]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Add 3-instruction subroutine vector shift for V16QI in ix86_expand_vec_perm_cons...
authorLevy Hsu <admin@levyhsu.com>
Thu, 9 May 2024 08:50:56 +0000 (16:50 +0800)
committerliuhongt <hongtao.liu@intel.com>
Wed, 15 May 2024 04:46:51 +0000 (12:46 +0800)
commita71f90c5a7ae2942083921033cb23dcd63e70525
tree75bb99a2ad0a90b04ebae731d0ba29f82f34135d
parentc6cc6d4741a880109c4e0e64d5a189687fb526f6
x86: Add 3-instruction subroutine vector shift for V16QI in ix86_expand_vec_perm_const_1 [PR107563]

Hi All

We've introduced a new subroutine in ix86_expand_vec_perm_const_1
to optimize vector shifting for the V16QI type on x86.
This patch uses a three-instruction sequence psrlw, psllw, and por
to handle specific vector shuffle operations more efficiently.
The change aims to improve assembly code generation for configurations
supporting SSE2.

Bootstrapped and tested on x86_64-linux-gnu, OK for trunk?

Best
Levy

gcc/ChangeLog:

PR target/107563
* config/i386/i386-expand.cc (expand_vec_perm_psrlw_psllw_por): New
subroutine.
(ix86_expand_vec_perm_const_1): Call expand_vec_perm_psrlw_psllw_por.

gcc/testsuite/ChangeLog:

PR target/107563
* g++.target/i386/pr107563-a.C: New test.
* g++.target/i386/pr107563-b.C: New test.
gcc/config/i386/i386-expand.cc
gcc/testsuite/g++.target/i386/pr107563-a.C [new file with mode: 0755]
gcc/testsuite/g++.target/i386/pr107563-b.C [new file with mode: 0755]