Add fromfp functions.

TS 18661-1 defines fromfp functions (fromfp, fromfpx, ufromfp,
ufromfpx, and float and long double variants) to convert from
floating-point to an integer type with any signedness and any given
width up to that of intmax_t, in any of the five IEEE rounding modes
(the usual four for binary floating point, plus rounding to nearest
with ties rounding away from zero), with control of whether in-range
non-integer values should result in the "inexact" exception being
raised.  This patch implements these functions for glibc.

These implementations are (apart from raising exceptions) pure integer
implementations; it's entirely possible optimized versions could be
devised for some architectures.  A common math/fromfp.h header
provides various common helper code that can readily be shared between
the implementations for different types.  For each type, the bulk of
the implementation is also shared between the four functions, with
wrappers that define UNSIGNED and INEXACT macros appropriately before
including the main implementation.

As the functions return intmax_t and uintmax_t without math.h being
allowed to expose those typedef names, they are declared using
__intmax_t and __uintmax_t as obtained from <bits/types.h>.

The FP_INT_* rounding direction macros are defined as ascending
integers in the order the names are listed in the TS; I see no
significant value in allowing architectures to vary the values of
them.

The libm-test machinery is duly adapted to handle unsigned int
arguments, and intmax_t and uintmax_t results.  Because each test
input is generally tested for four functions, five rounding modes and
several different widths, the libm-test.inc additions are very large.
Thus, the diffs in the body of this message exclude the libm-test.inc
changes, with the full patch being attached gzipped.  The bulk of the
new tests were generated (expanded from a test input plus rounding
results and information about where it lies in the relevant interval
between integers, to libm-test tests for all relevant combinations of
function, rounding direction and width) by a script that's included in
the patch as math/gen-fromfp-tests.py (input data
math/gen-fromfp-tests-inputs); as an ad hoc script that's not really
expected to be rerun, it's not very polished, but it's at least
plausibly useful for adding any further tests for these functions in
future.  I may split the libm-test tests up by function in future (so
both libm-test.inc and auto-libm-test-out are split into separate
files, and the tests for each function are also built and run
separately), but not for 2.25.

For no obvious reason, adding tgmath tests for the new functions
resulted in -Wuninitialized errors from test-tgmath.c about the
variable i being used uninitialized.  Those errors were correct - the
variable is read by the frexp version in test-tgmath.c (where real
frexp would write through that pointer instead of reading it) - but I
don't know why this patch would result in the pre-existing issue being
newly detected.  The patch initializes the variable to avoid those
errors.

With these changes, glibc 2.25 should have all the library features
from TS 18661-1 other than the functions that round result to narrower
type (and constant rounding directions, but I'm considering those
mainly a compiler feature not a library one).

Tested for x86_64, x86, mips64 and powerpc.

	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(fromfp): New declaration.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
	* math/tgmath.h (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
	* math/math.h: Include <bits/types.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_INT_UPWARD): New enum
	constant and macro.
	(FP_INT_DOWNWARD): Likewise.
	(FP_INT_TOWARDZERO): Likewise.
	(FP_INT_TONEARESTFROMZERO): Likewise.
	(FP_INT_TONEAREST): Likewise.
	* math/Versions (fromfp): New libm symbol at version GLIBC_2.25.
	(fromfpf): Likewise.
	(fromfpl): Likewise.
	(ufromfp): Likewise.
	(ufromfpf): Likewise.
	(ufromfpl): Likewise.
	(fromfpx): Likewise.
	(fromfpxf): Likewise.
	(fromfpxl): Likewise.
	(ufromfpx): Likewise.
	(ufromfpxf): Likewise.
	(ufromfpxl): Likewise.
	* math/Makefile (libm-calls): Add s_fromfpF, s_ufromfpF,
	s_fromfpxF and s_ufromfpxF.
	* math/gen-fromfp-tests.py: New file.
	* math/gen-fromfp-tests-inputs: Likewise.
	* math/libm-test.inc: Include <stdint.h>
	(check_intmax_t): New function.
	(check_uintmax_t): Likewise.
	(struct test_fiu_M_data): New type.
	(struct test_fiu_U_data): Likewise.
	(RUN_TEST_fiu_M): New macro.
	(RUN_TEST_LOOP_fiu_M): Likewise.
	(RUN_TEST_fiu_U): Likewise.
	(RUN_TEST_LOOP_fiu_U): Likewise.
	(fromfp_test_data): New array.
	(fromfp_test): New function.
	(fromfpx_test_data): New array.
	(fromfpx_test): New function.
	(ufromfp_test_data): New array.
	(ufromfp_test): New function.
	(ufromfpx_test_data): New array.
	(ufromfpx_test): New function.
	(main): Call fromfp_test, fromfpx_test, ufromfp_test and
	ufromfpx_test.
	* math/gen-libm-test.pl (parse_args): Handle u, M and U descriptor
	characters.
	* math/test-tgmath-ret.c: Include <stdint.h>.
	(rm): New variable.
	(width): Likewise.
	(CHECK_RET_CONST_TYPE): Take extra arguments and pass them to
	called function.
	(CHECK_RET_CONST_FLOAT): Take extra arguments and pass them to
	CHECK_RET_CONST_TYPE.
	(CHECK_RET_CONST_DOUBLE): Likewise.
	(CHECK_RET_CONST_LDOUBLE): Likewise.
	(CHECK_RET_CONST): Take extra arguments and pass them to calls
	macros.
	(fromfp): New CHECK_RET_CONST call.
	(ufromfp): Likewise.
	(fromfpx): Likewise.
	(ufromfpx): Likewise.
	(do_test): Call check_return_fromfp, check_return_ufromfp,
	check_return_fromfpx and check_return_ufromfpx.
	* math/test-tgmath.c: Include <stdint.h>
	(NCALLS): Increase to 138.
	(F(compile_test)): Initialize i.  Call fromfp functions.
	(F(fromfp)): New function.
	(F(fromfpx)): Likewise.
	(F(ufromfp)): Likewise.
	(F(ufromfpx)): Likewise.
	* manual/arith.texi (Rounding Functions): Document FP_INT_UPWARD,
	FP_INT_DOWNWARD, FP_INT_TOWARDZERO, FP_INT_TONEARESTFROMZERO,
	FP_INT_TONEAREST, fromfp, fromfpf, fromfpl, ufromfp, ufromfpf,
	ufromfpl, fromfpx, fromfpxf, fromfpxl, ufromfpx, ufromfpxf and
	ufromfpxl.
	* manual/libm-err-tab.pl (@all_functions): Add fromfp, fromfpx,
	ufromfp and ufromfpx.
	* math/fromfp.h: New file.
	* sysdeps/ieee754/dbl-64/s_fromfp.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fromfp_main.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fromfpx.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_ufromfp.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_ufromfpx.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpxf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_ufromfpf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_ufromfpxf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fromfp,
	ufromfp, fromfpx and ufromfpx.
	(CFLAGS-nldbl-fromfp.c): New variable.
	(CFLAGS-nldbl-fromfpx.c): Likewise.
	(CFLAGS-nldbl-ufromfp.c): Likewise.
	(CFLAGS-nldbl-ufromfpx.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Include <stdint.h>.
	* sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c: Likewise.
	* sysdeps/nacl/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
This commit is contained in:
Joseph Myers 2016-12-31 00:40:59 +00:00
parent e7eceec0bc
commit 423c2b9d08
74 changed files with 39745 additions and 30 deletions

158
ChangeLog
View File

@ -1,3 +1,161 @@
2016-12-31 Joseph Myers <joseph@codesourcery.com>
* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(fromfp): New declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
* math/tgmath.h (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): New macro.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
* math/math.h: Include <bits/types.h>.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_INT_UPWARD): New enum
constant and macro.
(FP_INT_DOWNWARD): Likewise.
(FP_INT_TOWARDZERO): Likewise.
(FP_INT_TONEARESTFROMZERO): Likewise.
(FP_INT_TONEAREST): Likewise.
* math/Versions (fromfp): New libm symbol at version GLIBC_2.25.
(fromfpf): Likewise.
(fromfpl): Likewise.
(ufromfp): Likewise.
(ufromfpf): Likewise.
(ufromfpl): Likewise.
(fromfpx): Likewise.
(fromfpxf): Likewise.
(fromfpxl): Likewise.
(ufromfpx): Likewise.
(ufromfpxf): Likewise.
(ufromfpxl): Likewise.
* math/Makefile (libm-calls): Add s_fromfpF, s_ufromfpF,
s_fromfpxF and s_ufromfpxF.
* math/gen-fromfp-tests.py: New file.
* math/gen-fromfp-tests-inputs: Likewise.
* math/libm-test.inc: Include <stdint.h>
(check_intmax_t): New function.
(check_uintmax_t): Likewise.
(struct test_fiu_M_data): New type.
(struct test_fiu_U_data): Likewise.
(RUN_TEST_fiu_M): New macro.
(RUN_TEST_LOOP_fiu_M): Likewise.
(RUN_TEST_fiu_U): Likewise.
(RUN_TEST_LOOP_fiu_U): Likewise.
(fromfp_test_data): New array.
(fromfp_test): New function.
(fromfpx_test_data): New array.
(fromfpx_test): New function.
(ufromfp_test_data): New array.
(ufromfp_test): New function.
(ufromfpx_test_data): New array.
(ufromfpx_test): New function.
(main): Call fromfp_test, fromfpx_test, ufromfp_test and
ufromfpx_test.
* math/gen-libm-test.pl (parse_args): Handle u, M and U descriptor
characters.
* math/test-tgmath-ret.c: Include <stdint.h>.
(rm): New variable.
(width): Likewise.
(CHECK_RET_CONST_TYPE): Take extra arguments and pass them to
called function.
(CHECK_RET_CONST_FLOAT): Take extra arguments and pass them to
CHECK_RET_CONST_TYPE.
(CHECK_RET_CONST_DOUBLE): Likewise.
(CHECK_RET_CONST_LDOUBLE): Likewise.
(CHECK_RET_CONST): Take extra arguments and pass them to calls
macros.
(fromfp): New CHECK_RET_CONST call.
(ufromfp): Likewise.
(fromfpx): Likewise.
(ufromfpx): Likewise.
(do_test): Call check_return_fromfp, check_return_ufromfp,
check_return_fromfpx and check_return_ufromfpx.
* math/test-tgmath.c: Include <stdint.h>
(NCALLS): Increase to 138.
(F(compile_test)): Initialize i. Call fromfp functions.
(F(fromfp)): New function.
(F(fromfpx)): Likewise.
(F(ufromfp)): Likewise.
(F(ufromfpx)): Likewise.
* manual/arith.texi (Rounding Functions): Document FP_INT_UPWARD,
FP_INT_DOWNWARD, FP_INT_TOWARDZERO, FP_INT_TONEARESTFROMZERO,
FP_INT_TONEAREST, fromfp, fromfpf, fromfpl, ufromfp, ufromfpf,
ufromfpl, fromfpx, fromfpxf, fromfpxl, ufromfpx, ufromfpxf and
ufromfpxl.
* manual/libm-err-tab.pl (@all_functions): Add fromfp, fromfpx,
ufromfp and ufromfpx.
* math/fromfp.h: New file.
* sysdeps/ieee754/dbl-64/s_fromfp.c: Likewise.
* sysdeps/ieee754/dbl-64/s_fromfp_main.c: Likewise.
* sysdeps/ieee754/dbl-64/s_fromfpx.c: Likewise.
* sysdeps/ieee754/dbl-64/s_ufromfp.c: Likewise.
* sysdeps/ieee754/dbl-64/s_ufromfpx.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpf.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpxf.c: Likewise.
* sysdeps/ieee754/flt-32/s_ufromfpf.c: Likewise.
* sysdeps/ieee754/flt-32/s_ufromfpxf.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fromfp,
ufromfp, fromfpx and ufromfpx.
(CFLAGS-nldbl-fromfp.c): New variable.
(CFLAGS-nldbl-fromfpx.c): Likewise.
(CFLAGS-nldbl-ufromfp.c): Likewise.
(CFLAGS-nldbl-ufromfpx.c): Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Include <stdint.h>.
* sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c: Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-12-30 Florian Weimer <fweimer@redhat.com>
* resolv/Makefile (libresolv-routines): Rename gethnamaddr to

