GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386 Performance Win

i386: Support 64-bit CRC-32C expansion on ia32

Enables 64-bit CRC-32C computation on 32-bit x86 by chaining two 32-bit CRC instructions.

This commit enables the expansion of 64-bit CRC-32C calculations on ia32 (32-bit x86) targets. It achieves this by chaining two crc32l instructions to process the low and high 32-bit halves of XORed operands, effectively avoiding a DImode XOR. The existing crc32q expansion on x86-64 is retained, and tests are updated to cover both ia32 and x86-64 targets.

In Details

The i386 backend now supports 64-bit CRC-32C computation on ia32 targets when the CRC64 polynomial is the iSCSI variant shifted by 32. This is implemented by chaining two crc32l instructions, processing the low and high 32-bit halves of XORed operands, thereby eliminating the need for a DImode XOR. The existing crc32q expansion for x86-64 targets remains, and test cases are extended to validate this new capability across both ia32 and x86-64 architectures.

For Context
CRC-32C
Cyclic Redundancy Check, a specific variant used for error detection, often found in networking and storage protocols.
ia32
Intel Architecture 32-bit, referring to the 32-bit x86 instruction set architecture.
x86-64
The 64-bit extension of the x86 instruction set architecture.
crc32l
An x86 instruction that computes a 32-bit CRC.
crc32q
An x86 instruction that computes a 64-bit CRC.
DImode
GCC's internal representation for a double-precision integer, typically 64 bits.
polynomial
In the context of CRC, a mathematical polynomial used in the algorithm to generate the checksum.
Filed Under: i386optimizationperformance