Commit 34732b0a by Anatoly Sokolov Committed by Anatoly Sokolov

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
parent 46527cc8
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> 2009-10-31 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/arm/cortex-a9.md: New - integer pipeline description. * config/arm/cortex-a9.md: New - integer pipeline description.
...@@ -37,12 +37,13 @@ extern int symbolic_operand (rtx, enum machine_mode); ...@@ -37,12 +37,13 @@ extern int symbolic_operand (rtx, enum machine_mode);
extern int impossible_plus_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_wide_const_load_uses_clr (rtx operands[2]);
extern bool mn10300_function_value_regno_p (const unsigned int);
#endif /* RTX_CODE */ #endif /* RTX_CODE */
#ifdef TREE_CODE #ifdef TREE_CODE
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree, int); enum machine_mode, tree, int);
extern rtx mn10300_function_value (const_tree, const_tree, int);
#endif /* TREE_CODE */ #endif /* TREE_CODE */
extern void expand_prologue (void); extern void expand_prologue (void);
......
...@@ -86,6 +86,8 @@ static unsigned int mn10300_case_values_threshold (void); ...@@ -86,6 +86,8 @@ static unsigned int mn10300_case_values_threshold (void);
static void mn10300_encode_section_info (tree, rtx, int); static void mn10300_encode_section_info (tree, rtx, int);
static void mn10300_asm_trampoline_template (FILE *); static void mn10300_asm_trampoline_template (FILE *);
static void mn10300_trampoline_init (rtx, tree, rtx); 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. */ /* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP #undef TARGET_ASM_ALIGNED_HI_OP
...@@ -139,6 +141,11 @@ static void mn10300_trampoline_init (rtx, tree, rtx); ...@@ -139,6 +141,11 @@ static void mn10300_trampoline_init (rtx, tree, rtx);
#undef TARGET_TRAMPOLINE_INIT #undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT mn10300_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; struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */ /* Implement TARGET_HANDLE_OPTION. */
...@@ -1624,8 +1631,10 @@ mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -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 we only return the PARALLEL for outgoing values; we do not want
callers relying on this extra copy. */ callers relying on this extra copy. */
rtx static rtx
mn10300_function_value (const_tree valtype, const_tree func, int outgoing) mn10300_function_value (const_tree valtype,
const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
bool outgoing)
{ {
rtx rv; rtx rv;
enum machine_mode mode = TYPE_MODE (valtype); enum machine_mode mode = TYPE_MODE (valtype);
...@@ -1649,6 +1658,23 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing) ...@@ -1649,6 +1658,23 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing)
return rv; 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. */ /* Output a tst insn. */
const char * const char *
output_tst (rtx operand, rtx insn) output_tst (rtx operand, rtx insn)
......
...@@ -564,25 +564,7 @@ struct cum_arg {int nbytes; }; ...@@ -564,25 +564,7 @@ struct cum_arg {int nbytes; };
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED) function_arg (&CUM, MODE, TYPE, NAMED)
/* Define how to find the value returned by a function. #define FUNCTION_VALUE_REGNO_P(N) mn10300_function_value_regno_p (N)
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 DEFAULT_PCC_STRUCT_RETURN 0 #define DEFAULT_PCC_STRUCT_RETURN 0
......
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