~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to opcodes/i386-opc.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Declarations for Intel 80386 opcode table
2
 
   Copyright 2007, 2008, 2009
 
2
   Copyright 2007, 2008, 2009, 2010
3
3
   Free Software Foundation, Inc.
4
4
 
5
5
   This file is part of the GNU opcodes library.
30
30
 
31
31
/* Position of cpu flags bitfiled.  */
32
32
 
33
 
/* i186 or better required */
34
 
#define Cpu186          0
35
 
/* i286 or better required */
36
 
#define Cpu286          (Cpu186 + 1)
37
 
/* i386 or better required */
38
 
#define Cpu386          (Cpu286 + 1)
39
 
/* i486 or better required */
40
 
#define Cpu486          (Cpu386 + 1)
41
 
/* i585 or better required */
42
 
#define Cpu586          (Cpu486 + 1)
43
 
/* i686 or better required */
44
 
#define Cpu686          (Cpu586 + 1)
45
 
/* CLFLUSH Instuction support required */
46
 
#define CpuClflush      (Cpu686 + 1)
47
 
/* SYSCALL Instuctions support required */
48
 
#define CpuSYSCALL      (CpuClflush + 1)
49
 
/* Floating point support required */
50
 
#define Cpu8087         (CpuSYSCALL + 1)
51
 
/* i287 support required */
52
 
#define Cpu287          (Cpu8087 + 1)
53
 
/* i387 support required */
54
 
#define Cpu387          (Cpu287 + 1)
55
 
/* i686 and floating point support required */
56
 
#define Cpu687          (Cpu387 + 1)
57
 
/* SSE3 and floating point support required */
58
 
#define CpuFISTTP               (Cpu687 + 1)
59
 
/* MMX support required */
60
 
#define CpuMMX          (CpuFISTTP + 1)
61
 
/* SSE support required */
62
 
#define CpuSSE          (CpuMMX + 1)
63
 
/* SSE2 support required */
64
 
#define CpuSSE2         (CpuSSE + 1)
65
 
/* 3dnow! support required */
66
 
#define Cpu3dnow        (CpuSSE2 + 1)
67
 
/* 3dnow! Extensions support required */
68
 
#define Cpu3dnowA       (Cpu3dnow + 1)
69
 
/* SSE3 support required */
70
 
#define CpuSSE3         (Cpu3dnowA + 1)
71
 
/* VIA PadLock required */
72
 
#define CpuPadLock      (CpuSSE3 + 1)
73
 
/* AMD Secure Virtual Machine Ext-s required */
74
 
#define CpuSVME         (CpuPadLock + 1)
75
 
/* VMX Instructions required */
76
 
#define CpuVMX          (CpuSVME + 1)
77
 
/* SMX Instructions required */
78
 
#define CpuSMX          (CpuVMX + 1)
79
 
/* SSSE3 support required */
80
 
#define CpuSSSE3        (CpuSMX + 1)
81
 
/* SSE4a support required */
82
 
#define CpuSSE4a        (CpuSSSE3 + 1)
83
 
/* ABM New Instructions required */
84
 
#define CpuABM          (CpuSSE4a + 1)
85
 
/* SSE4.1 support required */
86
 
#define CpuSSE4_1       (CpuABM + 1)
87
 
/* SSE4.2 support required */
88
 
#define CpuSSE4_2       (CpuSSE4_1 + 1)
89
 
/* AVX support required */
90
 
#define CpuAVX          (CpuSSE4_2 + 1)
91
 
/* Intel L1OM support required */
92
 
#define CpuL1OM         (CpuAVX + 1)
93
 
/* Xsave/xrstor New Instuctions support required */
94
 
#define CpuXsave        (CpuL1OM + 1)
95
 
/* AES support required */
96
 
#define CpuAES          (CpuXsave + 1)
97
 
/* PCLMUL support required */
98
 
#define CpuPCLMUL       (CpuAES + 1)
99
 
/* FMA support required */
100
 
#define CpuFMA          (CpuPCLMUL + 1)
101
 
/* FMA4 support required */
102
 
#define CpuFMA4         (CpuFMA + 1)
103
 
/* MOVBE Instuction support required */
104
 
