sh-protos.h (sh_initialize_trampoline): Remove.

* config/sh/sh-protos.h (sh_initialize_trampoline): Remove.
        * config/sh/sh.c (TARGET_TRAMPOLINE_INIT): New.
        (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
        (sh_trampoline_init): Rename from sh_initialize_trampoline;
        make static; adjust for target hook parameters.
        (sh_trampoline_adjust_address): New.
        * config/sh/sh.h (INITIALIZE_TRAMPOLINE): New.
        (TRAMPOLINE_ADJUST_ADDRESS): Move code to sh_trampoline_adjust_address.

From-SVN: r152011
This commit is contained in:
Richard Henderson 2009-09-22 08:15:50 -07:00 committed by Richard Henderson
parent 2f5bb28c29
commit 994322ef6e
4 changed files with 31 additions and 22 deletions

View File

@ -244,6 +244,15 @@
adjust for target hook.
* config/score/score3.h, config/score/score7.h: Update.
* config/sh/sh-protos.h (sh_initialize_trampoline): Remove.
* config/sh/sh.c (TARGET_TRAMPOLINE_INIT): New.
(TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
(sh_trampoline_init): Rename from sh_initialize_trampoline;
make static; adjust for target hook parameters.
(sh_trampoline_adjust_address): New.
* config/sh/sh.h (INITIALIZE_TRAMPOLINE): New.
(TRAMPOLINE_ADJUST_ADDRESS): Move code to sh_trampoline_adjust_address.
2009-09-22 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes

View File

@ -142,7 +142,6 @@ extern int sh_cfun_interrupt_handler_p (void);
extern int sh_cfun_resbank_handler_p (void);
extern int sh_attr_renesas_p (const_tree);
extern int sh_cfun_attr_renesas_p (void);
extern void sh_initialize_trampoline (rtx, rtx, rtx);
extern bool sh_cannot_change_mode_class
(enum machine_mode, enum machine_mode, enum reg_class);
extern void sh_mark_label (rtx, int);

View File

@ -272,6 +272,8 @@ static bool sh_scalar_mode_supported_p (enum machine_mode);
static int sh_dwarf_calling_convention (const_tree);
static void sh_encode_section_info (tree, rtx, int);
static int sh2a_function_vector_p (tree);
static void sh_trampoline_init (rtx, tree, rtx);
static rtx sh_trampoline_adjust_address (rtx);
static const struct attribute_spec sh_attribute_table[] =
{
@ -511,6 +513,11 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P sh_legitimate_address_p
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT sh_trampoline_init
#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
#define TARGET_TRAMPOLINE_ADJUST_ADDRESS sh_trampoline_adjust_address
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
@ -10327,10 +10334,11 @@ sh_ms_bitfield_layout_p (const_tree record_type ATTRIBUTE_UNUSED)
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. */
void
sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
static void
sh_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
{
rtx tramp_mem = gen_frame_mem (BLKmode, tramp);
rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
if (TARGET_SHMEDIA64)
{
@ -10421,7 +10429,6 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
rtx ptabs = force_reg (DImode, GEN_INT (0x6bf10600));
rtx blink = force_reg (DImode, GEN_INT (0x4401fff0));
tramp = force_reg (Pmode, tramp);
fnaddr = force_reg (SImode, fnaddr);
cxt = force_reg (SImode, cxt);
emit_insn (gen_mshflo_w_x (gen_rtx_SUBREG (V4HImode, quad0, 0),
@ -10477,6 +10484,17 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
}
}
/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
static rtx
sh_trampoline_adjust_address (rtx tramp)
{
if (TARGET_SHMEDIA)
tramp = expand_simple_binop (Pmode, PLUS, tramp, const1_rtx,
gen_reg_rtx (Pmode), 0, OPTAB_LIB_WIDEN);
return tramp;
}
/* FIXME: This is overly conservative. A SHcompact function that
receives arguments ``by reference'' will have them stored in its
own stack frame, so it must not pass pointers or references to

View File

@ -1829,23 +1829,6 @@ struct sh_args {
((CACHE_LOG < 3 || (TARGET_SMALLCODE && ! TARGET_HARVARD)) ? 32 \
: TARGET_SHMEDIA ? 256 : 64)
/* Emit RTL insns to initialize the variable parts of a trampoline.
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. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
sh_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
#define TRAMPOLINE_ADJUST_ADDRESS(TRAMP) do \
{ \
if (TARGET_SHMEDIA) \
(TRAMP) = expand_simple_binop (Pmode, PLUS, (TRAMP), const1_rtx, \
gen_reg_rtx (Pmode), 0, \
OPTAB_LIB_WIDEN); \
} while (0)
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
FRAMEADDR is already the frame pointer of the COUNT frame, so we