Unify instruction mnemonics [API break]

It is a longer standing issue that some instructions like ADD, IMUL, and
SHL have multiple mnemonics for different encoding forms. This is a
relict from a time where such information was not stored in the
instruction decoding. This, however, is no longer the case and therefore
the extra mnemonics just increase the number of cases to be handled by
users.
This commit is contained in:
Alexis Engelke
2020-02-20 10:49:46 +01:00
parent 513a913feb
commit dc286b14f2
6 changed files with 167 additions and 167 deletions

View File

@@ -559,7 +559,7 @@ fd_decode(const uint8_t* buffer, size_t len_sz, int mode_int, uintptr_t address,
uint8_t imm_size;
if (DESC_IMM_BYTE(desc))
imm_size = 1;
else if (UNLIKELY(instr->type == FDI_RET_IMM || instr->type == FDI_RETF))
else if (UNLIKELY(instr->type == FDI_RET || instr->type == FDI_RETF))
imm_size = 2;
else if (UNLIKELY(instr->type == FDI_ENTER))
imm_size = 3;
@@ -572,7 +572,7 @@ fd_decode(const uint8_t* buffer, size_t len_sz, int mode_int, uintptr_t address,
imm_size = 2;
#if defined(ARCH_X86_64)
else if (mode == DECODE_64 && (prefixes & PREFIX_REXW) &&
instr->type == FDI_MOVABS_IMM)
instr->type == FDI_MOVABS)
imm_size = 8;
#endif
else