Commit c547eb0d by Anatoly Sokolov Committed by Anatoly Sokolov

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
parent 6f5e9b8d
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
......
/* 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 ?
......
/* 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment