Mercurial > lcfOS
comparison python/ppci/target/arm/selector.py @ 352:899ae3aea803
First kernel run for vexpressA9
author | Windel Bouwman |
---|---|
date | Sun, 09 Mar 2014 11:55:55 +0100 |
parents | 3bb7dcfe5529 |
children | 42343d189e14 |
comparison
equal
deleted
inserted
replaced
351:62803b073d11 | 352:899ae3aea803 |
---|---|
1 from ... import ir, same_dir | 1 from ... import ir, same_dir |
2 from ppci.irmach import AbstractInstruction as makeIns | 2 from ppci.irmach import AbstractInstruction as makeIns |
3 from ppci.ir2tree import makeTree | 3 from ppci.ir2tree import makeTree |
4 from .instructions import Str1, Mov2 | 4 from .instructions import Str1, Mov2 |
5 from .instructions import B, Bl, Blt, Bgt, Beq | 5 from .instructions import B, Bl, Blt, Bgt, Beq, Bne, Cmp2 |
6 import pyburg | 6 import pyburg |
7 from ..basetarget import Nop | 7 from ..basetarget import Nop |
8 from ..instructionselector import InstructionSelector | 8 from ..instructionselector import InstructionSelector |
9 | 9 |
10 # Import BURG spec for arm: | 10 # Import BURG spec for arm: |
73 tgt = self.targets[s.target] | 73 tgt = self.targets[s.target] |
74 self.emit(B(ir.label_name(s.target)), jumps=[tgt]) | 74 self.emit(B(ir.label_name(s.target)), jumps=[tgt]) |
75 elif isinstance(s, ir.CJump): | 75 elif isinstance(s, ir.CJump): |
76 a = self.munchExpr(s.a) | 76 a = self.munchExpr(s.a) |
77 b = self.munchExpr(s.b) | 77 b = self.munchExpr(s.b) |
78 self.emit(Cmp, src=[a, b]) | 78 self.emit(Cmp2, src=[a, b]) |
79 ntgt = self.targets[s.lab_no] | 79 ntgt = self.targets[s.lab_no] |
80 ytgt = self.targets[s.lab_yes] | 80 ytgt = self.targets[s.lab_yes] |
81 jmp_ins = makeIns(B(ir.label_name(s.lab_no)), jumps=[ntgt]) | 81 jmp_ins = makeIns(B(ir.label_name(s.lab_no)), jumps=[ntgt]) |
82 opnames = {'<': Blt, '>':Bgt, '==':Beq, '!=':Bne} | 82 opnames = {'<': Blt, '>':Bgt, '==':Beq, '!=':Bne} |
83 op = opnames[s.cond](ir.label_name(s.lab_yes)) | 83 op = opnames[s.cond](ir.label_name(s.lab_yes)) |