]> git.feebdaed.xyz Git - 0xmirror/glibc.git/commit
aarch64: Optimise AdvSIMD asinhf
authorJames Chesterman <James.Chesterman@arm.com>
Fri, 28 Nov 2025 11:18:52 +0000 (11:18 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 4 Dec 2025 13:54:49 +0000 (10:54 -0300)
commit0e734b2b0caf78f69f447036dd20c63edf514358
treeb709098840b993cb13cb89ac6c506ef006c9040c
parent0e80864c07ffb549557e3c317b6b5326444da95e
aarch64: Optimise AdvSIMD asinhf

Optimise AdvSIMD asinhf by vectorising the special case.
For values greater than 0x1p64, scale the input down first.
This is because the output will overflow with inputs greater than
or equal to this value as there is a squaring operation in the
algorithm.
To scale, do:
2asinh(sqrt[(x-1)/2])
Because:
2asinh(x) = +-acosh(2x^2 + 1)
Apply opposite operations in opposite order for x, and you get:
asinh(x) = 2acosh(sqrt[(x-1)/2]).
Found that using asinh instead of acosh also very closely
approximates asinh(x) for a high input x.

R.Throughput difference on V2 with GCC@15:
25-58% improvement in special cases.
4% regression in fast pass.
sysdeps/aarch64/fpu/asinhf_advsimd.c