https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96933
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kewen Lin <li...@gcc.gnu.org>: https://gcc.gnu.org/g:025f434a87336e38bf5140fba2005081876aa911 commit r11-4731-g025f434a87336e38bf5140fba2005081876aa911 Author: Kewen Lin <li...@linux.ibm.com> Date: Thu Nov 5 00:04:10 2020 -0600 rs6000: Use direct move for char/short vector CTOR [PR96933] This patch is to make vector CTOR with char/short leverage direct move instructions when they are available. With one constructed test case, it can speed up 145% for char and 190% for short on P9. Tested SPEC2017 x264_r at -Ofast on P9, it gets 1.61% speedup (but based on unexpected SLP see PR96789). Bootstrapped/regtested on powerpc64{,le}-linux-gnu P8 and powerpc64le-linux-gnu P9. gcc/ChangeLog: PR target/96933 * config/rs6000/rs6000.c (rs6000_expand_vector_init): Use direct move instructions for vector construction with char/short types. * config/rs6000/rs6000.md (p8_mtvsrwz_v16qisi2): New define_insn. (p8_mtvsrd_v16qidi2): Likewise. gcc/testsuite/ChangeLog: PR target/96933 * gcc.target/powerpc/pr96933-1.c: New test. * gcc.target/powerpc/pr96933-2.c: New test. * gcc.target/powerpc/pr96933-3.c: New test. * gcc.target/powerpc/pr96933-4.c: New test. * gcc.target/powerpc/pr96933.h: New test. * gcc.target/powerpc/pr96933-run.h: New test.