glibc/sysdeps/ieee754/ldbl-128
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
..
e_acoshl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_acosl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_asinl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_atan2l.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_atanhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_coshl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_exp10l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_expl.c BZ #16447: Fix ldbl-128 expl implementation. 2014-02-11 13:47:47 +01:00
e_fmodl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_gammal_r.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_hypotl.c Fix hypot handling of subnormals (bug 16316, bug 16330). 2013-12-17 13:42:13 +00:00
e_ilogbl.c Finish ilogb changes 2012-04-18 14:31:43 +02:00
e_j0l.c Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285). 2013-03-21 13:57:21 +00:00
e_j1l.c Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285). 2013-03-21 13:57:21 +00:00
e_jnl.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
e_lgammal_r.c Fix ldbl-128 / ldbl-128ibm lgammal spurious underflow (bug 16400). 2014-01-06 18:20:20 +00:00
e_log2l.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_log10l.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_logl.c Fix ldbl-128 logl for subnormals (bug 16338). 2013-12-18 11:38:27 +00:00
e_powl.c Fix BZ #14811 for ldbl-128 too. 2012-11-16 21:39:54 -08:00
e_rem_pio2l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_remainderl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_sinhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
gamma_productl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ieee754.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_cosl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_sincosl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_sinl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_tanl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
ldbl2mpn.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Makefile
math_ldbl.h
mpn2ldbl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
printf_fphex.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_asinhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_atanl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_cbrtl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_ceill.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_copysignl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_cosl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_erfl.c Fix erfc errno setting on underflow (bug 6786). 2013-12-03 16:25:18 +00:00
s_expm1l.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_fabsl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_finitel.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_floorl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_fma.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fmal.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_fpclassifyl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_frexpl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isinf_nsl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isinfl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isnanl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_issignalingl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llrintl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llroundl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_log1pl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_logbl.c Optimize handling of denormals in logb/logbf/logbl 2012-05-26 13:53:22 +02:00
s_lrintl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_lroundl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_modfl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_nearbyintl.c Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490). 2013-05-19 18:40:25 +00:00
s_nextafterl.c Fix nextafter overflow in non-default rounding modes (bug 16677). 2014-03-11 22:24:00 +00:00
s_nexttoward.c Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
s_nexttowardf.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_remquol.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_rintl.c Fix set-but-not-used warnings in ldbl-128 nearbyintl, rintl. 2012-11-20 14:26:07 +00:00
s_roundl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_scalblnl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_scalbnl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_signbitl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_sincosl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_sinl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_tanhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_tanl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_truncl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
strtold_l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
t_expl.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
t_sincosl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
w_expl.c [BZ #16427] Fix ldbl-128 exp overflows. 2014-01-15 09:50:31 +01:00
x2y2m1l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00