glibc/sysdeps/x86_64/fpu
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
..
multiarch Fix pow overflow in non-default rounding modes (bug 16315). 2014-06-23 20:12:33 +00:00
dla.h Better DLA_FMS 2011-10-24 22:11:21 -04:00
e_acosl.c Update. 2001-09-19 10:37:31 +00:00
e_atan2l.c Update. 2001-09-19 10:37:31 +00:00
e_exp2l.S Optimize libm 2011-10-12 11:27:51 -04:00
e_exp10l.S Fix exp10 inaccuracy and exceptions (bugs 13884, 13914). 2012-05-06 18:23:44 +00:00
e_expf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_expl.S Fix x86/x86_64 expm1l spurious underflow exceptions (bug 16539). 2014-06-24 21:00:08 +00:00
e_fmodl.S Optimize libm 2011-10-12 11:27:51 -04:00
e_ilogbl.S Remove useless __ilogb*_finite aliases 2012-04-18 00:40:13 +02:00
e_log2l.S Fix log2 (1) in round-downward mode (bug 17042). 2014-06-10 12:07:15 +00:00
e_log10l.S Fix log10 (1) in round-downward mode (bug 16977). 2014-05-23 12:07:50 +00:00
e_logl.S Fix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022). 2014-06-18 12:32:01 +00:00
e_powl.S Fix pow overflow in non-default rounding modes (bug 16315). 2014-06-23 20:12:33 +00:00
e_remainderl.S Optimize libm 2011-10-12 11:27:51 -04:00
e_scalbl.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_sqrt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_sqrtf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
e_sqrtl.c Update. 2001-09-19 10:37:31 +00:00
fclrexcpt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fedisblxcpt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
feenablxcpt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fegetenv.c Make x86_64 fegetenv preserve exception mask (bug 16198). 2014-03-26 18:59:08 +00:00
fegetexcept.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fegetround.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
feholdexcpt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fesetenv.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fesetround.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
feupdateenv.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fgetexcptflg.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fraiseexcpt.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fsetexcptflg.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ftestexcept.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Implies Use x86_64 fpu/bits/fenv.h for i386 and x86_64 2012-06-06 10:13:19 -07:00
k_rem_pio2l.c Dummy files to prevent stub versions from being used. 2007-05-17 18:39:55 +00:00
libm-test-ulps Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562). 2014-06-27 14:52:13 +00:00
math_ldbl.h Update. 2001-09-19 10:37:31 +00:00
math_private.h Use movq for 64-bit operations 2013-05-15 20:33:45 +02:00
printf_fphex.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_atanl.c Update. 2001-09-19 10:37:31 +00:00
s_ceill.S Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_copysign.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_copysignf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_copysignl.S Update. 2002-07-06 15:07:30 +00:00
s_cosf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_expm1l.S Fix x86/x86_64 expm1l inaccuracy and exceptions (bugs 13885, 13923). 2012-05-07 19:13:08 +00:00
s_fabs.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fabsf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fabsl.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fdiml.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_finitel.S Update. 2002-09-10 01:40:26 +00:00
s_floorl.S Update. 2003-11-18 07:25:02 +00:00
s_fmax.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fmaxf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fmaxl.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fmin.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fminf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fminl.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_fpclassifyl.c Update. 2001-09-19 10:37:31 +00:00
s_isinfl.c Update. 2001-09-19 10:37:31 +00:00
s_isnanl.c Update. 2001-09-19 10:37:31 +00:00
s_llrint.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llrintf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_llrintl.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_log1pl.S Fix log1pl (LDBL_MAX) in FE_UPWARD mode (bug 16564). 2014-05-14 12:38:56 +00:00
s_logbl.c Update. 2001-09-19 10:37:31 +00:00
s_lrint.S lrint and llrint implementation for x86-64. 2002-04-08 08:14:22 +00:00
s_lrintf.S lrint and llrint implementation for x86-64. 2002-04-08 08:14:22 +00:00
s_lrintl.S lrint and llrint implementation for x86-64. 2002-04-08 08:14:22 +00:00
s_nearbyintl.S Update. 2003-11-18 07:25:02 +00:00
s_nextafterl.c Update. 2001-09-19 10:37:31 +00:00
s_nexttoward.c Update. 2001-09-19 10:37:31 +00:00
s_nexttowardf.c Update. 2001-09-19 10:37:31 +00:00
s_rintl.c Update. 2001-09-19 10:37:31 +00:00
s_scalbnl.S Update. 2003-11-18 07:25:02 +00:00
s_signbit.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_signbitf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_significandl.c Update. 2001-09-19 10:37:31 +00:00
s_sincosf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_sinf.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
s_truncl.S Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00