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]

Thumb-2 size costs


The patch below makes the ARM backend use the ARM size_rtx_costs for Thumb-2, 
not the Thumb-1 costs.  The ARM costs over-estimate the cost when narrow 
instructions can be used, and the Thumb costs excessively penalise operations 
that can only be performaned with wide instructions.  Neither of these are 
ideal, but in practice the ARM costs work better.

I did make a quick hack to include the difference between ARM and Thumb-2 
shifter operands.  However this didn't make any measurable difference over a 
selection of linux apps so I've left that bit out.

Tested on arm-none-eabi.
Applied to svn trunk.

Paul

2008-03-12  Paul Brook  <paul@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_size_rtx_costs): Use ARM costs for Thumb-2.

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 179514)
+++ gcc/config/arm/arm.c	(revision 179515)
@@ -5117,13 +5117,14 @@ arm_size_rtx_costs (rtx x, int code, int
 {
   enum machine_mode mode = GET_MODE (x);
 
-  if (TARGET_THUMB)
+  if (TARGET_THUMB1)
     {
       /* XXX TBD.  For now, use the standard costs.  */
       *total = thumb1_rtx_costs (x, code, outer_code);
       return true;
     }
 
+  /* FIXME: This makes no attempt to prefer narrow Thumb-2 instructions.  */
   switch (code)
     {
     case MEM:


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