[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler

Tim Northover t.p.northover at gmail.com
Fri Nov 1 12:17:52 PDT 2013


> I put the test in a separate file and forgot to attach it earlier. I've
> attached it to this email.

The ".space" directive could be very useful in making the test more manageable.

Other than that I'd be wary of instructions that might be relaxed
during object emission and suddenly make a load out of range. LLVM
seems to do this for Bcc, pc-relative loads, ADR and B. It's getting
towards implementation details but you'll want to bear it in mind when
adding tests for any implementation.

One question that's occurred is can this support PIC when you
reference other sections? That may well affect the relocation used.

ARM's own assembler may be able to (it certainly has --apcs=...
options that can tell it it's compiling PIC code). I can't recall a
similar command-line option to llvm-mc, but Clang-as-assembler
probably accepts -fPIC.

Goodness knows whether we want to do anything with it though.

(from Jim)
> What does ARM’s documentation say?

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/Bgbbfgia.html

Fairly similar, though it doesn't seem to use a MOV opportunistically.

Tim.




More information about the llvm-dev mailing list