This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Add Thumb-2-specific pattern for addsi3_compare0
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, paul at codesourcery dot com
- Date: Fri, 28 May 2010 14:09:17 +0100
- Subject: Re: [PATCH, ARM] Add Thumb-2-specific pattern for addsi3_compare0
- References: <20100528124017.1849a6c9@rex.config>
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.