summaryrefslogtreecommitdiff
path: root/gcc/config/moxie/moxie.c
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2014-12-27 15:53:46 +0000
committerAnthony Green <green@gcc.gnu.org>2014-12-27 15:53:46 +0000
commit982213b5ffeccdee4cb755d55009cc30aabd6016 (patch)
tree43b65bc3116fab8157d1a8c4f686e4ab436fb272 /gcc/config/moxie/moxie.c
parentfd6cc689cc0a12c64095444d799b620144e66b57 (diff)
downloadgcc-982213b5ffeccdee4cb755d55009cc30aabd6016.tar.gz
Switch to 16-bit offsets for moxie ldo/sto instructions
From-SVN: r219080
Diffstat (limited to 'gcc/config/moxie/moxie.c')
-rw-r--r--gcc/config/moxie/moxie.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index 1165e9ab50e..e6768e4258c 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -555,7 +555,6 @@ moxie_asm_trampoline_template (FILE *f)
fprintf (f, "\tldi.l $r0, 0x0\n");
fprintf (f, "\tsto.l 0x8($fp), $r0\n");
fprintf (f, "\tpop $sp, $r0\n");
- fprintf (f, "\tnop\n");
fprintf (f, "\tjmpa 0x0\n");
}
@@ -571,10 +570,28 @@ moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
mem = adjust_address (m_tramp, SImode, 4);
emit_move_insn (mem, chain_value);
- mem = adjust_address (m_tramp, SImode, 20);
+ mem = adjust_address (m_tramp, SImode, 16);
emit_move_insn (mem, fnaddr);
}
+/* Return true for memory offset addresses between -32768 and 32767. */
+bool
+moxie_offset_address_p (rtx x)
+{
+ x = XEXP (x, 0);
+
+ if (GET_CODE (x) == PLUS)
+ {
+ x = XEXP (x, 1);
+ if (GET_CODE (x) == CONST_INT)
+ {
+ unsigned int v = INTVAL (x) & 0xFFFF8000;
+ return (v == 0xFFFF8000 || v == 0x00000000);
+ }
+ }
+ return 0;
+}
+
/* The Global `targetm' Variable. */
/* Initialize the GCC target structure. */