]> gcc.gnu.org Git - gcc.git/commitdiff
xtensa.c (TARGET_ASM_TRAMPOLINE_TEMPLATE): New.
authorRichard Henderson <rth@redhat.com>
Tue, 22 Sep 2009 15:16:42 +0000 (08:16 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 22 Sep 2009 15:16:42 +0000 (08:16 -0700)
        * 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

gcc/ChangeLog
gcc/config/xtensa/xtensa-protos.h
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h

index 7a6e7a8b2bcc0963320aeb16ffc5ed895b220ef7..daff5e4d1b5f2442beafd3b1474aedb7c6449c86 100644 (file)
        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
index 73176f6f8f61d9ceafc4c24f0e69a3954970288a..6bd1e565fe7403cc1118ea79dfa18fe818d48bfc 100644 (file)
@@ -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__ */
index 77ba2d9d01798f92d14596b9b0fb010c220b570b..0264868a4a2df04867fd0b0f4e851d8b3c4c0f17 100644 (file)
@@ -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;
 
 \f
@@ -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);
 }
 
 
index 84d320bc95b2264913efe1b6a80f94cb8857089b..4fefbfd973a453e76fd114f256b18ed410b07762 100644 (file)
@@ -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.
 
This page took 0.114033 seconds and 5 git commands to generate.