#define CpuMovbe        (CpuFMA4 + 1)
105
 
/* EPT Instructions required */
106
 
#define CpuEPT          (CpuMovbe + 1)
107
 
/* RDTSCP Instuction support required */
108
 
#define CpuRdtscp       (CpuEPT + 1)
109
 
/* 64bit support available, used by -march= in assembler.  */
110
 
#define CpuLM           (CpuRdtscp + 1)
111
 
/* 64bit support required  */
112
 
#define Cpu64           (CpuLM + 1)
113
 
/* Not supported in the 64bit mode  */
114
 
#define CpuNo64         (Cpu64 + 1)
115
 
/* The last bitfield in i386_cpu_flags.  */
116
 
#define CpuMax          CpuNo64
 
33
enum
 
34
{
 
35
  /* i186 or better required */
 
36
  Cpu186 = 0,
 
37
  /* i286 or better required */
 
38
  Cpu286,
 
39
  /* i386 or better required */
 
40
  Cpu386,
 
41
  /* i486 or better required */
 
42
  Cpu486,
 
43
  /* i585 or better required */
 
44
  Cpu586,
 
45
  /* i686 or better required */
 
46
  Cpu686,
 
47
  /* CLFLUSH Instuction support required */
 
48
  CpuClflush,
 
49
  /* SYSCALL Instuctions support required */
 
50
  CpuSYSCALL,
 
51
  /* Floating point support required */
 
52
  Cpu8087,
 
53
  /* i287 support required */
 
54
  Cpu287,
 
55
  /* i387 support required */
 
56
  Cpu387,
 
57
  /* i686 and floating point support required */
 
58
  Cpu687,
 
59
  /* SSE3 and floating point support required */
 
60
  CpuFISTTP,
 
61
  /* MMX support required */
 
62
  CpuMMX,
 
63
  /* SSE support required */
 
64
  CpuSSE,
 
65
  /* SSE2 support required */
 
66
  CpuSSE2,
 
67
  /* 3dnow! support required */
 
68
  Cpu3dnow,
 
69
  /* 3dnow! Extensions support required */
 
70
  Cpu3dnowA,
 
71
  /* SSE3 support required */
 
72
  CpuSSE3,
 
73
  /* VIA PadLock required */
 
74
  CpuPadLock,
 
75
  /* AMD Secure Virtual Machine Ext-s required */
 
76
  CpuSVME,
 
77
  /* VMX Instructions required */
 
78
  CpuVMX,
 
79
  /* SMX Instructions required */
 
80
  CpuSMX,
 
81
  /* SSSE3 support required */
 
82
  CpuSSSE3,
 
83
  /* SSE4a support required */
 
84
  CpuSSE4a,
 
85
  /* ABM New Instructions required */
 
86
  CpuABM,
 
87
  /* SSE4.1 support required */
 
88
  CpuSSE4_1,
 
89
  /* SSE4.2 support required */
 
90
  CpuSSE4_2,
 
91
  /* AVX support required */
 
92
  CpuAVX,
 
93
  /* Intel L1OM support required */
 
94
  CpuL1OM,
 
95
  /* Xsave/xrstor New Instuctions support required */
 
96
  CpuXsave,
 
97
  /* AES support required */
 
98
  CpuAES,
 
99
  /* PCLMUL support required */
 
100
  CpuPCLMUL,
 
101
  /* FMA support required */
 
102
  CpuFMA,
 
103
  /* FMA4 support required */
 
104
  CpuFMA4,
 
105
  /* XOP support required */
 
106
  CpuXOP,
 
107
  /* LWP support required */
 
108
  CpuLWP,
 
109
  /* MOVBE Instuction support required */
 
110
  CpuMovbe,
 
111
  /* EPT Instructions required */
 
112
  CpuEPT,
 
113
  /* RDTSCP Instuction support required */
 
114
  CpuRdtscp,
 
115
  /* 64bit support available, used by -march= in assembler.  */
 
116
  CpuLM,
 
117
  /* 64bit support required  */
 
118
  Cpu64,
 
119
  /* Not supported in the 64bit mode  */
 
120
  CpuNo64,
 
121
  /* The last bitfield in i386_cpu_flags.  */
 
122
  CpuMax = CpuNo64
 
123
};
117
124
 
