]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/mmix/mmix.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 May 2010 16:51:40 +0000 (16:51 +0000)
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 May 2010 16:51:40 +0000 (16:51 +0000)
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.

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

gcc/ChangeLog
gcc/config/mmix/mmix-protos.h
gcc/config/mmix/mmix.c
gcc/config/mmix/mmix.h

index cd3a80fd95295b5dd83a84efb1100422a0baba46..f3e83122d1d208b133d2195f30176606cba75679 100644 (file)
@@ -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
index 957164b468b371e6fca16a0d2c45cfcd66ad2f91..18d21f1650eb9282a93586d5b44520905b164dbd 100644 (file)
@@ -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);
index b589db96ea68acd781086580da30ddc36ef09e90..7179301432199378b90b4c6133051a9e5a01d6b2 100644 (file)
@@ -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;
 }
index 1e76e460939267b5c908ca299d21342b3feee612..2886443c66da7018116c3e17f69ac7bc2f054fa3 100644 (file)
@@ -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) */