diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-06-08 22:14:28 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-06-08 22:14:28 +0400 |
commit | c547eb0db1e58bbe7346705cc35ac36891fee425 (patch) | |
tree | eed44730b88165f0d88cec30afff025f75bef4bd | |
parent | 6f5e9b8df6cdb8d8905816a53b09fd57a3a8ce49 (diff) | |
download | gcc-c547eb0db1e58bbe7346705cc35ac36891fee425.tar.gz |
pdp11.h (FUNCTION_VALUE, [...]): Remove macros.
* config/pdp11/pdp11.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros.
* config/pdp11/pdp11.c (moxie_function_value, moxie_libcall_value,
moxie_function_value_regno_p): New functions.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Define.
From-SVN: r160444
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.c | 46 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.h | 27 |
3 files changed, 55 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 486b3cf2f6e..71376663bed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-06-08 Anatoly Sokolov <aesok@post.ru> + + * config/pdp11/pdp11.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE, + LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove macros. + * config/pdp11/pdp11.c (moxie_function_value, moxie_libcall_value, + moxie_function_value_regno_p): New functions. + (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE, + TARGET_FUNCTION_VALUE_REGNO_P): Define. + 2010-06-08 Kazu Hirata <kazu@codesourcery.com> * config/arm/arm.c (arm_rtx_costs_1): Don't special case for diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index 733bf756c3e..15e8a545f09 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -1,6 +1,6 @@ /* Subroutines for gcc2 for pdp11. Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004, 2005, - 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). This file is part of GCC. @@ -151,6 +151,9 @@ static void pdp11_output_function_prologue (FILE *, HOST_WIDE_INT); static void pdp11_output_function_epilogue (FILE *, HOST_WIDE_INT); static bool pdp11_rtx_costs (rtx, int, int, int *, bool); static bool pdp11_return_in_memory (const_tree, const_tree); +static rtx pdp11_function_value (const_tree, const_tree, bool); +static rtx pdp11_libcall_value (enum machine_mode, const_rtx); +static bool pdp11_function_value_regno_p (const unsigned int); static void pdp11_trampoline_init (rtx, tree, rtx); /* Initialize the GCC target structure. */ @@ -185,6 +188,13 @@ static void pdp11_trampoline_init (rtx, tree, rtx); #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY pdp11_return_in_memory +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE pdp11_function_value +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE pdp11_libcall_value +#undef TARGET_FUNCTION_VALUE_REGNO_P +#define TARGET_FUNCTION_VALUE_REGNO_P pdp11_function_value_regno_p + #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT pdp11_trampoline_init @@ -1744,6 +1754,40 @@ pdp11_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) || (TYPE_MODE (type) == DFmode && ! TARGET_AC0)); } +/* Worker function for TARGET_FUNCTION_VALUE. + + On the pdp11 the value is found in R0 (or ac0??? not without FPU!!!! ) */ + +static rtx +pdp11_function_value (const_tree valtype, + const_tree fntype_or_decl ATTRIBUTE_UNUSED, + bool outgoing ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (TYPE_MODE (valtype), + BASE_RETURN_VALUE_REG(TYPE_MODE(valtype))); +} + +/* Worker function for TARGET_LIBCALL_VALUE. */ + +static rtx +pdp11_libcall_value (enum machine_mode mode, + const_rtx fun ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (mode, BASE_RETURN_VALUE_REG(mode)); +} + +/* Worker function for TARGET_FUNCTION_VALUE_REGNO_P. + + On the pdp, the first "output" reg is the only register thus used. + + maybe ac0 ? - as option someday! */ + +static bool +pdp11_function_value_regno_p (const unsigned int regno) +{ + return (regno == 0) || (TARGET_AC0 && (regno == 8)); +} + /* Worker function for TARGET_TRAMPOLINE_INIT. trampoline - how should i do it in separate i+d ? diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index a08f7239e10..15eef844a34 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for the pdp-11 Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005, - 2006, 2007, 2008 Free Software Foundation, Inc. + 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). This file is part of GCC. @@ -450,31 +450,6 @@ extern int current_first_parm_offset; #define BASE_RETURN_VALUE_REG(MODE) \ ((MODE) == DFmode ? 8 : 0) -/* On the pdp11 the value is found in R0 (or ac0??? -not without FPU!!!! ) */ - -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) - -/* and the called function leaves it in the first register. - Difference only on machines with register windows. */ - -#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) - -/* Define how to find the value returned by a library function - assuming the value has mode MODE. */ - -#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, BASE_RETURN_VALUE_REG(MODE)) - -/* 1 if N is a possible register number for a function value - as seen by the caller. - On the pdp, the first "output" reg is the only register thus used. - -maybe ac0 ? - as option someday! */ - -#define FUNCTION_VALUE_REGNO_P(N) (((N) == 0) || (TARGET_AC0 && (N) == 8)) - /* 1 if N is a possible register number for function argument passing. - not used on pdp */ |