about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-01-26 17:42:48 +0100
committerAjax <commial@gmail.com>2018-01-26 17:47:05 +0100
commit2d0910a2c398f681eacb8dea7df1bee4c72e6401 (patch)
tree27fc17a9edfbb659c9369a1304c232216f8d7b9e
parent343c04ffa9bae64d45d950909f038775963502a9 (diff)
downloadmiasm-2d0910a2c398f681eacb8dea7df1bee4c72e6401.tar.gz
miasm-2d0910a2c398f681eacb8dea7df1bee4c72e6401.zip
Add PSRLDQ semantic
-rw-r--r--miasm2/arch/x86/sem.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index b2403604..879a81ca 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -3788,6 +3788,16 @@ def pslldq(_, instr, dst, src):
         return [m2_expr.ExprAff(dst, dst << m2_expr.ExprInt(8 * count, dst.size))], []
 
 
+def psrldq(_, instr, dst, src):
+    assert src.is_int()
+    e = []
+    count = int(src)
+    if count > 15:
+        return [m2_expr.ExprAff(dst, m2_expr.ExprInt(0, dst.size))], []
+    else:
+        return [m2_expr.ExprAff(dst, dst >> m2_expr.ExprInt(8 * count, dst.size))], []
+
+
 def iret(ir, instr):
     """IRET implementation
     XXX: only support "no-privilege change"
@@ -4589,6 +4599,8 @@ mnemo_func = {'mov': mov,
               "pslld": pslld,
               "psllq": psllq,
               "pslldq": pslldq,
+              "psrldq": psrldq,
+
               "palignr": palignr,
 
               "pmaxub": pmaxub,