glibc/sysdeps
Joseph Myers 600fa36158 Fix nextafter overflow in non-default rounding modes (bug 16677).
ISO C requires the result of nextafter to be independent of the
rounding mode, even when underflow or overflow occurs.  This patch
fixes the bug in various nextafter implementations that, having done
an overflowing computation to force an overflow exception (correct),
they then return the result of that computation rather than an
infinity computed some other way (incorrect, when the overflowing
result of arithmetic with that sign and rounding mode is finite but
the correct result is infinite) - generally by falling through to
existing code to return a value that in fact is correct for this case
(but was computed by an integer increment and so without generating
the exceptions required).  Having fixed the bug, the previously
deferred conversion of nextafter testing in libm-test.inc to
ALL_RM_TEST is also included.

Tested x86_64 and x86; also spot-checked results of nextafter tests
for powerpc32 and mips64 to test the ldbl-128ibm and ldbl-128
changes.  (The m68k change is untested.)

	[BZ #16677]
	* math/s_nextafter.c (__nextafter): Do not return value from
	overflowing computation.
	* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Likewise.
	* sysdeps/ieee754/flt-32/s_nextafterf.c (__nextafterf): Likewise.
	* sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl):
	Likewise.
	* sysdeps/m68k/m680x0/fpu/s_nextafterl.c (__nextafterl): Likewise.
	* math/libm-test.inc (nextafter_test): Use ALL_RM_TEST.
2014-03-11 22:24:00 +00:00
..
aarch64 [PATCH] [AArch64] Optional trapping exceptions support. 2014-03-07 14:05:20 +00:00
alpha Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
arm ARM: Fix up setjmp/longjmp changes sfi_* macro use. 2014-03-11 10:59:01 -07:00
generic BZ #16613: Support TLS in audit libraries. 2014-02-25 13:18:15 -05:00
gnu Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
i386 Fix nextafter overflow in non-default rounding modes (bug 16677). 2014-03-11 22:24:00 +00:00
ia64 Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
ieee754 Fix nextafter overflow in non-default rounding modes (bug 16677). 2014-03-11 22:24:00 +00:00
init_array Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
m68k Fix nextafter overflow in non-default rounding modes (bug 16677). 2014-03-11 22:24:00 +00:00
mach Complete _BSD_SOURCE / _SVID_source followup cleanup. 2014-02-21 21:45:26 +00:00
microblaze Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
mips Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
posix Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
powerpc PowerPC: Fix bzero definition for static libc for PPC64 2014-03-11 09:31:59 -05:00
pthread Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s390 Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sh Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sparc Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
tile Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
unix Fix POSIX namespace for <bits/siginfo.h> (bug 16674). 2014-03-07 23:57:56 +00:00
wordsize-32 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wordsize-64 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x86 Enumerate tests with special rules in tests-special variable. 2014-03-06 22:35:33 +00:00
x86_64 Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00