diff options
author | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-28 19:51:34 +0000 |
---|---|---|
committer | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-28 19:51:34 +0000 |
commit | d7ef99d4736e30f0e23bdeeff6c7ced5bd58d783 (patch) | |
tree | 33ce75b014a5ad1ad390bfc2c63af0beb3012939 /gcc/config/fr30 | |
parent | 6a16a3b19bf552f3fca911688143c6db636ded1f (diff) | |
download | gcc-d7ef99d4736e30f0e23bdeeff6c7ced5bd58d783.tar.gz |
* config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete.
* config/fr30/fr30.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/fr30/fr30.c (fr30_num_arg_regs): Make static. Take a
const_tree.
(fr30_function_arg): New function.
(fr30_function_arg_advance): New function.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/fr30')
-rw-r--r-- | gcc/config/fr30/fr30-protos.h | 3 | ||||
-rw-r--r-- | gcc/config/fr30/fr30.c | 40 | ||||
-rw-r--r-- | gcc/config/fr30/fr30.h | 17 |
3 files changed, 38 insertions, 22 deletions
diff --git a/gcc/config/fr30/fr30-protos.h b/gcc/config/fr30/fr30-protos.h index 0ea28a3c798..37fc2a2d2c5 100644 --- a/gcc/config/fr30/fr30-protos.h +++ b/gcc/config/fr30/fr30-protos.h @@ -26,9 +26,6 @@ extern int fr30_check_multiple_regs (rtx *, int, int); extern void fr30_print_operand (FILE *, rtx, int); extern void fr30_print_operand_address (FILE *, rtx); extern rtx fr30_move_double (rtx *); -#ifdef TREE_CODE -extern int fr30_num_arg_regs (enum machine_mode, tree); -#endif /* TREE_CODE */ #ifdef HAVE_MACHINE_MODES #define Mmode enum machine_mode extern int fr30_const_double_is_zero (rtx); diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 04e90f23fc2..95bbd61d260 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -119,10 +119,15 @@ static void fr30_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, static bool fr30_must_pass_in_stack (enum machine_mode, const_tree); static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +static rtx fr30_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static void fr30_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static bool fr30_frame_pointer_required (void); static bool fr30_can_eliminate (const int, const int); static void fr30_asm_trampoline_template (FILE *); static void fr30_trampoline_init (rtx, tree, rtx); +static int fr30_num_arg_regs (enum machine_mode, const_tree); #define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM)) #define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM)) @@ -162,6 +167,10 @@ static const struct default_options fr30_option_optimization_table[] = #define TARGET_PASS_BY_REFERENCE hook_pass_by_reference_must_pass_in_stack #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES fr30_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG fr30_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE fr30_function_arg_advance #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS fr30_setup_incoming_varargs @@ -711,8 +720,8 @@ fr30_must_pass_in_stack (enum machine_mode mode, const_tree type) /* Compute the number of word sized registers needed to hold a function argument of mode INT_MODE and tree type TYPE. */ -int -fr30_num_arg_regs (enum machine_mode mode, tree type) +static int +fr30_num_arg_regs (enum machine_mode mode, const_tree type) { int size; @@ -756,6 +765,33 @@ fr30_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, return (FR30_NUM_ARG_REGS - *cum) * UNITS_PER_WORD; } +static rtx +fr30_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named) +{ + if (!named + || fr30_must_pass_in_stack (mode, type) + || *cum >= FR30_NUM_ARG_REGS) + return NULL_RTX; + else + return gen_rtx_REG (mode, *cum + FIRST_ARG_REGNUM); +} + +/* A C statement (sans semicolon) to update the summarizer variable CUM to + advance past an argument in the argument list. The values MODE, TYPE and + NAMED describe that argument. Once this is done, the variable CUM is + suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. + + This macro need not do anything if the argument in question was passed on + the stack. The compiler knows how to track the amount of stack space used + for arguments without any special help. */ +static void +fr30_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named) +{ + *cum += named * fr30_num_arg_regs (mode, type); +} + /*}}}*/ /*{{{ Operand predicates */ diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h index c5c405c159f..0ea72fd8c7c 100644 --- a/gcc/config/fr30/fr30.h +++ b/gcc/config/fr30/fr30.h @@ -555,12 +555,6 @@ enum reg_class #define FR30_NUM_ARG_REGS 4 -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - ( (NAMED) == 0 ? NULL_RTX \ - : targetm.calls.must_pass_in_stack (MODE, TYPE) ? NULL_RTX \ - : (CUM) >= FR30_NUM_ARG_REGS ? NULL_RTX \ - : gen_rtx_REG (MODE, CUM + FIRST_ARG_REGNUM)) - /* A C type for declaring a variable that is used as the first argument of `FUNCTION_ARG' and other related values. For some target machines, the type `int' suffices and can hold the number of bytes of argument so far. @@ -594,17 +588,6 @@ enum reg_class #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ (CUM) = 0 -/* A C statement (sans semicolon) to update the summarizer variable CUM to - advance past an argument in the argument list. The values MODE, TYPE and - NAMED describe that argument. Once this is done, the variable CUM is - suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. - - This macro need not do anything if the argument in question was passed on - the stack. The compiler knows how to track the amount of stack space used - for arguments without any special help. */ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - (CUM) += (NAMED) * fr30_num_arg_regs (MODE, TYPE) - /* A C expression that is nonzero if REGNO is the number of a hard register in which function arguments are sometimes passed. This does *not* include implicit arguments such as the static chain and the structure-value address. |