aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-22 08:16:42 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-22 08:16:42 -0700
commit3c1229cb545da35578b7df31316b0e60377054d4 (patch)
tree97e6487d8a47e5372135aecdd2cf420f5e8b8377 /gcc
parent3814318d559e5f13822e897a4316d72f92d6c0e5 (diff)
downloadgcc-3c1229cb545da35578b7df31316b0e60377054d4.zip
gcc-3c1229cb545da35578b7df31316b0e60377054d4.tar.gz
gcc-3c1229cb545da35578b7df31316b0e60377054d4.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/xtensa/xtensa-protos.h2
-rw-r--r--gcc/config/xtensa/xtensa.c27
-rw-r--r--gcc/config/xtensa/xtensa.h7
4 files changed, 29 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a6e7a8..daff5e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index 73176f6..6bd1e56 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -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__ */
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 77ba2d9..0264868 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -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);
}
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 84d320b..4fefbfd 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -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.