]> git.ipfire.org Git - thirdparty/glibc.git/commit
aarch64: Fix AdvSIMD libmvec routines for big-endian
authorJoe Ramsay <Joe.Ramsay@arm.com>
Thu, 2 May 2024 15:43:13 +0000 (16:43 +0100)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Thu, 27 Feb 2025 17:36:50 +0000 (17:36 +0000)
commitd591876303e368fde0b03e1536efb69b64d9d483
treebc9b648acd5e8a4a2c435b138392fc7dda988eb8
parentf6d48470aef9264d2d56f4c4533eb76db7f9c2e4
aarch64: Fix AdvSIMD libmvec routines for big-endian

Previously many routines used * to load from vector types stored
in the data table. This is emitted as ldr, which byte-swaps the
entire vector register, and causes bugs for big-endian when not
all lanes contain the same value. When a vector is to be used
this way, it has been replaced with an array and the load with an
explicit ld1 intrinsic, which byte-swaps only within lanes.

As well, many routines previously used non-standard GCC syntax
for vector operations such as indexing into vectors types with []
and assembling vectors using {}. This syntax should not be mixed
with ACLE, as the former does not respect endianness whereas the
latter does. Such examples have been replaced with, for instance,
vcombine_* and vgetq_lane* intrinsics. Helpers which only use the
GCC syntax, such as the v_call helpers, do not need changing as
they do not use intrinsics.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit 90a6ca8b28bf34e361e577e526e1b0f4c39a32a5)
sysdeps/aarch64/fpu/exp10f_advsimd.c
sysdeps/aarch64/fpu/expm1_advsimd.c
sysdeps/aarch64/fpu/expm1f_advsimd.c
sysdeps/aarch64/fpu/log10_advsimd.c
sysdeps/aarch64/fpu/log2_advsimd.c
sysdeps/aarch64/fpu/log_advsimd.c
sysdeps/aarch64/fpu/tan_advsimd.c
sysdeps/aarch64/fpu/tanf_advsimd.c