diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-05-16 20:51:40 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-05-16 20:51:40 +0400 |
commit | a3ca07e3be6e250a8213fd95c8bb738231d3fc51 (patch) | |
tree | 2b494a0df5ef94b559741e27e693686bedd609d1 /gcc | |
parent | 29d1748506a81fedf0659c07a67905b883d6e808 (diff) | |
download | gcc-a3ca07e3be6e250a8213fd95c8bb738231d3fc51.zip gcc-a3ca07e3be6e250a8213fd95c8bb738231d3fc51.tar.gz gcc-a3ca07e3be6e250a8213fd95c8bb738231d3fc51.tar.bz2 |
mmix.h (FUNCTION_VALUE, [...]): Remove macros.
* config/mmix/mmix.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
* config/mmix/mmix.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
(mmix_function_outgoing_value): Rename to...
(mmix_function_value): ...this. Make static. Add 'outgoing' argument.
(mmix_function_value_regno_p): Make static.
(mmix_libcall_value): New function.
* config/mmix/mmix-protos.h (mmix_function_outgoing_value,
mmix_function_value_regno_p): Remove declaration.
From-SVN: r159458
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/mmix/mmix-protos.h | 5 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.c | 38 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.h | 18 |
4 files changed, 47 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd3a80f..f3e8312 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2010-05-16 Anatoly Sokolov <aesok@post.ru> + + * config/mmix/mmix.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE, + LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros. + * config/mmix/mmix.c (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE, + TARGET_FUNCTION_VALUE_REGNO_P): Define. + (mmix_function_outgoing_value): Rename to... + (mmix_function_value): ...this. Make static. Add 'outgoing' argument. + (mmix_function_value_regno_p): Make static. + (mmix_libcall_value): New function. + * config/mmix/mmix-protos.h (mmix_function_outgoing_value, + mmix_function_value_regno_p): Remove declaration. + 2010-05-16 Eric Botcazou <ebotcazou@adacore.com> * tree.c (build_common_builtin_nodes): Always clear TREE_NOTHROW on diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h index 957164b..18d21f1 100644 --- a/gcc/config/mmix/mmix-protos.h +++ b/gcc/config/mmix/mmix-protos.h @@ -1,5 +1,6 @@ /* Prototypes for exported functions defined in mmix.c - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2010 + Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) This file is part of GCC. @@ -52,8 +53,6 @@ extern int mmix_local_regno (int); extern int mmix_dbx_register_number (int); extern int mmix_use_simple_return (void); extern void mmix_make_decl_one_only (tree); -extern rtx mmix_function_outgoing_value (const_tree, const_tree); -extern int mmix_function_value_regno_p (int); extern int mmix_data_alignment (tree, int); extern int mmix_constant_alignment (tree, int); extern int mmix_local_alignment (tree, int); diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index b589db9..7179301 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler, for MMIX. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) @@ -138,6 +139,9 @@ static rtx mmix_struct_value_rtx (tree, int); static enum machine_mode mmix_promote_function_mode (const_tree, enum machine_mode, int *, const_tree, int); +static rtx mmix_function_value (const_tree, const_tree, bool); +static rtx mmix_libcall_value (enum machine_mode, const_rtx); +static bool mmix_function_value_regno_p (const unsigned int); static bool mmix_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static bool mmix_frame_pointer_required (void); @@ -196,6 +200,12 @@ static void mmix_trampoline_init (rtx, tree, rtx); #undef TARGET_PROMOTE_FUNCTION_MODE #define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE mmix_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE mmix_libcall_value +#undef TARGET_FUNCTION_VALUE_REGNO_P +#define TARGET_FUNCTION_VALUE_REGNO_P mmix_function_value_regno_p #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx @@ -654,10 +664,12 @@ mmix_function_arg_regno_p (int regno, int incoming) && regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS; } -/* FUNCTION_OUTGOING_VALUE. */ +/* Implements TARGET_FUNCTION_VALUE. */ -rtx -mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED) +static rtx +mmix_function_value (const_tree valtype, + const_tree func ATTRIBUTE_UNUSED, + bool outgoing) { enum machine_mode mode = TYPE_MODE (valtype); enum machine_mode cmode; @@ -666,6 +678,9 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS int i; int nregs; + if (!outgoing) + return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM); + /* Return values that fit in a register need no special handling. There's no register hole when parameters are passed in global registers. */ @@ -717,10 +732,19 @@ mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUS return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec)); } -/* FUNCTION_VALUE_REGNO_P. */ +/* Implements TARGET_LIBCALL_VALUE. */ -int -mmix_function_value_regno_p (int regno) +static rtx +mmix_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM); +} + +/* Implements TARGET_FUNCTION_VALUE_REGNO_P. */ + +static bool +mmix_function_value_regno_p (const unsigned int regno) { return regno == MMIX_RETURN_VALUE_REGNUM; } diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 1e76e46..2886443 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for MMIX. - Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) @@ -613,22 +613,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS; mmix_function_arg_regno_p (REGNO, 0) -/* Node: Register Arguments */ - -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx_REG (TYPE_MODE (VALTYPE), MMIX_RETURN_VALUE_REGNUM) - -/* This needs to take care of the register hole for complex return values. */ -#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - mmix_function_outgoing_value (VALTYPE, FUNC) - -#define LIBCALL_VALUE(MODE) \ - gen_rtx_REG (MODE, MMIX_RETURN_VALUE_REGNUM) - -#define FUNCTION_VALUE_REGNO_P(REGNO) \ - mmix_function_value_regno_p (REGNO) - - /* Node: Caller Saves */ /* (empty) */ |