[LLVMdev] Getting To Native Code

Chris Lattner sabre at nondot.org
Wed Nov 12 10:11:01 PST 2003


> From my (somewhat cursory) review of AsmParser, it seems like this can't
> be done with LLVM right now. There is nothing in AsmParser or the rest
> of LLVM that would allow native assembly instructions to be passed
> through to the back end.

Correct.

> Is my finding correct or can this be done currently with LLVM in some
> way I haven't found?

Nope you're right.  Adding to what John said, eventually we will support
GCC style 'asm' blocks, but these will only have extremely limited (if
any) support in the JIT.  If you need low-level machine specific
functionality now, probably the best way to do it is to write a .s file or
a .c file with asm's in it, and compile that with a native compiler.
Since we are ABI compatible, you shouldn't have any problem linking it to
llvm compiled programs.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list