This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ARM: gas not detecting invalid operands for Thumb2 ADD{S} and SUB{S}
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sourceware dot org
- Cc: Paul Carroll <pcarroll at codesourcery dot com>
- Date: Fri, 11 Mar 2011 13:26:33 +0000
- Subject: Re: [PATCH] ARM: gas not detecting invalid operands for Thumb2 ADD{S} and SUB{S}
- References: <4D6BEC05.2010607@codesourcery.com>
> In ARMv6T2 and ARMv7 Thumb2, the ADD, ADDS, SUB, and SUBS instructions
> added several new instruction forms. One of the new forms allowed is:
>
> ADD{S}<c>.W <Rd>,SP,<Rm>{,<shift>}
> SUB{S}<c>.W <Rd>,SP,<Rm>{,<shift>}
The "added new forms" is mainly an artifact of how the new documentation is
structured. If you're starting from the ARM instruction set (or from the
encodings) then it's actually new restrictions on where r13 (aka SP) may be
used.
The patch looks ok, though I think the testcases could use some
reorganisation. I'd prefer two assembly files, one with insns valid in both
ARM and Thumb mode, the other which is only valid in ARM mode. Assemble both
in both modes. There should already be existing tests
(e.g. sp-pc-usage-t) that cover the former.
> +@ test case of ADD{S} and SUB{S} instructions in ARM mode
Too vague. You're testing use of SP in these insns.
> + .file "s6163c.c"
Looks bogus.
Paul