Re: how to write a compiler

bonzini@gnu.org (Paolo Bonzini)
17 Jul 2003 00:38:40 -0400

          From comp.compilers

Related articles
how to write a compiler sam__c@rediffmail.com (2003-07-02)
Re: how to write a compiler rjaishan@quicklogic.com (Jaishankar R) (2003-07-04)
Re: how to write a compiler bonzini@gnu.org (2003-07-04)
Re: how to write a compiler martinez_miguel@yahoo.com (2003-07-13)
Re: how to write a compiler mrmnews@the-meissners.org (Michael Meissner) (2003-07-15)
Re: how to write a compiler bonzini@gnu.org (2003-07-17)
Re: how to write a compiler alex@alexmcguire.com (Alex McGuire) (2003-07-25)
Re: how to write a compiler nicolas_capens@hotmail.com (2003-07-31)
Re: how to write a compiler suresh@sankhya.com (2003-07-31)
Re: how to write a compiler ertr1013@student.uu.se (Erik Trulsson) (2003-08-04)
Re: how to write a compiler boldyrev+nospam@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2003-08-10)
Re: how to write a compiler p2sam@uwaterloo.ca (2003-08-15)
[2 later articles]
| List of all articles for this month |
From: bonzini@gnu.org (Paolo Bonzini)
Newsgroups: comp.compilers
Date: 17 Jul 2003 00:38:40 -0400
Organization: http://groups.google.com/
References: 03-07-009 03-07-055 03-07-092
Keywords: registers
Posted-Date: 17 Jul 2003 00:38:40 EDT

> Having a regular machine, with plenty of registers to generate code for would
> be a help on such a short term project. The x86 architecture is not what I
> would call regular, nor particularly blessed with many registers :-)


Yes. Appel's book tells how to deal with this by using a dynamic
programming algorithm for instruction selection and doing something
that very dimly resembles gcc's reload at instruction selection time
(and then relying on the allocator's coalescing to produce sensible
code). But if you want to do x86, then you need spilling (Appel's
leaves it as an "advanced project"), which you can leave aside for the
moment on a SPARC, MIPS or PPC architecture.


If you want to do an easy architecture, go for the SPARC ignoring
delay slots (that's only my humble opinion). PPC is weird for a RISC
(wouldn't call it regular at all!), MIPS has delay slots as well and
has some tricky ABI issues. SPARC is quite a clear assembly language
and the ABI is possibly the easiest in existance.


Paolo


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.