encode: Fix erroneous encoding of high registers

This commit is contained in:
Alexis Engelke
2021-01-07 10:03:17 +01:00
parent db183ee6f9
commit 3fdbd70153
2 changed files with 20 additions and 1 deletions

View File

@@ -558,7 +558,11 @@ def encode_table(entries):
if ot == "m":
tys.append(0xf)
elif op.kind == "GP":
tys.append(2 if op.abssize(opsize//8) == 1 else 1)
if (desc.mnemonic == "MOVSX" or desc.mnemonic == "MOVZX" or
opsize == 8):
tys.append(2 if op.abssize(opsize//8) == 1 else 1)
else:
tys.append(1)
else:
tys.append({
"imm": 0, "SEG": 3, "FPU": 4, "MMX": 5, "XMM": 6,