+2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/stormy16/stormy16-protos.h: Remove the prototype for
+ xstormy16_setup_incoming_varargs.
+ * config/stormy16/stormy16.c
+ (xstormy16_setup_incoming_varargs): Remove.
+ (xstormy16_return_in_memory): New.
+ (TARGET_PROMOTE_FUNCTION_ARGS): Likewise.
+ (TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
+ (TARGET_PROMOTE_PROTOTYPES): Likewise.
+ (TARGET_STRUCT_VALUE_RTX): Likewise.
+ (TARGET_RETURN_IN_MEMORY): Likewise.
+ * config/stormy16/stormy16.h (PROMOTE_FUNCTION_ARGS): Remove.
+ (PROMOTE_FUNCTION_RETURN): Likewise
+ (PROMOTE_PROTOTYPES): Likewise
+ (RETURN_IN_MEMORY): Likewise
+ (STRUCT_VALUE): Likewise
+ (SETUP_INCOMING_VARARGS): Likewise
+
2004-01-25 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_offset_within_object_p): New function.
/* Prototypes for exported functions defined in xstormy16.c
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
extern int xstormy16_epilogue_uses (int);
extern void xstormy16_function_profiler (void);
-#if defined (TREE_CODE)
-# if defined (HAVE_MACHINE_MODES)
+#if defined (TREE_CODE) && defined (HAVE_MACHINE_MODES)
extern CUMULATIVE_ARGS xstormy16_function_arg_advance
(CUMULATIVE_ARGS, enum machine_mode, tree, int);
extern rtx xstormy16_function_arg
(CUMULATIVE_ARGS, enum machine_mode, tree, int);
-# endif
-extern void xstormy16_setup_incoming_varargs
- (CUMULATIVE_ARGS, int, tree, int *);
#endif
#if defined (TREE_CODE) && defined (RTX_CODE)
/* Xstormy16 target functions.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
static rtx xstormy16_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static bool xstormy16_rtx_costs (rtx, int, int, int *);
static int xstormy16_address_cost (rtx);
+static bool xstormy16_return_in_memory (tree, tree);
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. */
return gen_rtx_REG (mode, cum + 2);
}
-/* Do any needed setup for a variadic function. CUM has not been updated
- for the last named argument which has type TYPE and mode MODE. */
-void
-xstormy16_setup_incoming_varargs (CUMULATIVE_ARGS cum ATTRIBUTE_UNUSED,
- int int_mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED,
- int *pretend_size ATTRIBUTE_UNUSED)
-{
-}
-
/* Build the va_list type.
For this chip, va_list is a record containing a counter and a pointer.
relevant. (Actually, on most machines, scalar values are returned
in the same place regardless of mode).
- If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
- rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
+ If `TARGET_PROMOTE_FUNCTION_RETURN' is defined to return true, you
+ must apply the same promotion rules specified in `PROMOTE_MODE' if
+ VALTYPE is a scalar type.
If the precise function being called is known, FUNC is a tree node
(`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
return retval;
}
-
+\f
+static bool
+xstormy16_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+ return int_size_in_bytes (type) > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS;
+}
\f
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
#undef TARGET_BUILD_BUILTIN_VA_LIST_TYPE
#define TARGET_BUILD_BUILTIN_VA_LIST_TYPE xstormy16_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 xstormy16_return_in_memory
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Xstormy16 cpu description.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
(MODE) = HImode; \
} while (0)
-#define PROMOTE_FUNCTION_ARGS 1
-
-#define PROMOTE_FUNCTION_RETURN 1
-
#define PARM_BOUNDARY 16
#define STACK_BOUNDARY 16
\f
/* Passing Function Arguments on the Stack */
-#define PROMOTE_PROTOTYPES 1
-
#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
-\f
-/* How Large Values are Returned */
-
-#define RETURN_IN_MEMORY(TYPE) \
- (int_size_in_bytes (TYPE) > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS)
-
-#define STRUCT_VALUE 0
-
\f
/* Function Entry and Exit */
\f
/* Implementing the Varargs Macros. */
-#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
- if (! SECOND_TIME) \
- xstormy16_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE)
-
/* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
variable to initialize. NEXTARG is the machine independent notion of the