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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by hongtao Liu
<[email protected]>:

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

commit r16-9844-gb567707db43a9990e4319c0c38f4b0c752d45ac7
Author: liuhongt <[email protected]>
Date:   Thu Oct 15 00:29:50 2026 -0700

    i386: Avoid emulated broadcasts of vector constants [PR127897]

    Only broadcast floating-point constants when a broadcast instruction
    is available (AVX, or AVX2 for 16-bit elements), avoiding sequences such
    as movss + shufps.  For integer constants, guard broadcasting
    with TARGET_PREFER_BCST_FROM_INTEGER.

            PR target/127897

    gcc/ChangeLog:

            * config/i386/i386-expand.cc (ix86_expand_vector_move): Only
            broadcast floating-point constants when a broadcast instruction
            is available.  Guard integer broadcasts with
            TARGET_PREFER_BCST_FROM_INTEGER.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr127897-1.c: New test.
            * gcc.target/i386/pr127897-2.c: Likewise.
            * gcc.target/i386/pr127897-3.c: Likewise.

    (cherry picked from commit b2f4da30289466ed982464203d5e552f83421fe8)

Reply via email to