Mercurial > lcfOS
diff python/target/arminstructionselector.py @ 300:158068af716c
yafm
author | Windel Bouwman |
---|---|
date | Tue, 03 Dec 2013 18:00:22 +0100 |
parents | 534b94b40aa8 |
children | 6753763d3bec |
line wrap: on
line diff
--- a/python/target/arminstructionselector.py Sun Dec 01 18:37:23 2013 +0100 +++ b/python/target/arminstructionselector.py Tue Dec 03 18:00:22 2013 +0100 @@ -4,7 +4,7 @@ from .instructionselector import InstructionSelector from .arminstructions import Orr, Lsl, Str2, Ldr2, Ldr3, B, Bl, Bgt, Blt, Beq from .arminstructions import Mov2, Mov3 -from .arminstructions import Add, Sub, Cmp +from .arminstructions import Add, Sub, Cmp, Sub2, Add2, Mul from .basetarget import Imm8, Imm7, Imm3 @@ -18,7 +18,7 @@ a = self.munchExpr(e.a) d = self.newTmp() c = Imm3(e.b.value) - self.emit(arm.addregregimm3_ins, others=[c], dst=[d], src=[a]) + self.emit(Add2, others=[c], dst=[d], src=[a]) return d elif isinstance(e, ir.Binop) and e.operation == '+': a = self.munchExpr(e.a) @@ -31,7 +31,7 @@ a = self.munchExpr(e.a) d = self.newTmp() c = Imm3(e.b.value) - self.emit(arm.subregregimm3_ins, others=[c], dst=[d], src=[a]) + self.emit(Sub2, others=[c], dst=[d], src=[a]) return d elif isinstance(e, ir.Binop) and e.operation == '-': a = self.munchExpr(e.a) @@ -59,7 +59,7 @@ d = self.newTmp() self.move(d, a) # this mul instruction has operands swapped: - self.emit(arm.mulregreg_ins, dst=[d], src=[b, d]) + self.emit(Mul, dst=[d], src=[b, d]) return d elif isinstance(e, ir.Const) and e.value < 256: d = self.newTmp()