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]

Re: [PATCH, ARM] Add Thumb-2-specific pattern for addsi3_compare0


On Fri, 2010-05-28 at 12:40 +0100, Julian Brown wrote:
> Hi,
> 
> For the addsi3_compare0 pattern in Thumb-2 mode, GCC emits a wide
> instruction for immediate cases, e.g.:
> 
>     adds r5, r5, #4294967295
> 
> when there is often a narrow instruction which can be used instead,
> i.e.:
> 
>     subs r5, r5, #1
> 
> This patch adds a Thumb-2 version of the pattern (preferring low
> registers) to use the latter instruction instead (flags are set the same
> by both instructions). This provides a small but entirely positive size
> improvement on a well-known benchmark (<0.1% geometric mean, comparing
> object text sizes before/after).
> 
> Tested against on mainline (cross to ARM Linux).
> 
> OK to apply?
> 
> Julian
> 
> ChangeLog
> 
>     gcc/
>     * config/arm/thumb2.md (*thumb2_addsi3_compare0): New.
>     (*thumb2_addsi3_compare0_scratch): New.
>     * config/arm/constraints.md (Pv): New.
>     * config/arm/arm.md (*addsi3_compare0): Remove FIXME comment. Use
>     for ARM mode only.
>     (*addsi3_compare0_scratch): Likewise.

OK.

R.


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