summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-10-31 13:08:54 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-11-04 04:14:01 -0300
commitf27a146409e633c73c8212ed8e38114102d9888c (patch)
treece4a20371e6a1ed3375285ab2c83420e42f3b7f4 /sysdeps/ieee754
parent0e1a1178ee22a25ff4568f51a2fec85451b17b04 (diff)
math: Remove the SVID error handling from sinhf
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 <Wilco.Dijkstra@arm.com>
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/flt-32/e_sinhf.c22
-rw-r--r--sysdeps/ieee754/flt-32/w_sinhf.c1
2 files changed, 14 insertions, 9 deletions
diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c
index 5e812c35af..687f75332e 100644
--- a/sysdeps/ieee754/flt-32/e_sinhf.c
+++ b/sysdeps/ieee754/flt-32/e_sinhf.c
@@ -24,15 +24,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <libm-alias-finite.h>
+#include <libm-alias-float.h>
+#include <math-svid-compat.h>
#include <math-narrow-eval.h>
#include "math_config.h"
#include "e_sincoshf_data.h"
float
-__ieee754_sinhf (float x)
+__sinhf (float x)
{
static const struct
{
@@ -44,15 +47,9 @@ __ieee754_sinhf (float x)
uint32_t ux = asuint (x) << 1;
if (__glibc_unlikely (ux > 0x8565a9f8u))
{ /* |x| >~ 89.4 */
- float sgn = copysignf (2.0f, x);
if (ux >= 0xff000000u)
- {
- if (ux << 8)
- return x + x; /* nan */
- return copysignf (INFINITY, x); /* +-inf */
- }
- float r = math_narrow_eval (sgn * 0x1.fffffep127f);
- return r;
+ return x + x;;
+ return __math_oflowf (x < 0);
}
if (__glibc_unlikely (ux < 0x7c000000u))
{ /* |x| < 0.125 */
@@ -105,4 +102,11 @@ __ieee754_sinhf (float x)
}
return ub;
}
+strong_alias (__sinhf, __ieee754_sinhf)
+#if LIBM_SVID_COMPAT
+versioned_symbol (libm, __sinhf, sinhf, GLIBC_2_43);
+libm_alias_float_other (__sinh, sinh)
+#else
+libm_alias_float (__sinh, sinh)
+#endif
libm_alias_finite (__ieee754_sinhf, __sinhf)
diff --git a/sysdeps/ieee754/flt-32/w_sinhf.c b/sysdeps/ieee754/flt-32/w_sinhf.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_sinhf.c
@@ -0,0 +1 @@
+/* Not needed. */