glibc/sysdeps/ieee754/ldbl-128
Joseph Myers f8e8b8ed9f Add getpayload, getpayloadf, getpayloadl.
TS 18661-1 defines functions for manipulating the payloads of NaNs.
This patch implements the getpayload functions for glibc; these
extract the NaN payload (from an argument passed as a pointer, for
which corresponding libm-test support is added) and return it in the
same floating-point type.  The return value of these functions is
unspecified for non-NaN arguments; the patch does the simplest thing
to implement, which is that the functions do not check whether the
argument is a NaN and just treat the relevant bits of the
representation as a payload regardless.  A conversion from integer to
floating-point is used to produce the required return value, except in
the ldbl-128 case; as 128-bit integers are not supported for all
configurations using ldbl-128, the code constructs the required
floating-point representation of the return value directly instead.

Tested for x86_64, x86, mips64 and powerpc.

	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(getpayload): New declaration.
	* math/Versions (getpayload): New libm symbol at version
	GLIBC_2.25.
	(getpayloadf): Likewise.
	(getpayloadl): Likewise.
	* math/Makefile (libm-calls): Add s_getpayloadF.
	* math/libm-test.inc: Include <nan-high-order-bit.h>.
	(struct test_f_f_data): Add comment.
	(RUN_TEST_fp_f): New macro.
	(RUN_TEST_LOOP_fp_f): Likewise.
	(getpayload_test_data): New array.
	(getpayload_test): New function.
	(main): Call getpayload_test.
	* math/gen-libm-test.pl (parse_args): Handle 'p' in argument
	descriptor.
	* manual/arith.texi (FP Bit Twiddling): Document getpayload,
	getpayloadf and getpayloadl.
	* manual/libm-err-tab.pl: Update comment on interfaces without
	ulps tabulated.
	* sysdeps/ieee754/dbl-64/s_getpayload.c: New file.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c: Likewise.
	* sysdeps/ieee754/flt-32/s_getpayloadf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_getpayloadl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_getpayloadl.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-10-19 01:49:09 +00:00
..
e_acoshl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_acosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_asinl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_atan2l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_atanhl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_coshl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_exp10l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_expl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_fmodl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
e_gammal_r.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_hypotl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_ilogbl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
e_j0l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_j1l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_jnl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_lgammal_r.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_log2l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_log10l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_logl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_powl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_rem_pio2l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_remainderl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
e_sinhl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
gamma_productl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_cosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
k_sincosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
k_sinl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
k_tanl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lgamma_negl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
lgamma_productl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
Makefile
math_ldbl.h ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
mpn2ldbl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
printf_fphex.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_asinhl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_atanl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_cbrtl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_ceill.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_copysignl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_cosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_erfl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_expm1l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_fabsl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_finitel.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_floorl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_fma.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fmal.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_fpclassifyl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_frexpl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_getpayloadl.c Add getpayload, getpayloadf, getpayloadl. 2016-10-19 01:49:09 +00:00
s_isinfl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_isnanl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_issignalingl.c Define HIGH_ORDER_BIT_IS_SET_FOR_SNAN to 0 or 1. 2016-10-17 22:48:51 +00:00
s_llrintl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_llroundl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_log1pl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_logbl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_lrintl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_lroundl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_modfl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_nearbyintl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_nextafterl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_nexttoward.c
s_nexttowardf.c
s_nextupl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_remquol.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_rintl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_roundl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_scalblnl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_scalbnl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_signbitl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
s_sincosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_sinl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_tanhl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_tanl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
s_totalorderl.c Define HIGH_ORDER_BIT_IS_SET_FOR_SNAN to 0 or 1. 2016-10-17 22:48:51 +00:00
s_totalordermagl.c Define HIGH_ORDER_BIT_IS_SET_FOR_SNAN to 0 or 1. 2016-10-17 22:48:51 +00:00
s_truncl.c ldbl-128: Rename 'long double' to '_Float128' 2016-08-31 10:38:11 -05:00
strtod_nan_ldouble.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtold_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
t_expl.h ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
t_sincosl.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00
w_expl.c
x2y2m1l.c ldbl-128: Use L(x) macro for long double constants 2016-09-13 15:33:59 -05:00