From 1cd9ccd8c0b23a3106f08f6e29bcbb1f57d3334c Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 20 Dec 2024 13:01:20 -0300
Subject: math: Use atan2pif from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows better performance to the generic atan2pif.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

latency                 master        patched   improvement
x86_64                 79.4006        70.8726        10.74%
x86_64v2               77.5136        69.1424        10.80%
x86_64v3               71.8050        68.1637         5.07%
aarch64 (Neoverse)     27.8363        24.7700        11.02%
power8                 39.3893        17.2929        56.10%
power10                19.7200        16.8187        14.71%

reciprocal-throughput   master        patched   improvement
x86_64                 38.3457        30.9471        19.29%
x86_64v2               37.4023        30.3112        18.96%
x86_64v3               33.0713        24.4891        25.95%
aarch64 (Neoverse)     19.3683        15.3259        20.87%
power8                 19.5507        8.27165        57.69%
power10                9.05331        7.63775        15.64%

Reviewed-by: DJ Delorie <dj@redhat.com>
---
 sysdeps/arc/fpu/libm-test-ulps | 4 ----
 1 file changed, 4 deletions(-)

(limited to 'sysdeps/arc/fpu/libm-test-ulps')

diff --git a/sysdeps/arc/fpu/libm-test-ulps b/sysdeps/arc/fpu/libm-test-ulps
index 35aebba..1383c88 100644
--- a/sysdeps/arc/fpu/libm-test-ulps
+++ b/sysdeps/arc/fpu/libm-test-ulps
@@ -90,19 +90,15 @@ double: 8
 
 Function: "atan2pi":
 double: 1
-float: 1
 
 Function: "atan2pi_downward":
 double: 1
-float: 2
 
 Function: "atan2pi_towardzero":
 double: 1
-float: 2
 
 Function: "atan2pi_upward":
 double: 1
-float: 2
 
 Function: "atan_downward":
 double: 1
-- 
cgit v1.1