about summary refs log tree commit diff stats
path: root/miasm2/arch/x86/sem.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-02-09 10:43:48 +0100
committerAjax <commial@gmail.com>2018-02-09 17:36:31 +0100
commit4a94e84923d8ac059fc2c41a5876835613204ad2 (patch)
tree88606d70093bf53de06a36ce13bfe8fbcf15aba5 /miasm2/arch/x86/sem.py
parentb8bd5c0f24b786616b6f372f7f6dfad43438ab01 (diff)
downloadmiasm-4a94e84923d8ac059fc2c41a5876835613204ad2.tar.gz
miasm-4a94e84923d8ac059fc2c41a5876835613204ad2.zip
Add PMADDWD instruction
0F F5 /r 	PMADDWD mm, mm/m64
66 0F F5 /r 	PMADDWD xmm1, xmm2/m128
Diffstat (limited to 'miasm2/arch/x86/sem.py')
-rw-r--r--miasm2/arch/x86/sem.py19
1 files changed, 19 insertions, 0 deletions
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)
               #