aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-opc.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-11-12 09:09:31 +0100
committerJan Beulich <jbeulich@suse.com>2019-11-12 09:09:31 +0100
commit51c8edf68bf1e16c6d05fbb31a36e0cc436a9750 (patch)
treeca465dc8565167792ae44eb3f95b338720c813e0 /opcodes/i386-opc.h
parent474da251bf92a11a08583080af77fa197570767f (diff)
downloadgdb-51c8edf68bf1e16c6d05fbb31a36e0cc436a9750.zip
gdb-51c8edf68bf1e16c6d05fbb31a36e0cc436a9750.tar.gz
gdb-51c8edf68bf1e16c6d05fbb31a36e0cc436a9750.tar.bz2
x86: fold EsSeg into IsString
EsSeg (a per-operand bit) is used with IsString (a per-insn attribute) only. Extend the attribute to 2 bits, thus allowing to encode - not a string insn, - string insn with neither operand requiring use of %es:, - string insn with 1st operand requiring use of %es:, - string insn with 2nd operand requiring use of %es:, which covers all possible cases, allowing to drop EsSeg. The (transient) need to comment out the OTUnused #define did uncover an oversight in the earlier OTMax -> OTNum conversion, which is being taken care of here.
Diffstat (limited to 'opcodes/i386-opc.h')
-rw-r--r--opcodes/i386-opc.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index 8f6cd04..fe20142 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -443,7 +443,11 @@ enum
No_ldSuf,
/* instruction needs FWAIT */
FWait,
- /* quick test for string instructions */
+ /* IsString provides for a quick test for string instructions, and
+ its actual value also indicates which of the operands (if any)
+ requires use of the %es segment. */
+#define IS_STRING_ES_OP0 2
+#define IS_STRING_ES_OP1 3
IsString,
/* RegMem is for instructions with a modrm byte where the register
destination operand should be encoded in the mod and regmem fields.
@@ -661,7 +665,7 @@ typedef struct i386_opcode_modifier
unsigned int no_qsuf:1;
unsigned int no_ldsuf:1;
unsigned int fwait:1;
- unsigned int isstring:1;
+ unsigned int isstring:2;
unsigned int regmem:1;
unsigned int bndprefixok:1;
unsigned int notrackprefixok:1;
@@ -772,8 +776,6 @@ enum
BaseIndex,
/* Absolute address for jump. */
JumpAbsolute,
- /* String insn operand with fixed es segment */
- EsSeg,
/* BYTE size. */
Byte,
/* WORD size. 2 byte */
@@ -807,8 +809,9 @@ enum
(OTNumOfUints * sizeof (unsigned int) * CHAR_BIT)
/* If you get a compiler error for zero width of the unused field,
- comment it out. */
+ comment it out.
#define OTUnused OTNum
+*/
typedef union i386_operand_type
{
@@ -830,7 +833,6 @@ typedef union i386_operand_type
unsigned int disp64:1;
unsigned int baseindex:1;
unsigned int jumpabsolute:1;
- unsigned int esseg:1;
unsigned int byte:1;
unsigned int word:1;
unsigned int dword:1;