From b6713ba619c653fdc403d4054ad4d353cee5892f Mon Sep 17 00:00:00 2001 From: aesok Date: Sat, 31 Oct 2009 21:56:14 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153782 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 13 +++++++++++++ gcc/config/mn10300/mn10300-protos.h | 3 ++- gcc/config/mn10300/mn10300.c | 30 ++++++++++++++++++++++++++++-- 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 + + * 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 * 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 -- 2.7.4