]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Also handle all 1s float vector constant
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Jun 2025 22:08:51 +0000 (06:08 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Jun 2025 06:17:44 +0000 (14:17 +0800)
commit77473a27bae04da99d6979d43e7bd0a8106f4557
tree968a302fe484c2d9852b5cc22a505cef7b4a06fe
parent62a80185db84f20f3efb05c81598bffa95bcd63d
x86: Also handle all 1s float vector constant

Since float vector constant

(const_vector:V4SF [(const_double:SF -QNaN [-QNaN]) repeated x4])

is an all 1s float vector constant, update the remove_redundant_vector
pass to replace

(insn 20 18 21 2 (set (reg:V4SF 124)
        (const_vector:V4SF [
                (const_double:SF -QNaN [-QNaN]) repeated x4
            ])) "x.cc":26:5 2426 {movv4sf_internal}
     (nil))

with

(insn 49 2 5 2 (set (reg:V16QI 135)
        (const_vector:V16QI [
                (const_int -1 [0xffffffffffffffff]) repeated x16
            ])) -1
     (nil))
...
(insn 20 18 21 2 (set (reg:V4SF 124)
        (subreg:V4SF (reg:V16QI 135) 0)) "x.cc":26:5 2426 {movv4sf_internal}
     (nil))

gcc/

PR target/120819
* config/i386/i386-features.cc (ix86_broadcast_inner): Also handle
all 1s float vector constant.

gcc/testsuite/

PR target/120819
* g++.target/i386/pr120819.C: New test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/config/i386/i386-features.cc
gcc/testsuite/g++.target/i386/pr120819.C [new file with mode: 0644]