summaryrefslogtreecommitdiff
path: root/gcc/config/moxie
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 17:30:32 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 17:30:32 +0000
commit63bd5286299b1e177addbe74f764b1f842b176e9 (patch)
tree9b0e6e691d0c825811112fa4c7651d21f996c71c /gcc/config/moxie
parent3954ae548c34339c00e5e6a78a6846964c4deb05 (diff)
downloadgcc-63bd5286299b1e177addbe74f764b1f842b176e9.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/moxie')
-rw-r--r--gcc/config/moxie/moxie-protos.h5
-rw-r--r--gcc/config/moxie/moxie.c27
-rw-r--r--gcc/config/moxie/moxie.h16
3 files changed, 28 insertions, 20 deletions
diff --git a/gcc/config/moxie/moxie-protos.h b/gcc/config/moxie/moxie-protos.h
index 17bb4fc7cf7..471fd99a67d 100644
--- a/gcc/config/moxie/moxie-protos.h
+++ b/gcc/config/moxie/moxie-protos.h
@@ -1,5 +1,6 @@
/* 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.
@@ -21,8 +22,6 @@ extern void moxie_override_options (void);
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
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index b87b80f4744..1ce7107daff 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -70,7 +70,7 @@ moxie_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
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)
@@ -78,6 +78,27 @@ moxie_function_value (const_tree valtype,
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
@@ -530,6 +551,10 @@ moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
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
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index 928ca8838a7..266a244c570 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -268,18 +268,6 @@ enum reg_class
/* 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
@@ -429,10 +417,6 @@ enum reg_class
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. */