microblaze.c (microblaze_asm_trampoline_template): Replace with a microblaze version.
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>
Sat, 16 Feb 2013 17:42:30 +0000 (17:42 +0000)
committerMichael Eager <eager@gcc.gnu.org>
Sat, 16 Feb 2013 17:42:30 +0000 (17:42 +0000)
* 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.

From-SVN: r196103

gcc/ChangeLog
gcc/config/microblaze/microblaze.c
gcc/config/microblaze/microblaze.h

index 07d5b8a32f3c928f56f8d1ec0a6ca79585ed5bfc..555e946d8dd0134788038494d7f61021b51428f2 100644 (file)
@@ -1,3 +1,11 @@
+2013-02-16  Edgar E. Iglesias  <edgar.iglesias@gmail.com>
+
+       * 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.
+
 2013-02-16  Jakub Jelinek  <jakub@redhat.com>
            Dodji Seketeli  <dodji@redhat.com>
 
index 8095f8236d7e9c23a8135d4a82d89c3345a8444b..90c962b2eabf2bb0764519a558ce8092f64f0404 100644 (file)
@@ -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);
 }
 \f
index 5b64e39bcfe53f093c7fdf175c84f5a0fe91cc5b..327614544f2036fb5f392a3f364988fc54f93346 100644 (file)
@@ -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