4
NEWS
View File

@ -66,7 +66,9 @@ Version 2.25
- Signaling NaN macros: SNANF, SNAN, SNANL.
- Nearest integer functions: roundeven, roundevenf, roundevenl.
- Nearest integer functions: roundeven, roundevenf, roundevenl, fromfp,
fromfpf, fromfpl, ufromfp, ufromfpf, ufromfpl, fromfpx, fromfpxf,
fromfpxl, ufromfpx, ufromfpxf, ufromfpxl.
- llogb functions: the llogb, llogbf and llogbl functions, and the
FP_LLOGB0 and FP_LLOGBNAN macros.

View File

@ -1495,6 +1495,37 @@ result can actually be represented as an @code{int}---for very large
numbers, this is impossible. The functions listed here return the
result as a @code{double} instead to get around this problem.
The @code{fromfp} functions use the following macros, from TS
18661-1:2014, to specify the direction of rounding. These correspond
to the rounding directions defined in IEEE 754-2008.
@vtable @code
@comment math.h
@comment ISO
@item FP_INT_UPWARD
Round toward @math{+@infinity{}}.
@comment math.h
@comment ISO
@item FP_INT_DOWNWARD
Round toward @math{-@infinity{}}.
@comment math.h
@comment ISO
@item FP_INT_TOWARDZERO
Round toward zero.
@comment math.h
@comment ISO
@item FP_INT_TONEARESTFROMZERO
Round to nearest, ties round away from zero.
@comment math.h
@comment ISO
@item FP_INT_TONEAREST
Round to nearest, ties round to even.
@end vtable
@comment math.h
@comment ISO
@deftypefun double ceil (double @var{x})
@ -1660,6 +1691,56 @@ These functions are just like @code{round}, but they return a
@code{long long int} instead of a floating-point number.
@end deftypefun
@comment math.h
@comment ISO
@deftypefun intmax_t fromfp (double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx intmax_t fromfpf (float @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx intmax_t fromfpl (long double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfp (double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfpf (float @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfpl (long double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx intmax_t fromfpx (double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx intmax_t fromfpxf (float @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx intmax_t fromfpxl (long double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfpx (double @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfpxf (float @var{x}, int @var{round}, unsigned int @var{width})
@comment math.h
@comment ISO
@deftypefunx uintmax_t ufromfpxl (long double @var{x}, int @var{round}, unsigned int @var{width})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
These functions, from TS 18661-1:2014, convert a floating-point number
to an integer according to the rounding direction @var{round} (one of
the @code{FP_INT_*} macros). If the integer is outside the range of a
signed or unsigned (depending on the return type of the function) type
of width @var{width} bits (or outside the range of the return type, if
@var{width} is larger), or if @var{x} is infinite or NaN, or if
@var{width} is zero, a domain error occurs and an unspecified value is
returned. The functions with an @samp{x} in their names raise the
inexact exception when a domain error does not occur and the argument
is not an integer; the other functions do not raise the inexact
exception.
@end deftypefun
@comment math.h
@comment ISO

View File

@ -57,13 +57,14 @@ use vars qw (%results @all_floats %suffices @all_functions);
"clog", "clog10", "conj", "copysign", "cos", "cosh", "cpow", "cproj",
"creal", "csin", "csinh", "csqrt", "ctan", "ctanh", "erf", "erfc",
"exp", "exp10", "exp2", "expm1", "fabs", "fdim", "floor", "fma",
"fmax", "fmaxmag", "fmin", "fminmag", "fmod", "frexp", "gamma", "hypot",
"fmax", "fmaxmag", "fmin", "fminmag", "fmod", "frexp", "fromfp", "fromfpx",
"gamma", "hypot",
"ilogb", "j0", "j1", "jn", "lgamma", "llogb", "lrint",
"llrint", "log", "log10", "log1p", "log2", "logb", "lround",
"llround", "modf", "nearbyint", "nextafter", "nextdown", "nexttoward",
"nextup", "pow", "remainder", "remquo", "rint", "round", "roundeven",
"scalb", "scalbn", "sin", "sincos", "sinh", "sqrt", "tan", "tanh",
"tgamma", "trunc", "y0", "y1", "yn" );
"tgamma", "trunc", "ufromfp", "ufromfpx", "y0", "y1", "yn" );
# canonicalize, fpclassify, getpayload, iscanonical, isnormal,
# isfinite, isinf, isnan, issignaling, issubnormal, iszero, signbit,
# iseqsig, isgreater, isgreaterequal, isless, islessequal,

View File

@ -75,7 +75,8 @@ libm-calls = \
s_issignalingF $(calls:s_%=m_%) x2y2m1F \
gamma_productF lgamma_negF lgamma_productF \
s_nextupF s_totalorderF s_totalordermagF s_getpayloadF \
s_setpayloadF s_setpayloadsigF s_roundevenF $(gen-libm-calls)
s_setpayloadF s_setpayloadsigF s_roundevenF s_fromfpF s_ufromfpF \
s_fromfpxF s_ufromfpxF $(gen-libm-calls)
libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl
libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \

View File

@ -226,5 +226,7 @@ libm {
llogb; llogbf; llogbl;
fmaxmag; fmaxmagf; fmaxmagl; fminmag; fminmagf; fminmagl;
roundeven; roundevenf; roundevenl;
fromfp; fromfpf; fromfpl; ufromfp; ufromfpf; ufromfpl;
fromfpx; fromfpxf; fromfpxl; ufromfpx; ufromfpxf; ufromfpxl;
}
}

View File

@ -388,6 +388,28 @@ __END_NAMESPACE_C99
/* Round X to nearest integer value, rounding halfway cases to even. */
__MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
/* Round X to nearest signed integer value, not raising inexact, with
control of rounding direction and width of result. */
__MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
unsigned int __width));
/* Round X to nearest unsigned integer value, not raising inexact,
with control of rounding direction and width of result. */
__MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
unsigned int __width));
/* Round X to nearest signed integer value, raising inexact for
non-integers, with control of rounding direction and width of
result. */
__MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
unsigned int __width));
/* Round X to nearest unsigned integer value, raising inexact for
non-integers, with control of rounding direction and width of
result. */
__MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
unsigned int __width));
/* Return value with maximum magnitude. */
__MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));

174
math/fromfp.h Normal file
View File

