diff options
author | jiwang <jiwang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-01 14:54:57 +0000 |
---|---|---|
committer | jiwang <jiwang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-01 14:54:57 +0000 |
commit | 2341013f1ab17e47a6c0458209e831fc322b30e7 (patch) | |
tree | 3c8880f2009e49886a084c2d8830fc9e339f626b /gcc/config/aarch64/aarch64.md | |
parent | d1e7dfe22529a233dc3d458a1205064c688a1b2f (diff) | |
download | gcc-2341013f1ab17e47a6c0458209e831fc322b30e7.tar.gz |
[AArch64][1/2] Fix offset glitch in load reg pair pattern
on aarch64, we are using load register pair post-writeback instruction in
epilogue.
for example, for the following instruction:
ldp, x0, x1, [sp], #16
what it's doing is:
x0 <- MEM(sp + 0)
x1 <- MEM(sp + 8)
sp < sp + 16
while there is a glitch in our loadwb_pair* pattern, the restore of the
first reg should always be with offset zero.
(set (match_operand:GPI 2 "register_operand" "=r")
- (mem:GPI (plus:P (match_dup 1)
- (match_dup 4))))
+ (mem:GPI (match_dup 1)))
gcc/
* config/aarch64/aarch64.md (loadwb_pair<GPI:mode>_<P:mode>): Fix offset.
(loadwb_pair<GPI:mode>_<P:mode>): Likewise.
* config/aarch64/aarch64.c (aarch64_gen_loadwb_pair): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213485 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/aarch64/aarch64.md')
-rw-r--r-- | gcc/config/aarch64/aarch64.md | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index f4563d17f69..0728fb67664 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1016,20 +1016,19 @@ [(set_attr "type" "neon_store1_2reg<q>")] ) -;; Load pair with writeback. This is primarily used in function epilogues -;; when restoring [fp,lr] +;; Load pair with post-index writeback. This is primarily used in function +;; epilogues. (define_insn "loadwb_pair<GPI:mode>_<P:mode>" [(parallel [(set (match_operand:P 0 "register_operand" "=k") (plus:P (match_operand:P 1 "register_operand" "0") (match_operand:P 4 "const_int_operand" "n"))) (set (match_operand:GPI 2 "register_operand" "=r") - (mem:GPI (plus:P (match_dup 1) - (match_dup 4)))) + (mem:GPI (match_dup 1))) (set (match_operand:GPI 3 "register_operand" "=r") (mem:GPI (plus:P (match_dup 1) (match_operand:P 5 "const_int_operand" "n"))))])] - "INTVAL (operands[5]) == INTVAL (operands[4]) + GET_MODE_SIZE (<GPI:MODE>mode)" + "INTVAL (operands[5]) == GET_MODE_SIZE (<GPI:MODE>mode)" "ldp\\t%<w>2, %<w>3, [%1], %4" [(set_attr "type" "load2")] ) @@ -1040,18 +1039,17 @@ (plus:P (match_operand:P 1 "register_operand" "0") (match_operand:P 4 "const_int_operand" "n"))) (set (match_operand:GPF 2 "register_operand" "=w") - (mem:GPF (plus:P (match_dup 1) - (match_dup 4)))) + (mem:GPF (match_dup 1))) (set (match_operand:GPF 3 "register_operand" "=w") (mem:GPF (plus:P (match_dup 1) (match_operand:P 5 "const_int_operand" "n"))))])] - "INTVAL (operands[5]) == INTVAL (operands[4]) + GET_MODE_SIZE (<GPF:MODE>mode)" + "INTVAL (operands[5]) == GET_MODE_SIZE (<GPF:MODE>mode)" "ldp\\t%<w>2, %<w>3, [%1], %4" [(set_attr "type" "neon_load1_2reg")] ) -;; Store pair with writeback. This is primarily used in function prologues -;; when saving [fp,lr] +;; Store pair with pre-index writeback. This is primarily used in function +;; prologues. (define_insn "storewb_pair<GPI:mode>_<P:mode>" [(parallel [(set (match_operand:P 0 "register_operand" "=&k") |