diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2017-12-07 23:24:21 -0500 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2017-12-07 23:24:21 -0500 |
commit | e0727ae56b52ca891626a6c4242e26e5392e2796 (patch) | |
tree | 26bd7b67126169bbd5f77c5ad3da6f0e77869d14 | |
parent | df8ceba6a23ea326444348b922ef0550f9239107 (diff) | |
download | gcc-e0727ae56b52ca891626a6c4242e26e5392e2796.zip gcc-e0727ae56b52ca891626a6c4242e26e5392e2796.tar.gz gcc-e0727ae56b52ca891626a6c4242e26e5392e2796.tar.bz2 |
nios2.md (ld<bhw_uns>io): Add splitter for memory operand.
2017-12-07 Sandra Loosemore <sandra@codesourcery.com>
gcc/
* config/nios2/nios2.md (ld<bhw_uns>io): Add splitter for memory
operand.
(ld<bh>io_signed): Likewise.
(st<bhw>io): Likewise.
* config/nios2/predicates.md (ldstio_memory_operand): Allow
SMALL_INT12 constant integer operand.
From-SVN: r255493
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/nios2/nios2.md | 23 | ||||
-rw-r--r-- | gcc/config/nios2/predicates.md | 2 |
3 files changed, 31 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39a6f94..bea643d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2017-12-07 Sandra Loosemore <sandra@codesourcery.com> + * config/nios2/nios2.md (ld<bhw_uns>io): Add splitter for memory + operand. + (ld<bh>io_signed): Likewise. + (st<bhw>io): Likewise. + * config/nios2/predicates.md (ldstio_memory_operand): Allow + SMALL_INT12 constant integer operand. + +2017-12-07 Sandra Loosemore <sandra@codesourcery.com> + * config/nios2/nios2.c (nios2_symbolic_constant_allowed): Rename to... (nios2_large_constant_allowed): ...this. Adjust uses. diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md index 1d16be4..04693b1 100644 --- a/gcc/config/nios2/nios2.md +++ b/gcc/config/nios2/nios2.md @@ -318,12 +318,18 @@ (define_mode_attr bhw [(QI "b") (HI "h") (SI "w")]) (define_mode_attr bhw_uns [(QI "bu") (HI "hu") (SI "w")]) -(define_insn "ld<bhw_uns>io" +(define_insn_and_split "ld<bhw_uns>io" [(set (match_operand:BHW 0 "register_operand" "=r") (unspec_volatile:BHW [(match_operand:BHW 1 "ldstio_memory_operand" "w")] UNSPECV_LDXIO))] "" "ld<bhw_uns>io\\t%0, %1" + "nios2_large_constant_memory_operand_p (operands[1])" + [(set (match_dup 0) + (unspec_volatile:BHW [(match_dup 1)] UNSPECV_LDXIO))] + { + operands[1] = nios2_split_large_constant_memory_operand (operands[1]); + } [(set_attr "type" "ld")]) (define_expand "ld<bh>io" @@ -337,21 +343,32 @@ DONE; }) -(define_insn "ld<bh>io_signed" +(define_insn_and_split "ld<bh>io_signed" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (unspec_volatile:BH [(match_operand:BH 1 "ldstio_memory_operand" "w")] UNSPECV_LDXIO)))] "" "ld<bh>io\\t%0, %1" + "nios2_large_constant_memory_operand_p (operands[1])" + [(set (match_dup 0) + (sign_extend:SI (unspec_volatile:BH [(match_dup 1)] UNSPECV_LDXIO)))] + { + operands[1] = nios2_split_large_constant_memory_operand (operands[1]); + } [(set_attr "type" "ld")]) -(define_insn "st<bhw>io" +(define_insn_and_split "st<bhw>io" [(set (match_operand:BHW 0 "ldstio_memory_operand" "=w") (unspec_volatile:BHW [(match_operand:BHW 1 "reg_or_0_operand" "rM")] UNSPECV_STXIO))] "" "st<bhw>io\\t%z1, %0" + "nios2_large_constant_memory_operand_p (operands[0])" + [(set (match_dup 0) (unspec_volatile:BHW [(match_dup 1)] UNSPECV_STXIO))] + { + operands[0] = nios2_split_large_constant_memory_operand (operands[0]); + } [(set_attr "type" "st")]) diff --git a/gcc/config/nios2/predicates.md b/gcc/config/nios2/predicates.md index e35a37e..d605299 100644 --- a/gcc/config/nios2/predicates.md +++ b/gcc/config/nios2/predicates.md @@ -146,6 +146,8 @@ return (REG_P (XEXP (addr, 0)) && CONST_INT_P (XEXP (addr, 1)) && SMALL_INT12 (INTVAL (XEXP (addr, 1)))); + else if (CONST_INT_P (addr)) + return SMALL_INT12 (INTVAL (addr)); return false; } return memory_operand (op, mode); |