Commit 69e18c09 by Anatoly Sokolov Committed by Anatoly Sokolov

ia64.h (MEMORY_MOVE_COST): Remove macro.

	* 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
parent 16ad8025
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> 2010-07-05 Sandra Loosemore <sandra@codesourcery.com>
PR middle-end/42505 PR middle-end/42505
......
...@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h" #include "dbgcnt.h"
#include "tm-constrs.h" #include "tm-constrs.h"
#include "sel-sched.h" #include "sel-sched.h"
#include "reload.h"
/* This is used for communication between ASM_OUTPUT_LABEL and /* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */ ASM_OUTPUT_LABELREF. */
...@@ -212,6 +213,8 @@ static rtx ia64_libcall_value (enum machine_mode, const_rtx); ...@@ -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 bool ia64_function_value_regno_p (const unsigned int);
static int ia64_register_move_cost (enum machine_mode, reg_class_t, static int ia64_register_move_cost (enum machine_mode, reg_class_t,
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 bool ia64_rtx_costs (rtx, int, int, int *, bool);
static int ia64_unspec_may_trap_p (const_rtx, unsigned); static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *); static void fix_range (const char *);
...@@ -458,6 +461,8 @@ static const struct attribute_spec ia64_attribute_table[] = ...@@ -458,6 +461,8 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_REGISTER_MOVE_COST #undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST ia64_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 #undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs #define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST #undef TARGET_ADDRESS_COST
...@@ -5229,12 +5234,12 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i, ...@@ -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, /* Moving from FR<->GR in XFmode must be more expensive than 2,
so that we get secondary memory reloads. Between FR_REGS, 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. */ to avoid spectacularly poor register class preferencing. */
if (mode == XFmode || mode == RFmode) if (mode == XFmode || mode == RFmode)
{ {
if (to != GR_REGS || from != GR_REGS) if (to != GR_REGS || from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0); return memory_move_cost (mode, to, false);
else else
return 3; return 3;
} }
...@@ -5247,20 +5252,20 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i, ...@@ -5247,20 +5252,20 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
return 3; return 3;
/* Moving between PR and anything but GR is impossible. */ /* Moving between PR and anything but GR is impossible. */
if (from != GR_REGS) if (from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0); return memory_move_cost (mode, to, false);
break; break;
case BR_REGS: case BR_REGS:
/* Moving between BR and anything but GR is impossible. */ /* Moving between BR and anything but GR is impossible. */
if (from != GR_REGS && from != GR_AND_BR_REGS) if (from != GR_REGS && from != GR_AND_BR_REGS)
return MEMORY_MOVE_COST (mode, to, 0); return memory_move_cost (mode, to, false);
break; break;
case AR_I_REGS: case AR_I_REGS:
case AR_M_REGS: case AR_M_REGS:
/* Moving between AR and anything but GR is impossible. */ /* Moving between AR and anything but GR is impossible. */
if (from != GR_REGS) if (from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0); return memory_move_cost (mode, to, false);
break; break;
case GR_REGS: case GR_REGS:
...@@ -5278,6 +5283,23 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i, ...@@ -5278,6 +5283,23 @@ ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
return 2; 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 /* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on RCLASS
to use when copying X into that class. */ to use when copying X into that class. */
......
/* Definitions of target machine GNU compiler. IA-64 version. /* Definitions of target machine GNU compiler. IA-64 version.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 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 Contributed by James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>. David Mosberger <davidm@hpl.hp.com>.
...@@ -1304,12 +1304,6 @@ do { \ ...@@ -1304,12 +1304,6 @@ do { \
/* Describing Relative Costs of Operations */ /* 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 /* 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 default; other values are interpreted relative to that. Used by the
if-conversion code as max instruction count. */ if-conversion code as max instruction count. */
......
# 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. # Free Software Foundation, Inc.
# #
# This file is part of GCC. # This file is part of GCC.
...@@ -53,4 +54,4 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \ ...@@ -53,4 +54,4 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
# genattrtab generates very long string literals. # genattrtab generates very long string literals.
insn-attrtab.o-warn = -Wno-error 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
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