118
125
#define CpuNumOfUints \
119
126
  (CpuMax / sizeof (unsigned int) / CHAR_BIT + 1)
165
172
      unsigned int cpupclmul:1;
166
173
      unsigned int cpufma:1;
167
174
      unsigned int cpufma4:1;
 
175
      unsigned int cpuxop:1;
 
176
      unsigned int cpulwp:1;
168
177
      unsigned int cpumovbe:1;
169
178
      unsigned int cpuept:1;
170
179
      unsigned int cpurdtscp:1;
180
189
 
181
190
/* Position of opcode_modifier bits.  */
182
191
 
183
 
/* has direction bit. */
184
 
#define D                       0
185
 
/* set if operands can be words or dwords encoded the canonical way */
186
 
#define W                       (D + 1)
187
 
/* Skip the current insn and use the next insn in i386-opc.tbl to swap
188
 
   operand in encoding.  */
189
 
#define S                       (W + 1)
190
 
/* insn has a modrm byte. */
191
 
#define Modrm                   (S + 1)
192
 
/* register is in low 3 bits of opcode */
193
 
#define ShortForm               (Modrm + 1)
194
 
/* special case for jump insns.  */
195
 
#define Jump                    (ShortForm + 1)
196
 
/* call and jump */
197
 
#define JumpDword               (Jump + 1)
198
 
/* loop and jecxz */
199
 
#define JumpByte                (JumpDword + 1)
200
 
/* special case for intersegment leaps/calls */
201
 
#define JumpInterSegment        (JumpByte + 1)
202
 
/* FP insn memory format bit, sized by 0x4 */
203
 
#define FloatMF                 (JumpInterSegment + 1)
204
 
/* src/dest swap for floats. */
205
 
#define FloatR                  (FloatMF + 1)
206
 
/* has float insn direction bit. */
207
 
#define FloatD                  (FloatR + 1)
208
 
/* needs size prefix if in 32-bit mode */
209
 
#define Size16                  (FloatD + 1)
210
 
/* needs size prefix if in 16-bit mode */
211
 
#define Size32                  (Size16 + 1)
212
 
/* needs size prefix if in 64-bit mode */
213
 
#define Size64                  (Size32 + 1)
214
 
/* instruction ignores operand size prefix and in Intel mode ignores
215
 
   mnemonic size suffix check.  */
216
 
#define IgnoreSize              (Size64 + 1)
217
 
/* default insn size depends on mode */
218
 
#define DefaultSize             (IgnoreSize + 1)
219
 
/* b suffix on instruction illegal */
220
 
#define No_bSuf                 (DefaultSize + 1)
221
 
/* w suffix on instruction illegal */
222
 
#define No_wSuf                 (No_bSuf + 1)
223
 
/* l suffix on instruction illegal */
224
 
#define No_lSuf                 (No_wSuf + 1)
225
 
/* s suffix on instruction illegal */
226
 
#define No_sSuf                 (No_lSuf + 1)
227
 
/* q suffix on instruction illegal */
228
 
#define No_qSuf                 (No_sSuf + 1)
229
 
/* long double suffix on instruction illegal */
230
 
#define No_ldSuf                (No_qSuf + 1)
231
 
/* instruction needs FWAIT */
232
 
#define FWait                   (No_ldSuf + 1)
233
 
/* quick test for string instructions */
234
 
#define IsString                (FWait + 1)
235
 
/* fake an extra reg operand for clr, imul and special register
236
 
   processing for some instructions.  */
237
 
#define RegKludge               (IsString + 1)
238
 
/* The first operand must be xmm0 */
239
 
#define FirstXmm0               (RegKludge + 1)
240
 
/* An implicit xmm0 as the first operand */
241
 
#define Implicit1stXmm0         (FirstXmm0 + 1)
242
 
/* BYTE is OK in Intel syntax. */
243
 
#define ByteOkIntel             (Implicit1stXmm0 + 1)
244
 
/* Convert to DWORD */
245
 
#define ToDword                 (ByteOkIntel + 1)
246
 
/* Convert to QWORD */
247
 
#define ToQword                 (ToDword + 1)
248
 
