PowerPC: Accelerate SHA3 with XXEVAL support via instruction fusion
Adds PowerPC XXEVAL instruction support to fuse vector ANDC and XOR operations, speeding up SHA3 calculations.
This commit introduces support for the PowerPC XXEVAL instruction to optimize SHA3 calculations, addressing a performance regression observed in newer GCC versions compared to older ones. The optimization involves fusing specific vector ANDC and XOR operations when they are adjacent and feed into each other. This fusion is enabled by modifications to generated instruction patterns, particularly in fusion.md, allowing the compiler to leverage the specialized VANDC/VXOR adjacent to VXOR fusion mode available on Power10 processors, thereby reducing instruction spilling and improving performance.
In Details
Addresses a performance regression in SHA3 calculations on Power10, attributed to excessive spilling. The regression is linked to suboptimal instruction fusion patterns in fusion.md (generated by genfusion.pl) for sequences like vec_andc feeding vec_xor and subsequent vec_xor operations. This patch reintroduces and enhances the support for fusing VANDC or VXOR instructions adjacent to a VXOR instruction that feeds into it, utilizing the Power10's XXEVAL capabilities. This is achieved by updating genfusion.pl, predicates.md, rs6000.h, and rs6000.md, and regenerating `fu…
- XXEVAL
- A PowerPC instruction set extension that enables specific fused operations, particularly for logical and vector operations, on the Power10 processor.
- SHA3
- Secure Hash Algorithm 3, a cryptographic hash function standard.
- instruction fusion
- A compiler optimization technique that combines multiple independent instructions into a single, more efficient instruction or a tighter sequence.
- spilling
- The process of saving register contents to memory when there are not enough available registers to hold all the necessary values.
- Power10
- The tenth generation of IBM's POWER microarchitecture, featuring enhanced vector processing capabilities.
- VANDC
- Vector AND with Complement, a PowerPC vector instruction.
- VXOR
- Vector XOR, a PowerPC vector instruction.