aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog23
-rw-r--r--gcc/config/mips/mips-protos.h3
-rw-r--r--gcc/config/mips/mips.c54
-rw-r--r--gcc/config/mips/mips.h24
4 files changed, 65 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fd6e414..816043b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,28 @@
2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
+ * config/mips/mips-protos.h: Remove the prototypes for
+ mips_setup_incoming_varargs and mips_return_in_memory.
+ * config/mips/mips.c (TARGET_PROMOTE_FUNCTION_ARGS): New.
+ (TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
+ (TARGET_PROMOTE_PROTOTYPES): Likewise.
+ (TARGET_STRUCT_VALUE_RTX): Likewise.
+ (TARGET_RETURN_IN_MEMORY): Likewise.
+ (TARGET_SETUP_INCOMING_VARARGS): Likewise.
+ (TARGET_STRICT_ARGUMENT_NAMING): Likewise.
+ (mips_setup_incoming_varargs): Match the prototype for
+ TARGET_SETUP_INCOMING_VARARGS.
+ (mips_return_in_memory): Make it static. Add argument fntype.
+ (mips_strict_argument_naming): New.
+ * config/mips/mips.h (PROMOTE_PROTOTYPES): Remove.
+ (PROMOTE_FUNCTION_ARGS): Likewise.
+ (PROMOTE_FUNCTION_RETURN): Likewise.
+ (STRUCT_VALUE): Likewise.
+ (RETURN_IN_MEMORY): Likewise.
+ (SETUP_INCOMING_VARARGS): Likewise.
+ (STRICT_ARGUMENT_NAMING): Likewise.
+
+2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
* config/ip2k/ip2k.c (TARGET_STRUCT_VALUE_RTX): New.
(TARGET_RETURN_IN_MEMORY): Likewise.
(TARGET_SETUP_INCOMING_VARARGS): Likewise.
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index dfc1467..5c0081f 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -83,8 +83,6 @@ extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
extern bool mips_pad_arg_upward (enum machine_mode, tree);
extern bool mips_pad_reg_upward (enum machine_mode, tree);
-extern int mips_setup_incoming_varargs (const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
extern void mips_va_start (tree, rtx);
extern struct rtx_def *mips_va_arg (tree, tree);
@@ -141,7 +139,6 @@ extern const char *mips_output_conditional_branch (rtx, rtx *, int, int,
int, int);
extern const char *mips_output_division (const char *, rtx *);
extern unsigned int mips_hard_regno_nregs (int, enum machine_mode);
-extern int mips_return_in_memory (tree);
extern const char *mips_emit_prefetch (rtx *);
extern void irix_asm_output_align (FILE *, unsigned);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index d7bec70..1c87e11 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -279,9 +279,13 @@ static bool mips_matching_cpu_name_p (const char *, const char *);
static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
static int mips_adjust_cost (rtx, rtx, rtx, int);
+static bool mips_return_in_memory (tree, tree);
+static bool mips_strict_argument_naming (CUMULATIVE_ARGS *);
static int mips_issue_rate (void);
static int mips_use_dfa_pipeline_interface (void);
static void mips_init_libfuncs (void);
+static void mips_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int *, int);
static tree mips_build_builtin_va_list (void);
#if TARGET_IRIX
@@ -795,6 +799,18 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST mips_build_builtin_va_list
+
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY mips_return_in_memory
#undef TARGET_RETURN_IN_MSB
#define TARGET_RETURN_IN_MSB mips_return_in_msb
@@ -803,6 +819,11 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS mips_setup_incoming_varargs
+#undef TARGET_STRICT_ARGUMENT_NAMING
+#define TARGET_STRICT_ARGUMENT_NAMING mips_strict_argument_naming
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */
@@ -3885,9 +3906,9 @@ mips_pad_reg_upward (enum machine_mode mode, tree type)
return mips_pad_arg_upward (mode, type);
}
-int
-mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum,
- enum machine_mode mode, tree type, int no_rtl)
+static void
+mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int *pretend_size, int no_rtl)
{
CUMULATIVE_ARGS local_cum;
int gp_saved, fp_saved;
@@ -3958,10 +3979,13 @@ mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum,
}
}
if (mips_abi == ABI_32 || mips_abi == ABI_O64)
- /* No need for pretend arguments: the register parameter area was
- allocated by the caller. */
- return 0;
- return (gp_saved * UNITS_PER_WORD) + (fp_saved * UNITS_PER_FPREG);
+ {
+ /* No need for pretend arguments: the register parameter area was
+ allocated by the caller. */
+ *pretend_size = 0;
+ return;
+ }
+ *pretend_size = (gp_saved * UNITS_PER_WORD) + (fp_saved * UNITS_PER_FPREG);
}
/* Create the va_list data type.
@@ -7466,8 +7490,8 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
mode = TYPE_MODE (valtype);
unsignedp = TREE_UNSIGNED (valtype);
- /* Since we define PROMOTE_FUNCTION_RETURN, we must promote
- the mode just as PROMOTE_MODE does. */
+ /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns
+ true, we must promote the mode just as PROMOTE_MODE does. */
mode = promote_mode (valtype, mode, &unsignedp, 1);
/* Handle structures whose fields are returned in $f0/$f2. */
@@ -9517,14 +9541,14 @@ mips_hard_regno_nregs (int regno, enum machine_mode mode)
return ((GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG);
}
-/* Implement RETURN_IN_MEMORY. Under the old (i.e., 32 and O64 ABIs)
+/* Implement TARGET_RETURN_IN_MEMORY. Under the old (i.e., 32 and O64 ABIs)
all BLKmode objects are returned in memory. Under the new (N32 and
64-bit MIPS ABIs) small structures are returned in a register.
Objects with varying size must still be returned in memory, of
course. */
-int
-mips_return_in_memory (tree type)
+static bool
+mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
{
if (mips_abi == ABI_32 || mips_abi == ABI_O64)
return (TYPE_MODE (type) == BLKmode);
@@ -9533,6 +9557,12 @@ mips_return_in_memory (tree type)
|| (int_size_in_bytes (type) == -1));
}
+static bool
+mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
+{
+ return (mips_abi != ABI_32 && mips_abi != ABI_O64);
+}
+
static int
mips_issue_rate (void)
{
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 74b8c54..ae1f55f 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1424,10 +1424,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#define PAD_VARARGS_DOWN \
(FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)
-/* Arguments declared as 'char' or 'short' in a prototype should be
- passed as 'int's. */
-#define PROMOTE_PROTOTYPES 1
-
/* Define if operations between registers always perform the operation
on the full register even if a narrower mode is specified. */
#define WORD_REGISTER_OPERATIONS
@@ -1455,15 +1451,6 @@ extern const struct mips_cpu_info *mips_tune_info;
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
-
-
-/* Define this if function arguments should also be promoted using the above
- procedure. */
-#define PROMOTE_FUNCTION_ARGS
-
-/* Likewise, if the function return value is promoted. */
-#define PROMOTE_FUNCTION_RETURN
-
/* Standard register usage. */
@@ -1683,9 +1670,6 @@ extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)
-/* Pass structure addresses as an "invisible" first argument. */
-#define STRUCT_VALUE 0
-
/* Registers used as temporaries in prologue/epilogue code. If we're
generating mips16 code, these registers must come from the core set
of 8. The prologue register mustn't conflict with any incoming
@@ -2225,15 +2209,7 @@ extern enum reg_class mips_char_to_class[256];
|| (IN_RANGE((N), FP_ARG_FIRST, FP_ARG_LAST) \
&& ((N) % FP_INC == 0) && mips_abi != ABI_O64)) \
&& !fixed_regs[N])
-
-#define RETURN_IN_MEMORY(TYPE) mips_return_in_memory (TYPE)
-
-#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
- (PRETEND_SIZE) = mips_setup_incoming_varargs (&(CUM), (MODE), \
- (TYPE), (NO_RTL))
-#define STRICT_ARGUMENT_NAMING (mips_abi != ABI_32 && mips_abi != ABI_O64)
-
/* This structure has to cope with two different argument allocation
schemes. Most MIPS ABIs view the arguments as a struct, of which the
first N words go in registers and the rest go on the stack. If I < N,