glibc/sysdeps/ieee754/dbl-64
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
..
asincos.tbl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
atnat2.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
atnat.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
branred.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
branred.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
dbl2mpn.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dla.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acos.c
e_acosh.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_asin.c math: Remove slow paths from asin and acos [BZ #15267] 2021-03-11 14:26:36 +00:00
e_atan2.c math: Remove slow paths from atan2 [BZ #15267] 2021-03-11 14:26:36 +00:00
e_atanh.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_cosh.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_exp2.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_exp10.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_exp_data.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_exp.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_fmod.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_gamma_r.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_hypot.c
e_ilogb.c
e_j0.c
e_j1.c
e_jn.c
e_lgamma_r.c
e_log2_data.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_log2.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_log10.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
e_log_data.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_log.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_pow_log_data.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_pow.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_remainder.c math: Remove mpa files [BZ #15267] 2021-03-11 14:26:36 +00:00
e_sinh.c
e_sqrt.c math: Remove mpa files [BZ #15267] 2021-03-11 14:26:36 +00:00
gamma_product.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gamma_productf.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
k_rem_pio2.c
k_tan.c
lgamma_neg.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lgamma_product.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makefile
math_config.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
math_err.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mpn2dbl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mydefs.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
powtwo.tbl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
root.tbl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_asinh.c
s_atan.c math: Remove slow paths from atan [BZ #15267] 2021-03-11 14:26:36 +00:00
s_cbrt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ceil.c
s_copysign.c
s_cos.c
s_erf.c
s_expm1.c
s_f32xaddf64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_f32xdivf64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_f32xmulf64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_f32xsqrtf64.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
s_f32xsubf64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fabs.c
s_fadd.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fdiv.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_finite.c
s_floor.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fma.c Redirect fma calls to __fma in libm 2021-09-15 22:57:35 +00:00
s_fmaf.c Redirect fma calls to __fma in libm 2021-09-15 22:57:35 +00:00
s_fmul.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_fpclassify.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_frexp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fromfp_main.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fromfp.c
s_fromfpx.c
s_fsqrt.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
s_fsub.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_getpayload.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_isinf.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_isnan.c
s_issignaling.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_llrint.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_llround.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_log1p.c
s_logb.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lrint.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lround.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_modf.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nearbyint.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nexttoward.c
s_nextup.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_remquo.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_rint.c
s_round.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_roundeven.c Use GCC builtins for roundeven functions if desired. 2021-06-27 07:56:57 -07:00
s_scalbln.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_scalbn.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_setpayload_main.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_setpayload.c
s_setpayloadsig.c
s_signbit.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_sin.c math: Remove mpa files [BZ #15267] 2021-03-11 14:26:36 +00:00
s_sincos.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_tan.c math: Remove slow paths in tan [BZ #15267] 2021-03-11 14:26:36 +00:00
s_tanh.c
s_totalorder.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_totalordermag.c Remove dbl-64/wordsize-64 (part 2) 2021-01-07 15:26:26 +00:00
s_trunc.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ufromfp.c
s_ufromfpx.c
sincostab.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
uasncs.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
uatan.tbl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
urem.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
usncs.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
utan.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
utan.tbl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
w_exp2.c
w_exp.c
w_log2.c
w_log.c
w_pow.c
x2y2m1.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
x2y2m1f.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00