mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-21 04:31:04 +08:00
be25493251
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. |
||
---|---|---|
.. | ||
multiarch | ||
dla.h | ||
e_acosl.c | ||
e_atan2l.c | ||
e_exp2l.S | ||
e_exp10l.S | ||
e_expf.S | ||
e_expl.S | ||
e_fmodl.S | ||
e_ilogbl.S | ||
e_log2l.S | ||
e_log10l.S | ||
e_logl.S | ||
e_powl.S | ||
e_remainderl.S | ||
e_scalbl.S | ||
e_sqrt.c | ||
e_sqrtf.c | ||
e_sqrtl.c | ||
fclrexcpt.c | ||
fedisblxcpt.c | ||
feenablxcpt.c | ||
fegetenv.c | ||
fegetexcept.c | ||
fegetround.c | ||
feholdexcpt.c | ||
fesetenv.c | ||
fesetround.c | ||
feupdateenv.c | ||
fgetexcptflg.c | ||
fraiseexcpt.c | ||
fsetexcptflg.c | ||
ftestexcept.c | ||
Implies | ||
k_rem_pio2l.c | ||
libm-test-ulps | ||
math_ldbl.h | ||
math_private.h | ||
printf_fphex.c | ||
s_atanl.c | ||
s_ceill.S | ||
s_copysign.S | ||
s_copysignf.S | ||
s_copysignl.S | ||
s_cosf.S | ||
s_expm1l.S | ||
s_fabs.c | ||
s_fabsf.c | ||
s_fabsl.S | ||
s_fdiml.S | ||
s_finitel.S | ||
s_floorl.S | ||
s_fmax.S | ||
s_fmaxf.S | ||
s_fmaxl.S | ||
s_fmin.S | ||
s_fminf.S | ||
s_fminl.S | ||
s_fpclassifyl.c | ||
s_isinfl.c | ||
s_isnanl.c | ||
s_llrint.S | ||
s_llrintf.S | ||
s_llrintl.S | ||
s_log1pl.S | ||
s_logbl.c | ||
s_lrint.S | ||
s_lrintf.S | ||
s_lrintl.S | ||
s_nearbyintl.S | ||
s_nextafterl.c | ||
s_nexttoward.c | ||
s_nexttowardf.c | ||
s_rintl.c | ||
s_scalbnl.S | ||
s_signbit.S | ||
s_signbitf.S | ||
s_significandl.c | ||
s_sincosf.S | ||
s_sinf.S | ||
s_truncl.S |