decode: Change REP flag values
The new values allow for a more optimizable computation of the required flags from the decoded prefix.
This commit is contained in:
5
decode.c
5
decode.c
@@ -349,10 +349,7 @@ direct:
|
|||||||
|
|
||||||
instr->type = desc->type;
|
instr->type = desc->type;
|
||||||
instr->addrsz = addr_size;
|
instr->addrsz = addr_size;
|
||||||
instr->flags = prefix_rep == 0xf3 ? FD_FLAG_REP :
|
instr->flags = ((prefix_rep + 1) & 6) + (mode == DECODE_64 ? FD_FLAG_64 : 0);
|
||||||
prefix_rep == 0xf2 ? FD_FLAG_REPNZ : 0;
|
|
||||||
if (mode == DECODE_64)
|
|
||||||
instr->flags |= FD_FLAG_64;
|
|
||||||
instr->address = address;
|
instr->address = address;
|
||||||
|
|
||||||
for (unsigned i = 0; i < sizeof(instr->operands) / sizeof(FdOp); i++)
|
for (unsigned i = 0; i < sizeof(instr->operands) / sizeof(FdOp); i++)
|
||||||
|
|||||||
4
fadec.h
4
fadec.h
@@ -37,8 +37,8 @@ typedef enum {
|
|||||||
/** Internal use only. **/
|
/** Internal use only. **/
|
||||||
enum {
|
enum {
|
||||||
FD_FLAG_LOCK = 1 << 0,
|
FD_FLAG_LOCK = 1 << 0,
|
||||||
FD_FLAG_REP = 1 << 1,
|
FD_FLAG_REP = 1 << 2,
|
||||||
FD_FLAG_REPNZ = 1 << 2,
|
FD_FLAG_REPNZ = 1 << 1,
|
||||||
FD_FLAG_64 = 1 << 7,
|
FD_FLAG_64 = 1 << 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user