Jyoti Rajendra Allur
2014-Oct-10 11:01 UTC
[LLVMdev] LDMIA instruction allows high registers for v7m architechture
<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE> <META content="text/html; charset=windows-1252" http-equiv=Content-Type> <STYLE id=mysingle_style type=text/css>P { MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt } TD { MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt } LI { MARGIN-TOP: 5px; FONT-FAMILY: Arial, arial; MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt } BODY { LINE-HEIGHT: 1.4; MARGIN: 10px; FONT-FAMILY: Arial, arial; FONT-SIZE: 9pt } </STYLE> <META name=GENERATOR content=ActiveSquare></HEAD> <BODY> <P>Hi All,<BR>It looks like ARM assembly parser is allowing high registers in LDMIA instruction for v7m architechure.<BR>Specification for Cortex-M3 device specifies that high registers should not be allowed in LDMIA instruction.<BR><BR>cat ldmstm.s :-<BR> ldmia r0!,{r1-r3,r13, r15}<BR><BR><BR><U>GNU assembler version 2.22 (arm-linux-gnueabi) using BFD version (GNU Binutils) 2.22</U></P> <P><U></U> </P> <P><A href="mailto:jyoti.allur@jyotiallur-ubuntu:~/test/ARM$">jyoti.allur@jyotiallur-ubuntu:~/test/ARM$</A> /opt/tools/arm-linux-gnueabi-gcc-4.5/bin/arm-linux-gnueabi-as -mthumb -mcpu=cortex-m3 ldmstm.s<BR>ldmstm.s: Assembler messages:<BR>ldmstm.s:2: Error: lo register required -- `ldmia r0!,{r1-r3,r13,r15}'</P> <P><BR><A href="mailto:jyoti.allur@jyotiallur-ubuntu:~/test/ARM$">jyoti.allur@jyotiallur-ubuntu:~/test/ARM$</A> /opt/tools/arm-linux-gnueabi-gcc-4.5/bin/arm-linux-gnueabi-as -mcpu=cortex-m3 ldmstm.s<BR>ldmstm.s: Assembler messages:<BR>ldmstm.s:2: Error: lo register required -- `ldmia r0!,{r1-r3,r13,r15}'<BR><BR></P> <P><BR><U>LLVM version 3.6.0svn<BR></U><BR><U><SPAN style="COLOR: #0080ff">jyoti.allur@jyotiallur-ubuntu:~/test/ARM$</SPAN></U> ./llvm-mc -triple=thumbv7m--none-eabi ldmstm.s -filetype=obj -o ldmstm.o<BR><U><SPAN style="COLOR: #0079f2">jyoti.allur@jyotiallur-ubuntu:~/test/ARM$</SPAN></U> ./llvm-mc -triple=armv7m--none-eabi ldmstm.s -filetype=obj -o ldmstm.o<BR><SPAN style="COLOR: #0079f2"><U>jyoti.allur@jyotiallur-ubuntu:~/test/ARM$<BR></U><BR></SPAN><BR>I think this is a bug, could some expert in this area confirm it ?</P> <P> </P> <P>Regards,</P> <P>Jyoti Allur</P></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=98934eddeedafa1e62d3c8cdd622a6a18a6c316ac7a5d8db8858b930e647c73dbc8d46d65a1d3978434c6ebf74e200ff220d3e02ce1cb961d6250c6ef56fc7aacf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>
Tim Northover
2014-Oct-10 16:43 UTC
[LLVMdev] LDMIA instruction allows high registers for v7m architechture
Hi Jyoti, On 10 October 2014 04:01, Jyoti Rajendra Allur <jyoti.allur at samsung.com> wrote:> 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 http://infocenter.arm.com/help/topic/com.arm.doc.ddi0403- (free registration unfortunately required). Cheers. Tim.