master
Apoorva Ranade 4 years ago
parent fbd740eb25
commit 7a8e5b2082

@ -632,11 +632,12 @@ public class CodeGenImpl extends CodeGenBase
backend.emitADDI(Register.A0,Register.A0, 1, "Increment by 1"); backend.emitADDI(Register.A0,Register.A0, 1, "Increment by 1");
backend.emitSLT(Register.A0, Register.A0, Register.T0, comment); backend.emitSLT(Register.A0, Register.A0, Register.T0, comment);
} }
/* Maybe NA
else if(operator.equals("is")) else if(operator.equals("is"))
{ {
backend.emitXOR(Register.A0, Register.A0, Register.T0, comment); backend.emitXOR(Register.A0, Register.A0, Register.T0, comment);
backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0"); backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0");
} }*/
else else
{ {
backend.emitJAL(errorNI, "Operator not implemented for integer operands"); backend.emitJAL(errorNI, "Operator not implemented for integer operands");
@ -696,11 +697,12 @@ public class CodeGenImpl extends CodeGenBase
backend.emitOR(Register.A0, Register.A0, Register.T0, "OR operation"); backend.emitOR(Register.A0, Register.A0, Register.T0, "OR operation");
backend.emitLocalLabel(label, "Next step after OR"); backend.emitLocalLabel(label, "Next step after OR");
} }
/*Maybe NA
else if(operator.equals("is")) else if(operator.equals("is"))
{ {
backend.emitXOR(Register.A0, Register.A0, Register.T0, comment); backend.emitXOR(Register.A0, Register.A0, Register.T0, comment);
backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0"); backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0");
} }*/
else else
{ {
backend.emitJAL(errorNI, "Operator not implemented for boolean operands"); backend.emitJAL(errorNI, "Operator not implemented for boolean operands");
@ -727,6 +729,7 @@ public class CodeGenImpl extends CodeGenBase
sp_off -= 2; sp_off -= 2;
backend.emitADDI(SP, FP, -sp_off*wordSize, "restore sp"); backend.emitADDI(SP, FP, -sp_off*wordSize, "restore sp");
} }
// TODO: Implement "is" for objects
else else
{ {
backend.emitJAL(errorNI, "Operator not implemented"); backend.emitJAL(errorNI, "Operator not implemented");

Loading…
Cancel
Save