diff options
| -rw-r--r-- | miasm2/arch/x86/arch.py | 4 | ||||
| -rw-r--r-- | miasm2/arch/x86/sem.py | 9 | ||||
| -rw-r--r-- | test/arch/x86/arch.py | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py index 572c2378..71f4409d 100644 --- a/miasm2/arch/x86/arch.py +++ b/miasm2/arch/x86/arch.py @@ -4462,6 +4462,10 @@ addop("packsswb", [bs8(0x0f), bs8(0x63), no_xmm_pref] + rmmod(mm_reg, rm_arg_mm_m64)) addop("packsswb", [bs8(0x0f), bs8(0x63), pref_66] + rmmod(xmm_reg, rm_arg_xmm_m128)) +addop("packssdw", [bs8(0x0f), bs8(0x6b), no_xmm_pref] + + rmmod(mm_reg, rm_arg_mm_m64)) +addop("packssdw", [bs8(0x0f), bs8(0x6b), pref_66] + + rmmod(xmm_reg, rm_arg_xmm_m128)) addop("packuswb", [bs8(0x0f), bs8(0x67), no_xmm_pref] + rmmod(mm_reg, rm_arg_mm_m64)) diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 6dcc76af..57716447 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -4245,6 +4245,14 @@ def packsswb(ir, instr, dst, src): return [m2_expr.ExprAff(dst, m2_expr.ExprCompose(*out))], [] +def packssdw(ir, instr, dst, src): + out = [] + for source in [dst, src]: + for start in xrange(0, dst.size, 32): + out.append(_signed_saturation(source[start:start + 32], 16)) + return [m2_expr.ExprAff(dst, m2_expr.ExprCompose(*out))], [] + + def packuswb(ir, instr, dst, src): out = [] for source in [dst, src]: @@ -4751,6 +4759,7 @@ mnemo_func = {'mov': mov, "pmovmskb": pmovmskb, "packsswb": packsswb, + "packssdw": packssdw, "packuswb": packuswb, "smsw": smsw, diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index fbcb88f8..284bb40c 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -2975,6 +2975,11 @@ reg_tests = [ (m32, "00000000 PACKSSWB XMM0, XMM5", "660f63c5"), + (m32, "00000000 PACKSSDW MM2, MM0", + "0f6bd0"), + (m32, "00000000 PACKSSDW XMM0, XMM7", + "660f6bc7"), + (m32, "00000000 PACKUSWB MM1, MM7", "0f67cf"), (m32, "00000000 PACKUSWB XMM0, XMM6", |