glibc/sysdeps
Joseph Myers 457663a7cd Add setpayloadsig, setpayloadsigf, setpayloadsigl.
TS 18661-1 defines functions for manipulating the payloads of NaNs.
This patch implements the setpayloadsig functions for glibc; these are
like the setpayload functions, but produce a signaling NaN instead of
a quiet NaN.

The substance of the implementation was included with the setpayload
implementation, so the new files here just need to wrap the main files
with different defines to build the new functions.

Because the functions store a signaling NaN via a pointer and the
libm-test macros choose a suitable initial value for the variable in
such a case by comparing with the expected value, the relevant macro
needs to clear exceptions after FE_INVALID may have been raised by
that comparison.

Tested for x86_64, x86, mips64 and powerpc.

	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(setpayloadsig): New declaration.
	* math/Versions (setpayloadsig): New libm symbol at version
	GLIBC_2.25.
	(setpayloadsigf): Likewise.
	(setpayloadsigl): Likewise.
	* math/Makefile (libm-calls): Add s_setpayloadsigF.
	* math/libm-test.inc (RUN_TEST_Ff_b1): Call feclearexcept
	(FE_ALL_EXCEPT) after initializing EXTRA_VAR.
	(setpayloadsig_test_data): New array.
	(setpayloadsig_test): New function.
	(main): Call setpayloadsig_test.
	* manual/arith.texi (FP Bit Twiddling): Document setpayloadsig,
	setpayloadsigf and setpayloadsigl.
	* manual/libm-err-tab.pl: Update comment on interfaces without
	ulps tabulated.
	* sysdeps/ieee754/dbl-64/s_setpayloadsig.c: New file.
	* sysdeps/ieee754/flt-32/s_setpayloadsigf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
	setpayloadsig.
	(CFLAGS-nldbl-setpayloadsig.c): New variable.
	* 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-11-24 23:56:48 +00:00
..
aarch64 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
alpha Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
arm Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
generic Refactor some libm type-generic macros. 2016-11-10 21:41:56 +00:00
gnu Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
hppa Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
i386 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
ia64 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
ieee754 Add setpayloadsig, setpayloadsigf, setpayloadsigl. 2016-11-24 23:56:48 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
mach Fix hurd __access_noerrno implementation. 2016-11-18 16:49:08 -02:00
microblaze Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
mips Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
nacl Add setpayloadsig, setpayloadsigf, setpayloadsigl. 2016-11-24 23:56:48 +00:00
nios2 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
nptl Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
posix hurd: fix fcntl visibility 2016-09-18 23:48:55 +02:00
powerpc Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
pthread Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
s390 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
sh Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
sparc Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
tile Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
unix Add setpayloadsig, setpayloadsigf, setpayloadsigl. 2016-11-24 23:56:48 +00:00
wordsize-32 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
wordsize-64 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
x86 Refactor float_t, double_t information into bits/flt-eval-method.h. 2016-11-24 18:44:50 +00:00
x86_64 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00