Commit ba90d838 by Anatoly Sokolov Committed by Anatoly Sokolov

ia64.h (FUNCTION_VALUE_REGNO_P, [...]): Remove macros.

	* config/ia64/ia64.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
	LIBCALL_VALUE): Remove macros.
	* config/ia64/ia64-protos.h (ia64_function_value): Remove.
	* config/ia64/ia64.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
	TARGET_FUNCTION_VALUE_REGNO_P): Define.
	(ia64_libcall_value, ia64_function_value_regno_p): New functions.
	(ia64_function_value): Make static. Handle receiving the function
	type in 'fn_decl_or_type' argunent. Add 'outgoing' argument.

From-SVN: r160678
parent 9050c834
2010-06-13 Anatoly Sokolov <aesok@post.ru>
* config/ia64/ia64.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
LIBCALL_VALUE): Remove macros.
* config/ia64/ia64-protos.h (ia64_function_value): Remove.
* config/ia64/ia64.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
(ia64_libcall_value, ia64_function_value_regno_p): New functions.
(ia64_function_value): Make static. Handle receiving the function
type in 'fn_decl_or_type' argunent. Add 'outgoing' argument.
2010-06-12 Jan Hubicka <jh@suse.cz> 2010-06-12 Jan Hubicka <jh@suse.cz>
* cse.c (cse_extended_basic_block): Move optimize_bb_for_speed_p * cse.c (cse_extended_basic_block): Move optimize_bb_for_speed_p
......
...@@ -69,7 +69,6 @@ extern rtx ia64_function_arg (CUMULATIVE_ARGS *, enum machine_mode, ...@@ -69,7 +69,6 @@ extern rtx ia64_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
tree, int, int); tree, int, int);
extern rtx ia64_expand_builtin (tree, rtx, rtx, enum machine_mode, int); extern rtx ia64_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
extern rtx ia64_va_arg (tree, tree); extern rtx ia64_va_arg (tree, tree);
extern rtx ia64_function_value (const_tree, const_tree);
#endif /* RTX_CODE */ #endif /* RTX_CODE */
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
......
...@@ -207,6 +207,9 @@ static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, ...@@ -207,6 +207,9 @@ static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool); tree, bool);
static bool ia64_function_ok_for_sibcall (tree, tree); static bool ia64_function_ok_for_sibcall (tree, tree);
static bool ia64_return_in_memory (const_tree, const_tree); static bool ia64_return_in_memory (const_tree, const_tree);
static rtx ia64_function_value (const_tree, const_tree, bool);
static rtx ia64_libcall_value (enum machine_mode, const_rtx);
static bool ia64_function_value_regno_p (const unsigned int);
static bool ia64_rtx_costs (rtx, int, int, int *, bool); static bool ia64_rtx_costs (rtx, int, int, int *, bool);
static int ia64_unspec_may_trap_p (const_rtx, unsigned); static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *); static void fix_range (const char *);
...@@ -482,6 +485,13 @@ static const struct attribute_spec ia64_attribute_table[] = ...@@ -482,6 +485,13 @@ static const struct attribute_spec ia64_attribute_table[] =
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true #define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#endif #endif
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE ia64_function_value
#undef TARGET_LIBCALL_VALUE
#define TARGET_LIBCALL_VALUE ia64_libcall_value
#undef TARGET_FUNCTION_VALUE_REGNO_P
#define TARGET_FUNCTION_VALUE_REGNO_P ia64_function_value_regno_p
#undef TARGET_STRUCT_VALUE_RTX #undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx #define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx
#undef TARGET_RETURN_IN_MEMORY #undef TARGET_RETURN_IN_MEMORY
...@@ -4637,13 +4647,20 @@ ia64_return_in_memory (const_tree valtype, const_tree fntype ATTRIBUTE_UNUSED) ...@@ -4637,13 +4647,20 @@ ia64_return_in_memory (const_tree valtype, const_tree fntype ATTRIBUTE_UNUSED)
/* Return rtx for register that holds the function return value. */ /* Return rtx for register that holds the function return value. */
rtx static rtx
ia64_function_value (const_tree valtype, const_tree func) ia64_function_value (const_tree valtype,
const_tree fn_decl_or_type,
bool outgoing ATTRIBUTE_UNUSED)
{ {
enum machine_mode mode; enum machine_mode mode;
enum machine_mode hfa_mode; enum machine_mode hfa_mode;
int unsignedp; int unsignedp;
const_tree func = fn_decl_or_type;
if (fn_decl_or_type
&& !DECL_P (fn_decl_or_type))
func = NULL;
mode = TYPE_MODE (valtype); mode = TYPE_MODE (valtype);
hfa_mode = hfa_element_mode (valtype, 0); hfa_mode = hfa_element_mode (valtype, 0);
...@@ -4721,6 +4738,28 @@ ia64_function_value (const_tree valtype, const_tree func) ...@@ -4721,6 +4738,28 @@ ia64_function_value (const_tree valtype, const_tree func)
} }
} }
/* Worker function for TARGET_LIBCALL_VALUE. */
static rtx
ia64_libcall_value (enum machine_mode mode,
const_rtx fun ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (mode,
(((GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
&& (mode) != TFmode)
? FR_RET_FIRST : GR_RET_FIRST));
}
/* Worker function for FUNCTION_VALUE_REGNO_P. */
static bool
ia64_function_value_regno_p (const unsigned int regno)
{
return ((regno >= GR_RET_FIRST && regno <= GR_RET_LAST)
|| (regno >= FR_RET_FIRST && regno <= FR_RET_LAST));
}
/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. /* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.
We need to emit DTP-relative relocations. */ We need to emit DTP-relative relocations. */
......
...@@ -1146,31 +1146,6 @@ do { \ ...@@ -1146,31 +1146,6 @@ do { \
#define FUNCTION_ARG_REGNO_P(REGNO) \ #define FUNCTION_ARG_REGNO_P(REGNO) \
(((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \ (((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
|| ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS))) || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
/* How Scalar Function Values are Returned */
/* A C expression to create an RTX representing the place where a function
returns a value of data type VALTYPE. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
ia64_function_value (VALTYPE, FUNC)
/* A C expression to create an RTX representing the place where a library
function returns a value of mode MODE. */
#define LIBCALL_VALUE(MODE) \
gen_rtx_REG (MODE, \
(((GET_MODE_CLASS (MODE) == MODE_FLOAT \
|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) && \
(MODE) != TFmode) \
? FR_RET_FIRST : GR_RET_FIRST))
/* A C expression that is nonzero if REGNO is the number of a hard register in
which the values of called function may come back. */
#define FUNCTION_VALUE_REGNO_P(REGNO) \
(((REGNO) >= GR_RET_FIRST && (REGNO) <= GR_RET_LAST) \
|| ((REGNO) >= FR_RET_FIRST && (REGNO) <= FR_RET_LAST))
/* How Large Values are Returned */ /* How Large Values are Returned */
......
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