Commit cadc42db by Ulrich Weigand Committed by Ulrich Weigand

s390.c (s390_trampoline_template): Generate shorter trampoline code.

	* 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
parent 169bb110
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> 2004-10-11 Roger Sayle <roger@eyesopen.com>
PR middle-end/17657 PR middle-end/17657
......
...@@ -7825,23 +7825,23 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, ...@@ -7825,23 +7825,23 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
void void
s390_trampoline_template (FILE *file) 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) if (TARGET_64BIT)
{ {
fprintf (file, "larl\t%s,0f\n", reg_names[1]); output_asm_insn ("basr\t%1,0", op);
fprintf (file, "lg\t%s,0(%s)\n", reg_names[0], reg_names[1]); output_asm_insn ("lmg\t%0,%1,14(%1)", op);
fprintf (file, "lg\t%s,8(%s)\n", reg_names[1], reg_names[1]); output_asm_insn ("br\t%1", op);
fprintf (file, "br\t%s\n", reg_names[1]); ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 10));
fprintf (file, "0:\t.quad\t0\n");
fprintf (file, ".quad\t0\n");
} }
else else
{ {
fprintf (file, "basr\t%s,0\n", reg_names[1]); output_asm_insn ("basr\t%1,0", op);
fprintf (file, "l\t%s,10(%s)\n", reg_names[0], reg_names[1]); output_asm_insn ("lm\t%0,%1,6(%1)", op);
fprintf (file, "l\t%s,14(%s)\n", reg_names[1], reg_names[1]); output_asm_insn ("br\t%1", op);
fprintf (file, "br\t%s\n", reg_names[1]); ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 8));
fprintf (file, ".long\t0\n");
fprintf (file, ".long\t0\n");
} }
} }
...@@ -7854,10 +7854,10 @@ s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) ...@@ -7854,10 +7854,10 @@ s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
{ {
emit_move_insn (gen_rtx_MEM (Pmode, emit_move_insn (gen_rtx_MEM (Pmode,
memory_address (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, emit_move_insn (gen_rtx_MEM (Pmode,
memory_address (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 /* Return rtx for 64-bit constant formed from the 32-bit subwords
......
...@@ -730,7 +730,7 @@ CUMULATIVE_ARGS; ...@@ -730,7 +730,7 @@ CUMULATIVE_ARGS;
/* Trampolines for nested functions. */ /* Trampolines for nested functions. */
#define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20) #define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
s390_initialize_trampoline ((ADDR), (FNADDR), (CXT)) s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment