From ccaed3ba91952bdc19aecce21d49714c5599ad2d Mon Sep 17 00:00:00 2001 From: Anatoly Sokolov Date: Sun, 23 Jan 2011 00:38:39 +0300 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/s390/s390.c | 29 +++++++++++++++++++++++++++++ gcc/config/s390/s390.h | 12 ------------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df4658b3fe0..8e152821f8f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-01-22 Anatoly Sokolov + + * 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 PR middle-end/47401 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index efbf03503d0..4bc73625b6e 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2426,6 +2426,31 @@ s390_float_const_zero_p (rtx 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 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 #undef TARGET_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 #define TARGET_MACHINE_DEPENDENT_REORG s390_reorg diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index ed0a2aa546c..824864fec97 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -780,18 +780,6 @@ do { \ /* 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 is the default; other values are interpreted relative to that. */ #define BRANCH_COST(speed_p, predictable_p) 1