+2003-10-11 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_return_in_memory): Rename from
+ return_in_memory, make static, change signature to match target hook.
+ (alpha_setup_incoming_varargs): Make static, change signature to
+ match target hook, add code for vms and unicos.
+ (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN,
+ TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX,
+ TARGET_RETURN_IN_MEMORY, TARGET_SETUP_INCOMING_VARARGS,
+ TARGET_STRICT_ARGUMENT_NAMING,
+ TARGET_PRETEND_OUTGOING_VARARGS_NAMED): New.
+ * config/alpha/alpha-protos.h: Update.
+ * config/alpha/alpha.h (PROMOTE_FUNCTION_ARGS,
+ PROMOTE_FUNCTION_RETURN, RETURN_IN_MEMORY,
+ SETUP_INCOMING_VARARGS): Remove.
+ * config/alpha/unicosmk.h (SETUP_INCOMING_VARARGS): Remove.
+ * config/alpha/vms.h (SETUP_INCOMING_VARARGS): Remove.
+
2003-10-11 Ian Lance Taylor <ian@wasabisystems.com>
* config/arm/arm.c (arm_regno_class): Handle IWMMXT_GR_REGS.
extern void alpha_initialize_trampoline (rtx, rtx, rtx, int, int, int);
extern tree alpha_build_va_list (void);
-extern void alpha_setup_incoming_varargs (CUMULATIVE_ARGS, enum machine_mode,
- tree, int *, int);
extern void alpha_va_start (tree, rtx);
extern rtx alpha_va_arg (tree, tree);
extern rtx function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int);
extern rtx function_value (tree, tree, enum machine_mode);
-extern bool return_in_memory (tree, enum machine_mode);
extern void alpha_start_function (FILE *, const char *, tree);
extern void alpha_end_function (FILE *, const char *, tree);
/* Return true if TYPE must be returned in memory, instead of in registers. */
-bool
-return_in_memory (tree type, enum machine_mode mode)
+static bool
+alpha_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
{
+ enum machine_mode mode = VOIDmode;
int size;
if (type)
enum mode_class class;
#ifdef ENABLE_CHECKING
- if (return_in_memory (valtype, mode))
+ if (alpha_return_in_memory (valtype, func))
abort ();
#endif
}
/* Perform any needed actions needed for a function that is receiving a
- variable number of arguments.
+ variable number of arguments. */
- On the Alpha, we allocate space for all 12 arg registers, but only
- push those that are remaining. However, if NO registers need to be
- saved, don't allocate any space. This is not only because we won't
- need the space, but because AP includes the current_pretend_args_size
- and we don't want to mess up any ap-relative addresses already made.
+static void
+alpha_setup_incoming_varargs (CUMULATIVE_ARGS *pcum,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size, int no_rtl)
+{
+#if TARGET_ABI_UNICOSMK
+ /* On Unicos/Mk, the standard subroutine __T3E_MISMATCH stores all register
+ arguments on the stack. Unfortunately, it doesn't always store the first
+ one (i.e. the one that arrives in $16 or $f16). This is not a problem
+ with stdargs as we always have at least one named argument there. */
+ int num_reg_words = pcum->num_reg_words;
+ if (num_reg_words < 6)
+ {
+ if (!no_rtl)
+ {
+ emit_insn (gen_umk_mismatch_args (GEN_INT (num_reg_words + 1)));
+ emit_insn (gen_arg_home_umk ());
+ }
+ *pretend_size = 0;
+ }
+#elif TARGET_ABI_OPEN_VMS
+ /* For VMS, we allocate space for all 6 arg registers plus a count.
- If we are not to use the floating-point registers, save the integer
- registers where we would put the floating-point registers. This is
- not the most efficient way to implement varargs with just one register
- class, but it isn't worth doing anything more efficient in this rare
- case. */
+ However, if NO registers need to be saved, don't allocate any space.
+ This is not only because we won't need the space, but because AP
+ includes the current_pretend_args_size and we don't want to mess up
+ any ap-relative addresses already made. */
+ if (pcum->num_args < 6)
+ {
+ if (!no_rtl)
+ {
+ emit_move_insn (gen_rtx_REG (DImode, 1), virtual_incoming_args_rtx);
+ emit_insn (gen_arg_home ());
+ }
+ *pretend_size = 7 * UNITS_PER_WORD;
+ }
+#else
+ /* On OSF/1 and friends, we allocate space for all 12 arg registers, but
+ only push those that are remaining. However, if NO registers need to
+ be saved, don't allocate any space. This is not only because we won't
+ need the space, but because AP includes the current_pretend_args_size
+ and we don't want to mess up any ap-relative addresses already made.
+
+ If we are not to use the floating-point registers, save the integer
+ registers where we would put the floating-point registers. This is
+ not the most efficient way to implement varargs with just one register
+ class, but it isn't worth doing anything more efficient in this rare
+ case. */
+ CUMULATIVE_ARGS cum = *pcum;
-#if TARGET_ABI_OSF
-void
-alpha_setup_incoming_varargs(CUMULATIVE_ARGS cum,
- enum machine_mode mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED,
- int *pretend_size, int no_rtl)
-{
if (cum >= 6)
return;
6 - cum);
}
*pretend_size = 12 * UNITS_PER_WORD;
-}
#endif
+}
void
alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG alpha_reorg
+#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_false
+#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 alpha_return_in_memory
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS alpha_setup_incoming_varargs
+#undef TARGET_STRICT_ARGUMENT_NAMING
+#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
+#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
+#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
(MODE) = DImode; \
}
-/* 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
-
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields.
#define LIBCALL_VALUE(MODE) \
function_value (NULL, NULL, MODE)
-/* The definition of this macro implies that there are cases where
- a scalar value cannot be returned in registers.
-
- For the Alpha, any structure or union type is returned in memory, as
- are integers whose size is larger than 64 bits. */
-
-#define RETURN_IN_MEMORY(TYPE) \
- return_in_memory (TYPE, VOIDmode)
-
/* 1 if N is a possible register number for a function value
as seen by the caller. */
((CUM) < 6 && 6 < (CUM) + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
? 6 - (CUM) : 0)
-/* Perform any needed actions needed for a function that is receiving a
- variable number of arguments. */
-#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
- alpha_setup_incoming_varargs(CUM,MODE,TYPE,&(PRETEND_SIZE),NO_RTL)
-
/* Try to output insns to set TARGET equal to the constant C if it can be
done in less than N insns. Do all computations in MODE. Returns the place
where the output has been placed if it can be done and the insns have been
#undef FUNCTION_ARG_PARTIAL_NREGS
/* #define FUNCTION_ARG_PARTIAL_NREGS(CUM,MODE,TYPE,NAMED) 0 */
-/* Perform any needed actions needed for a function that is receiving a
- variable number of arguments.
-
- On Unicos/Mk, the standard subroutine __T3E_MISMATCH stores all register
- arguments on the stack. Unfortunately, it doesn't always store the first
- one (i.e. the one that arrives in $16 or $f16). This is not a problem
- with stdargs as we always have at least one named argument there. */
-
-#undef SETUP_INCOMING_VARARGS
-#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
-{ if ((CUM).num_reg_words < 6) \
- { \
- if (! (NO_RTL)) \
- { \
- int start = (CUM).num_reg_words + 1; \
- \
- emit_insn (gen_umk_mismatch_args (GEN_INT (start))); \
- emit_insn (gen_arg_home_umk ()); \
- } \
- \
- PRETEND_SIZE = 0; \
- } \
-}
-
/* This ensures that $15 increments/decrements in leaf functions won't get
eliminated. */
+ ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
? 6 - (CUM).num_args : 0)
-/* Perform any needed actions needed for a function that is receiving a
- variable number of arguments.
-
- CUM is as for INIT_CUMULATIVE_ARGS.
-
- MODE and TYPE are the mode and type of the current parameter.
-
- PRETEND_SIZE is a variable that should be set to the amount of stack
- that must be pushed by the prolog to pretend that our caller pushed
- it.
-
- Normally, this macro will push all remaining incoming registers on the
- stack and set PRETEND_SIZE to the length of the registers pushed.
-
- For VMS, we allocate space for all 6 arg registers plus a count.
-
- However, if NO registers need to be saved, don't allocate any space.
- This is not only because we won't need the space, but because AP includes
- the current_pretend_args_size and we don't want to mess up any
- ap-relative addresses already made. */
-
-#undef SETUP_INCOMING_VARARGS
-#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
-{ if ((CUM).num_args < 6) \
- { \
- if (! (NO_RTL)) \
- { \
- emit_move_insn (gen_rtx_REG (DImode, 1), \
- virtual_incoming_args_rtx); \
- emit_insn (gen_arg_home ()); \
- } \
- \
- PRETEND_SIZE = 7 * UNITS_PER_WORD; \
- } \
-}
-
/* ABI has stack checking, but it's broken. */
#undef STACK_CHECK_BUILTIN
#define STACK_CHECK_BUILTIN 0