about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-02-08 13:47:43 +0100
committerAjax <commial@gmail.com>2018-02-09 17:34:35 +0100
commitd533aee1b340f21974dc3c255d04ac0d35a73e84 (patch)
tree867a8cc097c811f101620037f83e8af49e9488f1
parenta328d6d33ce0b513bf41883380025ce8284f26d3 (diff)
downloadmiasm-d533aee1b340f21974dc3c255d04ac0d35a73e84.tar.gz
miasm-d533aee1b340f21974dc3c255d04ac0d35a73e84.zip
Add PMULLW instruction
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/arch.py6
-rw-r--r--miasm2/arch/x86/sem.py15
-rw-r--r--test/arch/x86/arch.py5
3 files changed, 26 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index 71f4409d..98e29b63 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -4472,6 +4472,12 @@ addop("packuswb", [bs8(0x0f), bs8(0x67), no_xmm_pref] +
 addop("packuswb", [bs8(0x0f), bs8(0x67), pref_66] +
       rmmod(xmm_reg, rm_arg_xmm_m128))
 
+addop("pmullw", [bs8(0x0f), bs8(0xd5), no_xmm_pref] +
+      rmmod(mm_reg, rm_arg_mm_m64))
+addop("pmullw", [bs8(0x0f), bs8(0xd5), 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 57716447..7c990199 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -3398,6 +3398,15 @@ psubw = vec_vertical_instr('-', 16)
 psubd = vec_vertical_instr('-', 32)
 psubq = vec_vertical_instr('-', 64)
 
+# Multiplications
+#
+
+# SSE
+pmullb = vec_vertical_instr('*', 8)
+pmullw = vec_vertical_instr('*', 16)
+pmulld = vec_vertical_instr('*', 32)
+pmullq = vec_vertical_instr('*', 64)
+
 # Floating-point arithmetic
 #
 
@@ -4645,6 +4654,12 @@ mnemo_func = {'mov': mov,
               "psubd": psubd,
               "psubq": psubq,
 
+              # SSE
+              "pmullb": pmullb,
+              "pmullw": pmullw,
+              "pmulld": pmulld,
+              "pmullq": pmullq,
+
               # Arithmetic (floating-point)
               #
 
diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py
index 284bb40c..9f3256f3 100644
--- a/test/arch/x86/arch.py
+++ b/test/arch/x86/arch.py
@@ -2984,6 +2984,11 @@ reg_tests = [
      "0f67cf"),
     (m32, "00000000    PACKUSWB   XMM0, XMM6",
      "660f67c6"),
+
+    (m32, "00000000    PMULLW     MM4, MM2",
+     "0fd5e2"),
+    (m32, "00000000    PMULLW     XMM0, XMM3",
+     "660fd5c3"),
 ]