diff options
Diffstat (limited to 'miasm2/arch')
| -rw-r--r-- | miasm2/arch/x86/arch.py | 4 | ||||
| -rw-r--r-- | miasm2/arch/x86/sem.py | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py index aaf877fe..839487e8 100644 --- a/miasm2/arch/x86/arch.py +++ b/miasm2/arch/x86/arch.py @@ -4488,6 +4488,10 @@ addop("pmulhw", [bs8(0x0f), bs8(0xe5), no_xmm_pref] + rmmod(mm_reg, rm_arg_mm_m64)) addop("pmulhw", [bs8(0x0f), bs8(0xe5), pref_66] + rmmod(xmm_reg, rm_arg_xmm_m128)) +addop("pmuludq", [bs8(0x0f), bs8(0xf4), no_xmm_pref] + + rmmod(mm_reg, rm_arg_mm_m64)) +addop("pmuludq", [bs8(0x0f), bs8(0xf4), pref_66] + + rmmod(xmm_reg, rm_arg_xmm_m128)) addop("psubusb", [bs8(0x0f), bs8(0xd8), no_xmm_pref] + diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 5beedede..d73eac96 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -3418,6 +3418,7 @@ def _min_max(expr, signed): expr.args[0], ) + # Integer arithmetic # @@ -3456,6 +3457,27 @@ pmulhw = vec_vertical_instr('*', 16, lambda x: _keep_mul_high(x, signed=True)) pmulhd = vec_vertical_instr('*', 32, lambda x: _keep_mul_high(x, signed=True)) pmulhq = vec_vertical_instr('*', 64, lambda x: _keep_mul_high(x, signed=True)) +def pmuludq(ir, instr, dst, src): + e = [] + if dst.size == 64: + e.append(m2_expr.ExprAff( + dst, + src[:32].zeroExtend(64) * dst[:32].zeroExtend(64) + )) + elif dst.size == 128: + e.append(m2_expr.ExprAff( + dst[:64], + src[:32].zeroExtend(64) * dst[:32].zeroExtend(64) + )) + e.append(m2_expr.ExprAff( + dst[64:], + src[64:96].zeroExtend(64) * dst[64:96].zeroExtend(64) + )) + else: + raise RuntimeError("Unsupported size %d" % dst.size) + return e, [] + + # Comparisons # @@ -4725,6 +4747,7 @@ mnemo_func = {'mov': mov, "pmulhw": pmulhw, "pmulhd": pmulhd, "pmulhq": pmulhq, + "pmuludq": pmuludq, # Arithmetic (floating-point) |