Fix i386/x86_64 scalbl with sNaN input (bug 20296).
commit40244be3729149ff440caf18e445ec17b0d0b511
authorJoseph Myers <joseph@codesourcery.com>
Thu, 23 Jun 2016 22:17:41 +0000 (23 22:17 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 23 Jun 2016 22:17:41 +0000 (23 22:17 +0000)
tree17752b5c0173889687263d735f6f259909e31c5a
parent7ed84b89f344c54dbf8665cb1cd29044bec62d18
Fix i386/x86_64 scalbl with sNaN input (bug 20296).

The x86_64 and i386 versions of scalbl return sNaN for some cases of
sNaN input and are missing "invalid" exceptions for other cases.  This
results from overly complicated code that either returns a NaN input,
or discards both inputs when one is NaN and loads a NaN from memory.
This patch fixes this by simplifying the code to add the arguments
when either one is NaN.

Tested for x86_64 and x86.

[BZ #20296]
* sysdeps/i386/fpu/e_scalbl.S (__ieee754_scalbl): Add arguments
when either argument is a NaN.
* sysdeps/x86_64/fpu/e_scalbl.S (__ieee754_scalbl): Likewise.
* math/libm-test.inc (scalb_test_data): Add sNaN tests.
ChangeLog
math/libm-test.inc
sysdeps/i386/fpu/e_scalbl.S
sysdeps/x86_64/fpu/e_scalbl.S