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 Update. 2001-03-12 00:04:52 +00:00
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 Fix exp10 inaccuracy and exceptions (bugs 13884, 13914). 2012-05-06 18:23:44 +00:00
e_exp_data.c Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
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 Add new log2 implementation 2018-09-12 17:36:33 +01:00
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 Add new log implementation 2018-09-12 17:33:30 +01:00
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 Add new pow implementation 2018-09-19 10:04:51 +01:00
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 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
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 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetmode.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
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 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Implies Use x86_64 fpu/bits/fenv.h for i386 and x86_64 2012-06-06 10:13:19 -07:00
libm-test-ulps i386: Regenerate ulps 2021-07-25 22:29:27 +02:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
math_err.c Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
math-tests-snan.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mpatan2.c Update. 2001-03-12 00:04:52 +00:00
mpatan.c Update. 2001-03-12 00:04:52 +00:00
mpsqrt.c Update. 2001-03-12 00:04:52 +00:00
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 Fix x86/x86_64 expm1l inaccuracy and exceptions (bugs 13885, 13923). 2012-05-07 19:13:08 +00:00
s_f32xaddf64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
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 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fabs.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_fabsf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_fabsl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_fdim.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
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 Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
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 Update. 1999-07-14 00:54:57 +00:00
s_scalblnf.c Update. 1999-07-14 00:54:57 +00:00
s_scalblnl.c Update. 1999-07-14 00:54:57 +00:00
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 Update. 2000-06-14 00:55:24 +00:00
w_exp2.c Remove the error handling wrapper from exp and exp2 2018-11-21 09:55:02 +00:00
w_exp.c Remove the error handling wrapper from exp and exp2 2018-11-21 09:55:02 +00:00
w_log2.c Remove the error handling wrapper from log2 2018-11-21 09:57:21 +00:00
w_log.c Remove the error handling wrapper from log 2018-11-21 09:56:27 +00:00
w_pow.c Remove the error handling wrapper from pow 2018-11-21 09:58:36 +00:00
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