https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128310

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <[email protected]>:

https://gcc.gnu.org/g:cdc06c5d808d338b240b4f50ae33cb43b71ccb40

commit r17-5754-gcdc06c5d808d338b240b4f50ae33cb43b71ccb40
Author: Uros Bizjak <[email protected]>
Date:   Fri Oct 30 10:16:50 2026 +0100

    i386: Use separate unspecs for CRC32 widths [PR128310]

    The CRC32 insns used a single UNSPEC_CRC32 for all operand widths.
    When the second operand is a constant, which carries no mode, the
    QI, HI and SI forms become identical unspec expressions, so CSE
    merges crc32 results of different widths and e.g.
    _mm_crc32_u16 (c, 0x7f) == _mm_crc32_u32 (c, 0x7f) folds to 1.
    Use a distinct unspec for each width.

    Also add the 64-bit zero-extended form of crc32b.

    Assisted-by: Claude Sonnet 5.5

            PR target/128310

    gcc/ChangeLog:

            * config/i386/i386.md (UNSPEC_CRC32): Remove.
            (UNSPEC_CRC32B, UNSPEC_CRC32W)
            (UNSPEC_CRC32L, UNSPEC_CRC32Q): New.
            (sse4_2_crc32qi): Rename from sse4_2_crc32<mode>.
            Use UNSPEC_CRC32B.
            (*sse4_2_crc32qi_zext): New insn.
            (sse4_2_crc32hi): New insn.
            (sse4_2_crc32si): Ditto.
            (sse4_2_crc32di): Use UNSPEC_CRC32Q.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr128310.c: New test.

Reply via email to