i386 backend optimized for CRC64 computation using pclmul.
PCLMULQDQ instructions now support efficient 64-bit CRC64 calculations on i386.
This commit enhances the i386 backend in GCC by extending its PCLMULQDQ instruction expanders to efficiently compute CRC64 checksums. The changes support both forward and reversed CRC64 calculations, including specific handling for polynomials with LSB=0 and LSB=1, building upon previous work for 16-bit and 32-bit CRC. New test cases are included to verify the correctness of these optimizations.
In Details
The i386 backend's ix86_expand_crc_using_pclmul and ix86_expand_reversed_crc_using_pclmul functions are modified to support 64-bit CRC computations. This involves relaxing an assertion in gf2n_poly_long_div_quotient to handle the lower 64 bits of a 65-bit quotient when the leading bit is assumed to be 1. The machine description (.md files) is updated with new or renamed iterators to accommodate the 64-bit CRC variations. This enables efficient CRC64 generation leveraging the PCLMULQDQ instruction for cryptographic and data integrity applications.
- i386
- Refers to the x86 instruction set architecture, typically targeting 32-bit Intel processors. In this context, it refers to the GCC backend for this architecture.
- pclmul
- Stands for 'carry-less multiplication', referring to the PCLMULQDQ instruction set extension on x86 processors used for fast polynomial multiplication, common in cryptography and CRC calculations.
- CRC64
- Cyclic Redundancy Check using a 64-bit polynomial, a common method for error detection in data transmission and storage.
- expander
- A part of the compiler backend that takes an intermediate representation of an operation and generates a sequence of machine instructions to perform it.
- LSB
- Least Significant Bit. The rightmost bit in a binary number.