Assignment 6: Instruction Selection

Due: 10:00 pm, Wednesday November 17.

Project 6 is to read chapter nine of the text and build a module to translate IR trees to MIPS machine instructions. The MIPS instruction set is documented in the SPIM documentation; see the course web page for links.

Your structure should match the CODEGEN signature described in chapter nine. 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.

You should submit the following files:

Word to the wise: 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. If you go over the deadline, you take a double hit: you lose points on your late project as well as using up the time allocated for the more difficult current project.

As always… good luck; have fun!

  –Olin

CS4410