diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 947f65619e2..cd177e63d10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-10-11 Ulrich Weigand + + * 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 PR middle-end/17657 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 2a65365e1f4..79407a4137b 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -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 diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 11b6d84ab6d..2217e838f35 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -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))