TC-7 Code to WriteΒΆ

Tip

Information on MIPS R2000 assembly instructions may be found in SPIM manual.

Codegen

src/target/mips/mips-matcher.cc is the functor used for instruction selection pattern-matching.

src/target/mips/spim-assembly.cc

SpimAssembly::move_build builds a move instruction using MIPS R2000 standard instruction set.

SpimAssembly::binop_inst, SpimAssembly::binop_build build arithmetic binary operations (addition, multiplication, etc.) using MIPS R2000 standard instruction set.

SpimAssembly::load_build, SpimAssembly::store_build build a load (respectively a store) instruction using MIPS R2000 standard instruction set. Here, the indirect addressing mode is used.

SpimAssembly::cjump_build translates conditional branch instructions (branch if equal, if lower than, etc.) into MIPS R2000 assembly.

Runtime

You have to complete the implementation of the runtime in src/target/mips/runtime.s:

strcmp
streq
print_int
substring
concat
src/target/mips/epilogue.cc

Completing the Codegen::rewrite_program routine will be needed during register allocation only, see TC-9, Register Allocation.