summaryrefslogtreecommitdiff
path: root/gcc/config/microblaze
diff options
context:
space:
mode:
authoreager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-16 17:42:30 +0000
committereager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-16 17:42:30 +0000
commit10baa3f35c31a9101e8c1628d18f4fce43a394f1 (patch)
tree8db6827c5afa13cddf755039dc7fffa850c2fd37 /gcc/config/microblaze
parentd9dc05a18a24f4096a08dd3866da04d1abaf7c1a (diff)
downloadgcc-10baa3f35c31a9101e8c1628d18f4fce43a394f1.tar.gz
* config/microblaze/microblaze.c (microblaze_asm_trampoline_template):
Replace with a microblaze version. (microblaze_trampoline_init): Adapt for microblaze. * gcc/config/microblaze/microblaze.h (TRAMPOLINE_SIZE): Adapt for microblaze. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196103 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/microblaze')
-rw-r--r--gcc/config/microblaze/microblaze.c18
-rw-r--r--gcc/config/microblaze/microblaze.h3
2 files changed, 9 insertions, 12 deletions
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index 8095f8236d7..90c962b2eab 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -2776,14 +2776,10 @@ microblaze_elf_asm_init_sections (void)
static void
microblaze_asm_trampoline_template (FILE *f)
{
- fprintf (f, "\t.word\t0x03e00821\t\t# move $1,$31\n");
- fprintf (f, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");
- fprintf (f, "\t.word\t0x00000000\t\t# nop\n");
- fprintf (f, "\t.word\t0x8fe30014\t\t# lw $3,20($31)\n");
- fprintf (f, "\t.word\t0x8fe20018\t\t# lw $2,24($31)\n");
- fprintf (f, "\t.word\t0x0060c821\t\t# move $25,$3 (abicalls)\n");
- fprintf (f, "\t.word\t0x00600008\t\t# jr $3\n");
- fprintf (f, "\t.word\t0x0020f821\t\t# move $31,$1\n");
+ fprintf (f, "\tmfs r18, rpc\n");
+ fprintf (f, "\tlwi r3, r18, 16\n");
+ fprintf (f, "\tlwi r18, r18, 20\n");
+ fprintf (f, "\tbra r18\n");
/* fprintf (f, "\t.word\t0x00000000\t\t# <function address>\n"); */
/* fprintf (f, "\t.word\t0x00000000\t\t# <static chain value>\n"); */
}
@@ -2797,11 +2793,11 @@ microblaze_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
rtx mem;
emit_block_move (m_tramp, assemble_trampoline_template (),
- GEN_INT (8*UNITS_PER_WORD), BLOCK_OP_NORMAL);
+ GEN_INT (6*UNITS_PER_WORD), BLOCK_OP_NORMAL);
- mem = adjust_address (m_tramp, SImode, 8);
+ mem = adjust_address (m_tramp, SImode, 16);
emit_move_insn (mem, chain_value);
- mem = adjust_address (m_tramp, SImode, 12);
+ mem = adjust_address (m_tramp, SImode, 20);
emit_move_insn (mem, fnaddr);
}
diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
index 5b64e39bcfe..327614544f2 100644
--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -499,7 +499,8 @@ typedef struct microblaze_args
#define EXIT_IGNORE_STACK 1
-#define TRAMPOLINE_SIZE (32 + 8)
+/* 4 insns + 2 words of data. */
+#define TRAMPOLINE_SIZE (6 * 4)
#define TRAMPOLINE_ALIGNMENT 32