glibc/sysdeps
Joseph Myers 90ab295a9e Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916).
Various pow function implementations mishandle sNaN arguments in
various ways.  This includes returning sNaN instead of qNaN for sNaN
arguments.  For arguments (1, sNaN) and (sNaN, 0), TS 18661-1
semantics are also that the result should be qNaN, whereas with a qNaN
argument there the result should be 1, but for the dbl-64
implementation of pow there are issues with sNaN arguments beyond not
implementing the TS 18661-1 semantics in those special cases.

This patch makes the implementations in sysdeps/ieee754 follow the TS
18661-1 semantics consistently.  Because x86 / x86_64 implementations
still need fixing, testcases are not included with this patch; they
will be included with the fix for the x86 / x86_64 versions.

Tested for x86_64, x86, mips64 and powerpc (with such testcases, which
pass in the mips64 and powerpc cases).

	[BZ #20916]
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Do not return 1
	for arguments (sNaN, 0) or (1, sNaN).  Do arithmetic on NaN
	arguments to compute result.
	* sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Do not return
	1 for arguments (sNaN, 0) or (1, sNaN).
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Likewise.
2016-12-02 23:21:15 +00:00
..
aarch64 aarch64: Use explicit offsets in _dl_tlsdesc_dynamic 2016-12-02 16:52:57 +01:00
alpha Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
arm Refactor FP_FAST_* into bits/fp-fast.h. 2016-11-29 01:45:00 +00:00
generic ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
gnu Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
hppa Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
i386 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
ia64 Refactor FP_ILOGB* out of bits/mathdef.h. 2016-12-01 02:56:55 +00:00
ieee754 Fix sysdeps/ieee754 pow handling of sNaN arguments (bug 20916). 2016-12-02 23:21:15 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k Refactor FP_ILOGB* out of bits/mathdef.h. 2016-12-01 02:56:55 +00: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 Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
nacl Add llogb, llogbf, llogbl. 2016-12-02 01:42:49 +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 powerpc: Remove stpcpy internal clash with IFUNC 2016-12-01 15:53:16 -02:00
pthread Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
s390 S390: Regenerate ULPs. 2016-12-02 12:52:36 +01:00
sh Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
sparc Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
tile Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
unix Add llogb, llogbf, llogbl. 2016-12-02 01:42:49 +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 FP_ILOGB* out of bits/mathdef.h. 2016-12-01 02:56:55 +00:00
x86_64 ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00