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.instr.type.MipsMdType;
import backend.mips.instr.type.MipsType;
import backend.mips.Register;
public class MipsMd extends MipsInstr {
private MipsMdType mdType;
private Register rd;
private Register rt;
public MipsMd(MipsMdType mdType, Register rd, Register rt) {
super(MipsType.MD);
this.mdType = mdType;
this.rd = rd;
this.rt = rt;
}
public MipsMd(MipsMdType mdType, Register rd) {
super(MipsType.MD);
this.mdType = mdType;
this.rd = rd;
this.rt = null;
}
public String toString() {
if (this.rt == null) {
return this.mdType.toString() + " " + this.rd + "\n";
} else {
return this.mdType.toString() + " " + this.rd + ", " + this.rt + "\n";
}
}
}