https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104124
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by HaoChen Gui <guih...@gcc.gnu.org>: https://gcc.gnu.org/g:f3d87219dd502d5c11608ffb83fbe66c79baf784 commit r14-2153-gf3d87219dd502d5c11608ffb83fbe66c79baf784 Author: Haochen Gui <guih...@gcc.gnu.org> Date: Wed Jun 28 16:30:44 2023 +0800 rs6000: Splat vector small V2DI constants with vspltisw and vupkhsw This patch adds a new insn for vector splat with small V2DI constants on P8. If the value of constant is in RANGE (-16, 15) but not 0 or -1, it can be loaded with vspltisw and vupkhsw on P8. gcc/ PR target/104124 * config/rs6000/altivec.md (*altivec_vupkhs<VU_char>_direct): Rename to... (altivec_vupkhs<VU_char>_direct): ...this. * config/rs6000/predicates.md (vspltisw_vupkhsw_constant_split): New predicate to test if a constant can be loaded with vspltisw and vupkhsw. (easy_vector_constant): Call vspltisw_vupkhsw_constant_p to Check if a vector constant can be synthesized with a vspltisw and a vupkhsw. * config/rs6000/rs6000-protos.h (vspltisw_vupkhsw_constant_p): Declare. * config/rs6000/rs6000.cc (vspltisw_vupkhsw_constant_p): New function to return true if OP mode is V2DI and can be synthesized with vupkhsw and vspltisw. * config/rs6000/vsx.md (*vspltisw_v2di_split): New insn to load up constants with vspltisw and vupkhsw. gcc/testsuite/ PR target/104124 * gcc.target/powerpc/pr104124.c: New.