This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, ARM, GAS] Fix single-reg LDM/STM to LDR/STR translation.
On Fri, 2010-09-17 at 14:59 +0100, Richard Earnshaw wrote:
> On Fri, 2010-09-17 at 11:06 +0100, Tejas Belagod wrote:
> > Hi,
> >
> > The attached patch fixes the translation of single-register LDM/STM. For
> > instruction like:
> > STMIA sp, {r1}
> > this patch chooses to encode this as
> > STR r1, [sp, #0]
> > which can fit into a 16-bit thumb encoding. This is in line with what
> > the ARM ARM has to say about choosing encodings for STM:
> >
> > "Encoding T2 does not support a list containing only one register. If an
> > STM instruction with just one register <Rt> in the list is assembled to
> > Thumb and encoding T1 is not available, it is assembled to the
> > equivalent STR<c><q> <Rt>,[<Rn>]{,#4} instruction"
> >
> > For LDM/STM with single-register list that can't fit into 16-bit
> > encoding after translation to STR/LDR, 32-bit encoding is used. Care
> > also has been taken to record UNPREDICTABLE errors where necessary.
> >
> > Tested with arm-none-eabi. OK?
> >
> > --
> > Tejas Belagod
> > ARM.
> >
> > Changelog:
> >
> > gas/
> >
> > 2010-09-17 Tejas Belagod <tejas.belagod@arm.com>
> >
> > * config/tc-arm.c (do_t_ldmstm): Add logic to handle
> > single-register list for ldm/stm.
> >
> > gas/testsuite
> >
> > 2010-09-17 Tejas Belagod <tejas.belagod@arm.com>
> >
> > * gas/arm/thumb2_ldmstm.d: Change single-register stmia to use
> > 16-bit str encoding instead of str.w. Likewise for ldmia.
> > * gas/arm/thumb2_ldmstm.s: Change stmia comment. Add tests for
> > T1 ldmia-to-ldr.
>
> This is OK.
>
> R.
>
I've checked this in on Tejas' behalf. Please see:
http://sourceware.org/ml/binutils-cvs/2010-09/msg00106.html
Thanks,
Matt
--
Matthew Gretton-Dann
Principal Engineer - PDSW Tools
ARM Ltd