about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-02-09 10:09:21 +0100
committerAjax <commial@gmail.com>2018-02-09 17:36:31 +0100
commit950bb44e32c5bed4dba7ef77949db86b4d36c5ca (patch)
treed891ff6daedb8da4b7c6b6528ddac9b5cd2aa653
parentdeda8791ecbaa3cd541667b04d44759b91a14372 (diff)
downloadmiasm-950bb44e32c5bed4dba7ef77949db86b4d36c5ca.tar.gz
miasm-950bb44e32c5bed4dba7ef77949db86b4d36c5ca.zip
Add PMAXSW instruction
0F EE /r 	PMAXSW mm1, mm2/m64
66 0F EE /r 	PMAXSW xmm1, xmm2/m128
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/arch.py4
-rw-r--r--miasm2/arch/x86/sem.py2
-rw-r--r--test/arch/x86/arch.py5
3 files changed, 11 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index 1b181f6f..aaf877fe 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -4306,6 +4306,10 @@ addop("pmaxuw", [bs8(0x0f), bs8(0x38), bs8(0x3e), pref_66] +
 addop("pmaxud", [bs8(0x0f), bs8(0x38), bs8(0x3f), pref_66] +
       rmmod(xmm_reg, rm_arg_xmm))
 
+addop("pmaxsw", [bs8(0x0f), bs8(0xee), no_xmm_pref] +
+      rmmod(mm_reg, rm_arg_mm_m64))
+addop("pmaxsw", [bs8(0x0f), bs8(0xee), pref_66] +
+      rmmod(xmm_reg, rm_arg_xmm_m128))
 
 addop("pminub", [bs8(0x0f), bs8(0xda), no_xmm_pref] +
       rmmod(mm_reg, rm_arg_mm))
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index 0bb534e5..5beedede 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -3467,6 +3467,7 @@ pminud = vec_vertical_instr('min', 32, lambda x: _min_max(x, signed=False))
 pmaxub = vec_vertical_instr('max', 8, lambda x: _min_max(x, signed=False))
 pmaxuw = vec_vertical_instr('max', 16, lambda x: _min_max(x, signed=False))
 pmaxud = vec_vertical_instr('max', 32, lambda x: _min_max(x, signed=False))
+pmaxsw = vec_vertical_instr('max', 16, lambda x: _min_max(x, signed=True))
 
 # Floating-point arithmetic
 #
@@ -4783,6 +4784,7 @@ mnemo_func = {'mov': mov,
               "pmaxub": pmaxub,
               "pmaxuw": pmaxuw,
               "pmaxud": pmaxud,
+              "pmaxsw": pmaxsw,
 
               "pminub": pminub,
               "pminuw": pminuw,
diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py
index 8c191aad..cc0a0a93 100644
--- a/test/arch/x86/arch.py
+++ b/test/arch/x86/arch.py
@@ -3039,6 +3039,11 @@ reg_tests = [
      "0fedd9"),
     (m32, "00000000    PADDSW     XMM0, XMM6",
      "660fedc6"),
+
+    (m32, "00000000    PMAXSW     MM3, MM1",
+     "0feed9"),
+    (m32, "00000000    PMAXSW     XMM0, XMM6",
+     "660feec6"),
 ]