s390.h (REGISTER_MOVE_COST, [...]): Remove.

* config/s390/s390.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
	* config/s390/s390.c (s390_register_move_cost,
	s390_memory_move_cost): New.
	(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.

From-SVN: r169135
This commit is contained in:
Anatoly Sokolov 2011-01-23 00:38:39 +03:00 committed by Anatoly Sokolov
parent 0cecee061e
commit ccaed3ba91
3 changed files with 36 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2011-01-22 Anatoly Sokolov <aesok@post.ru>
* config/s390/s390.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
* config/s390/s390.c (s390_register_move_cost,
s390_memory_move_cost): New.
(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
2011-01-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2011-01-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
PR middle-end/47401 PR middle-end/47401

View File

@ -2426,6 +2426,31 @@ s390_float_const_zero_p (rtx value)
&& value == CONST0_RTX (GET_MODE (value))); && value == CONST0_RTX (GET_MODE (value)));
} }
/* Implement TARGET_REGISTER_MOVE_COST. */
static int
s390_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
reg_class_t from, reg_class_t to)
{
/* On s390, copy between fprs and gprs is expensive. */
if ((reg_classes_intersect_p (from, GENERAL_REGS)
&& reg_classes_intersect_p (to, FP_REGS))
|| (reg_classes_intersect_p (from, FP_REGS)
&& reg_classes_intersect_p (to, GENERAL_REGS)))
return 10;
return 1;
}
/* Implement TARGET_MEMORY_MOVE_COST. */
static int
s390_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
reg_class_t rclass ATTRIBUTE_UNUSED,
bool in ATTRIBUTE_UNUSED)
{
return 1;
}
/* Compute a (partial) cost for rtx X. Return true if the complete /* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be cost has been computed, and false if subexpressions should be
@ -10640,6 +10665,10 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
#define TARGET_RTX_COSTS s390_rtx_costs #define TARGET_RTX_COSTS s390_rtx_costs
#undef TARGET_ADDRESS_COST #undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST s390_address_cost #define TARGET_ADDRESS_COST s390_address_cost
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST s390_register_move_cost
#undef TARGET_MEMORY_MOVE_COST
#define TARGET_MEMORY_MOVE_COST s390_memory_move_cost
#undef TARGET_MACHINE_DEPENDENT_REORG #undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg #define TARGET_MACHINE_DEPENDENT_REORG s390_reorg

View File

@ -780,18 +780,6 @@ do { \
/* Relative costs of operations. */ /* Relative costs of operations. */
/* On s390, copy between fprs and gprs is expensive. */
#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
(( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \
&& reg_classes_intersect_p ((CLASS2), FP_REGS)) \
|| ( reg_classes_intersect_p ((CLASS1), FP_REGS) \
&& reg_classes_intersect_p ((CLASS2), GENERAL_REGS))) ? 10 : 1)
/* A C expression for the cost of moving data of mode M between a
register and memory. A value of 2 is the default; this cost is
relative to those in `REGISTER_MOVE_COST'. */
#define MEMORY_MOVE_COST(M, C, I) 1
/* A C expression for the cost of a branch instruction. A value of 1 /* A C expression for the cost of a branch instruction. A value of 1
is the default; other values are interpreted relative to that. */ is the default; other values are interpreted relative to that. */
#define BRANCH_COST(speed_p, predictable_p) 1 #define BRANCH_COST(speed_p, predictable_p) 1