X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FWritingAnLLVMBackend.html;h=ea5cd9c3da59699e39cc1c41928fa99e8917a488;hb=8a886be3355d37b7671ff550f308d36f066dc0d0;hp=4066eec1dfaf0e5bb96d10c2c4c87b8cf1e3a62a;hpb=e940714e4e3cadca86e32a157e624af17e9962eb;p=oota-llvm.git diff --git a/docs/WritingAnLLVMBackend.html b/docs/WritingAnLLVMBackend.html index 4066eec1dfa..ea5cd9c3da5 100644 --- a/docs/WritingAnLLVMBackend.html +++ b/docs/WritingAnLLVMBackend.html @@ -68,21 +68,21 @@ convert the LLVM representation to machine assembly code or other languages.

implement the following:

- -

Now, for static code generation you also need to write an instruction -selector for your platform: see lib/Target/*/*ISelSimple.cpp which -is no longer "simple" but it gives you the idea: you have to be able to create -MachineInstrs for any given LLVM instruction using the InstVisitor -pattern, and produce a MachineFunction with -MachineBasicBlocks full of MachineInstrs for a -corresponding LLVM Function. Creating an instruction selector is perhaps the -most time-consuming part of creating a back-end.

- -

To create a JIT for your platform:

- +
  • Implement the assembly printer for the architecture. + +
  • +
  • Implement an instruction selector for the architecture. + +
  • +
  • Optionally, add subtarget support. +
  • Optionally, add JIT support. + - -

    Note that lib/target/Skeleton is a clean skeleton for a new target, -so you might want to start with that and adapt it for your target, and if you -are wondering how things are done, peek in the X86 or PowerPC target.

    - -

    The Skeleton target is non-functional but provides the basic building blocks -you will need for your endeavor.

    - @@ -217,10 +229,13 @@ how the C backend is written.