glibc/sysdeps/ieee754/ldbl-128
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
..
bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_acoshl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_acosl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_asinl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_atan2l.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_atanhl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_coshl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_exp10l.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
e_expl.c 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_gammal_r.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_hypotl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_ilogbl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_j0l.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_j1l.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_jnl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_lgammal_r.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_log2l.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_log10l.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_logl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_powl.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_rem_pio2l.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_remainderl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
e_sinhl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
float128-abi.h Move __isnanf128 to libc.so 2021-03-30 14:58:19 +05:30
gamma_productl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ieee754.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
k_cosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
k_sincosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
k_sinl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
k_tanl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lgamma_negl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lgamma_productl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makeconfig Add _Float64x function aliases. 2017-11-27 14:16:47 +00:00
Makefile
math-nan-payload-ldouble.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
math_ldbl.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mpn2ldbl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
printf_fphex.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
printf_fphex_macros.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_asinhl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_atanl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
s_cbrtl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
s_ceill.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_copysignl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_cosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_daddl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_ddivl.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_dmull.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_dsqrtl.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
s_dsubl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_erfl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
s_expm1l.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
s_f64xaddf128.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_f64xdivf128.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_f64xmulf128.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_f64xsqrtf128.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
s_f64xsubf128.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fabsl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_faddl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fdivl.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_finitel.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_floorl.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_fmal.c Redirect fma calls to __fma in libm 2021-09-15 22:57:35 +00:00
s_fmull.c Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
s_fpclassifyl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_frexpl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_fromfpl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
s_fromfpl_main.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_fromfpxl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
s_fsqrtl.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
s_fsubl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_getpayloadl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_isinfl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_isnanl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_issignalingl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_llrintl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_llroundl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_log1pl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
s_logbl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lrintl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_lroundl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_modfl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_nearbyintl.c 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 ldbl-128ibm-compat: Provide nexttoward functions 2020-02-28 08:20:02 -06:00
s_nexttowardf.c ldbl-128ibm-compat: Provide nexttoward functions 2020-02-28 08:20:02 -06:00
s_nextupl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_remquol.c 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_roundevenl.c Use GCC builtins for roundeven functions if desired. 2021-06-27 07:56:57 -07:00
s_roundl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_scalblnl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_scalbnl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_setpayloadl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
s_setpayloadl_main.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_setpayloadsigl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
s_signbitl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_sincosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_sinl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_tanhl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_tanl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_totalorderl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_totalordermagl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_truncl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
s_ufromfpl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
s_ufromfpxl.c Use libm_alias_ldouble for ldbl-128 functions. 2017-10-06 17:45:05 +00:00
strtold_l.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
t_expl.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
t_sincosl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
x2y2m1l.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00