Commit b60613c3 by Nathan Froyd Committed by Nathan Froyd

fr30-protos.h (fr30_num_arg_regs): Delete.

	* config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete.
	* config/fr30/fr30.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
	* config/fr30/fr30.c (fr30_num_arg_regs): Make static.  Take a
	const_tree.
	(fr30_function_arg): New function.
	(fr30_function_arg_advance): New function.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r166034
parent 88a1f47f
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete.
* config/fr30/fr30.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/fr30/fr30.c (fr30_num_arg_regs): Make static. Take a
const_tree.
(fr30_function_arg): New function.
(fr30_function_arg_advance): New function.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/frv/frv-protos.h (frv_function_arg): Delete.
(frv_function_arg_advance): Delete.
* config/frv/frv.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
......@@ -26,9 +26,6 @@ extern int fr30_check_multiple_regs (rtx *, int, int);
extern void fr30_print_operand (FILE *, rtx, int);
extern void fr30_print_operand_address (FILE *, rtx);
extern rtx fr30_move_double (rtx *);
#ifdef TREE_CODE
extern int fr30_num_arg_regs (enum machine_mode, tree);
#endif /* TREE_CODE */
#ifdef HAVE_MACHINE_MODES
#define Mmode enum machine_mode
extern int fr30_const_double_is_zero (rtx);
......
......@@ -119,10 +119,15 @@ static void fr30_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
static bool fr30_must_pass_in_stack (enum machine_mode, const_tree);
static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static rtx fr30_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static void fr30_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static bool fr30_frame_pointer_required (void);
static bool fr30_can_eliminate (const int, const int);
static void fr30_asm_trampoline_template (FILE *);
static void fr30_trampoline_init (rtx, tree, rtx);
static int fr30_num_arg_regs (enum machine_mode, const_tree);
#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
#define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM))
......@@ -162,6 +167,10 @@ static const struct default_options fr30_option_optimization_table[] =
#define TARGET_PASS_BY_REFERENCE hook_pass_by_reference_must_pass_in_stack
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES fr30_arg_partial_bytes
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG fr30_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE fr30_function_arg_advance
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS fr30_setup_incoming_varargs
......@@ -711,8 +720,8 @@ fr30_must_pass_in_stack (enum machine_mode mode, const_tree type)
/* Compute the number of word sized registers needed to hold a
function argument of mode INT_MODE and tree type TYPE. */
int
fr30_num_arg_regs (enum machine_mode mode, tree type)
static int
fr30_num_arg_regs (enum machine_mode mode, const_tree type)
{
int size;
......@@ -756,6 +765,33 @@ fr30_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return (FR30_NUM_ARG_REGS - *cum) * UNITS_PER_WORD;
}
static rtx
fr30_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named)
{
if (!named
|| fr30_must_pass_in_stack (mode, type)
|| *cum >= FR30_NUM_ARG_REGS)
return NULL_RTX;
else
return gen_rtx_REG (mode, *cum + FIRST_ARG_REGNUM);
}
/* A C statement (sans semicolon) to update the summarizer variable CUM to
advance past an argument in the argument list. The values MODE, TYPE and
NAMED describe that argument. Once this is done, the variable CUM is
suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
This macro need not do anything if the argument in question was passed on
the stack. The compiler knows how to track the amount of stack space used
for arguments without any special help. */
static void
fr30_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named)
{
*cum += named * fr30_num_arg_regs (mode, type);
}
/*}}}*/
/*{{{ Operand predicates */
......
......@@ -555,12 +555,6 @@ enum reg_class
#define FR30_NUM_ARG_REGS 4
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
( (NAMED) == 0 ? NULL_RTX \
: targetm.calls.must_pass_in_stack (MODE, TYPE) ? NULL_RTX \
: (CUM) >= FR30_NUM_ARG_REGS ? NULL_RTX \
: gen_rtx_REG (MODE, CUM + FIRST_ARG_REGNUM))
/* A C type for declaring a variable that is used as the first argument of
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far.
......@@ -594,17 +588,6 @@ enum reg_class
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
(CUM) = 0
/* A C statement (sans semicolon) to update the summarizer variable CUM to
advance past an argument in the argument list. The values MODE, TYPE and
NAMED describe that argument. Once this is done, the variable CUM is
suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
This macro need not do anything if the argument in question was passed on
the stack. The compiler knows how to track the amount of stack space used
for arguments without any special help. */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
(CUM) += (NAMED) * fr30_num_arg_regs (MODE, TYPE)
/* A C expression that is nonzero if REGNO is the number of a hard register in
which function arguments are sometimes passed. This does *not* include
implicit arguments such as the static chain and the structure-value address.
......
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