Commit a3ca07e3 by Anatoly Sokolov Committed by Anatoly Sokolov

mmix.h (FUNCTION_VALUE, [...]): Remove macros.

	* config/mmix/mmix.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
	LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
	* config/mmix/mmix.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
	TARGET_FUNCTION_VALUE_REGNO_P): Define.
	(mmix_function_outgoing_value): Rename to...
	(mmix_function_value): ...this. Make static. Add 'outgoing' argument.
	(mmix_function_value_regno_p): Make static.
	(mmix_libcall_value): New function.
	* config/mmix/mmix-protos.h (mmix_function_outgoing_value,
	mmix_function_value_regno_p): Remove declaration.

From-SVN: r159458
parent 29d17485
2010-05-16 Anatoly Sokolov <aesok@post.ru>
* config/mmix/mmix.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
* config/mmix/mmix.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
(mmix_function_outgoing_value): Rename to...
(mmix_function_value): ...this. Make static. Add 'outgoing' argument.
(mmix_function_value_regno_p): Make static.
(mmix_libcall_value): New function.
* config/mmix/mmix-protos.h (mmix_function_outgoing_value,
mmix_function_value_regno_p): Remove declaration.
2010-05-16 Eric Botcazou <ebotcazou@adacore.com> 2010-05-16 Eric Botcazou <ebotcazou@adacore.com>
* tree.c (build_common_builtin_nodes): Always clear TREE_NOTHROW on * tree.c (build_common_builtin_nodes): Always clear TREE_NOTHROW on
......
/* Prototypes for exported functions defined in mmix.c /* Prototypes for exported functions defined in mmix.c
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2010
Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com) Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC. This file is part of GCC.
...@@ -52,8 +53,6 @@ extern int mmix_local_regno (int); ...@@ -52,8 +53,6 @@ extern int mmix_local_regno (int);
extern int mmix_dbx_register_number (int); extern int mmix_dbx_register_number (int);
extern int mmix_use_simple_return (void); extern int mmix_use_simple_return (void);
extern void mmix_make_decl_one_only (tree); extern void mmix_make_decl_one_only (tree);
extern rtx mmix_function_outgoing_value (const_tree, const_tree);
extern int mmix_function_value_regno_p (int);
extern int mmix_data_alignment (tree, int); extern int mmix_data_alignment (tree, int);
extern int mmix_constant_alignment (tree, int); extern int mmix_constant_alignment (tree, int);
extern int mmix_local_alignment (tree, int); extern int mmix_local_alignment (tree, int);
......
/* Definitions of target machine for GNU compiler, for MMIX. /* Definitions of target machine for GNU compiler, for MMIX.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com) Contributed by Hans-Peter Nilsson (hp@bitrange.com)
...@@ -138,6 +139,9 @@ static rtx mmix_struct_value_rtx (tree, int); ...@@ -138,6 +139,9 @@ static rtx mmix_struct_value_rtx (tree, int);
static enum machine_mode mmix_promote_function_mode (const_tree, static enum machine_mode mmix_promote_function_mode (const_tree,
enum machine_mode, enum machine_mode,
int *, const_tree, int); int *, const_tree, int);
static rtx mmix_function_value (const_tree, const_tree, bool);
static rtx mmix_libcall_value (enum machine_mode, const_rtx);
static bool mmix_function_value_regno_p (const unsigned int);
static bool mmix_pass_by_reference (CUMULATIVE_ARGS *, static bool mmix_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool); enum machine_mode, const_tree, bool);
static bool mmix_frame_pointer_required (void); static bool mmix_frame_pointer_required (void);
...@@ -196,6 +200,12 @@ static void mmix_trampoline_init (rtx, tree, rtx); ...@@ -196,6 +200,12 @@ static void mmix_trampoline_init (rtx, tree, rtx);
#undef TARGET_PROMOTE_FUNCTION_MODE #undef TARGET_PROMOTE_FUNCTION_MODE
#define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode #define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE mmix_function_value
#undef TARGET_LIBCALL_VALUE
#define TARGET_LIBCALL_VALUE mmix_libcall_value
#undef TARGET_FUNCTION_VALUE_REGNO_P
#define TARGET_FUNCTION_VALUE_REGNO_P mmix_function_value_regno_p
#undef TARGET_STRUCT_VALUE_RTX #undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx #define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx
...@@ -654,10 +664,12 @@ mmix_function_arg_regno_p (int regno, int incoming) ...@@ -654,10 +664,12 @@ mmix_function_arg_regno_p (int regno, int incoming)
&& regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS; && regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS;
} }
/* FUNCTION_OUTGOING_VALUE. */ /* Implements TARGET_FUNCTION_VALUE. */
rtx static rtx
mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED) mmix_function_value (const_tree valtype,
const_tree func ATTRIBUTE_UNUSED,
bool outgoing)
{ {
enum machine_mode mode = TYPE_MODE (valtype); enum machine_mode mode = TYPE_MODE (valtype);
enum machine_mode cmode; enum machine_mode cmode;
...@@ -666,6 +678,9 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS ...@@ -666,6 +678,9 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS
int i; int i;
int nregs; int nregs;
if (!outgoing)
return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM);
/* Return values that fit in a register need no special handling. /* Return values that fit in a register need no special handling.
There's no register hole when parameters are passed in global There's no register hole when parameters are passed in global
registers. */ registers. */
...@@ -717,10 +732,19 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS ...@@ -717,10 +732,19 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS
return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec)); return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec));
} }
/* FUNCTION_VALUE_REGNO_P. */ /* Implements TARGET_LIBCALL_VALUE. */
int static rtx
mmix_function_value_regno_p (int regno) mmix_libcall_value (enum machine_mode mode,
const_rtx fun ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM);
}
/* Implements TARGET_FUNCTION_VALUE_REGNO_P. */
static bool
mmix_function_value_regno_p (const unsigned int regno)
{ {
return regno == MMIX_RETURN_VALUE_REGNUM; return regno == MMIX_RETURN_VALUE_REGNUM;
} }
......
/* Definitions of target machine for GNU compiler, for MMIX. /* Definitions of target machine for GNU compiler, for MMIX.
Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009 Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com) Contributed by Hans-Peter Nilsson (hp@bitrange.com)
...@@ -613,22 +613,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS; ...@@ -613,22 +613,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
mmix_function_arg_regno_p (REGNO, 0) mmix_function_arg_regno_p (REGNO, 0)
/* Node: Register Arguments */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), MMIX_RETURN_VALUE_REGNUM)
/* This needs to take care of the register hole for complex return values. */
#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
mmix_function_outgoing_value (VALTYPE, FUNC)
#define LIBCALL_VALUE(MODE) \
gen_rtx_REG (MODE, MMIX_RETURN_VALUE_REGNUM)
#define FUNCTION_VALUE_REGNO_P(REGNO) \
mmix_function_value_regno_p (REGNO)
/* Node: Caller Saves */ /* Node: Caller Saves */
/* (empty) */ /* (empty) */
......
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