[AArch64, patch] Refactor of aarch64-ldpstp
commit30370ebb0134b7d9279c88b497139a0b7ab7db7d
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 May 2018 15:37:11 +0000 (22 15:37 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 May 2018 15:37:11 +0000 (22 15:37 +0000)
tree8c93422e81794ccaa08bf457f8cc40d08cd542a8
parenta91ef3031256c1bbc50e1505f9aa5d9b34c98295
[AArch64, patch] Refactor of aarch64-ldpstp

This patch removes a lot of duplicated code in aarch64-ldpstp.md.

The patterns that did not previously generate a base register now
do not check for aarch64_mem_pair_operand in the pattern. This has
been extracted to a check in aarch64_operands_ok_for_ldpstp.

All patterns in the file used to have explicit switching code to
swap loads and stores that were in the wrong order.

This has been extracted into aarch64_operands_ok_for_ldpstp
as a final operation after all the checks have been performed.

2018-05-22  Jackson Woodruff  <jackson.woodruff@arm.com>
            Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

* config/aarch64/aarch64-ldpstp.md: Replace uses of
aarch64_mem_pair_operand with memory_operand and delete operand swapping
code.
* config/aarch64/aarch64.c (aarch64_operands_ok_for_ldpstp):
Add check for legitimate_address.
(aarch64_gen_adjusted_ldpstp): Swap operands where appropriate.
(aarch64_swap_ldrstr_operands): New.
* config/aarch64/aarch64-protos.h (aarch64_swap_ldrstr_operands):
Define prototype.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260539 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64-ldpstp.md
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c