glibc/sysdeps
Joseph Myers 903af5af9a Fix exp2 missing underflows (bug 16521).
Various exp2 implementations in glibc can miss underflow exceptions
when the scaling down part of the calculation is exact (or, in the x86
case, when the conversion from extended precision to the target
precision is exact).  This patch forces the exception in a similar way
to previous fixes.

The x86 exp2f changes may in fact not be needed for this purpose -
it's likely to be the case that no argument of type float has an exp2
result so close to an exact subnormal float value that it equals that
value when rounded to 64 bits (even taking account of variation
between different x86 implementations).  However, they are included
for consistency with the changes to exp2 and so as to fix the exp2f
part of bug 18875 by ensuring that excess range and precision is
removed from underflowing return values.

Tested for x86_64, x86 and mips64.

	[BZ #16521]
	[BZ #18875]
	* math/e_exp2l.c (__ieee754_exp2l): Force underflow exception for
	small results.
	* sysdeps/i386/fpu/e_exp2.S (dbl_min): New object.
	(MO): New macro.
	(__ieee754_exp2): For small results, force underflow exception and
	remove excess range and precision from return value.
	* sysdeps/i386/fpu/e_exp2f.S (flt_min): New object.
	(MO): New macro.
	(__ieee754_exp2f): For small results, force underflow exception
	and remove excess range and precision from return value.
	* sysdeps/i386/fpu/e_exp2l.S (ldbl_min): New object.
	(MO): New macro.
	(__ieee754_exp2l): Force underflow exception for small results.
	* sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Likewise.
	* sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Likewise.
	* sysdeps/x86_64/fpu/e_exp2l.S (ldbl_min): New object.
	(MO): New macro.
	(__ieee754_exp2l): Force underflow exception for small results.
	* math/auto-libm-test-in: Add more tests or exp2.
	* math/auto-libm-test-out: Regenerated.
2015-09-14 22:00:12 +00:00
..
aarch64 Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
alpha Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
arm Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
generic Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
gnu Add more TCP_* values to netinet/tcp.h. 2015-09-01 13:45:49 +00:00
hppa Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
i386 Fix exp2 missing underflows (bug 16521). 2015-09-14 22:00:12 +00:00
ia64 Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
ieee754 Fix exp2 missing underflows (bug 16521). 2015-09-14 22:00:12 +00:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
mach Fix typo 2015-09-13 19:50:22 +02:00
microblaze Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
mips Add more random libm test inputs (mainly for ldbl-128). 2015-09-12 00:01:38 +00:00
nacl NaCl: Do not install <sys/mtio.h>. 2015-09-11 14:16:18 -07:00
nios2 Fixes extern protected data handling testcases elf/tst-protected1a 2015-07-26 05:27:18 -07:00
nptl Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912). 2015-09-08 21:11:03 +00:00
posix To fix BZ #18675, use __fstatvfs64 in __fpathconf. 2015-09-09 18:41:25 -07:00
powerpc Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
pthread Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912). 2015-09-08 21:11:03 +00:00
s390 Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
sh Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
sparc Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
tile Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
unix linux/getsysstats.c: use sysinfo() instead of parsing /proc/meminfo 2015-09-12 21:09:59 -04:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
x86 Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
x86_64 Fix exp2 missing underflows (bug 16521). 2015-09-14 22:00:12 +00:00