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

* config/h8300/h8300.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
	LIBCALL_VALUE): Remove macros.
	* config/h8300/h8300.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
	TARGET_FUNCTION_VALUE_REGNO_P): Define.
	(h8300_function_value, h8300_libcall_value,
	h8300_function_value_regno_p): New functions.

From-SVN: r171625
This commit is contained in:
Anatoly Sokolov 2011-03-29 00:05:28 +04:00 committed by Anatoly Sokolov
parent dcec2be2c3
commit 9eaa7740ba
3 changed files with 51 additions and 24 deletions

View File

@ -1,3 +1,12 @@
2011-03-28 Anatoly Sokolov <aesok@post.ru>
* config/h8300/h8300.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
LIBCALL_VALUE): Remove macros.
* config/h8300/h8300.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
(h8300_function_value, h8300_libcall_value,
h8300_function_value_regno_p): New functions.
2011-03-28 Anatoly Sokolov <aesok@post.ru>
* config/h8300/h8300.h (ASM_OUTPUT_BSS): Remove macro.

View File

@ -1,6 +1,6 @@
/* Subroutines for insn-output.c for Renesas H8/300.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@ -5860,6 +5860,38 @@ h8300_init_libfuncs (void)
set_optab_libfunc (umod_optab, HImode, "__umodhi3");
}
/* Worker function for TARGET_FUNCTION_VALUE.
On the H8 the return value is in R0/R1. */
static rtx
h8300_function_value (const_tree ret_type,
const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
bool outgoing ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (TYPE_MODE (ret_type), R0_REG);
}
/* Worker function for TARGET_LIBCALL_VALUE.
On the H8 the return value is in R0/R1. */
static rtx
h8300_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (mode, R0_REG);
}
/* Worker function for TARGET_FUNCTION_VALUE_REGNO_P.
On the H8, R0 is the only register thus used. */
static bool
h8300_function_value_regno_p (const unsigned int regno)
{
return (regno == R0_REG);
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
static bool
@ -5946,6 +5978,15 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS h8300_init_libfuncs
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE h8300_function_value
#undef TARGET_LIBCALL_VALUE
#define TARGET_LIBCALL_VALUE h8300_libcall_value
#undef TARGET_FUNCTION_VALUE_REGNO_P
#define TARGET_FUNCTION_VALUE_REGNO_P h8300_function_value_regno_p
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY h8300_return_in_memory

View File

@ -527,29 +527,6 @@ enum reg_class {
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
((OFFSET) = h8300_initial_elimination_offset ((FROM), (TO)))
/* 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.
On the H8 the return value is in R0/R1. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), R0_REG)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
/* On the H8 the return value is in R0/R1. */
#define LIBCALL_VALUE(MODE) \
gen_rtx_REG (MODE, R0_REG)
/* 1 if N is a possible register number for a function value.
On the H8, R0 is the only register thus used. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == R0_REG)
/* Define this if PCC uses the nonreentrant convention for returning
structure and union values. */