@ -0,0 +1,174 @@
/* Round to integer type. Common helper functions.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
/* The including file should have defined UNSIGNED to 0 (signed return
type) or 1 (unsigned return type), INEXACT to 0 (no inexact
exceptions) or 1 (raise inexact exceptions) and RET_TYPE to the
return type (intmax_t or uintmax_t). */
/* Return the maximum unbiased exponent for an argument (negative if
NEGATIVE is set) that might be in range for a call to a fromfp
function with width WIDTH (greater than 0, and not exceeding that
of intmax_t). The truncated argument may still be out of range in
the case of negative arguments, and if not out of range it may
become out of range as a result of rounding. */
static int
fromfp_max_exponent (bool negative, int width)
{
if (UNSIGNED)
return negative ? -1 : width - 1;
else
return negative ? width - 1 : width - 2;
}
/* Return the result of rounding an integer value X (passed as the
absolute value; NEGATIVE is true if the value is negative), where
HALF_BIT is true if the bit with value 0.5 is set and MORE_BITS is
true if any lower bits are set, in the rounding direction
ROUND. */
static uintmax_t
fromfp_round (bool negative, uintmax_t x, bool half_bit, bool more_bits,
int round)
{
switch (round)
{
case FP_INT_UPWARD:
return x + (!negative && (half_bit || more_bits));
case FP_INT_DOWNWARD:
return x + (negative && (half_bit || more_bits));
case FP_INT_TOWARDZERO:
default:
/* Unknown rounding directions are defined to mean unspecified
rounding; treat this as truncation. */
return x;
case FP_INT_TONEARESTFROMZERO:
return x + half_bit;
case FP_INT_TONEAREST:
return x + (half_bit && ((x & 1) || more_bits));
}
}
/* Integer rounding, of a value whose exponent EXPONENT did not exceed
the maximum exponent MAX_EXPONENT and so did not necessarily
overflow, has produced X (possibly wrapping to 0); the sign is
negative if NEGATIVE is true. Return whether this overflowed the
allowed width. */
static bool
fromfp_overflowed (bool negative, uintmax_t x, int exponent, int max_exponent)
{
if (UNSIGNED)
{
if (negative)
return x != 0;
else if (max_exponent == INTMAX_WIDTH - 1)
return exponent == INTMAX_WIDTH - 1 && x == 0;
else
return x == (1ULL << (max_exponent + 1));
}
else
{
if (negative)
return exponent == max_exponent && x != (1ULL << max_exponent);
else
return x == (1ULL << (max_exponent + 1));
}
}
/* Handle a domain error for a call to a fromfp function with an
argument which is negative if NEGATIVE is set, and specified width
(not exceeding that of intmax_t) WIDTH. The return value is
unspecified (with it being unclear if the result needs to fit
within WIDTH bits in this case); we choose to saturate to the given
number of bits (treating NaNs like any other value). */
static RET_TYPE
fromfp_domain_error (bool negative, unsigned int width)
{
feraiseexcept (FE_INVALID);
__set_errno (EDOM);
/* The return value is unspecified; we choose to saturate to the
given number of bits (treating NaNs like any other value). */
if (UNSIGNED)
{
if (negative)
return 0;
else if (width == INTMAX_WIDTH)
return -1;
else
return (1ULL << width) - 1;
}
else
{
if (width == 0)
return 0;
else if (negative)
return -(1ULL << (width - 1));
else
return (1ULL << (width - 1)) - 1;
}
}
/* Given X, the absolute value of a floating-point number (negative if
NEGATIVE is set) truncated towards zero, where HALF_BIT is true if
the bit with value 0.5 is set and MORE_BITS is true if any lower
bits are set, round it in the rounding direction ROUND, handle
errors and exceptions and return the appropriate return value for a
fromfp function. X originally had floating-point exponent
EXPONENT, which does not exceed MAX_EXPONENT, the return value from
fromfp_max_exponent with width WIDTH. */
static RET_TYPE
fromfp_round_and_return (bool negative, uintmax_t x, bool half_bit,
bool more_bits, int round, int exponent,
int max_exponent, unsigned int width)
{
uintmax_t uret = fromfp_round (negative, x, half_bit, more_bits, round);
if (fromfp_overflowed (negative, uret, exponent, max_exponent))
return fromfp_domain_error (negative, width);
if (INEXACT && (half_bit || more_bits))
{
/* There is no need for this to use the specific floating-point
type for which this header is included, and there is no need
for this header to know that type at all, so just use float
here. */
float force_inexact = 1.0f + FLT_MIN;
math_force_eval (force_inexact);
}
if (UNSIGNED)
/* A negative argument not rounding to zero will already have
produced a domain error. */
return uret;
else
return negative ? -uret : uret;
}

View File

