LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
* config/moxie/moxie-protos.h (moxie_function_value): Remove.
* config/moxie/moxie.c (moxie_function_value): Make static.
(moxie_libcall_value, moxie_function_value_regno_p): New functions.
(TARGET_LIBCALL_VALUE, TARGET_FUNCTION_VALUE_REGNO_P): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160565
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-06-10 Anatoly Sokolov <aesok@post.ru>
+
+ * config/moxie/moxie.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
+ LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
+ * config/moxie/moxie-protos.h (moxie_function_value): Remove.
+ * config/moxie/moxie.c (moxie_function_value): Make static.
+ (moxie_libcall_value, moxie_function_value_regno_p): New functions.
+ (TARGET_LIBCALL_VALUE, TARGET_FUNCTION_VALUE_REGNO_P): Define.
+
2010-06-10 Martin Jambor <mjambor@suse.cz>
* Makefile.in (tree-sra.o): Add DBGCNT_H to dependencies.
/* Prototypes for moxie.c functions used in the md file & elsewhere.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GCC.
extern void moxie_expand_prologue (void);
extern void moxie_expand_epilogue (void);
extern int moxie_initial_elimination_offset (int, int);
-extern rtx moxie_function_value (const_tree, const_tree,
- bool ATTRIBUTE_UNUSED);
extern void moxie_print_operand (FILE *, rtx, int);
extern void moxie_print_operand_address (FILE *, rtx);
#ifdef RTX_CODE
We always return values in register $r0 for moxie. */
-rtx
+static rtx
moxie_function_value (const_tree valtype,
const_tree fntype_or_decl ATTRIBUTE_UNUSED,
bool outgoing ATTRIBUTE_UNUSED)
return gen_rtx_REG (TYPE_MODE (valtype), MOXIE_R0);
}
+/* Define how to find the value returned by a library function.
+
+ We always return values in register $r0 for moxie. */
+
+static rtx
+moxie_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode, MOXIE_R0);
+}
+
+/* Handle TARGET_FUNCTION_VALUE_REGNO_P.
+
+ We always return values in register $r0 for moxie. */
+
+static bool
+moxie_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == MOXIE_R0);
+}
+
/* Emit an error message when we're in an asm, and a fatal error for
"normal" insns. Formatted output isn't easily implemented, since we
use output_operand_lossage to output the actual message and handle the
node node representing a data type. */
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE moxie_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE moxie_libcall_value
+#undef TARGET_FUNCTION_VALUE_REGNO_P
+#define TARGET_FUNCTION_VALUE_REGNO_P moxie_function_value_regno_p
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true
/* How Scalar Function Values Are Returned */
-/* These macros are deprecated, but we still need them for now since
- the version of gcc we're using doesn't fully support
- TARGET_FUNCTION_VALUE. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- moxie_function_value (VALTYPE, FUNC, 0)
-#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
- moxie_function_value (VALTYPE, FUNC, 1)
-
-/* A C expression to create an RTX representing the place where a
- library function returns a value of mode MODE. */
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 2)
-
/* STACK AND CALLING */
/* Define this macro if pushing a word onto the stack moves the stack
register in which function arguments are sometimes passed. */
#define FUNCTION_ARG_REGNO_P(r) (r >= MOXIE_R0 && r <= MOXIE_R5)
-/* A C expression that is nonzero if REGNO is the number of a hard
- register in which the values of called function may come back. */
-#define FUNCTION_VALUE_REGNO_P(r) (r == MOXIE_R0)
-
/* A macro whose definition is the name of the class to which a valid
base register must belong. A base register is one used in an
address which is the register value plus a displacement. */