[LLVMdev] inline asm

Hans Stimer hans.stimer at gmail.com
Tue May 17 10:36:16 PDT 2011


Are there any examples for the inline assembler or more complete docs?

Questions:

* What are the syntax and semantics of constraints?
* If I load up specific registers in the inline assembly, will llvm make
sure that those registers are unassigned or should I save the registers and
restore them? i.e. does llvm try and understand what is going on in the
inline assembly, or is it a black box to llvm analysis?
* What is the syntax of the inline assembly? i.e. intel, att, ...?

The test code is complete mystery to me:


; From test/Assembler/alignstack.II

define void @test1() nounwind {
; CHECK: test1
; CHECK: sideeffect
; CHECK-NOT: alignstack
tail call void asm sideeffect "mov", "~{dirflag},~{fpsr},~{flags}"()
nounwind
ret void
; CHECK: ret
}



* Presumably "mov" is the inline assembly string, but that isn't going to
assemble without arguments -- are arguments append to the string somehow?
* Is anyone using the inline assembler? I would really like to see how
others are using it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110517/235a8a1b/attachment.html>


More information about the llvm-dev mailing list