aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2011-01-13 23:24:19 +0300
committerAnatoly Sokolov <aesok@gcc.gnu.org>2011-01-13 23:24:19 +0300
commitdde8a3a47e4c13fd3ac3d6bb542c96020be65598 (patch)
tree6e8c242feb8e288d26c0b81cc1417be27855547d /gcc
parent389295b785f9c396c703c186bd5e2fe1f697ed38 (diff)
downloadgcc-dde8a3a47e4c13fd3ac3d6bb542c96020be65598.zip
gcc-dde8a3a47e4c13fd3ac3d6bb542c96020be65598.tar.gz
gcc-dde8a3a47e4c13fd3ac3d6bb542c96020be65598.tar.bz2
xtensa.h (XTENSA_LIBCALL_VALUE, [...]): Remove macros.
* 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. From-SVN: r168765
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/xtensa/xtensa.c27
-rw-r--r--gcc/config/xtensa/xtensa.h29
3 files changed, 35 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d053ab..417509a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-13 Anatoly Sokolov <aesok@post.ru>
+
+ * 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.
+
2011-01-13 Kai Tietz <kai.tietz@onevision.com>
PR c++/47213
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 0a6f34b..7e244e2 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 ab17383..e465e8f 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