aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-22 08:16:18 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-22 08:16:18 -0700
commitfb8d0fac17d730521734266b364159b8a6f4a226 (patch)
treed9edfa397031459bbd942a82286a4289bf6cfb7e /gcc/config
parenta85b4c91b30eda2893ecf5efeeda4f9dbb518763 (diff)
downloadgcc-fb8d0fac17d730521734266b364159b8a6f4a226.zip
gcc-fb8d0fac17d730521734266b364159b8a6f4a226.tar.gz
gcc-fb8d0fac17d730521734266b364159b8a6f4a226.tar.bz2
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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/stormy16/stormy16.c27
-rw-r--r--gcc/config/stormy16/stormy16.h5
2 files changed, 16 insertions, 16 deletions
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 1c076b2..03e716f 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -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"
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 49505b5..682f7e6 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -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