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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159458
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
* tree.c (build_common_builtin_nodes): Always clear TREE_NOTHROW on
/* 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)
This file is part of GCC.
extern int mmix_dbx_register_number (int);
extern int mmix_use_simple_return (void);
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_constant_alignment (tree, int);
extern int mmix_local_alignment (tree, int);
/* 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.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
static enum machine_mode mmix_promote_function_mode (const_tree,
enum machine_mode,
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 *,
enum machine_mode, const_tree, bool);
static bool mmix_frame_pointer_required (void);
#undef TARGET_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
#define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx
&& regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS;
}
-/* FUNCTION_OUTGOING_VALUE. */
+/* Implements TARGET_FUNCTION_VALUE. */
-rtx
-mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
+static rtx
+mmix_function_value (const_tree valtype,
+ const_tree func ATTRIBUTE_UNUSED,
+ bool outgoing)
{
enum machine_mode mode = TYPE_MODE (valtype);
enum machine_mode cmode;
int i;
int nregs;
+ if (!outgoing)
+ return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM);
+
/* Return values that fit in a register need no special handling.
There's no register hole when parameters are passed in global
registers. */
return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec));
}
-/* FUNCTION_VALUE_REGNO_P. */
+/* Implements TARGET_LIBCALL_VALUE. */
-int
-mmix_function_value_regno_p (int regno)
+static rtx
+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;
}
/* 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.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
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 */
/* (empty) */