sparc: Skip empty instructions in errata workaround paths
SPARC errata workarounds now correctly skip empty instructions in instruction windows.
This commit improves SPARC’s handling of hardware errata by ensuring that instruction window traversals for workarounds properly skip over empty instructions. Previously, zero-length instructions (like frame blockages or empty asm statements) occupied space in the window, potentially disrupting the intended sequence of the workaround. The fix uses next_active_non_empty_insn() to ensure only valid instructions are considered, aligning with other existing workaround implementations.
In Details
The SPARC backend in GCC implements workarounds for specific CPU errata, such as issues with FDIV or FSQRT results on AT697F and UT699 processors. These workarounds historically used next_active_insn() to navigate instruction windows. However, zero-length instructions, which emit no actual machine code but consume a slot, could interfere with these traversals. This patch modifies the errata workaround logic for lost divide/square root, AT697F, and UT699 to use next_active_non_empty_insn(), similar to other SPARC workarounds, ensuring correct behavior when empty insns are present.
- errata
- Known hardware bugs or flaws in a processor design.
- instruction window
- A conceptual or physical buffer within a processor that holds a sequence of instructions being considered for execution, often used for speculative execution or handling complex instruction sequences.
- NOP
- No Operation; an instruction that does nothing but consume processor cycles. Often used as a placeholder or in hardware errata workarounds.
- RTL
- Register Transfer Language, an intermediate representation used within GCC.