[LLVMdev] building an ARM backend

Chris Lattner sabre at nondot.org
Mon Apr 24 09:06:43 PDT 2006


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/


More information about the llvm-dev mailing list