diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-10-25 15:21:51 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-11-01 11:27:39 -0300 |
commit | c3695808141ff1655da8da3c4e9330bcd2305f55 (patch) | |
tree | 316a77912d358cb1272a9e09c62192668b4058e9 /sysdeps/powerpc | |
parent | 9247f5321969abb701099b598b6eadb22b277ee4 (diff) | |
download | glibc-c3695808141ff1655da8da3c4e9330bcd2305f55.zip glibc-c3695808141ff1655da8da3c4e9330bcd2305f55.tar.gz glibc-c3695808141ff1655da8da3c4e9330bcd2305f55.tar.bz2 |
math: Use log2p1f from CORE-MATH
The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows better performance compared to the generic log2p1f.
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 70.1462 47.0090 32.98%
x86_64v2 70.2513 47.6160 32.22%
x86_64v3 60.4840 39.9443 33.96%
i686 164.068 122.909 25.09%
aarch64 25.9169 16.9207 34.71%
power10 18.1261 9.8592 45.61%
powerpc 17.2683 9.38665 45.64%
reciprocal-throughput master patched improvement
x86_64 26.2240 16.4082 37.43%
x86_64v2 25.0911 15.7480 37.24%
x86_64v3 20.9371 11.7264 43.99%
i686 90.4209 95.3073 -5.40%
aarch64 16.8537 8.9561 46.86%
power10 12.9401 6.5555 49.34%
powerpc 9.01763 7.54745 16.30%
The performance decrease for i686 is mostly due the use of x87 fpu,
when building with '-msse2 -mfpmath=sse:
master patched improvement
latency 164.068 102.982 37.23%
reciprocal-throughput 89.1968 82.5117 7.49%
Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r-- | sysdeps/powerpc/fpu/libm-test-ulps | 4 | ||||
-rw-r--r-- | sysdeps/powerpc/nofpu/libm-test-ulps | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index ddbd184..f775c56 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1569,25 +1569,21 @@ ldouble: 4 Function: "log2p1": double: 2 -float: 2 float128: 3 ldouble: 2 Function: "log2p1_downward": double: 2 -float: 2 float128: 3 ldouble: 4 Function: "log2p1_towardzero": double: 2 -float: 2 float128: 2 ldouble: 5 Function: "log2p1_upward": double: 2 -float: 2 float128: 3 ldouble: 6 diff --git a/sysdeps/powerpc/nofpu/libm-test-ulps b/sysdeps/powerpc/nofpu/libm-test-ulps index c79dfcc..a732166 100644 --- a/sysdeps/powerpc/nofpu/libm-test-ulps +++ b/sysdeps/powerpc/nofpu/libm-test-ulps @@ -1317,22 +1317,18 @@ ldouble: 4 Function: "log2p1": double: 1 -float: 2 ldouble: 2 Function: "log2p1_downward": double: 2 -float: 2 ldouble: 4 Function: "log2p1_towardzero": double: 2 -float: 2 ldouble: 5 Function: "log2p1_upward": double: 2 -float: 2 ldouble: 6 Function: "log_downward": |