Howdy: I'm a newbie of LLVM. I want to make sure that my way is correct. Plz tell me... we design a new processor with a new arch. we wanna get a compiler as fast as possible. The target code of the new compiler is machine code. So, is it I just to create a whole new backend for our new processor, right? And then???? Thx.
> I'm a newbie of LLVM. I want to make sure that my way is correct. > Plz tell me... > we design a new processor with a new arch. we wanna get a compiler as > fast as possible. The target code of the new compiler is machine > code. > So, is it I just to create a whole new backend for our new processor, > right? And then????Yes. LLVM would be great for your project. Please check out the document on how to write a backend. http://llvm.cs.uiuc.edu/docs/WritingAnLLVMBackend.html -Tanya
> You are the only one who response my problem. The others maybe don't > understand my questions....:(I'm also replying to the list. People are very nice and helpful! Plus, I am on vacation! :)> well....my questions are following. > 1. I wrote a very simple backend, but I dont know how to tell the llvm > compiler to use it. > I found something in "llc --help", it says that I can use > -march=BACKEND. But it only > can use X86, sparcev9 and powerpc. The skeleton looks like for > custom use, but I dnot > know how to use it??You need to use -load or link it in statically to the llc executable. If you have done this you should see your backend option with -help.> 2. I dont know how to generate the "machine code", which I mean is > the code looks like "01001110101010100010....". All I got was the > "assembly code", not machine code.Usually you use a system assembler to do this. The other way to do it is to implement the JIT code emitter interface.> Above just a part of my questions, thx for your help!!!You're welcome! -Tanya> > Dave win. > > > On Sun, 26 Dec 2004 22:46:58 -0600 (CST), Tanya Lattner > <tonic at nondot.org> wrote: >> >>> I have tons of questions about the LLVM backend, could U give me hand?? >> >> Maybe :) Its actually best to email the llvmdev at cs.uiuc.edu mailing list >> since there are tons of people on it. You will get a much faster response. >> >> -Tanya >> >>> >>> Dave Win. >>> MSN: s8540049 at hotmail.com >>> >>> >>> >>> On Wed, 1 Dec 2004 11:17:07 -0600 (CST), Tanya Lattner <tonic at nondot.org> wrote: >>>> >>>>> I'm a newbie of LLVM. I want to make sure that my way is correct. >>>>> Plz tell me... >>>>> we design a new processor with a new arch. we wanna get a compiler as >>>>> fast as possible. The target code of the new compiler is machine >>>>> code. >>>>> So, is it I just to create a whole new backend for our new processor, >>>>> right? And then???? >>>> >>>> Yes. LLVM would be great for your project. Please check out the document >>>> on how to write a backend. >>>> http://llvm.cs.uiuc.edu/docs/WritingAnLLVMBackend.html >>>> >>>> -Tanya >>>> >>>> >>> >> >
On Mon, Dec 27, 2004 at 12:37:59PM -0600, Tanya Lattner wrote:> >1. I wrote a very simple backend, but I dont know how to tell the > >llvm compiler to use it. I found something in "llc --help", it says > >that I can use -march=BACKEND. But it only can use X86, sparcev9 and > >powerpc. The skeleton looks like for custom use, but I dnot know how > >to use it?? > > You need to use -load or link it in statically to the llc executable. > If you have done this you should see your backend option with -help.In addition to what Tanya said, you need something like this, taken from llvm/lib/Target/X86/X86TargetMachine.cpp: // Register the target. RegisterTarget<X86TargetMachine> X("x86", " IA-32 (Pentium and above)"); This will add an option "-march=x86" to llc.> >2. I dont know how to generate the "machine code", which I mean is > >the code looks like "01001110101010100010....". All I got was the > >"assembly code", not machine code. > > Usually you use a system assembler to do this. The other way to do it > is to implement the JIT code emitter interface.Just to clarify: a JIT compiler will write out code to MEMORY, which is probably not what you want for your new test processor. The JIT compiler does have support for relocations, so it is possible (though not currently implemented) to have LLVM produce object files (machine code) to DISK instead of memory. This will require some work, though. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
Maybe Matching Threads
- [LLVMdev] Could LLVM help me?
- [LLVMdev] Fix for non-standard variable length array + Visual C X86 specific code
- [LLVMdev] Fix for non-standard variable length array + Visual C X86 specific code
- [LLVMdev] How to register a new LLVM backend
- [LLVMdev] Fix for non-standard variable length array + Visual C X86 specific code