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/fr30.c | |
parent | 6a16a3b19bf552f3fca911688143c6db636ded1f (diff) | |
download | ppe42-gcc-d7ef99d4736e30f0e23bdeeff6c7ced5bd58d783.tar.gz ppe42-gcc-d7ef99d4736e30f0e23bdeeff6c7ced5bd58d783.zip |
* 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/fr30.c')
-rw-r--r-- | gcc/config/fr30/fr30.c | 40 |
1 files changed, 38 insertions, 2 deletions
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 */ |