/* Address prefix changes operand 0 */
249
 
#define AddrPrefixOp0           (ToQword + 1)
250
 
/* opcode is a prefix */
251
 
#define IsPrefix                (AddrPrefixOp0 + 1)
252
 
/* instruction has extension in 8 bit imm */
253
 
#define ImmExt                  (IsPrefix + 1)
254
 
/* instruction don't need Rex64 prefix.  */
255
 
#define NoRex64                 (ImmExt + 1)
256
 
/* instruction require Rex64 prefix.  */
257
 
#define Rex64                   (NoRex64 + 1)
258
 
/* deprecated fp insn, gets a warning */
259
 
#define Ugh                     (Rex64 + 1)
260
 
/* insn has VEX prefix. */
261
 
#define Vex                     (Ugh + 1)
262
 
/* insn has 256bit VEX prefix. */
263
 
#define Vex256                  (Vex + 1)
264
 
/* insn has VEX NDS. Register-only source is encoded in Vex prefix.
265
 
   We use VexNDS on insns with VEX DDS since the register-only source
266
 
   is the second source register.  */
267
 
#define VexNDS                  (Vex256 + 1)
268
 
/* insn has VEX NDD. Register destination is encoded in Vex
269
 
   prefix. */
270
 
#define VexNDD                  (VexNDS + 1)
271
 
/* insn has VEX W0. */
272
 
#define VexW0                   (VexNDD + 1)
273
 
/* insn has VEX W1. */
274
 
#define VexW1                   (VexW0 + 1)
275
 
/* insn has VEX 0x0F opcode prefix. */
276
 
#define Vex0F                   (VexW1 + 1)
277
 
/* insn has VEX 0x0F38 opcode prefix. */
278
 
#define Vex0F38                 (Vex0F + 1)
279
 
/* insn has VEX 0x0F3A opcode prefix. */
280
 
#define Vex0F3A                 (Vex0F38 + 1)
281
 
/* insn has VEX prefix with 3 soures. */
282
 
#define Vex3Sources             (Vex0F3A + 1)
283
 
/* instruction has VEX 8 bit imm */
284
 
#define VexImmExt               (Vex3Sources + 1)
285
 
/* SSE to AVX support required */
286
 
#define SSE2AVX                 (VexImmExt + 1)
287
 
/* No AVX equivalent */
288
 
#define NoAVX                   (SSE2AVX + 1)
289
 
/* Compatible with old (<= 2.8.1) versions of gcc  */
290
 
#define OldGcc                  (NoAVX + 1)
291
 
/* AT&T mnemonic.  */
292
 
#define ATTMnemonic             (OldGcc + 1)
293
 
/* AT&T syntax.  */
294
 
#define ATTSyntax               (ATTMnemonic + 1)
295
 
/* Intel syntax.  */
296
 
#define IntelSyntax             (ATTSyntax + 1)
297
 
/* The last bitfield in i386_opcode_modifier.  */
298
 
#define Opcode_Modifier_Max     IntelSyntax
 
192
enum
 