@ -0,0 +1,426 @@
/* Integer inputs within range of uintmax_t. */
i 1:1
i -1:1
i 2:2
i -2:2
i 3:2
i -3:3
i 4:3
i -4:3
i 5:3
i -5:4
i 6:3
i -6:4
i 7:3
i -7:4
i 8:4
i -8:4
i 9:4
i -9:5
i 15:4
i -15:5
i 16:5
i -16:5
i 17:5
i -17:6
i 0x3fffff:22
i -0x3fffff:23
i 0x400000:23
i -0x400000:23
i 0x400001:23
i -0x400001:24
i 0x7fffff:23
i -0x7fffff:24
i 0x800000:24
i -0x800000:24
i 0x800001:24
i -0x800001:25
i 0xffffff:24
i -0xffffff:25
i 0x1000000:25
i -0x1000000:25
#if MANT_DIG >= 53
i 0x1000001:25
i -0x1000001:26
i 0x7ffffffffffffLL:51
i -0x7ffffffffffffLL:52
#endif
i 0x8000000000000LL:52
i -0x8000000000000LL:52
#if MANT_DIG >= 53
i 0x8000000000001LL:52
i -0x8000000000001LL:53
i 0xfffffffffffffLL:52
i -0xfffffffffffffLL:53
#endif
i 0x10000000000000LL:53
i -0x10000000000000LL:53
#if MANT_DIG >= 53
i 0x10000000000001LL:53
i -0x10000000000001LL:54
i 0x1fffffffffffffLL:53
i -0x1fffffffffffffLL:54
#endif
i 0x20000000000000LL:54
i -0x20000000000000LL:54
#if MANT_DIG >= 64
i 0x20000000000001LL:54
i -0x20000000000001LL:55
i 0x3fffffffffffffffLL:62
i -0x3fffffffffffffffLL:63
#endif
i 0x4000000000000000LL:63
i -0x4000000000000000LL:63
#if MANT_DIG >= 64
i 0x4000000000000001LL:63
i -0x4000000000000001LL:64
i 0x7fffffffffffffffLL:63
i -0x7fffffffffffffffLL:64
#endif
i 0x8000000000000000ULL:64
i -INT64_MAX-1:64
#if MANT_DIG >= 64
i 0x8000000000000001ULL:64
i 0xffffffffffffffffULL:64
#endif
i 0x7fffff8000000000LL:63
i -0x7fffff8000000000LL:64
i 0x8000010000000000ULL:64
i 0xffffff0000000000ULL:64
#if MANT_DIG >= 53
i 0x7ffffffffffffc00LL:63
i -0x7ffffffffffffc00LL:64
i 0x8000000000000800ULL:64
i 0xfffffffffffff800ULL:64
#endif
/* Inputs with absolute value between 0 and 1. */
t min_subnorm_value a 0:1 1:1
t -min_subnorm_value a 0:1 -1:1
t min_value a 0:1 1:1
t -min_value a 0:1 -1:1
t 0.1 a 0:1 1:1
t -0.1 a 0:1 -1:1
t 0.25 a 0:1 1:1
t -0.25 a 0:1 -1:1
t 0.499 a 0:1 1:1
t -0.499 a 0:1 -1:1
t 0x0.ffffffp-1 a 0:1 1:1
t -0x0.ffffffp-1 a 0:1 -1:1
#if MANT_DIG >= 53
t 0x0.fffffffffffff8p-1 a 0:1 1:1
t -0x0.fffffffffffff8p-1 a 0:1 -1:1
#endif
#if MANT_DIG >= 64
t 0x0.ffffffffffffffffp-1 a 0:1 1:1
t -0x0.ffffffffffffffffp-1 a 0:1 -1:1
#endif
#if MANT_DIG >= 106
t 0x0.ffffffffffffffffffffffffffcp-1 a 0:1 1:1
t -0x0.ffffffffffffffffffffffffffcp-1 a 0:1 -1:1
#endif
#if MANT_DIG >= 113
t 0x0.ffffffffffffffffffffffffffff8p-1 a 0:1 1:1
t -0x0.ffffffffffffffffffffffffffff8p-1 a 0:1 -1:1
#endif
t 0.5 be 0:1 1:1
t -0.5 be 0:1 -1:1
t 0x1.000002p-1 c 0:1 1:1
t -0x1.000002p-1 c 0:1 -1:1
#if MANT_DIG >= 53
t 0x1.0000000000001p-1 c 0:1 1:1
t -0x1.0000000000001p-1 c 0:1 -1:1
#endif
#if MANT_DIG >= 64
t 0x1.0000000000000002p-1 c 0:1 1:1
t -0x1.0000000000000002p-1 c 0:1 -1:1
#endif
#if MANT_DIG >= 106
t 0x1.000000000000000000000000008p-1 c 0:1 1:1
t -0x1.000000000000000000000000008p-1 c 0:1 -1:1
#endif
#if MANT_DIG >= 113
t 0x1.0000000000000000000000000001p-1 c 0:1 1:1
t -0x1.0000000000000000000000000001p-1 c 0:1 -1:1
#endif
t 0.501 c 0:1 1:1
t -0.501 c 0:1 -1:1
t 0.75 c 0:1 1:1
t -0.75 c 0:1 -1:1
t 0.9 c 0:1 1:1
t -0.9 c 0:1 -1:1
t 0x0.ffffffp0 c 0:1 1:1
t -0x0.ffffffp0 c 0:1 -1:1
#if MANT_DIG >= 53
t 0x0.fffffffffffff8p0 c 0:1 1:1
t -0x0.fffffffffffff8p0 c 0:1 -1:1
#endif
#if MANT_DIG >= 64
t 0x0.ffffffffffffffffp0 c 0:1 1:1
t -0x0.ffffffffffffffffp0 c 0:1 -1:1
#endif
#if MANT_DIG >= 106
t 0x0.ffffffffffffffffffffffffffcp0 c 0:1 1:1
t -0x0.ffffffffffffffffffffffffffcp0 c 0:1 -1:1
#endif
#if MANT_DIG >= 113
t 0x0.ffffffffffffffffffffffffffff8p0 c 0:1 1:1
t -0x0.ffffffffffffffffffffffffffff8p0 c 0:1 -1:1
#endif
/* Various non-integer inputs. */
t 1.25 a 1:1 2:2
t -1.25 a -1:1 -2:2
t 1.5 bo 1:1 2:2
t -1.5 bo -1:1 -2:2
t 1.75 c 1:1 2:2
t -1.75 c -1:1 -2:2
t 2.25 a 2:2 3:2
t -2.25 a -2:2 -3:3
t 2.5 be 2:2 3:2
t -2.5 be -2:2 -3:3
t 2.75 c 2:2 3:2
t -2.75 c -2:2 -3:3
t 3.25 a 3:2 4:3
t -3.25 a -3:3 -4:3
t 3.5 bo 3:2 4:3
t -3.5 bo -3:3 -4:3
t 3.75 c 3:2 4:3
t -3.75 c -3:3 -4:3
t 4.25 a 4:3 5:3
t -4.25 a -4:3 -5:4
t 4.5 be 4:3 5:3
t -4.5 be -4:3 -5:4
t 4.75 c 4:3 5:3
t -4.75 c -4:3 -5:4
t 5.25 a 5:3 6:3
t -5.25 a -5:4 -6:4
t 5.5 bo 5:3 6:3
t -5.5 bo -5:4 -6:4
t 5.75 c 5:3 6:3
t -5.75 c -5:4 -6:4
/* 1, 1.5, 2, 2.5, 3, 3.5 +/- 1ulp. */
t 0x1.000002p0 a 1:1 2:2
t -0x1.000002p0 a -1:1 -2:2
t 0x2.fffffcp-1 a 1:1 2:2
t -0x2.fffffcp-1 a -1:1 -2:2
t 0x3.000004p-1 c 1:1 2:2
t -0x3.000004p-1 c -1:1 -2:2
t 0x0.ffffffp1 c 1:1 2:2
t -0x0.ffffffp1 c -1:1 -2:2
t 0x1.000002p1 a 2:2 3:2
t -0x1.000002p1 a -2:2 -3:3
t 0x4.fffff8p-1 a 2:2 3:2
t -0x4.fffff8p-1 a -2:2 -3:3
t 0x5.000008p-1 c 2:2 3:2
t -0x5.000008p-1 c -2:2 -3:3
t 0x2.fffffcp0 c 2:2 3:2
t -0x2.fffffcp0 c -2:2 -3:3
t 0x3.000004p0 a 3:2 4:3
t -0x3.000004p0 a -3:3 -4:3
t 0x6.fffff8p-1 a 3:2 4:3
t -0x6.fffff8p-1 a -3:3 -4:3
t 0x7.000008p-1 c 3:2 4:3
t -0x7.000008p-1 c -3:3 -4:3
#if MANT_DIG >= 53
t 0x1.0000000000001p0 a 1:1 2:2
t -0x1.0000000000001p0 a -1:1 -2:2
t 0x2.ffffffffffffep-1 a 1:1 2:2
t -0x2.ffffffffffffep-1 a -1:1 -2:2
t 0x3.0000000000002p-1 c 1:1 2:2
t -0x3.0000000000002p-1 c -1:1 -2:2
t 0x0.fffffffffffff8p1 c 1:1 2:2
t -0x0.fffffffffffff8p1 c -1:1 -2:2
t 0x1.0000000000001p1 a 2:2 3:2
t -0x1.0000000000001p1 a -2:2 -3:3
t 0x4.ffffffffffffcp-1 a 2:2 3:2
t -0x4.ffffffffffffcp-1 a -2:2 -3:3
t 0x5.0000000000004p-1 c 2:2 3:2
t -0x5.0000000000004p-1 c -2:2 -3:3
t 0x2.ffffffffffffep0 c 2:2 3:2
t -0x2.ffffffffffffep0 c -2:2 -3:3
t 0x3.0000000000002p0 a 3:2 4:3
t -0x3.0000000000002p0 a -3:3 -4:3
t 0x6.ffffffffffffcp-1 a 3:2 4:3
t -0x6.ffffffffffffcp-1 a -3:3 -4:3
t 0x7.0000000000004p-1 c 3:2 4:3
t -0x7.0000000000004p-1 c -3:3 -4:3
#endif
#if MANT_DIG >= 64
t 0x1.0000000000000002p0 a 1:1 2:2
t -0x1.0000000000000002p0 a -1:1 -2:2
t 0x2.fffffffffffffffcp-1 a 1:1 2:2
t -0x2.fffffffffffffffcp-1 a -1:1 -2:2
t 0x3.0000000000000004p-1 c 1:1 2:2
t -0x3.0000000000000004p-1 c -1:1 -2:2
t 0x0.ffffffffffffffffp1 c 1:1 2:2
t -0x0.ffffffffffffffffp1 c -1:1 -2:2
t 0x1.0000000000000002p1 a 2:2 3:2
t -0x1.0000000000000002p1 a -2:2 -3:3
t 0x4.fffffffffffffff8p-1 a 2:2 3:2
t -0x4.fffffffffffffff8p-1 a -2:2 -3:3
t 0x5.0000000000000008p-1 c 2:2 3:2
t -0x5.0000000000000008p-1 c -2:2 -3:3
t 0x2.fffffffffffffffcp0 c 2:2 3:2
t -0x2.fffffffffffffffcp0 c -2:2 -3:3
t 0x3.0000000000000004p0 a 3:2 4:3
t -0x3.0000000000000004p0 a -3:3 -4:3
t 0x6.fffffffffffffff8p-1 a 3:2 4:3
t -0x6.fffffffffffffff8p-1 a -3:3 -4:3
t 0x7.0000000000000008p-1 c 3:2 4:3
t -0x7.0000000000000008p-1 c -3:3 -4:3
#endif
#if MANT_DIG >= 106
t 0x1.000000000000000000000000008p0 a 1:1 2:2
t -0x1.000000000000000000000000008p0 a -1:1 -2:2
t 0x2.ffffffffffffffffffffffffffp-1 a 1:1 2:2
t -0x2.ffffffffffffffffffffffffffp-1 a -1:1 -2:2
t 0x3.00000000000000000000000001p-1 c 1:1 2:2
t -0x3.00000000000000000000000001p-1 c -1:1 -2:2
t 0x0.ffffffffffffffffffffffffffcp1 c 1:1 2:2
t -0x0.ffffffffffffffffffffffffffcp1 c -1:1 -2:2
t 0x1.000000000000000000000000008p1 a 2:2 3:2
t -0x1.000000000000000000000000008p1 a -2:2 -3:3
t 0x4.fffffffffffffffffffffffffep-1 a 2:2 3:2
t -0x4.fffffffffffffffffffffffffep-1 a -2:2 -3:3
t 0x5.00000000000000000000000002p-1 c 2:2 3:2
t -0x5.00000000000000000000000002p-1 c -2:2 -3:3
t 0x2.ffffffffffffffffffffffffffp0 c 2:2 3:2
t -0x2.ffffffffffffffffffffffffffp0 c -2:2 -3:3
t 0x3.00000000000000000000000001p0 a 3:2 4:3
t -0x3.00000000000000000000000001p0 a -3:3 -4:3
t 0x6.fffffffffffffffffffffffffep-1 a 3:2 4:3
t -0x6.fffffffffffffffffffffffffep-1 a -3:3 -4:3
t 0x7.00000000000000000000000002p-1 c 3:2 4:3
t -0x7.00000000000000000000000002p-1 c -3:3 -4:3
#endif
#if MANT_DIG >= 113
t 0x1.0000000000000000000000000001p0 a 1:1 2:2
t -0x1.0000000000000000000000000001p0 a -1:1 -2:2
t 0x2.fffffffffffffffffffffffffffep-1 a 1:1 2:2
t -0x2.fffffffffffffffffffffffffffep-1 a -1:1 -2:2
t 0x3.0000000000000000000000000002p-1 c 1:1 2:2
t -0x3.0000000000000000000000000002p-1 c -1:1 -2:2
t 0x0.ffffffffffffffffffffffffffff8p1 c 1:1 2:2
t -0x0.ffffffffffffffffffffffffffff8p1 c -1:1 -2:2
t 0x1.0000000000000000000000000001p1 a 2:2 3:2
t -0x1.0000000000000000000000000001p1 a -2:2 -3:3
t 0x4.fffffffffffffffffffffffffffcp-1 a 2:2 3:2
t -0x4.fffffffffffffffffffffffffffcp-1 a -2:2 -3:3
t 0x5.0000000000000000000000000004p-1 c 2:2 3:2
t -0x5.0000000000000000000000000004p-1 c -2:2 -3:3
t 0x2.fffffffffffffffffffffffffffep0 c 2:2 3:2
t -0x2.fffffffffffffffffffffffffffep0 c -2:2 -3:3
t 0x3.0000000000000000000000000002p0 a 3:2 4:3
t -0x3.0000000000000000000000000002p0 a -3:3 -4:3
t 0x6.fffffffffffffffffffffffffffcp-1 a 3:2 4:3
t -0x6.fffffffffffffffffffffffffffcp-1 a -3:3 -4:3
t 0x7.0000000000000000000000000004p-1 c 3:2 4:3
t -0x7.0000000000000000000000000004p-1 c -3:3 -4:3
#endif
/* 31, 32, 33 fractional bits. */
#if MANT_DIG >= 53
t 0x200000.7ffffffep0 a 0x200000:22 0x200001:22
t -0x200000.7ffffffep0 a -0x200000:22 -0x200001:23
t 0x200000.8p0 be 0x200000:22 0x200001:22
t -0x200000.8p0 be -0x200000:22 -0x200001:23
t 0x200000.80000002p0 c 0x200000:22 0x200001:22
t -0x200000.80000002p0 c -0x200000:22 -0x200001:23
t 0x200001.7ffffffep0 a 0x200001:22 0x200002:22
t -0x200001.7ffffffep0 a -0x200001:23 -0x200002:23
t 0x200001.8p0 bo 0x200001:22 0x200002:22
t -0x200001.8p0 bo -0x200001:23 -0x200002:23
t 0x200001.80000002p0 c 0x200001:22 0x200002:22
t -0x200001.80000002p0 c -0x200001:23 -0x200002:23
t 0x3fffff.fffffffep0 c 0x3fffff:22 0x400000:23
t -0x3fffff.fffffffep0 c -0x3fffff:23 -0x400000:23
t 0x100000.7fffffffp0 a 0x100000:21 0x100001:21
t -0x100000.7fffffffp0 a -0x100000:21 -0x100001:22
t 0x100000.8p0 be 0x100000:21 0x100001:21
t -0x100000.8p0 be -0x100000:21 -0x100001:22
t 0x100000.80000001p0 c 0x100000:21 0x100001:21
t -0x100000.80000001p0 c -0x100000:21 -0x100001:22
t 0x100001.7fffffffp0 a 0x100001:21 0x100002:21
t -0x100001.7fffffffp0 a -0x100001:22 -0x100002:22
t 0x100001.8p0 bo 0x100001:21 0x100002:21
t -0x100001.8p0 bo -0x100001:22 -0x100002:22
t 0x100001.80000001p0 c 0x100001:21 0x100002:21
t -0x100001.80000001p0 c -0x100001:22 -0x100002:22
t 0x1fffff.ffffffffp0 c 0x1fffff:21 0x200000:22
t -0x1fffff.ffffffffp0 c -0x1fffff:22 -0x200000:22
t 0x80000.7fffffff8p0 a 0x80000:20 0x80001:20
t -0x80000.7fffffff8p0 a -0x80000:20 -0x80001:21
t 0x80000.8p0 be 0x80000:20 0x80001:20
t -0x80000.8p0 be -0x80000:20 -0x80001:21
t 0x80000.800000008p0 c 0x80000:20 0x80001:20
t -0x80000.800000008p0 c -0x80000:20 -0x80001:21
t 0x80001.7fffffff8p0 a 0x80001:20 0x80002:20
t -0x80001.7fffffff8p0 a -0x80001:21 -0x80002:21
t 0x80001.8p0 bo 0x80001:20 0x80002:20
t -0x80001.8p0 bo -0x80001:21 -0x80002:21
t 0x80001.800000008p0 c 0x80001:20 0x80002:20
t -0x80001.800000008p0 c -0x80001:21 -0x80002:21
t 0xfffff.ffffffff8p0 c 0xfffff:20 0x100000:21
t -0xfffff.ffffffff8p0 c -0xfffff:21 -0x100000:21
#endif
#if MANT_DIG >= 64
t 0x100000000.7ffffffep0 a 0x100000000LL:33 0x100000001LL:33
t -0x100000000.7ffffffep0 a -0x100000000LL:33 -0x100000001LL:34
t 0x100000000.8p0 be 0x100000000LL:33 0x100000001LL:33
t -0x100000000.8p0 be -0x100000000LL:33 -0x100000001LL:34
t 0x100000000.80000002p0 c 0x100000000LL:33 0x100000001LL:33
t -0x100000000.80000002p0 c -0x100000000LL:33 -0x100000001LL:34
t 0x100000001.7ffffffep0 a 0x100000001LL:33 0x100000002LL:33
t -0x100000001.7ffffffep0 a -0x100000001LL:34 -0x100000002LL:34
t 0x100000001.8p0 bo 0x100000001LL:33 0x100000002LL:33
t -0x100000001.8p0 bo -0x100000001LL:34 -0x100000002LL:34
t 0x100000001.80000002p0 c 0x100000001LL:33 0x100000002LL:33
t -0x100000001.80000002p0 c -0x100000001LL:34 -0x100000002LL:34
t 0x1ffffffff.fffffffep0 c 0x1ffffffffLL:33 0x200000000LL:34
t -0x1ffffffff.fffffffep0 c -0x1ffffffffLL:34 -0x200000000LL:34
t 0x80000000.7fffffffp0 a 0x80000000LL:32 0x80000001LL:32
t -0x80000000.7fffffffp0 a -0x80000000LL:32 -0x80000001LL:33
t 0x80000000.8p0 be 0x80000000LL:32 0x80000001LL:32
t -0x80000000.8p0 be -0x80000000LL:32 -0x80000001LL:33
t 0x80000000.80000001p0 c 0x80000000LL:32 0x80000001LL:32
t -0x80000000.80000001p0 c -0x80000000LL:32 -0x80000001LL:33
t 0x80000001.7fffffffp0 a 0x80000001LL:32 0x80000002LL:32
t -0x80000001.7fffffffp0 a -0x80000001LL:33 -0x80000002LL:33
t 0x80000001.8p0 bo 0x80000001LL:32 0x80000002LL:32
t -0x80000001.8p0 bo -0x80000001LL:33 -0x80000002LL:33
t 0x80000001.80000001p0 c 0x80000001LL:32 0x80000002LL:32
t -0x80000001.80000001p0 c -0x80000001LL:33 -0x80000002LL:33
t 0xffffffff.ffffffffp0 c 0xffffffffLL:32 0x100000000LL:33
t -0xffffffff.ffffffffp0 c -0xffffffffLL:33 -0x100000000LL:33
t 0x40000000.7fffffff8p0 a 0x40000000LL:31 0x40000001LL:31
t -0x40000000.7fffffff8p0 a -0x40000000LL:31 -0x40000001LL:32
t 0x40000000.8p0 be 0x40000000LL:31 0x40000001LL:31
t -0x40000000.8p0 be -0x40000000LL:31 -0x40000001LL:32
t 0x40000000.800000008p0 c 0x40000000LL:31 0x40000001LL:31
t -0x40000000.800000008p0 c -0x40000000LL:31 -0x40000001LL:32
t 0x40000001.7fffffff8p0 a 0x40000001LL:31 0x40000002LL:31
t -0x40000001.7fffffff8p0 a -0x40000001LL:32 -0x40000002LL:32
t 0x40000001.8p0 bo 0x40000001LL:31 0x40000002LL:31
t -0x40000001.8p0 bo -0x40000001LL:32 -0x40000002LL:32
t 0x40000001.800000008p0 c 0x40000001LL:31 0x40000002LL:31
t -0x40000001.800000008p0 c -0x40000001LL:32 -0x40000002LL:32
t 0x7fffffff.ffffffff8p0 c 0x7fffffffLL:31 0x80000000LL:32
t -0x7fffffff.ffffffff8p0 c -0x7fffffffLL:32 -0x80000000LL:32
#endif
/* Tests where overflow depends on the rounding mode. */
#if MANT_DIG >= 64
t 0x7fffffffffffffff.8p0 bo 0x7fffffffffffffffLL:63 0x8000000000000000ULL:64
#endif
#if MANT_DIG >= 72
t 0x7fffffffffffffff.7fp0 a 0x7fffffffffffffffLL:63 0x8000000000000000ULL:64
t 0x7fffffffffffffff.81p0 c 0x7fffffffffffffffLL:63 0x8000000000000000ULL:64
t 0xffffffffffffffff.7fp0 a 0xffffffffffffffffULL:64 0x10000000000000000ULL:65
t 0xffffffffffffffff.8p0 bo 0xffffffffffffffffULL:64 0x10000000000000000ULL:65
t 0xffffffffffffffff.81p0 c 0xffffffffffffffffULL:64 0x10000000000000000ULL:65
t -0x8000000000000000.7fp0 a -INT64_MAX-1:64 -0x8000000000000001LL:65
t -0x8000000000000000.8p0 be -INT64_MAX-1:64 -0x8000000000000001LL:65
t -0x8000000000000000.81p0 c -INT64_MAX-1:64 -0x8000000000000001LL:65
#endif

