From f56c33b6bdba48ce83fa77a2debcc119a7d511c0 Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Wed, 6 Jan 2016 11:26:15 +0100 Subject: X86: add andnp[sd] --- miasm2/arch/x86/arch.py | 3 +++ miasm2/arch/x86/sem.py | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'miasm2') diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py index ee4f5fbf..efa955f3 100644 --- a/miasm2/arch/x86/arch.py +++ b/miasm2/arch/x86/arch.py @@ -3943,6 +3943,9 @@ addop("xorpd", [bs8(0x0f), bs8(0x57), pref_66] + rmmod(xmm_reg, rm_arg_xmm)) addop("andps", [bs8(0x0f), bs8(0x54), no_xmm_pref] + rmmod(xmm_reg, rm_arg_xmm)) addop("andpd", [bs8(0x0f), bs8(0x54), pref_66] + rmmod(xmm_reg, rm_arg_xmm)) +addop("andnps", [bs8(0x0f), bs8(0x55), no_xmm_pref] + rmmod(xmm_reg, rm_arg_xmm)) +addop("andnpd", [bs8(0x0f), bs8(0x55), pref_66] + rmmod(xmm_reg, rm_arg_xmm)) + ## OR addop("orps", [bs8(0x0f), bs8(0x56), no_xmm_pref] + rmmod(xmm_reg, rm_arg_xmm)) addop("orpd", [bs8(0x0f), bs8(0x56), pref_66] + rmmod(xmm_reg, rm_arg_xmm)) diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 61e56bbe..a9737923 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -3149,6 +3149,12 @@ def andps(ir, instr, a, b): return e, [] +def andnps(ir, instr, a, b): + e = [] + e.append(m2_expr.ExprAff(a, m2_expr.ExprOp('&', a ^ a.mask, b))) + return e, [] + + def orps(ir, instr, a, b): e = [] e.append(m2_expr.ExprAff(a, m2_expr.ExprOp('|', a, b))) @@ -4254,6 +4260,8 @@ mnemo_func = {'mov': mov, "movups": movapd, # XXX TODO alignement check "andps": andps, "andpd": andps, + "andnps": andnps, + "andnpd": andnps, "orps": orps, "orpd": orps, "xorps": xorps, -- cgit 1.4.1