[LLVMdev] Getting To Native Code

Reid Spencer reid at x10sys.com
Wed Nov 12 02:50:01 PST 2003


Suppose I wanted to, say, write glibc for LLVM (fat chance! :) I would
need at some point to write (hopefully a small amount) of native code
to, say, access specific registers, handle interrupts, or generate
operating system traps. 

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.

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

What is the alternative? Write a library function in C and have it
called by LLVM?

The reason I'm asking is that I'd like as much code as possible to be
open to optimization by LLVM. If the core of my runtime library can't be
expressed in LLVM then it can't be optimized by it either.  Ideally,
everything except the glue for system traps, interrupts and the like
should be expressible in LLVIS.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031112/1598eada/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031112/1598eada/attachment.sig>


More information about the llvm-dev mailing list