mirror of git://gcc.gnu.org/git/gcc.git
m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
* config/m68hc11/m68hc11.c (TARGET_TRAMPOLINE_INIT): New. (m68hc11_trampoline_init): Rename from m68hc11_initialize_trampoline; make static; update for hook parameters. * config/m68hc11/m68hc11-protos.h: Update. * config/m68hc11/m68hc11.h (INITIALIZE_TRAMPOLINE): Remove. From-SVN: r151998
This commit is contained in:
parent
1548bf0514
commit
0d7e5af167
|
@ -135,6 +135,12 @@
|
||||||
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Move code to
|
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Move code to
|
||||||
m32r_trampoline_init.
|
m32r_trampoline_init.
|
||||||
|
|
||||||
|
* config/m68hc11/m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
|
||||||
|
(m68hc11_trampoline_init): Rename from m68hc11_initialize_trampoline;
|
||||||
|
make static; update for hook parameters.
|
||||||
|
* config/m68hc11/m68hc11-protos.h: Update.
|
||||||
|
* config/m68hc11/m68hc11.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
|
||||||
|
|
|
@ -43,8 +43,6 @@ extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*,
|
||||||
#ifdef RTX_CODE
|
#ifdef RTX_CODE
|
||||||
extern int m68hc11_auto_inc_p (rtx);
|
extern int m68hc11_auto_inc_p (rtx);
|
||||||
|
|
||||||
extern void m68hc11_initialize_trampoline (rtx, rtx, rtx);
|
|
||||||
|
|
||||||
extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
|
extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
|
||||||
extern enum reg_class preferred_reload_class (rtx, enum reg_class);
|
extern enum reg_class preferred_reload_class (rtx, enum reg_class);
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ static void m68hc11_init_libfuncs (void);
|
||||||
static rtx m68hc11_struct_value_rtx (tree, int);
|
static rtx m68hc11_struct_value_rtx (tree, int);
|
||||||
static bool m68hc11_return_in_memory (const_tree, const_tree);
|
static bool m68hc11_return_in_memory (const_tree, const_tree);
|
||||||
static bool m68hc11_can_eliminate (const int, const int);
|
static bool m68hc11_can_eliminate (const int, const int);
|
||||||
|
static void m68hc11_trampoline_init (rtx, tree, rtx);
|
||||||
|
|
||||||
/* Must be set to 1 to produce debug messages. */
|
/* Must be set to 1 to produce debug messages. */
|
||||||
int debug_m6811 = 0;
|
int debug_m6811 = 0;
|
||||||
|
@ -282,6 +283,9 @@ static const struct attribute_spec m68hc11_attribute_table[] =
|
||||||
#undef TARGET_CAN_ELIMINATE
|
#undef TARGET_CAN_ELIMINATE
|
||||||
#define TARGET_CAN_ELIMINATE m68hc11_can_eliminate
|
#define TARGET_CAN_ELIMINATE m68hc11_can_eliminate
|
||||||
|
|
||||||
|
#undef TARGET_TRAMPOLINE_INIT
|
||||||
|
#define TARGET_TRAMPOLINE_INIT m68hc11_trampoline_init
|
||||||
|
|
||||||
struct gcc_target targetm = TARGET_INITIALIZER;
|
struct gcc_target targetm = TARGET_INITIALIZER;
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1072,39 +1076,49 @@ symbolic_memory_operand (rtx op, enum machine_mode mode)
|
||||||
jmp FNADDR
|
jmp FNADDR
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
m68hc11_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
|
m68hc11_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
|
||||||
{
|
{
|
||||||
const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
|
const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
|
||||||
|
rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
|
||||||
|
rtx mem;
|
||||||
|
|
||||||
/* Skip the '*'. */
|
/* Skip the '*'. */
|
||||||
if (*static_chain_reg == '*')
|
if (*static_chain_reg == '*')
|
||||||
static_chain_reg++;
|
static_chain_reg++;
|
||||||
if (TARGET_M6811)
|
if (TARGET_M6811)
|
||||||
{
|
{
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x18ce));
|
mem = adjust_address (m_tramp, HImode, 0);
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
|
emit_move_insn (mem, GEN_INT (0x18ce));
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
|
mem = adjust_address (m_tramp, HImode, 2);
|
||||||
GEN_INT (0x18df));
|
emit_move_insn (mem, cxt);
|
||||||
emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
|
mem = adjust_address (m_tramp, HImode, 4);
|
||||||
|
emit_move_insn (mem, GEN_INT (0x18df));
|
||||||
|
mem = adjust_address (m_tramp, QImode, 6);
|
||||||
|
emit_move_insn (mem,
|
||||||
gen_rtx_CONST (QImode,
|
gen_rtx_CONST (QImode,
|
||||||
gen_rtx_SYMBOL_REF (Pmode,
|
gen_rtx_SYMBOL_REF (Pmode,
|
||||||
static_chain_reg)));
|
static_chain_reg)));
|
||||||
emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 7)),
|
mem = adjust_address (m_tramp, QImode, 7);
|
||||||
GEN_INT (0x7e));
|
emit_move_insn (mem, GEN_INT (0x7e));
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 8)), fnaddr);
|
mem = adjust_address (m_tramp, HImode, 8);
|
||||||
|
emit_move_insn (mem, fnaddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x1803));
|
mem = adjust_address (m_tramp, HImode, 0);
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
|
emit_move_insn (mem, GEN_INT (0x1803));
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
|
mem = adjust_address (m_tramp, HImode, 2);
|
||||||
|
emit_move_insn (mem, cxt);
|
||||||
|
mem = adjust_address (m_tramp, HImode, 4);
|
||||||
|
emit_move_insn (mem,
|
||||||
gen_rtx_CONST (HImode,
|
gen_rtx_CONST (HImode,
|
||||||
gen_rtx_SYMBOL_REF (Pmode,
|
gen_rtx_SYMBOL_REF (Pmode,
|
||||||
static_chain_reg)));
|
static_chain_reg)));
|
||||||
emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
|
mem = adjust_address (m_tramp, QImode, 6);
|
||||||
GEN_INT (0x06));
|
emit_move_insn (mem, GEN_INT (0x06));
|
||||||
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 7)), fnaddr);
|
mem = adjust_address (m_tramp, HImode, 7);
|
||||||
|
emit_move_insn (mem, fnaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1005,17 +1005,10 @@ typedef struct m68hc11_args
|
||||||
for profiling a function entry. */
|
for profiling a function entry. */
|
||||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||||
fprintf (FILE, "\tldy\t.LP%d\n\tjsr mcount\n", (LABELNO))
|
fprintf (FILE, "\tldy\t.LP%d\n\tjsr mcount\n", (LABELNO))
|
||||||
|
|
||||||
/* 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 (TARGET_M6811 ? 11 : 9)
|
#define TRAMPOLINE_SIZE (TARGET_M6811 ? 11 : 9)
|
||||||
|
|
||||||
/* A C statement to 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. */
|
|
||||||
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
|
||||||
m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
|
|
||||||
|
|
||||||
|
|
||||||
/* Addressing modes, and classification of registers for them. */
|
/* Addressing modes, and classification of registers for them. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue