glibc/sysdeps/i386/fpu
Joseph Myers 1356f38df5 Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358)
As described in bug 28358, the round-to-odd computations used in the
libm functions that round their results to a narrower format can yield
spurious underflow exceptions in the following circumstances: the
narrowing only narrows the precision of the type and not the exponent
range (i.e., it's narrowing _Float128 to _Float64x on x86_64, x86 or
ia64), the architecture does after-rounding tininess detection (which
applies to all those architectures), the result is inexact, tiny
before rounding but not tiny after rounding (with the chosen rounding
mode) for _Float64x (which is possible for narrowing mul, div and fma,
not for narrowing add, sub or sqrt), so the underflow exception
resulting from the toward-zero computation in _Float128 is spurious
for _Float64x.

Fixed by making ROUND_TO_ODD call feclearexcept (FE_UNDERFLOW) in the
problem cases (as indicated by an extra argument to the macro); there
is never any need to preserve underflow exceptions from this part of
the computation, because the conversion of the round-to-odd value to
the narrower type will underflow in exactly the cases in which the
function should raise that exception, but it may be more efficient to
avoid the extra manipulation of the floating-point environment when
not needed.

Tested for x86_64 and x86, and with build-many-glibcs.py.
2021-09-21 21:54:37 +00:00
..
doasin.c
e_acos.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acosf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acosh.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acoshf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acoshl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_asin.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_asinf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atan2.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atan2f.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atan2l.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atanh.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atanhf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atanhl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_exp2.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_exp2l.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_exp10.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_exp10l.S
e_exp_data.c
e_exp.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_expl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_fmod.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_fmodf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_fmodl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_hypot.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_hypotf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_ilogb.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_ilogbf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_ilogbl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log2_data.c
e_log2.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log2l.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log10.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log10f.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log10l.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_log_data.c
e_log.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_logl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_pow_log_data.c
e_pow.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_powl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_remainder.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_remainderf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_remainderl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_scalb.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_scalbf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_scalbl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_sqrt.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_sqrtf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fclrexcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fedisblxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
feenablxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetenv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetexcept.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetmode.c
fegetround.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
feholdexcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fesetenv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fesetexcept.c
fesetmode.c
fesetround.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
feupdateenv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fgetexcptflg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fraiseexcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fsetexcptflg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ftestexcept.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
i386-math-asm.h
Implies
libm-test-ulps
libm-test-ulps-name
math_err.c
math-tests-snan.h
mpatan2.c
mpatan.c
mpsqrt.c
s_asinh.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_asinhf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_asinhl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_atan.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_atanf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_atanl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_cbrt.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_cbrtf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_cbrtl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ceil.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ceilf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ceill.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_copysign.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_copysignf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_copysignl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_expm1.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_expm1f.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_expm1l.S
s_f32xaddf64.c
s_f32xdivf64.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_f32xmulf64.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_f32xsubf64.c
s_fabs.S
s_fabsf.S
s_fabsl.S
s_fdim.c
s_finite.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_finitef.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_finitel.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_floor.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_floorf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_floorl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fmax.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fmaxf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fmaxl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fmin.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fminf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fminl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_frexp.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_frexpf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_frexpl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_isinfl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_llrint.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_llrintf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_llrintl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_log1p.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_log1pf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_log1pl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_logb.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_logbf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_logbl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lrint.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lrintf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lrintl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nearbyint.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nearbyintf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nearbyintl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nextafterl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nexttoward.c
s_nexttowardf.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_remquo.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_remquof.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_remquol.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_rint.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_rintf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_rintl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_scalbln.c
s_scalblnf.c
s_scalblnl.c
s_scalbn.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_scalbnf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_scalbnl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_significand.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_significandf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_significandl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_trunc.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_truncf.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_truncl.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Versions
w_exp2.c
w_exp.c
w_log2.c
w_log.c
w_pow.c
w_sqrt_compat.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
w_sqrt.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00