cris.c (cris_function_value, [...]): New functions.

* config/cris/cris.c (cris_function_value, cris_libcall_value,
	cris_function_value_regno_p): New functions.
	(cris_promote_function_mode): Update comment.
	(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
	* config/cris/cris.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
	(FUNCTION_VALUE_REGNO_P): Redefine, use cris_function_value_regno_p.
	* config/cris/cris-protos.h (cris_function_value_regno_p): Declare.

From-SVN: r152992
This commit is contained in:
Anatoly Sokolov 2009-10-20 00:54:07 +04:00 committed by Anatoly Sokolov
parent 270213ca82
commit 4d696ad011
4 changed files with 52 additions and 9 deletions

View File

@ -1,3 +1,13 @@
2009-10-19 Anatoly Sokolov <aesok@post.ru>
* config/cris/cris.c (cris_function_value, cris_libcall_value,
cris_function_value_regno_p): New functions.
(cris_promote_function_mode): Update comment.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
* config/cris/cris.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
(FUNCTION_VALUE_REGNO_P): Redefine, use cris_function_value_regno_p.
* config/cris/cris-protos.h (cris_function_value_regno_p): Declare.
2009-10-19 Jakub Jelinek <jakub@redhat.com>
* unwind-dw2.c (execute_stack_op): Fix operand order for

View File

@ -71,3 +71,5 @@ extern void cris_override_options (void);
extern int cris_initial_elimination_offset (int, int);
extern void cris_init_expanders (void);
extern bool cris_function_value_regno_p (const unsigned int);

View File

@ -130,6 +130,9 @@ static bool cris_frame_pointer_required (void);
static void cris_asm_trampoline_template (FILE *);
static void cris_trampoline_init (rtx, tree, rtx);
static rtx cris_function_value(const_tree, const_tree, bool);
static rtx cris_libcall_value (enum machine_mode, const_rtx);
/* This is the parsed result of the "-max-stack-stackframe=" option. If
it (still) is zero, then there was no such option given. */
int cris_max_stackframe = 0;
@ -197,6 +200,11 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT cris_trampoline_init
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE cris_function_value
#undef TARGET_LIBCALL_VALUE
#define TARGET_LIBCALL_VALUE cris_libcall_value
struct gcc_target targetm = TARGET_INITIALIZER;
/* Helper for cris_load_multiple_op and cris_ret_movem_op. */
@ -3777,13 +3785,42 @@ cris_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
int for_return)
{
/* Defining PROMOTE_FUNCTION_RETURN in gcc-2.7.2 uncovered bug 981110 (even
when modifying FUNCTION_VALUE to return the promoted mode). Maybe
pointless as of now, but let's keep the old behavior. */
when modifying TARGET_FUNCTION_VALUE to return the promoted mode).
Maybe pointless as of now, but let's keep the old behavior. */
if (for_return == 1)
return mode;
return CRIS_PROMOTED_MODE (mode, *punsignedp, type);
}
/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
time being. */
static rtx
cris_function_value(const_tree type,
const_tree func ATTRIBUTE_UNUSED,
bool outgoing ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (TYPE_MODE (type), CRIS_FIRST_ARG_REG);
}
/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
time being. */
static rtx
cris_libcall_value (enum machine_mode mode,
const_rtx fun ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (mode, CRIS_FIRST_ARG_REG);
}
/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
time being. */
bool
cris_function_value_regno_p (const unsigned int regno)
{
return (regno == CRIS_FIRST_ARG_REG);
}
static int
cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode,

View File

@ -906,14 +906,8 @@ struct cum_args {int regs;};
/* Node: Scalar Return */
/* Let's assume all functions return in r[CRIS_FIRST_ARG_REG] for the
time being. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), CRIS_FIRST_ARG_REG)
#define FUNCTION_VALUE_REGNO_P(N) cris_function_value_regno_p (N)
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, CRIS_FIRST_ARG_REG)
#define FUNCTION_VALUE_REGNO_P(N) ((N) == CRIS_FIRST_ARG_REG)
/* Node: Aggregate Return */