libdfp / libdfp Goto Github PK
View Code? Open in Web Editor NEWDecimal Floating Point C Library
License: Other
Decimal Floating Point C Library
License: Other
=========================================================================== Libdfp The "Decimal Floating Point C Library" Developer's Guide for the GNU/Linux OS and GLIBC 2.10 Contributed by IBM Corporation Copyright (C) 2009-2014 Free Software Foundation =========================================================================== NOTE:Eight space tabs are the optimum editor setting for reading this file. =========================================================================== Author(s) : Ryan S. Arnold <[email protected]> Andreas Krebbel <[email protected]> Date Created: July 14, 2009 Last Changed: January 21, 2010 --------------------------------------------------------------------------- Table of Contents: 1. Introduction 1.1. ISO/IEC TR 24732 1.2. IEEE 754-2008 (DPD & BID Encodings) 1.3. Backends (libdecnumber & libbid) 2. Availability 3. Compliance With ISO/IEC TR 24732 3.1 __STDC_WANT_DEC_FP__ 3.2 scanf 4. Dependencies 4.1 GNU/Linux OS 4.2 GLIBC Minimum Version 4.3 GLIBC Headers 4.4 libdecnumber 4.5 GCC With --enable-decimal-float Support 4.6 Autoconf & GNU Make 5. Configuration 5.1 Configure Switches 6. Source Tree Layout 7. Make Rules 8. Adding New Functions (API changes) (TODO) 8. Precision (TODO) 9. Testing (make check) (TODO) 10. Contribution Checklist (TODO) 11. Coding Style (TODO) 12. DFP ABI (TODO) 13. Division of Responsibility With GCC (TODO) A. History B. Acknowledgements --------------------------------------------------------------------------- 1. Introduction The "Decimal Floating Point C Library" is an implementation of ISO/IEC Technical report "ISO/IEC TR 24732" which describes the C-Language library routines necessary to provide the C library runtime support for decimal floating point data types introduced in IEEE 754-2008, namely _Decimal32, _Decimal64, and _Decimal128. --------------------------------------------------------------------------- 1.1. ISO/IEC TR 24732 The latest description of ISO/IEC TR 24732 at the time of this writing can be found here: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1312.pdf A rationale can be found here: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1242.pdf And the last draft for new standard can be found at: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1775.pdf --------------------------------------------------------------------------- 1.2. IEEE754-2008 (DPD & BID Encodings) IEEE 754-2008 defines two different encodings for the decimal floating point data types. These are DPD and BID. DPD (Densely Packed Decimal) - IBM sponsored encoding (implemented in hardware). BID (Binary Integer Decimal) - Intel sponsored encoding. A simple explanation of the general overview of Decimal Floaing Point can be found at http://speleotrove.com/decimal/decbits.pdf The BID format encoding general explanation can be found at BID - Binary-Integer Decimal Encoding for Decimal Floating Point | Ping Tak Peter Tang http://m1.archiveorange.com/m/att/KGyKy/ArchiveOrange_Ps0PWkD0ZgCLBVQYnJEcnXblPpEa.pdf Both encodings can be investigated in the draft IEEE754r: http://754r.ucbtest.org/drafts/archive/2006-10-04.pdf --------------------------------------------------------------------------- 1.3. Backends (libdecnumber & libbid) Libdfp use of "libdecnumber" backend library for software emulation. Libdecnumber was written by Mike Cowlishaw (IBM) and a form of the library was donated to the FSF where it was subsumed into GCC. The Free Software Foundation assigned GCC as the owner of libdecnumber and now any project that needs to include libdecnumber statically needs to pull it from the GCC source trees. All patches to libdecnumber should be sent to GCC. This library's copy of libdecnumber should be periodically synced with upstream GCC's version. This syncing is the responsibility of the Libdfp maintainer. --------------------------------------------------------------------------- 2. Availability Libdfp attempts to provide an encoding agnostic API to users based upon the _Decimal32, _Decimal64, and _Decimal128 data-types. Libdfp is available to be configured in the following combinations: Arch HW|SW Backend Encoding ------------------------------------------------- ppc970 SW libdecnumber DPD POWER4 SW libdecnumber DPD POWER SW libdecnumber DPD POWER6 HW libdecnumber DPD POWER7 HW libdecnumber DPD S/390 z9-109 SW libdecnumber DPD S/390 z9-ec HW libdecnumber DPD S/390 z10 HW libdecnumber DPD TODO: ------------------------------------------------- x86 SW libdecnumber DPD | BID x86_64 SW libdecnumber DPD | BID The selection of a backend and/or an encoding is made at configuration time by the distro maintainer or person building libdfp using configuration flags described in the section entitled "Configuration". A summary with information regarding "libdecnumber" and Decimal Floating Point in general can be found at: http://speleotrove.com/decimal/ --------------------------------------------------------------------------- 3. Compliance With ISO/IEC TR 24732 This section covers issues related to compliance with ISO/IEC TR 24732. --------------------------------------------------------------------------- 3.1 __STDC_WANT_DEC_FP__ The standard ISO/IEC TR 24732 indicates that programs that wish to use Decimal Floating Point should define the following macro: __STDC_WANT_DEC_FP__ There is no set value for this macro. Simply passing -D__STDC_WANT_DEC_FP__ on compilation, or defining it in your program should suffice: #define __STDC_WANT_DEC_FP__ This macro is REQUIRED when including dfp/math.h dfp/fenv.h, etc to pick up the DFP function prototypes and data types defined in these headers. --------------------------------------------------------------------------- 3.2 scanf Libdfp does not, and will not comply with the TR 24732 requirement for the addition of scanf in support of decimal floating point data types. The strtod[32|64|128] functions can be used for the same purpose without the implications of scanf. This is main due the fact GLIBC does not support scanf hooks as it does for printf. --------------------------------------------------------------------------- 3.3 printf Libdfp supports the addition of the printf format codes indicated by TR 24732. GLIBC proper owns the printf implementation. Libdfp utilizes the printf-hooks mechanism provided by GLIBC to register support of the DFP format codes. The fully functional printf-hooks mechanism was debuted in GLIBC 2.10. --------------------------------------------------------------------------- 4. Dependencies --------------------------------------------------------------------------- 4.1 GNU/Linux OS Libdfp is only enabled to work on the GNU/Linux OS. --------------------------------------------------------------------------- 4.2 GLIBC Minimum Version Libdfp version 1.0.0 relies upon a minimum GLIBC 2.10 for printf-hooks support. The libdfp configure stage will check the libc that it is linked against for the printf-hook support and will warn if it is not found. --------------------------------------------------------------------------- 4.4 libdecnumber The libdecnumber library has it's own configure and Makefile fragments. This is so that it can be built from within any source tree simply by passing the necessary configure flags. In reality it's a bit more complicated. The libdecnumber library requires the --enable-decimal-float flag when being configured. This pushes this requirement upon the top level Libdfp 'configure'. Sadly this is necessary because Autoconf doesn't allow passing flags to AC_CONFIG_SUBDIRS. It only passes the --with and --enable flags of the parent configure fragment to the child, therefore the parent needs to have all the flags used by the child. We used the --enable-decimal-float flag to indicate which encoding to use, DPD or BID. The following are valid: --enable-decimal-float=dpd --enable-decimal-float=bid --enable-decimal-float=yes {uses the host default encoding} Specifying --enable-decimal-float=no simply defaults to the host default encoding as well. Some of the files in the Libdfp top directory are symlinked to the actual files in the ./scripts directory. This is because libdecnumber lives in the GCC source tree and GCC doesn't use AC_CONFIG_AUX_DIR([scripts]) but Libdfp DOES. This is required so that libdecnumber/configure.ac -> configure works properly. --------------------------------------------------------------------------- 4.5 GCC With --enable-decimal-float Support There's a dependency on a version of GCC which supports Decimal Floating Point. Use the following to determine if your compiler supports it: gcc -v 2>&1 | grep "\-\-enable\-decimal\-float" If decimal floating point support is not available in your compiler the libdfp configure stage will fail with a warning. Between GCC 4.3 and GCC 4.5 the compiler exported constant __DEC32_DENORMAL_MIN__ was changed to __DEC32_SUBNORMAL_MIN__. Libdfp now uses __DEC32_SUBNORMAL_MIN__. If you see errors like the following then you need to upgrade your compiler: error: '__DEC32_SUBNORMAL_MIN__' undeclared (first use in this function) --------------------------------------------------------------------------- 4.6 Autoconf & GNU Make This Library uses Autoconf to generate GNU Makefiles from Makefile.in templates and NOT Automake because Automake is incapable of selecting .S or .c source files from an override directory. Automake is poorly suited for system libraries which require flexibility based on assembler code overrides and submachine architecture overrides. Automake demands that the target file list be statically defined. If you need to re-run autoreconf -i you need to use Autoconf version 2.59 because libdecnumber explicitly requires it. Here's a hint on how to use a particular autoconf version: PATH=/usr/local/autoconf-2.59/bin/:$PATH autoreconf -i This of course requires that you've installed Autoconf version 2.59 with --prefix=/usr/local/autoconf-2.59/ Some of the Makefile machinery was inspired by the GLIBC Makefiles, beautifully written by Roland McGrath since this library was originally a GLIBC add-on. --------------------------------------------------------------------------- 5. Configuration Standalone libdfp requires that your build directory be separate from the source directory. Invoke the source directory's 'configure' script from within the build directory, e.g. /home/$USER/stage_libdfp/build/$ ../libdfp/configure --------------------------------------------------------------------------- 5.1 Configure Switches Environment Variables PATH Set the PATH environment variable. If this is specified and paths to CC, CXX, OBJDUMP, LDD, and GDB aren't defined, libdfp configure will search in $PATH for these binaries. CC [OPTIONAL: Picked up from $PATH if not specified.] Specify the C compiler to use to build libdfp and test cases. CXX [OPTIONAL: Picked up from $PATH if not specified.] Specify the C++ compiler to use for the Libdfp C++ compatibility tests cases. CFLAGS="-m64 -O2 -g" Since the default bitness of the compiler's generated binaries varies between Linux distros, and on some architectures the Kernel has a different bitness than the default user env it is recommended that the -m[31|32|64] flags be passed. These should accompany sympathetic --build switch described below, e.g. powerpc-linux-gnu for -m32 powerpc64-linux-gnu for -m64 For System Z (s390), depending on the cpu, Libdfp's configure.ac will append a -mzarch flag onto CFLAGS automatically. This is a special flag required to enable hardware DFP on some System Z cpus. ASFLAGS Libdfp's Makefile.in will pull -g or -m[31|32|64] into ASFLAGS if it is specified in CFLAGS. If you need anything else, pass it in here and it'll be added. CXXFLAGS [Only needed for the C++ compatibility test suite.] This should generally match the CFLAGS (for the most part). CPPFLAGS Use this to pass specific flags to the C Preprocessor. OBJDUMP [OPTIONAL: Picked up from $PATH if not specified.] Specify the objdump binary to use to generate the debug scripts. LDD [OPTIONAL: Picked up from $PATH if not specified.] Specify the ldd to use to generate the debug scripts. GDB [OPTIONAL: Picked up from $PATH if not specified.] Specify the gdb to use to debug the test cases. Libdfp's default configure will be based on whatever bitness the user environment is. In order to build 32-bit libdfp you can pass the following switch: --build=powerpc-linux-gnu In order to build 64-bit libdfp you can pass the following switch: --build=powerpc64-linux-gnu --prefix=/opt/foo [OPTIONAL] Override the default system prefix, e.g. if you want to install into /opt/ for some reason specify: --prefix=/opt/libdfp/. --libdir=/usr/lib64 [REQUIRED if you want to install 64-bit libs into lib64/] [OPTIONAL] Override the default '<foo>/lib' library path on installation. If you've already used --prefix=/opt/foo and you need t install a 64-bit libdfp into lib64/ then you need: --prefix=/opt/foo --libdir=/opt/foo/lib64/ In otherwords, libdir REPLACES the path "<prefix>/lib" on installation it doesn't concatenate onto "<prefix>" --with-glibc-headers=/home/$USER/stage_libdfp/glibc-2.10-headers [REQUIRED if your toolchain has GLIBC version less than 2.10] --with-glibc-build=/home/$USER/stage_glibc/build/glibc64_power6/ [OPTIONAL] If you want to run make check but your system GLIBC isn't version 2.10 you need to pass the location of a temporary GLIBC build-dir (not install dir) where that GLIBC meets or exceeds version 2.10. Not passing this switch tells the make check system to simply use the system GLIBC. WARNING: Make sure you link to a GLIBC build that supports the same configure options as how you're configuring libdfp, e.g. if you're configuring for 'power6' 64-bit, make sure that the GLIBC build you link against is a 64-bit. It doesn't have to be tuned for power6 but it should be able to execute properly. --with-cpu={power5|power6|power7|<etc>} [OPTIONAL] Use this if you want the compiler to optimize the generated code for a particular processor. This also causes the libdfp build infrastructure to choose architecture specific overrides from the sysdeps tree. For most scenarios, running configure without any extra parameters will do the right thing, e.g: ../libdfp/configure | tee _configure Here are some more complicated configurations of libdfp linking an alternate GLIBC: 64-bit PowerPC (soft-dfp) using the libdecnumber backend and dpd encoding: CC=/opt/at4.0/bin/gcc CFLAGS="-m64 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m64 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --libdir=/usr/lib64/ \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc64-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc64_power5 \ 2>&1 | tee _configure64_power5 64-bit PowerPC POWER6 (hard-dfp) using libdecnumber backend and dpd encoding: We only need the --with-cpu=power6 flag for power6 support and hardware-dfp: CC=/opt/at4.0/bin/gcc CFLAGS="-m64 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m64 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --libdir=/usr/lib64/ \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc64-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc64_power6 \ --with-cpu=power6 2>&1 | tee _configure64_power6 64-bit PowerPC POWER7 (hard-dfp) using libdecnumber backend and dpd encoding: We only need the --with-cpu=power7 flag for power7 support and hardware-dfp: CC=/opt/at4.0/bin/gcc CFLAGS="-m64 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m64 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --libdir=/usr/lib64/ \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc64-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc64_power7 \ --with-cpu=power7 2>&1 | tee _configure64_power7 32-bit PowerPC (soft-dfp) using the libdecnumber backend and dpd encoding: CC=/opt/at4.0/bin/gcc CFLAGS="-m32 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m32 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc32_power5 \ 2>&1 | tee _configure32_power5 Or 32-bit POWER6 (hard-dfp): CC=/opt/at4.0/bin/gcc CFLAGS="-m32 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m32 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc32_power6 \ --with-cpu=power6 2>&1 | tee _configure32_power6 Or 32-bit POWER7 (hard-dfp): CC=/opt/at4.0/bin/gcc CFLAGS="-m32 -O2 -g" \ CXX=/opt/at4.0/bin/gcc CXXFLAGS="-m32 -O2 -g" \ ~/eglibc/eglibc/libdfp/trunk/configure \ --with-glibc-headers=~/ppc64-tc-utils/trunk/libdfp/include-2.10/ \ --build=powerpc-linux-gnu \ --with-glibc-build=~/glibc-2.11/build/glibc32_power7 \ --with-cpu=power7 2>&1 | tee _configure32_power7 --------------------------------------------------------------------------- 6. Source Tree Layout The Libdfp configure script is responsible for building the search order that is used by the Make system for selecting files out of the source tree. The configure script automatically knows how to search for base_machine (e.g. powerpc) machine (e.g. powerpc32) submachine (e.g. power6, power7) It also recognizes the following special directories when they show up following any of the previous *machine directories: fpu nofpu dfpu bits It hard-searches for the following sysdep directories based upon configuration settings: bid dpd soft-dfp And it knows how to find the common files stored in the convenience directories: ieee754r base-math The top of the search list is the commond libdfp internal header files: ${srcdir}/include. Anything in these directories should be ABSOLUTELY COMMON since you can't get a header earlier than in the ${srcdir}/include directory. If you need to override something in ${srcdir}/include then you may need to move the headers out of this directory and into the sysdeps tree. Header files that are used when building libdfp, but also provided by libdfp and installed in the prefix directory are in the following directory: ${srcdir}/dfp The sysdeps tree is searched and relevant directory depth takes precedence. ${srcdir}/include [internal libdfp headers] ${srcdir}/libdecnumber/dpd [libdecnumber headers] ${srcdir}/libdecnumber/bid [libdecnumber headers] ${srcdir}/libbid/? [libbid headers] [MACHINE/SUBMACHINE] ${srcdir}/sysdeps/powerpc/powerpc64/power7/fpu [platform directories] ${srcdir}/sysdeps/powerpc/powerpc64/power7/ ${srcdir}/sysdeps/powerpc/powerpc64/power6/fpu [platform directories] ${srcdir}/sysdeps/powerpc/powerpc64/power6/ ${srcdir}/sysdeps/powerpc/powerpc64/ ${srcdir}/sysdeps/powerpc/powerpc32/power6/fpu [platform directories] ${srcdir}/sysdeps/powerpc/powerpc32/power6/ ${srcdir}/sysdeps/powerpc/powerpc32/ [BASE_MACHINE/[FPU|NOFPU|BITS]] ${srcdir}/sysdeps/powerpc/fpu ${srcdir}/sysdeps/powerpc/fpu/bits ${srcdir}/sysdeps/powerpc/nofpu ${srcdir}/sysdeps/powerpc/nofpu/bits [BASE_MACHINE] ${srcdir}/sysdeps/powerpc/ ${srcdir}/sysdeps/i386/ [ENCODING] ${srcdir}/sysdeps/dpd [dpd specific implementations] ${srcdir}/sysdeps/bid [bid specific implementations] [SOFT-DFP ENCODING OVERRIDES[DPD|BID]] ${srcdir}/sysdeps/soft-dfp/dpd [soft-dfp dpd arithmetic, conversion, and comparison fns] ${srcdir}/sysdeps/soft-dfp/bid [soft-dfp bid arithmetic, conversion, and comparison fns] ${srcdir}/sysdeps/soft-dfp [soft-dfp arithmetic, conversion, and comparison fns] ${srcdir}/dfp [headers files that will be installed. These follow the sysdep overrides so that sysdeps override directories show up before the install headers in #include_next <header>. ${srcdir}/ieee754r [ISO C Draft TR functions] ${srcdir}/base-math [Arithmetic, Conversion, and Comparison Routines.] ${srcdir}/[common libdfp framework code & common headers for the backends.] Out of Tree Sources ${srcdir}/libdecnumber [third-party GCC sources] ${srcdir}/libbid [third-party libBID sources] --------------------------------------------------------------------------- 7. Make Rules make [all (default)] DEPENDENCIES: GLIBC headers: The location of the companion GLIBC 2.10 (or greater) headers as passed to configure using the --with-glibc-headers switch. make check DEPENDENCIES: GLIBC build: The location of a companion GLIBC 2.10 (or greater) build (prior to make install) that is to be linked against during the make check run. This is required because the printf-hooks feature that is necessary for printing _Decimal[32|64|128] numbers is only in GLIBC 2.10 and later. This isn't necessary if the system GLIBC is version 2.10 or later. The path to the build was passed to configure using the --with-glibc-build switch. make install [DESTDIR=<path>] [DESTDIR] (Optional) : Install to <path>/$prefix. This is used by libdfp developers and distro builders so that they can build libdfp and install it to an alternate location in preparation for packaging. make install-headers [DESTDIR=<path>] [DESTDIR] (Optional) : Install libdfp headers into <path>/$prefix/include/dfp. This is used by application or library developers whose projects depend on libdfp who don't want to install libdfp proper or may not have permission to do so. make clean [TODO] make distclean --------------------------------------------------------------------------- 8. Adding New Functions (API changes) (TODO) Libdfp versioning uses the following convention: major.minor.revision New functions must ALWAYS be added to the next revision number of the library. For instance, if the maintainer has designated the current release at 1.0.8 new function should be added to 1.0.9. Then, when the maintainer increments the library to 1.0.9 the new functions will become available. --------------------------------------------------------------------------- Appendices --------------------------------------------------------------------------- A. History Libdfp was designed by Ryan S. Arnold (IBM), Janis Johnson (IBM), and Steven J. Munroe (IBM) in 2006. Libdfp was originally written as a GLIBC add-on by Ryan S. Arnold <[email protected]> and Joseph Kerian <[email protected]> in 2006 and contributed to the Free Software Foundation by IBM in 2007. Janis Johnson <[email protected]> provided the initial versions of the arithmetic, conversion, and comparison routines. The libdecnumber library was originaly contributed to GCC by IBM and written by Mike Cowlishaw. Its inclusion into GCC was negotiated in 2005/2006 and it was pulled into Libdfp as a utility library shortly thereafter. GLIBC proper declined to include Libdfp upstream on the grounds that ratification of the DFP technical report had not taken place so... Libdfp was ported to EGLIBC by Pete Eberlein <[email protected]> in 2007. System 390 support was added by Andreas Krebbel <[email protected]> starting in 2008. Ryan S. Arnold (with the help of Andreas Krebbel) ported Libdfp into a stand-alone library in 2009. --------------------------------------------------------------------------- B. Acknowledgements Thanks to Ulrich Drepper and the GLIBC folks since we used much of the GLIBC macro black magic, math routines, string-to-float conversions, and printf_fp code as a basis for the corresponding decimal floating point forms. Thanks to Roland McGrath for his wild Makefile foo in GLIBC. Ryan used a lot of that as inspiration for Libdfp's Makefiles. Thanks to everyone at IBM (past and present) who worked on Libdfp. Thanks to Jeff Bailey for helping Ryan grok Autoconf and GNU Make. His examples on SUFFIXES rules were invaluable in getting the stand-alone Libdfp make files into a functional form. Thanks to EGLIBC (eglibc.org) for hosting Libdfp when it was a GLIBC add-on and for hosting the stand alone version as well. Thanks to Michael Matz (SuSE) for help getting the initial packaging for Libdfp straightened out.
When built against a target with hardware dfp, The GCC callouts for soft-dfp functions (https://gcc.gnu.org/onlinedocs/gccint/Decimal-float-library-routines.html) are mostly inlined.
Libdfp builds these functions to provide compatibility with libraries built against soft-dfp but may be run against a library with hardware support on targets which implement dfp in hardware.
Some basic tests should be added to perform basic sanity tests of these functions. E.g the target compiler is correctly inlining the code, or the target specific override behaves correctly.
The build system does not check included for files, leaving incremental builds in broken states.
Test: log10 (3.141592653589793238462643383279503)
Result:
is: 4.97149872694133800000e-01 4.971498726941338e-01
should be: 4.97149872694133900000e-01 4.971498726941339e-01
difference: 1.00000000000000000000e-16 1.000000000000000e-16
ulp : 1.0000
max.ulp : 1.0000
Libdecnumber doesn't appear to be used, but it is about 3 years behind gcc. On x86_64 / BID encoding, the endian is swapped, so it doesn't work with the current gcc _DecimalXX encoding. The gcc version of libdecnumber does works with the builtin type. I've pulled out libdecnumber from gcc here: https://github.com/raitechnology/libdecnumber
I'm not sure of the gcc status of _DecimalXX, since the g++ 8 distributed with FC28 no longer has _DecimalXX types unless I'm missing an cmd line option (disabled in favor of std::decimal ??).
I can merge the libgcc version into libdfp and do a pull request if that is useful.
Excerpt from @jsm28:
Any libdfp integration in glibc would I expect also look very different,
as regards build system and general integration, from either the present
build system or the old add-on version. For example, functions would be
declared directly in the relevant headers under appropriate __GLIBC_USE
conditionals (in bits/mathcalls.h in many cases - most functions should be
present for both binary and decimal types). Tests would use the libm-test
/ auto-libm-test machinery, adapted as necessary to support DFP; the vast
bulk of test inputs to most functions should be applicable to both binary
and decimal floating point. (The actual function implementations would I
expect not need changing much for glibc.)
Source: https://sourceware.org/ml/libc-alpha/2017-09/msg00823.html
Hi,
when building libdfp 1.0.14 on ppc64el, ppc64 and powerpc on current debian unstable (gcc 8.3), the test test-cast-to-underflow fails. Here is an extract on ppc64el :
21 Error: Expected: "0x0p+0"
Result: "0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:143
22 Error: Expected: "-0x0p+0"
Result: "-0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:144
29 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:151
30 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:153
31 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:155
32 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:156
45 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:169
46 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:171
59 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:186
60 Error: Expected: "-0x0.0000000000002p-1022"
Result: "-0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:188
73 Error: Expected: "0x0.0000000000002p-1022"
Result: "0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:203
74 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:205
83 Error: Expected: "0x0p+0"
Result: "0x1p-149"
in: ./tests/test-cast-to-underflow.c:219
84 Error: Expected: "-0x0p+0"
Result: "-0x1p-149"
in: ./tests/test-cast-to-underflow.c:220
91 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:227
92 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:229
93 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:231
94 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:232
95 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:233
96 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:234
109 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:247
110 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:249
111 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:251
112 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:252
123 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:264
124 Error: Expected: "-0x1p-148"
Result: "-0x1p-149"
in: ./tests/test-cast-to-underflow.c:266
125 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:268
126 Error: Expected: "-0x1p-148"
Result: "-0x1p-149"
in: ./tests/test-cast-to-underflow.c:269
137 Error: Expected: "0x1p-148"
Result: "0x1p-149"
in: ./tests/test-cast-to-underflow.c:281
138 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:283
139 Error: Expected: "0x1p-148"
Result: "0x1p-149"
in: ./tests/test-cast-to-underflow.c:285
140 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:286
145 Error: Expected: "0x0p+0"
Result: "0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:295
146 Error: Expected: "-0x0p+0"
Result: "-0x0.0000000000001p-1022"
in: ./tests/test-cast-to-underflow.c:296
195 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: ./tests/test-cast-to-underflow.c:349
196 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: ./tests/test-cast-to-underflow.c:350
Found 36 failures.
Fred
decimal32 and decimal64 have high ulps (15 and 13 respectively) with the input 88.72269439697265625.
It's happening on ppc64 and ppc64le, with different distributions.
Output of test-fabs-d128:
Failure: Test: fabs (-42)
Result:
is: -4.20000000000000000000e+01 -4.2000000000000000000000000000000000e+01
should be: 4.20000000000000000000e+01 4.2000000000000000000000000000000000e+01
difference: -8.40000000000000000000e+01 -8.4000000000000000000000000000000000e+01
ulp : -8400000000000000000000000000000000.0000
max.ulp : 0.0000
Failure: Test: fabs (-2.718281828459045235360287471352662)
Result:
is: -2.71828182845904523536e+00 -2.7182818284590452353602874713526620e+00
should be: 2.71828182845904523536e+00 2.7182818284590452353602874713526620e+00
difference: -5.43656365691809047072e+00 -5.4365636569180904707205749427053240e+00
ulp : -5436563656918090470720574942705324.0000
max.ulp : 0.0000
TS 18661-2 states it should be equivalent to x * 10 ^ y.
I noticed this recently, but it seems to be affecting older revisions.
I was able to reproduce it on Debian 8. The kernel is ppc64, but I was building for ppc.
configure --build=powerpc-linux --host=powerpc-linux
...
$ cat check-localplt.out
Extra PLT reference: libdfp.so: register_printf_dfp@@LIBDFP_1.0.0
Missing required PLT reference: libdfp.so: register_printf_dfp
The existing long double <-> _Decimal128 conversion functions assume IBM long double. This is not always correct.
"./configure && make && make check" Running on a POWER8 RHEL7.1 LE, and BE host:
LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions 2> ./test-bfp-conversions.out 1> /dev/null /bin/sh: line 1: 16985 Segmentation fault LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions 2> ./test-bfp-conversions.out > /dev/null make: *** [test-bfp-conversions.out] Error 139
On a POWER8 Ubuntu 14.04 LE host (Not a segfault, likely the same as Issue 3):
gcc -DSHARED -O2 -fpic -g -DNOT_IN_libdfp -I../tests -Wl,--no-as-needed ./test-bfp-conversions.os -o test-bfp-conversions -lc -lm -L./ -ldfp LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions 2> ./test-bfp-conversions.out 1> /dev/null make: *** [test-bfp-conversions.out] Error 137
On a POWER8 SLES 12 host:
gcc -DSHARED -O2 -fpic -g -DNOT_IN_libdfp -I../tests -Wl,--no-as-needed ./test-bfp-conversions.os -o test-bfp-conversions -lc -lm -L./ -ldfp LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions 2> ./test-bfp-conversions.out 1> /dev/null /bin/sh: line 1: 15991 Segmentation fault LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions 2> ./test-bfp-conversions.out > /dev/null Makefile:391: recipe for target 'test-bfp-conversions.out' failed make: *** [test-bfp-conversions.out] Error 139
These are built from SHA 05ec25f when testing for release improvements.
x86-64 expects these to be return as a long. This causes strange and confusing failures when gcc performs comparisons. I.e -1 < 0.
This appears to be an issue with the return type of the comparison functions as the word size on x86-64 is not the same size as an int.
Seems like we have lots of trailing white spacing and the code is not standardized (looks like GNU, but there's lots of things that doesn't follow the code standard). I am creating a task to check what standard to follow and fix accordingly.
O.S. : Centos7 64 bits
GCC : 4.9.3
libdfp: master
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <fenv.h>
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>
main()
{
_Decimal64 a = 9.853946746503084DD;
printf("%Da * 1000 = %Da\n", a, a * 1000.0DD);
return 0;
}
result :
9.853946746503084 * 1000 = 98539467.46503084
long double
type should, depending on the rounding mode, return INFINITY
when overflow instead, it returns NaN. For example, the attached test converting 1e1000DL
to long double
produces (on POWER8 little-endian):
#include <fenv.h>
#include <float.h>
#include <math.h>
int
main (void)
{
volatile long double;
volatile _Decimal128 a = 1e1000DL;
fesetround (FE_TONEAREST);
b = (long double) a;
return b != INFINITY;
}
The expected result should be inf
instead nan
.
At least some libdfp conversions between decimal and binary types wrongly convert values in the subnormal range of the target type to zero instead of a subnormal. For example, for conversions from _Decimal128 to double, the attached test (on POWER8 little-endian) outputs:
0x0.012688b70e62bp-1022 0x0p+0
whereas if I use the libgcc conversions I get the expected:
0x0.012688b70e62bp-1022 0x0.012688b70e62bp-1022
subnormal.txt
This is generating a value with ~3 million ULPS, or more likely, a wrong value.
Hi,
while compiling on s390x, I noticed several tests failing.
Note that this was done on a qemu guest, on Debian Unstable (I'm maintaining the Debian package).
Hardening was disabled and test ouput should be displayed within the log.
Here is the build log :
F.
Hi,
on ppc64 (Debian Unstable) and libdfp 1.0.13 with the hardening flag -fstack-protector-strong, this test only fails.
Can you help ? Thanks.
Here is the log of the test :
gcc -DSHARED -O2 -Werror=format-security -Wformat -fdebug-prefix-map=/home/ubuntu/libdfp/libdfp-1.0.13=. -fpic -fstack-protector-strong -g -mno-hard-dfp -DNOT_IN_libdfp -I../tests -Wl,--no-as-needed -Wdate-time -D_FORTIFY_SOURCE=2 -MT test-bfp-conversions.os -MD -MP -MF test-bfp-conversions.d -c ../tests/test-bfp-conversions.c -D__STDC_DEC_FP__=200704L -D__STDC_WANT_DEC_FP__=1 -DOPTION_EGLIBC_LOCALE_CODE=1 -std=gnu99 -D_ISOC99_SOURCE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-long-long -include ./config.h -include ../include/libdfp-symbols.h -I../include -I../dfp -I../dfp/decimal -I../libdecnumber/dpd -I../libdecnumber -I../sysdeps/powerpc/powerpc64 -I../sysdeps/powerpc/fpu/bits -I../sysdeps/powerpc/fpu -I../sysdeps/powerpc -I../sysdeps/soft-dfp/dpd -I../sysdeps/soft-dfp -I../sysdeps/dpd -I../sysdeps/generic -I../decNumberMath/ -I../ieee754/ -I../base-math/ -I.. -I. -o test-bfp-conversions.os
gcc -DSHARED -O2 -Werror=format-security -Wformat -fdebug-prefix-map=/home/ubuntu/libdfp/libdfp-1.0.13=. -fpic -fstack-protector-strong -g -mno-hard-dfp -DNOT_IN_libdfp -I../tests -Wl,--no-as-needed ./test-bfp-conversions.os -o test-bfp-conversions -lc -lm -L./ -ldfp
LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./test-bfp-conversions
1.234500e+01 = (_Decimal32) 1.234500e+01; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,012,345E-3
retval: +1,234,500E-5
1 Success: Expected: "1.234500e+01"
Result: "1.234500e+01"
in: ../tests/test-bfp-conversions.c:45
1.234568e+01 = (_Decimal32) 1.234568e+01; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +1,234,568E-5
retval: +1,234,568E-5
2 Success: Expected: "1.234568e+01"
Result: "1.234568e+01"
in: ../tests/test-bfp-conversions.c:46
1.234567e+05 = (_Decimal32) 1.234567e+05; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +1,234,567E-1
retval: +1,234,567E-1
3 Success: Expected: "1.234567e+05"
Result: "1.234567e+05"
in: ../tests/test-bfp-conversions.c:47
9.999999e+05 = (_Decimal32) 9.999999e+05; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +9,999,999E-1
retval: +9,999,999E-1
4 Success: Expected: "9.999999e+05"
Result: "9.999999e+05"
in: ../tests/test-bfp-conversions.c:48
2.000000e+00 = (_Decimal32) 2.000000e+00; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,020E-1
retval: +0,000,002E+0
5 Success: Expected: "2.000000e+00"
Result: "2.000000e+00"
in: ../tests/test-bfp-conversions.c:49
3.000000e+01 = (_Decimal32) 3.000000e+01; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,300E-1
retval: +0,000,030E+0
6 Success: Expected: "3.000000e+01"
Result: "3.000000e+01"
in: ../tests/test-bfp-conversions.c:50
1.000000e-20 = (_Decimal32) 1.000000e-20; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,010E-21
retval: +1,000,000E-26
7 Success: Expected: "1.000000e-20"
Result: "1.000000e-20"
in: ../tests/test-bfp-conversions.c:51
0.000000e+00 = (_Decimal32) 0.000000e+00; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,000E-1
retval: +0,000,000E-1
8 Success: Expected: "0.000000e+00"
Result: "0.000000e+00"
in: ../tests/test-bfp-conversions.c:52
3.402819e+38 = (_Decimal32) 3.402819e+38; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +3,402,819E+32
retval: +3,402,819E+32
9 Success: Expected: "3.402819e+38"
Result: "3.402819e+38"
in: ../tests/test-bfp-conversions.c:53
1.000000e+05 = (_Decimal32) 1.000000e+05; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +1,000,000E-1
retval: +0,100,000E+0
10 Success: Expected: "1.000000e+05"
Result: "1.000000e+05"
in: ../tests/test-bfp-conversions.c:54
9.999990e+05 = (_Decimal32) 9.999990e+05; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +9,999,990E-1
retval: +0,999,999E+0
11 Success: Expected: "9.999990e+05"
Result: "9.999990e+05"
in: ../tests/test-bfp-conversions.c:55
1.200000e-38 = (_Decimal32) 1.200000e-38; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,012E-39
retval: +1,200,000E-44
12 Success: Expected: "1.200000e-38"
Result: "1.200000e-38"
in: ../tests/test-bfp-conversions.c:56
1.100000e-38 = (_Decimal32) 1.100000e-38; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: +0,000,011E-39
retval: +1,100,000E-44
13 Success: Expected: "1.100000e-38"
Result: "1.100000e-38"
in: ../tests/test-bfp-conversions.c:57
-1.200000e-38 = (_Decimal32) -1.200000e-38; /* float */ in: ../tests/test-bfp-conversions.c: 374
expected: -0,000,012E-39
retval: -1,200,000E-44
14 Success: Expected: "-1.200000e-38"
Result: "-1.200000e-38"
in: ../tests/test-bfp-conversions.c:58
1.234500e+01 = (_Decimal64) 1.234500e+01; /* float */ in: ../tests/test-bfp-conversions.c: 388
expected: +1,234,500,026,702,881E-14
retval: +1,234,500,026,702,881E-14
15 Success: Expected: "1.234500e+01"
Result: "1.234500e+01"
in: ../tests/test-bfp-conversions.c:73
3.000000e+01 = (_Decimal64) 3.000000e+01; /* float */ in: ../tests/test-bfp-conversions.c: 388
expected: +0,000,000,000,000,300E-1
retval: +0,000,000,000,000,030E+0
16 Success: Expected: "3.000000e+01"
Result: "3.000000e+01"
in: ../tests/test-bfp-conversions.c:74
3.402819e+38 = (_Decimal64) 3.402819e+38; /* float */ in: ../tests/test-bfp-conversions.c: 388
expected: +3,402,819,004,255,176E+23
retval: +3,402,819,004,255,176E+23
17 Success: Expected: "3.402819e+38"
Result: "3.402819e+38"
in: ../tests/test-bfp-conversions.c:75
1.234500e+01 = (_Decimal128) 1.234500e+01; /* float */ in: ../tests/test-bfp-conversions.c: 402
expected: +1,234,500,026,702,880,859,375,000,000,000,000E-32
retval: +0,000,000,000,001,234,500,026,702,880,859,375E-20
18 Success: Expected: "1.234500e+01"
Result: "1.234500e+01"
in: ../tests/test-bfp-conversions.c:90
3.000000e+01 = (_Decimal128) 3.000000e+01; /* float */ in: ../tests/test-bfp-conversions.c: 402
expected: +0,000,000,000,000,000,000,000,000,000,000,300E-1
retval: +0,000,000,000,000,000,000,000,000,000,000,030E+0
19 Success: Expected: "3.000000e+01"
Result: "3.000000e+01"
in: ../tests/test-bfp-conversions.c:91
3.402819e+38 = (_Decimal128) 3.402819e+38; /* float */ in: ../tests/test-bfp-conversions.c: 402
expected: +3,402,819,004,255,175,794,749,548,566,449,886E+5
retval: +3,402,819,004,255,175,794,749,548,566,449,886E+5
20 Success: Expected: "3.402819e+38"
Result: "3.402819e+38"
in: ../tests/test-bfp-conversions.c:92
1.234568e+01 = (_Decimal64) 1.234568e+01; /* double */ in: ../tests/test-bfp-conversions.c: 416
expected: +0,000,000,123,456,789E-7
retval: +1,234,567,890,000,000E-14
21 Success: Expected: "1.234568e+01"
Result: "1.234568e+01"
in: ../tests/test-bfp-conversions.c:107
-2.000000e+00 = (_Decimal64) -2.000000e+00; /* double */ in: ../tests/test-bfp-conversions.c: 416
expected: -0,000,000,000,000,020E-1
retval: -0,000,000,000,000,002E+0
22 Success: Expected: "-2.000000e+00"
Result: "-2.000000e+00"
in: ../tests/test-bfp-conversions.c:108
1.797680e+308 = (_Decimal64) 1.797680e+308; /* double */ in: ../tests/test-bfp-conversions.c: 416
expected: +0,000,000,000,179,768E+303
retval: +1,797,680,000,000,000E+293
23 Success: Expected: "1.797680e+308"
Result: "1.797680e+308"
in: ../tests/test-bfp-conversions.c:109
1.000000e+14 = (_Decimal64) 1.000000e+14; /* double */ in: ../tests/test-bfp-conversions.c: 416
expected: +1,000,000,000,000,000E-1
retval: +0,100,000,000,000,000E+0
24 Success: Expected: "1.000000e+14"
Result: "1.000000e+14"
in: ../tests/test-bfp-conversions.c:110
1.000000e+15 = (_Decimal64) 1.000000e+15; /* double */ in: ../tests/test-bfp-conversions.c: 416
expected: +9,999,999,999,999,990E-1
retval: +0,999,999,999,999,999E+0
25 Success: Expected: "1.000000e+15"
Result: "1.000000e+15"
in: ../tests/test-bfp-conversions.c:111
1.234568e+01 = (_Decimal128) 1.234568e+01; /* double */ in: ../tests/test-bfp-conversions.c: 430
expected: +1,234,567,889,999,999,934,502,739,051,822,573E-32
retval: +1,234,567,889,999,999,934,502,739,051,822,573E-32
26 Success: Expected: "1.234568e+01"
Result: "1.234568e+01"
in: ../tests/test-bfp-conversions.c:126
-2.000000e+00 = (_Decimal128) -2.000000e+00; /* double */ in: ../tests/test-bfp-conversions.c: 430
expected: -0,000,000,000,000,000,000,000,000,000,000,020E-1
retval: -0,000,000,000,000,000,000,000,000,000,000,002E+0
27 Success: Expected: "-2.000000e+00"
Result: "-2.000000e+00"
in: ../tests/test-bfp-conversions.c:127
1.797680e+308 = (_Decimal128) 1.797680e+308; /* double */ in: ../tests/test-bfp-conversions.c: 430
expected: +1,797,679,999,999,999,908,416,854,000,763,986E+275
retval: +1,797,679,999,999,999,908,416,854,000,763,986E+275
28 Success: Expected: "1.797680e+308"
Result: "1.797680e+308"
in: ../tests/test-bfp-conversions.c:128
Segmentation fault
Makefile:413: recipe for target 'test-bfp-conversions.out' failed
make[1]: *** [test-bfp-conversions.out] Error 139
An user reported the following output from log10() as suspicious.
Investigate if they're fine or not.
Reproduced on power8.
Output:
4../test-log10-d64
...
Test: log10 (3.141592653589793238462643383279503)
Result:
is: 4.97149872694133800000e-01 4.9714987269413380e-01
should be: 4.97149872694133900000e-01 4.9714987269413390e-01
difference: 1.00000000000000000000e-16 1.0000000000000000e-16
ulp : 1.0000
max.ulp : 1.0000
...
5../test-log10-d128
...
Test: log10 (2.718281828459045235360287471352662)
Result:
is: 4.34294481903251827651e-01
4.3429448190325182765112891891660500e-01
should be: 4.34294481903251827651e-01
4.3429448190325182765112891891660510e-01
difference: -1.00000000000000000000e-34
-1.0000000000000000000000000000000000e-34
ulp : -1.0000
max.ulp : 1.0000
...
On ppc64el, there a failure on test-strtod :
$ cat test-strtod.out
104 Error: Expected: "+0,000,000,000,000,000E-398"
Result: "+5,000,000,000,000,000E-398"
in: ./tests/test-strtod.c:119.
Found 1 failures.
While working on PR #24, we noticed that a mistake should have caused the testsuite to failure but it didn't.
I could mean that:
This is used in place of __int128 arithmetic which is nominally available on any recent 64b GCC compiler.
GCC converts between BID <-> DPD <-> Decnumber. I am unsure which approach is better today. Denumber uses declets internally.
This value exceeds the log table lookup and suffers from undefined behavior.
I get this:
../sysdeps/s390/dfpu/fe_decround.c: Assembler messages:
../sysdeps/s390/dfpu/fe_decround.c:56: Error: Unrecognized opcode: `srnmt'
make: *** [fe_decround.o] Error 1
This happens with binutils 2.28-8.el7 (from devtoolset-7-binutils-2.28-8.el7.s390x) and gcc 7.2.1 (from devtoolset-7-gcc-7.2.1-1.el7.s390x).
At least some libdfp conversions between decimal and binary types wrongly always produce an infinity for obviously overflowing results, without taking account of the rounding mode (the relevant rounding mode is that for the radix of the target type, not the source type). For example, the attached test converting 1e1000DL to double produces (on POWER8 little-endian):
inf
but the expected result, as with the libgcc conversions, is:
0x1.fffffffffffffp+1023
overflow.txt
At least some libdfp conversions between decimal and binary types wrongly clear the "inexact" exception when it was raised before the conversion; the exception flag bits are sticky and should not be cleared except by a few functions such as feclearexcept. For example, the attached test prints
inexact wrongly cleared
instead of the expected
inexact still raised as expected
that it does with the libgcc conversions.
testinex2.txt
It would be nice to extend support for TS 18661-2.
This will require fixing up the headers to honor new feature tests, and implement new API. I see the following API which is missing:
nextdowndN
nextupdN
canonicalizedN
fmaxmagdN
fminmagdN
totalordermagdN
totalorderdN
ufromfpdN
fromfpdN
fromfpxdN
ufromfpxdN
setpayloadsigdN
setpayloaddN
getpayloaddN
encodedecdN
decodedecdN
encodebindN
decodebindN
Where N is 32, 64, and 128.
And narrowing functions where sizeof(M) < sizeof(N):
dMadddN
dMsubdN
dMmuldN
dMdivdN
dMfmadN
dMsqrtdN
Likewise, missing are the stdlib string functions:
strfromdN
An user reported the following suspicious output for log().
Reproduced on power8.
Output:
2../test-log-d64
...
Test: log (2.718281828459045235360287471352662)
Result:
is: 9.99999999999999900000e-01 9.9999999999999990e-01
should be: 1.00000000000000000000e+00 1.0000000000000000e+00
difference: 1.00000000000000000000e-16 1.0000000000000000e-16
ulp : 0.1000
max.ulp : 0.0000
...
3../test-log-d128
...
Test: log (2.718281828459045235360287471352662)
Result:
is: 1.00000000000000000000e+00
9.9999999999999999999999999999999980e-01
should be: 1.00000000000000000000e+00
1.0000000000000000000000000000000000e+00
difference: -2.00000000000000000000e-34
-2.0000000000000000000000000000000000e-34
ulp : -0.2000
max.ulp : 0.0000
...
At least some libdfp conversions between decimal and binary types wrongly always produce a zero for obvious underflowing results, without taking account of the rounding mode (the relevant rounding mode is that for the radix of the target type, not the source type). For example, the attached test converting 1e-1000DL to double produces (on POWER8 little-endian):
0x0p+0
but the expected result, as with the libgcc conversions, is:
0x0.0000000000001p-1022
underflow.txt
When configuring libdfp on s390x with z10 CPU setting, the package fails to build from source:
$ make
find: ‘./sysdeps/s390/dfpu/libdfp-test-ulps’: No such file or directory
find: ‘./sysdeps/s390/fpu/libdfp-test-ulps’: No such file or directory
find: ‘./sysdeps/s390/libdfp-test-ulps’: No such file or directory
find: ‘./sysdeps/dpd/libdfp-test-ulps’: No such file or directory
VPATH=./sysdeps/s390/dfpu:./sysdeps/s390/fpu:./sysdeps/s390:./sysdeps/dpd:./sysdeps/generic:./decNumberMath/:./ieee754r/:./base-math:./:./tests
Processing Makefiles: ./sysdeps/dpd/ ./decNumberMath/ ./ieee754r/ ./base-math
gcc -DSHARED -O2 -fpic -g -march=z10 -mzarch -MT floattitd.o -MD -MP -MF floattitd.d -c ./base-math/floattitd.c -D__STDC_DEC_FP__=200704L -D__STDC_WANT_DEC_FP__=1 -DOPTION_EGLIBC_LOCALE_CODE=1 -std=gnu99 -D_ISOC99_SOURCE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-long-long -include ./config.h -include ./include/libdfp-symbols.h -I./include -I./dfp -I./dfp/decimal -I./libdecnumber/dpd -I./libdecnumber -I./sysdeps/s390/dfpu -I./sysdeps/s390/fpu -I./sysdeps/s390 -I./sysdeps/dpd -I./sysdeps/generic -I./decNumberMath/ -I./ieee754/ -I./base-math/ -I. -I. -o floattitd.o
./base-math/floattitd.c:27:29: fatal error: convert_helpers.h: No such file or directory
compilation terminated.
Makefile:241: recipe for target 'floattitd.o' failed
make: *** [floattitd.o] Error 1
The following error happens on Ubuntu 14.04.4 ppc64el during "make check":
LC_ALL=C mawk -f scripts/localplt.awk libdfp.so.jmprel |
LC_ALL=C mawk -f scripts/check-localplt.awk ./sysdeps/generic/localplt.data -
> check-localplt.out
mawk: scripts/localplt.awk: line 76: regular expression compile failed (bad class -- [], [^] or [)
([^
mawk: scripts/localplt.awk: line 76: syntax error at or n]
mawk: scripts/localplt.awk: line 76: runaway regular expression /, "\1:", ...
make: *** [check-localplt.out] Error 1
Ubuntu 14.04.4 has mawk-1.3.3-17ubuntu2 as its AWK interpreter. Perhaps ./configure should look for gawk instead. Or update awk scripts to make them compatible with both mawk and gawk.
test-log-d64:
Test: log (2.718281828459045235360287471352662)
Result:
is: 9.99999999999999900000e-01 9.999999999999999e-01
should be: 1.00000000000000000000e+00 1.000000000000000e+00
difference: 1.00000000000000000000e-16 1.000000000000000e-16
ulp : 0.1000
max.ulp : 0.0000
test-log-d128:
Test: log (2.718281828459045235360287471352662)
Result:
is: 1.00000000000000000000e+00 9.999999999999999999999999999999998e-01
should be: 1.00000000000000000000e+00 1.000000000000000000000000000000000e+00
difference: 2.00000000000000000000e-34 2.000000000000000000000000000000000e-34
ulp : 0.2000
max.ulp : 0.0000
At least some libdfp conversions between decimal and binary types wrongly fail to raise the "inexact" exception for inexact results. For example, the attached test prints
inexact not raised
instead of the expected
inexact raised as expected
(libgcc conversions via strings have the same issue because glibc strtod fails to raise "inexact", which is a strtod bug; this bug report is only about the libdfp issue).
testinex.txt
Newer distributions provide only python3 by default.
Some are even considering to drop support for python, aka. python 2
src/libdfp/tests/gen-libdfp-tests.py -t decimal32 src/libdfp/tests/fpclassify.input > ./test-fpclassify-d32.c
/usr/bin/env: ‘python’: No such file or directory
make: *** [Makefile:419: test-fpclassify-d32.c] Error 127
...
There are 2 problems here:
It return -INF for tiny values. Likewise, it does not respect subnormal resultants.
The following output has been reported by an user.
It looks like quantize() is giving better results than the test expects.
Reproduced on power8.
Output:
6../test-quantize-d32
...
Test: quantize (-0.1, 1.0)
Result:
is: -1.00000000000000000000e-01 -1.00000000e-01
should be: -0.00000000000000000000e+00 -0.00000000e+00
difference: 1.00000000000000000000e-01 1.00000000e-01
ulp : -0.0000
max.ulp : 0.0000
7../test-quantize-d64
...
Test: quantize (-0.1, 1.0)
Result:
is: -1.00000000000000000000e-01 -1.0000000000000000e-01
should be: -0.00000000000000000000e+00 -0.0000000000000000e+00
difference: 1.00000000000000000000e-01 1.0000000000000000e-01
ulp : -0.0000
max.ulp : 0.0000
...
8../test-quantize-d128
...
Test: quantize (-0.1, 1.0)
Result:
is: -1.00000000000000000000e-01
-1.0000000000000000000000000000000000e-01
should be: -0.00000000000000000000e+00
-0.0000000000000000000000000000000000e+00
difference: -1.00000000000000000000e-01
-1.0000000000000000000000000000000000e-01
ulp : 0.0000
max.ulp : 0.0000
...
IEEE 754, TR 24732 and TS 18661-2 all specify that conversions between binary and decimal floating point types, in either direction, must be correctly rounded. The libdfp conversions, however, are not. The appended test illustrates this for conversions from _Decimal128 to double and I expect other conversions are similarly affected. Testing on POWER8 little-endian, I get
334 passes, 309 fails
but the expected output (as obtained when using libgcc conversions via strings instead of linking with libdfp) is:
643 passes, 0 fails
struct test { _Decimal128 a; double b; };
static volatile struct test tests[] =
{
{ 4014726507494508544159874225545523e-340DL, 0x4.82c2685cb4194p-1020 },
{ 8029453014989017088319748451091046e-340DL, 0x9.0584d0b968328p-1020 },
{ 1801855589287419980815050884769007e-339DL, 0x1.43eb187aeb785p-1016 },
{ 3626954367709046642494879218191221e-338DL, 0x1.97826a5cad2eep-1012 },
{ 7253908735418093284989758436382442e-338DL, 0x3.2f04d4b95a5dcp-1012 },
{ 2997221668398624927484976226963055e-337DL, 0xd.278d921a15c3p-1012 },
{ 3836865267479187214164846881933943e-337DL, 0x1.0d6f10420533p-1008 },
{ 7673730534958374428329693763867886e-337DL, 0x2.1ade20840a66p-1008 },
{ 2397777334718899941987980981570444e-336DL, 0x6.93c6c90d0ae18p-1008 },
{ 4795554669437799883975961963140888e-336DL, 0xd.278d921a15c3p-1008 },
{ 2005030828862579227603481781841521e-334DL, 0x2.25fe0d8ff5396p-1000 },
{ 2023572319008330520523588116333811e-333DL, 0x1.5aec8ce93ef3dp-996 },
{ 7668808343268414529919115747437117e-332DL, 0x3.35b82b8f44bb2p-992 },
{ 5234588283611777491556375980799011e-331DL, 0x1.5e8e809e4cbcap-988 },
{ 2419076792921427162743484725591410e-327DL, 0x1.8b84680cf407dp-976 },
{ 1795988825255558335952383258022639e-326DL, 0xb.786d947798588p-976 },
{ 1935261434337141730194787780473128e-326DL, 0xc.5c234067a03e8p-976 },
{ 8264459614736573503220738093670883e-325DL, 0x2.0fd348faeefc8p-968 },
{ 2664216569453690704547178424124874e-324DL, 0x6.a58d611fc76cp-968 },
{ 5328433138907381409094356848249748e-324DL, 0xd.4b1ac23f8ed8p-968 },
{ 2348821180663353675301104996336908e-323DL, 0x3.a9930bc6e382cp-964 },
{ 3829910063302400414264356800994987e-322DL, 0x3.bb7c71c189d3p-960 },
{ 7659820126604800828528713601989974e-322DL, 0x7.76f8e38313a6p-960 },
{ 7125233393417469262032603092905331e-321DL, 0x4.57008f783e258p-956 },
{ 3384895396565646269970708954532749e-316DL, 0x3.2557eda80c678p-940 },
{ 6769790793131292539941417909065498e-316DL, 0x6.4aafdb5018cfp-940 },
{ 8710632748372721592328745984745725e-316DL, 0x8.1875123182ce8p-940 },
{ 1742126549674544318465749196949145e-315DL, 0x1.030ea2463059dp-936 },
{ 3484253099349088636931498393898290e-315DL, 0x2.061d448c60b3ap-936 },
{ 6968506198698177273862996787796580e-315DL, 0x4.0c3a8918c1674p-936 },
{ 1393701239739635454772599357559316e-314DL, 0x8.1875123182ce8p-936 },
{ 2787402479479270909545198715118632e-314DL, 0x1.030ea2463059dp-932 },
{ 5574804958958541819090397430237264e-314DL, 0x2.061d448c60b3ap-932 },
{ 1413303440219179696432602524788250e-313DL, 0x5.2180fa5d53108p-932 },
{ 2080750759369681061328897452724507e-313DL, 0x7.8dd1d98f39f98p-932 },
{ 4161501518739362122657794905449014e-313DL, 0xf.1ba3b31e73f3p-932 },
{ 8323003037478724245315589810898028e-313DL, 0x1.e3747663ce7e6p-928 },
{ 2589539997848585752044634361648277e-311DL, 0x3.ac1c1c311253ep-924 },
{ 5179079995697171504089268723296554e-311DL, 0x7.5838386224a7cp-924 },
{ 5959591590065207244700171853215871e-311DL, 0x8.7393d7648d73p-924 },
{ 1447222722784440009146984985383168e-310DL, 0x1.48603e9754c42p-920 },
{ 7406814312849647253847156838599039e-310DL, 0x6.909ca5362d2c4p-920 },
{ 2853518468597507436108987680415987e-307DL, 0x9.e1298c2294ccp-912 },
{ 5707036937195014872217975360831974e-307DL, 0x1.3c25318452998p-908 },
{ 9426139287561980126090399910121765e-307DL, 0x2.0a2ae4b5eb6cp-908 },
{ 1885227857512396025218079982024353e-306DL, 0x4.1455c96bd6d8p-908 },
{ 3770455715024792050436159964048706e-306DL, 0x8.28ab92d7adbp-908 },
{ 7540911430049584100872319928097412e-306DL, 0x1.0515725af5b6p-904 },
{ 7217273357791244764254988763041813e-304DL, 0x6.19bde2aa34a1p-900 },
{ 3584489410015040735915958931376773e-303DL, 0x1.e4c74e1158d7ep-896 },
{ 7210927727862056864094912336651545e-299DL, 0x9.4ceefd41ea8p-884 },
{ 1442185545572411372818982467330309e-298DL, 0x1.299ddfa83d5p-880 },
{ 2884371091144822745637964934660618e-298DL, 0x2.533bbf507aap-880 },
{ 5768742182289645491275929869321236e-298DL, 0x4.a6777ea0f54p-880 },
{ 2776084320673306121979232472416587e-297DL, 0x1.660de2a221f7fp-876 },
{ 6713791420121766560843213227883065e-296DL, 0x2.1d3530e7840fp-872 },
{ 1342758284024353312168642645576613e-295DL, 0x4.3a6a61cf081ep-872 },
{ 2685516568048706624337285291153226e-295DL, 0x8.74d4c39e103cp-872 },
{ 5371033136097413248674570582306452e-295DL, 0x1.0e9a9873c2078p-868 },
{ 4447246719681592730327429560921427e-294DL, 0x8.c09daf89e6a78p-868 },
{ 8894493439363185460654859121842854e-294DL, 0x1.1813b5f13cd4fp-864 },
{ 5186275852814249145005142378029447e-293DL, 0x6.6118b03406fa8p-864 },
{ 8142392385344874803715993646461527e-293DL, 0xa.03f13a2b6242p-864 },
{ 1811074237375074197170310868707553e-291DL, 0xd.ec49195adf28p-860 },
{ 8606362649681462655172534016529307e-290DL, 0x2.95a18ffba21b2p-852 },
{ 8917691952580014853227686140346243e-289DL, 0x1.ac7a6cd979c76p-848 },
{ 1245317211594208792220608495267744e-288DL, 0x2.5659f2683280ap-848 },
{ 1285411505878319453757293829962151e-288DL, 0x2.699dabefac282p-848 },
{ 7000848977937822223513684551512273e-286DL, 0x5.21f98bb3e7104p-840 },
{ 1483360089606007093066750353536840e-285DL, 0xa.e0167418651e8p-840 },
{ 4424653257383702631271313480814723e-278DL, 0x1.355e431f2958fp-812 },
{ 8849306514767405262542626961629446e-278DL, 0x2.6abc863e52b1ep-812 },
{ 2390484840495475712026948715648297e-277DL, 0x6.8768691098ebcp-812 },
{ 4780969680990951424053897431296594e-277DL, 0xd.0ed0d22131d78p-812 },
{ 9561939361981902848107794862593188e-277DL, 0x1.a1da1a44263afp-808 },
{ 9897509760638098473400151025530099e-276DL, 0x1.0e52987112c53p-804 },
{ 3053327227827445695615569926504135e-275DL, 0x3.41ee31b181962p-804 },
{ 3422091266405326388892290549512982e-275DL, 0x3.a6a5e15c9d0fp-804 },
{ 6475418494232772084507860476017117e-275DL, 0x6.e894130e1ea54p-804 },
{ 2442661782261956556492455941203308e-274DL, 0x1.a0f718d8c0cb1p-800 },
{ 4885323564523913112984911882406616e-274DL, 0x3.41ee31b181962p-800 },
{ 5254087603101793806261632505415463e-274DL, 0x3.80e0ff7c72c1ap-800 },
{ 2249140656671869799815341251369724e-273DL, 0xe.ff4f351d8fb5p-800 },
{ 4431839790669080589006341880801007e-272DL, 0x1.278406058e75cp-792 },
{ 8863679581338161178012683761602014e-272DL, 0x2.4f080c0b1ceb8p-792 },
{ 1691671823511138968916189125055305e-271DL, 0x4.68025bd0a8afp-792 },
{ 1353337458808911175132951300044244e-270DL, 0x2.34012de854578p-788 },
{ 2706674917617822350265902600088488e-270DL, 0x4.68025bd0a8afp-788 },
{ 3067337982013462990598640528871025e-270DL, 0x4.fe50dcea83474p-788 },
{ 5774012899631285340864543128959513e-270DL, 0x9.665338bb2bf6p-788 },
{ 6134675964026925981197281057742050e-270DL, 0x9.fca1b9d5068e8p-788 },
{ 2093207321215129752146174494314283e-269DL, 0x2.21375dc519048p-784 },
{ 2453870385610770392478912423096820e-269DL, 0x2.7f286e7541a3ap-784 },
{ 4547077706825900144625086917411103e-269DL, 0x4.a05fcc3a5aa8p-784 },
{ 4907740771221540784957824846193640e-269DL, 0x4.fe50dcea83474p-784 },
{ 9454818478047440929582911763604743e-269DL, 0x9.9eb0a924ddefp-784 },
{ 9815481542443081569915649692387280e-269DL, 0x9.fca1b9d5068e8p-784 },
{ 1602433244092975673650392009694919e-268DL, 0x1.04dd8ccc876e6p-780 },
{ 1963096308488616313983129938477456e-268DL, 0x1.3f94373aa0d1dp-780 },
{ 3565529552581591987633521948172375e-268DL, 0x2.4471c40728402p-780 },
{ 3926192616977232627966259876954912e-268DL, 0x2.7f286e7541a3ap-780 },
{ 7852385233954465255932519753909824e-268DL, 0x4.fe50dcea83474p-780 },
{ 1426211821032636795053408779268950e-267DL, 0x9.11c7101ca1008p-780 },
{ 2852423642065273590106817558537900e-267DL, 0x1.2238e20394201p-776 },
{ 1140969456826109436042727023415160e-266DL, 0x4.88e3880e50804p-776 },
{ 2281938913652218872085454046830320e-266DL, 0x9.11c7101ca1008p-776 },
{ 4563877827304437744170908093660640e-266DL, 0x1.2238e20394201p-772 },
{ 4639298527493551025492964266589387e-266DL, 0x1.2704ae765cc8fp-772 },
{ 9278597054987102050985928533178774e-266DL, 0x2.4e095cecb991ep-772 },
{ 1825551130921775097668363237464256e-265DL, 0x4.88e3880e50804p-772 },
{ 5552074092954438574327145885321515e-265DL, 0xd.caa094a6c819p-772 },
{ 1900971831110888378990419410393003e-264DL, 0x2.f387f2d6586f6p-768 },
{ 2220829637181775429730858354128606e-264DL, 0x3.72a82529b2064p-768 },
{ 4121801468292663808721277764521609e-264DL, 0x6.663018000a75cp-768 },
{ 4441659274363550859461716708257212e-264DL, 0x6.e5504a53640c8p-768 },
{ 8563460742656214668182994472778821e-264DL, 0xd.4b8062536e828p-768 },
{ 8883318548727101718923433416514424e-264DL, 0xd.caa094a6c819p-768 },
{ 1584749026102888113340423317061523e-263DL, 0x1.89a7ffb5976a9p-764 },
{ 1904606832173775164080862260797126e-263DL, 0x1.d91c1f29af68ep-764 },
{ 3489355858276663277421285577858649e-263DL, 0x3.62c41edf46d38p-764 },
{ 6978711716553326554842571155717298e-263DL, 0x6.c5883dbe8da7p-764 },
{ 2120365339791792701740948174343357e-261DL, 0xc.dbe7d246c5de8p-760 },
{ 1913562761593907401352720423654414e-259DL, 0x4.887c14b024e08p-752 },
{ 3827125523187814802705440847308828e-259DL, 0x9.10f8296049c1p-752 },
{ 7654251046375629605410881694617656e-259DL, 0x1.221f052c09382p-748 },
{ 3400085866168343277876889906893541e-257DL, 0x3.25770439dca16p-744 },
{ 3400467781226871017188690321397747e-256DL, 0x1.f778dc74397e8p-740 },
{ 2803708652475018877938324295074721e-253DL, 0x6.558c28892c03p-732 },
{ 5607417304950037755876648590149442e-253DL, 0xc.ab1851125806p-732 },
{ 6884881054040908481463633343958747e-253DL, 0xf.8ded2b3e5b048p-732 },
{ 9944458305683495720747124950940451e-249DL, 0x3.6d9a500261a02p-716 },
{ 8722216710846756367939728692418571e-248DL, 0x1.e1164f07b84c8p-712 },
{ 8396285618890292540524423023479403e-247DL, 0x1.2171963b32669p-708 },
{ 3243726365169084879698351815603887e-246DL, 0x4.5e3444448a898p-708 },
{ 1412278428454666088390758120029429e-245DL, 0x1.30485dfa4a0ccp-704 },
{ 2845106955905860138163590726569073e-243DL, 0xe.f734c9ebf7ccp-700 },
{ 2652786035308714531242031639107251e-241DL, 0x5.7366c91eae6e8p-692 },
{ 5305572070617429062484063278214502e-241DL, 0xa.e6cd923d5cddp-692 },
{ 1609042371336615151713044012518526e-239DL, 0x1.4a9dd0c10e5dcp-684 },
{ 3218084742673230303426088025037052e-239DL, 0x2.953ba1821cbb8p-684 },
{ 4083553419360281734815946221319749e-239DL, 0x3.4710759fdec8ap-684 },
{ 7301638162033512038242034246356801e-239DL, 0x5.dc4c1721fb84p-684 },
{ 8167106838720563469631892442639498e-239DL, 0x6.8e20eb3fbd914p-684 },
{ 2747561529475994529018842059286181e-238DL, 0x1.60d86b44c69f6p-680 },
{ 3613030206163045960408700255568878e-238DL, 0x1.cffd6fd75fe79p-680 },
{ 6360591735639040489427542314855059e-238DL, 0x3.30d5db1c2686ep-680 },
{ 1851861752905975050659130368915866e-237DL, 0x9.4a2f47dbcfda8p-680 },
{ 2598203345248197803087317490009407e-235DL, 0x5.17609dd961898p-672 },
{ 2704047323934790924979899224329875e-231DL, 0xc.efb3fcd43333p-660 },
{ 2163237859147832739983919379463900e-230DL, 0x6.77d9fe6a19998p-656 },
{ 1730590287318266191987135503571120e-229DL, 0x3.3becff350ccccp-652 },
{ 2490946536684803785134820051981469e-228DL, 0x2.e8cda1aa4bd46p-648 },
{ 4981893073369607570269640103962938e-228DL, 0x5.d19b435497a8cp-648 },
{ 5259890996394029692314236857695261e-228DL, 0x6.24baa0df58a14p-648 },
{ 1881558060138074179290017340092246e-227DL, 0x1.5f9ef97275ac2p-644 },
{ 2689780868798188275414943626875609e-226DL, 0x1.3a298d92fe0ap-640 },
{ 3039433179770292046829900117793717e-224DL, 0x8.aac1e13b964f8p-636 },
{ 6078866359540584093659800235587434e-224DL, 0x1.15583c2772c9fp-632 },
{ 1838565427369465189667801497780775e-223DL, 0x3.46d5a59e84be2p-632 },
{ 3677130854738930379335602995561550e-223DL, 0x6.8dab4b3d097c4p-632 },
{ 2941704683791144303468482396449240e-222DL, 0x3.46d5a59e84be2p-628 },
{ 7182005615962263207460481134255899e-222DL, 0x7.fff79611ff358p-628 },
{ 2353363747032915442774785917159392e-221DL, 0x1.a36ad2cf425f1p-624 },
{ 6995434991204378414837451895651049e-220DL, 0x3.0b349ac971a4p-620 },
{ 2644941636684948419185081599664147e-217DL, 0x4.7ed5fe371f598p-612 },
{ 4778383553985877934690261630076579e-217DL, 0x8.1f1d341540be8p-612 },
{ 9556767107971755869380523260153158e-217DL, 0x1.03e3a682a817dp-608 },
{ 2964049526184302399924665554506695e-214DL, 0x1.3add262352b55p-600 },
{ 9301348354060122322717917918921457e-214DL, 0x3.dc0f558b59b9ap-600 },
{ 2371239620947441919939732443605356e-213DL, 0x9.d6e9311a95aa8p-600 },
{ 3373249301691517522868586809908067e-212DL, 0x8.bf9379ed66eep-596 },
{ 1804872790582371902999411593576417e-211DL, 0x2.ecef4d60a4954p-592 },
{ 4941625812800663142737762026239717e-209DL, 0x3.20fd884f2af7ep-584 },
{ 3088461924078162430992415081378331e-207DL, 0xc.38d04d67de4b8p-580 },
{ 4768640720713068875468223539110151e-206DL, 0xb.cb57212146dep-576 },
{ 9537281441426137750936447078220302e-206DL, 0x1.796ae42428dbcp-572 },
{ 6138439794075126363423254248280029e-205DL, 0x9.7d280cd6a5388p-572 },
{ 9384907912457452602716313641512661e-204DL, 0x9.112c4c7741b2p-568 },
{ 1063845528691786581097212130030526e-201DL, 0x4.03d1577abfp-560 },
{ 9158875229253581317117709286614059e-195DL, 0x2.0f6c82f8055c4p-536 },
{ 9427136938162078679962910822631013e-194DL, 0x1.534b85dc85f9ap-532 },
{ 2314646121886011516544904622153329e-193DL, 0x3.41124bd135f2cp-532 },
{ 4629292243772023033089809244306658e-193DL, 0x6.822497a26be58p-532 },
{ 1241599286252022065164098478085513e-192DL, 0x1.174adb3d0018ap-528 },
{ 1355077183008000387170284306488458e-192DL, 0x1.30d19b0367bc5p-528 },
{ 2596676469260022452334382784573971e-192DL, 0x2.481c764067d4ep-528 },
{ 5193352938520044904668765569147942e-192DL, 0x4.9038ec80cfa9cp-528 },
{ 2050106480186583164586021628842470e-190DL, 0xb.42442f986bb3p-524 },
{ 1640085184149266531668817303073976e-189DL, 0x5.a12217cc35d98p-520 },
{ 1421862342085552198063350825050766e-186DL, 0x1.310660d3ccd6ap-508 },
{ 1699753910822118554730296368030499e-186DL, 0x1.6ca3bbbd618fdp-508 },
{ 3121616252907670752793647193081265e-186DL, 0x2.9daa1c912e666p-508 },
{ 6243232505815341505587294386162530e-186DL, 0x5.3b5439225ccccp-508 },
{ 2497293002326136602234917754465012e-185DL, 0x1.4ed50e4897333p-504 },
{ 4994586004652273204469835508930024e-185DL, 0x2.9daa1c912e666p-504 },
{ 9989172009304546408939671017860048e-185DL, 0x5.3b5439225ccccp-504 },
{ 1498674290699918809962358023267214e-183DL, 0x4.e7defe1cddaf4p-500 },
{ 2136556319251014823655351447120721e-183DL, 0x6.fe689691ad764p-500 },
{ 4273112638502029647310702894241442e-183DL, 0xd.fcd12d235aec8p-500 },
{ 2078527906423286377080580569124802e-180DL, 0x1.a93d56f243efbp-488 },
{ 2145472728594923894958406294143129e-180DL, 0x1.b6ef864390f4bp-488 },
{ 4290945457189847789916812588286258e-180DL, 0x3.6ddf0c8721e96p-488 },
{ 8581890914379695579833625176572516e-180DL, 0x6.dbbe190e43d2cp-488 },
{ 1743156111744594123117855325321834e-178DL, 0x8.b4eb159d1554p-484 },
{ 3486312223489188246235710650643668e-178DL, 0x1.169d62b3a2aa8p-480 },
{ 8767021326512897741337638284101445e-177DL, 0x1.b5e51d44f9873p-476 },
{ 1540362629499207731527273772287448e-176DL, 0x3.016145a43ddf8p-476 },
{ 1753404265302579548267527656820289e-176DL, 0x3.6bca3a89f30e6p-476 },
{ 3293766894801787279794801429107737e-176DL, 0x6.6d2b802e30edcp-476 },
{ 3506808530605159096535055313640578e-176DL, 0x6.d7947513e61ccp-476 },
{ 7013617061210318193070110627281156e-176DL, 0xd.af28ea27cc398p-476 },
{ 1842165560490433438528306303054532e-172DL, 0x8.c665c44c5e968p-464 },
{ 2208037920647679301958475745215411e-172DL, 0xa.848deaf3ca9f8p-464 },
{ 4050203481138112740486782048269943e-171DL, 0xc.0ed84d8819c2p-460 },
{ 2722819976808664335036204782690669e-170DL, 0x5.10fda9275b6b8p-456 },
{ 7052110752442620261440112334382891e-170DL, 0xd.1f35ad2e59aa8p-456 },
{ 1242694756915147217162670184931459e-167DL, 0x9.084a7ef6d9f88p-448 },
{ 2485389513830294434325340369862918e-167DL, 0x1.21094fdedb3f1p-444 },
{ 2790570974740105285666530447208921e-167DL, 0x1.4486f71357cf4p-444 },
{ 5275960488570399719991870817071839e-167DL, 0x2.659046f2330e4p-444 },
{ 1639478322596958174182808249087628e-164DL, 0x2.e8c5d02df1f7cp-436 },
{ 3278956645193916348365616498175256e-164DL, 0x5.d18ba05be3ef8p-436 },
{ 3441127897791917120729428147597677e-164DL, 0x6.1b3733aa69e5cp-436 },
{ 6720084542985833469095044645772933e-164DL, 0xb.ecc2d4064dd5p-436 },
{ 2655599566674733233165255528424689e-163DL, 0x2.f1fb4297c2b68p-432 },
{ 5311199133349466466330511056849378e-163DL, 0x5.e3f6852f856dp-432 },
{ 3830550226115535886652520426908449e-161DL, 0x1.a8d58265a1d59p-424 },
{ 7661100452231071773305040853816898e-161DL, 0x3.51ab04cb43ab2p-424 },
{ 3123469067065861931719792909304279e-160DL, 0xd.8823a33552c28p-424 },
{ 1475653597722240438266389969355046e-158DL, 0x2.7f4c0018b4e1p-416 },
{ 2951307195444480876532779938710092e-158DL, 0x4.fe98003169c2p-416 },
{ 5902614390888961753065559877420184e-158DL, 0x9.fd300062d384p-416 },
{ 9572076660244324449377477559887489e-158DL, 0x1.032e8464deadap-412 },
{ 2301167600117209900949776304183460e-154DL, 0x9.81ebc1a600598p-404 },
{ 1840934080093767920759821043346768e-153DL, 0x4.c0f5e0d3002ccp-400 },
{ 1993192442791211909782724875140948e-149DL, 0xc.90d359ccfe928p-388 },
{ 1192219191804159514232960062615849e-148DL, 0x4.b294c948eb718p-384 },
{ 1636077708959627234030231747397427e-146DL, 0x2.84a5bea51fd6ap-376 },
{ 1758444878300947638572807725086498e-146DL, 0x2.b4dcd0b9e514p-376 },
{ 3394522587260574872603039472483925e-146DL, 0x5.39828f5f04eacp-376 },
{ 6789045174521149745206078944967850e-146DL, 0xa.73051ebe09d58p-376 },
{ 6911412343862470149748654922656921e-146DL, 0xa.a33c30d2cf128p-376 },
{ 1357809034904229949041215788993570e-145DL, 0x1.4e60a3d7c13abp-372 },
{ 2715618069808459898082431577987140e-145DL, 0x2.9cc147af82756p-372 },
{ 8269221378766700098789870711650491e-145DL, 0x7.f466425b82a68p-372 },
{ 2172494455846767918465945262389712e-144DL, 0x1.4e60a3d7c13abp-368 },
{ 4344988911693535836931890524779424e-144DL, 0x2.9cc147af82756p-368 },
{ 2064336296129954928744727663577365e-141DL, 0x4.d9226f8813f4cp-360 },
{ 2946143398866593292346225154488558e-141DL, 0x6.eb4cf87525cfcp-360 },
{ 1651469036903963942995782130861892e-140DL, 0x2.6c9137c409fa6p-356 },
{ 3302938073807927885991564261723784e-140DL, 0x4.d9226f8813f4cp-356 },
{ 3359010658092584278095170687204031e-140DL, 0x4.ee34693a3a208p-356 },
{ 6661948731900512164086734948927815e-140DL, 0x9.c756d8c24e15p-356 },
{ 6718021316185168556190341374408062e-140DL, 0x9.dc68d2747441p-356 },
{ 1332389746380102432817346989785563e-139DL, 0x1.38eadb1849c2ap-352 },
{ 2664779492760204865634693979571126e-139DL, 0x2.71d5b63093854p-352 },
{ 5329558985520409731269387959142252e-139DL, 0x4.e3ab6c61270a8p-352 },
{ 8050411062565270989007688364193625e-139DL, 0x7.62ac5ea1126b4p-352 },
{ 3220164425026108395603075345677450e-138DL, 0x1.d8ab17a8449adp-348 },
{ 6440328850052216791206150691354900e-138DL, 0x3.b1562f508935ap-348 },
{ 2576131540020886716482460276541960e-137DL, 0xe.c558bd4224d68p-348 },
{ 3719476773007355533467850286303527e-137DL, 0x1.55397ef15dcfcp-344 },
{ 5152263080041773432964920553083920e-137DL, 0x1.d8ab17a8449adp-344 },
{ 8871739853049128966432770839387447e-137DL, 0x3.2de49699a26a8p-344 },
{ 2060905232016709373185968221233568e-136DL, 0x7.62ac5ea1126b4p-344 },
{ 2689024156999000846874866175686743e-136DL, 0x9.a2e8c61d20e8p-344 },
{ 4121810464033418746371936442467136e-136DL, 0xe.c558bd4224d68p-344 },
{ 6810834621032419593246802618153879e-136DL, 0x1.86841835f45bep-340 },
{ 8243620928066837492743872884934272e-136DL, 0x1.d8ab17a8449adp-340 },
{ 2437776587006084257399306993905473e-135DL, 0x5.75c261f330f1cp-340 },
{ 2348521496349548086602195145766944e-131DL, 0xc.d78e300f5dc98p-328 },
{ 4697042992699096173204390291533888e-131DL, 0x1.9af1c601ebb93p-324 },
{ 4855854213258868349400119048079507e-131DL, 0x1.a8d6bd4b3cd44p-324 },
{ 9552897205957964522604509339613395e-131DL, 0x3.43c8834d288d8p-324 },
{ 9711708426517736698800238096159014e-131DL, 0x3.51ad7a9679a88p-324 },
{ 1910579441191592904520901867922679e-130DL, 0x6.8791069a511bp-324 },
{ 3821158882383185809041803735845358e-130DL, 0xd.0f220d34a236p-324 },
{ 7642317764766371618083607471690716e-130DL, 0x1.a1e441a69446cp-320 },
{ 2044174658240774604132200294996009e-128DL, 0x2.ba9ce66dcb01p-316 },
{ 4088349316481549208264400589992018e-128DL, 0x5.7539ccdb9602p-316 },
{ 8176698632963098416528801179984036e-128DL, 0xa.ea7399b72c04p-316 },
{ 3121954634029703381049563847236911e-127DL, 0x2.9ad8703b045dcp-312 },
{ 8389864833836076936873775540313497e-124DL, 0x1.b584040774ae6p-300 },
{ 8277736212351533159971621110761919e-123DL, 0x1.0dcaf13c81d29p-296 },
{ 2007217587976345296116271662218821e-117DL, 0x3.e63c67064de9ap-280 },
{ 1787397146619661573195766503028306e-114DL, 0xd.9052223a96f7p-272 },
{ 1896086617006448223738630417882177e-113DL, 0x8.fe2af542e284p-268 },
{ 3792173234012896447477260835764354e-113DL, 0x1.1fc55ea85c508p-264 },
{ 7584346468025792894954521671528708e-113DL, 0x2.3f8abd50b8a1p-264 },
{ 1106240952040296571232616694685258e-111DL, 0x2.0cac3e284898ep-260 },
{ 8396591164685361033519706217945075e-110DL, 0x9.b8fb8c904fbap-256 },
{ 1679318232937072206703941243589015e-109DL, 0x1.371f719209f74p-252 },
{ 3358636465874144413407882487178030e-109DL, 0x2.6e3ee32413ee8p-252 },
{ 6717272931748288826815764974356060e-109DL, 0x4.dc7dc64827ddp-252 },
{ 1147079078727477642896588542934021e-108DL, 0x8.4d29b5b2ab4a8p-252 },
{ 1343454586349657765363152994871212e-108DL, 0x9.b8fb8c904fbap-252 },
{ 2490533665077135408259741537805233e-108DL, 0x1.206254242fb05p-248 },
{ 2686909172699315530726305989742424e-108DL, 0x1.371f719209f74p-248 },
{ 5177442837776450938986047527547657e-108DL, 0x2.5781c5b639a7ap-248 },
{ 5373818345398631061452611979484848e-108DL, 0x2.6e3ee32413ee8p-248 },
{ 2110252236635016400087731901406501e-107DL, 0x9.8b8151b49b2c8p-248 },
{ 4220504473270032800175463802813002e-107DL, 0x1.31702a3693659p-244 },
{ 8441008946540065600350927605626004e-107DL, 0x2.62e0546d26cb2p-244 },
{ 1531101383210269022096933959575448e-106DL, 0x4.540f15b50a334p-244 },
{ 1727476890832449144563498411512639e-106DL, 0x4.e22d0da39e6ecp-244 },
{ 3454953781664898289126996823025278e-106DL, 0x9.c45a1b473cdd8p-244 },
{ 6909907563329796578253993646050556e-106DL, 0x1.388b4368e79bbp-240 },
{ 2101196657709679872011928704412528e-99DL, 0x3.8a5ed25aeab76p-220 },
{ 2355953821935199491857314419246839e-99DL, 0x3.f84321854844cp-220 },
{ 4457150479644879363869243123659367e-99DL, 0x7.82a1f3e032fcp-220 },
{ 4711907643870398983714628838493678e-99DL, 0x7.f086430a90898p-220 },
{ 9423815287740797967429257676987356e-99DL, 0xf.e10c86152113p-220 },
{ 1536360846740613295946164538554477e-96DL, 0xa.1cc34dc810bc8p-212 },
{ 3072721693481226591892329077108954e-96DL, 0x1.439869b902179p-208 },
{ 3164803167785754154211860309207915e-95DL, 0xd.04ed3f0409328p-208 },
{ 2531842534228603323369488247366332e-94DL, 0x6.82769f8204994p-204 },
{ 3533129065003864403489985237603759e-94DL, 0x9.158311db68708p-204 },
{ 7066258130007728806979970475207518e-94DL, 0x1.22b0623b6d0e1p-200 },
{ 3683614613936963179011423294075194e-92DL, 0x3.b3182f7573cdap-196 },
{ 4300977118142770973917941935409667e-92DL, 0x4.51d319137b77cp-196 },
{ 8601954236285541947835883870819334e-92DL, 0x8.a3a63226f6ef8p-196 },
{ 1601030428675523548671410756683301e-91DL, 0x1.01469258f52ebp-192 },
{ 2333641269203339466388157704712011e-90DL, 0xe.a60455fdfbd8p-192 },
{ 4667282538406678932776315409424022e-90DL, 0x1.d4c08abfbf7bp-188 },
{ 9334565076813357865552630818848044e-90DL, 0x3.a981157f7ef6p-188 },
{ 6043166679392938785617839527595921e-88DL, 0xe.d15b71ca318b8p-184 },
{ 2302191621369859261473542805149747e-87DL, 0x3.873174d329c78p-180 },
{ 2619222227890640808343824312797661e-83DL, 0x9.ccb76beba9a1p-168 },
{ 4293421831695405134565896371144411e-83DL, 0x1.01047f84e08ep-164 },
{ 8586843663390810269131792742288822e-83DL, 0x2.0208ff09c11cp-164 },
{ 1125764793172304324398000834093635e-77DL, 0x4.0451225800fp-148 },
{ 3950938441170251006884486024166965e-73DL, 0x2.26ae31c138e7ap-132 },
{ 1580375376468100402753794409666786e-72DL, 0x8.9ab8c704e39e8p-132 },
{ 3160750752936200805507588819333572e-72DL, 0x1.135718e09c73dp-128 },
{ 5306892120470888117804607281695747e-72DL, 0x1.ce4ba62334e85p-128 },
{ 9326099420420963848231003485974189e-71DL, 0x1.fbc2dab308f6cp-124 },
{ 8295951564004313938328434624040345e-70DL, 0x1.1a4bee3369046p-120 },
{ 1659190312800862787665686924808069e-69DL, 0x2.3497dc66d208cp-120 },
{ 3318380625601725575331373849616138e-69DL, 0x4.692fb8cda4118p-120 },
{ 6636761251203451150662747699232276e-69DL, 0x8.d25f719b4823p-120 },
{ 6016599951588847514479452797589669e-67DL, 0x3.1fbe49882ffd4p-112 },
{ 8127219060932884364505639966487295e-67DL, 0x4.384aef110cf14p-112 },
{ 1625443812186576872901127993297459e-66DL, 0x8.7095de2219e28p-112 },
{ 3250887624373153745802255986594918e-66DL, 0x1.0e12bbc4433c5p-108 },
{ 6501775248746307491604511973189836e-66DL, 0x2.1c2577888678ap-108 },
{ 2857831693650159594611650201336643e-65DL, 0x9.46319546bc638p-108 },
{ 2962646608509624701595811744072183e-64DL, 0x6.024b480786678p-104 },
{ 3104645611960680552322874943078121e-61DL, 0x1.898f82a70de5cp-92 },
{ 6209291223921361104645749886156242e-61DL, 0x3.131f054e1bcb8p-92 },
{ 3688537037691463104146503139126203e-57DL, 0x4.758c0309650ep-80 },
{ 7377074075382926208293006278252406e-57DL, 0x8.eb180612ca1cp-80 },
{ 2212344115427126657766048627099827e-56DL, 0x1.abedf97554d85p-76 },
{ 4424688230854253315532097254199654e-56DL, 0x3.57dbf2eaa9b0ap-76 },
{ 8849376461708506631064194508399308e-56DL, 0x6.afb7e5d553614p-76 },
{ 3743849840080830779336825689002963e-54DL, 0x1.1ae09678f15dp-68 },
{ 7769189608522526669077078779896419e-52DL, 0xe.54e5643ad0ce8p-64 },
{ 2059319930127063548835434324072865e-50DL, 0x1.7be0a25801b46p-56 },
{ 4118639860254127097670868648145730e-50DL, 0x2.f7c144b00368cp-56 },
{ 6231376785290948773299674474645081e-50DL, 0x4.7d7c72dff6744p-56 },
{ 8237279720508254195341737296291460e-50DL, 0x5.ef82896006d18p-56 },
{ 1647455944101650839068347459258292e-49DL, 0xb.df0512c00da3p-56 },
{ 3294911888203301678136694918516584e-49DL, 0x1.7be0a25801b46p-52 },
{ 6589823776406603356273389837033168e-49DL, 0x2.f7c144b00368cp-52 },
{ 1528038007197302793824756010699167e25DL, 0x2.6f2e9c9cf86aep+192 },
{ 3056076014394605587649512021398334e25DL, 0x4.de5d3939f0d5cp+192 },
{ 8613282575095184764413745328891987e25DL, 0xd.b8c4a90c33bcp+192 },
{ 2501130546305973589114721286095319e26DL, 0x2.7d86621f334a6p+196 },
{ 4108234894400282995510542829772185e32DL, 0x3.e6a815cb02d18p+216 },
{ 3286587915520226396408434263817748e33DL, 0x1.f3540ae58168cp+220 },
{ 6573175831040452792816868527635496e33DL, 0x3.e6a815cb02d18p+220 },
{ 8058782786848933856905133028431237e34DL, 0x2.fd3a28674d6f4p+224 },
{ 3826072859618914655800982977934691e35DL, 0xe.3112ca989f7fp+224 },
{ 2656884808772990906907850647029872e37DL, 0x3.d97e4c0482f1cp+232 },
{ 5981935369003718872272813606058177e39DL, 0x3.62ba508c10ceap+240 },
{ 2252160506713430916825042492676187e43DL, 0x3.1cac6d8623892p+252 },
{ 5453148207869668169378900350465581e43DL, 0x7.88fb99f52f36p+252 },
{ 8743805023666207736835873828132365e45DL, 0x4.b8352438df154p+260 },
{ 1748761004733241547367174765626473e46DL, 0x9.706a4871be2a8p+260 },
{ 3497522009466483094734349531252946e46DL, 0x1.2e0d490e37c55p+264 },
{ 6995044018932966189468699062505892e46DL, 0x2.5c1a921c6f8aap+264 },
{ 8357601600715659579752266534791423e46DL, 0x2.d1c6ccba5cf4ep+264 },
{ 2216543352856209272063880295872497e47DL, 0x7.7a3e83ec6f924p+264 },
{ 2318257714998044773764531225612210e48DL, 0x4.e34dd48109528p+268 },
{ 3070529123929725153844193119459463e48DL, 0x6.7959b68c7f9f4p+268 },
{ 5388786838927769927608724345071673e48DL, 0xb.5ca78b0d88f2p+268 },
{ 6141058247859450307688386238918926e48DL, 0xc.f2b36d18ff3e8p+268 },
{ 1854606171998435819011624980489768e49DL, 0x2.71a6ea4084a94p+272 },
{ 2606877580930116199091286874337021e49DL, 0x3.6f6e5787ae994p+272 },
{ 5213755161860232398182573748674042e49DL, 0x6.dedcaf0f5d328p+272 },
{ 2415427976655517653865709934790271e52DL, 0xc.6efd6f6410918p+280 },
{ 3494527229464214980190418301269777e52DL, 0x1.1fcffedbd7ddap+284 },
{ 4830855953311035307731419869580542e52DL, 0x1.8ddfadec82123p+284 },
{ 8325383182775250287921838170850319e52DL, 0x2.adafacc859efcp+284 },
{ 1368831773336186815336648224069635e56DL, 0x1.133d6761c203bp+296 },
{ 1095065418668949452269318579255708e57DL, 0x8.99eb3b0e101d8p+296 },
{ 3662972369040058480821354681009435e57DL, 0x1.cc5601f30038fp+300 },
{ 2930377895232046784657083744807548e58DL, 0xe.62b00f9801c78p+300 },
{ 7333597322166253145596885012113115e58DL, 0x2.4005628dc71a4p+304 },
{ 1466719464433250629119377002422623e59DL, 0x4.800ac51b8e348p+304 },
{ 2933438928866501258238754004845246e59DL, 0x9.00158a371c69p+304 },
{ 5866877857733002516477508009690492e59DL, 0x1.2002b146e38d2p+308 },
{ 3229231648660714962927965613359929e60DL, 0x6.31428f41f12ep+308 },
{ 6458463297321429925855931226719858e60DL, 0xc.62851e83e25cp+308 },
{ 1735358537264967531314817258377248e64DL, 0x8.1fd7d415726b8p+320 },
{ 3334972382352485089674687357416661e65DL, 0x9.c21f2f4aa3018p+324 },
{ 6669944764704970179349374714833322e65DL, 0x1.3843e5e954603p+328 },
{ 9129636290486716656519835489752557e65DL, 0x1.ab6b86a8aaf06p+328 },
{ 8390577726948422525729132032374731e68DL, 0x5.fe73b186e59fcp+336 },
{ 7796568222188738770761612726707537e69DL, 0x3.7b234e8cb977p+340 },
{ 2984936455860988766074368878942773e70DL, 0xd.53bea6cf8423p+340 },
{ 4202733329505496258482952191490767e70DL, 0x1.2c3abd40fa863p+344 },
{ 8405466659010992516965904382981534e70DL, 0x2.58757a81f50c6p+344 },
{ 2286804534479015214338719339999741e74DL, 0x1.8ed51f7e0bba9p+356 },
{ 4573609068958030428677438679999482e74DL, 0x3.1daa3efc17752p+356 },
{ 2447815983435979802971396168946926e76DL, 0xa.6c363553f1dbp+360 },
{ 2244324029511783646284975159294667e79DL, 0x2.5543dd88e3ccp+372 },
{ 4488648059023567292569950318589334e79DL, 0x4.aa87bb11c798p+372 },
{ 8977296118047134585139900637178668e79DL, 0x9.550f76238f3p+372 },
{ 2106656151988410624700146309110791e82DL, 0x8.8df494ab82c58p+380 },
{ 4213312303976821249400292618221582e82DL, 0x1.11be92957058bp+384 },
{ 1103234362535969738311240777637990e88DL, 0x4.45ba76e9c327p+400 },
{ 2074911601246991947427600610117961e89DL, 0x5.05a54f6273efcp+404 },
{ 4149823202493983894855201220235922e89DL, 0xa.0b4a9ec4e7df8p+404 },
{ 1506325817745411816793057053920819e91DL, 0x1.6c9629b5935e9p+412 },
{ 3012651635490823633586114107841638e91DL, 0x2.d92c536b26bd2p+412 },
{ 4459559823683424260984816586133099e91DL, 0x4.3760e2940fa18p+412 },
{ 8919119647366848521969633172266198e91DL, 0x8.6ec1c5281f43p+412 },
{ 2096972618933014305631408960363275e92DL, 0x1.3d37312d4ba38p+416 },
{ 4193945237866028611262817920726550e92DL, 0x2.7a6e625a9747p+416 },
{ 8387890475732057222525635841453100e92DL, 0x4.f4dcc4b52e8ep+416 },
{ 1677578095146411444505127168290620e93DL, 0x9.e9b9896a5d1cp+416 },
{ 3355156190292822889010254336581240e93DL, 0x1.3d37312d4ba38p+420 },
{ 6710312380585645778020508673162480e93DL, 0x2.7a6e625a9747p+420 },
{ 1342062476117129155604101734632496e94DL, 0x4.f4dcc4b52e8ep+420 },
{ 2684124952234258311208203469264992e94DL, 0x9.e9b9896a5d1cp+420 },
{ 5368249904468516622416406938529984e94DL, 0x1.3d37312d4ba38p+424 },
{ 1917180479413634832954985540140932e100DL, 0x6.c0a428c94c2e8p+440 },
{ 2621515432895309700434922634758277e100DL, 0x9.3bb5e60103168p+440 },
{ 3834360958827269665909971080281864e100DL, 0xd.81485192985dp+440 },
{ 6455876391722579366344893715040141e100DL, 0x1.6bcfe37939b74p+444 },
{ 7668721917654539331819942160563728e100DL, 0x1.b0290a32530bap+444 },
{ 3552626977434599718917996242434926e101DL, 0x7.d208c3adb1804p+444 },
{ 2374145291647151824445807434565673e102DL, 0x3.4432b9c88239ap+448 },
{ 2339781451502639753442947796911339e103DL, 0x2.030f2d2cce646p+452 },
{ 2141602506536184710446596889109045e104DL, 0x1.26a56bc9a9469p+456 },
{ 1713282005228947768357277511287236e105DL, 0x9.352b5e4d4a348p+456 },
{ 2077677283787530998253361764674603e105DL, 0xb.2a831897ac6d8p+456 },
{ 3790959289016478766610639275961839e106DL, 0xc.bbcd0a4f1a258p+460 },
{ 7581918578032957533221278551923678e106DL, 0x1.9779a149e344bp+464 },
{ 1623681659886353820336724723233708e109DL, 0x1.54dd89af7c92ep+472 },
{ 3247363319772707640673449446467416e109DL, 0x2.a9bb135ef925cp+472 },
{ 6494726639545415281346898892934832e109DL, 0x5.537626bdf24b8p+472 },
{ 9127258654062977485531104945095525e109DL, 0x7.7c1e57bc592a4p+472 },
{ 3650903461625190994212441978038210e110DL, 0x1.df0795ef164a9p+476 },
{ 7301806923250381988424883956076420e110DL, 0x3.be0f2bde2c952p+476 },
{ 1748552139432666988870724321485159e111DL, 0x8.f63fd4ff088f8p+476 },
{ 2920722769300152795369953582430568e111DL, 0xe.f83caf78b2548p+476 },
{ 5841445538600305590739907164861136e111DL, 0x1.df0795ef164a9p+480 },
{ 1402723233693558279447827285161309e112DL, 0x4.7e4ec72d61cdcp+480 },
{ 2805446467387116558895654570322618e112DL, 0x8.fc9d8e5ac39b8p+480 },
{ 4300390742611103827522921065170287e113DL, 0x8.9c17e51d6d4e8p+484 },
{ 1329452952218009485476827119586839e116DL, 0xa.65acdf3f3311p+492 },
{ 1602113363885492424859486237669574e116DL, 0xc.879067b44d2bp+492 },
{ 2714491277161940665629898472233195e119DL, 0x5.2ed0d19185b5cp+504 },
{ 4670273208420842081587057256328097e119DL, 0x8.eac830a5bf958p+504 },
{ 5428982554323881331259796944466390e119DL, 0xa.5da1a3230b6b8p+504 },
{ 2171593021729552532503918777786556e120DL, 0x2.976868c8c2daep+508 },
{ 4343186043459105065007837555573112e120DL, 0x5.2ed0d19185b5cp+508 },
{ 8686372086918210130015675111146224e120DL, 0xa.5da1a3230b6b8p+508 },
{ 1835220178714739946541718103899442e125DL, 0x3.577b2896ffb0ap+524 },
{ 3537586580050559852983048953892979e128DL, 0x1.92988e1483f22p+536 },
{ 3322652366909726180001874387732158e132DL, 0x3.9b2e8c3f56a76p+548 },
{ 6645304733819452360003748775464316e132DL, 0x7.365d187ead4ecp+548 },
{ 3552059535824812015887659027404051e133DL, 0x2.68d36da111078p+552 },
{ 6026655694220524291180530825852263e133DL, 0x4.168c0892c075cp+552 },
{ 2626154953174029664591169776132073e134DL, 0x1.1d065c7a9c509p+556 },
{ 5252309906348059329182339552264146e134DL, 0x2.3a0cb8f538a12p+556 },
{ 3832301318840819989569501491879945e137DL, 0x6.58bbb416c5f24p+564 },
{ 7664602637681639979139002983759890e137DL, 0xc.b177682d8be48p+564 },
{ 3065841055072655991655601193503956e138DL, 0x3.2c5dda0b62f92p+568 },
{ 6131682110145311983311202387007912e138DL, 0x6.58bbb416c5f24p+568 },
{ 5759453647048406780839142339226751e139DL, 0x3.b9d06816c9c98p+572 },
{ 1371192794886374934659949135961549e140DL, 0x8.decf9667ceaep+572 },
{ 2836562435773746569502531116053574e141DL, 0xb.77fdda22c199p+576 },
{ 4317628217661284321042218570167345e141DL, 0x1.174f905f4cc8fp+580 },
{ 8635256435322568642084437140334690e141DL, 0x2.2e9f20be9991ep+580 },
{ 1727051287064513728416887428066938e142DL, 0x4.5d3e417d3323cp+580 },
{ 3454102574129027456833774856133876e142DL, 0x8.ba7c82fa66478p+580 },
{ 6908205148258054913667549712267752e142DL, 0x1.174f905f4cc8fp+584 },
{ 1504118507157530782144461168390657e143DL, 0x2.6024313a3797p+584 },
{ 2882179541920279536812313890067784e145DL, 0x1.c7338d2fbf0dep+592 },
{ 3292874973618227289904496505011669e146DL, 0x1.450a6d97016ddp+596 },
{ 6585749947236454579808993010023338e146DL, 0x2.8a14db2e02dbap+596 },
{ 8525144558009472132045321628200845e149DL, 0xc.d72fba40441f8p+604 },
{ 1705028911601894426409064325640169e150DL, 0x1.9ae5f7480883fp+608 },
{ 2633519141106552203369965262872097e150DL, 0x2.7aa831c369836p+608 },
{ 3410057823203788852818128651280338e150DL, 0x3.35cbee901107ep+608 },
{ 6820115646407577705636257302560676e150DL, 0x6.6b97dd20220fcp+608 },
{ 2486303179990617440006979164458173e152DL, 0xe.a0dea0bb76848p+612 },
{ 4972606359981234880013958328916346e152DL, 0x1.d41bd4176ed09p+616 },
{ 9945212719962469760027916657832692e152DL, 0x3.a837a82edda12p+616 },
{ 2744845917077995496512711884176717e156DL, 0x2.76d792e38a5d6p+628 },
{ 5489691834155990993025423768353434e156DL, 0x4.edaf25c714bacp+628 },
{ 7711920103258379645908209745712321e156DL, 0x6.ec6a0617e2c7p+628 },
{ 2640322387482874127786726702813151e157DL, 0x1.7b43257bdef03p+632 },
{ 5280644774965748255573453405626302e157DL, 0x2.f6864af7bde06p+632 },
{ 4668961473793076335035319919972819e158DL, 0x1.a329bf022f093p+636 },
{ 9337922947586152670070639839945638e158DL, 0x3.46537e045e126p+636 },
{ 2070388375428286873187526485351633e163DL, 0x1.1b9e5876745bdp+652 },
{ 4140776750856573746375052970703266e163DL, 0x2.373cb0ece8b7ap+652 },
{ 4676564397687561033439638127248937e164DL, 0x1.9065602c9fd97p+656 },
{ 9353128795375122066879276254497874e164DL, 0x3.20cac0593fb2ep+656 },
{ 1865334325717317019421737900949742e170DL, 0x9.84e90fed55c3p+672 },
{ 1997468416374232399754555307270397e171DL, 0x6.5ef5495f7ce24p+676 },
{ 3994936832748464799509110614540794e171DL, 0xc.bdea92bef9c48p+676 },
{ 5886697976597164894997411996754667e171DL, 0x1.2c69029625739p+680 },
{ 2506458872611197220890199680031119e173DL, 0x3.1f6f8716d3ed8p+684 },
{ 9505093554205095381683650062999763e175DL, 0x4.a03d2f7ff46fcp+692 },
{ 2167381743724459814341371376220575e178DL, 0x4.1ed1f464e2bc8p+700 },
{ 4334763487448919628682742752441150e178DL, 0x8.3da3e8c9c579p+700 },
{ 8669526974897839257365485504882300e178DL, 0x1.07b47d1938af2p+704 },
{ 1733905394979567851473097100976460e179DL, 0x2.0f68fa32715e4p+704 },
{ 3467810789959135702946194201952920e179DL, 0x4.1ed1f464e2bc8p+704 },
{ 6935621579918271405892388403905840e179DL, 0x8.3da3e8c9c579p+704 },
{ 1387124315983654281178477680781168e180DL, 0x1.07b47d1938af2p+708 },
{ 2774248631967308562356955361562336e180DL, 0x2.0f68fa32715e4p+708 },
{ 5548497263934617124713910723124672e180DL, 0x4.1ed1f464e2bc8p+708 },
{ 1172294626639155828724628115286994e181DL, 0x8.b4a3b18c46f2p+708 },
{ 2344589253278311657449256230573988e181DL, 0x1.1694763188de4p+712 },
{ 2547750591680026621303258868300357e182DL, 0xb.d33125641917p+712 },
{ 8086913174860416955137292049210785e183DL, 0x1.775743e500a9cp+720 },
{ 1617382634972083391027458409842157e184DL, 0x2.eeae87ca01538p+720 },
{ 3234765269944166782054916819684314e184DL, 0x5.dd5d0f9402a7p+720 },
{ 6469530539888333564109833639368628e184DL, 0xb.baba1f28054ep+720 },
{ 8589435876231295733794702447296861e184DL, 0xf.92a581a815c68p+720 },
{ 1967883234373036724918915657787403e186DL, 0x1.64c816e08329ap+728 },
{ 3935766468746073449837831315574806e186DL, 0x2.c9902dc106534p+728 },
{ 1785456712009126191199771877618407e187DL, 0xc.a5129992f85d8p+728 },
{ 1932176707345588773213221604874848e194DL, 0x8.27ff79c5b5648p+752 },
{ 3864353414691177546426443209749696e194DL, 0x1.04ffef38b6ac9p+756 },
{ 7126815900176748812465889893990095e194DL, 0x1.e158fa5711421p+756 },
{ 2438990234655827783933265230951677e195DL, 0x6.6f4d638900394p+756 },
{ 2850726360070699524986355957596038e195DL, 0x7.8563e95c45084p+756 },
{ 5701452720141399049972711915192076e195DL, 0xf.0ac7d2b88a108p+756 },
{ 4608056389736231635913718089037825e197DL, 0x4.bfbdb2243d7ap+764 },
{ 9216112779472463271827436178075650e197DL, 0x9.7f7b64487af4p+764 },
{ 1843222555894492654365487235615130e198DL, 0x1.2fef6c890f5e8p+768 },
{ 3686445111788985308730974471230260e198DL, 0x2.5fded9121ebdp+768 },
{ 7372890223577970617461948942460520e198DL, 0x4.bfbdb2243d7ap+768 },
{ 1474578044715594123492389788492104e199DL, 0x9.7f7b64487af4p+768 },
{ 2949156089431188246984779576984208e199DL, 0x1.2fef6c890f5e8p+772 },
{ 5375899823198473729279607747590385e199DL, 0x2.2a08124091696p+772 },
{ 5898312178862376493969559153968416e199DL, 0x2.5fded9121ebdp+772 },
{ 2150359929279389491711843099036154e200DL, 0x8.a820490245a58p+772 },
{ 4300719858558778983423686198072308e200DL, 0x1.1504092048b4bp+776 },
{ 4823132214222681748113637604450339e200DL, 0x1.36aa45634108fp+776 },
{ 1615805472290731040431484197953317e202DL, 0x2.8a7a4b7cff5a8p+780 },
{ 3659358894951772685171237075948255e204DL, 0x2.3f737811e9bb2p+788 },
{ 7318717789903545370342474151896510e204DL, 0x4.7ee6f023d3764p+788 },
{ 1463743557980709074068494830379302e205DL, 0x8.fdcde047a6ec8p+788 },
{ 2927487115961418148136989660758604e205DL, 0x1.1fb9bc08f4dd9p+792 },
{ 5854974231922836296273979321517208e205DL, 0x2.3f737811e9bb2p+792 },
{ 2982744096341530777676504924339277e206DL, 0xb.739068a967608p+792 },
{ 8727204367504141814871453718695139e206DL, 0x2.18174f8bcdb3ep+796 },
{ 1369738720683444530803879723751134e208DL, 0x2.0ddf943b6654p+800 },
{ 5731207658624860415845123685568637e209DL, 0x5.5f3639bc29264p+804 },
{ 7876968058300521640980718259403225e210DL, 0x4.9d4e6f9387d5p+808 },
{ 1575393611660104328196143651880645e211DL, 0x9.3a9cdf270faap+808 },
{ 3150787223320208656392287303761290e211DL, 0x1.27539be4e1f54p+812 },
{ 6301574446640417312784574607522580e211DL, 0x2.4ea737c9c3ea8p+812 },
{ 1260314889328083462556914921504516e212DL, 0x4.9d4e6f9387d5p+812 },
{ 2520629778656166925113829843009032e212DL, 0x9.3a9cdf270faap+812 },
{ 5041259557312333850227659686018064e212DL, 0x1.27539be4e1f54p+816 },
{ 2492546208236873264301832498864815e213DL, 0x5.b42e5c56b50dcp+816 },
{ 4191688440953846988252383956966981e213DL, 0x9.97922e12c9678p+816 },
{ 8383376881907693976504767913933962e213DL, 0x1.32f245c2592cfp+820 },
{ 1994036966589498611441465999091852e214DL, 0x2.da172e2b5a86ep+820 },
{ 2632970958121318147947796190576063e215DL, 0x2.5a847591daa8p+824 },
{ 5265941916242636295895592381152126e215DL, 0x4.b508eb23b55p+824 },
{ 7744442890375874439998437722449751e215DL, 0x6.ec343b47eb454p+824 },
{ 5446055617722808337222049746751399e219DL, 0xb.e29b099dbbad8p+836 },
{ 5259924817284655751866507307300383e221DL, 0x4.7be5cb7a74b94p+844 },
{ 2349053309602280518684653473479607e223DL, 0xc.840791ab33778p+848 },
{ 5534327143339863119611304957268887e224DL, 0x1.26de5b86e1345p+856 },
{ 2136701720686441678622876707893655e225DL, 0x4.726eea5814a44p+856 },
{ 1709361376549153342898301366314924e226DL, 0x2.3937752c0a522p+860 },
{ 3418722753098306685796602732629848e226DL, 0x4.726eea5814a44p+860 },
{ 5541359586821491534547363118353759e227DL, 0x4.814b45afbc1fcp+864 },
{ 2698720294183948157326034287647753e230DL, 0x8.920676bf7323p+872 },
{ 5397440588367896314652068575295506e230DL, 0x1.1240ced7ee646p+876 },
{ 3508107768572455110438575298714495e233DL, 0x2.b84cef6d08334p+884 },
{ 7016215537144910220877150597428990e233DL, 0x5.7099deda10668p+884 },
{ 1403243107428982044175430119485798e234DL, 0xa.e133bdb420cdp+884 },
{ 2806486214857964088350860238971596e234DL, 0x1.5c2677b68419ap+888 },
{ 5612972429715928176701720477943192e234DL, 0x2.b84cef6d08334p+888 },
{ 8863103403928930579965819103278029e234DL, 0x4.4b7c5e908bebcp+888 },
{ 3459983233510030189776594282137575e237DL, 0x6.8ca1e2807f854p+896 },
{ 6919966467020060379553188564275150e237DL, 0xd.1943c500ff0a8p+896 },
{ 2767986586808024151821275425710060e238DL, 0x3.4650f1403fc2ap+900 },
{ 5535973173616048303642550851420120e238DL, 0x6.8ca1e2807f854p+900 },
{ 2214389269446419321457020340568048e239DL, 0x1.a32878a01fe15p+904 },
{ 4428778538892838642914040681136096e239DL, 0x3.4650f1403fc2ap+904 },
{ 8857557077785677285828081362272192e239DL, 0x6.8ca1e2807f854p+904 },
{ 3494239048066394893903444077535573e241DL, 0x1.025ddfd33af2fp+912 },
{ 6409754124892808115145571131361333e243DL, 0xb.92235cef2e06p+916 },
{ 3451550133931603602532745892766899e245DL, 0x2.6f126750ed3ecp+924 },
{ 6030401158520284971123070527108695e245DL, 0x4.409ac8bd9175p+924 },
{ 1206080231704056994224614105421739e246DL, 0x8.8135917b22eap+924 },
{ 2412160463408113988449228210843478e246DL, 0x1.1026b22f645d4p+928 },
{ 4824320926816227976898456421686956e246DL, 0x2.204d645ec8ba8p+928 },
{ 9648641853632455953796912843373912e246DL, 0x4.409ac8bd9175p+928 },
{ 3177167469331289395921348296037741e250DL, 0x3.6b274077da574p+940 },
{ 1748659638942498001891311945695003e251DL, 0x1.2d0b26e8d554p+944 },
{ 3497319277884996003782623891390006e251DL, 0x2.5a164dd1aaa8p+944 },
{ 3564415465455574916592766971280586e253DL, 0xe.fb3d193adc38p+948 },
{ 1354413040542463235536259769288698e255DL, 0x2.394417d2b93cep+956 },
{ 2708826081084926471072519538577396e255DL, 0x4.72882fa57279cp+956 },
{ 5417652162169852942145039077154792e255DL, 0x8.e5105f4ae4f38p+956 },
{ 3123867977918010008111079143185849e256DL, 0x3.349c283cd224cp+960 },
{ 1932910926307651756903856324082353e261DL, 0x3.06c699cbd5f6p+976 },
{ 3865821852615303513807712648164706e261DL, 0x6.0d8d3397abecp+976 },
{ 4810955983684551456760555007841915e261DL, 0x7.8864a5a9195bcp+976 },
{ 8676777836299854970568267656006621e261DL, 0xd.95f1d940c5478p+976 },
{ 9621911967369102913521110015683830e261DL, 0xf.10c94b5232b78p+976 },
{ 1924382393473820582704222003136766e262DL, 0x1.e219296a4656fp+980 },
{ 3848764786947641165408444006273532e262DL, 0x3.c43252d48cadep+980 },
{ 7697529573895282330816888012547064e262DL, 0x7.8864a5a9195bcp+980 },
{ 4793898918016889108361286365950741e263DL, 0x2.ee9b9c53a6ac4p+984 },
{ 2241835533203522791040487963097706e264DL, 0xd.b62b2b3659aap+984 },
{ 2957408342309325251940765173749797e264DL, 0x1.21694d86fd7c8p+988 },
{ 5914816684618650503881530347499594e264DL, 0x2.42d29b0dfaf9p+988 },
{ 7441079408716370834021741099945209e265DL, 0x1.c71d2fd49d6f1p+992 },
{ 1999623620064007322318961558412890e266DL, 0x4.c7045fd33ed94p+992 },
{ 3999247240128014644637923116825780e266DL, 0x9.8e08bfa67db28p+992 },
{ 4220445609374187247590610939575827e266DL, 0xa.1553071be2e18p+992 },
{ 8440891218748374495181221879151654e266DL, 0x1.42aa60e37c5c3p+996 },
{ 1599698896051205857855169246730312e267DL, 0x2.63822fe99f6cap+996 },
{ 5020295057399790176518195562940983e267DL, 0x7.7f14fc663d838p+996 },
{ 5979214855736472734666335816634517e271DL, 0x1.5cc2f0671954ep+1012 },
{ 2140001790348707494076958326069627e273DL, 0x3.0c2694d9ac2eep+1016 },
{ 2893681248568924501714561685613969e273DL, 0x4.1ee8be47d2bbcp+1016 },
{ 4280003580697414988153916652139254e273DL, 0x6.184d29b3585dcp+1016 },
{ 6619155896414943295292736351143109e274DL, 0x5.e428962219878p+1020 },
};
int
main (void)
{
int i;
int passes = 0, fails = 0;
for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
{
double d = (double) tests[i].a;
if (d == tests[i].b)
passes++;
else
fails++;
}
printf ("%d passes, %d fails\n", passes, fails);
return fails > 0;
}
Test: exp (88.72269439697265625)
Result:
is: 3.40231600000000000000e+38 3.4023160e+38
should be: 3.40233100000000000000e+38 3.4023310e+38
Not sure if this is a bug of the test suit. would anyone please have a look at it ?
While trying to build libdfp on cross with AT, the libdfp.so.1 is not created and no error message is displayed.
This is the log:
+Linking shared object files into libdfp-1.0.9.so.
/home/rzinsly/AT/eight/at-next-8.0/bin/powerpc64-linux-gnu-gcc -DSHARED -O3 -Wl,-zrelro -fpic -g -m64 -mcpu=power7 -shared -Wl,-soname,libdfp.so.1 -Bsymbolic -Wl,--whole-archive libdecnumber/libdecnumber.a -Wl,--no-whole-archive -Wl,--version-script,libdfp.map dfptypeconv.os mapround.os decode.os fmt_d32.os fmt_d64.os fmt_d128.os fe_decround.os strtod32.os strtod64.os strtod128.os wcstod32.os wcstod64.os wcstod128.os printf_dfp.os init_dfp.os dpd-private.os binpowof10.os decpowof2.os decNumberMath.os acosd32.os acosd64.os acosd128.os acoshd32.os acoshd64.os acoshd128.os asind32.os asind64.os asind128.os asinhd32.os asinhd64.os asinhd128.os atan2d32.os atan2d64.os atan2d128.os atand32.os atand64.os atand128.os atanhd32.os atanhd64.os atanhd128.os cbrtd32.os cbrtd64.os cbrtd128.os ceild32.os ceild64.os ceild128.os copysignd32.os copysignd64.os copysignd128.os cosd32.os cosd64.os cosd128.os coshd32.os coshd64.os coshd128.os erfd32.os erfd64.os erfd128.os exp2d32.os exp2d64.os exp2d128.os expd32.os expd64.os expd128.os expm1d32.os expm1d64.os expm1d128.os fabsd32.os fabsd64.os fabsd128.os fdimd32.os fdimd64.os fdimd128.os isfinited32.os isfinited64.os isfinited128.os issignalingd32.os issignalingd64.os issignalingd128.os floord32.os floord64.os floord128.os fmad32.os fmad64.os fmad128.os fmaxd32.os fmaxd64.os fmaxd128.os fmind32.os fmind64.os fmind128.os fmodd32.os fmodd64.os fmodd128.os fpclassifyd32.os fpclassifyd64.os fpclassifyd128.os frexpd32.os frexpd64.os frexpd128.os hypotd32.os hypotd64.os hypotd128.os ilogbd32.os ilogbd64.os ilogbd128.os llogbd32.os llogbd64.os llogbd128.os isgreaterd32.os isgreaterd64.os isgreaterd128.os isgreaterequald32.os isgreaterequald64.os isgreaterequald128.os isinfd32.os isinfd64.os isinfd128.os islessd32.os islessd64.os islessd128.os islessequald32.os islessequald64.os islessequald128.os islessgreaterd32.os islessgreaterd64.os islessgreaterd128.os isnand32.os isnand64.os isnand128.os isnormald32.os isnormald64.os isnormald128.os isunorderedd32.os isunorderedd64.os isunorderedd128.os ldexpd32.os ldexpd64.os ldexpd128.os lgammad32.os lgammad64.os lgammad128.os llquantexpd32.os llquantexpd64.os llquantexpd128.os llrintd32.os llrintd64.os llrintd128.os llroundd32.os llroundd64.os llroundd128.os log10d32.os log10d64.os log10d128.os log1pd32.os log1pd64.os log1pd128.os log2d32.os log2d64.os log2d128.os logbd32.os logbd64.os logbd128.os logd32.os logd64.os logd128.os lrintd32.os lrintd64.os lrintd128.os lroundd32.os lroundd64.os lroundd128.os modfd32.os modfd64.os modfd128.os nand32.os nand64.os nand128.os nearbyintd32.os nearbyintd64.os nearbyintd128.os nextafterd32.os nextafterd64.os nextafterd128.os nexttowardd32.os nexttowardd64.os nexttowardd128.os powd32.os powd64.os powd128.os quantized32.os quantized64.os quantized128.os quantumd32.os quantumd64.os quantumd128.os remainderd32.os remainderd64.os remainderd128.os rintd32.os rintd64.os rintd128.os roundd32.os roundd64.os roundd128.os roundevend32.os roundevend64.os roundevend128.os samequantumd32.os samequantumd64.os samequantumd128.os scalblnd32.os scalblnd64.os scalblnd128.os scalbnd32.os scalbnd64.os scalbnd128.os signbitd32.os signbitd64.os signbitd128.os sind32.os sind64.os sind128.os sinhd32.os sinhd64.os sinhd128.os sqrtd32.os sqrtd64.os sqrtd128.os tand32.os tand64.os tand128.os tanhd32.os tanhd64.os tanhd128.os tgammad32.os tgammad64.os tgammad128.os truncd32.os truncd64.os truncd128.os addsd3.os adddd3.os addtd3.os divsd3.os divdd3.os divtd3.os eqsd2.os eqdd2.os eqtd2.os extendsddd2.os extendsdtd2.os extendddtd2.os extendsfsd.os extendsddf.os extendsdtf.os extendsfdd.os extenddfdd.os extendddtf.os extendsftd.os extenddftd.os extendtftd.os fixsdsi.os fixddsi.os fixtdsi.os fixsddi.os fixdddi.os fixtddi.os fixunssdsi.os fixunsddsi.os fixunstdsi.os fixunssddi.os fixunsdddi.os fixunstddi.os floatsisd.os floatsidd.os floatsitd.os floatdisd.os floatdidd.os floatditd.os floatunssisd.os floatunssidd.os floatunssitd.os floatunsdisd.os floatunsdidd.os floatunsditd.os gesd2.os gedd2.os getd2.os gtsd2.os gtdd2.os gttd2.os lesd2.os ledd2.os letd2.os ltsd2.os ltdd2.os lttd2.os mulsd3.os muldd3.os multd3.os nesd2.os nedd2.os netd2.os subsd3.os subdd3.os subtd3.os truncddsd2.os trunctddd2.os trunctdsd2.os truncsdsf.os truncdfsd.os trunctfsd.os truncddsf.os truncdddf.os trunctfdd.os trunctdsf.os trunctddf.os trunctdtf.os unordsd2.os unorddd2.os unordtd2.os classify.os -o libdfp-1.0.9.so -lm
+Creating linker .so symlink libdfp.so -> libdfp-1.0.9.so
ln -f -s libdfp-1.0.9.so libdfp.so
+Running ldconfig to create the library compat symlink libdfp.so.1 -> libdfp-1.0.9.so
/sbin/ldconfig -l libdfp-1.0.9.so
/sbin/ldconfig: No link created since soname could not be found for libdfp-1.0.9.so
libdfp was configured with:
CFLAGS='-Wl,-zrelro -g -O3 -m64' CXXFLAGS='-g -O3 -m64' ./configure --build=x86_64-pc-linux-gnu --host=powerpc64-linux-gnu --with-backend=libdecnumber --enable-decimal-float=dpd --with-cpu=power7
The commit beeb238 was tested with the changes in: a42c6fb applied.
Printf statements that uses %f and %Hf didn't work, the values printed will be zero instead of the real values of the variables in %f and %Hf.
For example, this: printf("%f (long double) %Hf (_Decimal64)\n", number, dd)
Will generate this output: 0.000000 (long double) 0.000000 (_Decimal64)
From libdfp side, for a value with 32 bits the function __d32_va (./printf_dfp.c:300) is called with the wrong parameter va_list *ap when this combination occurs, so the function stores the wrong value (something like 0E-101), maybe this is caused by some bug in glibc side.
When %f and %Hf is used together ___printf_fp is called earlier in _IO_vfprintf_internal than other hook combinations that I observed, maybe this could indicate what is wrong.
Exponent check must be not use exp from getmantandexpd*. That's because those function returns the nromalized exponent which is adjusted later in the code. Some exception (underflow/overflow) code is using this exponent which may lead on wrong results:
1.797693134862316e308DD
the result 1797693134862316e309
and exp is 309
. I the case of a conversion to a double 309 is beyond the maximum (base 10) exponent for a double which is 308. So, the expected result of this conversion will be something like 1.797680e+308
but, instead we get infinity since we are use the normalized exponent to check.
In order to fix the code must check the exponent (not normalized) for overflow/underflow. Also we may need to check the mantissa in order to see if the mantissa is not generate a overflow and overflow
The crontab file should have mode bits 644.
Having 664 may spam the syslog of some Linux distributions. Ubuntu 17.04 is known to be affected by this.
On s390x (with hardware dfp) the test test-cast-to-overflow fails with:
3 Error: Expected: "0x1.fffffffffffffp+1023"
Result: "inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:49
4 Error: Expected: "-0x1.fffffffffffffp+1023"
Result: "-inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:50
5 Error: Expected: "0x1.fffffffffffffp+1023"
Result: "inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:51
8 Error: Expected: "-0x1.fffffffffffffp+1023"
Result: "-inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:54
11 Error: Expected: "0x1.fffffep+127"
Result: "inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:61
12 Error: Expected: "-0x1.fffffep+127"
Result: "-inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:62
13 Error: Expected: "0x1.fffffep+127"
Result: "inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:63
16 Error: Expected: "-0x1.fffffep+127"
Result: "-inf"
in: /home/stli/libdfpDir/src/tests/test-cast-to-overflow.c:66
Found 8 failures.
and test-cast-to-underflow with:
5 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:51
6 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:52
10 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:56
11 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:57
17 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:67
18 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:68
22 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:72
23 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:73
Found 8 failures.
The main cause of those fails on s390x is, that the pfpo instruction is used to convert from dfp to bfp values, but unfortunately, GCC emits the pfpo instruction with RM-mode 0 = "According to current DFP rounding mode in bits 25-27 of the floating-point-control register".
Future GCCs (>8.1) have to use RM-mode 1 = "According to current BFP rounding mode in bits 29-31 of the floating-point-control register"
After patching the test-binary in order to use RM-mode 1 or by adding fe_dec_setround() calls, the most tests are passing on s390x.
But there are still the following fails in test-cast-to-underflow:
5 Error: Expected: "0x0.0000000000001p-1022"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:51
// {LINE, FE_TONEAREST, 2.4703282292062326e-325DL, DBL_DENORM_MIN},
6 Error: Expected: "-0x0.0000000000001p-1022"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:52
// {LINE, FE_TONEAREST, -2.4703282292062326e-325DL, -DBL_DENORM_MIN},
17 Error: Expected: "0x1p-149"
Result: "0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:67
// {LINE, FE_TONEAREST, 7.0064922e-46DL, FLT_DENORM_MIN},
18 Error: Expected: "-0x1p-149"
Result: "-0x0p+0"
in: /home/stli/libdfpDir/src/tests/test-cast-to-underflow.c:68
// {LINE, FE_TONEAREST, -7.0064922e-46DL, -FLT_DENORM_MIN},
It seems as the tests use incorrect input values or assumptions.
According to the comment from Joseph Myers in "Conversions incorrect on underflow #32" (#32), "This fix looks wrong for FE_TONEAREST mode, when conversion of a value with absolute value less than or equal to half the least subnormal in the target type should produce +/- 0, not +/- the least subnormal."
The following min-values are defined for the bfp types:
define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221372e-324L)
define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
=> half of the least subnormal (DBL_DENORM_MIN) = 2.4703282292062327e-324.
And not 2.4...26e-325.
=> half of the least subnormal (FLT_DENORM_MIN) = 7.0064923e-46
And not 7.0...22e-46.
Thus the tests should be adjusted in order to use the correct input values and assumptions.
Furthermore, there seems to be a typo in some/all the truncation conversions.
See commit "Fix subnormals for decimal to binary conversions." (4f67ffa):
-In commit-message: "It should return -0.0/0.0 if the absolute value of the result is less than or equal to half the least subnormal or subnormal otherwise (task #32)."
-In code:
if (... || (exp == ... && (mant >= (POWOF10_MIN_DENORM_DBL_MAN/2LL))))
return SIGNBIT(a) ? -0.0 : 0.0;
else
return SIGNBIT(a) ? -__DBL_DENORM_MIN__ : __DBL_DENORM_MIN__;
@racardoso Can you have a look at your commit?
Reproduced this on Ubuntu 14.04 ppc64le:
/home/tuliom/src/libdfp/tests/test-amort.c: In function ‘main’:
/home/tuliom/src/libdfp/tests/test-amort.c:327:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread (inputs, sizeof (inputtype), numinputs, inputfile);
^
lrint.c and similar are rightfully generating warnings about integer overflow for several tests when built for ppc32 or i386. This was introduced by my large chunk of patches to cleanup the build system.
Running 'configure' on libdfp does not substitute the value of the variable 'cross_compilation' on Makefile.in
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.