Remove some likeliness information
Much better information and performance can be achieved using PGO.
This commit is contained in:
14
decode.c
14
decode.c
@@ -373,7 +373,7 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
decode_table = _decode_table64;
|
decode_table = _decode_table64;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (decode_table == NULL)
|
if (UNLIKELY(decode_table == NULL))
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
@@ -468,7 +468,7 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
else
|
else
|
||||||
op_size = 4;
|
op_size = 4;
|
||||||
|
|
||||||
instr->op_size = UNLIKELY(desc->gp_instr_width) ? op_size : 0;
|
instr->op_size = desc->gp_instr_width ? op_size : 0;
|
||||||
|
|
||||||
uint8_t vec_size = 16;
|
uint8_t vec_size = 16;
|
||||||
if (prefixes & PREFIX_VEXL)
|
if (prefixes & PREFIX_VEXL)
|
||||||
@@ -493,7 +493,7 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
instr->operands[i].size = operand_sizes[enc_size];
|
instr->operands[i].size = operand_sizes[enc_size];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UNLIKELY(DESC_HAS_IMPLICIT(desc)))
|
if (DESC_HAS_IMPLICIT(desc))
|
||||||
{
|
{
|
||||||
struct Operand* operand = &instr->operands[DESC_IMPLICIT_IDX(desc)];
|
struct Operand* operand = &instr->operands[DESC_IMPLICIT_IDX(desc)];
|
||||||
operand->type = OT_REG;
|
operand->type = OT_REG;
|
||||||
@@ -519,7 +519,7 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
|
|
||||||
off += retval;
|
off += retval;
|
||||||
}
|
}
|
||||||
else if (UNLIKELY(DESC_HAS_MODREG(desc)))
|
else if (DESC_HAS_MODREG(desc))
|
||||||
{
|
{
|
||||||
// If there is no ModRM, but a Mod-Reg, its opcode-encoded.
|
// If there is no ModRM, but a Mod-Reg, its opcode-encoded.
|
||||||
struct Operand* operand = &instr->operands[DESC_MODREG_IDX(desc)];
|
struct Operand* operand = &instr->operands[DESC_MODREG_IDX(desc)];
|
||||||
@@ -539,14 +539,14 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t imm_control = DESC_IMM_CONTROL(desc);
|
uint32_t imm_control = DESC_IMM_CONTROL(desc);
|
||||||
if (UNLIKELY(imm_control == 1))
|
if (imm_control == 1)
|
||||||
{
|
{
|
||||||
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
||||||
operand->type = OT_IMM;
|
operand->type = OT_IMM;
|
||||||
operand->size = 1;
|
operand->size = 1;
|
||||||
instr->immediate = 1;
|
instr->immediate = 1;
|
||||||
}
|
}
|
||||||
else if (UNLIKELY(imm_control == 2))
|
else if (imm_control == 2)
|
||||||
{
|
{
|
||||||
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
||||||
operand->type = OT_MEM;
|
operand->type = OT_MEM;
|
||||||
@@ -568,7 +568,7 @@ decode(const uint8_t* buffer, int len, DecodeMode mode, uintptr_t address,
|
|||||||
#endif
|
#endif
|
||||||
off += addr_size;
|
off += addr_size;
|
||||||
}
|
}
|
||||||
else if (UNLIKELY(imm_control != 0))
|
else if (imm_control != 0)
|
||||||
{
|
{
|
||||||
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
struct Operand* operand = &instr->operands[DESC_IMM_IDX(desc)];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user