mips without optimize

This commit is contained in:
colden
2025-12-12 20:14:00 +08:00
parent 84827838e2
commit c94bebf37b
130 changed files with 5462 additions and 4182 deletions

View File

@@ -0,0 +1,33 @@
package backend.mips.instr;
import backend.mips.Register;
import backend.mips.instr.type.MipsJumpType;
import backend.mips.instr.type.MipsType;
public class MipsJump extends MipsInstr {
private MipsJumpType jumpType;
private String label;
private Register rd;
public MipsJump(MipsJumpType jumpType, String label) {
super(MipsType.JUMP);
this.jumpType = jumpType;
this.label = label;
this.rd = null;
}
public MipsJump(MipsJumpType jumpType, Register rd) {
super(MipsType.JUMP);
this.jumpType = jumpType;
this.label = null;
this.rd = rd;
}
public String toString() {
if (this.rd == null) {
return this.jumpType.toString() + " " + this.label + "\n";
} else {
return this.jumpType.toString() + " " + this.rd + "\n";
}
}
}