This is the mail archive of the
mailing list for the GCC project.
Thumb-2 size costs
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Mar 2008 22:03:55 +0000
- Subject: 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.
2008-03-12 Paul Brook <firstname.lastname@example.org>
* config/arm/arm.c (arm_size_rtx_costs): Use ARM costs for Thumb-2.
--- 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);
+ /* FIXME: This makes no attempt to prefer narrow Thumb-2 instructions. */