193
{
 
194
  /* has direction bit. */
 
195
  D = 0,
 
196
  /* set if operands can be words or dwords encoded the canonical way */
 
197
  W,
 
198
  /* Skip the current insn and use the next insn in i386-opc.tbl to swap
 
199
     operand in encoding.  */
 
200
  S,
 
201
  /* insn has a modrm byte. */
 
202
  Modrm,
 
203
  /* register is in low 3 bits of opcode */
 
204
  ShortForm,
 
205
  /* special case for jump insns.  */
 
206
  Jump,
 
207
  /* call and jump */
 
208
  JumpDword,
 
209
  /* loop and jecxz */
 
210
  JumpByte,
 
211
  /* special case for intersegment leaps/calls */
 
212
  JumpInterSegment,
 
213
  /* FP insn memory format bit, sized by 0x4 */
 
214
  FloatMF,
 
215
  /* src/dest swap for floats. */
 
216
  FloatR,
 
217
  /* has float insn direction bit. */
 
218
  FloatD,
 
219
  /* needs size prefix if in 32-bit mode */
 
220
  Size16,
 
221
  /* needs size prefix if in 16-bit mode */
 
222
  Size32,
 
223
  /* needs size prefix if in 64-bit mode */
 
224
  Size64,
 
225
  /* instruction ignores operand size prefix and in Intel mode ignores
 
226
     mnemonic size suffix check.  */
 
227
  IgnoreSize,
 
228
  /* default insn size depends on mode */
 
229
  DefaultSize,
 
230
  /* b suffix on instruction illegal */
 
231
  No_bSuf,
 
232
  /* w suffix on instruction illegal */
 
233
  No_wSuf,
 
234
  /* l suffix on instruction illegal */
 
235
  No_lSuf,
 
236
  /* s suffix on instruction illegal */
 
237
  No_sSuf,
 
238
  /* q suffix on instruction illegal */
 
239
  No_qSuf,
 
240
  /* long double suffix on instruction illegal */
 
241
  No_ldSuf,
 
242
  /* instruction needs FWAIT */
 
243
  FWait,
 
244
  /* quick test for string instructions */
 
245
  IsString,
 
246
  /* quick test for lockable instructions */
 
247
  IsLockable,
 
248
  /* fake an extra reg operand for clr, imul and special register
 
249
     processing for some instructions.  */
 
250
  RegKludge,
 
251
  /* The first operand must be xmm0 */
 
252
  FirstXmm0,
 
253
  /* An implicit xmm0 as the first operand */
 
254
  Implicit1stXmm0,
 
255
  /* Convert to DWORD */
 
256
  ToDword,
 
257
  /* Convert to QWORD */
 
258
  ToQword,
 
259
  /* Address prefix changes operand 0 */
 
260
  AddrPrefixOp0,
 
261
  /* opcode is a prefix */
 
262
  IsPrefix,
 
263
  /* instruction has extension in 8 bit imm */
 
264
  ImmExt,
 
265
  /* instruction don't need Rex64 prefix.  */
 
266
  NoRex64,
 
267
  /* instruction require Rex64 prefix.  */
 
268
  Rex64,
 
269
  /* deprecated fp insn, gets a warning */
 
270
  Ugh,
 
271
  /* insn has VEX prefix:
 
272
        1: 128bit VEX prefix.
 
273
        2: 256bit VEX prefix.
 
274
        3: Scalar VEX prefix.
 
275
   */
 
276
#define VEX128          1
 
277
#define VEX256          2
 
278
#define VEXScalar       3
 
279
  Vex,
 
280
  /* How to encode VEX.vvvv:
 
281
     0: VEX.vvvv must be 1111b.
 
282
     1: VEX.NDS.  Register-only source is encoded in VEX.vvvv where
 
283
        the content of source registers will be preserved.
 
284
        VEX.DDS.  The second register operand is encoded in VEX.vvvv 
 
285
        where the content of first source register will be overwritten
 
286
        by the result.
 
287
        For assembler, there are no difference between VEX.NDS and
 
288
        VEX.DDS.
 
289
     2. VEX.NDD.  Register destination is encoded in VEX.vvvv.
 
290
     3. VEX.LWP.  Register destination is encoded in VEX.vvvv and one
 
291
        of the operands can access a memory location.
 
292
   */
 
293
#define VEXXDS  1
 
294
#define VEXNDD  2
 
295
#define VEXLWP  3
 
296
  VexVVVV,
 
297
  /* How the VEX.W bit is used:
 
298
     0: Set by the REX.W bit.
 
299
     1: VEX.W0.  Should always be 0.
 
300
     2: VEX.W1.  Should always be 1.
 
301
   */
 
302
#define VEXW0   1
 
303
#define VEXW1   2
 
304
  VexW,
 
305
  /* VEX opcode prefix:
 
306
     0: VEX 0x0F opcode prefix.
 
307
     1: VEX 0x0F38 opcode prefix.
 
308
     2: VEX 0x0F3A opcode prefix
 
309
     3: XOP 0x08 opcode prefix.
 
310
     4: XOP 0x09 opcode prefix
 
311
     5: XOP 0x0A opcode prefix.
 
312
   */
 
313
#define VEX0F           0
 
314
#define VEX0F38         1
 
315
#define VEX0F3A         2
 
316
#define XOP08           3
 
317
#define XOP09           4
 
318
#define XOP0A           5
 
319
  VexOpcode,
 
320
  /* number of VEX source operands:
 
321
     0: <= 2 source operands.
 
322
     1: 2 XOP source operands.
 
323
     2: 3 source operands.
 
324
   */
 
325
#define XOP2SOURCES     1
 
326
#define VEX3SOURCES     2
 
327
  VexSources,
 
328
  /* instruction has VEX 8 bit imm */
 
329
  VexImmExt,
 
330
  /* SSE to AVX support required */
 
331
  SSE2AVX,
 
332
  /* No AVX equivalent */
 
333
  NoAVX,
 
334
  /* Compatible with old (<= 2.8.1) versions of gcc  */
 
335
  OldGcc,
 
336
  /* AT&T mnemonic.  */
 
337
  ATTMnemonic,
 
338
  /* AT&T syntax.  */
 
339
  ATTSyntax,
 
340
  /* Intel syntax.  */
 
341
  IntelSyntax,
 
342
  /* The last bitfield in i386_opcode_modifier.  */
 
343
  Opcode_Modifier_Max
 
344
};
299
345
 
