aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.cc
diff options
context:
space:
mode:
authorHaochen Gui <guihaoc@gcc.gnu.org>2023-06-28 16:30:44 +0800
committerHaochen Gui <guihaoc@gcc.gnu.org>2023-06-28 16:37:57 +0800
commitf3d87219dd502d5c11608ffb83fbe66c79baf784 (patch)
tree31cf9bd41553f47dc3d5f8dff26dc064bf724db3 /gcc/fortran/trans-decl.cc
parent7198573f44fb579843bff8deda695107858d8cff (diff)
downloadgcc-f3d87219dd502d5c11608ffb83fbe66c79baf784.zip
gcc-f3d87219dd502d5c11608ffb83fbe66c79baf784.tar.gz
gcc-f3d87219dd502d5c11608ffb83fbe66c79baf784.tar.bz2
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.
Diffstat (limited to 'gcc/fortran/trans-decl.cc')
0 files changed, 0 insertions, 0 deletions