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