Use pblendw instead of pand to clear upper 16 bits.
commit0ebaffccb294d90184ad78367de66b6307de3ac0
authorliuhongt <hongtao.liu@intel.com>
Fri, 22 Mar 2024 06:40:00 +0000 (22 14:40 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 21 May 2024 05:21:52 +0000 (21 13:21 +0800)
tree3049011ba0d59a0fad60c72707aaaa88b4f0d388
parent3bb8cdbd60cdb4dab45b97235dc045d65555b0a1
Use pblendw instead of pand to clear upper 16 bits.

For vec_pack_truncv8si/v4si w/o AVX512,
(const_vector:v4si (const_int 0xffff) x4) is used as mask to clear
upper 16 bits, but vpblendw with zero_vector can also be used, and
zero vector is cheaper than (const_vector:v4si (const_int 0xffff) x4).

gcc/ChangeLog:
PR target/114427
* config/i386/i386-expand.cc (expand_vec_perm_even_odd_pack):
Use pblendw instead of pand to clear upper bits.

gcc/testsuite/ChangeLog:
* gcc.target/i386/pr114427.c: New test.
gcc/config/i386/i386-expand.cc
gcc/testsuite/gcc.target/i386/pr114427.c [new file with mode: 0644]