stormy16.c (xstormy16_trampoline_init): Rename from xstormy16_initialize_trampoline...

* config/stormy16/stormy16.c (xstormy16_trampoline_init): Rename
        from xstormy16_initialize_trampoline; make static; update for
        hook parameters.
        (TARGET_TRAMPOLINE_INIT): New.
        * config/stormy16/stormy16.h (INITIALIZE_TRAMPOLINE): Remove.

From-SVN: r152014
This commit is contained in:
Richard Henderson 2009-09-22 08:16:18 -07:00 committed by Richard Henderson
parent a85b4c91b3
commit fb8d0fac17
3 changed files with 22 additions and 16 deletions

View File

@ -270,6 +270,12 @@
* config/spu/spu-protos.h: Update decls.
* config/spu/spu.h (INITIALIZE_TRAMPOLINE): Remove.
* config/stormy16/stormy16.c (xstormy16_trampoline_init): Rename
from xstormy16_initialize_trampoline; make static; update for
hook parameters.
(TARGET_TRAMPOLINE_INIT): New.
* config/stormy16/stormy16.h (INITIALIZE_TRAMPOLINE): Remove.
2009-09-22 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes

View File

@ -1456,34 +1456,36 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
return build_va_arg_indirect_ref (addr);
}
/* Initialize the variable parts of a trampoline. ADDR is an RTX for
the address of the trampoline; FNADDR is an RTX for the address of
the nested function; STATIC_CHAIN is an RTX for the static chain
value that should be passed to the function when it is called. */
/* Worker function for TARGET_TRAMPOLINE_INIT. */
void
xstormy16_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
static void
xstormy16_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
{
rtx reg_addr = gen_reg_rtx (Pmode);
rtx temp = gen_reg_rtx (HImode);
rtx reg_fnaddr = gen_reg_rtx (HImode);
rtx reg_addr_mem;
rtx reg_addr, reg_addr_mem;
reg_addr_mem = gen_rtx_MEM (HImode, reg_addr);
reg_addr = copy_to_reg (XEXP (m_tramp, 0));
reg_addr_mem = adjust_automodify_address (m_tramp, HImode, reg_addr, 0);
emit_move_insn (reg_addr, addr);
emit_move_insn (temp, GEN_INT (0x3130 | STATIC_CHAIN_REGNUM));
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
emit_move_insn (temp, static_chain);
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
emit_move_insn (reg_fnaddr, fnaddr);
reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
emit_move_insn (reg_fnaddr, XEXP (DECL_RTL (fndecl), 0));
emit_move_insn (temp, reg_fnaddr);
emit_insn (gen_andhi3 (temp, temp, GEN_INT (0xFF)));
emit_insn (gen_iorhi3 (temp, temp, GEN_INT (0x0200)));
emit_move_insn (reg_addr_mem, temp);
emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
reg_addr_mem = adjust_automodify_address (reg_addr_mem, VOIDmode, NULL, 2);
emit_insn (gen_lshrhi3 (reg_fnaddr, reg_fnaddr, GEN_INT (8)));
emit_move_insn (reg_addr_mem, reg_fnaddr);
}
@ -2667,6 +2669,9 @@ xstormy16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE xstormy16_can_eliminate
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT xstormy16_trampoline_init
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-stormy16.h"

View File

@ -454,12 +454,7 @@ enum reg_class
/* Trampolines for Nested Functions. */
#define TRAMPOLINE_SIZE 8
#define TRAMPOLINE_ALIGNMENT 16
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
/* Define this macro to override the type used by the library routines to pick
up arguments of type `float'. (By default, they use a union of `float' and