143
math/gen-fromfp-tests.py Executable file
View File

@ -0,0 +1,143 @@
#!/usr/bin/python3
# Expand test inputs for fromfp functions into text to edit into libm-test.inc.
# Copyright (C) 2016 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
# Take test inputs on stdin, in format:
#
# i <value>:width [int-value]
#
# for integer inputs, or
#
# t <value> <pos> <z> <a>
#
# for noninteger inputs, where <pos> is "a" for fractional part
# between 0 and 0.5, "be" for 0.5 with even integer part, "bo" for 0.5
# with odd integer part and "c" for between 0.5 and 1; <z> is the
# value truncated towards zero, <a> is the value rounded away from
# zero, both being in the form <value>:<width>. Width values are for
# the smallest type that can hold the value; for positive values, this
# is an unsigned type.
#
# Command-line argument is function to generate tests for. Any input
# lines not of the above form are just passed through unchanged.
#
# Note that the output of this script forms the largest part of the
# tests for the fromfp functions, but not the whole of those tests.
import sys
func = sys.argv[1]
invalid_res = 'IGNORE, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM'
exact_res = 'NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED'
if func == 'fromfpx' or func == 'ufromfpx':
inexact_res = 'INEXACT_EXCEPTION|ERRNO_UNCHANGED'
else:
inexact_res = exact_res
unsigned = func.startswith('ufromfp')
rm_list = ['FP_INT_UPWARD', 'FP_INT_DOWNWARD', 'FP_INT_TOWARDZERO',
'FP_INT_TONEARESTFROMZERO', 'FP_INT_TONEAREST']
rm_away_pos = {'FP_INT_UPWARD': 'a',
'FP_INT_DOWNWARD': 'z',
'FP_INT_TOWARDZERO': 'z',
'FP_INT_TONEARESTFROMZERO': 'be',
'FP_INT_TONEAREST': 'bo'}
rm_away_neg = {'FP_INT_UPWARD': 'z',
'FP_INT_DOWNWARD': 'a',
'FP_INT_TOWARDZERO': 'z',
'FP_INT_TONEARESTFROMZERO': 'be',
'FP_INT_TONEAREST': 'bo'}
if unsigned:
test_macro = 'TEST_fiu_U'
else:
test_macro = 'TEST_fiu_M'
for line in sys.stdin:
if line.startswith('i'):
data = line.split()
val_width = data[1]
val, width = val_width.split(':')
negative = val.startswith('-')
if unsigned and negative:
continue
width = int(width)
if not unsigned and not negative:
width += 1
width_list = [0, 1]
if width > 2:
width_list.append(width - 1)
if width > 1 and width <= 64:
width_list.append(width)
if width < 64:
width_list.append(width + 1)
if width < 63:
width_list.append(64)
width_list = [(w, str(w)) for w in width_list]
width_list.append((64, 'UINT_MAX'))
for rm in rm_list:
for we in width_list:
w, ws = we
if w < width:
print(' %s (%s, %s, %s, %s, %s),' %
(test_macro, func, val, rm, ws, invalid_res))
else:
print(' %s (%s, %s, %s, %s, %s, %s),' %
(test_macro, func, val, rm, ws, val, exact_res))
elif line.startswith('t'):
data = line.split()
val = data[1]
pos = data[2]
z, z_width = data[3].split(':')
z_width = int(z_width)
a, a_width = data[4].split(':')
a_width = int(a_width)
if unsigned and z.startswith('-'):
continue
negative = val.startswith('-')
if negative:
rm_away = rm_away_neg
else:
rm_away = rm_away_pos
for rm in rm_list:
if pos >= rm_away[rm]:
res, width = a, a_width
else:
res, width = z, z_width
if not unsigned and not negative and res != '0':
width += 1
width_list = [0, 1]
if width > 2:
width_list.append(width - 1)
if width > 1 and width <= 64:
width_list.append(width)
if width < 64:
width_list.append(width + 1)
if width < 63:
width_list.append(64)
width_list = [(w, str(w)) for w in width_list]
width_list.append((64, 'UINT_MAX'))
for we in width_list:
w, ws = we
if w < width or (unsigned and res.startswith('-')):
print(' %s (%s, %s, %s, %s, %s),' %
(test_macro, func, val, rm, ws, invalid_res))
else:
print(' %s (%s, %s, %s, %s, %s, %s),' %
(test_macro, func, val, rm, ws, res, inexact_res))
else:
print(line.rstrip())

