diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-09-08 00:03:14 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-09-08 00:03:14 +0400 |
commit | 7149f02cac5d517914046bcaa429ad784a9066ae (patch) | |
tree | 98e9028e60148534ddf3c727a91e7f6e274a70b3 | |
parent | 21e928492982646038dfc5562686200d329d9cfd (diff) | |
download | gcc-7149f02cac5d517914046bcaa429ad784a9066ae.zip gcc-7149f02cac5d517914046bcaa429ad784a9066ae.tar.gz gcc-7149f02cac5d517914046bcaa429ad784a9066ae.tar.bz2 |
m32r.h (REGISTER_MOVE_COST, [...]): Remove.
* config/m32r/m32r.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
* config/m32r/m32r.c (TARGET_MEMORY_MOVE_COSTS): Define.
(m32r_memory_move_cost): New function.
From-SVN: r163966
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.c | 20 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.h | 10 |
3 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ad6ff3..664f10d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-09-07 Anatoly Sokolov <aesok@post.ru> + + * config/m32r/m32r.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. + * config/m32r/m32r.c (TARGET_MEMORY_MOVE_COSTS): Define. + (m32r_memory_move_cost): New function. + 2010-09-07 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Append t-android for Android targets. diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 33e3bfb..5fff1cc 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -89,6 +89,7 @@ static void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); static void init_idents (void); static bool m32r_rtx_costs (rtx, int, int, int *, bool speed); +static int m32r_memory_move_cost (enum machine_mode, reg_class_t, bool); static bool m32r_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, @@ -152,6 +153,9 @@ static const struct attribute_spec m32r_attribute_table[] = #undef TARGET_IN_SMALL_DATA_P #define TARGET_IN_SMALL_DATA_P m32r_in_small_data_p + +#undef TARGET_MEMORY_MOVE_COSTS +#define TARGET_MEMORY_MOVE_COSTS m32r_memory_move_costs #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m32r_rtx_costs #undef TARGET_ADDRESS_COST @@ -1366,6 +1370,22 @@ m32r_issue_rate (void) /* Cost functions. */ +/* Implement TARGET_HANDLE_OPTION. + + Memory is 3 times as expensive as registers. + ??? Is that the right way to look at it? */ + +static int +m32r_memory_move_cost (enum machine_mode mode, + reg_class_t rclass ATTRIBUTE_UNUSED, + bool in ATTRIBUTE_UNUSED) +{ + if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD) + return 6; + else + return 12; +} + static bool m32r_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total, bool speed ATTRIBUTE_UNUSED) diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index 2ea0d31..66ff1ec 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1067,16 +1067,6 @@ L2: .word STATIC /* Costs. */ -/* Compute extra cost of moving data between one register class - and another. */ -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 2 - -/* Compute the cost of moving data between registers and memory. */ -/* Memory is 3 times as expensive as registers. - ??? Is that the right way to look at it? */ -#define MEMORY_MOVE_COST(MODE,CLASS,IN_P) \ -(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12) - /* The cost of a branch insn. */ /* A value of 2 here causes GCC to avoid using branches in comparisons like while (a < N && a). Branches aren't that expensive on the M32R so |