1 # Define set of possible instruction opcode flags that can apply
2 # to an instruction. These flags fully define how to parse an
3 # x86 instruction. Used by the decoder defined
4 # in native_client/src/trusted/validator/x86/decoder.
6 # Note: The following sufficies are used:
12 # Indicates the use of a rex pefix that affects the operand size or
13 # instruction semantics. Intel's Notation is REX.W. Only applies if
14 # decoder is running in 64-bit mode.
17 # Indicates that opcode has REX prefix and REX.R is set.
20 # Defines instruction that uses opcode value 0-7 in the ModRm reg field
21 # as an operand. Intel's notation is /digit. Note: This data will be
22 # stored in the first operand, using a ModRmOpcode operand kind.
25 # Defines a special 3DNOW 0F0F format instruction, which is used
26 # to parse all 3DNOW OFOF instructions, including the operands,
27 # and the trailing opcode in the immediate byte following the instruction.
30 # Defines instruction that uses opcode value 0-7 in the ModRm r/m field
31 # as an operand (in addition to the ModRm reg field). Note: These
32 # instructions also require the ModRm mod field to be 0x3. See
33 # section A.2.5 in the Intel manual (see ncdecode_tablegen.c for reference).
36 # Defines an OpcodeInModRm, where the value of ModRm must also be less
37 # than 0xC0 (see x87 instructions for examples of this).
38 # NOTE: When this flag is set, so is OpcodeInModRm.
39 # NOTE: Also automatically added when an M_Operand is specified, so that
40 # none of the mod=0x3 registers are allowed.
43 # Defines requirement during instruction matching that the ModRm mod field
47 # Defines requirement during instruction matching that the ModRm mod field
51 # Defines requirement that the S_Operand value (modrm reg field) can only be
55 # Defines instruction that the ModR/M byte contains a register operand and
56 # an r/m operand. Intel's notation is /r.
59 # Defines the size of the immediate value that must follow the opcode.
60 # Intel's notation is ib, iw, id, and io.
65 OpcodeHasImmed_p # 6 bytes.
67 OpcodeHasImmed_z # if effective size 2 bytes, 2 bytes. Otherwise 4 bytes.
69 # Define the size of the second immediate value that must follow the first
70 # immediate opcode (if more than one immediate value).
75 # Define the size of the immediate value that must follow the opcode, but
76 # uses the address size instead of the operand size.
79 # Defines a register code, from 0 through 7, added to the hexadecimal byte
80 # associated with the instruction, based on the operand size.
81 # Intel's notation is +rb. See Intel manual, table 3-1 for details.
82 # Note: to compute value 0-7, see first operand, which should be OperandBase.
85 # Defines a number used in floating-point instructions when one of the
86 # operands is ST(i) from the FPU register stack. The number i (which can
87 # range from 0 to 7) is added to the hexidecimal byte given at the left
88 # of the plus sign to form a single opcode byte. Intel's notation is +i.
89 # Note: to compute value 0-7, see first operand, which sould be OperandBase.
92 # Defines that in 64-bit mode, REX prefix should appear if using a 64-bit
93 # only register. Only applicable if running in 64-bit mode.
96 # Indicates the REX prefix does not affect the legacy instruction in 64-bit
97 # mode. Intel's notation is N.P.
100 # Defines that the opcode can be prefixed with a lock prefix.
103 # Defines that the opcode can be prefixed with a REP prefix.
106 # Defines that the opcode can be prefixed with a REPNE prefix.
109 # Defines that the opcode can be prefixed with a DATA16 prefix.
112 # Defines that prefix 66 can't be used to define operand size.
113 # That is, only 32 or 64 bit values are allowed.
114 # Used for special cases where operand size is defined as "d/q".
115 # Also used to mark instructions with 66 prefix.
118 # Defines the expected size of the operand. Can be repeated.
119 # The (possibly repeated) flags define the set possible operand
120 # sizes that are allowed by the opcode.
126 # Defines the expected size of addresses. Can be repeated.
127 # The (possibly repeated) flags define the set of possible
128 # address sizes that are allowed by the opcode.
133 # The instruction is not allowed by the Native Client Validator.
136 # Operand size defaults to size 64 in 64-bit mode.
137 OperandSizeDefaultIs64
139 # Operand size must be 64 in 64-bit mode.
142 # The instruction requires that the CPUID sets bit 29 (long mode).
145 # Ignore multiple 66 prefices when counting the number of prefices allowed
150 #--------------------------------------------------------------
152 # Note: instructions below this point are used elsewhere within native
153 # client, and do not effect the x86 instruction decoder.
156 # Opcode only applies if running in 32-bit mode.
157 # Used by the table generator to decide if the instruction
158 # should be included in the set of generated tables.
161 # Opcode only applies if running in 64-bit mode.
162 # Used by the table generator to decide if the instruction
163 # should be included in the set of generated tables.
166 # Mark instruction as (unconditional) jump. Used by the x86-64
167 # validator to quickly categorize unconditional jumps.
170 # Mark instruction as conditional jump. Used by the x86-64
171 # validator to quickly categorize unconditional jumps.
174 # Mark instruction as allowing branch hints 2e and 3e.
177 # Mark the instruction as partial. This communicates to the print routines
178 # that the matched instruction is NOT a valid x86 instruction. Hence, it should
179 # use different print rules to better communicate what was partially matched.