]> gcc.gnu.org Git - gcc.git/commit
Generate XXSPLTIDP on power10.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 3 Nov 2021 18:03:14 +0000 (14:03 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 3 Nov 2021 18:03:14 +0000 (14:03 -0400)
commit89ce6e7f005723e59f8c2b088faa02d2604b5210
tree3b568b84bc89f39d4d57d667917191cc56e4affc
parent1fef62d0804ea85cae229d6d72fcce530a28fe2e
Generate XXSPLTIDP on power10.

This patch implements XXSPLTIDP support for SF, and DF scalar constants and 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-11-03  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.
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.opt
gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2df.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-splat-constant-v2di.c [new file with mode: 0644]
This page took 0.058931 seconds and 6 git commands to generate.