glibc/sysdeps/ieee754
Szabolcs Nagy 347a5b592c math: Fix float conversion regressions with gcc-12 [BZ #28713]
Converting double precision constants to float is now affected by the
runtime dynamic rounding mode instead of being evaluated at compile
time with default rounding mode (except static object initializers).

This can change the computed result and cause performance regression.
The known correctness issues (increased ulp errors) are already fixed,
this patch fixes remaining cases of unnecessary runtime conversions.

Add float M_* macros to math.h as new GNU extension API.  To avoid
conversions the new M_* macros are used and instead of casting double
literals to float, use float literals (only required if the conversion
is inexact).

The patch was tested on aarch64 where the following symbols had new
spurious conversion instructions that got fixed:

  __clog10f
  __gammaf_r_finite@GLIBC_2.17
  __j0f_finite@GLIBC_2.17
  __j1f_finite@GLIBC_2.17
  __jnf_finite@GLIBC_2.17
  __kernel_casinhf
  __lgamma_negf
  __log1pf
  __y0f_finite@GLIBC_2.17
  __y1f_finite@GLIBC_2.17
  cacosf
  cacoshf
  casinhf
  catanf
  catanhf
  clogf
  gammaf_positive

Fixes bug 28713.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2022-01-10 14:27:17 +00:00
..
dbl-64 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
float128 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
flt-32 math: Fix float conversion regressions with gcc-12 [BZ #28713] 2022-01-10 14:27:17 +00:00
ldbl-64-128 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl-96 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl-128 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl-128ibm Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl-128ibm-compat Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ldbl-opt Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
soft-fp Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ieee754.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
k_standard.c Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
k_standardl.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libm-alias-finite.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Simplify math-svid-compat code. 2017-08-28 15:19:52 +00:00
s_matherr.c Obsolete matherr, _LIB_VERSION, libieee.a. 2017-08-21 17:45:10 +00:00
s_signgam.c Remove unnecessary math_private.h includes. 2018-09-28 21:53:33 +00:00