]> gcc.gnu.org Git - gcc.git/commit
Support load/store vector with right length.
authorMichael Meissner <meissner@linux.ibm.com>
Fri, 17 Nov 2023 18:30:54 +0000 (13:30 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Fri, 17 Nov 2023 18:30:54 +0000 (13:30 -0500)
commitf3cb0a61ba2d1147c25bc6e71f5bf700840f18df
tree8b8df99cf08e420d4f0b606be6c7b6f61aacd7e7
parent9dcccc13665a7934566dd2ce5f54619474147807
Support load/store vector with right length.

This patch adds support for new instructions that may be added to the PowerPC
architecture in the future to enhance the load and store vector with length
instructions.

The current instructions (lxvl, lxvll, stxvl, and stxvll) are inconvient to use
since the count for the number of bytes must be in the top 8 bits of the GPR
register, instead of the bottom 8 bits.  This meant that code generating these
instructions typically had to do a shift left by 56 bits to get the count into
the right position.  In a future version of the PowerPC architecture, new
variants of these instructions might be added that expect the count to be in
the bottom 8 bits of the GPR register.  These patches add this support to GCC
if the user uses the -mcpu=future option.

I discovered that the code in rs6000-string.cc to generate ISA 3.1 lxvl/stxvl
future lxvll/stxvll instructions would generate these instructions on 32-bit.
However the patterns for these instructions is only done on 64-bit systems.  So
I added a check for 64-bit support before generating the instructions.

The patches have been tested on both little and big endian systems.  Can I check
it into the master branch?

2023-11-17   Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/rs6000-string.cc (expand_block_move): Do not generate
lxvl and stxvl on 32-bit.
* config/rs6000/vsx.md (lxvl): If -mcpu=future, generate the lxvl with
the shift count automaticaly used in the insn.
(lxvrl): New insn for -mcpu=future.
(lxvrll): Likewise.
(stxvl): If -mcpu=future, generate the stxvl with the shift count
automaticaly used in the insn.
(stxvrl): New insn for -mcpu=future.
(stxvrll): Likewise.

gcc/testsuite/

* gcc.target/powerpc/lxvrl.c: New test.
* lib/target-supports.exp (check_effective_target_powerpc_future_ok):
New effective target.
gcc/config/rs6000/rs6000-string.cc
gcc/config/rs6000/vsx.md
gcc/testsuite/gcc.target/powerpc/lxvrl.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp
This page took 0.063025 seconds and 6 git commands to generate.