]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/pdp11/pdp11.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Jun 2010 18:14:28 +0000 (18:14 +0000)
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Jun 2010 18:14:28 +0000 (18:14 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160444 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/pdp11/pdp11.c
gcc/config/pdp11/pdp11.h

index 486b3cf2f6e97878e433676d6d3c1b2269f5222c..71376663bed20196b0f5da41ed19f658c5d253ea 100644 (file)
@@ -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
index 733bf756c3e7c4eeae1496383b27fe639ce67fac..15e8a545f09eece446bfbe9c58de33bf21acf276 100644 (file)
@@ -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);
 \f
 /* 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 ? 
index a08f7239e10f7bd613236b59512602e0ef8cc11c..15eef844a340ff2e451564ebfbdbcd07d4d248ba 100644 (file)
@@ -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 */