[AArch64] Improve LDP/STP generation that requires a base register
commitf90ebd338fd4252718deb87e39963236effc6d82
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 May 2018 10:59:25 +0000 (30 10:59 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 May 2018 10:59:25 +0000 (30 10:59 +0000)
tree21ad00bd75ac07a9a1b087a73e2a2587e24d064f
parent69b1edbbe7442f385c06ef1d3c60ef31c77f96d8
[AArch64] Improve LDP/STP generation that requires a base register

This patch generalizes the formation of LDP/STP that require a base register.

In AArch64, LDP/STP instructions have different sized immediate offsets than
normal LDR/STR instructions. This part of the backend attempts to spot groups
of four LDR/STR instructions that can be turned into LDP/STP instructions by
using a base register.

Previously, we would only accept address pairs that were ordered in ascending
or descending order, and only strictly sequential loads/stores. In fact, the
instructions that we generate from this should be able to consider any order
of loads or stores (provided that they can be re-ordered). They should also be
able to accept non-sequential loads and stores provided that the two pairs of
addresses are amenable to pairing. The current code is also overly restrictive
on the range of addresses that are accepted, as LDP/STP instructions may take
negative offsets as well as positive ones.

This patch improves that by allowing us to accept all orders of loads/stores
that are valid, and extending the range that the LDP/STP addresses can reach.

2017-05-30  Jackson Woodruff  <jackson.woodruff@arm.com>

* config/aarch64/aarch64.c (aarch64_host_wide_int_compare): New.
(aarch64_ldrstr_offset_compare): New.
(aarch64_operands_adjust_ok_for_ldpstp): Update to consider all
load/store orderings.
(aarch64_gen_adjusted_ldpstp): Likewise.

* gcc.target/aarch64/simd/ldp_stp_9: New.
* gcc.target/aarch64/simd/ldp_stp_10: New.
* gcc.target/aarch64/simd/ldp_stp_11: New.
* gcc.target/aarch64/simd/ldp_stp_12: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260952 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/ldp_stp_10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/ldp_stp_11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/ldp_stp_12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/ldp_stp_9.c [new file with mode: 0644]