Commit 3c1229cb by Richard Henderson Committed by Richard Henderson

xtensa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.

        * config/xtensa/xtensa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
        (TARGET_TRAMPOLINE_INIT): New.
        (xtensa_asm_trampoline_template): Rename from
        xtensa_trampoline_template; make static.
        (xtensa_trampoline_init): Rename from xtensa_initialize_trampoline;
        make static; update for hook parameters.
        * config/xtensa/xtensa-protos.h: Remove trampoline decls.
        * config/xtensa/xtensa.h (TRAMPOLINE_TEMPLATE): Remove.
        (INITIALIZE_TRAMPOLINE): Remove.

From-SVN: r152017
parent 3814318d
......@@ -292,6 +292,16 @@
vax_asm_trampoline_template.
(INITIALIZE_TRAMPOLINE): Move code to vax_trampoline_init.
* config/xtensa/xtensa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
(TARGET_TRAMPOLINE_INIT): New.
(xtensa_asm_trampoline_template): Rename from
xtensa_trampoline_template; make static.
(xtensa_trampoline_init): Rename from xtensa_initialize_trampoline;
make static; update for hook parameters.
* config/xtensa/xtensa-protos.h: Remove trampoline decls.
* config/xtensa/xtensa.h (TRAMPOLINE_TEMPLATE): Remove.
(INITIALIZE_TRAMPOLINE): Remove.
2009-09-22 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
......
......@@ -70,7 +70,6 @@ struct secondary_reload_info;
extern enum reg_class xtensa_secondary_reload (bool, rtx, enum reg_class,
enum machine_mode,
struct secondary_reload_info *);
extern void xtensa_initialize_trampoline (rtx, rtx, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
......@@ -86,6 +85,5 @@ extern void override_options (void);
extern long compute_frame_size (int);
extern void xtensa_expand_prologue (void);
extern void order_regs_for_local_alloc (void);
extern void xtensa_trampoline_template (FILE *);
#endif /* !__XTENSA_PROTOS_H__ */
......@@ -146,6 +146,8 @@ static tree xtensa_fold_builtin (tree, tree, bool);
static rtx xtensa_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void xtensa_va_start (tree, rtx);
static bool xtensa_frame_pointer_required (void);
static void xtensa_asm_trampoline_template (FILE *);
static void xtensa_trampoline_init (rtx, tree, rtx);
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
REG_ALLOC_ORDER;
......@@ -229,6 +231,11 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED xtensa_frame_pointer_required
#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
#define TARGET_ASM_TRAMPOLINE_TEMPLATE xtensa_asm_trampoline_template
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT xtensa_trampoline_init
struct gcc_target targetm = TARGET_INITIALIZER;
......@@ -3435,8 +3442,8 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
control to the instruction following the ENTRY at the target. Note:
this assumes that the target begins with an ENTRY instruction. */
void
xtensa_trampoline_template (FILE *stream)
static void
xtensa_asm_trampoline_template (FILE *stream)
{
bool use_call0 = (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS);
......@@ -3503,17 +3510,21 @@ xtensa_trampoline_template (FILE *stream)
fprintf (stream, "\t.end no-transform\n");
}
void
xtensa_initialize_trampoline (rtx addr, rtx func, rtx chain)
static void
xtensa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain)
{
rtx func = XEXP (DECL_RTL (fndecl), 0);
bool use_call0 = (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS);
int chain_off = use_call0 ? 12 : 8;
int func_off = use_call0 ? 16 : 12;
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, chain_off)), chain);
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, func_off)), func);
emit_block_move (m_tramp, assemble_trampoline_template (),
GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL);
emit_move_insn (adjust_address (m_tramp, SImode, chain_off), chain);
emit_move_insn (adjust_address (m_tramp, SImode, func_off), func);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_sync_caches"),
0, VOIDmode, 1, addr, Pmode);
0, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
}
......
......@@ -677,8 +677,6 @@ typedef struct xtensa_args
/* Stack pointer value doesn't matter at exit. */
#define EXIT_IGNORE_STACK 1
#define TRAMPOLINE_TEMPLATE(STREAM) xtensa_trampoline_template (STREAM)
/* Size in bytes of the trampoline, as an integer. Make sure this is
a multiple of TRAMPOLINE_ALIGNMENT to avoid -Wpadded warnings. */
#define TRAMPOLINE_SIZE (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS ? 60 : 52)
......@@ -686,11 +684,6 @@ typedef struct xtensa_args
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT 32
/* A C statement to initialize the variable parts of a trampoline. */
#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
xtensa_initialize_trampoline (ADDR, FUNC, CHAIN)
/* If defined, a C expression that produces the machine-specific code
to setup the stack so that arbitrary frames can be accessed.
......
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