[Bug target/106453] Redundant zero extension after crc32q

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 5 18:02:22 GMT 2022


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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexander Monakov <amonakov@gcc.gnu.org>:

https://gcc.gnu.org/g:810d9815249451f477d4cbc67b8e4a0819c37faa

commit r13-2448-g810d9815249451f477d4cbc67b8e4a0819c37faa
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Tue Aug 23 18:42:24 2022 +0300

    i386: avoid zero extension for crc32q

    The crc32q instruction takes 64-bit operands, but ignores high 32 bits
    of the destination operand, and zero-extends the result from 32 bits.

    Let's model this in the RTL pattern to avoid zero-extension when the
    _mm_crc32_u64 intrinsic is used with a 32-bit type.

            PR target/106453

    gcc/ChangeLog:

            * config/i386/i386.md (sse4_2_crc32di): Model that only low 32
            bits of operand 0 are consumed, and the result is zero-extended
            to 64 bits.

    gcc/testsuite/ChangeLog:

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


More information about the Gcc-bugs mailing list