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:
4
decode.c
4
decode.c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user