about summary refs log tree commit diff stats
path: root/miasm2/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/arch/x86')
-rw-r--r--miasm2/arch/x86/arch.py2
-rw-r--r--miasm2/arch/x86/sem.py11
2 files changed, 13 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index af79ea97..ee4f5fbf 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -3983,6 +3983,8 @@ addop("pshufb", [bs8(0x0f), bs8(0x38), bs8(0x00), no_xmm_pref] +
       rmmod(mm_reg, rm_arg_mm))
 addop("pshufb", [bs8(0x0f), bs8(0x38), bs8(0x00), pref_66] +
       rmmod(xmm_reg, rm_arg_xmm))
+addop("pshufd", [bs8(0x0f), bs8(0x70), pref_66] +
+      rmmod(xmm_reg, rm_arg_xmm) + [u08])
 
 
 
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index d3927821..61e56bbe 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -3583,6 +3583,16 @@ def pshufb(ir, instr, a, b):
     return e, []
 
 
+def pshufd(ir, instr, a, b, c):
+    e = []
+    for i in xrange(4):
+        index = c[2 * i:2 * (i + 1)].zeroExtend(a.size)
+        index <<= m2_expr.ExprInt(5, a.size)
+        value = (a >> index)[:32]
+        e.append(m2_expr.ExprAff(a[32 * i:32 * (i + 1)], value))
+    return e, []
+
+
 def ps_rl_ll(ir, instr, a, b, op, size):
     lbl_zero = m2_expr.ExprId(ir.gen_label(), ir.IRDst.size)
     lbl_do = m2_expr.ExprId(ir.gen_label(), ir.IRDst.size)
@@ -4348,6 +4358,7 @@ mnemo_func = {'mov': mov,
               "rdmsr": rdmsr,
               "wrmsr": wrmsr,
               "pshufb": pshufb,
+              "pshufd": pshufd,
 
               "psrlw": psrlw,
               "psrld": psrld,