rs6000: Generate an lxvp instead of two adjacent lxv instructions
commit69feb7601e86274fa9abbfb420b00c8adf947e7b
authorPeter Bergner <bergner@linux.ibm.com>
Wed, 14 Jul 2021 23:27:02 +0000 (14 18:27 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Wed, 14 Jul 2021 23:27:02 +0000 (14 18:27 -0500)
tree401e1f3e61d0a8869d2658674cc3681aa8e292df
parent7d914777fc6c6151f430d798fc97bae927a430f7
rs6000: Generate an lxvp instead of two adjacent lxv instructions

The MMA build built-ins currently use individual lxv instructions to
load up the registers of a __vector_pair or __vector_quad.  If the
memory addresses of the built-in operands are to adjacent locations,
then we can use an lxvp in some cases to load up two registers at once.
The patch below adds support for checking whether memory addresses are
adjacent and emitting an lxvp instead of two lxv instructions.

2021-07-14  Peter Bergner  <bergner@linux.ibm.com>

gcc/
* config/rs6000/rs6000.c (adjacent_mem_locations): Return the lower
addressed memory rtx, if any.
(rs6000_split_multireg_move): Fix code formatting.
Handle MMA build built-ins with operands in adjacent memory locations.

gcc/testsuite/
* gcc.target/powerpc/mma-builtin-9.c: New test.
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/mma-builtin-9.c [new file with mode: 0644]