300
346
typedef struct i386_opcode_modifier
301
347
{
324
370
  unsigned int no_ldsuf:1;
325
371
  unsigned int fwait:1;
326
372
  unsigned int isstring:1;
 
373
  unsigned int islockable:1;
327
374
  unsigned int regkludge:1;
328
375
  unsigned int firstxmm0:1;
329
376
  unsigned int implicit1stxmm0:1;
330
 
  unsigned int byteokintel:1;
331
377
  unsigned int todword:1;
332
378
  unsigned int toqword:1;
333
379
  unsigned int addrprefixop0:1;
336
382
  unsigned int norex64:1;
337
383
  unsigned int rex64:1;
338
384
  unsigned int ugh:1;
339
 
  unsigned int vex:1;
340
 
  unsigned int vex256:1;
341
 
  unsigned int vexnds:1;
342
 
  unsigned int vexndd:1;
343
 
  unsigned int vexw0:1;
344
 
  unsigned int vexw1:1;
345
 
  unsigned int vex0f:1;
346
 
  unsigned int vex0f38:1;
347
 
  unsigned int vex0f3a:1;
348
 
  unsigned int vex3sources:1;
 
385
  unsigned int vex:2;
 
386
  unsigned int vexvvvv:2;
 
387
  unsigned int vexw:2;
 
388
  unsigned int vexopcode:3;
 
389
  unsigned int vexsources:2;
349
390
  unsigned int veximmext:1;
350
391
  unsigned int sse2avx:1;
351
392
  unsigned int noavx:1;
357
398
 
358
399
/* Position of operand_type bits.  */
359
400
 
360
 
/* 8bit register */
361
 
#define Reg8                    0
362
 
/* 16bit register */
363
 
#define Reg16                   (Reg8 + 1)
364
 
/* 32bit register */
365
 
#define Reg32                   (Reg16 + 1)
366
 
/* 64bit register */
367
 
#define Reg64                   (Reg32 + 1)
368
 
/* Floating pointer stack register */
369
 
#define FloatReg                (Reg64 + 1)
370
 
/* MMX register */
371
 
#define RegMMX                  (FloatReg + 1)
372
 
/* SSE register */
373
 
#define RegXMM                  (RegMMX + 1)
374
 
/* AVX registers */
375
 
#define RegYMM                  (RegXMM + 1)
376
 
/* Control register */
377
 
#define Control                 (RegYMM + 1)
378
 
/* Debug register */
379
 
#define Debug                   (Control + 1)
380
 
/* Test register */
381
 
#define Test                    (Debug + 1)
382
 
/* 2 bit segment register */
383
 
#define SReg2                   (Test + 1)
384
 
/* 3 bit segment register */
385
 
#define SReg3                   (SReg2 + 1)
386
 
/* 1 bit immediate */
387
 
#define Imm1                    (SReg3 + 1)
388
 
/* 8 bit immediate */
389
 
#define Imm8                    (Imm1 + 1)
390
 
/* 8 bit immediate sign extended */
391
 
#define Imm8S                   (Imm8 + 1)
392
 
/* 16 bit immediate */
393
 
#define Imm16                   (Imm8S + 1)
394
 
/* 32 bit immediate */
395
 
#define Imm32                   (Imm16 + 1)
396
 
/* 32 bit immediate sign extended */
397
 
#define Imm32S                  (Imm32 + 1)
398
 
/* 64 bit immediate */
399
 
#define Imm64                   (Imm32S + 1)
400
 
/* 8bit/16bit/32bit displacements are used in different ways,
401
 
   depending on the instruction.  For jumps, they specify the
402
 
   size of the PC relative displacement, for instructions with
403
 
   memory operand, they specify the size of the offset relative
404
 
   to the base register, and for instructions with memory offset
405
 
   such as `mov 1234,%al' they specify the size of the offset
406
 
   relative to the segment base.  */
407
 
/* 8 bit displacement */
408
 
#define Disp8                   (Imm64 + 1)
409
 
/* 16 bit displacement */
410
 
#define Disp16                  (Disp8 + 1)
411
 
/* 32 bit displacement */
412
 
#define Disp32                  (Disp16 + 1)
413
 
/* 32 bit signed displacement */
414
 
#define Disp32S                 (Disp32 + 1)
415
 
/* 64 bit displacement */
416
 
#define Disp64                  (Disp32S + 1)
417
 
/* Accumulator %al/%ax/%eax/%rax */
418
 
#define Acc                     (Disp64 + 1)
419
 
/* Floating pointer top stack register %st(0) */
420
 
#define FloatAcc                (Acc + 1)
421
 
/* Register which can be used for base or index in memory operand.  */
422
 
#define BaseIndex               (FloatAcc + 1)
423
 
/* Register to hold in/out port addr = dx */
424
 
#define InOutPortReg            (BaseIndex + 1)
425
 
/* Register to hold shift count = cl */
426
 
#define ShiftCount              (InOutPortReg + 1)
427
 
/* Absolute address for jump.  */
428
 
#define JumpAbsolute            (ShiftCount + 1)
429
 
/* String insn operand with fixed es segment */
430
 
#define EsSeg                   (JumpAbsolute + 1)
431
 
/* RegMem is for instructions with a modrm byte where the register
432
 
   destination operand should be encoded in the mod and regmem fields.
433
 
   Normally, it will be encoded in the reg field. We add a RegMem
434
 
   flag to the destination register operand to indicate that it should
435
 
   be encoded in the regmem field.  */
436
 
#define RegMem                  (EsSeg + 1)
437
 
/* Memory.  */
438
 
#define Mem                     (RegMem + 1)
439
 
/* BYTE memory. */
440
 
#define Byte                    (Mem + 1)
441
 
/* WORD memory. 2 byte */
442
 
#define Word                    (Byte + 1)
443
 
/* DWORD memory. 4 byte */
444
 
#define Dword                   (Word + 1)
445
 
/* FWORD memory. 6 byte */
446
 
#define Fword                   (Dword + 1)
447
 
/* QWORD memory. 8 byte */
448
 
#define Qword                   (Fword + 1)
449
 
/* TBYTE memory. 10 byte */
450
 
#define Tbyte                   (Qword + 1)
451
 
/* XMMWORD memory. */
452
 
#define Xmmword                 (Tbyte + 1)
453
 
/* YMMWORD memory. */
454
 
#define Ymmword                 (Xmmword + 1)
455
 
/* Unspecified memory size.  */
456
 
#define Unspecified             (Ymmword + 1)
457
 
/* Any memory size.  */
458
 
#define Anysize                 (Unspecified  + 1)
459
 
 
460
 
/* The last bitfield in i386_operand_type.  */
461
 
#define OTMax                   Anysize
 
401
enum
 
402
{
 
403
  /* 8bit register */
 
404
  Reg8 = 0,
 
405
  /* 16bit register */
 
406
  Reg16,
 
407
  /* 32bit register */
 
408
  Reg32,
 
409
  /* 64bit register */
 
410
  Reg64,
 
411
  /* Floating pointer stack register */
 
412
  FloatReg,
 
413
  /* MMX register */
 
414
  RegMMX,
 
415
  /* SSE register */
 
416
  RegXMM,
 
417
  /* AVX registers */
 
418
  RegYMM,
 
419
  /* Control register */
 
420
  Control,
 
421
  /* Debug register */
 
422
  Debug,
 
423
  /* Test register */
 
424
  Test,
 
425
  /* 2 bit segment register */
 
426
  SReg2,
 
427
  /* 3 bit segment register */
 
428
  SReg3,
 
429
  /* 1 bit immediate */
 
430
  Imm1,
 
431
  /* 8 bit immediate */
 
432
  Imm8,
 
433
  /* 8 bit immediate sign extended */
 
434
  Imm8S,
 
435
  /* 16 bit immediate */
 
436
  Imm16,
 
437
  /* 32 bit immediate */
 
438
  Imm32,
 
439
  /* 32 bit immediate sign extended */
 
440
  Imm32S,
 
441
  /* 64 bit immediate */
 
442
  Imm64,
 
443
  /* 8bit/16bit/32bit displacements are used in different ways,
 
444
     depending on the instruction.  For jumps, they specify the
 
445
     size of the PC relative displacement, for instructions with
 
446
     memory operand, they specify the size of the offset relative
 
447
     to the base register, and for instructions with memory offset
 
448
     such as `mov 1234,%al' they specify the size of the offset
 
449
     relative to the segment base.  */
 
450
  /* 8 bit displacement */
 
451
  Disp8,
 
452
  /* 16 bit displacement */
 
453
  Disp16,
 
454
  /* 32 bit displacement */
 
455
  Disp32,
 
456
  /* 32 bit signed displacement */
 
457
  Disp32S,
 
458
  /* 64 bit displacement */
 
459
  Disp64,
 
460
  /* Accumulator %al/%ax/%eax/%rax */
 
461
  Acc,
 
462
  /* Floating pointer top stack register %st(0) */
 
463
  FloatAcc,
 
464
  /* Register which can be used for base or index in memory operand.  */
 
465
  BaseIndex,
 
466
  /* Register to hold in/out port addr = dx */
 
467
  InOutPortReg,
 
468
  /* Register to hold shift count = cl */
 
469
  ShiftCount,
 
470
  /* Absolute address for jump.  */
 
471
  JumpAbsolute,
 
472
  /* String insn operand with fixed es segment */
 
473
  EsSeg,
 
474
  /* RegMem is for instructions with a modrm byte where the register
 
475
     destination operand should be encoded in the mod and regmem fields.
 
476
     Normally, it will be encoded in the reg field. We add a RegMem
 
477
     flag to the destination register operand to indicate that it should
 
478
     be encoded in the regmem field.  */
 
479
  RegMem,
 
480
  /* Memory.  */
 
481
  Mem,
 
482
  /* BYTE memory. */
 
483
  Byte,
 
484
  /* WORD memory. 2 byte */
 
485
  Word,
 
486
  /* DWORD memory. 4 byte */
 
487
  Dword,
 
488
  /* FWORD memory. 6 byte */
 
489
  Fword,
 
490
  /* QWORD memory. 8 byte */
 
491
  Qword,
 
492
  /* TBYTE memory. 10 byte */
 
493
  Tbyte,
 
494
  /* XMMWORD memory. */
 
495
  Xmmword,
 
496
  /* YMMWORD memory. */
 
497
  Ymmword,
 
498
  /* Unspecified memory size.  */
 
499
  Unspecified,
 
500
  /* Any memory size.  */
 
501
  Anysize,
 
502
 
 
503
  /* Vector 4 bit immediate.  */
 
504
  Vec_Imm4,
 
505
 
 
506
  /* The last bitfield in i386_operand_type.  */
 
507
  OTMax
 
508
};
462
509
 
463
510
#define OTNumOfUints \
464
511
  (OTMax / sizeof (unsigned int) / CHAR_BIT + 1)
517
564
      unsigned int ymmword:1;
518
565
      unsigned int unspecified:1;
519
566
      unsigned int anysize:1;
 
567
      unsigned int vec_imm4:1;
520
568
#ifdef OTUnused
521
569
      unsigned int unused:(OTNumOfBits - OTUnused);
522
570
#endif