i386: Implement PCLMUL expanders for efficient CRC computation
Adds PCLMUL instruction support to the i386 backend for faster CRC calculations, similar to aarch64's PMULL.
This commit introduces PCLMUL instruction expanders to the i386 backend, enabling faster Cyclic Redundancy Check (CRC) computations. The new expanders leverage the PCLMULQDQ instruction for both bit-forward and bit-reversed CRC-16 and CRC-32 calculations when the target supports it. This optimization aligns the x86 backend’s capabilities with other architectures like aarch64.
In Details
The i386 backend now includes expanders for CRC computations utilizing the PCLMULQDQ instruction. These expanders target CRC-16 and CRC-32 with 16-bit data, and CRC-32 with 32-bit data. They provide optimized implementations for both bit-forward and bit-reversed CRC algorithms, aiming to match the performance of hardware CRC instructions or vector extensions found on other architectures.
- PCLMULQDQ
- A specific x86 instruction that performs carry-less multiplication, often used in cryptographic and CRC computations for efficiency.
- CRC
- Cyclic Redundancy Check, an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.
- expander
- In compiler construction, an expander translates a high-level intermediate representation (IR) construct into a sequence of lower-level instructions.
- i386 backend
- The part of the GCC compiler responsible for generating machine code specifically for Intel 386 and compatible processors (x86 architecture).