mips without optimize
This commit is contained in:
33
backend/mips/instr/MipsMd.java
Normal file
33
backend/mips/instr/MipsMd.java
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user