Skip to content

Commit

Permalink
Merge pull request #82 from mrexodia/vinsertf128_addition
Browse files Browse the repository at this point in the history
Added vinsertf128
  • Loading branch information
mrexodia committed Oct 2, 2023
2 parents f265a01 + eda3297 commit adc648e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/dumpulator/dumpulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,14 +1756,25 @@ def cip_next():
# TODO: PRNG based on dmp hash
op_write(0, 42)
cip_next()
elif instr.id == X86_INS_VMOVDQU:
elif instr.id in [X86_INS_VMOVDQU, X86_INS_VMOVUPS]:
src = op_read(1)
op_write(0, src)
cip_next()
elif instr.id in [X86_INS_VMOVDQA, X86_INS_MOVNTDQ]:
elif instr.id in [X86_INS_VMOVDQA, X86_INS_MOVNTDQ, X86_INS_VMOVAPS]:
src = op_read(1, aligned=True)
op_write(0, src, aligned=True)
cip_next()
elif instr.id == X86_INS_VINSERTF128:
src = op_read(1)
xmm1 = op_read(2)
imm8 = op_read(3)
if imm8 == 0:
src = (src & 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000) | xmm1
elif imm8 == 1:
src = (src & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff) | (xmm1 << 128)
op_write(0, src)
cip_next()

else:
dp.error(f"unsupported: {instr.mnemonic} {instr.op_str}")
# Unsupported instruction
Expand Down

0 comments on commit adc648e

Please sign in to comment.