glibc/sysdeps/ieee754/ldbl-96
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
..
e_acoshl.c Fix acosh (1) in round-downward mode (bug 16927). 2014-05-14 12:35:40 +00:00
e_asinl.c Use hex float 64-bit values in ldbl-96 asinl (bug 14803). 2012-11-28 21:46:16 +00:00
e_atanhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_coshl.c Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061). 2014-06-23 20:20:10 +00:00
e_gammal_r.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_hypotl.c Fix hypot handling of subnormals (bug 16316, bug 16330). 2013-12-17 13:42:13 +00:00
e_j0l.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_j1l.c Set errno for y1 overflow (bug 17050). 2014-06-23 20:17:13 +00:00
e_jnl.c Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562). 2014-06-27 14:52:13 +00:00
e_lgammal_r.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_rem_pio2l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_sinhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
gamma_product.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gamma_productl.c 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_sinl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
k_tanl.c Fix tan, tanl for large inputs. 2012-03-16 20:05:37 +00:00
ldbl2mpn.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
math_ldbl.h Fix a typo. 2000-12-21 23:30:28 +00:00
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_cbrtl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_copysignl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_cosl.c Implement ldbl-96 sinl / cosl / sincosl (bug 13851). 2012-03-16 12:30:05 +00:00
s_erfl.c Fix erf underflow handling near 0 (bug 16516). 2014-05-14 12:34:03 +00:00
s_fma.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_fmal.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01: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_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_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_nexttoward.c Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
s_nexttowardf.c Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
s_remquol.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_roundl.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_scalblnl.c [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
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 Implement ldbl-96 sinl / cosl / sincosl (bug 13851). 2012-03-16 12:30:05 +00:00
s_tanhl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_tanl.c Fix tan, tanl for large inputs. 2012-03-16 20:05:37 +00:00
strtold_l.c 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 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
x2y2m1l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00