]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/rs6000/rs6000-protos.h
Generate XXSPLTIDP for vectors on power10.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 15 Dec 2021 07:02:24 +0000 (02:02 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 15 Dec 2021 07:02:24 +0000 (02:02 -0500)
commit8d443ac032ecf0d8275bb0f6838ed7c9aee4e7a5
tree337f7f1c6573c0d4265c9497123312e9e4a9ef7a
parentd730aa8a9ff26a36c3b480402c1507f3d2e48db9
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.
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/pr86731-fwrapv-longlong.c
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]