xtensa.h (FUNCTION_OUTGOING_VALUE, [...]): Remove.
authorAnatoly Sokolov <aesok@post.ru>
Wed, 16 Jul 2008 15:36:43 +0000 (19:36 +0400)
committerBob Wilson <bwilson@gcc.gnu.org>
Wed, 16 Jul 2008 15:36:43 +0000 (15:36 +0000)
2008-07-16  Anatoly Sokolov  <aesok@post.ru>
* config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE,
XTENSA_FUNCTION_VALUE, XTENSA_FUNCTION_VALUE): Remove.
* config/xtensa/xtensa.c (xtensa_function_value): New function.
(TARGET_FUNCTION_VALUE): Define.

From-SVN: r137888

gcc/ChangeLog
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h

index 7947278..f1ea47c 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-16  Anatoly Sokolov  <aesok@post.ru>
+
+       * config/xtensa/xtensa.h (FUNCTION_OUTGOING_VALUE,
+       XTENSA_FUNCTION_VALUE, XTENSA_FUNCTION_VALUE): Remove.
+       * config/xtensa/xtensa.c (xtensa_function_value): New function.
+       (TARGET_FUNCTION_VALUE): Define.
+
 2008-07-16  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.c (processor_target_table): Add
index 6e26d76..38a621d 100644 (file)
@@ -142,6 +142,7 @@ static section *xtensa_select_rtx_section (enum machine_mode, rtx,
 static bool xtensa_rtx_costs (rtx, int, int, int *);
 static tree xtensa_build_builtin_va_list (void);
 static bool xtensa_return_in_memory (const_tree, const_tree);
+static rtx xtensa_function_value (const_tree, const_tree, bool);
 static tree xtensa_gimplify_va_arg_expr (tree, tree, tree *, tree *);
 static void xtensa_init_builtins (void);
 static tree xtensa_fold_builtin (tree, tree, bool);
@@ -192,6 +193,8 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
 
 #undef TARGET_RETURN_IN_MEMORY
 #define TARGET_RETURN_IN_MEMORY xtensa_return_in_memory
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE xtensa_function_value
 #undef TARGET_SPLIT_COMPLEX_ARG
 #define TARGET_SPLIT_COMPLEX_ARG hook_bool_const_tree_true
 #undef TARGET_MUST_PASS_IN_STACK
@@ -3163,6 +3166,17 @@ xtensa_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
          > 4 * UNITS_PER_WORD);
 }
 
+/* Worker function for TARGET_FUNCTION_VALUE.  */
+
+rtx
+xtensa_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, 
+                      bool outgoing)
+{
+  return gen_rtx_REG ((INTEGRAL_TYPE_P (valtype)
+                      && TYPE_PRECISION (valtype) < BITS_PER_WORD)
+                     ? SImode : TYPE_MODE (valtype),
+                     outgoing ? GP_OUTGOING_RETURN : GP_RETURN);
+}
 
 /* TRAMPOLINE_TEMPLATE: For Xtensa, the trampoline must perform an ENTRY
    instruction with a minimal stack frame in order to get some free
index eaef97e..920f9d2 100644 (file)
@@ -608,22 +608,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
 #define LIBCALL_OUTGOING_VALUE(MODE)                                   \
   XTENSA_LIBCALL_VALUE ((MODE), 1)
 
-/* Define how to find the value returned by a function.
-   VALTYPE is the data type of the value (as a tree).
-   If the precise function being called is known, FUNC is its FUNCTION_DECL;
-   otherwise, FUNC is 0.  */
-#define XTENSA_FUNCTION_VALUE(VALTYPE, FUNC, OUTGOINGP)                        \
-  gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE)                              \
-               && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD)            \
-              ? SImode: TYPE_MODE (VALTYPE),                           \
-              OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
-
-#define FUNCTION_VALUE(VALTYPE, FUNC)                                  \
-  XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 0)
-
-#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC)                         \
-  XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 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