Mercurial > lcfOS
diff python/target/arminstructionselector.py @ 305:0615b5308710
Updated docs
author | Windel Bouwman |
---|---|
date | Fri, 06 Dec 2013 13:50:38 +0100 |
parents | 6753763d3bec |
children | 56e6ff84f646 |
line wrap: on
line diff
--- a/python/target/arminstructionselector.py Fri Dec 06 12:45:02 2013 +0100 +++ b/python/target/arminstructionselector.py Fri Dec 06 13:50:38 2013 +0100 @@ -2,7 +2,8 @@ from ppci.irmach import AbstractInstruction as makeIns from .basetarget import Label, Comment, Alignment, LabelRef, DebugInfo, Nop from .instructionselector import InstructionSelector -from .arminstructions import Orr, Lsl, Str2, Ldr2, Ldr3, B, Bl, Bgt, Blt, Beq +from .arminstructions import Orr, Lsl, Str2, Ldr2, Ldr3 +from .arminstructions import B, Bl, Bgt, Blt, Beq, Bne from .arminstructions import Mov2, Mov3 from .arminstructions import Add, Sub, Cmp, Sub2, Add2, Mul from .basetarget import Imm8, Imm7, Imm3 @@ -94,7 +95,7 @@ self.munchStm(m) if isinstance(loc, ir.Temp): reguses.append(loc) - self.emit(Bl(LabelRef(e.f.name)), src=reguses, dst=[self.frame.rv]) + self.emit(Bl(LabelRef(e.f)), src=reguses, dst=[self.frame.rv]) d = self.newTmp() self.move(d, self.frame.rv) return d @@ -133,7 +134,7 @@ ntgt = self.targets[s.lab_no] ytgt = self.targets[s.lab_yes] jmp_ins = makeIns(B(LabelRef(s.lab_no.name)), jumps=[ntgt]) - opnames = {'<': Blt, '>':Bgt, '==':Beq} + opnames = {'<': Blt, '>':Bgt, '==':Beq, '!=':Bne} op = opnames[s.cond](LabelRef(s.lab_yes.name)) self.emit(op, jumps=[ytgt, jmp_ins]) # Explicitely add fallthrough self.emit2(jmp_ins)