Commit e73cbb04 by Richard Kenner

(TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Avoid need for helper function.

(TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Avoid need for
helper function.
(TRAMPOLINE_ALIGNMENT): Renamed from TRAMPOLINE_ALIGN.

From-SVN: r11134
parent 270eeaa5
...@@ -993,41 +993,33 @@ while(0) ...@@ -993,41 +993,33 @@ while(0)
of a trampoline, leaving space for the variable parts. */ of a trampoline, leaving space for the variable parts. */
/* On the 68k, the trampoline looks like this: /* On the 68k, the trampoline looks like this:
mov @#.,a0 movl pc@(8),a0
jsr @#___trampoline movl pc@(8),sp@-
jsr @#___trampoline rts
.long STATIC .long STATIC
.long FUNCTION .long FUNCTION
The reason for having three jsr insns is so that an entire line The use of pc relative addressing mode ensures that the constants are
of the instruction cache is filled in a predictable way accessed through the data cache. */
that will always be the same.
We always use the assembler label ___trampoline
regardless of whether the system adds underscores. */
#define TRAMPOLINE_TEMPLATE(FILE) \ #define TRAMPOLINE_TEMPLATE(FILE) \
{ \ { \
ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x207c)); \ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x207a)); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 8)); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x2f3a)); \
ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 8)); \
ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4e75)); \
ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \ ASM_OUTPUT_INT (FILE, const0_rtx); \
ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\ ASM_OUTPUT_INT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
} }
/* Length in units of the trampoline for entering a nested function. */ /* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 26 #define TRAMPOLINE_SIZE 18
/* Alignment required for a trampoline. 16 is used to find the /* Alignment required for a trampoline. 16 is used to find the
beginning of a line in the instruction cache. */ beginning of a line in the instruction cache. */
#define TRAMPOLINE_ALIGN 16 #define TRAMPOLINE_ALIGNMENT 16
/* Emit RTL insns to initialize the variable parts of a trampoline. /* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code. FNADDR is an RTX for the address of the function's pure code.
...@@ -1035,14 +1027,16 @@ regardless of whether the system adds underscores. */ ...@@ -1035,14 +1027,16 @@ regardless of whether the system adds underscores. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \ { \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), TRAMP); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 10)), CXT); \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 18)), CXT); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 14)), FNADDR); \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 22)), FNADDR); \
} }
/* This is the library routine that is used /* This is the library routine that is used
to transfer control from the trampoline to transfer control from the trampoline
to the actual nested function. */ to the actual nested function.
It is defined for backward compatibility,
for linking with object code that used the old
trampoline definition. */
/* A colon is used with no explicit operands /* A colon is used with no explicit operands
to cause the template string to be scanned for %-constructs. */ to cause the template string to be scanned for %-constructs. */
......
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