diff options
| -rw-r--r-- | miasm2/arch/x86/arch.py | 4 | ||||
| -rw-r--r-- | miasm2/arch/x86/sem.py | 19 | ||||
| -rw-r--r-- | test/arch/x86/arch.py | 5 |
3 files changed, 28 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py index 839487e8..ae5f3fd7 100644 --- a/miasm2/arch/x86/arch.py +++ b/miasm2/arch/x86/arch.py @@ -4529,6 +4529,10 @@ addop("paddsw", [bs8(0x0f), bs8(0xed), no_xmm_pref] + addop("paddsw", [bs8(0x0f), bs8(0xed), pref_66] + rmmod(xmm_reg, rm_arg_xmm_m128)) +addop("pmaddwd", [bs8(0x0f), bs8(0xf5), no_xmm_pref] + + rmmod(mm_reg, rm_arg_mm_m64)) +addop("pmaddwd", [bs8(0x0f), bs8(0xf5), pref_66] + + rmmod(xmm_reg, rm_arg_xmm_m128)) mn_x86.bintree = factor_one_bit(mn_x86.bintree) # mn_x86.bintree = factor_fields_all(mn_x86.bintree) diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index d73eac96..3880ed67 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -3477,6 +3477,22 @@ def pmuludq(ir, instr, dst, src): raise RuntimeError("Unsupported size %d" % dst.size) return e, [] +# Mix +# + +# SSE +def pmaddwd(ir, instr, dst, src): + sizedst = 32 + sizesrc = 16 + out = [] + for start in xrange(0, dst.size, sizedst): + base = start + mul1 = src[base: base + sizesrc].signExtend(sizedst) * dst[base: base + sizesrc].signExtend(sizedst) + base += sizesrc + mul2 = src[base: base + sizesrc].signExtend(sizedst) * dst[base: base + sizesrc].signExtend(sizedst) + out.append(mul1 + mul2) + return [m2_expr.ExprAff(dst, m2_expr.ExprCompose(*out))], [] + # Comparisons # @@ -4749,6 +4765,9 @@ mnemo_func = {'mov': mov, "pmulhq": pmulhq, "pmuludq": pmuludq, + # Mix + # SSE + "pmaddwd": pmaddwd, # Arithmetic (floating-point) # diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index 93ab4a48..3d9fd31f 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -3049,6 +3049,11 @@ reg_tests = [ "0ff4d9"), (m32, "00000000 PMULUDQ XMM0, XMM6", "660ff4c6"), + + (m32, "00000000 PMADDWD MM3, MM1", + "0ff5d9"), + (m32, "00000000 PMADDWD XMM0, XMM6", + "660ff5c6"), ] |