summaryrefslogtreecommitdiff
path: root/gcc/config/picochip
diff options
context:
space:
mode:
authorHariharan Sandanagobalane <hariharan@picochip.com>2010-10-11 14:52:16 +0000
committerHariharan Sandanagobalane <hariharans@gcc.gnu.org>2010-10-11 14:52:16 +0000
commitc159751bf52d6bac1c1dfef02498bf1a32f24278 (patch)
tree4060108aecc74fcd2fd6b036389408eef48a3810 /gcc/config/picochip
parent3414bf53840cbfaedf6c4b8ac4ff6a751e491a50 (diff)
downloadgcc-c159751bf52d6bac1c1dfef02498bf1a32f24278.tar.gz
picochip-protos.h (picochip_function_arg): Delete.
* config/picochip/picochip-protos.h (picochip_function_arg): Delete. (picochip_incoming_function_arg): Delete. (picochip_arg_advance): Delete. * config/picochip/picochip.h (FUNCTION_ARG): Delete. (FUNCTION_INCOMING_ARG): Delete. (FUNCTION_ARG_ADVANCE): Delete. * config/picochip/picochip.c (picochip_function_arg): Take a const_tree and a bool. (picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_INCOMING_ARG): Define. (TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r165312
Diffstat (limited to 'gcc/config/picochip')
-rw-r--r--gcc/config/picochip/picochip-protos.h7
-rw-r--r--gcc/config/picochip/picochip.c63
-rw-r--r--gcc/config/picochip/picochip.h13
3 files changed, 37 insertions, 46 deletions
diff --git a/gcc/config/picochip/picochip-protos.h b/gcc/config/picochip/picochip-protos.h
index 4acfdb0520e..b3755a63624 100644
--- a/gcc/config/picochip/picochip-protos.h
+++ b/gcc/config/picochip/picochip-protos.h
@@ -54,13 +54,6 @@ extern bool ok_to_peephole_ldw(rtx opnd0, rtx opnd1, rtx opnd2, rtx opnd3);
extern rtx gen_min_reg(rtx opnd1,rtx opnd2);
-extern rtx picochip_function_arg (CUMULATIVE_ARGS cum, int mode, tree type,
- int named);
-
-extern rtx picochip_incoming_function_arg (CUMULATIVE_ARGS, int, tree, int);
-extern CUMULATIVE_ARGS picochip_arg_advance (CUMULATIVE_ARGS cum, int mode,
- tree type, int named);
-
extern int picochip_regno_nregs (int regno, int mode);
extern int picochip_class_max_nregs (int klass, int mode);
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index b3b3e3bff84..8c6b294070b 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -81,6 +81,14 @@ void picochip_reorg (void);
int picochip_arg_partial_bytes (CUMULATIVE_ARGS * p_cum,
enum machine_mode mode,
tree type, bool named);
+rtx picochip_function_arg (CUMULATIVE_ARGS * p_cum,
+ enum machine_mode mode,
+ const_tree type, bool named);
+rtx picochip_incoming_function_arg (CUMULATIVE_ARGS * p_cum,
+ enum machine_mode mode,
+ const_tree type, bool named);
+void picochip_arg_advance (CUMULATIVE_ARGS * p_cum, enum machine_mode mode,
+ const_tree type, bool named);
int picochip_sched_lookahead (void);
int picochip_sched_issue_rate (void);
@@ -262,6 +270,15 @@ static char picochip_get_vliw_alu_id (void);
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES picochip_arg_partial_bytes
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG picochip_function_arg
+
+#undef TARGET_FUNCTION_INCOMING_ARG
+#define TARGET_FUNCTION_INCOMING_ARG picochip_incoming_function_arg
+
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE picochip_arg_advance
+
#undef TARGET_PROMOTE_FUNCTION_MODE
#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote
#undef TARGET_PROMOTE_PROTOTYPES
@@ -315,12 +332,6 @@ static char picochip_get_vliw_alu_id (void);
struct gcc_target targetm = TARGET_INITIALIZER;
-enum unwind_info_type
-picochip_except_unwind_info (void)
-{
- return UI_NONE;
-}
-
/* Only return a value in memory if it is greater than 4 bytes.
int_size_in_bytes returns -1 for variable size objects, which go in
memory always. The cast to unsigned makes -1 > 8. */
@@ -799,7 +810,7 @@ picochip_is_aligned (int byte_offset, int bit_alignment)
/* Compute the size of an argument in units. */
static int
-picochip_compute_arg_size (tree type, enum machine_mode mode)
+picochip_compute_arg_size (const_tree type, enum machine_mode mode)
{
int type_size_in_units = 0;
@@ -814,8 +825,8 @@ picochip_compute_arg_size (tree type, enum machine_mode mode)
/* Determine where the next outgoing arg should be placed. */
rtx
-picochip_function_arg (CUMULATIVE_ARGS cum, int mode, tree type,
- int named ATTRIBUTE_UNUSED)
+picochip_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
int reg = 0;
int type_align_in_units = 0;
@@ -835,17 +846,17 @@ picochip_function_arg (CUMULATIVE_ARGS cum, int mode, tree type,
/* Compute the correct offset (i.e., ensure that the offset meets
the alignment requirements). */
- offset_overflow = cum % type_align_in_units;
+ offset_overflow = *cum % type_align_in_units;
if (offset_overflow == 0)
- new_offset = cum;
+ new_offset = *cum;
else
- new_offset = (cum - offset_overflow) + type_align_in_units;
+ new_offset = (*cum - offset_overflow) + type_align_in_units;
if (TARGET_DEBUG)
{
printf ("Function arg:\n");
printf (" Type valid: %s\n", (type ? "yes" : "no"));
- printf (" Cumulative Value: %d\n", cum);
+ printf (" Cumulative Value: %d\n", *cum);
printf (" Mode: %s\n", GET_MODE_NAME (mode));
printf (" Type size: %i units\n", type_size_in_units);
printf (" Alignment: %i units\n", type_align_in_units);
@@ -879,7 +890,7 @@ picochip_function_arg (CUMULATIVE_ARGS cum, int mode, tree type,
case CSImode:
case SCmode:
case CQImode:
- return gen_rtx_REG ((enum machine_mode) mode, reg);
+ return gen_rtx_REG (mode, reg);
case BLKmode:
{
@@ -912,8 +923,9 @@ picochip_function_arg (CUMULATIVE_ARGS cum, int mode, tree type,
passed in registers, which are then pushed onto the stack by the
function prologue). */
rtx
-picochip_incoming_function_arg (CUMULATIVE_ARGS cum, int mode,
- tree type, int named)
+picochip_incoming_function_arg (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ const_tree type, bool named)
{
if (cfun->stdarg)
@@ -998,10 +1010,10 @@ picochip_arg_partial_bytes (CUMULATIVE_ARGS * p_cum, enum machine_mode mode,
}
-/* Advance the cumulative args counter, returning the new counter. */
-CUMULATIVE_ARGS
-picochip_arg_advance (const CUMULATIVE_ARGS cum, int mode,
- tree type, int named ATTRIBUTE_UNUSED)
+/* Advance the cumulative args counter CUM. */
+void
+picochip_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
int type_align_in_units = 0;
int type_size_in_units;
@@ -1011,7 +1023,7 @@ picochip_arg_advance (const CUMULATIVE_ARGS cum, int mode,
/* VOIDmode is passed when computing the second argument to a `call'
pattern. This can be ignored. */
if (mode == VOIDmode)
- return 0;
+ return;
/* Compute the alignment and size of the parameter. */
type_align_in_units =
@@ -1020,17 +1032,16 @@ picochip_arg_advance (const CUMULATIVE_ARGS cum, int mode,
/* Compute the correct offset (i.e., ensure that the offset meets
the alignment requirements). */
- offset_overflow = cum % type_align_in_units;
+ offset_overflow = *cum % type_align_in_units;
if (offset_overflow == 0)
- new_offset = cum;
+ new_offset = *cum;
else
- new_offset = (cum - offset_overflow) + type_align_in_units;
+ new_offset = (*cum - offset_overflow) + type_align_in_units;
/* Advance past the last argument. */
new_offset += type_size_in_units;
- return new_offset;
-
+ *cum = new_offset;
}
/* Determine whether a register needs saving/restoring. It does if it
diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h
index cf81f59bb53..61571d6e07c 100644
--- a/gcc/config/picochip/picochip.h
+++ b/gcc/config/picochip/picochip.h
@@ -405,22 +405,9 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Store the offset of the next argument. */
#define CUMULATIVE_ARGS unsigned
-/* Decide how function arguments are handled. */
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- picochip_function_arg (CUM, MODE, TYPE, NAMED)
-
-/* Incoming arguments are always the same as normal arguments, except
- for a function which uses variadic arguments, in which case all
- arguments are effectively passed on the stack. */
-#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
- picochip_incoming_function_arg(CUM, MODE, TYPE, NAMED)
-
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
((CUM) = 0)
-#define FUNCTION_ARG_ADVANCE(CUM,MODE,TYPE,NAMED) \
- (CUM) = picochip_arg_advance (CUM, MODE, TYPE, NAMED)
-
/* Originally this used TYPE_ALIGN to determine the
alignment. Unfortunately, this fails in some cases, because the
type is unknown (e.g., libcall's). Instead, use GET_MODE_ALIGNMENT