https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115146
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Levy Hsu <xlwxlw7...@gcc.gnu.org>: https://gcc.gnu.org/g:0022064649d0ec40e97df24279c48842e278fedc commit r15-841-g0022064649d0ec40e97df24279c48842e278fedc Author: Levy Hsu <ad...@levyhsu.com> Date: Tue May 21 12:47:21 2024 +0930 x86: Fix Logical Shift Issue in expand_vec_perm_psrlw_psllw_por [PR115146] Replaced arithmetic shifts with logical shifts in expand_vec_perm_psrlw_psllw_por to avoid sign bit extension issues. Also corrected gen_vlshrv8hi3 to gen_lshrv8hi3 and gen_vashlv8hi3 to gen_ashlv8hi3. Co-authored-by: H.J. Lu <hjl.to...@gmail.com> gcc/ChangeLog: PR target/115146 * config/i386/i386-expand.cc (expand_vec_perm_psrlw_psllw_por): Replace arithmatic shift gen_ashrv4hi3 with logic shift gen_lshrv4hi3. Replace gen_vlshrv8hi3 with gen_lshrv8hi3 and gen_vashlv8hi3 with gen_ashlv8hi3. gcc/testsuite/ChangeLog: PR target/115146 * g++.target/i386/pr107563-a.C: Append '-mno-sse3' to compile option to avoid test failure on hosts with SSE3 support. * g++.target/i386/pr107563-b.C: Append '-mno-sse3' to compile option to avoid test failure on hosts with SSE3 support. * gcc.target/i386/pr115146.c: New test.