Commit 44d43e53 by Richard Henderson Committed by Richard Henderson

rs6000-protos.h (rs6000_initialize_trampoline): Remove.

        * config/rs6000/rs6000-protos.h (rs6000_initialize_trampoline): Remove.
        * config/rs6000/rs6000.c (TARGET_TRAMPOLINE_INIT): New.
        (rs6000_trampoline_init): Rename from rs6000_initialize_trampoline;
        make static; adjust parameters for the hook.
        * config/rs6000/rs6000.h (INITIALIZE_TRAMPOLINE): Remove.

From-SVN: r152008
parent 454da451
...@@ -211,6 +211,12 @@ ...@@ -211,6 +211,12 @@
* config/picochip/picochip.h (INITIALIZE_TRAMPOLINE): Remove. * config/picochip/picochip.h (INITIALIZE_TRAMPOLINE): Remove.
* config/rs6000/rs6000-protos.h (rs6000_initialize_trampoline): Remove.
* config/rs6000/rs6000.c (TARGET_TRAMPOLINE_INIT): New.
(rs6000_trampoline_init): Rename from rs6000_initialize_trampoline;
make static; adjust parameters for the hook.
* config/rs6000/rs6000.h (INITIALIZE_TRAMPOLINE): Remove.
2009-09-22 Jakub Jelinek <jakub@redhat.com> 2009-09-22 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes * config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
......
...@@ -109,7 +109,6 @@ extern void rs6000_emit_swdivsf (rtx, rtx, rtx); ...@@ -109,7 +109,6 @@ extern void rs6000_emit_swdivsf (rtx, rtx, rtx);
extern void rs6000_emit_swdivdf (rtx, rtx, rtx); extern void rs6000_emit_swdivdf (rtx, rtx, rtx);
extern void rs6000_emit_swrsqrtsf (rtx, rtx); extern void rs6000_emit_swrsqrtsf (rtx, rtx);
extern void output_toc (FILE *, rtx, int, enum machine_mode); extern void output_toc (FILE *, rtx, int, enum machine_mode);
extern void rs6000_initialize_trampoline (rtx, rtx, rtx);
extern rtx rs6000_longcall_ref (rtx); extern rtx rs6000_longcall_ref (rtx);
extern void rs6000_fatal_bad_address (rtx); extern void rs6000_fatal_bad_address (rtx);
extern rtx create_TOC_reference (rtx); extern rtx create_TOC_reference (rtx);
......
...@@ -1094,6 +1094,7 @@ static const enum reg_class *rs6000_ira_cover_classes (void); ...@@ -1094,6 +1094,7 @@ static const enum reg_class *rs6000_ira_cover_classes (void);
const int INSN_NOT_AVAILABLE = -1; const int INSN_NOT_AVAILABLE = -1;
static enum machine_mode rs6000_eh_return_filter_mode (void); static enum machine_mode rs6000_eh_return_filter_mode (void);
static bool rs6000_can_eliminate (const int, const int); static bool rs6000_can_eliminate (const int, const int);
static void rs6000_trampoline_init (rtx, tree, rtx);
/* Hash table stuff for keeping track of TOC entries. */ /* Hash table stuff for keeping track of TOC entries. */
...@@ -1467,6 +1468,9 @@ static const struct attribute_spec rs6000_attribute_table[] = ...@@ -1467,6 +1468,9 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_CAN_ELIMINATE #undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE rs6000_can_eliminate #define TARGET_CAN_ELIMINATE rs6000_can_eliminate
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT rs6000_trampoline_init
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
/* Return number of consecutive hard regs needed starting at reg REGNO /* Return number of consecutive hard regs needed starting at reg REGNO
...@@ -22962,32 +22966,38 @@ rs6000_trampoline_size (void) ...@@ -22962,32 +22966,38 @@ rs6000_trampoline_size (void)
FNADDR is an RTX for the address of the function's pure code. FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */ CXT is an RTX for the static chain value for the function. */
void static void
rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) rs6000_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
{ {
int regsize = (TARGET_32BIT) ? 4 : 8; int regsize = (TARGET_32BIT) ? 4 : 8;
rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx ctx_reg = force_reg (Pmode, cxt); rtx ctx_reg = force_reg (Pmode, cxt);
rtx addr = force_reg (Pmode, XEXP (m_tramp, 0));
switch (DEFAULT_ABI) switch (DEFAULT_ABI)
{ {
default: default:
gcc_unreachable (); gcc_unreachable ();
/* Macros to shorten the code expansions below. */
#define MEM_DEREF(addr) gen_rtx_MEM (Pmode, memory_address (Pmode, addr))
#define MEM_PLUS(addr,offset) \
gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (addr, offset)))
/* Under AIX, just build the 3 word function descriptor */ /* Under AIX, just build the 3 word function descriptor */
case ABI_AIX: case ABI_AIX:
{ {
rtx fnmem = gen_const_mem (Pmode, force_reg (Pmode, fnaddr));
rtx fn_reg = gen_reg_rtx (Pmode); rtx fn_reg = gen_reg_rtx (Pmode);
rtx toc_reg = gen_reg_rtx (Pmode); rtx toc_reg = gen_reg_rtx (Pmode);
emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize)); /* Macro to shorten the code expansions below. */
emit_move_insn (MEM_DEREF (addr), fn_reg); # define MEM_PLUS(MEM, OFFSET) adjust_address (MEM, Pmode, OFFSET)
emit_move_insn (MEM_PLUS (addr, regsize), toc_reg);
emit_move_insn (MEM_PLUS (addr, 2*regsize), ctx_reg); m_tramp = replace_equiv_address (m_tramp, addr);
emit_move_insn (fn_reg, MEM_PLUS (fnmem, 0));
emit_move_insn (toc_reg, MEM_PLUS (fnmem, regsize));
emit_move_insn (MEM_PLUS (m_tramp, 0), fn_reg);
emit_move_insn (MEM_PLUS (m_tramp, regsize), toc_reg);
emit_move_insn (MEM_PLUS (m_tramp, 2*regsize), ctx_reg);
# undef MEM_PLUS
} }
break; break;
...@@ -23002,8 +23012,6 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) ...@@ -23002,8 +23012,6 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
ctx_reg, Pmode); ctx_reg, Pmode);
break; break;
} }
return;
} }
......
...@@ -1727,18 +1727,9 @@ typedef struct rs6000_args ...@@ -1727,18 +1727,9 @@ typedef struct rs6000_args
&& (REGNO) == 2)) && (REGNO) == 2))
/* TRAMPOLINE_TEMPLATE deleted */
/* Length in units of the trampoline for entering a nested function. */ /* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE rs6000_trampoline_size () #define TRAMPOLINE_SIZE rs6000_trampoline_size ()
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
/* Definitions for __builtin_return_address and __builtin_frame_address. /* Definitions for __builtin_return_address and __builtin_frame_address.
__builtin_return_address (0) should give link register (65), enable __builtin_return_address (0) should give link register (65), enable
......
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