aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-28 19:57:17 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-28 19:57:17 +0000
commit4c05cbb2a7e272fc046e62c19c5a1c1b17a9be05 (patch)
tree27531d3f2162a38a1ee50ce3e9eb70916df46170
parentce236858e339040a4814a70f62282ad5da7d9c34 (diff)
downloadgcc-4c05cbb2a7e272fc046e62c19c5a1c1b17a9be05.zip
gcc-4c05cbb2a7e272fc046e62c19c5a1c1b17a9be05.tar.gz
gcc-4c05cbb2a7e272fc046e62c19c5a1c1b17a9be05.tar.bz2
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
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/moxie/moxie-protos.h4
-rw-r--r--gcc/config/moxie/moxie.c28
-rw-r--r--gcc/config/moxie/moxie.h13
4 files changed, 33 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 709b364..34d3e91 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
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.
diff --git a/gcc/config/moxie/moxie-protos.h b/gcc/config/moxie/moxie-protos.h
index 3c1027b..7d939f5 100644
--- a/gcc/config/moxie/moxie-protos.h
+++ b/gcc/config/moxie/moxie-protos.h
@@ -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 */
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index cd2fb88..d2a6b66 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -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
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index 30170b4..0cfc11b 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -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 */