glibc/sysdeps
Joseph Myers 9438b237ab Fix x86/x86_64 scalb (qNaN, -Inf) (bug 16783).
Various x86 / x86_64 versions of scalb / scalbf / scalbl produce
spurious "invalid" exceptions for (qNaN, -Inf) arguments, because this
is wrongly handled like (+/-Inf, -Inf) which *should* raise such an
exception.  (In fact the NaN case of the code determining whether to
quietly return a zero or a NaN for second argument -Inf was
accidentally dead since the code had been made to return a NaN with
exception.)  This patch fixes the code to do the proper test for an
infinity as distinct from a NaN.

(Since the existing code does nothing to distinguish qNaNs and sNaNs
here, this patch doesn't either.  If in future we systematically
implement proper sNaN semantics following TS 18661-1:2014, there will
be lots of bugs to address - Thomas found lots of issues with his
patch <https://sourceware.org/ml/libc-ports/2013-04/msg00008.html> to
add SNaN tests (which never went in and would now require significant
reworking).)

Tested for x86_64 and x86.  Committed.

	[BZ #16783]
	* sysdeps/i386/fpu/e_scalb.S (__ieee754_scalb): Do not handle
	arguments (NaN, -Inf) the same as (+/-Inf, -Inf).
	* sysdeps/i386/fpu/e_scalbf.S (__ieee754_scalbf): Likewise.
	* sysdeps/i386/fpu/e_scalbl.S (__ieee754_scalbl): Likewise.
	* sysdeps/x86_64/fpu/e_scalbl.S (__ieee754_scalbl): Likewise.
	* math/libm-test.inc (scalb_test_data): Add more tests.
2015-02-24 17:30:02 +00:00
..
aarch64
alpha
arm Use -Werror=undef for assembly code. 2015-02-12 13:57:32 -08:00
generic Add placeholder c++-types.data and *.abilist files. 2015-02-13 15:41:34 -08:00
gnu
hppa
i386 Fix x86/x86_64 scalb (qNaN, -Inf) (bug 16783). 2015-02-24 17:30:02 +00:00
ia64
ieee754 Fix atan / atan2 missing underflows (bug 15319). 2015-02-18 21:10:49 +00:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k
mach linux: open and openat ignore 'mode' with O_TMPFILE in flags 2015-02-24 13:19:22 +05:30
microblaze
mips 2015-02-18 Steve Ellcey <sellcey@imgtec.com> 2015-02-18 10:51:37 -08:00
nios2
nptl
posix linux: open and openat ignore 'mode' with O_TMPFILE in flags 2015-02-24 13:19:22 +05:30
powerpc Fix powerpc software sqrtf (bug 17967). 2015-02-13 16:20:36 +00:00
pthread
s390 s390: Use generic lowlevellock-futex.h 2015-02-20 10:48:06 +01:00
sh
sparc
tile
unix linux: open and openat ignore 'mode' with O_TMPFILE in flags 2015-02-24 13:19:22 +05:30
wordsize-32
wordsize-64
x86 Fix atan / atan2 missing underflows (bug 15319). 2015-02-18 21:10:49 +00:00
x86_64 Fix x86/x86_64 scalb (qNaN, -Inf) (bug 16783). 2015-02-24 17:30:02 +00:00