ARM: Fixes big-endian 16-bit NEON lane duplication for PR128324
Corrects the order of operations in ARM NEON 16-bit lane duplication for big-endian targets to properly handle lane indexing.
This commit resolves an issue in ARM’s NEON 16-bit lane duplication for big-endian architectures, addressing PR128324. The problem stemmed from an incorrect statement ordering in a previous patch. Specifically, the subreg_regno_offset call, used to determine the core register for extraction, must now occur before adjusting the element number. This adjustment is crucial for mapping the big-endian byte ordering to the ARM lane ordering, ensuring correct lane duplication.
In Details
This fix targets the ARM NEON backend, specifically in gcc/config/arm/neon.md. It addresses an ordering dependency in the neon_vdup_lane internal VQW and VQHF/VBF/VBF modes when compiling for big-endian targets. The issue is that the calculation of the base register using subreg_regno_offset needs to precede the adjustment of the element index. This adjustment accounts for the byte-swapping required by big-endianness to align with NEON's lane-based operations. The incorrect order in the previous patch (r17-2930) led to mis-mapped lanes.
- ARM NEON
- An advanced SIMD (Single Instruction, Multiple Data) architecture extension for ARM processors, designed for high-performance media and signal processing.
- 16-bit lane duplication
- A NEON operation where a 16-bit element from a vector register is duplicated across multiple lanes within the same or another vector register.
- big-endian
- A byte ordering scheme where the most significant byte of a multi-byte word is stored at the lowest memory address.
- subreg_regno_offset
- An internal GCC compiler function used to determine the register number and offset for a subregister within a larger register.
- PR128324
- A bug report identifier within the GCC bug tracking system, indicating a specific issue that has been reported and is being addressed.