Debian Codegraph @

x86/iflags.ph

raw
1 # -*- perl -*-
2
3 #
4 # Flags consumed by preinsns.pl/insns.pl and not actually present in
5 # the generated C code:
6 #
7 # ND - not for disassembler
8 # DISASM - disassembler only
9 # KILL - ignore this instruction pattern entirely
10 # !ZU - no zero-upper version of this instruction
11 # !FL - instruction never modifies the flags
12 # NF! - alias for NF_R: {nf} syntactic prefix required
13 # SMx-y - alias for SMx,SMx+1,SMx+2,...,SMy
14 #
15
16 #
17 # dword bound, index 0 - specific flags
18 #
19 if_align('IGEN', $NOBREAK);
20
21 # The following MUST be in word 0
22 if_("SM0", "Size match operand 0");
23 if_("SM1", "Size match operand 1");
24 if_("SM2", "Size match operand 2");
25 if_("SM3", "Size match operand 3");
26 if_("SM4", "Size match operand 4");
27 if_("AR0", "SB, SW, SD applies to operand 0");
28 if_("AR1", "SB, SW, SD applies to operand 1");
29 if_("AR2", "SB, SW, SD applies to operand 2");
30 if_("AR3", "SB, SW, SD applies to operand 3");
31 if_("AR4", "SB, SW, SD applies to operand 4");
32 # These must match the order of the BITSx flags in opflags.h
33 if_("SB", "Unsized operands can't be non-byte");
34 if_("SW", "Unsized operands can't be non-word");
35 if_("SD", "Unsized operands can't be non-dword");
36 if_("SQ", "Unsized operands can't be non-qword");
37 if_("ST", "Unsized operands can't be non-tword");
38 if_("SO", "Unsized operands can't be non-oword");
39 if_("SY", "Unsized operands can't be non-yword");
40 if_("SZ", "Unsized operands can't be non-zword");
41 # End BITSx order match requirement
42 if_("NWSIZE", "Operand size defaults to 64 in 64-bit mode");
43 # OSIZE can be modified by osp prefixes, but not by other operands
44 if_("OSIZE", "Unsized operands must match the operand size");
45 if_("ASIZE", "Unsized operands must match the address size");
46 if_("ANYSIZE", "Ignore operand size even if explicit");
47 if_("SX", "Unsized operands not allowed");
48 if_("SDWORD", "Strict sdword64 matching");
49 if_break_ok();
50
51 if_("PSEUDO", "Pseudo-instruction (directive)");
52 if_("JMP_RELAX", "Relaxable jump instruction");
53 if_("JCC_HINT", "Hintable jump instruction");
54 if_("OPT", "Optimizing assembly only");
55 if_("LATEVEX", "Only if EVEX instructions are disabled");
56 if_("NOREX", "Instruction does not support REX encoding");
57 if_("NOAPX", "Instruction does not support APX registers or REX2");
58 if_("NF", "Instruction supports the {nf} prefix");
59 if_("NF_R", "Instruction requires the {nf} prefix");
60 if_("NF_N", "Instruction doesn't allow the {nf} prefix");
61 if_("NF_E", "EVEX.NF set with {nf} prefix");
62 if_("ZU", "Instruction supports the {zu} prefix");
63 if_("ZU_R", "Instruction requires the {zu} prefix");
64 if_("ZU_E", "EVEX.ND set with {zu} prefix");
65 if_("LIG", "Ignore VEX/EVEX L field");
66 if_("WIG", "Ignore VEX/EVEX W field");
67 if_("WW", "VEX/EVEX W is REX.W");
68 if_("SIB", "SIB encoding required");
69 if_("LOCK", "Lockable if operand 0 is memory");
70 if_("LOCK1", "Lockable if operand 1 is memory");
71 if_("NOLONG", "Not available in long mode");
72 if_("LONG", "Long mode");
73 if_("NOHLE", "HLE prefixes forbidden");
74 if_("MIB", "split base/index EA");
75 if_("BND", "BND (0xF2) prefix available");
76 if_("REX2", "REX2 encoding required");
77 if_("HLE", "HLE prefixed");
78 if_("FL", "Instruction modifies the flags");
79 if_("MOPVEC", "M operand is a vector"); # Autodetected
80 if_("SCC", "EVEX[27:24] is special condition code");
81 if_("BESTDIS", "Preferred disassembly pattern");
82
83 #
84 # Special immediates types like {dfv=}
85 # Used to detect incorrect usage and for the disassembler.
86 #
87 if_("DFV", "Destination flag values");
88
89 #
90 # dword bound - instruction feature filtering flags
91 #
92 if_align('FEATURE');
93
94 #
95 # Encoding formats that can be set with the CPU directive
96 #
97 if_("VEX", "VEX or XOP encoded instruction");
98 if_("EVEX", "EVEX encoded instruction");
99
100 #
101 # Feature filtering flags
102 #
103 if_("PRIV", "Privileged instruction");
104 if_("SMM", "Only valid in SMM");
105 if_("PROT", "Protected mode only");
106 if_("UNDOC", "Undocumented");
107 if_("FPU", "FPU");
108 if_("MMX", "MMX");
109 if_("3DNOW", "3DNow!");
110 if_("SSE", "SSE (KNI, MMX2)");
111 if_("SSE2", "SSE2");
112 if_("SSE3", "SSE3 (PNI)");
113 if_("VMX", "VMX");
114 if_("SSSE3", "SSSE3");
115 if_("SSE4A", "AMD SSE4a");
116 if_("SSE41", "SSE4.1");
117 if_("SSE42", "SSE4.2");
118 if_("SSE5", "SSE5");
119 if_("AVX", "AVX (256-bit floating point)");
120 if_("AVX2", "AVX2 (256-bit integer)");
121 if_("FMA", "Fused multiply-add");
122 if_("BMI1", "Bit manipulation instructions 1");
123 if_("BMI2", "Bit manipulation instructions 2");
124 if_("TBM", "");
125 if_("RTM", "");
126 if_("AVX512", "AVX-512");
127 if_("AVX512F", "AVX-512F (base architecture)");
128 if_("AVX512CD", "AVX-512 Conflict Detection");
129 if_("AVX512ER", "AVX-512 Exponential and Reciprocal");
130 if_("AVX512PF", "AVX-512 Prefetch");
131 if_("MPX", "MPX");
132 if_("SHA", "SHA");
133 if_("AVX512VL", "AVX-512 Vector Length Orthogonality");
134 if_("AVX512DQ", "AVX-512 Dword and Qword");
135 if_("AVX512BW", "AVX-512 Byte and Word");
136 if_("AVX512IFMA", "AVX-512 IFMA instructions");
137 if_("AVX512VBMI", "AVX-512 VBMI instructions");
138 if_("AES", "AES instructions");
139 if_("VAES", "AES AVX instructions");
140 if_("VPCLMULQDQ", "AVX Carryless Multiplication");
141 if_("GFNI", "Galois Field instructions");
142 if_("AVX512VBMI2", "AVX-512 VBMI2 instructions");
143 if_("AVX512VNNI", "AVX-512 VNNI instructions");
144 if_("AVX512BITALG", "AVX-512 Bit Algorithm instructions");
145 if_("AVX512VPOPCNTDQ", "AVX-512 VPOPCNTD/VPOPCNTQ");
146 if_("AVX5124FMAPS", "AVX-512 4-iteration multiply-add");
147 if_("AVX5124VNNIW", "AVX-512 4-iteration dot product");
148 if_("AVX512FP16", "AVX-512 FP16 instructions");
149 if_("F16C", "F16C instructions");
150 if_("SGX", "Intel Software Guard Extensions (SGX)");
151 if_("CET", "Intel Control-Flow Enforcement Technology (CET)");
152 if_("ENQCMD", "Enqueue command instructions");
153 if_("TSXLDTRK", "TSX suspend load address tracking");
154 if_("AVX512BF16", "AVX-512 bfloat16");
155 if_("AVX512VP2INTERSECT", "AVX-512 VP2INTERSECT instructions");
156 if_("AMXTILE", "AMX tile configuration instructions");
157 if_("AMXBF16", "AMX bfloat16 multiplication");
158 if_("AMXFP16", "AMX FP16 multiplication");
159 if_("AMXFP8", "AMX FP8 instructions");
160 if_("AMXTF32", "AMX TF32 multiplication");
161 if_("AMXINT8", "AMX 8-bit integer multiplication");
162 if_("AMXCOMPLEX", "AMX float16 complex multiplication");
163 if_("AMXAVX512", "EVEX zmm<-tmm conversion instructions");
164 if_("AMXMOVRS", "AMX loads with MOVRS hint");
165 if_("AMXTRANSPOSE", "AMX transpose instructions");
166 if_("FRED", "Flexible Return and Exception Delivery (FRED)");
167 if_("RAOINT", "Remote atomic operations (RAO-INT)");
168 if_("UINTR", "User interrupts");
169 if_("CMPCCXADD", "CMPccXADD instructions");
170 if_("PREFETCHI", "PREFETCHI0 and PREFETCHI1");
171 if_("MSRLIST", "RDMSRLIST and WRMSRLIST");
172 if_("AVXNECONVERT", "AVX exceptionless floating-point conversions");
173 if_("AVXVNNI", "AVX Vector Neural Network instructions");
174 if_("AVXVNNIINT8", "AVX Vector Neural Network 8-bit integer instructions");
175 if_("AVXVNNIINT16", "AVX Vector Neural Network 16-bit integer instructions");
176 if_("AVXIFMA", "AVX integer multiply and add");
177 if_("HRESET", "History reset");
178 if_("SMAP", "Supervisor Mode Access Prevention (SMAP)");
179 if_("SHA512", "SHA512 instructions");
180 if_("HSM3", "SM3 hash instructions");
181 if_("HSM4", "SM4 hash instructions");
182 if_("APX", "Advanced Performance Extensions (APX)");
183 if_("AVX10_1", "AVX 10.1 instructions");
184 if_("AVX10_2", "AVX 10.2 instructions");
185 if_("AVX10_VNNIINT", "AVX Vector Neural Network integer instructions");
186 if_("ADX", "ADCX and ADOX instructions");
187 if_("PKU", "Protection key for user mode");
188 if_("MONITOR", "MONITOR and MWAIT");
189 if_("MONITORX", "MONITORX and MWAITX");
190 if_("WAITPKG", "User wait instruction package");
191 if_("MSR_IMM", "Immediate RDMSR/WRMSRNS instructions");
192 if_("AESKLE", "AES key locker");
193 if_("AESKLEWIDE_KL", "AES wide key locker");
194
195 # Single-instruction CPUID bits without additional help text
196 my @oneins = qw(invpcid prefetchwt1 pbndkb pconfig wbnoinvd serialize
197 lkgs wrmsrns clflushopt clwb rdrand rdseed rdpid lzcnt
198 ptwrite cldemote movdiri movdir64b clzero movbe movrs);
199 foreach my $ins (@oneins) {
200 if_($ins, "\U$ins\E instruction");
201 }
202
203 # Put these last to minimize their relevance
204 if_("OBSOLETE", "Instruction removed from architecture");
205 if_("NEVER", "Instruction never implemented");
206 if_("NOP", "Instruction is always a (nonintentional) NOP");
207
208 #
209 # dword bound - cpu type flags
210 #
211 # The CYRIX and AMD flags should have the highest bit values; the
212 # disassembler selection algorithm depends on it.
213 #
214 if_align('CPU');
215
216 if_("8086", "8086");
217 if_("186", "186+");
218 if_("286", "286+");
219 if_("386", "386+");
220 if_("486", "486+");
221 if_("PENT", "Pentium");
222 if_("P6", "P6");
223 if_("KATMAI", "Katmai");
224 if_("WILLAMETTE", "Willamette");
225 if_("PRESCOTT", "Prescott");
226 if_("IA64", "IA64 (in x86 mode)");
227 if_("X86_64", "x86-64 (long or legacy mode)");
228 if_("NEHALEM", "Nehalem");
229 if_("WESTMERE", "Westmere");
230 if_("SANDYBRIDGE", "Sandy Bridge");
231 if_("FUTURE", "Ivy Bridge or newer");
232
233 # Default CPU level
234 if_("DEFAULT", "Default CPU level");
235
236 # Must be the last CPU definition
237 if_("ANY", "Allow any known instruction");
238
239 # These must come after the CPU definitions proper
240 if_("CYRIX", "Cyrix-specific");
241 if_("AMD", "AMD-specific");