glibc/sysdeps/ieee754/dbl-64
Joseph Myers be25493251 Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562).
This patch fixes bugs 16561 and 16562, bad results of yn in overflow
cases in non-default rounding modes, both because an intermediate
overflow in the recurrence does not get detected if the result is not
an infinity and because an overflowing result may occur in the wrong
sign.  The fix is to set FE_TONEAREST mode internally for the parts of
the function where such overflows can occur (which includes the call
to y1 - where yn is used to compute a Bessel function of order -1,
negating the result of y1 isn't correct for overflowing results in
directed rounding modes) and then compute an overflowing value in the
original rounding mode if the to-nearest result was an infinity.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to test the ldbl-128 and ldbl-128ibm changes.

(The tests for these bugs were added in my previous y1 patch, so the
only thing this patch has to do with the testsuite is enable yn
testing in all rounding modes.)

	[BZ #16561]
	[BZ #16562]
	* sysdeps/ieee754/dbl-64/e_jn.c: Include <float.h>.
	(__ieee754_yn): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/flt-32/e_jnf.c: Include <float.h>.
	(__ieee754_ynf): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-96/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/i386/fpu/fenv_private.h [!__SSE2_MATH__]
	(libc_feholdsetround_ctx): New macro.
	* math/libm-test.inc (yn_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps : Likewise.
2014-06-27 14:52:13 +00:00
..
wordsize-64 [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
asincos.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
atnat2.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
atnat.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
branred.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
branred.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dbl2mpn.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dla.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
doasin.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
doasin.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dosincos.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dosincos.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_acos.c Update. 2001-03-12 00:04:52 +00:00
e_acosh.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_asin.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_atan2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_atanh.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_cosh.c Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061). 2014-06-23 20:20:10 +00:00
e_exp2.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_exp10.c Fix exp10 spurious underflows (bug 16560). 2014-06-25 11:33:22 +00:00
e_exp.c Fix implicit __isinf declarations in exp. 2014-03-24 22:00:32 +00:00
e_fmod.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_gamma_r.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_hypot.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_ilogb.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_j0.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_j1.c Set errno for y1 overflow (bug 17050). 2014-06-23 20:17:13 +00:00
e_jn.c Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562). 2014-06-27 14:52:13 +00:00
e_lgamma_r.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_log2.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_log10.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_log.c Fix log (1) in round-downward mode (bug 16731). 2014-03-21 18:13:58 +00:00
e_pow.c Fix pow overflow in non-default rounding modes (bug 16315). 2014-06-23 20:12:33 +00:00
e_rem_pio2.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_remainder.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_sinh.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_sqrt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gamma_product.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gamma_productf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
halfulp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_cos.c Update. 2001-03-12 00:04:52 +00:00
k_rem_pio2.c Format floating routines. 2013-10-17 16:03:24 +02:00
k_sin.c Update. 2001-03-12 00:04:52 +00:00
k_tan.c Replace sysdeps/ieee754/dbl-64/k_tan.c with empty file 2012-02-26 16:10:46 +01:00
Makefile Compile e_sqrt.c with -ffp-contract=off. 2013-12-18 12:07:06 +00:00
MathLib.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpa-arch.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpa.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpa.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpatan2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpatan.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpatan.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpexp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mplog.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpn2dbl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpsqrt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mpsqrt.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mptan.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mydefs.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
powtwo.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
root.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_asinh.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_atan.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_cbrt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_ceil.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_copysign.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_cos.c Update. 2001-03-12 00:04:52 +00:00
s_erf.c Fix erf underflow handling near 0 (bug 16516). 2014-05-14 12:34:03 +00:00
s_expm1.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_fabs.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_finite.c PowerPC: multiarch finite/finitef for PowerPC32 2013-12-06 05:47:03 -06:00
s_floor.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_fma.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_fmaf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fpclassify.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_frexp.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isinf_ns.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isinf.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isnan.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_issignaling.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llrint.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llround.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_log1p.c [BZ #16823] Fix log1pl returning wrong infinity sign 2014-04-29 15:43:36 +02:00
s_logb.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_lrint.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_lround.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_modf.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_nearbyint.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_nexttoward.c Update. 1999-07-14 00:54:57 +00:00
s_remquo.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_rint.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_round.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_scalbln.c [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
s_scalbn.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_signbit.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_sin.c Fix sign of input to bsloww1 (BZ #16623) 2014-02-27 21:12:09 +05:30
s_sincos.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_tan.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_tanh.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_trunc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sincos32.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sincos32.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sincostab.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
slowexp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
slowpow.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
t_exp2.h Update. 1999-07-14 00:54:57 +00:00
t_exp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
uasncs.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
uatan.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
uexp.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
uexp.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ulog.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ulog.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
upow.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
upow.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
urem.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
uroot.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
usncs.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
utan.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
utan.tbl Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
w_exp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x2y2m1.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x2y2m1f.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00