Implement submarine rotation in MIPS