result = val1 / val2;
break;
}
LinkedList<Temp> def = new LinkedList<Temp>();
def.add(new Temp());
if (result < 4096)
{
instructions.add(new AsmOPER("mov `d0, #" + result, def, new LinkedList<Temp>()));
}
else
{
instructions.add(new AsmOPER("ldr `d0, =" + result, def, new LinkedList<Temp>()));
}
return def.getFirst();
}
// Check for immediate values
else
{
String command = "";
// Evaulate left and right sides
Temp val1 = munch((ImcExpr)binop.limc);
Temp val2 = munch((ImcExpr)binop.rimc);
switch(binop.op)
{
case ImcBINOP.ADD:
command = "add";
break;
case ImcBINOP.SUB:
command = "sub";
break;
case ImcBINOP.MUL:
command = "mul";
break;
case ImcBINOP.DIV:
return inlineDivAlgorithm(val1, val2);
}
Temp result = new Temp();
LinkedList<Temp> defs = new LinkedList<Temp>();
defs.add(result);
LinkedList<Temp> srcs = new LinkedList<Temp>();