romp-protos.h (romp_initialize_trampoline): New function.

* romp-protos.h (romp_initialize_trampoline): New function.
	* romp.c (romp_initialize_trampoline): Likewise.
	* romp.h (INITIALIZE_TRAMPOLINE): Define in terms of
	romp_initialize_trampoline.

From-SVN: r46104
This commit is contained in:
Kaveh R. Ghazi 2001-10-08 21:55:05 +00:00 committed by Kaveh Ghazi
parent da905677f1
commit e052f1a966
4 changed files with 34 additions and 31 deletions

View File

@ -1,3 +1,10 @@
2001-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* romp-protos.h (romp_initialize_trampoline): New function.
* romp.c (romp_initialize_trampoline): Likewise.
* romp.h (INITIALIZE_TRAMPOLINE): Define in terms of
romp_initialize_trampoline.
2001-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* m68k/3b1.h (ASM_OUTPUT_SOURCE_LINE): Don't reference `last_linenum'.

View File

@ -47,6 +47,7 @@ extern int reg_15_operand PARAMS ((rtx, enum machine_mode));
extern int float_binary PARAMS ((rtx, enum machine_mode));
extern int float_unary PARAMS ((rtx, enum machine_mode));
extern int float_conversion PARAMS ((rtx, enum machine_mode));
extern void romp_initialize_trampoline PARAMS ((rtx, rtx, rtx));
#endif /* RTX_CODE */
extern int first_reg_to_save PARAMS ((void));

View File

@ -2046,3 +2046,28 @@ romp_debugger_arg_correction (offset)
return (offset - fp_to_argp);
}
void
romp_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
{
rtx addr, temp, val;
temp = expand_simple_binop (SImode, PLUS, tramp, GEN_INT (4),
0, 1, OPTAB_LIB_WIDEN);
emit_move_insn (gen_rtx_MEM (SImode, memory_address (SImode, tramp)), temp);
val = force_reg (SImode, cxt);
addr = memory_address (HImode, plus_constant (tramp, 10));
emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, val));
temp = expand_shift (RSHIFT_EXPR, SImode, val, build_int_2 (16, 0), 0, 1);
addr = memory_address (HImode, plus_constant (tramp, 6));
emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, temp));
val = force_reg (SImode, fnaddr);
addr = memory_address (HImode, plus_constant (tramp, 24));
emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, val));
temp = expand_shift (RSHIFT_EXPR, SImode, val, build_int_2 (16, 0), 0, 1);
addr = memory_address (HImode, plus_constant (tramp, 20));
emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, temp));
}

View File

@ -785,37 +785,7 @@ struct rt_cargs {int gregs, fregs; };
data area. */
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
{ \
rtx _addr, _temp; \
rtx _val; \
\
_temp = expand_binop (SImode, add_optab, ADDR, \
GEN_INT (4), \
0, 1, OPTAB_LIB_WIDEN); \
emit_move_insn (gen_rtx_MEM (SImode, \
memory_address (SImode, ADDR)), _temp); \
\
_val = force_reg (SImode, CXT); \
_addr = memory_address (HImode, plus_constant (ADDR, 10)); \
emit_move_insn (gen_rtx_MEM (HImode, _addr), \
gen_lowpart (HImode, _val)); \
_temp = expand_shift (RSHIFT_EXPR, SImode, _val, \
build_int_2 (16, 0), 0, 1); \
_addr = memory_address (HImode, plus_constant (ADDR, 6)); \
emit_move_insn (gen_rtx_MEM (HImode, _addr), \
gen_lowpart (HImode, _temp)); \
\
_val = force_reg (SImode, FNADDR); \
_addr = memory_address (HImode, plus_constant (ADDR, 24)); \
emit_move_insn (gen_rtx_MEM (HImode, _addr), \
gen_lowpart (HImode, _val)); \
_temp = expand_shift (RSHIFT_EXPR, SImode, _val, \
build_int_2 (16, 0), 0, 1); \
_addr = memory_address (HImode, plus_constant (ADDR, 20)); \
emit_move_insn (gen_rtx_MEM (HImode, _addr), \
gen_lowpart (HImode, _temp)); \
\
}
romp_initialize_trampoline (ADDR, FNADDR, CXT)
/* Definitions for register eliminations.