aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-opc.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-03-23 17:08:39 +0100
committerJan Beulich <jbeulich@suse.com>2021-03-23 17:08:39 +0100
commit441f6aca3923ba65db139f5c2557a5f01e190edc (patch)
tree3db030cdeae0a950236523451d774b374f26a274 /opcodes/i386-opc.h
parent66848ebca8da38ce395d74d25d604646738514a7 (diff)
downloadgdb-441f6aca3923ba65db139f5c2557a5f01e190edc.zip
gdb-441f6aca3923ba65db139f5c2557a5f01e190edc.tar.gz
gdb-441f6aca3923ba65db139f5c2557a5f01e190edc.tar.bz2
x86: split opcode prefix and opcode space representation
Commit 8b65b8953af2 ("x86: Remove the prefix byte from non-VEX/EVEX base_opcode") used the opcodeprefix field for two distinct purposes. In preparation of having VEX/XOP/EVEX and non-VEX templates become similar in the representatioon of both encoding space and opcode prefixes, split the field to have a separate one holding an insn's opcode space.
Diffstat (limited to 'opcodes/i386-opc.h')
-rw-r--r--opcodes/i386-opc.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index d3f7070..4708d86 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -575,7 +575,25 @@ enum
#define VEXW1 2
#define VEXWIG 3
VexW,
- /* Regular opcode prefix:
+ /* Opcode encoding space (values chosen to be usable directly in
+ VEX/XOP mmmmm and EVEX mm fields):
+ 0: Base opcode space.
+ 1: 0F opcode prefix / space.
+ 2: 0F38 opcode prefix / space.
+ 3: 0F3A opcode prefix / space.
+ 8: XOP 08 opcode space.
+ 9: XOP 09 opcode space.
+ A: XOP 0A opcode space.
+ */
+#define SPACE_BASE 0
+#define SPACE_0F 1
+#define SPACE_0F38 2
+#define SPACE_0F3A 3
+#define SPACE_XOP08 8
+#define SPACE_XOP09 9
+#define SPACE_XOP0A 0xA
+ OpcodeSpace,
+ /* Opcode prefix:
0: None
1: Add 0x66 opcode prefix.
2: Add 0xf2 opcode prefix.
@@ -585,20 +603,6 @@ enum
#define PREFIX_0X66 1
#define PREFIX_0XF2 2
#define PREFIX_0XF3 3
- /* VEX opcode prefix:
- 0: VEX 0x0F opcode prefix.
- 1: VEX 0x0F38 opcode prefix.
- 2: VEX 0x0F3A opcode prefix
- 3: XOP 0x08 opcode prefix.
- 4: XOP 0x09 opcode prefix
- 5: XOP 0x0A opcode prefix.
- */
-#define VEX0F 0
-#define VEX0F38 1
-#define VEX0F3A 2
-#define XOP08 3
-#define XOP09 4
-#define XOP0A 5
OpcodePrefix,
/* number of VEX source operands:
0: <= 2 source operands.
@@ -742,7 +746,8 @@ typedef struct i386_opcode_modifier
unsigned int vex:2;
unsigned int vexvvvv:2;
unsigned int vexw:2;
- unsigned int opcodeprefix:3;
+ unsigned int opcodespace:4;
+ unsigned int opcodeprefix:2;
unsigned int vexsources:2;
unsigned int sib:3;
unsigned int sse2avx:1;