1 #include <linux/types.h>
5 static bool opcode_is_prefix(
uint8_t b)
9 b == 0xf0 || b == 0xf2 || b == 0xf3
11 || b == 0x2e || b == 0x36 || b == 0x3e || b == 0x26
12 || b == 0x64 || b == 0x65
20 static bool opcode_is_rex_prefix(
uint8_t b)
22 return (b & 0xf0) == 0x40;
25 static bool opcode_is_rex_prefix(
uint8_t b)
31 #define REX_W (1 << 3)
42 int operand_size_override = 4;
45 for (; opcode_is_prefix(*op); ++
op) {
47 operand_size_override = 2;
51 if (opcode_is_rex_prefix(*op)) {
91 if (*op == 0xb7 || *op == 0xbf)
92 operand_size_override = 2;
95 *size = (*op & 1) ? operand_size_override : 1;
101 while (opcode_is_prefix(*op))
103 if (opcode_is_rex_prefix(*op))