-/* has direction bit. */
-#define D 0
-/* set if operands can be words or dwords encoded the canonical way */
-#define W (D + 1)
-/* Skip the current insn and use the next insn in i386-opc.tbl to swap
- operand in encoding. */
-#define S (W + 1)
-/* insn has a modrm byte. */
-#define Modrm (S + 1)
-/* register is in low 3 bits of opcode */
-#define ShortForm (Modrm + 1)
-/* special case for jump insns. */
-#define Jump (ShortForm + 1)
-/* call and jump */
-#define JumpDword (Jump + 1)
-/* loop and jecxz */
-#define JumpByte (JumpDword + 1)
-/* special case for intersegment leaps/calls */
-#define JumpInterSegment (JumpByte + 1)
-/* FP insn memory format bit, sized by 0x4 */
-#define FloatMF (JumpInterSegment + 1)
-/* src/dest swap for floats. */
-#define FloatR (FloatMF + 1)
-/* has float insn direction bit. */
-#define FloatD (FloatR + 1)
-/* needs size prefix if in 32-bit mode */
-#define Size16 (FloatD + 1)
-/* needs size prefix if in 16-bit mode */
-#define Size32 (Size16 + 1)
-/* needs size prefix if in 64-bit mode */
-#define Size64 (Size32 + 1)
-/* instruction ignores operand size prefix and in Intel mode ignores
- mnemonic size suffix check. */
-#define IgnoreSize (Size64 + 1)
-/* default insn size depends on mode */
-#define DefaultSize (IgnoreSize + 1)
-/* b suffix on instruction illegal */
-#define No_bSuf (DefaultSize + 1)
-/* w suffix on instruction illegal */
-#define No_wSuf (No_bSuf + 1)
-/* l suffix on instruction illegal */
-#define No_lSuf (No_wSuf + 1)
-/* s suffix on instruction illegal */
-#define No_sSuf (No_lSuf + 1)
-/* q suffix on instruction illegal */
-#define No_qSuf (No_sSuf + 1)
-/* long double suffix on instruction illegal */
-#define No_ldSuf (No_qSuf + 1)
-/* instruction needs FWAIT */
-#define FWait (No_ldSuf + 1)
-/* quick test for string instructions */
-#define IsString (FWait + 1)
-/* fake an extra reg operand for clr, imul and special register
- processing for some instructions. */
-#define RegKludge (IsString + 1)
-/* The first operand must be xmm0 */
-#define FirstXmm0 (RegKludge + 1)
-/* An implicit xmm0 as the first operand */
-#define Implicit1stXmm0 (FirstXmm0 + 1)
-/* BYTE is OK in Intel syntax. */
-#define ByteOkIntel (Implicit1stXmm0 + 1)
-/* Convert to DWORD */
-#define ToDword (ByteOkIntel + 1)
-/* Convert to QWORD */
-#define ToQword (ToDword + 1)
-/* Address prefix changes operand 0 */
-#define AddrPrefixOp0 (ToQword + 1)
-/* opcode is a prefix */
-#define IsPrefix (AddrPrefixOp0 + 1)
-/* instruction has extension in 8 bit imm */
-#define ImmExt (IsPrefix + 1)
-/* instruction don't need Rex64 prefix. */
-#define NoRex64 (ImmExt + 1)
-/* instruction require Rex64 prefix. */
-#define Rex64 (NoRex64 + 1)
-/* deprecated fp insn, gets a warning */
-#define Ugh (Rex64 + 1)
-#define Drex (Ugh + 1)
-/* instruction needs DREX with multiple encodings for memory ops */
-#define Drexv (Drex + 1)
-/* special DREX for comparisons */
-#define Drexc (Drexv + 1)
-/* insn has VEX prefix. */
-#define Vex (Drexc + 1)
-/* insn has 256bit VEX prefix. */
-#define Vex256 (Vex + 1)
-/* insn has VEX NDS. Register-only source is encoded in Vex prefix.
- We use VexNDS on insns with VEX DDS since the register-only source
- is the second source register. */
-#define VexNDS (Vex256 + 1)
-/* insn has VEX NDD. Register destination is encoded in Vex
- prefix. */
-#define VexNDD (VexNDS + 1)
-/* insn has VEX W0. */
-#define VexW0 (VexNDD + 1)
-/* insn has VEX W1. */
-#define VexW1 (VexW0 + 1)
-/* insn has VEX 0x0F opcode prefix. */
-#define Vex0F (VexW1 + 1)
-/* insn has VEX 0x0F38 opcode prefix. */
-#define Vex0F38 (Vex0F + 1)
-/* insn has VEX 0x0F3A opcode prefix. */
-#define Vex0F3A (Vex0F38 + 1)
-/* insn has VEX prefix with 3 soures. */
-#define Vex3Sources (Vex0F3A + 1)
-/* instruction has VEX 8 bit imm */
-#define VexImmExt (Vex3Sources + 1)
-/* SSE to AVX support required */
-#define SSE2AVX (VexImmExt + 1)
-/* No AVX equivalent */
-#define NoAVX (SSE2AVX + 1)
-/* Compatible with old (<= 2.8.1) versions of gcc */
-#define OldGcc (NoAVX + 1)
-/* AT&T mnemonic. */
-#define ATTMnemonic (OldGcc + 1)
-/* AT&T syntax. */
-#define ATTSyntax (ATTMnemonic + 1)
-/* Intel syntax. */
-#define IntelSyntax (ATTSyntax + 1)
-/* The last bitfield in i386_opcode_modifier. */
-#define Opcode_Modifier_Max IntelSyntax
+enum
+{
+ /* has direction bit. */
+ D = 0,
+ /* set if operands can be both bytes and words/dwords/qwords, encoded the
+ canonical way; the base_opcode field should hold the encoding for byte
+ operands */
+ W,
+ /* load form instruction. Must be placed before store form. */
+ Load,
+ /* insn has a modrm byte. */
+ Modrm,
+ /* special case for jump insns; value has to be 1 */
+#define JUMP 1
+ /* call and jump */
+#define JUMP_DWORD 2
+ /* loop and jecxz */
+#define JUMP_BYTE 3
+ /* special case for intersegment leaps/calls */
+#define JUMP_INTERSEGMENT 4
+ /* absolute address for jump */
+#define JUMP_ABSOLUTE 5
+ Jump,
+ /* FP insn memory format bit, sized by 0x4 */
+ FloatMF,
+ /* src/dest swap for floats. */
+ FloatR,
+ /* needs size prefix if in 32-bit mode */
+#define SIZE16 1
+ /* needs size prefix if in 16-bit mode */
+#define SIZE32 2
+ /* needs size prefix if in 64-bit mode */
+#define SIZE64 3
+ Size,
+ /* check register size. */
+ CheckRegSize,
+ /* instruction ignores operand size prefix and in Intel mode ignores
+ mnemonic size suffix check. */
+#define IGNORESIZE 1
+ /* default insn size depends on mode */
+#define DEFAULTSIZE 2
+ MnemonicSize,
+ /* any memory size */
+ Anysize,
+ /* b suffix on instruction illegal */
+ No_bSuf,
+ /* w suffix on instruction illegal */
+ No_wSuf,
+ /* l suffix on instruction illegal */
+ No_lSuf,
+ /* s suffix on instruction illegal */
+ No_sSuf,
+ /* q suffix on instruction illegal */
+ No_qSuf,
+ /* long double suffix on instruction illegal */
+ No_ldSuf,
+ /* instruction needs FWAIT */
+ FWait,
+ /* 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.
+ Normally, it will be encoded in the reg field. We add a RegMem
+ flag to indicate that it should be encoded in the regmem field. */
+ RegMem,
+ /* quick test if branch instruction is MPX supported */
+ BNDPrefixOk,
+ /* quick test if NOTRACK prefix is supported */
+ NoTrackPrefixOk,
+ /* quick test for lockable instructions */
+ IsLockable,
+ /* fake an extra reg operand for clr, imul and special register
+ processing for some instructions. */
+ RegKludge,
+ /* An implicit xmm0 as the first operand */
+ Implicit1stXmm0,
+ /* The HLE prefix is OK:
+ 1. With a LOCK prefix.
+ 2. With or without a LOCK prefix.
+ 3. With a RELEASE (0xf3) prefix.
+ */
+#define HLEPrefixNone 0
+#define HLEPrefixLock 1
+#define HLEPrefixAny 2
+#define HLEPrefixRelease 3
+ HLEPrefixOk,
+ /* An instruction on which a "rep" prefix is acceptable. */
+ RepPrefixOk,
+ /* Convert to DWORD */
+ ToDword,
+ /* Convert to QWORD */
+ ToQword,
+ /* Address prefix changes register operand */
+ AddrPrefixOpReg,
+ /* opcode is a prefix */
+ IsPrefix,
+ /* instruction has extension in 8 bit imm */
+ ImmExt,
+ /* instruction don't need Rex64 prefix. */
+ NoRex64,
+ /* deprecated fp insn, gets a warning */
+ Ugh,
+ /* insn has VEX prefix:
+ 1: 128bit VEX prefix (or operand dependent).
+ 2: 256bit VEX prefix.
+ 3: Scalar VEX prefix.
+ */
+#define VEX128 1
+#define VEX256 2
+#define VEXScalar 3
+ Vex,
+ /* How to encode VEX.vvvv:
+ 0: VEX.vvvv must be 1111b.
+ 1: VEX.NDS. Register-only source is encoded in VEX.vvvv where
+ the content of source registers will be preserved.
+ VEX.DDS. The second register operand is encoded in VEX.vvvv
+ where the content of first source register will be overwritten
+ by the result.
+ VEX.NDD2. The second destination register operand is encoded in
+ VEX.vvvv for instructions with 2 destination register operands.
+ For assembler, there are no difference between VEX.NDS, VEX.DDS
+ and VEX.NDD2.
+ 2. VEX.NDD. Register destination is encoded in VEX.vvvv for
+ instructions with 1 destination register operand.
+ 3. VEX.LWP. Register destination is encoded in VEX.vvvv and one
+ of the operands can access a memory location.
+ */
+#define VEXXDS 1
+#define VEXNDD 2
+#define VEXLWP 3
+ VexVVVV,
+ /* How the VEX.W bit is used:
+ 0: Set by the REX.W bit.
+ 1: VEX.W0. Should always be 0.
+ 2: VEX.W1. Should always be 1.
+ 3: VEX.WIG. The VEX.W bit is ignored.
+ */
+#define VEXW0 1
+#define VEXW1 2
+#define VEXWIG 3
+ VexW,
+ /* 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
+ VexOpcode,
+ /* number of VEX source operands:
+ 0: <= 2 source operands.
+ 1: 2 XOP source operands.
+ 2: 3 source operands.
+ */
+#define XOP2SOURCES 1
+#define VEX3SOURCES 2
+ VexSources,
+ /* Instruction with vector SIB byte:
+ 1: 128bit vector register.
+ 2: 256bit vector register.
+ 3: 512bit vector register.
+ */
+#define VecSIB128 1
+#define VecSIB256 2
+#define VecSIB512 3
+ VecSIB,
+ /* SSE to AVX support required */
+ SSE2AVX,
+ /* No AVX equivalent */
+ NoAVX,
+
+ /* insn has EVEX prefix:
+ 1: 512bit EVEX prefix.
+ 2: 128bit EVEX prefix.
+ 3: 256bit EVEX prefix.
+ 4: Length-ignored (LIG) EVEX prefix.
+ 5: Length determined from actual operands.
+ */
+#define EVEX512 1
+#define EVEX128 2
+#define EVEX256 3
+#define EVEXLIG 4
+#define EVEXDYN 5
+ EVex,
+
+ /* AVX512 masking support:
+ 1: Zeroing or merging masking depending on operands.
+ 2: Merging-masking.
+ 3: Both zeroing and merging masking.
+ */
+#define DYNAMIC_MASKING 1
+#define MERGING_MASKING 2
+#define BOTH_MASKING 3
+ Masking,
+
+ /* AVX512 broadcast support. The number of bytes to broadcast is
+ 1 << (Broadcast - 1):
+ 1: Byte broadcast.
+ 2: Word broadcast.
+ 3: Dword broadcast.
+ 4: Qword broadcast.
+ */
+#define BYTE_BROADCAST 1
+#define WORD_BROADCAST 2
+#define DWORD_BROADCAST 3
+#define QWORD_BROADCAST 4
+ Broadcast,
+
+ /* Static rounding control is supported. */
+ StaticRounding,
+
+ /* Supress All Exceptions is supported. */
+ SAE,
+
+ /* Compressed Disp8*N attribute. */
+#define DISP8_SHIFT_VL 7
+ Disp8MemShift,
+
+ /* Default mask isn't allowed. */
+ NoDefMask,
+
+ /* The second operand must be a vector register, {x,y,z}mmN, where N is a multiple of 4.
+ It implicitly denotes the register group of {x,y,z}mmN - {x,y,z}mm(N + 3).
+ */
+ ImplicitQuadGroup,
+
+ /* Support encoding optimization. */
+ Optimize,
+
+ /* AT&T mnemonic. */
+ ATTMnemonic,
+ /* AT&T syntax. */
+ ATTSyntax,
+ /* Intel syntax. */
+ IntelSyntax,
+ /* ISA64: Don't change the order without other code adjustments.
+ 0: Common to AMD64 and Intel64.
+ 1: AMD64.
+ 2: Intel64.
+ 3: Only in Intel64.
+ */
+#define AMD64 1
+#define INTEL64 2
+#define INTEL64ONLY 3
+ ISA64,
+ /* The last bitfield in i386_opcode_modifier. */
+ Opcode_Modifier_Num
+};