Generate XXSPLTIW on power10.
This patch adds support to automatically generate the ISA 3.1 XXSPLTIW instruction for V8HImode, V4SImode, and V4SFmode vectors. It does this by adding support for vector constants that can be used, and adding a VEC_DUPLICATE pattern to generate the actual XXSPLTIW instruction. Add the eP constraint to recognize constants that can be loaded into vector registers with a single prefixed instruction such as xxspltiw and xxspltidp. I added 4 new tests to test loading up V16QI, V8HI, V4SI, and V4SF vector constants. 2021-12-14 Michael Meissner <meissner@linux.ibm.com> gcc/ * config/rs6000/constraints.md (eP): Update comment. * config/rs6000/predicates.md (easy_fp_constant): Add support for generating XXSPLTIW. (vsx_prefixed_constant): New predicate. (easy_vector_constant): Add support for generating XXSPLTIW. * config/rs6000/rs6000-protos.h (prefixed_xxsplti_p): New declaration. (constant_generates_xxspltiw): Likewise. * config/rs6000/rs6000.c (xxspltib_constant_p): Generate XXSPLTIW if possible instead of XXSPLTIB and sign extending the constant. (output_vec_const_move): Add support for XXSPLTIW. (prefixed_xxsplti_p): New function. (constant_generates_xxspltiw): New function. * config/rs6000/rs6000.md (prefixed attribute): Add support to mark XXSPLTI* instructions as being prefixed. * config/rs6000/rs6000.opt (-msplat-word-constant): New debug switch. * config/rs6000/vsx.md (vsx_mov<mode>_64bit): Add support for generating XXSPLTIW or XXSPLTIDP. (vsx_mov<mode>_32bit): Likewise. * doc/md.texi (PowerPC and IBM RS6000 constraints): Document the eP constraint. gcc/testsuite/ * gcc.target/powerpc/vec-splat-constant-v16qi.c: New test. * gcc.target/powerpc/vec-splat-constant-v4sf.c: New test. * gcc.target/powerpc/vec-splat-constant-v4si.c: New test. * gcc.target/powerpc/vec-splat-constant-v8hi.c: New test. * gcc.target/powerpc/vec-splati-runnable.c: Update insn count.
Showing
- gcc/config/rs6000/constraints.md 6 additions, 0 deletionsgcc/config/rs6000/constraints.md
- gcc/config/rs6000/predicates.md 44 additions, 2 deletionsgcc/config/rs6000/predicates.md
- gcc/config/rs6000/rs6000-protos.h 2 additions, 0 deletionsgcc/config/rs6000/rs6000-protos.h
- gcc/config/rs6000/rs6000.c 83 additions, 0 deletionsgcc/config/rs6000/rs6000.c
- gcc/config/rs6000/rs6000.md 5 additions, 0 deletionsgcc/config/rs6000/rs6000.md
- gcc/config/rs6000/rs6000.opt 4 additions, 0 deletionsgcc/config/rs6000/rs6000.opt
- gcc/config/rs6000/vsx.md 14 additions, 14 deletionsgcc/config/rs6000/vsx.md
- gcc/doc/md.texi 4 additions, 0 deletionsgcc/doc/md.texi
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v16qi.c 27 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v16qi.c
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v4sf.c 67 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v4sf.c
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v4si.c 51 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v4si.c
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v8hi.c 62 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v8hi.c
- gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c 2 additions, 2 deletionsgcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
Loading
Please register or sign in to comment