diff options
| author | serpilliere <fabrice.desclaux@cea.fr> | 2015-10-18 17:38:21 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-23 10:47:24 +0200 |
| commit | 01e8b966465d67bdb138070e50d105a6181c9ad6 (patch) | |
| tree | 2034e1e030671e9ade4e4761f68a8c0dddccb1fd /miasm2/arch/x86/sem.py | |
| parent | 3d4c4551f6b0685ab19dd13c9b78a98d081b8292 (diff) | |
| download | miasm-01e8b966465d67bdb138070e50d105a6181c9ad6.tar.gz miasm-01e8b966465d67bdb138070e50d105a6181c9ad6.zip | |
Arch/x86/sem: add cmovpe/cmovnp
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index e627ea6d..51c9125c 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -2686,7 +2686,6 @@ def cmovz(ir, instr, a, b): e.append(m2_expr.ExprAff(ir.IRDst, m2_expr.ExprCond(zf, lbl_do, lbl_skip))) return e, [irbloc(lbl_do.name, [e_do])] - def cmovnz(ir, instr, a, b): e = [] lbl_do = m2_expr.ExprId(ir.gen_label(), instr.mode) @@ -2697,6 +2696,26 @@ def cmovnz(ir, instr, a, b): return e, [irbloc(lbl_do.name, [e_do])] +def cmovpe(ir, instr, a, b): + e = [] + lbl_do = m2_expr.ExprId(ir.gen_label(), instr.mode) + lbl_skip = m2_expr.ExprId(ir.get_next_label(instr), instr.mode) + e_do, extra_irs = mov(ir, instr, a, b) + e_do.append(m2_expr.ExprAff(ir.IRDst, lbl_skip)) + e.append(m2_expr.ExprAff(ir.IRDst, m2_expr.ExprCond(pf, lbl_do, lbl_skip))) + return e, [irbloc(lbl_do.name, [e_do])] + + +def cmovnp(ir, instr, a, b): + e = [] + lbl_do = m2_expr.ExprId(ir.gen_label(), instr.mode) + lbl_skip = m2_expr.ExprId(ir.get_next_label(instr), instr.mode) + e_do, extra_irs = mov(ir, instr, a, b) + e_do.append(m2_expr.ExprAff(ir.IRDst, lbl_skip)) + e.append(m2_expr.ExprAff(ir.IRDst, m2_expr.ExprCond(pf, lbl_skip, lbl_do))) + return e, [irbloc(lbl_do.name, [e_do])] + + def cmovge(ir, instr, a, b): e = [] lbl_do = m2_expr.ExprId(ir.gen_label(), instr.mode) @@ -3617,6 +3636,8 @@ mnemo_func = {'mov': mov, 'cmovz': cmovz, 'cmove': cmovz, 'cmovnz': cmovnz, + 'cmovpe':cmovpe, + 'cmovnp':cmovnp, 'cmovge': cmovge, 'cmovnl': cmovge, 'cmovg': cmovg, |