No longer store sizes as bitfields
On most (x86) processors, using bitfields is low than using slightly more memory.
This commit is contained in:
10
decode.h
10
decode.h
@@ -116,9 +116,9 @@ struct Instr
|
||||
{
|
||||
uint16_t type;
|
||||
struct Operand operands[4];
|
||||
uint8_t segment : 3;
|
||||
uint8_t width : 3;
|
||||
uint8_t addr_size : 2;
|
||||
uint8_t segment;
|
||||
uint8_t op_size;
|
||||
uint8_t addr_size;
|
||||
|
||||
/**
|
||||
* Encoded as 1 << (scale - 1) **or** no scaled register at all if zero.
|
||||
@@ -137,8 +137,8 @@ struct Instr
|
||||
typedef struct Instr Instr;
|
||||
|
||||
#define INSTR_SEGMENT(instr) ((instr)->segment)
|
||||
#define INSTR_WIDTH(instr) ((1 << (instr)->width) >> 1)
|
||||
#define INSTR_ADDRSZ(instr) ((1 << (instr)->addr_size) >> 1)
|
||||
#define INSTR_WIDTH(instr) ((instr)->op_size)
|
||||
#define INSTR_ADDRSZ(instr) ((instr)->addr_size)
|
||||
#define INSTR_HAS_REP(instr) ((instr)->prefixes & PREFIX_REP)
|
||||
#define INSTR_HAS_REPNZ(instr) ((instr)->prefixes & PREFIX_REPNZ)
|
||||
#define INSTR_HAS_LOCK(instr) ((instr)->prefixes & PREFIX_LOCK)
|
||||
|
||||
Reference in New Issue
Block a user