Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Well... compiler design is a tough issue. Let us clarify some issues here.
1. Compilers for stack computers (or single-accumulator ones)
These are the more easy to implement. They have been documented in some books (like "Compilers and Compiler Generators). Since no register allocation is regarded, you have significantly less job to do.
2. Simple compilers for RISCs
An example is LCC from Princeton. Actually, not that easy but in order to get a new backend working you only have to modify the .md file (machine description file). About 7-8 backends are available globally, 4 of them come within the original distribution. You can't easily change the register allocation approach, while code generation is only done via dynamic programming (as in Aho or Hanson books if i recall).
3. Production-quality compilers
GCC mainly. Very tough mother, lots of host/targets configurations, some of them in alpha state. Extremely good code regarding size. Doesn't get much better than that. Very tough to extend. It is so big and bloated that it has been split to "development branches". At least 10 of them!!!
4. Research compilers
Research compilers are meant to be either one or both things: retargetable and extendable.
Retargetable means you can (with no indespeakable pain) add support for new targets.
Extendable means you can add both analysis and optimization passes.
Such compilers are SUIF and derivatives, COINS, ML-RISC. Major research work happens with SUIF and IMPACT (a research compiler for VLIW architecture of HP named PlayDoh)
To sum up:
5. Good books
The Aho-Ullman book (Compilers - Principles ...) Known as "The Red Dragon" book. If you master this beau, i must i'm amazed.
2-3 free books out there. Like the Terry book (Compilers and Compiler Generators), "Engineering a Compiler" etc
The LCC book
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.