Commit 9e56a932 by Kazu Hirata Committed by Kazu Hirata

h8300.h (TRAMPOLINE_TEMPLATE): Remove.

	* config/h8300/h8300.h (TRAMPOLINE_TEMPLATE): Remove.
	(TRAMPOLINE_SIZE): Support the normal mode.
	(INITIALIZE_TRAMPOLINE): Emit the entire trampoline.

From-SVN: r60705
parent 3f4f56e2
2002-12-31 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.h (TRAMPOLINE_TEMPLATE): Remove.
(TRAMPOLINE_SIZE): Support the normal mode.
(INITIALIZE_TRAMPOLINE): Emit the entire trampoline.
2002-12-31 Mark Mitchell <mark@codesourcery.com> 2002-12-31 Mark Mitchell <mark@codesourcery.com>
* c-common.h (pending_lang_change): Declare. * c-common.h (pending_lang_change): Declare.
......
...@@ -719,54 +719,58 @@ struct cum_arg ...@@ -719,54 +719,58 @@ struct cum_arg
#define EXIT_IGNORE_STACK 0 #define EXIT_IGNORE_STACK 0
/* Output assembler code for a block containing the constant parts /* We emit the entire trampoline with INITIALIZE_TRAMPOLINE.
of a trampoline, leaving space for the variable parts. Depending on the pointer size, we use a different trampoline.
H8/300 Pmode == HImode
vvvv context vvvv context
1 0000 7903xxxx mov.w #0x1234,r3 1 0000 7903xxxx mov.w #0x1234,r3
2 0004 5A00xxxx jmp @0x1234 2 0004 5A00xxxx jmp @0x1234
^^^^ function ^^^^ function
H8/300H Pmode == SImode
vvvvvvvv context vvvvvvvv context
2 0000 7A03xxxxxxxx mov.l #0x12345678,er3 2 0000 7A03xxxxxxxx mov.l #0x12345678,er3
3 0006 5Axxxxxx jmp @0x123456 3 0006 5Axxxxxx jmp @0x123456
^^^^^^ function ^^^^^^ function
*/ */
#define TRAMPOLINE_TEMPLATE(FILE) \
do \
{ \
if (TARGET_H8300) \
{ \
fprintf (FILE, "\tmov.w #0x1234,r3\n"); \
fprintf (FILE, "\tjmp @0x1234\n"); \
} \
else \
{ \
fprintf (FILE, "\tmov.l #0x12345678,er3\n"); \
fprintf (FILE, "\tjmp @0x123456\n"); \
} \
} \
while (0)
/* 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 (TARGET_H8300 ? 8 : 12) #define TRAMPOLINE_SIZE ((TARGET_H8300 || TARGET_NORMAL_MODE) ? 8 : 12)
/* Emit RTL insns to initialize the variable parts of a trampoline. /* Emit RTL insns to build 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.
CXT is an RTX for the static chain value for the function. */ CXT is an RTX for the static chain value for the function. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \ do \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), CXT); \ { \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), FNADDR); \ if (Pmode == HImode) \
if (TARGET_H8300H || TARGET_H8300S) \ { \
emit_move_insn (gen_rtx_MEM (QImode, plus_constant ((TRAMP), 6)), \ emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7903)); \
GEN_INT (0x5A)); \ emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \
} (CXT)); \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 4)), \
GEN_INT (0x5a00)); \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \
(FNADDR)); \
} \
else \
{ \
rtx tem = gen_reg_rtx (Pmode); \
\
emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7a03)); \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \
(CXT)); \
emit_move_insn (tem, (FNADDR)); \
emit_insn (gen_andsi3 (tem, tem, GEN_INT (0x00ffffff))); \
emit_insn (gen_iorsi3 (tem, tem, GEN_INT (0x5a000000))); \
emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \
tem); \
} \
} \
while (0)
/* Addressing modes, and classification of registers for them. */ /* Addressing modes, and classification of registers for them. */
......
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