aarch64: Simplify SIMD lane printing with multi-character operands
AArch64 SIMD lane selection in assembly output is simplified using new internal print operands.
This commit enhances the AArch64 backend by introducing a new internal print operand, ENDIAN_LANE. This operand simplifies SIMD instruction patterns that previously required custom C code to convert a lane number into its architectural representation, considering vector width and endianness. The new operand centralizes this logic within the target’s print operand hook, allowing patterns for instructions like dup and fcmla to use a cleaner, direct assembly template.
In Details
This change introduces endian_lane and related print operands (ENDIAN_LANE, ENDIAN_LANE1, etc.) to aarch64-print-operands.def. These are used in aarch64-simd.md to simplify patterns that insert or duplicate lanes into SIMD registers. The aarch64_print_operand function in aarch64.cc now handles these modifiers, calculating the correct architectural lane index based on the register mode and endianness. This replaces C code within MD patterns for instructions like dup_lane and fcmla_lane.
- SIMD
- Single Instruction, Multiple Data. A type of parallel processing where a single instruction operates on multiple data points simultaneously.
- print operand
- A mechanism within GCC's machine descriptions that defines how operands should be formatted when generating assembly code.
- lane number
- An index that identifies a specific element within a SIMD or vector register.
- architectural lane order
- The standardized order in which lanes within a vector register are addressed or referred to by the architecture's instructions.
- endianness
- The order in which bytes of a multi-byte data word are stored in computer memory. Big-endian stores the most significant byte first, while little-endian stores the least significant byte first.
- vector mode
- GCC's internal representation for vector data types, specifying the size and element type of the vector.