Generate XXSPLTIDP for vectors on power10.
This patch implements XXSPLTIDP support for all vector constants. The XXSPLTIDP instruction is given a 32-bit immediate that is converted to a vector of two DFmode constants. The immediate is in SFmode format, so only constants that fit as SFmode values can be loaded with XXSPLTIDP. The constraint (eP) added in the previous patch for XXSPLTIW is also used for XXSPLTIDP. DImode scalar constants are not handled. This is due to the majority of DImode constants will be in the GPR registers. With vector registers, you have the problem that XXSPLTIDP splats the double word into both elements of the vector. However, if TImode is loaded with an integer constant, it wants a full 128-bit constant. SFmode and DFmode scalar constants are not handled in this patch. The support for for those constants will be in the next patch. I have added a temporary switch (-msplat-float-constant) to control whether or not the XXSPLTIDP instruction is generated. I added 2 new tests to test loading up V2DI and V2DF vector constants. 2021-12-14 Michael Meissner <meissner@the-meissners.org> gcc/ * config/rs6000/predicates.md (easy_fp_constant): Add support for generating XXSPLTIDP. (vsx_prefixed_constant): Likewise. (easy_vector_constant): Likewise. * config/rs6000/rs6000-protos.h (constant_generates_xxspltidp): New declaration. * config/rs6000/rs6000.c (output_vec_const_move): Add support for generating XXSPLTIDP. (prefixed_xxsplti_p): Likewise. (constant_generates_xxspltidp): New function. * config/rs6000/rs6000.opt (-msplat-float-constant): New debug option. gcc/testsuite/ * gcc.target/powerpc/pr86731-fwrapv-longlong.c: Update insn regex for power10. * gcc.target/powerpc/vec-splat-constant-v2df.c: New test. * gcc.target/powerpc/vec-splat-constant-v2di.c: New test.
Showing
- gcc/config/rs6000/predicates.md 9 additions, 0 deletionsgcc/config/rs6000/predicates.md
- gcc/config/rs6000/rs6000-protos.h 1 addition, 0 deletionsgcc/config/rs6000/rs6000-protos.h
- gcc/config/rs6000/rs6000.c 108 additions, 0 deletionsgcc/config/rs6000/rs6000.c
- gcc/config/rs6000/rs6000.opt 4 additions, 0 deletionsgcc/config/rs6000/rs6000.opt
- gcc/testsuite/gcc.target/powerpc/pr86731-fwrapv-longlong.c 5 additions, 4 deletionsgcc/testsuite/gcc.target/powerpc/pr86731-fwrapv-longlong.c
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2df.c 64 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2df.c
- gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2di.c 50 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2di.c
Loading
Please register or sign in to comment