summaryrefslogtreecommitdiff
path: root/gcc/config/xtensa
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-13 20:24:19 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-13 20:24:19 +0000
commit7af7466c047815027d8da5039d38051f78b39fc2 (patch)
tree6e8c242feb8e288d26c0b81cc1417be27855547d /gcc/config/xtensa
parent7549a79a8724518fb2a59a44aeb54dfe32241d61 (diff)
downloadgcc-7af7466c047815027d8da5039d38051f78b39fc2.tar.gz
* config/xtensa/xtensa.h (XTENSA_LIBCALL_VALUE, LIBCALL_VALUE,
LIBCALL_OUTGOING_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros. * config/xtensa/xtensa.c (xtensa_libcall_value, xtensa_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@168765 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/xtensa')
-rw-r--r--gcc/config/xtensa/xtensa.c27
-rw-r--r--gcc/config/xtensa/xtensa.h29
2 files changed, 27 insertions, 29 deletions
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 0a6f34bbb85..7e244e2318c 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for Tensilica's Xtensa architecture.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
@@ -147,6 +147,8 @@ static rtx xtensa_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
static rtx xtensa_function_incoming_arg (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool);
static rtx xtensa_function_value (const_tree, const_tree, bool);
+static rtx xtensa_libcall_value (enum machine_mode, const_rtx);
+static bool xtensa_function_value_regno_p (const unsigned int);
static unsigned int xtensa_function_arg_boundary (enum machine_mode,
const_tree);
static void xtensa_init_builtins (void);
@@ -220,6 +222,11 @@ static const struct default_options xtensa_option_optimization_table[] =
#define TARGET_RETURN_IN_MEMORY xtensa_return_in_memory
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE xtensa_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE xtensa_libcall_value
+#undef TARGET_FUNCTION_VALUE_REGNO_P
+#define TARGET_FUNCTION_VALUE_REGNO_P xtensa_function_value_regno_p
+
#undef TARGET_SPLIT_COMPLEX_ARG
#define TARGET_SPLIT_COMPLEX_ARG hook_bool_const_tree_true
#undef TARGET_MUST_PASS_IN_STACK
@@ -3496,6 +3503,24 @@ xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
outgoing ? GP_OUTGOING_RETURN : GP_RETURN);
}
+/* Worker function for TARGET_LIBCALL_VALUE. */
+
+static rtx
+xtensa_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG ((GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) < UNITS_PER_WORD)
+ ? SImode : mode, GP_RETURN);
+}
+
+/* Worker function TARGET_FUNCTION_VALUE_REGNO_P. */
+
+static bool
+xtensa_function_value_regno_p (const unsigned int regno)
+{
+ return (regno == GP_RETURN);
+}
+
/* The static chain is passed in memory. Provide rtx giving 'mem'
expressions that denote where they are stored. */
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index ab1738333f2..e465e8f6347 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -1,5 +1,5 @@
/* Definitions of Tensilica's Xtensa target machine for GNU compiler.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
@@ -539,33 +539,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
/* Don't worry about compatibility with PCC. */
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Define how to find the value returned by a library function
- assuming the value has mode MODE. Because we have defined
- TARGET_PROMOTE_FUNCTION_MODE to promote everything, we have to
- perform the same promotions as PROMOTE_MODE. */
-#define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
- gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
- && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
- ? SImode : (MODE), \
- OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
-
-#define LIBCALL_VALUE(MODE) \
- XTENSA_LIBCALL_VALUE ((MODE), 0)
-
-#define LIBCALL_OUTGOING_VALUE(MODE) \
- XTENSA_LIBCALL_VALUE ((MODE), 1)
-
-/* 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. A
- register whose use for returning values is limited to serving as
- the second of a pair (for a value of type 'double', say) need not
- be recognized by this macro. If the machine has register windows,
- so that the caller and the called function use different registers
- for the return value, this macro should recognize only the caller's
- register numbers. */
-#define FUNCTION_VALUE_REGNO_P(N) \
- ((N) == GP_RETURN)
-
/* A C expression that is nonzero if REGNO is the number of a hard
register in which function arguments are sometimes passed. This
does *not* include implicit arguments such as the static chain and