m32c.c (m32c_function_value_regno_p): New function.
* config/m32c/m32c.c (m32c_function_value_regno_p): New function. (m32c_function_value): Make static, add new 'outgoing' argument. (m32c_libcall_value): Make static, add new 'fun' argument. (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare. * config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove. (FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p. * config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare. (m32c_function_value, m32c_libcall_value): Delete declaration. From-SVN: r153473
This commit is contained in:
parent
062eee1eb0
commit
2a31793e32
4 changed files with 41 additions and 13 deletions
|
@ -1,3 +1,14 @@
|
|||
2009-10-22 Anatoly Sokolov <aesok@post.ru>
|
||||
|
||||
* config/m32c/m32c.c (m32c_function_value_regno_p): New function.
|
||||
(m32c_function_value): Make static, add new 'outgoing' argument.
|
||||
(m32c_libcall_value): Make static, add new 'fun' argument.
|
||||
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
|
||||
* config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
|
||||
(FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p.
|
||||
* config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare.
|
||||
(m32c_function_value, m32c_libcall_value): Delete declaration.
|
||||
|
||||
2009-10-22 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
* Makefile.in (PLUGIN_HEADERS): Add output.h and
|
||||
|
|
|
@ -49,7 +49,6 @@ int m32c_trampoline_size (void);
|
|||
#if defined(RTX_CODE) && defined(TREE_CODE)
|
||||
|
||||
rtx m32c_function_arg (CUMULATIVE_ARGS *, MM, tree, int);
|
||||
rtx m32c_function_value (const_tree, const_tree);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -75,7 +74,7 @@ bool m32c_immd_dbl_mov (rtx *, MM);
|
|||
rtx m32c_incoming_return_addr_rtx (void);
|
||||
int m32c_legitimate_constant_p (rtx);
|
||||
int m32c_legitimize_reload_address (rtx *, MM, int, int, int);
|
||||
rtx m32c_libcall_value (MM);
|
||||
bool m32c_function_value_regno_p (const unsigned int);
|
||||
int m32c_limit_reload_class (MM, int);
|
||||
int m32c_memory_move_cost (MM, int, int);
|
||||
int m32c_modes_tieable_p (MM, MM);
|
||||
|
|
|
@ -81,6 +81,9 @@ static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *);
|
|||
static rtx m32c_struct_value_rtx (tree, int);
|
||||
static rtx m32c_subreg (enum machine_mode, rtx, enum machine_mode, int);
|
||||
static int need_to_save (int);
|
||||
static rtx m32c_function_value (const_tree, const_tree, bool);
|
||||
static rtx m32c_libcall_value (enum machine_mode, const_rtx);
|
||||
|
||||
int current_function_special_page_vector (rtx);
|
||||
|
||||
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
|
||||
|
@ -1591,15 +1594,19 @@ m32c_valid_pointer_mode (enum machine_mode mode)
|
|||
|
||||
/* How Scalar Function Values Are Returned */
|
||||
|
||||
/* Implements LIBCALL_VALUE. Most values are returned in $r0, or some
|
||||
/* Implements TARGET_LIBCALL_VALUE. Most values are returned in $r0, or some
|
||||
combination of registers starting there (r2r0 for longs, r3r1r2r0
|
||||
for long long, r3r2r1r0 for doubles), except that that ABI
|
||||
currently doesn't work because it ends up using all available
|
||||
general registers and gcc often can't compile it. So, instead, we
|
||||
return anything bigger than 16 bits in "mem0" (effectively, a
|
||||
memory location). */
|
||||
rtx
|
||||
m32c_libcall_value (enum machine_mode mode)
|
||||
|
||||
#undef TARGET_LIBCALL_VALUE
|
||||
#define TARGET_LIBCALL_VALUE m32c_libcall_value
|
||||
|
||||
static rtx
|
||||
m32c_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* return reg or parallel */
|
||||
#if 0
|
||||
|
@ -1649,14 +1656,28 @@ m32c_libcall_value (enum machine_mode mode)
|
|||
return gen_rtx_REG (mode, R0_REGNO);
|
||||
}
|
||||
|
||||
/* Implements FUNCTION_VALUE. Functions and libcalls have the same
|
||||
/* Implements TARGET_FUNCTION_VALUE. Functions and libcalls have the same
|
||||
conventions. */
|
||||
rtx
|
||||
m32c_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
|
||||
|
||||
#undef TARGET_FUNCTION_VALUE
|
||||
#define TARGET_FUNCTION_VALUE m32c_function_value
|
||||
|
||||
static rtx
|
||||
m32c_function_value (const_tree valtype,
|
||||
const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
|
||||
bool outgoing ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* return reg or parallel */
|
||||
const enum machine_mode mode = TYPE_MODE (valtype);
|
||||
return m32c_libcall_value (mode);
|
||||
return m32c_libcall_value (mode, NULL_RTX);
|
||||
}
|
||||
|
||||
/* Implements FUNCTION_VALUE_REGNO_P. */
|
||||
|
||||
bool
|
||||
m32c_function_value_regno_p (const unsigned int regno)
|
||||
{
|
||||
return (regno == R0_REGNO || regno == MEM0_REGNO);
|
||||
}
|
||||
|
||||
/* How Large Values Are Returned */
|
||||
|
|
|
@ -533,10 +533,7 @@ typedef struct m32c_cumulative_args
|
|||
|
||||
/* How Scalar Function Values Are Returned */
|
||||
|
||||
#define FUNCTION_VALUE(VT,F) m32c_function_value (VT, F)
|
||||
#define LIBCALL_VALUE(MODE) m32c_libcall_value (MODE)
|
||||
|
||||
#define FUNCTION_VALUE_REGNO_P(r) ((r) == R0_REGNO || (r) == MEM0_REGNO)
|
||||
#define FUNCTION_VALUE_REGNO_P(r) m32c_function_value_regno_p (r)
|
||||
|
||||
/* How Large Values Are Returned */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue