This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RX: Adjust memory move cost
- From: Nick Clifton <nickc at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 17 Mar 2011 10:51:51 +0000
- Subject: 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))