Commit 925ed112 by Nathan Froyd Committed by Nathan Froyd

spu-protos.h (spu_function_arg): Delete.

	* config/spu/spu-protos.h (spu_function_arg): Delete.
	* config/spu/spu.h (FUNCTION_ARG): Delete.
	(FUNCTION_ARG_ADVANCE): Move code to ...
	* config/spu/spu.c (spu_function_arg_advance): New function.
	(spu_function_arg): Make static.  Take a const_tree and a bool.
	(spu_setup_incoming_varargs): Call spu_function_arg_advance.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r165179
parent 9ad6bebe
2010-10-08 Nathan Froyd <froydnj@codesourcery.com> 2010-10-08 Nathan Froyd <froydnj@codesourcery.com>
* config/spu/spu-protos.h (spu_function_arg): Delete.
* config/spu/spu.h (FUNCTION_ARG): Delete.
(FUNCTION_ARG_ADVANCE): Move code to ...
* config/spu/spu.c (spu_function_arg_advance): New function.
(spu_function_arg): Make static. Take a const_tree and a bool.
(spu_setup_incoming_varargs): Call spu_function_arg_advance.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-10-08 Nathan Froyd <froydnj@codesourcery.com>
* config/rx/rx.c (TARGET_EXCEPT_UNWIND_INFO): Define.
2010-10-08 Nathan Froyd <froydnj@codesourcery.com>
* tree-ssa-sccvn.c (init_vn_nary_op_from_pieces): New function. * tree-ssa-sccvn.c (init_vn_nary_op_from_pieces): New function.
(init_vn_nary_op_from_op): New function. (init_vn_nary_op_from_op): New function.
(init_vn_nary_op_from_stmt): New function. (init_vn_nary_op_from_stmt): New function.
...@@ -55,8 +55,6 @@ extern int spu_constant_address_p (rtx x); ...@@ -55,8 +55,6 @@ extern int spu_constant_address_p (rtx x);
extern int spu_legitimate_constant_p (rtx x); extern int spu_legitimate_constant_p (rtx x);
extern int spu_initial_elimination_offset (int from, int to); extern int spu_initial_elimination_offset (int from, int to);
extern rtx spu_function_value (const_tree type, const_tree func); extern rtx spu_function_value (const_tree type, const_tree func);
extern rtx spu_function_arg (int cum, enum machine_mode mode, tree type,
int named);
extern void spu_setup_incoming_varargs (int *cum, enum machine_mode mode, extern void spu_setup_incoming_varargs (int *cum, enum machine_mode mode,
tree type, int *pretend_size, tree type, int *pretend_size,
int no_rtl); int no_rtl);
......
...@@ -190,6 +190,10 @@ static tree spu_handle_vector_attribute (tree * node, tree name, tree args, ...@@ -190,6 +190,10 @@ static tree spu_handle_vector_attribute (tree * node, tree name, tree args,
static int spu_naked_function_p (tree func); static int spu_naked_function_p (tree func);
static bool spu_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode, static bool spu_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named); const_tree type, bool named);
static rtx spu_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named);
static void spu_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named);
static tree spu_build_builtin_va_list (void); static tree spu_build_builtin_va_list (void);
static void spu_va_start (tree, rtx); static void spu_va_start (tree, rtx);
static tree spu_gimplify_va_arg_expr (tree valist, tree type, static tree spu_gimplify_va_arg_expr (tree valist, tree type,
...@@ -391,6 +395,12 @@ static const struct attribute_spec spu_attribute_table[] = ...@@ -391,6 +395,12 @@ static const struct attribute_spec spu_attribute_table[] =
#undef TARGET_PASS_BY_REFERENCE #undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE spu_pass_by_reference #define TARGET_PASS_BY_REFERENCE spu_pass_by_reference
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG spu_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE spu_function_arg_advance
#undef TARGET_MUST_PASS_IN_STACK #undef TARGET_MUST_PASS_IN_STACK
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size #define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
...@@ -3994,10 +4004,10 @@ spu_function_value (const_tree type, const_tree func ATTRIBUTE_UNUSED) ...@@ -3994,10 +4004,10 @@ spu_function_value (const_tree type, const_tree func ATTRIBUTE_UNUSED)
return gen_rtx_REG (mode, FIRST_RETURN_REGNUM); return gen_rtx_REG (mode, FIRST_RETURN_REGNUM);
} }
rtx static rtx
spu_function_arg (CUMULATIVE_ARGS cum, spu_function_arg (CUMULATIVE_ARGS *cum,
enum machine_mode mode, enum machine_mode mode,
tree type, int named ATTRIBUTE_UNUSED) const_tree type, bool named ATTRIBUTE_UNUSED)
{ {
int byte_size; int byte_size;
...@@ -4030,6 +4040,19 @@ spu_function_arg (CUMULATIVE_ARGS cum, ...@@ -4030,6 +4040,19 @@ spu_function_arg (CUMULATIVE_ARGS cum,
return gen_rtx_REG (mode, FIRST_ARG_REGNUM + cum); return gen_rtx_REG (mode, FIRST_ARG_REGNUM + cum);
} }
static void
spu_function_arg_advance (CUMULATIVE_ARGS * cum, enum machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
*cum += (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
? 1
: mode == BLKmode
? ((int_size_in_bytes (type) + 15) / 16)
: mode == VOIDmode
? 1
: HARD_REGNO_NREGS (cum, mode));
}
/* Variable sized types are passed by reference. */ /* Variable sized types are passed by reference. */
static bool static bool
spu_pass_by_reference (CUMULATIVE_ARGS * cum ATTRIBUTE_UNUSED, spu_pass_by_reference (CUMULATIVE_ARGS * cum ATTRIBUTE_UNUSED,
...@@ -4238,7 +4261,7 @@ spu_setup_incoming_varargs (CUMULATIVE_ARGS * cum, enum machine_mode mode, ...@@ -4238,7 +4261,7 @@ spu_setup_incoming_varargs (CUMULATIVE_ARGS * cum, enum machine_mode mode,
/* cum currently points to the last named argument, we want to /* cum currently points to the last named argument, we want to
start at the next argument. */ start at the next argument. */
FUNCTION_ARG_ADVANCE (ncum, mode, type, 1); spu_function_arg_advance (&ncum, mode, type, true);
offset = -STACK_POINTER_OFFSET; offset = -STACK_POINTER_OFFSET;
for (regno = ncum; regno < MAX_REGISTER_ARGS; regno++) for (regno = ncum; regno < MAX_REGISTER_ARGS; regno++)
......
...@@ -330,22 +330,11 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \ ...@@ -330,22 +330,11 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
/* Register Arguments */ /* Register Arguments */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
(spu_function_arg((CUM),(MODE),(TYPE),(NAMED)))
#define CUMULATIVE_ARGS int #define CUMULATIVE_ARGS int
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \ #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \
((CUM) = 0) ((CUM) = 0)
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
((CUM) += \
(TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST ? 1 \
: (MODE) == BLKmode ? ((int_size_in_bytes(TYPE)+15) / 16) \
: (MODE) == VOIDmode ? 1 \
: HARD_REGNO_NREGS(CUM,MODE))
/* The SPU ABI wants 32/64-bit types at offset 0 in the quad-word on the /* The SPU ABI wants 32/64-bit types at offset 0 in the quad-word on the
stack. 8/16-bit types should be at offsets 3/2 respectively. */ stack. 8/16-bit types should be at offsets 3/2 respectively. */
#define FUNCTION_ARG_OFFSET(MODE, TYPE) \ #define FUNCTION_ARG_OFFSET(MODE, TYPE) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment