glibc/sysdeps/m68k
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
..
bits Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
coldfire Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
fpu Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
m680x0 Fix nextafter overflow in non-default rounding modes (bug 16677). 2014-03-11 22:24:00 +00:00
nptl Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
sys Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
__longjmp.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
abort-instr.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
asm-syntax.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
backtrace.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
bsd-_setjmp.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
bsd-setjmp.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
crti.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
crtn.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
dl-machine.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
dl-tls.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
dl-trampoline.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
ffs.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
fpu_control.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
gccframe.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
Implies Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
jmpbuf-unwind.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
ldsodefs.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
libc-tls.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
Makefile Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
memchr.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
memcopy.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
memusage.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
preconfigure Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
rawmemchr.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setjmp.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
shlib-versions Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
sotruss-lib.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
stackinfo.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
start.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
strchr.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
strchrnul.S Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
sysdep.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
tls-macros.h Whitespace fixes 2014-02-10 20:24:03 +01:00
tst-audit.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
Versions Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
wcpcpy_chk.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
wcpcpy.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00