]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Fix neon-sve-bridge.c failures for big-endian
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 26 Jul 2025 17:38:47 +0000 (18:38 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Sat, 26 Jul 2025 17:38:47 +0000 (18:38 +0100)
commit82f5dd231e2e25bc18853f3f1d217a6bde778b20
treeff4e7466a85a2b885eb6e0b5702ac17ee07d65c9
parentd755d8107d336ca1a5805370fb6c5fb4df2c5da4
aarch64: Fix neon-sve-bridge.c failures for big-endian

Lowpart subregs are generally disallowed on big-endian SVE vector
registers, since the first memory element is stored at the least
significant end of the register, rather than the most significant end.
(See the comment at the head of aarch64-sve.md for details,
and aarch64_modes_compatible_p for the implementation.)

This means that arm_sve_neon_bridge.h needs to use custom define_insns
for big-endian targets, in lieu of using lowpart subregs.  However,
one of those define_insns relied on the prohibited lowparts internally,
to convert an Advanced SIMD register to an SVE register.  Since the
lowpart is not allowed, the lowpart_subreg would return null, leading
to a later ICE.

The simplest fix seems to be to use %Z instead, to force the Advanced
SIMD register to be written as an SVE register.

gcc/
* config/aarch64/aarch64-sve.md (@aarch64_sve_set_neonq_<mode>):
Use %Z instead of lowpart_subreg.  Tweak formatting.

(cherry picked from commit 69c839c7361430ec27d1f13f909531b872588f27)
gcc/config/aarch64/aarch64-sve.md