Homework 6: Instruction Selection

Due Tuesday, 18 March 2008, 6 PM

Homework 6 is to read Chapter 9 of the text and build a module MipsGen to translate IR trees into machine instructions. Your structure should match the CODEGEN signature described in Chapter 9. In particular, it should export a codegen function that maps a frame and a single IR statement to a list of assembler instructions.

You will also need to augment your frame structure to add the register lists and functions that add entry/exit code to Tiger procedure bodies as described on page 208 of the text.

The MIPS instruction set is documented in the SPIM documentation; see the course web page for links.

You should submit the following files:

This should not be too hard, but under no circumstances do you want to go past the project deadline. The following phases will require serious hacking. Note that you only get one week for this phase of the compiler (in order to make time available where you'll need it---the register allocator). So don't delay; start now.

Good luck and have fun!

Last updated 12 March 2008.

Valid XHTML 1.1 Valid CSS!