about summary refs log tree commit diff
path: root/version.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-12-15 00:43:16 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-12-15 00:43:16 +0000
commit9ce4ac64b234c976ae56061afd5774896c5513c9 (patch)
tree2d0aae52da78653fcebf4df843e5efc40c8aecd2 /version.h
parentf02bb0004c5b1944333fd8e74ac1efda3074084b (diff)
downloadglibc-9ce4ac64b234c976ae56061afd5774896c5513c9.tar.gz
glibc-9ce4ac64b234c976ae56061afd5774896c5513c9.tar.xz
glibc-9ce4ac64b234c976ae56061afd5774896c5513c9.zip
Fix powerpc fmax, fmin sNaN handling (bug 20947).
Various fmax and fmin function implementations mishandle sNaN
arguments:

(a) When both arguments are NaNs, the return value should be a qNaN,
but sometimes it is an sNaN if at least one argument is an sNaN.

(b) Under TS 18661-1 semantics, if either argument is an sNaN then the
result should be a qNaN (whereas if one argument is a qNaN and the
other is not a NaN, the result should be the non-NaN argument).
Various implementations treat sNaNs like qNaNs here.

This patch fixes the powerpc versions of these functions (shared by
float and double, 32-bit and 64-bit).  The structure of those versions
is that all ordered cases are already handled before anything dealing
with the case where the arguments are unordered; thus, this patch
causes no change to the code executed in the common case (neither
argument a NaN).

Tested for powerpc (32-bit and 64-bit), together with tests to be
added along with the x86_64 / x86 fixes.

	[BZ #20947]
	* sysdeps/powerpc/fpu/s_fmax.S (__fmax): Add the arguments when
	either is a signaling NaN.
	* sysdeps/powerpc/fpu/s_fmin.S (__fmin): Likewise.
Diffstat (limited to 'version.h')
0 files changed, 0 insertions, 0 deletions