Make x86 backend AOP-safe for shift instructions
Ensures x86 backend correctly recognizes shift instructions with OR, XOR, or PLUS operations.
This patch modifies the i386 backend’s Machine Description (i386.md) to ensure it is “any-or-plus (AOP) safe”. This means the backend can now correctly recognize shld and shrd instructions when they are represented in RTL using PLUS, IOR, or XOR operations. This change is a prerequisite for fixing PR tree-optimization/108477 and includes documentation for the aop<mode>3 named pattern.
In Details
The i386 backend's RTL patterns for shld and shrd instructions were updated to be AOP-safe, meaning they now correctly match when the underlying RTL uses PLUS, IOR, or XOR. This was achieved by applying any_or_plus and introducing aop_name_pfx. This work prepares for fixing PR tree-optimization/108477 and documents the aop<mode>3 pattern.
- AOP-safe
- A property of machine description patterns indicating they can correctly match RTL operations involving PLUS, IOR, or XOR, commonly used for bitwise shifts.
- RTL
- Register Transfer Language, an intermediate representation used by GCC to represent code during optimization and code generation.
- shld/shrd
- Shift Left Double and Shift Right Double instructions on x86 architectures, used for shifting bits across two registers.
- i386.md
- The Machine Description file for the Intel 386 architecture, defining its instruction set for GCC.