From: Anatoly Sokolov Date: Fri, 30 Dec 2011 18:56:49 +0000 (+0400) Subject: bfin.h (REGISTER_MOVE_COST, [...]): Remove. X-Git-Tag: upstream/12.2.0~78853 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30c34af582f54fa59d3983ef5d091b427dab8f7f;p=platform%2Fupstream%2Fgcc.git bfin.h (REGISTER_MOVE_COST, [...]): Remove. * config/bfin/bfin.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. * config/bfin/bfin-protos.h (bfin_register_move_cost, bfin_memory_move_cost): Remove. * config/bfin/bfin.c (bfin_register_move_cost, bfin_memory_move_cost): Make static. Change arguments type from enum reg_class to reg_class_t and from int to bool. (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define. From-SVN: r182745 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4ee25a..60e915f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-12-30 Anatoly Sokolov + + * config/bfin/bfin.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. + * config/bfin/bfin-protos.h (bfin_register_move_cost, + bfin_memory_move_cost): Remove. + * config/bfin/bfin.c (bfin_register_move_cost, + bfin_memory_move_cost): Make static. Change arguments type from + enum reg_class to reg_class_t and from int to bool. + (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define. + 2011-12-30 Nathan Sidwell * gcov.c (total_lines, total_executed): New global vars. diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h index 7ee826e..a76210f 100644 --- a/gcc/config/bfin/bfin-protos.h +++ b/gcc/config/bfin/bfin-protos.h @@ -85,9 +85,6 @@ extern bool bfin_longcall_p (rtx, int); extern bool bfin_dsp_memref_p (rtx); extern bool bfin_expand_movmem (rtx, rtx, rtx, rtx); -extern int bfin_register_move_cost (enum machine_mode, enum reg_class, - enum reg_class); -extern int bfin_memory_move_cost (enum machine_mode, enum reg_class, int in); extern enum reg_class secondary_input_reload_class (enum reg_class, enum machine_mode, rtx); diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 8a0d5a0..28ec6ef 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -2149,12 +2149,11 @@ bfin_vector_mode_supported_p (enum machine_mode mode) return mode == V2HImode; } -/* Return the cost of moving data from a register in class CLASS1 to - one in class CLASS2. A cost of 2 is the default. */ +/* Worker function for TARGET_REGISTER_MOVE_COST. */ -int +static int bfin_register_move_cost (enum machine_mode mode, - enum reg_class class1, enum reg_class class2) + reg_class_t class1, reg_class_t class2) { /* These need secondary reloads, so they're more expensive. */ if ((class1 == CCREGS && !reg_class_subset_p (class2, DREGS)) @@ -2177,18 +2176,16 @@ bfin_register_move_cost (enum machine_mode mode, return 2; } -/* Return 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'. +/* Worker function for TARGET_MEMORY_MOVE_COST. ??? In theory L1 memory has single-cycle latency. We should add a switch that tells the compiler whether we expect to use only L1 memory for the program; it'll make the costs more accurate. */ -int +static int bfin_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, - enum reg_class rclass, - int in ATTRIBUTE_UNUSED) + reg_class_t rclass, + bool in ATTRIBUTE_UNUSED) { /* Make memory accesses slightly more expensive than any register-register move. Also, penalize non-DP registers, since they need secondary @@ -5703,6 +5700,12 @@ bfin_conditional_register_usage (void) #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST bfin_address_cost +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST bfin_register_move_cost + +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST bfin_memory_move_cost + #undef TARGET_ASM_INTEGER #define TARGET_ASM_INTEGER bfin_assemble_integer diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index a16feca..cc3b14f 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -975,29 +975,6 @@ typedef struct { /* Do not put function addr into constant pool */ #define NO_FUNCTION_CSE 1 -/* A C expression for the cost of moving data from a register in class FROM to - one in class TO. The classes are expressed using the enumeration values - such as `GENERAL_REGS'. A value of 2 is the default; other values are - interpreted relative to that. - - It is not required that the cost always equal 2 when FROM is the same as TO; - on some machines it is expensive to move between registers if they are not - general registers. */ - -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ - bfin_register_move_cost ((MODE), (CLASS1), (CLASS2)) - -/* 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'. - - If moving between registers and memory is more expensive than - between two registers, you should define this macro to express the - relative cost. */ - -#define MEMORY_MOVE_COST(MODE, CLASS, IN) \ - bfin_memory_move_cost ((MODE), (CLASS), (IN)) - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE SImode