From e2b2d01ef17560879ca8e09a9e258cc906160b51 Mon Sep 17 00:00:00 2001 From: Anatoly Sokolov Date: Wed, 16 Jul 2008 19:36:43 +0400 Subject: [PATCH] xtensa.h (FUNCTION_OUTGOING_VALUE, [...]): Remove. 2008-07-16 Anatoly Sokolov * 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 | 7 +++++++ gcc/config/xtensa/xtensa.c | 14 ++++++++++++++ gcc/config/xtensa/xtensa.h | 16 ---------------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79472780861..f1ea47ce04e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-07-16 Anatoly Sokolov + + * 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 * config/rs6000/rs6000.c (processor_target_table): Add diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 6e26d76daad..38a621df0d0 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -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 diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index eaef97e2094..920f9d2ef18 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -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 -- 2.30.2