From 03eeeba705cc714e77b0b2710fea2e956ff34f24 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 8 Oct 2025 10:55:15 -0300 Subject: math: Remove the SVID error handling from coshf It improves latency for about 3-10% and throughput for about 5-15%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra --- math/Versions | 1 + math/w_coshf_compat.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'math') diff --git a/math/Versions b/math/Versions index cf79a6107e..642bb9242e 100644 --- a/math/Versions +++ b/math/Versions @@ -692,6 +692,7 @@ libm { acoshf; asinf; atanhf; + coshf; log10f; } } diff --git a/math/w_coshf_compat.c b/math/w_coshf_compat.c index ce5e196c07..bef703becd 100644 --- a/math/w_coshf_compat.c +++ b/math/w_coshf_compat.c @@ -20,10 +20,11 @@ #include #include #include +#include -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_43) float -__coshf (float x) +__cosh_compatf (float x) { float z = __ieee754_coshf (x); if (__builtin_expect (!isfinite (z), 0) && isfinite (x) @@ -32,5 +33,10 @@ __coshf (float x) return z; } -libm_alias_float (__cosh, cosh) +# ifdef NO_COMPAT_NEEDED +strong_alias (__cosh_compatf, __coshf) +libm_alias_float (__cosh_compat, cosh) +# else +compat_symbol (libm, __cosh_compatf, coshf, GLIBC_2_0); +# endif #endif -- cgit v1.2.3