The company I work for uses quiet some ARM processors and I am trying to convince them to let me spend some company time building an llvm back end :-) I have read the documentation and taken a look on the X86 back end. It looks quiet simple to get a very minimal back end working. I am considering for a first version: 1) only support the 32 bits ABI 2) Ignore the shifter (i.e use only 8 bits immediates) 3) Ignore the fancier addressing modes Without this, the generated code with not be very good but the back end will be very simple. The only part that appears to require more work is describing the instructions set. Am I underestimating how hard it is? How much work do you thing is required to have this minimal back end working? PS.: What is the getRARegister method for? PS.: Once I have a small back end working I will try to improve it :-) Thanks, Rafael
This one I can answer. This routine is used by debug emitters (specifically DwarfWriter), to define which target register contains the return address on function entry, MRegisterInfo::NoRegister if the return address is, for example, pushed on the stack. You can return 0 for the time being. As debug support advances, further instruction will be provided. -- Jim On Apr 24, 2006, at 10:50 AM, Rafael Espíndola wrote:> PS.: What is the getRARegister method for?-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060424/b851a433/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060424/b851a433/attachment.bin>
On Mon, 2006-04-24 at 08:50, Rafael Espíndola wrote:> I have read the documentation and taken a look on the X86 back end. It > looks quiet simple to get a very minimal back end working. I am > considering for a first version:One of the RISC backends will make the work look a lot simpler :)> 1) only support the 32 bits ABI > 2) Ignore the shifter (i.e use only 8 bits immediates) > 3) Ignore the fancier addressing modes > > Without this, the generated code with not be very good but the back > end will be very simple. The only part that appears to require more > work is describing the instructions set.Actually, I think the most work goes into the calling conventions and ABI. Describing the instruction set is just a lot of typing things from manuals. Well, you will also likely need a CFE, which is a bit of work in itself.> Am I underestimating how hard it is? How much work do you thing is > required to have this minimal back end working?So, if you've done one before, you could get one up in a couple weeks if you had fast enough available hardware. Andrew (aka crazy guy who did the Alpha backend and uses it!)
Hi, Andrew Lenharth wrote:> On Mon, 2006-04-24 at 08:50, Rafael Espíndola wrote: > > I have read the documentation and taken a look on the X86 back end. > > It looks quiet simple to get a very minimal back end working. I am > > considering for a first version: > > One of the RISC backends will make the work look a lot simpler :)Is it true that the new Sparc one is meant to be a good one to follow? Cheers, Ralph.
On Mon, 24 Apr 2006, Andrew Lenharth wrote:> On Mon, 2006-04-24 at 08:50, Rafael Espíndola wrote: >> I have read the documentation and taken a look on the X86 back end. It >> looks quiet simple to get a very minimal back end working. I am >> considering for a first version: > > One of the RISC backends will make the work look a lot simpler :)Indeed. In fact, the SPARC backend is probably the simplest and is the smallest, it (in addition to alpha and ia64) would probably be better things to look at than X86 (unless there is something specificly similar to X86 you're trying to do).>> 1) only support the 32 bits ABI >> 2) Ignore the shifter (i.e use only 8 bits immediates) >> 3) Ignore the fancier addressing modes >> >> Without this, the generated code with not be very good but the back >> end will be very simple. The only part that appears to require more >> work is describing the instructions set.Sure. In general, you usually start with something tiny and trivial (e.g. "void foo() { return; }") and work up from there. Adding support for any of these three should be pretty straight-forward.> Actually, I think the most work goes into the calling conventions and > ABI. Describing the instruction set is just a lot of typing things from > manuals.Yup.> Well, you will also likely need a CFE, which is a bit of work in itself.Yup. Also, if you have questions about backend writing stuff, please ask, we're happy to help :) -Chris -- http://nondot.org/sabre/ http://llvm.org/
> One of the RISC backends will make the work look a lot simpler :)I was looking at the x86 back end because the manual instructs to use the X86 or PowerPC back end as examples. But I guess that it is a bit out of date.> Actually, I think the most work goes into the calling conventions and > ABI. Describing the instruction set is just a lot of typing things from > manuals. > > Well, you will also likely need a CFE, which is a bit of work in itself.I have some experience with GCC, so I think that I can dig into it once I am able to compile some .ll files. Being able to work on this as two distinct steps one a very nice characteristic of LLVM :-)> So, if you've done one before, you could get one up in a couple weeks if > you had fast enough available hardware.Nice!> Andrew (aka crazy guy who did the Alpha backend and uses it!)Really cool! :-) Thank you, Rafael
Rafael Esp?ndola wrote:> The company I work for uses quiet some ARM processors and I am trying > to convince them to let me spend some company time building an llvm > back end :-)Funny, I've just got one student for exactly same task -- writing ARM backend. Of course, the student might well disappear by the time new term begins and might not produce anything usable for a year ;-)> I have read the documentation and taken a look on the X86 back end. It > looks quiet simple to get a very minimal back end working. I am > considering for a first version: > > 1) only support the 32 bits ABI > 2) Ignore the shifter (i.e use only 8 bits immediates) > 3) Ignore the fancier addressing modes > > Without this, the generated code with not be very good but the back > end will be very simple. The only part that appears to require more > work is describing the instructions set. > > Am I underestimating how hard it is? How much work do you thing is > required to have this minimal back end working?I wrote one backend (private) in a couple of months. I guess it should take roughly the same time to you if you work full-time on this. - Volodya
> Funny, I've just got one student for exactly same task -- writing ARM > backend. Of course, the student might well disappear by the time new term > begins and might not produce anything usable for a year ;-)I am currently reading and hacking the code. I would be very glad to work with your student if that is not a problem.> I wrote one backend (private) in a couple of months. I guess it should take > roughly the same time to you if you work full-time on this.That is very good news :-)> - VolodyaThanks, Rafael