AArch64: Make bitfield patterns AOP-safe
AArch64 bitfield instruction patterns are made AOP-safe to resolve testsuite regressions caused by aggressive optimization.
This patch modifies AArch64’s machine description (aarch64.md) to make bitfield instructions (bfi, bfxil, rev16) recognize RTL expressions using PLUS, IOR, or XOR. This change is necessary to address testsuite regressions that occurred after a previous patch improved the middle-end’s ability to select between these operations. While the patterns are now AOP-safe, accurate cost estimates for these instructions are still pending review in a separate patch.
In Details
This commit addresses issues in the AArch64 backend's instruction selection, specifically concerning bitfield manipulation instructions. The aarch64.md file defines patterns that map RTL expressions to machine instructions. The 'AOP-safe' requirement means these patterns must correctly match RTL generated using various arithmetic or logical operations (Any-Or-Plus, IOR, XOR). Previous aggressive optimizations in the middle-end, particularly around get_nonzero_bits, generated RTL that didn't always match the existing AOP-specific patterns, leading to regressions. This patch ensures the pat…
- AArch64
- The 64-bit ARM architecture. GCC supports compilation for this platform.
- AOP
- Any-Or-Plus. In GCC's RTL, this refers to patterns that can be generated using arithmetic or logical operations like PLUS, IOR, or XOR.
- bfi
- Bit Field Insert. An AArch64 instruction that inserts a bitfield from one register into another at a specified position.
- bfxil
- Bit Field Extract and Insert. An AArch64 instruction that extracts a bitfield from one register and inserts it into another.
- rev16
- Reverse 16 bits. An AArch64 instruction that reverses the order of bytes within 16-bit chunks of a register.
- RTL
- Register Transfer Language, an intermediate representation used within GCC to represent code before it is translated into machine code. It describes data transfers between registers and memory.
- machine description
- Files (e.g., *.md) that describe the instruction set, addressing modes, and costs for a specific target architecture, used by GCC's backend for code generation.