<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 25, 2013 at 1:33 PM, David Peixotto <span dir="ltr"><<a href="mailto:dpeixott@codeaurora.org" target="_blank">dpeixott@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Both armasm and gnu as support an ldr pseudo instruction for loading<br>
constants that lowers to either a mov, movn, or a pc-relative ldr from the<br>
constant pool. It would be great if the llvm integrated assembler could<br>
support this feature as well.<br>
<br>
For example, using gnu as to compile this code:<br>
.text<br>
foo:<br>
ldr r0, =0x1<br>
ldr r0, =-0x1<br>
ldr r0, =0x1000001<br>
ldr r0, =bar<br>
ldr r0, =baz<br>
bar:<br>
<br>
Produces an object file like this (with relocations shown):<br>
Disassembly of section .text:<br>
00000000 <foo>:<br>
0: e3a00001 mov r0, #1<br>
4: e3e00000 mvn r0, #0<br>
8: e59f0004 ldr r0, [pc, #4] ; 14 <bar><br>
c: e59f0004 ldr r0, [pc, #4] ; 18 <bar+0x4><br>
10: e59f0004 ldr r0, [pc, #4] ; 1c <bar+0x8><br>
<br>
00000014 <bar>:<br>
14: 01000001 .word 0x01000001<br>
18: 00000014 .word 0x00000014<br>
18: R_ARM_ABS32 .text<br>
1c: 00000000 .word 0x00000000<br>
1c: R_ARM_ABS32 baz<br>
<br>
Currently the llvm integrated assembler fails on this input with an error<br>
like:<br>
error: unexpected token in operand<br>
ldr r0, =0x1<br>
^<br>
I am interested in seeing support for this feature added to the integrated<br>
assembler. Is anybody planning to add this feature? I am willing to do the<br>
work, but I am not sure exactly where to start so I thought I would bring it<br>
up here in case anybody has some suggestions (or wants to implement it<br>
themselves :)<br></blockquote><div><br></div><div>I would like to see this features supported. I have run into code in the wild that cannot be handled by the LLVM toolchain due to this issue.</div><div><br></div><div>-- Sean Silva</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
CC'ing some recent contributors to the llvm arm assembler.<br>
<br>
gnu as reference:<br>
<a href="https://sourceware.org/binutils/docs/as/ARM-Opcodes.html#ARM-Opcodes" target="_blank">https://sourceware.org/binutils/docs/as/ARM-Opcodes.html#ARM-Opcodes</a><br>
<br>
-David<br>
<br>
-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted<br>
by The Linux Foundation<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>