rs6000: Use rldimi for 64-bit constants with high=low (PR93012)
authorSegher Boessenkool <segher@kernel.crashing.org>
Fri, 20 Dec 2019 00:15:19 +0000 (00:15 +0000)
committerSegher Boessenkool <segher@kernel.crashing.org>
Thu, 6 Feb 2020 18:03:47 +0000 (18:03 +0000)
commit72b2f3317b4484b25e9a6cc3fd12e7f8c893fb56
tree0d9e80e5e9ecc09de1c484921529d5ab2f9916c0
parent201c2f785f4d4c9ad9a8df859e6d078ed86ecc79
rs6000: Use rldimi for 64-bit constants with high=low (PR93012)

We currently use an (up to) five instruction sequence to generate such
constants.  After this change we just generate a 32-bit constant and do
a rotate-and-mask-insert instruction, making the sequence only up to
three instructions.

* config/rs6000/rs6000.c (rs6000_emit_set_long_const): Handle the case
where the low and the high 32 bits are equal to each other specially,
with an rldimi instruction.

gcc/testsuite/
* gcc.target/powerpc/pr93012.c: New.
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr93012.c [new file with mode: 0644]