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

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

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

commit r17-1735-gd9a8473311915852f3229f4177d13988e3393c1d
Author: H.J. Lu <[email protected]>
Date:   Fri Jun 19 16:31:26 2026 +0800

    x86_cse: Use integer CONST_VECTOR to load FP CONST_VECTOR

    Use integer CONST_VECTOR:

    (const_vector:V2SI [
            (const_int 1073741824 [0x40000000]) repeated x2
        ])

    instead of

    (const_vector:V2SF [
            (const_int 1073741824 [0x40000000]) repeated x2
        ])

    to load FP CONST_VECTOR converted from const_int:

    (insn 25 24 27 2 (set (subreg:SI (reg/v:SF 144 [ d ]) 0)
            (const_int 1073741824 [0x40000000])) "x.c":4:18 100
{*movsi_internal}
         (nil))
    ...
    (insn 90 88 91 2 (set (reg:V2SF 202 [ _15 ])
            (vec_duplicate:V2SF (reg/v:SF 144 [ d ]))) "x.c":4:5 2137
{*vec_dupv2sf}
         (expr_list:REG_DEAD (reg/v:SF 144 [ d ])
            (nil)))

    into GPR:

    (insn 90 88 91 2 (set (subreg:DI (reg:V2SF 202 [ _15 ]) 0)
            (const_int 4611686019501129728 [0x4000000040000000])) "x.c":4:5 99
{*movdi_internal}
         (expr_list:REG_DEAD (reg/v:SF 144 [ d ])
            (nil)))

    gcc/

            PR target/125895
            * config/i386/i386-features.cc (pass_x86_cse::x86_cse): Use
            integer CONST_VECTOR to load FP CONST_VECTOR converted from
            const_int.

    gcc/testsuite/

            PR target/125895
            * gcc.target/i386/pr125895.c: New test.

    Signed-off-by: H.J. Lu <[email protected]>

Reply via email to