This is the mail archive of the
mailing list for the GCC project.
Re: Improve additions involving SP on Thumb-1
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jul 2010 09:26:32 +0100
- Subject: Re: Improve additions involving SP on Thumb-1
- References: <4C44E173.firstname.lastname@example.org>
On Tue, 2010-07-20 at 01:36 +0200, Bernd Schmidt wrote:
> Thumb-1 supports a range of up to 1020 for add insns of the form
> add rn, sp, #1020
> If the constant is somewhat larger, we can do it with a sequence of two
> adds, which is better than the available alternatives:
> - ldr r4, .L64+12
> - add r4, r4, sp
> + add r4, sp, #1020
> + add r4, r4, #224
> - mov r0, #156
> - lsl r0, r0, #3
> - add r0, r0, sp
> + add r0, sp, #1020
> + add r0, r0, #228
> It's conceivable that we might even prefer a three-insn add sequence
> over either of these alternatives, but the following patch doesn't do this.
> Regression tested on arm-linux, with one extra timeout (which comes and
> goes - it went away vs. baseline for a different set of compiler flags).
Please also update the list of multi-list constants in the comment near
the start of constraints.md.
OK with that change.