diff options
author | Anatoly Sokolov <aesok@post.ru> | 2009-11-01 00:56:14 +0300 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2009-11-01 00:56:14 +0300 |
commit | 34732b0adebe0eff2db3c23e0e3c667ec7e4c22c (patch) | |
tree | c5f6c633174ba9d95f902eff1e2ec3a9c6806ab2 | |
parent | 46527cc82c394c372e91b7453dccfc1da5899aa0 (diff) | |
download | gcc-34732b0adebe0eff2db3c23e0e3c667ec7e4c22c.zip gcc-34732b0adebe0eff2db3c23e0e3c667ec7e4c22c.tar.gz gcc-34732b0adebe0eff2db3c23e0e3c667ec7e4c22c.tar.bz2 |
mn10300.c (mn10300_function_value): Make static, add new 'outgoing' argument.
* config/mn10300/mn10300.c (mn10300_function_value): Make static, add
new 'outgoing' argument.
(mn10300_libcall_value, mn10300_function_value_regno_p): New
functions.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
* config/mn10300/mn10300.h: (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
LIBCALL_VALUE): Remove.
(FUNCTION_VALUE_REGNO_P): Redefine, use mn10300_function_value_regno_p.
* config/mn10300/mn10300-protos.h (mn10300_function_value): Remove.
(mh10300_function_value_regno_p): Declare.
From-SVN: r153782
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300-protos.h | 3 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.c | 30 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.h | 20 |
4 files changed, 44 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 179c40e..7d63c0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2009-10-31 Anatoly Sokolov <aesok@post.ru> + + * config/mn10300/mn10300.c (mn10300_function_value): Make static, add + new 'outgoing' argument. + (mn10300_libcall_value, mn10300_function_value_regno_p): New + functions. + (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare. + * config/mn10300/mn10300.h: (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE, + LIBCALL_VALUE): Remove. + (FUNCTION_VALUE_REGNO_P): Redefine, use mn10300_function_value_regno_p. + * config/mn10300/mn10300-protos.h (mn10300_function_value): Remove. + (mh10300_function_value_regno_p): Declare. + 2009-10-31 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * config/arm/cortex-a9.md: New - integer pipeline description. diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h index ae4728a..47488c9 100644 --- a/gcc/config/mn10300/mn10300-protos.h +++ b/gcc/config/mn10300/mn10300-protos.h @@ -37,12 +37,13 @@ extern int symbolic_operand (rtx, enum machine_mode); extern int impossible_plus_operand (rtx, enum machine_mode); extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]); + +extern bool mn10300_function_value_regno_p (const unsigned int); #endif /* RTX_CODE */ #ifdef TREE_CODE extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern rtx mn10300_function_value (const_tree, const_tree, int); #endif /* TREE_CODE */ extern void expand_prologue (void); diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 1a0eb37..8f69dd0 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -86,6 +86,8 @@ static unsigned int mn10300_case_values_threshold (void); static void mn10300_encode_section_info (tree, rtx, int); static void mn10300_asm_trampoline_template (FILE *); static void mn10300_trampoline_init (rtx, tree, rtx); +static rtx mn10300_function_value (const_tree, const_tree, bool); +static rtx mn10300_libcall_value (enum machine_mode, const_rtx); /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -139,6 +141,11 @@ static void mn10300_trampoline_init (rtx, tree, rtx); #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT mn10300_trampoline_init +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE mn10300_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE mn10300_libcall_value + struct gcc_target targetm = TARGET_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ @@ -1624,8 +1631,10 @@ mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, we only return the PARALLEL for outgoing values; we do not want callers relying on this extra copy. */ -rtx -mn10300_function_value (const_tree valtype, const_tree func, int outgoing) +static rtx +mn10300_function_value (const_tree valtype, + const_tree fn_decl_or_type ATTRIBUTE_UNUSED, + bool outgoing) { rtx rv; enum machine_mode mode = TYPE_MODE (valtype); @@ -1649,6 +1658,23 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing) return rv; } +/* Implements TARGET_LIBCALL_VALUE. */ + +static rtx +mn10300_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (mode, FIRST_DATA_REGNUM); +} + +/* Implements FUNCTION_VALUE_REGNO_P. */ + +bool +mn10300_function_value_regno_p (const unsigned int regno) +{ + return (regno == FIRST_DATA_REGNUM || regno == FIRST_ADDRESS_REGNUM); +} + /* Output a tst insn. */ const char * output_tst (rtx operand, rtx insn) diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 6c0f461..bdbc948 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -564,25 +564,7 @@ struct cum_arg {int nbytes; }; #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (&CUM, MODE, TYPE, NAMED) -/* Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ - -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - mn10300_function_value (VALTYPE, FUNC, 0) -#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - mn10300_function_value (VALTYPE, FUNC, 1) - -/* Define how to find the value returned by a library function - assuming the value has mode MODE. */ - -#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM) - -/* 1 if N is a possible register number for a function value. */ - -#define FUNCTION_VALUE_REGNO_P(N) \ - ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM) +#define FUNCTION_VALUE_REGNO_P(N) mn10300_function_value_regno_p (N) #define DEFAULT_PCC_STRUCT_RETURN 0 |