X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FWritingAnLLVMBackend.html;h=909432ef453d74f1276a930a963109a4fac90dd6;hb=52bb2db70998c42c99d22069ac66eb7bbb492f3a;hp=1a7bc7c428b06e2eae476c73954fde9b62b3fc09;hpb=7a2fd89ccad1b0d60171f5cafe04f64c711cce84;p=oota-llvm.git diff --git a/docs/WritingAnLLVMBackend.html b/docs/WritingAnLLVMBackend.html index 1a7bc7c428b..909432ef453 100644 --- a/docs/WritingAnLLVMBackend.html +++ b/docs/WritingAnLLVMBackend.html @@ -21,7 +21,6 @@
In general, you want to follow the format of X86 or PowerPC (in -lib/Target).
+In general, you want to follow the format of SPARC, X86 or PowerPC (in +lib/Target). SPARC is the simplest backend, and is RISC, so if +you're working on a RISC target, it is a good one to start with.
To create a static compiler (one that emits text assembly), you need to implement the following:
+RegisterTarget<MyTargetMachine> M("short_name", " Target name"); +
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:
- +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.
-