building an ARM backend

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

building an ARM backend

Rafael Espíndola
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: building an ARM backend

Jim Laskey
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?



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building an ARM backend

Andrew Lenharth-2
In reply to this post by Rafael Espíndola
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!)

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: building an ARM backend

Ralph Corderoy

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.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: building an ARM backend

Rafael Espíndola
In reply to this post by Andrew Lenharth-2
> 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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: building an ARM backend

Bugzilla from ghost@cs.msu.su
In reply to this post by Rafael Espíndola
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Re: building an ARM backend

Rafael Espíndola
> 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 :-)

> - Volodya

Thanks,
Rafael

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Re: building an ARM backend

Chris Lattner
On Tue, 25 Apr 2006, [UTF-8] Rafael Esp?ndola wrote:
>> 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 :-)

Are you guys interested in contributing this back to LLVM?  It would be
great if so.  We can set up cvs commit access and other stuff as needed
when this gets going.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Re: building an ARM backend

Rafael Espíndola
> Are you guys interested in contributing this back to LLVM?  It would be
> great if so.  We can set up cvs commit access and other stuff as needed
> when this gets going.
I am.
A cvs account will help a lot. Thanks.
I am currently "translating" the sparc back end. When I have a decent
skeleton (remove all sparc code for example) I will email it.
What paperwork is necessary regarding the copyright?

> -Chris

Best Regards,
Rafael

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Re: building an ARM backend

Bugzilla from ghost@cs.msu.su
In reply to this post by Rafael Espíndola
Rafael Esp?ndola wrote:

>> 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 think that will be great. But as I said, it's a bit dicey at the moment
how this will work out with the student, so I suggest that if you will
convince your bosses to allow working on ARM backend, you just keep us
updated on the progress. If things work out good on my end, I'll ask you
what part of work you can "outsource" ;-)

Hmm, it's looks like LLVM will have backends for all relevant processors in
near future, except maybe MIPS. Anybody wants to sponsor MIPS backend? ;-)


- Volodya

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Re: building an ARM backend

Chris Lattner
In reply to this post by Rafael Espíndola
On Tue, 25 Apr 2006, [UTF-8] Rafael Esp?ndola wrote:

>> Are you guys interested in contributing this back to LLVM?  It would be
>> great if so.  We can set up cvs commit access and other stuff as needed
>> when this gets going.
> I am.
> A cvs account will help a lot. Thanks.
> I am currently "translating" the sparc back end. When I have a decent
> skeleton (remove all sparc code for example) I will email it.

Okay, sounds great. When you have your first batch of code to commit, I'll
set this up for you.  Just let me know, it shouldn't be a problem.

> What paperwork is necessary regarding the copyright?

I will email you a form.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev