diff options
author | Chung-Ju Wu <jasonwucj@gmail.com> | 2018-04-07 04:07:53 +0000 |
---|---|---|
committer | Chung-Ju Wu <jasonwucj@gmail.com> | 2018-04-07 04:07:53 +0000 |
commit | b46686eeb685970746c16ea42c18303b9ff66b0d (patch) | |
tree | 69c52ca1892921f706f90750a5d2692f71a11cff /gcc/config/nds32/nds32.c | |
parent | 018ae4c206beb0218888097779419b4e6b54ea01 (diff) |
[NDS32] Support [$ra + $rb << 3] form for load/store address.
gcc/
* config/nds32/nds32.c (nds32_legitimate_index_p): Modify condition
for load/store addressing form.
(nds32_print_operand_address): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@259201 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nds32/nds32.c')
-rw-r--r-- | gcc/config/nds32/nds32.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 030fb2e0224..b4c31a4a90f 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -1246,9 +1246,10 @@ nds32_legitimate_index_p (machine_mode outer_mode, int multiplier; multiplier = INTVAL (op1); - /* We only allow (mult reg const_int_1) - or (mult reg const_int_2) or (mult reg const_int_4). */ - if (multiplier != 1 && multiplier != 2 && multiplier != 4) + /* We only allow (mult reg const_int_1), (mult reg const_int_2), + (mult reg const_int_4) or (mult reg const_int_8). */ + if (multiplier != 1 && multiplier != 2 + && multiplier != 4 && multiplier != 8) return false; regno = REGNO (op0); @@ -1273,8 +1274,9 @@ nds32_legitimate_index_p (machine_mode outer_mode, sv = INTVAL (op1); /* We only allow (ashift reg const_int_0) - or (ashift reg const_int_1) or (ashift reg const_int_2). */ - if (sv != 0 && sv != 1 && sv !=2) + or (ashift reg const_int_1) or (ashift reg const_int_2) or + (ashift reg const_int_3). */ + if (sv != 0 && sv != 1 && sv !=2 && sv != 3) return false; regno = REGNO (op0); @@ -2926,6 +2928,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x) sv = 1; else if (INTVAL (XEXP (op0, 1)) == 4) sv = 2; + else if (INTVAL (XEXP (op0, 1)) == 8) + sv = 3; else gcc_unreachable (); |