Hpc Instruction Selection

Tiger in Stratego -- Compilation by Program Transformation
Instruction Selection for the MIPS

This is the fourth set of HpcExercises. In these exercises you build an instruction selector for IR programs that produces MIPS code.

  1. Extend the set of overlays for MIPS with instructions needed to implement IR.

  1. Define rules that cover all combinations of IR expressions

  1. Define the instructions for implementing the view shift for changing control from caller to callee.


Notes

  1. In order to construct a correct control-flow graph, all branching instructions need to have all possible labels they can branch to in their labels argument. This includes the label of the next instruction in case the instruction can fall through. Also be aware of the fact that jal returns to the next instruction.