]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390.c (s390_trampoline_template): Generate shorter trampoline code.
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 11 Oct 2004 18:28:25 +0000 (18:28 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Mon, 11 Oct 2004 18:28:25 +0000 (18:28 +0000)
* config/s390/s390.c (s390_trampoline_template): Generate shorter
trampoline code.
(s390_trampoline_instantiate): Adapt.
* config/s390/s390.h (TRAMPOLINE_SIZE): Adapt to new code.

From-SVN: r88895

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/config/s390/s390.h

index 947f65619e2e5aeaf9bf1e9dee43d5bee3afd01c..cd177e63d1067a1eaf5d6d9b71e5ac88b0def0d8 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-11  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * config/s390/s390.c (s390_trampoline_template): Generate shorter
+       trampoline code.
+       (s390_trampoline_instantiate): Adapt.
+       * config/s390/s390.h (TRAMPOLINE_SIZE): Adapt to new code.
+
 2004-10-11  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/17657
index 2a65365e1f4c51d617352e55c70a8bc5d082c141..79407a4137bb8f26a15b4dd1a1f41ca63a2e6da1 100644 (file)
@@ -7825,23 +7825,23 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 void
 s390_trampoline_template (FILE *file)
 {
+  rtx op[2];
+  op[0] = gen_rtx_REG (Pmode, 0);
+  op[1] = gen_rtx_REG (Pmode, 1);
+
   if (TARGET_64BIT)
     {
-      fprintf (file, "larl\t%s,0f\n", reg_names[1]);
-      fprintf (file, "lg\t%s,0(%s)\n", reg_names[0], reg_names[1]);
-      fprintf (file, "lg\t%s,8(%s)\n", reg_names[1], reg_names[1]);
-      fprintf (file, "br\t%s\n", reg_names[1]);
-      fprintf (file, "0:\t.quad\t0\n");
-      fprintf (file, ".quad\t0\n");
+      output_asm_insn ("basr\t%1,0", op);
+      output_asm_insn ("lmg\t%0,%1,14(%1)", op);
+      output_asm_insn ("br\t%1", op);
+      ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 10));
     }
   else
     {
-      fprintf (file, "basr\t%s,0\n", reg_names[1]);
-      fprintf (file, "l\t%s,10(%s)\n", reg_names[0], reg_names[1]);
-      fprintf (file, "l\t%s,14(%s)\n", reg_names[1], reg_names[1]);
-      fprintf (file, "br\t%s\n", reg_names[1]);
-      fprintf (file, ".long\t0\n");
-      fprintf (file, ".long\t0\n");
+      output_asm_insn ("basr\t%1,0", op);
+      output_asm_insn ("lm\t%0,%1,6(%1)", op);
+      output_asm_insn ("br\t%1", op);
+      ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 8));
     }
 }
 
@@ -7854,10 +7854,10 @@ s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
 {
   emit_move_insn (gen_rtx_MEM (Pmode,
                   memory_address (Pmode,
-                  plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt);
+                  plus_constant (addr, (TARGET_64BIT ? 16 : 8)))), cxt);
   emit_move_insn (gen_rtx_MEM (Pmode,
                   memory_address (Pmode,
-                  plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr);
+                  plus_constant (addr, (TARGET_64BIT ? 24 : 12)))), fnaddr);
 }
 
 /* Return rtx for 64-bit constant formed from the 32-bit subwords
index 11b6d84ab6d5296e053346b8f1f78547bd79503b..2217e838f359ee59331aad4417640e565d206838 100644 (file)
@@ -730,7 +730,7 @@ CUMULATIVE_ARGS;
 
 /* Trampolines for nested functions.  */
 
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20)
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
 
 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT)                       \
    s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))