View File

@ -223,8 +223,8 @@ sub parse_args {
if ($current_arg > 1) {
$comma = ', ';
}
# FLOAT, int, long int, long long int
if ($descr[$i] =~ /f|j|i|l|L/) {
# FLOAT, long double, int, unsigned int, long int, long long int
if ($descr[$i] =~ /f|j|i|u|l|L/) {
$call_args .= $comma . &beautify ($args[$current_arg]);
++$current_arg;
next;
@ -252,7 +252,7 @@ sub parse_args {
$num_res = 0;
@descr = split //,$descr_res;
foreach (@descr) {
if ($_ =~ /f|i|l|L/) {
if ($_ =~ /f|i|l|L|M|U/) {
++$num_res;
} elsif ($_ eq 'c') {
$num_res += 2;
@ -289,7 +289,7 @@ sub parse_args {
@descr = split //,$descr_args;
for ($i=0; $i <= $#descr; $i++) {
# FLOAT, int, long int, long long int
if ($descr[$i] =~ /f|j|i|l|L/) {
if ($descr[$i] =~ /f|j|i|u|l|L/) {
if ($descr[$i] eq "f") {
$cline .= ", " . &apply_lit ($args[$current_arg]);
} else {
@ -327,7 +327,7 @@ sub parse_args {
$cline_res = "";
@special = ();
foreach (@descr) {
if ($_ =~ /b|f|j|i|l|L/ ) {
if ($_ =~ /b|f|j|i|l|L|M|U/ ) {
my ($result) = $args_res[$current_arg];
if ($result eq "IGNORE") {
$ignore_result_any = 1;

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,9 @@
__BEGIN_DECLS
/* Get definitions of __intmax_t and __uintmax_t. */
#include <bits/types.h>
/* Get machine-dependent vector math functions declarations. */
#include <bits/math-vector.h>
@ -152,6 +155,28 @@ typedef _Float128x double_t;
#include <bits/fp-fast.h>
#if __GLIBC_USE (IEC_60559_BFP_EXT)
/* Rounding direction macros for fromfp functions. */
enum
{
FP_INT_UPWARD =
# define FP_INT_UPWARD 0
FP_INT_UPWARD,
FP_INT_DOWNWARD =
# define FP_INT_DOWNWARD 1
FP_INT_DOWNWARD,
FP_INT_TOWARDZERO =
# define FP_INT_TOWARDZERO 2
FP_INT_TOWARDZERO,
FP_INT_TONEARESTFROMZERO =
# define FP_INT_TONEARESTFROMZERO 3
FP_INT_TONEARESTFROMZERO,
FP_INT_TONEAREST =
# define FP_INT_TONEAREST 4
FP_INT_TONEAREST,
};
#endif
/* The file <bits/mathcalls.h> contains the prototypes for all the
actual math functions. These macros are used for those prototypes,
so we can easily declare each function as both `name' and `__name',

View File

@ -20,11 +20,14 @@
#include <math.h>
#include <complex.h>
#include <tgmath.h>
#include <stdint.h>
#include <stdio.h>
static float fx;
static double dx;
static long double lx;
static int rm = FP_INT_UPWARD;
static unsigned int width = 64;
static int errors = 0;
static void
@ -36,28 +39,28 @@ our_error (const char *c)
/* First function where the return type is constant. */
#define CHECK_RET_CONST_TYPE(func, rettype, arg, name) \
if (sizeof (func (arg)) != sizeof (rettype)) \
#define CHECK_RET_CONST_TYPE(func, rettype, arg, name, ...) \
if (sizeof (func (arg, ## __VA_ARGS__)) != sizeof (rettype)) \
our_error ("Return size of " #func " is wrong with " #name " argument");
#define CHECK_RET_CONST_FLOAT(func, rettype) \
CHECK_RET_CONST_TYPE (func, rettype, fx, float)
#define CHECK_RET_CONST_DOUBLE(func, rettype) \
CHECK_RET_CONST_TYPE (func, rettype, dx, double)
#define CHECK_RET_CONST_FLOAT(func, rettype, ...) \
CHECK_RET_CONST_TYPE (func, rettype, fx, float, ## __VA_ARGS__)
#define CHECK_RET_CONST_DOUBLE(func, rettype, ...) \
CHECK_RET_CONST_TYPE (func, rettype, dx, double, ## __VA_ARGS__)
#ifdef NO_LONG_DOUBLE
# define CHECK_RET_CONST_LDOUBLE(func, rettype)
# define CHECK_RET_CONST_LDOUBLE(func, rettype, ...)
#else
# define CHECK_RET_CONST_LDOUBLE(func, rettype) \
CHECK_RET_CONST_TYPE (func, rettype, lx, long double)
# define CHECK_RET_CONST_LDOUBLE(func, rettype, ...) \
CHECK_RET_CONST_TYPE (func, rettype, lx, long double, ## __VA_ARGS__)
#endif
#define CHECK_RET_CONST(func, rettype) \
#define CHECK_RET_CONST(func, rettype, ...) \
static void \
check_return_ ##func (void) \
{ \
CHECK_RET_CONST_FLOAT (func, rettype) \
CHECK_RET_CONST_DOUBLE (func, rettype) \
CHECK_RET_CONST_LDOUBLE (func, rettype) \
CHECK_RET_CONST_FLOAT (func, rettype, ## __VA_ARGS__) \
CHECK_RET_CONST_DOUBLE (func, rettype, ## __VA_ARGS__) \
CHECK_RET_CONST_LDOUBLE (func, rettype, ## __VA_ARGS__) \
}
CHECK_RET_CONST(ilogb, int)
@ -66,6 +69,10 @@ CHECK_RET_CONST(lrint, long)
CHECK_RET_CONST(lround, long)
CHECK_RET_CONST(llrint, long long)
CHECK_RET_CONST(llround, long long)
CHECK_RET_CONST(fromfp, intmax_t, rm, width)
CHECK_RET_CONST(ufromfp, uintmax_t, rm, width)
CHECK_RET_CONST(fromfpx, intmax_t, rm, width)
CHECK_RET_CONST(ufromfpx, uintmax_t, rm, width)
static int
do_test (void)
@ -76,6 +83,10 @@ do_test (void)
check_return_lround ();
check_return_llrint ();
check_return_llround ();
check_return_fromfp ();
check_return_ufromfp ();
check_return_fromfpx ();
check_return_ufromfpx ();
printf ("%Zd\n", sizeof(carg (lx)));

View File

@ -22,6 +22,7 @@
#undef __NO_MATH_INLINES
#define __NO_MATH_INLINES 1
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <tgmath.h>
@ -50,7 +51,7 @@ int count_cdouble;
int count_cfloat;
int count_cldouble;
#define NCALLS 134
#define NCALLS 138
#define NCALLS_INT 4
#define NCCALLS 47
@ -226,10 +227,12 @@ F(compile_test) (void)
{
TYPE a, b, c = 1.0;
complex TYPE d;
int i;
int i = 2;
int saved_count;
long int j;
long long int k;
intmax_t m;
uintmax_t um;
a = cos (cos (x));
b = acos (acos (a));
@ -269,6 +272,8 @@ F(compile_test) (void)
b = remquo (remquo (a, b, &i), remquo (c, x, &i), &i);
j = lrint (x) + lround (a);
k = llrint (b) + llround (c);
m = fromfp (a, FP_INT_UPWARD, 2) + fromfpx (b, FP_INT_DOWNWARD, 3);
um = ufromfp (c, FP_INT_TONEAREST, 4) + ufromfpx (a, FP_INT_TOWARDZERO, 5);
a = erf (erf (x));
b = erfc (erfc (a));
a = tgamma (tgamma (x));
@ -298,7 +303,7 @@ F(compile_test) (void)
c = fma (i, b, i);
a = pow (i, c);
#endif
x = a + b + c + i + j + k;
x = a + b + c + i + j + k + m + um;
saved_count = count;
if (ccount != 0)
@ -373,6 +378,9 @@ F(compile_test) (void)
a = remquo (y, y, &i);
j = lrint (y) + lround (y);
k = llrint (y) + llround (y);
m = fromfp (y, FP_INT_UPWARD, 6) + fromfpx (y, FP_INT_DOWNWARD, 7);
um = (ufromfp (y, FP_INT_TONEAREST, 8)
+ ufromfpx (y, FP_INT_TOWARDZERO, 9));
a = erf (y);
a = erfc (y);
a = tgamma (y);
@ -750,6 +758,38 @@ long long int
return x;
}
intmax_t
(F(fromfp)) (TYPE x, int round, unsigned int width)
{
++count;
P ();
return x;
}
intmax_t
(F(fromfpx)) (TYPE x, int round, unsigned int width)
{
++count;
P ();
return x;
}
uintmax_t
(F(ufromfp)) (TYPE x, int round, unsigned int width)
{
++count;
P ();
return x;
}
uintmax_t
(F(ufromfpx)) (TYPE x, int round, unsigned int width)
{
++count;
P ();
return x;
}
TYPE
(F(erf)) (TYPE x)
{

View File

@ -155,6 +155,14 @@
+ (__tgmath_real_type (Val3)) 0)) \
Fct##f (Val1, Val2, Val3)))
# define __TGMATH_TERNARY_FIRST_REAL_RET_ONLY(Val1, Val2, Val3, RetType, Fct) \
(__extension__ ((sizeof (Val1) == sizeof (double) \
|| __builtin_classify_type (Val1) != 8) \
? (RetType) Fct (Val1, Val2, Val3) \
: (sizeof (Val1) == sizeof (float)) \
? (RetType) Fct##f (Val1, Val2, Val3) \
: (RetType) __tgml(Fct) (Val1, Val2, Val3)))
/* XXX This definition has to be changed as soon as the compiler understands
the imaginary keyword. */
# define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \
@ -441,6 +449,18 @@
/* Round X to nearest integer value, rounding halfway cases to even. */
# define roundeven(Val) __TGMATH_UNARY_REAL_ONLY (Val, roundeven)
# define fromfp(Val1, Val2, Val3) \
__TGMATH_TERNARY_FIRST_REAL_RET_ONLY (Val1, Val2, Val3, __intmax_t, fromfp)
# define ufromfp(Val1, Val2, Val3) \
__TGMATH_TERNARY_FIRST_REAL_RET_ONLY (Val1, Val2, Val3, __uintmax_t, ufromfp)
# define fromfpx(Val1, Val2, Val3) \
__TGMATH_TERNARY_FIRST_REAL_RET_ONLY (Val1, Val2, Val3, __intmax_t, fromfpx)
# define ufromfpx(Val1, Val2, Val3) \
__TGMATH_TERNARY_FIRST_REAL_RET_ONLY (Val1, Val2, Val3, __uintmax_t, ufromfpx)
/* Like ilogb, but returning long int. */
# define llogb(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, llogb)

View File

@ -0,0 +1,7 @@
#define UNSIGNED 0
#define INEXACT 0
#define FUNC fromfp
#include <s_fromfp_main.c>
#ifdef NO_LONG_DOUBLE
weak_alias (fromfp, fromfpl)
#endif

View File

@ -0,0 +1,82 @@
/* Round to integer type. dbl-64 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
#define BIAS 0x3ff
#define MANT_DIG 53
#if UNSIGNED
# define RET_TYPE uintmax_t
#else
# define RET_TYPE intmax_t
#endif
#include <fromfp.h>
RET_TYPE
FUNC (double x, int round, unsigned int width)
{
if (width > INTMAX_WIDTH)
width = INTMAX_WIDTH;
uint64_t ix;
EXTRACT_WORDS64 (ix, x);
bool negative = (ix & 0x8000000000000000ULL) != 0;
if (width == 0)
return fromfp_domain_error (negative, width);
ix &= 0x7fffffffffffffffULL;
if (ix == 0)
return 0;
int exponent = ix >> (MANT_DIG - 1);
exponent -= BIAS;
int max_exponent = fromfp_max_exponent (negative, width);
if (exponent > max_exponent)
return fromfp_domain_error (negative, width);
ix &= ((1ULL << (MANT_DIG - 1)) - 1);
ix |= 1ULL << (MANT_DIG - 1);
uintmax_t uret;
bool half_bit, more_bits;
if (exponent >= MANT_DIG - 1)
{
uret = ix;
uret <<= exponent - (MANT_DIG - 1);
half_bit = false;
more_bits = false;
}
else if (exponent >= -1)
{
uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
half_bit = (ix & h) != 0;
more_bits = (ix & (h - 1)) != 0;
uret = ix >> (MANT_DIG - 1 - exponent);
}
else
{
uret = 0;
half_bit = false;
more_bits = true;
}
return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
exponent, max_exponent, width);
}

View File

@ -0,0 +1,7 @@
#define UNSIGNED 0
#define INEXACT 1
#define FUNC fromfpx
#include <s_fromfp_main.c>
#ifdef NO_LONG_DOUBLE
weak_alias (fromfpx, fromfpxl)
#endif

View File

@ -0,0 +1,7 @@
#define UNSIGNED 1
#define INEXACT 0
#define FUNC ufromfp
#include <s_fromfp_main.c>
#ifdef NO_LONG_DOUBLE
weak_alias (ufromfp, ufromfpl)
#endif

View File

@ -0,0 +1,7 @@
#define UNSIGNED 1
#define INEXACT 1
#define FUNC ufromfpx
#include <s_fromfp_main.c>
#ifdef NO_LONG_DOUBLE
weak_alias (ufromfpx, ufromfpxl)
#endif

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 0
#define FUNC fromfpf
#include <s_fromfpf_main.c>

View File

@ -0,0 +1,82 @@
/* Round to integer type. flt-32 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
#define BIAS 0x7f
#define MANT_DIG 24
#if UNSIGNED
# define RET_TYPE uintmax_t
#else
# define RET_TYPE intmax_t
#endif
#include <fromfp.h>
RET_TYPE
FUNC (float x, int round, unsigned int width)
{
if (width > INTMAX_WIDTH)
width = INTMAX_WIDTH;
uint32_t ix;
GET_FLOAT_WORD (ix, x);
bool negative = (ix & 0x80000000) != 0;
if (width == 0)
return fromfp_domain_error (negative, width);
ix &= 0x7fffffff;
if (ix == 0)
return 0;
int exponent = ix >> (MANT_DIG - 1);
exponent -= BIAS;
int max_exponent = fromfp_max_exponent (negative, width);
if (exponent > max_exponent)
return fromfp_domain_error (negative, width);
ix &= ((1U << (MANT_DIG - 1)) - 1);
ix |= 1U << (MANT_DIG - 1);
uintmax_t uret;
bool half_bit, more_bits;
if (exponent >= MANT_DIG - 1)
{
uret = ix;
uret <<= exponent - (MANT_DIG - 1);
half_bit = false;
more_bits = false;
}
else if (exponent >= -1)
{
uint32_t h = 1U << (MANT_DIG - 2 - exponent);
half_bit = (ix & h) != 0;
more_bits = (ix & (h - 1)) != 0;
uret = ix >> (MANT_DIG - 1 - exponent);
}
else
{
uret = 0;
half_bit = false;
more_bits = true;
}
return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
exponent, max_exponent, width);
}

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 1
#define FUNC fromfpxf
#include <s_fromfpf_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 0
#define FUNC ufromfpf
#include <s_fromfpf_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 1
#define FUNC ufromfpxf
#include <s_fromfpf_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 0
#define FUNC fromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,90 @@
/* Round to integer type. ldbl-128 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
#define BIAS 0x3fff
#define MANT_DIG 113
#if UNSIGNED
# define RET_TYPE uintmax_t
#else
# define RET_TYPE intmax_t
#endif
#include <fromfp.h>
RET_TYPE
FUNC (_Float128 x, int round, unsigned int width)
{
if (width > INTMAX_WIDTH)
width = INTMAX_WIDTH;
uint64_t hx, lx;
GET_LDOUBLE_WORDS64 (hx, lx, x);
bool negative = (hx & 0x8000000000000000ULL) != 0;
if (width == 0)
return fromfp_domain_error (negative, width);
hx &= 0x7fffffffffffffffULL;
if ((hx | lx) == 0)
return 0;
int exponent = hx >> (MANT_DIG - 1 - 64);
exponent -= BIAS;
int max_exponent = fromfp_max_exponent (negative, width);
if (exponent > max_exponent)
return fromfp_domain_error (negative, width);
hx &= ((1ULL << (MANT_DIG - 1 - 64)) - 1);
hx |= 1ULL << (MANT_DIG - 1 - 64);
uintmax_t uret;
bool half_bit, more_bits;
/* The exponent is at most 63, so we are shifting right by at least
49 bits. */
if (exponent >= -1)
{
int shift = MANT_DIG - 1 - exponent;
if (shift <= 64)
{
uint64_t h = 1ULL << (shift - 1);
half_bit = (lx & h) != 0;
more_bits = (lx & (h - 1)) != 0;
uret = hx << (64 - shift);
if (shift != 64)
uret |= lx >> shift;
}
else
{
uint64_t h = 1ULL << (shift - 1 - 64);
half_bit = (hx & h) != 0;
more_bits = ((hx & (h - 1)) | lx) != 0;
uret = hx >> (shift - 64);
}
}
else
{
uret = 0;
half_bit = false;
more_bits = true;
}
return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
exponent, max_exponent, width);
}

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 1
#define FUNC fromfpxl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 0
#define FUNC ufromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 1
#define FUNC ufromfpxl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 0
#define FUNC fromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,147 @@
/* Round to integer type. ldbl-128ibm version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
#define BIAS 0x3ff
#define MANT_DIG 53
#if UNSIGNED
# define RET_TYPE uintmax_t
#else
# define RET_TYPE intmax_t
#endif
#include <fromfp.h>
RET_TYPE
FUNC (long double x, int round, unsigned int width)
{
double hi, lo;
if (width > INTMAX_WIDTH)
width = INTMAX_WIDTH;
uint64_t hx, lx;
ldbl_unpack (x, &hi, &lo);
EXTRACT_WORDS64 (hx, hi);
EXTRACT_WORDS64 (lx, lo);
bool negative = (hx & 0x8000000000000000ULL) != 0;
bool lo_negative = (lx & 0x8000000000000000ULL) != 0;
if (width == 0)
return fromfp_domain_error (negative, width);
hx &= 0x7fffffffffffffffULL;
lx &= 0x7fffffffffffffffULL;
if ((hx | lx) == 0)
return 0;
int hi_exponent = hx >> (MANT_DIG - 1);
hi_exponent -= BIAS;
int exponent = hi_exponent;
hx &= ((1ULL << (MANT_DIG - 1)) - 1);
if (hx == 0 && lx != 0 && lo_negative != negative)
exponent--;
int max_exponent = fromfp_max_exponent (negative, width);
if (exponent > max_exponent)
return fromfp_domain_error (negative, width);
int lo_exponent = lx >> (MANT_DIG - 1);
lo_exponent -= BIAS;
/* Convert the high part to integer. */
hx |= 1ULL << (MANT_DIG - 1);
uintmax_t uret;
bool half_bit, more_bits;
if (hi_exponent >= MANT_DIG - 1)
{
uret = hx;
uret <<= hi_exponent - (MANT_DIG - 1);
half_bit = false;
more_bits = false;
}
else if (hi_exponent >= -1)
{
uint64_t h = 1ULL << (MANT_DIG - 2 - hi_exponent);
half_bit = (hx & h) != 0;
more_bits = (hx & (h - 1)) != 0;
uret = hx >> (MANT_DIG - 1 - hi_exponent);
}
else
{
uret = 0;
half_bit = false;
more_bits = true;
}
/* Likewise, the low part. */
if (lx != 0)
{
uintmax_t lo_uret;
bool lo_half_bit, lo_more_bits;
lx &= ((1ULL << (MANT_DIG - 1)) - 1);
lx |= 1ULL << (MANT_DIG - 1);
/* The high part exponent is at most 64, so the low part
exponent is at most 11. */
if (lo_exponent >= -1)
{
uint64_t h = 1ULL << (MANT_DIG - 2 - lo_exponent);
lo_half_bit = (lx & h) != 0;
lo_more_bits = (lx & (h - 1)) != 0;
lo_uret = lx >> (MANT_DIG - 1 - lo_exponent);
}
else
{
lo_uret = 0;
lo_half_bit = false;
lo_more_bits = true;
}
if (lo_negative == negative)
{
uret += lo_uret;
half_bit |= lo_half_bit;
more_bits |= lo_more_bits;
}
else
{
uret -= lo_uret;
if (lo_half_bit)
{
uret--;
half_bit = true;
}
if (lo_more_bits && !more_bits)
{
if (half_bit)
{
half_bit = false;
more_bits = true;
}
else
{
uret--;
half_bit = true;
more_bits = true;
}
}
}
}
return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
exponent, max_exponent, width);
}

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 1
#define FUNC fromfpxl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 0
#define FUNC ufromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 1
#define FUNC ufromfpxl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 0
#define FUNC fromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,84 @@
/* Round to integer type. ldbl-96 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fenv.h>
#include <math.h>
#include <math_private.h>
#include <stdbool.h>
#include <stdint.h>
#define BIAS 0x3fff
#define MANT_DIG 64
#if UNSIGNED
# define RET_TYPE uintmax_t
#else
# define RET_TYPE intmax_t
#endif
#include <fromfp.h>
RET_TYPE
FUNC (long double x, int round, unsigned int width)
{
if (width > INTMAX_WIDTH)
width = INTMAX_WIDTH;
uint16_t se;
uint32_t hx, lx;
GET_LDOUBLE_WORDS (se, hx, lx, x);
bool negative = (se & 0x8000) != 0;
if (width == 0)
return fromfp_domain_error (negative, width);
if ((hx | lx) == 0)
return 0;
int exponent = se & 0x7fff;
exponent -= BIAS;
int max_exponent = fromfp_max_exponent (negative, width);
if (exponent > max_exponent)
return fromfp_domain_error (negative, width);
uint64_t ix = (((uint64_t) hx) << 32) | lx;
uintmax_t uret;
bool half_bit, more_bits;
if (exponent >= MANT_DIG - 1)
{
uret = ix;
/* Exponent 63; no shifting required. */
half_bit = false;
more_bits = false;
}
else if (exponent >= -1)
{
uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
half_bit = (ix & h) != 0;
more_bits = (ix & (h - 1)) != 0;
if (exponent == -1)
uret = 0;
else
uret = ix >> (MANT_DIG - 1 - exponent);
}
else
{
uret = 0;
half_bit = false;
more_bits = true;
}
return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
exponent, max_exponent, width);
}

View File

@ -0,0 +1,4 @@
#define UNSIGNED 0
#define INEXACT 1
#define FUNC fromfpxl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 0
#define FUNC ufromfpl
#include <s_fromfpl_main.c>

View File

@ -0,0 +1,4 @@
#define UNSIGNED 1
#define INEXACT 1
#define FUNC ufromfpxl
#include <s_fromfpl_main.c>

View File

@ -44,7 +44,7 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
nextup nextdown totalorder totalordermag getpayload \
canonicalize setpayload setpayloadsig llogb fmaxmag fminmag \
roundeven
roundeven fromfp ufromfp fromfpx ufromfpx
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
@ -103,6 +103,8 @@ CFLAGS-nldbl-fmin.c = -fno-builtin-fminl
CFLAGS-nldbl-fminmag.c = -fno-builtin-fminmagl
CFLAGS-nldbl-fmod.c = -fno-builtin-fmodl
CFLAGS-nldbl-frexp.c = -fno-builtin-frexpl
CFLAGS-nldbl-fromfp.c = -fno-builtin-fromfpl
CFLAGS-nldbl-fromfpx.c = -fno-builtin-fromfpxl
CFLAGS-nldbl-gamma.c = -fno-builtin-gammal
CFLAGS-nldbl-getpayload.c = -fno-builtin-getpayloadl
CFLAGS-nldbl-hypot.c = -fno-builtin-hypotl
@ -156,6 +158,8 @@ CFLAGS-nldbl-tgamma.c = -fno-builtin-tgammal
CFLAGS-nldbl-totalorder.c = -fno-builtin-totalorderl
CFLAGS-nldbl-totalordermag.c = -fno-builtin-totalordermagl
CFLAGS-nldbl-trunc.c = -fno-builtin-truncl
CFLAGS-nldbl-ufromfp.c = -fno-builtin-ufromfpl
CFLAGS-nldbl-ufromfpx.c = -fno-builtin-ufromfpxl
CFLAGS-nldbl-y0.c = -fno-builtin-y0l
CFLAGS-nldbl-y1.c = -fno-builtin-y1l
CFLAGS-nldbl-yn.c = -fno-builtin-ynl

View File

@ -24,6 +24,7 @@
#define __NO_LONG_DOUBLE_MATH 1
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#include <wchar.h>

View File

@ -0,0 +1,26 @@
/* Compatibility routine for IEEE double as long double for fromfp.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "nldbl-compat.h"
intmax_t
attribute_hidden
fromfpl (double x, int round, unsigned int width)
{
return fromfp (x, round, width);
}

View File

@ -0,0 +1,26 @@
/* Compatibility routine for IEEE double as long double for fromfpx.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "nldbl-compat.h"
intmax_t
attribute_hidden
fromfpxl (double x, int round, unsigned int width)
{
return fromfpx (x, round, width);
}

View File

@ -0,0 +1,26 @@
/* Compatibility routine for IEEE double as long double for ufromfp.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "nldbl-compat.h"
uintmax_t
attribute_hidden
ufromfpl (double x, int round, unsigned int width)
{
return ufromfp (x, round, width);
}

View File

@ -0,0 +1,26 @@
/* Compatibility routine for IEEE double as long double for ufromfpx.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "nldbl-compat.h"
uintmax_t
attribute_hidden
ufromfpxl (double x, int round, unsigned int width)
{
return ufromfpx (x, round, width);
}

View File

@ -395,6 +395,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -416,3 +422,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -427,6 +427,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -448,3 +454,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -437,6 +437,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -458,6 +464,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __c1_cabsf F
GLIBC_2.3.4 __c1_cacosf F

View File

@ -84,6 +84,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -105,6 +111,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F

View File

@ -396,6 +396,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -417,5 +423,11 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F

View File

@ -440,6 +440,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -461,4 +467,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -369,6 +369,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -390,4 +396,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -84,6 +84,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -105,6 +111,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F

View File

@ -438,6 +438,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -459,4 +465,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -395,6 +395,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -416,3 +422,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -397,6 +397,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -418,6 +424,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F
_gp_disp _gp_disp A

View File

@ -429,6 +429,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -450,4 +456,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -395,6 +395,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -416,3 +422,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -440,6 +440,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -461,6 +467,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -439,6 +439,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -460,6 +466,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -434,6 +434,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -455,3 +461,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -115,6 +115,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -136,6 +142,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 _LIB_VERSION D 0x4
GLIBC_2.3 __clog10 F

View File

@ -427,6 +427,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -448,6 +454,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -425,6 +425,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -446,6 +452,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -396,6 +396,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -417,5 +423,11 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F

View File

@ -430,6 +430,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -451,6 +457,12 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -428,6 +428,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -449,4 +455,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -396,6 +396,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -417,3 +423,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -396,6 +396,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -417,3 +423,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -396,6 +396,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -417,3 +423,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F

View File

@ -429,6 +429,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -450,4 +456,10 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -428,6 +428,12 @@ GLIBC_2.25 fmaxmagl F
GLIBC_2.25 fminmag F
GLIBC_2.25 fminmagf F
GLIBC_2.25 fminmagl F
GLIBC_2.25 fromfp F
GLIBC_2.25 fromfpf F
GLIBC_2.25 fromfpl F
GLIBC_2.25 fromfpx F
GLIBC_2.25 fromfpxf F
GLIBC_2.25 fromfpxl F
GLIBC_2.25 getpayload F
GLIBC_2.25 getpayloadf F
GLIBC_2.25 getpayloadl F
@ -449,3 +455,9 @@ GLIBC_2.25 totalorderl F
GLIBC_2.25 totalordermag F
GLIBC_2.25 totalordermagf F
GLIBC_2.25 totalordermagl F
GLIBC_2.25 ufromfp F
GLIBC_2.25 ufromfpf F
GLIBC_2.25 ufromfpl F
GLIBC_2.25 ufromfpx F
GLIBC_2.25 ufromfpxf F
GLIBC_2.25 ufromfpxl F