This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RX: Adjust memory move cost


Hi Guys,

  I am applying the patch below to tweak the MEMORY_MOVE_COST macro for
  the RX port on the 4.5 branch.  Writing to memory is actually faster
  than reading on the RX, so the cost can be reduced as shown.

Cheers
  Nick

gcc/ChangeLog
2011-03-17  Nick Clifton  <nickc@redhat.com>

	* config/rx/rx.h (MEMORY_MOVE_COST): Reduce the cost of stores.

Index: gcc/config/rx/rx.h
===================================================================
--- gcc/config/rx/rx.h	(revision 171086)
+++ gcc/config/rx/rx.h	(working copy)
@@ -659,7 +659,8 @@
 
 #define BRANCH_COST(SPEED, PREDICT)           1
 #define REGISTER_MOVE_COST(MODE, FROM, TO)    2
-#define MEMORY_MOVE_COST(MODE, REGCLASS, IN) (2 + memory_move_secondary_cost (MODE, REGCLASS, IN))
+#define MEMORY_MOVE_COST(MODE, REGCLASS, IN) \
+  (((IN) ? 2 : 0) + memory_move_secondary_cost (MODE, REGCLASS, IN))
   
 #define SELECT_CC_MODE(OP,X,Y)  rx_select_cc_mode ((OP), (X), (Y))
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]