Commit 4c05cbb2 by Nathan Froyd Committed by Nathan Froyd

moxie-protos.h (moxie_function_arg): Delete.

	* config/moxie/moxie-protos.h (moxie_function_arg): Delete.
	* config/moxie/moxie.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
	(MOXIE_FUNCTION_ARG_SIZE): Move to...
	* config/moxie/moxie.c (MOXIE_FUNCTION_ARG_SIZE): ...here.
	(moxie_function_arg): Make static.  Take a const_tree and a bool.
	(moxie_function_arg_advance): New function.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r166037
parent ce236858
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/moxie/moxie-protos.h (moxie_function_arg): Delete.
* config/moxie/moxie.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
(MOXIE_FUNCTION_ARG_SIZE): Move to...
* config/moxie/moxie.c (MOXIE_FUNCTION_ARG_SIZE): ...here.
(moxie_function_arg): Make static. Take a const_tree and a bool.
(moxie_function_arg_advance): New function.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/mn10300/mn10300-protos.h (function_arg): Delete.
* config/mn10300/mn10300.h (FUNCTION_ARG): Delete.
(FUNCTION_ARG_ADVANCE): Delete.
......@@ -23,7 +23,3 @@ extern void moxie_expand_epilogue (void);
extern int moxie_initial_elimination_offset (int, int);
extern void moxie_print_operand (FILE *, rtx, int);
extern void moxie_print_operand_address (FILE *, rtx);
#ifdef RTX_CODE
extern rtx moxie_function_arg (CUMULATIVE_ARGS,
enum machine_mode, tree, int);
#endif /* RTX_CODE */
......@@ -409,16 +409,30 @@ moxie_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2)
/* Return the next register to be used to hold a function argument or
NULL_RTX if there's no more space. */
rtx
moxie_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
static rtx
moxie_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type ATTRIBUTE_UNUSED,
bool named ATTRIBUTE_UNUSED)
{
if (cum < 8)
return gen_rtx_REG (mode, cum);
if (*cum < 8)
return gen_rtx_REG (mode, *cum);
else
return NULL_RTX;
}
#define MOXIE_FUNCTION_ARG_SIZE(MODE, TYPE) \
((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
: (unsigned) int_size_in_bytes (TYPE))
static void
moxie_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
*cum = (*cum < MOXIE_R6
? *cum + ((3 + MOXIE_FUNCTION_ARG_SIZE (mode, type)) / 4)
: *cum);
}
/* Return non-zero if the function argument described by TYPE is to be
passed by reference. */
......@@ -539,6 +553,10 @@ moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
#define TARGET_PASS_BY_REFERENCE moxie_pass_by_reference
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES moxie_arg_partial_bytes
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG moxie_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE moxie_function_arg_advance
#undef TARGET_SETUP_INCOMING_VARARGS
......
......@@ -231,11 +231,6 @@ enum reg_class
/* Passing Arguments in Registers */
/* A C expression that controls whether a function argument is passed
in a register, and which register. */
#define FUNCTION_ARG(CUM,MODE,TYPE,NAMED) \
moxie_function_arg(CUM,MODE,TYPE,NAMED)
/* A C type for declaring a variable that is used as the first
argument of `FUNCTION_ARG' and other related values. */
#define CUMULATIVE_ARGS unsigned int
......@@ -253,14 +248,6 @@ enum reg_class
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \
(CUM = MOXIE_R0)
#define MOXIE_FUNCTION_ARG_SIZE(MODE, TYPE) \
((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
: (unsigned) int_size_in_bytes (TYPE))
#define FUNCTION_ARG_ADVANCE(CUM,MODE,TYPE,NAMED) \
(CUM = (CUM < MOXIE_R6 ? \
CUM + ((3 + MOXIE_FUNCTION_ARG_SIZE(MODE,TYPE))/4) : CUM ))
/* How Scalar Function Values Are Returned */
/* STACK AND CALLING */
......
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