* config/m32r/m32r.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 2010 20:03:14 +0000 (20:03 +0000)
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 2010 20:03:14 +0000 (20:03 +0000)
* config/m32r/m32r.c (TARGET_MEMORY_MOVE_COSTS): Define.
(m32r_memory_move_cost): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163966 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h

index 6ad6ff3..664f10d 100644 (file)
@@ -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.
index 33e3bfb..5fff1cc 100644 (file)
@@ -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)
 \f
 /* 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)
index 2ea0d31..66ff1ec 100644 (file)
@@ -1067,16 +1067,6 @@ L2:     .word STATIC
 \f
 /* 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