LDMIA instruction allows high registers for v7m architechture

Hi All,
It looks like ARM assembly parser is allowing high registers in LDMIA instruction for v7m architechure.
Specification for Cortex-M3 device specifies that high registers should not be allowed in LDMIA instruction.

cat ldmstm.s :-
ldmia r0!,{r1-r3,r13, r15}

GNU assembler version 2.22 (arm-linux-gnueabi) using BFD version (GNU Binutils) 2.22

jyoti.allur@jyotiallur-ubuntu:~/test/ARM$ /opt/tools/arm-linux-gnueabi-gcc-4.5/bin/arm-linux-gnueabi-as -mthumb -mcpu=cortex-m3 ldmstm.s
ldmstm.s: Assembler messages:
ldmstm.s:2: Error: lo register required – `ldmia r0!,{r1-r3,r13,r15}’

jyoti.allur@jyotiallur-ubuntu:~/test/ARM$ /opt/tools/arm-linux-gnueabi-gcc-4.5/bin/arm-linux-gnueabi-as -mcpu=cortex-m3 ldmstm.s
ldmstm.s: Assembler messages:
ldmstm.s:2: Error: lo register required – `ldmia r0!,{r1-r3,r13,r15}’

LLVM version 3.6.0svn

jyoti.allur@jyotiallur-ubuntu:~/test/ARM$ ./llvm-mc -triple=thumbv7m–none-eabi ldmstm.s -filetype=obj -o ldmstm.o
jyoti.allur@jyotiallur-ubuntu:~/test/ARM$ ./llvm-mc -triple=armv7m–none-eabi ldmstm.s -filetype=obj -o ldmstm.o
jyoti.allur@jyotiallur-ubuntu:~/test/ARM$

I think this is a bug, could some expert in this area confirm it ?

Regards,

Jyoti Allur

Hi Jyoti,

cat ldmstm.s :-
  ldmia r0!,{r1-r3,r13, r15}

The actual problem here is that we allow r13 (i.e. sp). There is a
syntax variant on v7M with high registers, but it has odd restrictions
around r13-r15 that we get wrong at the moment.

For more details, the canonical document is always ARM's Architecture
Reference Manual (v7M version). Section A7.7.40 in this case, and you
can find a copy at
Documentation – Arm Developer (free
registration unfortunately required).

Cheers.

Tim.