mirror of https://github.com/x64dbg/zydis
Cleaned up register-decoding code
This commit is contained in:
parent
55400e9206
commit
b118637dae
|
@ -258,7 +258,7 @@ enum ZydisFormatterHookTypes
|
|||
ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT,
|
||||
/**
|
||||
* @brief This function is called right after formatting an operand to print the optional
|
||||
* avx-512 operand decorator.
|
||||
* EVEX/MVEX operand-decorator.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR,
|
||||
/**
|
||||
|
|
|
@ -792,23 +792,7 @@ enum ZydisRoundingModes
|
|||
/**
|
||||
* @brief Round towards zero.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RZ,
|
||||
/**
|
||||
* @brief Round to nearest and suppress all exceptions.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RN_SAE,
|
||||
/**
|
||||
* @brief Round down and suppress all exceptions.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RD_SAE,
|
||||
/**
|
||||
* @brief Round up and suppress all exceptions.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RU_SAE,
|
||||
/**
|
||||
* @brief Round towards zero and suppress all exceptions.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RZ_SAE
|
||||
ZYDIS_ROUNDING_MODE_RZ
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -646,7 +646,7 @@ enum ZydisMaskPolicies
|
|||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
|
||||
ZydisBool hasNDSOperand ZYDIS_BITFIELD( 1)
|
||||
ZydisBool hasNDSNDDOperand ZYDIS_BITFIELD( 1)
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisInstructionDefinition struct.
|
||||
|
|
1237
src/Decoder.c
1237
src/Decoder.c
File diff suppressed because it is too large
Load Diff
|
@ -720,15 +720,39 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisInstructionForma
|
|||
if ((operand->id == (info->operandCount - 1)) ||
|
||||
((operand->id != (info->operandCount - 1)) &&
|
||||
(info->operands[operand->id + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)))
|
||||
{
|
||||
if (info->avx.hasSAE)
|
||||
{
|
||||
switch (info->avx.roundingMode)
|
||||
{
|
||||
case ZYDIS_ROUNDING_MODE_INVALID:
|
||||
if (info->avx.hasSAE)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RN:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rn-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RD:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rd-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RU:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {ru-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RZ:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rz-sae}"));
|
||||
break;
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
} else
|
||||
{
|
||||
switch (info->avx.roundingMode)
|
||||
{
|
||||
case ZYDIS_ROUNDING_MODE_INVALID:
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RN:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
|
@ -746,25 +770,10 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisInstructionForma
|
|||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rz}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RN_SAE:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rn-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RD_SAE:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rd-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RU_SAE:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {ru-sae}"));
|
||||
break;
|
||||
case ZYDIS_ROUNDING_MODE_RZ_SAE:
|
||||
ZYDIS_CHECK(ZydisStringBufferAppend(buffer, bufEnd - *buffer,
|
||||
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, " {rz-sae}"));
|
||||
break;
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
switch (info->avx.swizzleMode)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue