aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn Hassey <hassey@gnu.org>1993-02-18 03:05:08 +0000
committerJohn Hassey <hassey@gnu.org>1993-02-18 03:05:08 +0000
commit7f8f7371d3e43dcb01b3f9428507e40fa923de57 (patch)
treeded4d7a206a3cc4446f67a92a6f822d1d6508015 /gcc
parentabc1d3f177dd5824bb9c5bb99abd177c2ee6f5be (diff)
downloadgcc-7f8f7371d3e43dcb01b3f9428507e40fa923de57.zip
gcc-7f8f7371d3e43dcb01b3f9428507e40fa923de57.tar.gz
gcc-7f8f7371d3e43dcb01b3f9428507e40fa923de57.tar.bz2
(emit_ldst): For large offsets use register index
instead of immediate. From-SVN: r3484
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m88k/m88k.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c
index aec823a..c4718fb 100644
--- a/gcc/config/m88k/m88k.c
+++ b/gcc/config/m88k/m88k.c
@@ -2127,7 +2127,22 @@ emit_ldst (store_p, regno, mode, offset)
int offset;
{
rtx reg = gen_rtx (REG, mode, regno);
- rtx mem = gen_rtx (MEM, mode, plus_constant (stack_pointer_rtx, offset));
+ rtx mem;
+
+ if (SMALL_INTVAL (offset))
+ {
+ mem = gen_rtx (MEM, mode, plus_constant (stack_pointer_rtx, offset));
+ }
+ else
+ {
+ /* offset is too large for immediate index must use register */
+
+ rtx disp = gen_rtx (CONST_INT, VOIDmode, offset);
+ rtx temp = gen_rtx (REG, SImode, TEMP_REGNUM);
+ rtx regi = gen_rtx (PLUS, SImode, stack_pointer_rtx, temp);
+ emit_move_insn (temp, disp);
+ mem = gen_rtx (MEM, mode, regi);
+ }
if (store_p)
emit_move_insn (mem, reg);