diff options
| author | Ajax <commial@gmail.com> | 2015-04-24 13:11:55 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-04-24 13:11:55 +0200 |
| commit | adb365d4454561874b127c32b387d05b0d5bad90 (patch) | |
| tree | 5bc04d627564b3082dab1401a312a583f6dd2651 /miasm2/arch/mips32/sem.py | |
| parent | a300ef578432b16c4d7e6de04a638834b73f82c7 (diff) | |
| download | miasm-adb365d4454561874b127c32b387d05b0d5bad90.tar.gz miasm-adb365d4454561874b127c32b387d05b0d5bad90.zip | |
Mips32Sem: Update semantic according to sembuilder
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/mips32/sem.py | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/miasm2/arch/mips32/sem.py b/miasm2/arch/mips32/sem.py index d634c208..5bebfbc2 100644 --- a/miasm2/arch/mips32/sem.py +++ b/miasm2/arch/mips32/sem.py @@ -165,27 +165,15 @@ def sb(a, b): def sh(a, b): mem16[b.arg] = a[:16] -def movn(ir, instr, a, b, c): - lbl_do = m2_expr.ExprId(ir.gen_label(), 32) - lbl_skip = m2_expr.ExprId(ir.get_next_instr(instr), 32) - e_do = [] - e_do.append(m2_expr.ExprAff(a, b)) - e_do.append(m2_expr.ExprAff(ir.IRDst, lbl_skip)) - e = [] - e.append(m2_expr.ExprAff(ir.IRDst, m2_expr.ExprCond(c, lbl_do, lbl_skip))) - - return e, [irbloc(lbl_do.name, [e_do], [])] - -def movz(ir, instr, a, b, c): - lbl_do = m2_expr.ExprId(ir.gen_label(), 32) - lbl_skip = m2_expr.ExprId(ir.get_next_instr(instr), 32) - e_do = [] - e_do.append(m2_expr.ExprAff(a, b)) - e_do.append(m2_expr.ExprAff(ir.IRDst, lbl_skip)) - e = [] - e.append(m2_expr.ExprAff(ir.IRDst, m2_expr.ExprCond(c, lbl_skip, lbl_do))) +@sbuild.parse +def movn(a, b, c): + if c: + a = b - return e, [irbloc(lbl_do.name, [e_do], [])] +@sbuild.parse +def movz(a, b, c): + if not c: + a = b @sbuild.parse def srl(a, b, c): @@ -423,8 +411,6 @@ mnemo_func.update({ 'ins': ins, 'jr': j, 'mov.d': mov_d, - 'movn': movn, - 'movz': movz, 'mul.d': mul_d, 'or': l_or, 'ori': l_or, |