diff options
Diffstat (limited to 'miasm2/arch/x86/sem.py')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index ec0598d7..f7f6ea75 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -3561,6 +3561,27 @@ def pminud(ir, instr, a, b): return pminu(ir, instr, a, b, 32) + +def pcmpeq(ir, instr, a, b, size): + e = [] + for i in xrange(0, a.size, size): + test = a[i:i+size] - b[i:i+size] + e.append(m2_expr.ExprAff(a[i:i+size], + m2_expr.ExprCond(test, + m2_expr.ExprInt(0, size), + m2_expr.ExprInt(-1, size)))) + return e, [] + + +def pcmpeqb(ir, instr, a, b): + return pcmpeq(ir, instr, a, b, 8) + +def pcmpeqw(ir, instr, a, b): + return pcmpeq(ir, instr, a, b, 16) + +def pcmpeqd(ir, instr, a, b): + return pcmpeq(ir, instr, a, b, 32) + mnemo_func = {'mov': mov, 'xchg': xchg, 'movzx': movzx, @@ -3991,6 +4012,11 @@ mnemo_func = {'mov': mov, "pminub" : pminub, "pminuw" : pminuw, "pminud" : pminud, + + "pcmpeqb" : pcmpeqb, + "pcmpeqw" : pcmpeqw, + "pcmpeqd" : pcmpeqd, + } |