mips without optimize
This commit is contained in:
28
backend/mips/instr/fake/MipsLa.java
Normal file
28
backend/mips/instr/fake/MipsLa.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package backend.mips.instr.fake;
|
||||
|
||||
import backend.mips.instr.MipsInstr;
|
||||
import backend.mips.instr.type.MipsType;
|
||||
import backend.mips.Register;
|
||||
|
||||
public class MipsLa extends MipsInstr {
|
||||
private Register rd;
|
||||
private String label;
|
||||
|
||||
public MipsLa(Register rd, String label) {
|
||||
super(MipsType.FAKE);
|
||||
this.rd = rd;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public Register getRd() {
|
||||
return rd;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "la " + rd + ", " + label + "\n";
|
||||
}
|
||||
}
|
||||
29
backend/mips/instr/fake/MipsLi.java
Normal file
29
backend/mips/instr/fake/MipsLi.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package backend.mips.instr.fake;
|
||||
|
||||
import backend.mips.instr.MipsInstr;
|
||||
import backend.mips.instr.type.MipsType;
|
||||
import backend.mips.Register;
|
||||
|
||||
|
||||
public class MipsLi extends MipsInstr {
|
||||
private Register rd;
|
||||
private int value;
|
||||
|
||||
public MipsLi(Register rd, int value) {
|
||||
super(MipsType.FAKE);
|
||||
this.rd = rd;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Register getRd() {
|
||||
return rd;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "li " + rd + ", " + value + "\n";
|
||||
}
|
||||
}
|
||||
28
backend/mips/instr/fake/MipsMove.java
Normal file
28
backend/mips/instr/fake/MipsMove.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package backend.mips.instr.fake;
|
||||
|
||||
import backend.mips.instr.MipsInstr;
|
||||
import backend.mips.instr.type.MipsType;
|
||||
import backend.mips.Register;
|
||||
|
||||
public class MipsMove extends MipsInstr {
|
||||
private Register rd;
|
||||
private Register rt;
|
||||
|
||||
public MipsMove(Register rd, Register rt) {
|
||||
super(MipsType.FAKE);
|
||||
this.rd = rd;
|
||||
this.rt = rt;
|
||||
}
|
||||
|
||||
public Register getDest() {
|
||||
return rd;
|
||||
}
|
||||
|
||||
public Register getSrc() {
|
||||
return rt;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "move " + rd + ", " + rt + "\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user