ia64.h (MEMORY_MOVE_COST): Remove macro.
authorAnatoly Sokolov <aesok@post.ru>
Mon, 5 Jul 2010 17:49:56 +0000 (21:49 +0400)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Mon, 5 Jul 2010 17:49:56 +0000 (21:49 +0400)
* config/ia64/ia64.h (MEMORY_MOVE_COST): Remove macro.
* config/ia64/t-ia64 (ia64.o): Depend on reload.h.
* config/ia64/ia64.c Include reload.h.
(ia64_memory_move_cost): New function.
(TARGET_MEMORY_MOVE_COST): Define.
(ia64_register_move_cost): Replace MEMORY_MOVE_COST with
memory_move_cost.

From-SVN: r161845

gcc/ChangeLog
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h
gcc/config/ia64/t-ia64

index eb2d24b..d96152e 100644 (file)
@@ -1,3 +1,13 @@
+2010-07-05  Anatoly Sokolov  <aesok@post.ru>
+
+       * config/ia64/ia64.h (MEMORY_MOVE_COST): Remove macro.
+       * config/ia64/t-ia64 (ia64.o): Depend on reload.h.
+       * config/ia64/ia64.c Include reload.h.
+       (ia64_memory_move_cost): New function.
+       (TARGET_MEMORY_MOVE_COST): Define.
+       (ia64_register_move_cost): Replace MEMORY_MOVE_COST with
+       memory_move_cost.
+
 2010-07-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        PR middle-end/42505
index 7df747b..c00aa7f 100644 (file)
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dbgcnt.h"
 #include "tm-constrs.h"
 #include "sel-sched.h"
+#include "reload.h"
 
 /* This is used for communication between ASM_OUTPUT_LABEL and
    ASM_OUTPUT_LABELREF.  */
@@ -212,6 +213,8 @@ static rtx ia64_libcall_value (enum machine_mode, const_rtx);
 static bool ia64_function_value_regno_p (const unsigned int);
 static int ia64_register_move_cost (enum machine_mode, reg_class_t,
                                     reg_class_t);
+static int ia64_memory_move_cost (enum machine_mode mode, reg_class_t,
+                                 bool);
 static bool ia64_rtx_costs (rtx, int, int, int *, bool);
 static int ia64_unspec_may_trap_p (const_rtx, unsigned);
 static void fix_range (const char *);
@@ -458,6 +461,8 @@ static const struct attribute_spec ia64_attribute_table[] =
 
 #undef TARGET_REGISTER_MOVE_COST
 #define TARGET_REGISTER_MOVE_COST ia64_register_move_cost
+#undef TARGET_MEMORY_MOVE_COST
+#define TARGET_MEMORY_MOVE_COST ia64_memory_move_cost
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS ia64_rtx_costs
 #undef TARGET_ADDRESS_COST
@@ -5229,12 +5234,12 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
 
   /* Moving from FR<->GR in XFmode must be more expensive than 2,
      so that we get secondary memory reloads.  Between FR_REGS,
-     we have to make this at least as expensive as MEMORY_MOVE_COST
+     we have to make this at least as expensive as memory_move_cost
      to avoid spectacularly poor register class preferencing.  */
   if (mode == XFmode || mode == RFmode)
     {
       if (to != GR_REGS || from != GR_REGS)
-        return MEMORY_MOVE_COST (mode, to, 0);
+        return memory_move_cost (mode, to, false);
       else
        return 3;
     }
@@ -5247,20 +5252,20 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
        return 3;
       /* Moving between PR and anything but GR is impossible.  */
       if (from != GR_REGS)
-       return MEMORY_MOVE_COST (mode, to, 0);
+       return memory_move_cost (mode, to, false);
       break;
 
     case BR_REGS:
       /* Moving between BR and anything but GR is impossible.  */
       if (from != GR_REGS && from != GR_AND_BR_REGS)
-       return MEMORY_MOVE_COST (mode, to, 0);
+       return memory_move_cost (mode, to, false);
       break;
 
     case AR_I_REGS:
     case AR_M_REGS:
       /* Moving between AR and anything but GR is impossible.  */
       if (from != GR_REGS)
-       return MEMORY_MOVE_COST (mode, to, 0);
+       return memory_move_cost (mode, to, false);
       break;
 
     case GR_REGS:
@@ -5278,6 +5283,23 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
   return 2;
 }
 
+/* Calculate the cost of moving data of MODE from a register to or from
+   memory.  */
+
+static int
+ia64_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+                      reg_class_t rclass,
+                      bool in ATTRIBUTE_UNUSED)
+{
+  if (rclass == GENERAL_REGS
+      || rclass == FR_REGS
+      || rclass == FP_REGS
+      || rclass == GR_AND_FR_REGS)
+    return 4;
+  else
+    return 10;
+}
+
 /* Implement PREFERRED_RELOAD_CLASS.  Place additional restrictions on RCLASS
    to use when copying X into that class.  */
 
index d3821f6..f631cee 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine GNU compiler.  IA-64 version.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009 Free Software Foundation, Inc.
+   2009, 2010 Free Software Foundation, Inc.
    Contributed by James E. Wilson <wilson@cygnus.com> and
                  David Mosberger <davidm@hpl.hp.com>.
 
@@ -1304,12 +1304,6 @@ do {                                                                     \
 \f
 /* Describing Relative Costs of Operations */
 
-/* A C expression for the cost of moving data of mode M between a
-   register and memory.  */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
-  ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS || (CLASS) == FP_REGS \
-   || (CLASS) == GR_AND_FR_REGS ? 4 : 10)
-
 /* A C expression for the cost of a branch instruction.  A value of 1 is the
    default; other values are interpreted relative to that.  Used by the
    if-conversion code as max instruction count.  */
index 212bef7..d11a004 100644 (file)
@@ -1,4 +1,5 @@
-# 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.
 #
 # This file is part of GCC.
@@ -53,4 +54,4 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
 # genattrtab generates very long string literals.
 insn-attrtab.o-warn = -Wno-error
 
-ia64.o: debug.h $(PARAMS_H) sel-sched.h
+ia64.o: debug.h $(PARAMS_H) sel-sched.h reload.h