]> sourceware.org Git - glibc.git/commit
math: Use exp10m1f from CORE-MATH
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 25 Oct 2024 18:21:47 +0000 (15:21 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Nov 2024 14:27:26 +0000 (11:27 -0300)
commit5fa89852fa12fe56c315a119998affa267200f1b
tree78405c4b6dc8631840a34021e4663fa2fba6021f
parent48767cbb76e17d0ee03b2cf0a43bcf01e7295b8b
math: Use exp10m1f from CORE-MATH

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

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).  I mostly
fixed some small issues in corner cases (sNaN handling, -INFINITY,
a specific overflow check).

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                      45.4690        49.5845        -9.05%
x86_64v2                    46.1604        36.2665        21.43%
x86_64v3                    37.8442        31.0359        17.99%
i686                        121.367        93.0079        23.37%
aarch64                     21.1126        15.0165        28.87%
power10                     12.7426        8.4929         33.35%

reciprocal-throughput        master        patched   improvement
x86_64                      19.6005        17.4005        11.22%
x86_64v2                    19.6008        11.1977        42.87%
x86_64v3                    17.5427        10.2898        41.34%
i686                        59.4215        60.9675        -2.60%
aarch64                     13.9814        7.9173         43.37%
power10                      6.7814        6.4258          5.24%

The generic implementation calls __ieee754_exp10f which has an
optimized version, although it is not correctly rounded, which is
the main culprit of the the latency difference for x86_64 and
throughp for i686.

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>
20 files changed:
SHARED-FILES
sysdeps/aarch64/libm-test-ulps
sysdeps/arc/fpu/libm-test-ulps
sysdeps/arc/nofpu/libm-test-ulps
sysdeps/arm/libm-test-ulps
sysdeps/hppa/fpu/libm-test-ulps
sysdeps/i386/fpu/libm-test-ulps
sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
sysdeps/ieee754/flt-32/s_exp10m1f.c [new file with mode: 0644]
sysdeps/loongarch/lp64/libm-test-ulps
sysdeps/m68k/m680x0/fpu/libm-test-ulps
sysdeps/mips/mips32/libm-test-ulps
sysdeps/mips/mips64/libm-test-ulps
sysdeps/powerpc/fpu/libm-test-ulps
sysdeps/powerpc/nofpu/libm-test-ulps
sysdeps/riscv/nofpu/libm-test-ulps
sysdeps/riscv/rvd/libm-test-ulps
sysdeps/s390/fpu/libm-test-ulps
sysdeps/sparc/fpu/libm-test-ulps
sysdeps/x86_64/fpu/libm-test-ulps
This page took 0.045819 seconds and 5 git commands to generate.