aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-opc.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-11-12 09:07:34 +0100
committerJan Beulich <jbeulich@suse.com>2019-11-12 09:07:34 +0100
commit75e5731b8f10129ef9a0e4202152c391d70375eb (patch)
tree79bbb36fee586624bba5b92acdf7c3bc6dc86622 /opcodes/i386-opc.h
parentaa16be3993e2b29d4f6a774fca82c67a43956864 (diff)
downloadgdb-75e5731b8f10129ef9a0e4202152c391d70375eb.zip
gdb-75e5731b8f10129ef9a0e4202152c391d70375eb.tar.gz
gdb-75e5731b8f10129ef9a0e4202152c391d70375eb.tar.bz2
x86: introduce operand type "instance"
Special register "class" instances can't be combined with one another (neither in templates nor in register entries), and hence it is not a good use of resources (memory as well as execution time) to represent them as individual bits of a bit field. Furthermore the generalization becoming possible will allow improvements to the handling of insns accepting only individual registers as their operands.
Diffstat (limited to 'opcodes/i386-opc.h')
-rw-r--r--opcodes/i386-opc.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index dcb8ea3..0bfb4d8 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -719,12 +719,23 @@ enum operand_class
RegBND, /* Bound register */
};
+/* Special operand instances. */
+
+#define INSTANCE_WIDTH 3
+enum operand_instance
+{
+ InstanceNone,
+ Accum, /* Accumulator %al/%ax/%eax/%rax/%st(0)/%xmm0 */
+ RegC, /* Register to hold shift count = %cl */
+ RegD, /* Register to hold in/out port addr = %dx */
+};
+
/* Position of operand_type bits. */
enum
{
- /* Class */
- Class = CLASS_WIDTH - 1,
+ /* Class and Instance */
+ ClassInstance = CLASS_WIDTH + INSTANCE_WIDTH - 1,
/* 1 bit immediate */
Imm1,
/* 8 bit immediate */
@@ -756,14 +767,8 @@ enum
Disp32S,
/* 64 bit displacement */
Disp64,
- /* Accumulator %al/%ax/%eax/%rax/%st(0)/%xmm0 */
- Acc,
/* Register which can be used for base or index in memory operand. */
BaseIndex,
- /* Register to hold in/out port addr = dx */
- InOutPortReg,
- /* Register to hold shift count = cl */
- ShiftCount,
/* Absolute address for jump. */
JumpAbsolute,
/* String insn operand with fixed es segment */
@@ -809,6 +814,7 @@ typedef union i386_operand_type
struct
{
unsigned int class:CLASS_WIDTH;
+ unsigned int instance:INSTANCE_WIDTH;
unsigned int imm1:1;
unsigned int imm8:1;
unsigned int imm8s:1;
@@ -821,10 +827,7 @@ typedef union i386_operand_type
unsigned int disp32:1;
unsigned int disp32s:1;
unsigned int disp64:1;
- unsigned int acc:1;
unsigned int baseindex:1;
- unsigned int inoutportreg:1;
- unsigned int shiftcount:1;
unsigned int jumpabsolute:1;
unsigned int esseg:1;
unsigned int byte:1;