authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-19 20:22:31-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-19 20:54:05-05:00
loge3b5e9187811e23fbf1565a9c8a14996f1aad659
tree50597f3c007812d3301f91dabbec9092359f45d8
parenta313f153841df8caa3af8fc80966c8f61a856f51
signaturelock-open Commit is signed but in an unrecognized format.

do the x86 arch


4 files changed, 3440 insertions(+), 3398 deletions(-)

BRANCH_TODO-15
......@@ -1,8 +1,5 @@
11Finish these thigns before merging teh branch
22
3 * need to populate builtin.zig cpu_features, undefined is incorrect. I guess for zig0 it will be always baseline
4 * need to populate std.Target.current.cpu_features even for native target
5
63 * finish refactoring target/arch/*
74 * `zig builtin` integration
85 * move target details to better location
......@@ -29,18 +26,6 @@ const riscv64_default_features: []*const std.target.Feature = &[_]*const std.tar
2926 &std.target.riscv.feature_relax,
3027};
3128
32const i386_default_features: []*const std.target.Feature = &[_]*const std.target.Feature{
33 &std.target.x86.feature_cmov,
34 &std.target.x86.feature_cx8,
35 &std.target.x86.feature_fxsr,
36 &std.target.x86.feature_mmx,
37 &std.target.x86.feature_nopl,
38 &std.target.x86.feature_sse,
39 &std.target.x86.feature_sse2,
40 &std.target.x86.feature_slowUnalignedMem16,
41 &std.target.x86.feature_x87,
42};
43
4429// Same as above but without sse.
4530const i386_default_features_freestanding: []*const std.target.Feature = &[_]*const std.target.Feature{
4631 &std.target.x86.feature_cmov,
lib/std/target.zig+51-34
......@@ -401,25 +401,25 @@ pub const Target = union(enum) {
401401 }
402402
403403 /// All CPU features Zig is aware of, sorted lexicographically by name.
404 pub fn allFeaturesList(arch: Arch) []const *const Cpu.Feature {
404 pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
405405 return switch (arch) {
406 .arm, .armeb, .thumb, .thumbeb => arm.all_features,
407 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_features,
408 .avr => avr.all_features,
409 .bpfel, .bpfeb => bpf.all_features,
410 .hexagon => hexagon.all_features,
411 .mips, .mipsel, .mips64, .mips64el => mips.all_features,
412 .msp430 => msp430.all_features,
413 .powerpc, .powerpc64, .powerpc64le => powerpc.all_features,
414 .amdgcn => amdgpu.all_features,
415 .riscv32, .riscv64 => riscv.all_features,
416 .sparc, .sparcv9, .sparcel => sparc.all_features,
417 .s390x => systemz.all_features,
418 .i386, .x86_64 => x86.all_features,
419 .nvptx, .nvptx64 => nvptx.all_features,
420 .wasm32, .wasm64 => wasm.all_features,
421
422 else => &[0]*const Cpu.Feature{},
406 // TODO .arm, .armeb, .thumb, .thumbeb => arm.all_features,
407 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
408 // TODO .avr => avr.all_features,
409 // TODO .bpfel, .bpfeb => bpf.all_features,
410 // TODO .hexagon => hexagon.all_features,
411 // TODO .mips, .mipsel, .mips64, .mips64el => mips.all_features,
412 // TODO .msp430 => msp430.all_features,
413 // TODO .powerpc, .powerpc64, .powerpc64le => powerpc.all_features,
414 // TODO .amdgcn => amdgpu.all_features,
415 // TODO .riscv32, .riscv64 => riscv.all_features,
416 // TODO .sparc, .sparcv9, .sparcel => sparc.all_features,
417 // TODO .s390x => systemz.all_features,
418 .i386, .x86_64 => &x86.all_features,
419 // TODO .nvptx, .nvptx64 => nvptx.all_features,
420 // TODO .wasm32, .wasm64 => wasm.all_features,
421
422 else => &[0]Cpu.Feature{},
423423 };
424424 }
425425
......@@ -427,23 +427,24 @@ pub const Target = union(enum) {
427427 /// of features that is expected to be supported on most available hardware.
428428 pub fn baselineFeatures(arch: Arch) Cpu.Feature.Set {
429429 return switch (arch) {
430 .arm, .armeb, .thumb, .thumbeb => arm.baseline_features,
430 // TODO .arm, .armeb, .thumb, .thumbeb => arm.baseline_features,
431431 .aarch64, .aarch64_be, .aarch64_32 => aarch64.cpu.generic.features,
432 .avr => avr.baseline_features,
433 .bpfel, .bpfeb => bpf.baseline_features,
434 .hexagon => hexagon.baseline_features,
435 .mips, .mipsel, .mips64, .mips64el => mips.baseline_features,
436 .msp430 => msp430.baseline_features,
437 .powerpc, .powerpc64, .powerpc64le => powerpc.baseline_features,
438 .amdgcn => amdgpu.baseline_features,
439 .riscv32, .riscv64 => riscv.baseline_features,
440 .sparc, .sparcv9, .sparcel => sparc.baseline_features,
441 .s390x => systemz.baseline_features,
442 .i386, .x86_64 => x86.baseline_features,
443 .nvptx, .nvptx64 => nvptx.baseline_features,
444 .wasm32, .wasm64 => wasm.baseline_features,
445
446 else => &[0]*const Cpu.Feature{},
432 // TODO .avr => avr.baseline_features,
433 // TODO .bpfel, .bpfeb => bpf.baseline_features,
434 // TODO .hexagon => hexagon.baseline_features,
435 // TODO .mips, .mipsel, .mips64, .mips64el => mips.baseline_features,
436 // TODO .msp430 => msp430.baseline_features,
437 // TODO .powerpc, .powerpc64, .powerpc64le => powerpc.baseline_features,
438 // TODO .amdgcn => amdgpu.baseline_features,
439 // TODO .riscv32, .riscv64 => riscv.baseline_features,
440 // TODO .sparc, .sparcv9, .sparcel => sparc.baseline_features,
441 // TODO .s390x => systemz.baseline_features,
442 .i386 => x86.cpu.pentium4.features,
443 .x86_64 => x86.cpu.x8664.features,
444 // TODO .nvptx, .nvptx64 => nvptx.baseline_features,
445 // TODO .wasm32, .wasm64 => wasm.baseline_features,
446
447 else => 0,
447448 };
448449 }
449450
......@@ -515,6 +516,22 @@ pub const Target = union(enum) {
515516 pub fn isEnabled(set: Set, arch_feature_index: u7) bool {
516517 return (set & (@as(Set, 1) << arch_feature_index)) != 0;
517518 }
519
520 pub fn feature_set_fns(comptime F: type) type {
521 return struct {
522 pub fn featureSet(features: []const F) Set {
523 var x: Set = 0;
524 for (features) |feature| {
525 x |= @as(Set, 1) << @enumToInt(feature);
526 }
527 return x;
528 }
529
530 pub fn featureSetHas(set: Set, feature: F) bool {
531 return (set & (@as(Set, 1) << @enumToInt(feature))) != 0;
532 }
533 };
534 }
518535 };
519536 };
520537
lib/std/target/aarch64.zig+2-12
......@@ -123,21 +123,11 @@ pub const Feature = enum {
123123 zcz_gp,
124124};
125125
126pub fn featureSet(features: []const Feature) Cpu.Feature.Set {
127 var x: Cpu.Feature.Set = 0;
128 for (features) |feature| {
129 x |= 1 << @enumToInt(feature);
130 }
131 return x;
132}
133
134pub fn featureSetHas(set: Feature.Set, feature: Feature) bool {
135 return (set & (1 << @enumToInt(feature))) != 0;
136}
126pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
137127
138128pub const all_features = blk: {
139129 const len = @typeInfo(Feature).Enum.fields.len;
140 std.debug.assert(len <= @typeInfo(Feature.Set).Int.bits);
130 std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits);
141131 var result: [len]Cpu.Feature = undefined;
142132 result[@enumToInt(Feature.aes)] = .{
143133 .index = @enumToInt(Feature.aes),
lib/std/target/x86.zig+3387-3337
......@@ -1,3338 +1,3388 @@
1const Feature = @import("std").target.Feature;
2const Cpu = @import("std").target.Cpu;
3
4pub const feature_dnow3 = Feature{
5 .name = "dnow3",
6 .llvm_name = "3dnow",
7 .description = "Enable 3DNow! instructions",
8 .dependencies = &[_]*const Feature {
9 &feature_mmx,
10 },
11};
12
13pub const feature_dnowa3 = Feature{
14 .name = "dnowa3",
15 .llvm_name = "3dnowa",
16 .description = "Enable 3DNow! Athlon instructions",
17 .dependencies = &[_]*const Feature {
18 &feature_mmx,
19 },
20};
21
22pub const feature_bit64 = Feature{
23 .name = "bit64",
24 .llvm_name = "64bit",
25 .description = "Support 64-bit instructions",
26 .dependencies = &[_]*const Feature {
27 },
28};
29
30pub const feature_adx = Feature{
31 .name = "adx",
32 .llvm_name = "adx",
33 .description = "Support ADX instructions",
34 .dependencies = &[_]*const Feature {
35 },
36};
37
38pub const feature_aes = Feature{
39 .name = "aes",
40 .llvm_name = "aes",
41 .description = "Enable AES instructions",
42 .dependencies = &[_]*const Feature {
43 &feature_sse,
44 },
45};
46
47pub const feature_avx = Feature{
48 .name = "avx",
49 .llvm_name = "avx",
50 .description = "Enable AVX instructions",
51 .dependencies = &[_]*const Feature {
52 &feature_sse,
53 },
54};
55
56pub const feature_avx2 = Feature{
57 .name = "avx2",
58 .llvm_name = "avx2",
59 .description = "Enable AVX2 instructions",
60 .dependencies = &[_]*const Feature {
61 &feature_sse,
62 },
63};
64
65pub const feature_avx512f = Feature{
66 .name = "avx512f",
67 .llvm_name = "avx512f",
68 .description = "Enable AVX-512 instructions",
69 .dependencies = &[_]*const Feature {
70 &feature_sse,
71 },
72};
73
74pub const feature_avx512bf16 = Feature{
75 .name = "avx512bf16",
76 .llvm_name = "avx512bf16",
77 .description = "Support bfloat16 floating point",
78 .dependencies = &[_]*const Feature {
79 &feature_sse,
80 },
81};
82
83pub const feature_avx512bitalg = Feature{
84 .name = "avx512bitalg",
85 .llvm_name = "avx512bitalg",
86 .description = "Enable AVX-512 Bit Algorithms",
87 .dependencies = &[_]*const Feature {
88 &feature_sse,
89 },
90};
91
92pub const feature_bmi = Feature{
93 .name = "bmi",
94 .llvm_name = "bmi",
95 .description = "Support BMI instructions",
96 .dependencies = &[_]*const Feature {
97 },
98};
99
100pub const feature_bmi2 = Feature{
101 .name = "bmi2",
102 .llvm_name = "bmi2",
103 .description = "Support BMI2 instructions",
104 .dependencies = &[_]*const Feature {
105 },
106};
107
108pub const feature_avx512bw = Feature{
109 .name = "avx512bw",
110 .llvm_name = "avx512bw",
111 .description = "Enable AVX-512 Byte and Word Instructions",
112 .dependencies = &[_]*const Feature {
113 &feature_sse,
114 },
115};
116
117pub const feature_branchfusion = Feature{
118 .name = "branchfusion",
119 .llvm_name = "branchfusion",
120 .description = "CMP/TEST can be fused with conditional branches",
121 .dependencies = &[_]*const Feature {
122 },
123};
124
125pub const feature_avx512cd = Feature{
126 .name = "avx512cd",
127 .llvm_name = "avx512cd",
128 .description = "Enable AVX-512 Conflict Detection Instructions",
129 .dependencies = &[_]*const Feature {
130 &feature_sse,
131 },
132};
133
134pub const feature_cldemote = Feature{
135 .name = "cldemote",
136 .llvm_name = "cldemote",
137 .description = "Enable Cache Demote",
138 .dependencies = &[_]*const Feature {
139 },
140};
141
142pub const feature_clflushopt = Feature{
143 .name = "clflushopt",
144 .llvm_name = "clflushopt",
145 .description = "Flush A Cache Line Optimized",
146 .dependencies = &[_]*const Feature {
147 },
148};
149
150pub const feature_clwb = Feature{
151 .name = "clwb",
152 .llvm_name = "clwb",
153 .description = "Cache Line Write Back",
154 .dependencies = &[_]*const Feature {
155 },
156};
157
158pub const feature_clzero = Feature{
159 .name = "clzero",
160 .llvm_name = "clzero",
161 .description = "Enable Cache Line Zero",
162 .dependencies = &[_]*const Feature {
163 },
164};
165
166pub const feature_cmov = Feature{
167 .name = "cmov",
168 .llvm_name = "cmov",
169 .description = "Enable conditional move instructions",
170 .dependencies = &[_]*const Feature {
171 },
172};
173
174pub const feature_cx8 = Feature{
175 .name = "cx8",
176 .llvm_name = "cx8",
177 .description = "Support CMPXCHG8B instructions",
178 .dependencies = &[_]*const Feature {
179 },
180};
181
182pub const feature_cx16 = Feature{
183 .name = "cx16",
184 .llvm_name = "cx16",
185 .description = "64-bit with cmpxchg16b",
186 .dependencies = &[_]*const Feature {
187 &feature_cx8,
188 },
189};
190
191pub const feature_avx512dq = Feature{
192 .name = "avx512dq",
193 .llvm_name = "avx512dq",
194 .description = "Enable AVX-512 Doubleword and Quadword Instructions",
195 .dependencies = &[_]*const Feature {
196 &feature_sse,
197 },
198};
199
200pub const feature_enqcmd = Feature{
201 .name = "enqcmd",
202 .llvm_name = "enqcmd",
203 .description = "Has ENQCMD instructions",
204 .dependencies = &[_]*const Feature {
205 },
206};
207
208pub const feature_avx512er = Feature{
209 .name = "avx512er",
210 .llvm_name = "avx512er",
211 .description = "Enable AVX-512 Exponential and Reciprocal Instructions",
212 .dependencies = &[_]*const Feature {
213 &feature_sse,
214 },
215};
216
217pub const feature_ermsb = Feature{
218 .name = "ermsb",
219 .llvm_name = "ermsb",
220 .description = "REP MOVS/STOS are fast",
221 .dependencies = &[_]*const Feature {
222 },
223};
224
225pub const feature_f16c = Feature{
226 .name = "f16c",
227 .llvm_name = "f16c",
228 .description = "Support 16-bit floating point conversion instructions",
229 .dependencies = &[_]*const Feature {
230 &feature_sse,
231 },
232};
233
234pub const feature_fma = Feature{
235 .name = "fma",
236 .llvm_name = "fma",
237 .description = "Enable three-operand fused multiple-add",
238 .dependencies = &[_]*const Feature {
239 &feature_sse,
240 },
241};
242
243pub const feature_fma4 = Feature{
244 .name = "fma4",
245 .llvm_name = "fma4",
246 .description = "Enable four-operand fused multiple-add",
247 .dependencies = &[_]*const Feature {
248 &feature_sse,
249 },
250};
251
252pub const feature_fsgsbase = Feature{
253 .name = "fsgsbase",
254 .llvm_name = "fsgsbase",
255 .description = "Support FS/GS Base instructions",
256 .dependencies = &[_]*const Feature {
257 },
258};
259
260pub const feature_fxsr = Feature{
261 .name = "fxsr",
262 .llvm_name = "fxsr",
263 .description = "Support fxsave/fxrestore instructions",
264 .dependencies = &[_]*const Feature {
265 },
266};
267
268pub const feature_fast11bytenop = Feature{
269 .name = "fast11bytenop",
270 .llvm_name = "fast-11bytenop",
271 .description = "Target can quickly decode up to 11 byte NOPs",
272 .dependencies = &[_]*const Feature {
273 },
274};
275
276pub const feature_fast15bytenop = Feature{
277 .name = "fast15bytenop",
278 .llvm_name = "fast-15bytenop",
279 .description = "Target can quickly decode up to 15 byte NOPs",
280 .dependencies = &[_]*const Feature {
281 },
282};
283
284pub const feature_fastBextr = Feature{
285 .name = "fastBextr",
286 .llvm_name = "fast-bextr",
287 .description = "Indicates that the BEXTR instruction is implemented as a single uop with good throughput",
288 .dependencies = &[_]*const Feature {
289 },
290};
291
292pub const feature_fastHops = Feature{
293 .name = "fastHops",
294 .llvm_name = "fast-hops",
295 .description = "Prefer horizontal vector math instructions (haddp, phsub, etc.) over normal vector instructions with shuffles",
296 .dependencies = &[_]*const Feature {
297 &feature_sse,
298 },
299};
300
301pub const feature_fastLzcnt = Feature{
302 .name = "fastLzcnt",
303 .llvm_name = "fast-lzcnt",
304 .description = "LZCNT instructions are as fast as most simple integer ops",
305 .dependencies = &[_]*const Feature {
306 },
307};
308
309pub const feature_fastPartialYmmOrZmmWrite = Feature{
310 .name = "fastPartialYmmOrZmmWrite",
311 .llvm_name = "fast-partial-ymm-or-zmm-write",
312 .description = "Partial writes to YMM/ZMM registers are fast",
313 .dependencies = &[_]*const Feature {
314 },
315};
316
317pub const feature_fastShldRotate = Feature{
318 .name = "fastShldRotate",
319 .llvm_name = "fast-shld-rotate",
320 .description = "SHLD can be used as a faster rotate",
321 .dependencies = &[_]*const Feature {
322 },
323};
324
325pub const feature_fastScalarFsqrt = Feature{
326 .name = "fastScalarFsqrt",
327 .llvm_name = "fast-scalar-fsqrt",
328 .description = "Scalar SQRT is fast (disable Newton-Raphson)",
329 .dependencies = &[_]*const Feature {
330 },
331};
332
333pub const feature_fastScalarShiftMasks = Feature{
334 .name = "fastScalarShiftMasks",
335 .llvm_name = "fast-scalar-shift-masks",
336 .description = "Prefer a left/right scalar logical shift pair over a shift+and pair",
337 .dependencies = &[_]*const Feature {
338 },
339};
340
341pub const feature_fastVariableShuffle = Feature{
342 .name = "fastVariableShuffle",
343 .llvm_name = "fast-variable-shuffle",
344 .description = "Shuffles with variable masks are fast",
345 .dependencies = &[_]*const Feature {
346 },
347};
348
349pub const feature_fastVectorFsqrt = Feature{
350 .name = "fastVectorFsqrt",
351 .llvm_name = "fast-vector-fsqrt",
352 .description = "Vector SQRT is fast (disable Newton-Raphson)",
353 .dependencies = &[_]*const Feature {
354 },
355};
356
357pub const feature_fastVectorShiftMasks = Feature{
358 .name = "fastVectorShiftMasks",
359 .llvm_name = "fast-vector-shift-masks",
360 .description = "Prefer a left/right vector logical shift pair over a shift+and pair",
361 .dependencies = &[_]*const Feature {
362 },
363};
364
365pub const feature_gfni = Feature{
366 .name = "gfni",
367 .llvm_name = "gfni",
368 .description = "Enable Galois Field Arithmetic Instructions",
369 .dependencies = &[_]*const Feature {
370 &feature_sse,
371 },
372};
373
374pub const feature_fastGather = Feature{
375 .name = "fastGather",
376 .llvm_name = "fast-gather",
377 .description = "Indicates if gather is reasonably fast",
378 .dependencies = &[_]*const Feature {
379 },
380};
381
382pub const feature_avx512ifma = Feature{
383 .name = "avx512ifma",
384 .llvm_name = "avx512ifma",
385 .description = "Enable AVX-512 Integer Fused Multiple-Add",
386 .dependencies = &[_]*const Feature {
387 &feature_sse,
388 },
389};
390
391pub const feature_invpcid = Feature{
392 .name = "invpcid",
393 .llvm_name = "invpcid",
394 .description = "Invalidate Process-Context Identifier",
395 .dependencies = &[_]*const Feature {
396 },
397};
398
399pub const feature_sahf = Feature{
400 .name = "sahf",
401 .llvm_name = "sahf",
402 .description = "Support LAHF and SAHF instructions",
403 .dependencies = &[_]*const Feature {
404 },
405};
406
407pub const feature_leaSp = Feature{
408 .name = "leaSp",
409 .llvm_name = "lea-sp",
410 .description = "Use LEA for adjusting the stack pointer",
411 .dependencies = &[_]*const Feature {
412 },
413};
414
415pub const feature_leaUsesAg = Feature{
416 .name = "leaUsesAg",
417 .llvm_name = "lea-uses-ag",
418 .description = "LEA instruction needs inputs at AG stage",
419 .dependencies = &[_]*const Feature {
420 },
421};
422
423pub const feature_lwp = Feature{
424 .name = "lwp",
425 .llvm_name = "lwp",
426 .description = "Enable LWP instructions",
427 .dependencies = &[_]*const Feature {
428 },
429};
430
431pub const feature_lzcnt = Feature{
432 .name = "lzcnt",
433 .llvm_name = "lzcnt",
434 .description = "Support LZCNT instruction",
435 .dependencies = &[_]*const Feature {
436 },
437};
438
439pub const feature_falseDepsLzcntTzcnt = Feature{
440 .name = "falseDepsLzcntTzcnt",
441 .llvm_name = "false-deps-lzcnt-tzcnt",
442 .description = "LZCNT/TZCNT have a false dependency on dest register",
443 .dependencies = &[_]*const Feature {
444 },
445};
446
447pub const feature_mmx = Feature{
448 .name = "mmx",
449 .llvm_name = "mmx",
450 .description = "Enable MMX instructions",
451 .dependencies = &[_]*const Feature {
452 },
453};
454
455pub const feature_movbe = Feature{
456 .name = "movbe",
457 .llvm_name = "movbe",
458 .description = "Support MOVBE instruction",
459 .dependencies = &[_]*const Feature {
460 },
461};
462
463pub const feature_movdir64b = Feature{
464 .name = "movdir64b",
465 .llvm_name = "movdir64b",
466 .description = "Support movdir64b instruction",
467 .dependencies = &[_]*const Feature {
468 },
469};
470
471pub const feature_movdiri = Feature{
472 .name = "movdiri",
473 .llvm_name = "movdiri",
474 .description = "Support movdiri instruction",
475 .dependencies = &[_]*const Feature {
476 },
477};
478
479pub const feature_mpx = Feature{
480 .name = "mpx",
481 .llvm_name = "mpx",
482 .description = "Support MPX instructions",
483 .dependencies = &[_]*const Feature {
484 },
485};
486
487pub const feature_mwaitx = Feature{
488 .name = "mwaitx",
489 .llvm_name = "mwaitx",
490 .description = "Enable MONITORX/MWAITX timer functionality",
491 .dependencies = &[_]*const Feature {
492 },
493};
494
495pub const feature_macrofusion = Feature{
496 .name = "macrofusion",
497 .llvm_name = "macrofusion",
498 .description = "Various instructions can be fused with conditional branches",
499 .dependencies = &[_]*const Feature {
500 },
501};
502
503pub const feature_mergeToThreewayBranch = Feature{
504 .name = "mergeToThreewayBranch",
505 .llvm_name = "merge-to-threeway-branch",
506 .description = "Merge branches to a three-way conditional branch",
507 .dependencies = &[_]*const Feature {
508 },
509};
510
511pub const feature_nopl = Feature{
512 .name = "nopl",
513 .llvm_name = "nopl",
514 .description = "Enable NOPL instruction",
515 .dependencies = &[_]*const Feature {
516 },
517};
518
519pub const feature_pclmul = Feature{
520 .name = "pclmul",
521 .llvm_name = "pclmul",
522 .description = "Enable packed carry-less multiplication instructions",
523 .dependencies = &[_]*const Feature {
524 &feature_sse,
525 },
526};
527
528pub const feature_pconfig = Feature{
529 .name = "pconfig",
530 .llvm_name = "pconfig",
531 .description = "platform configuration instruction",
532 .dependencies = &[_]*const Feature {
533 },
534};
535
536pub const feature_avx512pf = Feature{
537 .name = "avx512pf",
538 .llvm_name = "avx512pf",
539 .description = "Enable AVX-512 PreFetch Instructions",
540 .dependencies = &[_]*const Feature {
541 &feature_sse,
542 },
543};
544
545pub const feature_pku = Feature{
546 .name = "pku",
547 .llvm_name = "pku",
548 .description = "Enable protection keys",
549 .dependencies = &[_]*const Feature {
550 },
551};
552
553pub const feature_popcnt = Feature{
554 .name = "popcnt",
555 .llvm_name = "popcnt",
556 .description = "Support POPCNT instruction",
557 .dependencies = &[_]*const Feature {
558 },
559};
560
561pub const feature_falseDepsPopcnt = Feature{
562 .name = "falseDepsPopcnt",
563 .llvm_name = "false-deps-popcnt",
564 .description = "POPCNT has a false dependency on dest register",
565 .dependencies = &[_]*const Feature {
566 },
567};
568
569pub const feature_prefetchwt1 = Feature{
570 .name = "prefetchwt1",
571 .llvm_name = "prefetchwt1",
572 .description = "Prefetch with Intent to Write and T1 Hint",
573 .dependencies = &[_]*const Feature {
574 },
575};
576
577pub const feature_prfchw = Feature{
578 .name = "prfchw",
579 .llvm_name = "prfchw",
580 .description = "Support PRFCHW instructions",
581 .dependencies = &[_]*const Feature {
582 },
583};
584
585pub const feature_ptwrite = Feature{
586 .name = "ptwrite",
587 .llvm_name = "ptwrite",
588 .description = "Support ptwrite instruction",
589 .dependencies = &[_]*const Feature {
590 },
591};
592
593pub const feature_padShortFunctions = Feature{
594 .name = "padShortFunctions",
595 .llvm_name = "pad-short-functions",
596 .description = "Pad short functions",
597 .dependencies = &[_]*const Feature {
598 },
599};
600
601pub const feature_prefer256Bit = Feature{
602 .name = "prefer256Bit",
603 .llvm_name = "prefer-256-bit",
604 .description = "Prefer 256-bit AVX instructions",
605 .dependencies = &[_]*const Feature {
606 },
607};
608
609pub const feature_rdpid = Feature{
610 .name = "rdpid",
611 .llvm_name = "rdpid",
612 .description = "Support RDPID instructions",
613 .dependencies = &[_]*const Feature {
614 },
615};
616
617pub const feature_rdrnd = Feature{
618 .name = "rdrnd",
619 .llvm_name = "rdrnd",
620 .description = "Support RDRAND instruction",
621 .dependencies = &[_]*const Feature {
622 },
623};
624
625pub const feature_rdseed = Feature{
626 .name = "rdseed",
627 .llvm_name = "rdseed",
628 .description = "Support RDSEED instruction",
629 .dependencies = &[_]*const Feature {
630 },
631};
632
633pub const feature_rtm = Feature{
634 .name = "rtm",
635 .llvm_name = "rtm",
636 .description = "Support RTM instructions",
637 .dependencies = &[_]*const Feature {
638 },
639};
640
641pub const feature_retpoline = Feature{
642 .name = "retpoline",
643 .llvm_name = "retpoline",
644 .description = "Remove speculation of indirect branches from the generated code, either by avoiding them entirely or lowering them with a speculation blocking construct",
645 .dependencies = &[_]*const Feature {
646 &feature_retpolineIndirectCalls,
647 &feature_retpolineIndirectBranches,
648 },
649};
650
651pub const feature_retpolineExternalThunk = Feature{
652 .name = "retpolineExternalThunk",
653 .llvm_name = "retpoline-external-thunk",
654 .description = "When lowering an indirect call or branch using a `retpoline`, rely on the specified user provided thunk rather than emitting one ourselves. Only has effect when combined with some other retpoline feature",
655 .dependencies = &[_]*const Feature {
656 &feature_retpolineIndirectCalls,
657 },
658};
659
660pub const feature_retpolineIndirectBranches = Feature{
661 .name = "retpolineIndirectBranches",
662 .llvm_name = "retpoline-indirect-branches",
663 .description = "Remove speculation of indirect branches from the generated code",
664 .dependencies = &[_]*const Feature {
665 },
666};
667
668pub const feature_retpolineIndirectCalls = Feature{
669 .name = "retpolineIndirectCalls",
670 .llvm_name = "retpoline-indirect-calls",
671 .description = "Remove speculation of indirect calls from the generated code",
672 .dependencies = &[_]*const Feature {
673 },
674};
675
676pub const feature_sgx = Feature{
677 .name = "sgx",
678 .llvm_name = "sgx",
679 .description = "Enable Software Guard Extensions",
680 .dependencies = &[_]*const Feature {
681 },
682};
683
684pub const feature_sha = Feature{
685 .name = "sha",
686 .llvm_name = "sha",
687 .description = "Enable SHA instructions",
688 .dependencies = &[_]*const Feature {
689 &feature_sse,
690 },
691};
692
693pub const feature_shstk = Feature{
694 .name = "shstk",
695 .llvm_name = "shstk",
696 .description = "Support CET Shadow-Stack instructions",
697 .dependencies = &[_]*const Feature {
698 },
699};
700
701pub const feature_sse = Feature{
702 .name = "sse",
703 .llvm_name = "sse",
704 .description = "Enable SSE instructions",
705 .dependencies = &[_]*const Feature {
706 },
707};
708
709pub const feature_sse2 = Feature{
710 .name = "sse2",
711 .llvm_name = "sse2",
712 .description = "Enable SSE2 instructions",
713 .dependencies = &[_]*const Feature {
714 &feature_sse,
715 },
716};
717
718pub const feature_sse3 = Feature{
719 .name = "sse3",
720 .llvm_name = "sse3",
721 .description = "Enable SSE3 instructions",
722 .dependencies = &[_]*const Feature {
723 &feature_sse,
724 },
725};
726
727pub const feature_sse4a = Feature{
728 .name = "sse4a",
729 .llvm_name = "sse4a",
730 .description = "Support SSE 4a instructions",
731 .dependencies = &[_]*const Feature {
732 &feature_sse,
733 },
734};
735
736pub const feature_sse41 = Feature{
737 .name = "sse41",
738 .llvm_name = "sse4.1",
739 .description = "Enable SSE 4.1 instructions",
740 .dependencies = &[_]*const Feature {
741 &feature_sse,
742 },
743};
744
745pub const feature_sse42 = Feature{
746 .name = "sse42",
747 .llvm_name = "sse4.2",
748 .description = "Enable SSE 4.2 instructions",
749 .dependencies = &[_]*const Feature {
750 &feature_sse,
751 },
752};
753
754pub const feature_sseUnalignedMem = Feature{
755 .name = "sseUnalignedMem",
756 .llvm_name = "sse-unaligned-mem",
757 .description = "Allow unaligned memory operands with SSE instructions",
758 .dependencies = &[_]*const Feature {
759 },
760};
761
762pub const feature_ssse3 = Feature{
763 .name = "ssse3",
764 .llvm_name = "ssse3",
765 .description = "Enable SSSE3 instructions",
766 .dependencies = &[_]*const Feature {
767 &feature_sse,
768 },
769};
770
771pub const feature_slow3opsLea = Feature{
772 .name = "slow3opsLea",
773 .llvm_name = "slow-3ops-lea",
774 .description = "LEA instruction with 3 ops or certain registers is slow",
775 .dependencies = &[_]*const Feature {
776 },
777};
778
779pub const feature_idivlToDivb = Feature{
780 .name = "idivlToDivb",
781 .llvm_name = "idivl-to-divb",
782 .description = "Use 8-bit divide for positive values less than 256",
783 .dependencies = &[_]*const Feature {
784 },
785};
786
787pub const feature_idivqToDivl = Feature{
788 .name = "idivqToDivl",
789 .llvm_name = "idivq-to-divl",
790 .description = "Use 32-bit divide for positive values less than 2^32",
791 .dependencies = &[_]*const Feature {
792 },
793};
794
795pub const feature_slowIncdec = Feature{
796 .name = "slowIncdec",
797 .llvm_name = "slow-incdec",
798 .description = "INC and DEC instructions are slower than ADD and SUB",
799 .dependencies = &[_]*const Feature {
800 },
801};
802
803pub const feature_slowLea = Feature{
804 .name = "slowLea",
805 .llvm_name = "slow-lea",
806 .description = "LEA instruction with certain arguments is slow",
807 .dependencies = &[_]*const Feature {
808 },
809};
810
811pub const feature_slowPmaddwd = Feature{
812 .name = "slowPmaddwd",
813 .llvm_name = "slow-pmaddwd",
814 .description = "PMADDWD is slower than PMULLD",
815 .dependencies = &[_]*const Feature {
816 },
817};
818
819pub const feature_slowPmulld = Feature{
820 .name = "slowPmulld",
821 .llvm_name = "slow-pmulld",
822 .description = "PMULLD instruction is slow",
823 .dependencies = &[_]*const Feature {
824 },
825};
826
827pub const feature_slowShld = Feature{
828 .name = "slowShld",
829 .llvm_name = "slow-shld",
830 .description = "SHLD instruction is slow",
831 .dependencies = &[_]*const Feature {
832 },
833};
834
835pub const feature_slowTwoMemOps = Feature{
836 .name = "slowTwoMemOps",
837 .llvm_name = "slow-two-mem-ops",
838 .description = "Two memory operand instructions are slow",
839 .dependencies = &[_]*const Feature {
840 },
841};
842
843pub const feature_slowUnalignedMem16 = Feature{
844 .name = "slowUnalignedMem16",
845 .llvm_name = "slow-unaligned-mem-16",
846 .description = "Slow unaligned 16-byte memory access",
847 .dependencies = &[_]*const Feature {
848 },
849};
850
851pub const feature_slowUnalignedMem32 = Feature{
852 .name = "slowUnalignedMem32",
853 .llvm_name = "slow-unaligned-mem-32",
854 .description = "Slow unaligned 32-byte memory access",
855 .dependencies = &[_]*const Feature {
856 },
857};
858
859pub const feature_softFloat = Feature{
860 .name = "softFloat",
861 .llvm_name = "soft-float",
862 .description = "Use software floating point features",
863 .dependencies = &[_]*const Feature {
864 },
865};
866
867pub const feature_tbm = Feature{
868 .name = "tbm",
869 .llvm_name = "tbm",
870 .description = "Enable TBM instructions",
871 .dependencies = &[_]*const Feature {
872 },
873};
874
875pub const feature_vaes = Feature{
876 .name = "vaes",
877 .llvm_name = "vaes",
878 .description = "Promote selected AES instructions to AVX512/AVX registers",
879 .dependencies = &[_]*const Feature {
880 &feature_sse,
881 },
882};
883
884pub const feature_avx512vbmi = Feature{
885 .name = "avx512vbmi",
886 .llvm_name = "avx512vbmi",
887 .description = "Enable AVX-512 Vector Byte Manipulation Instructions",
888 .dependencies = &[_]*const Feature {
889 &feature_sse,
890 },
891};
892
893pub const feature_avx512vbmi2 = Feature{
894 .name = "avx512vbmi2",
895 .llvm_name = "avx512vbmi2",
896 .description = "Enable AVX-512 further Vector Byte Manipulation Instructions",
897 .dependencies = &[_]*const Feature {
898 &feature_sse,
899 },
900};
901
902pub const feature_avx512vl = Feature{
903 .name = "avx512vl",
904 .llvm_name = "avx512vl",
905 .description = "Enable AVX-512 Vector Length eXtensions",
906 .dependencies = &[_]*const Feature {
907 &feature_sse,
908 },
909};
910
911pub const feature_avx512vnni = Feature{
912 .name = "avx512vnni",
913 .llvm_name = "avx512vnni",
914 .description = "Enable AVX-512 Vector Neural Network Instructions",
915 .dependencies = &[_]*const Feature {
916 &feature_sse,
917 },
918};
919
920pub const feature_avx512vp2intersect = Feature{
921 .name = "avx512vp2intersect",
922 .llvm_name = "avx512vp2intersect",
923 .description = "Enable AVX-512 vp2intersect",
924 .dependencies = &[_]*const Feature {
925 &feature_sse,
926 },
927};
928
929pub const feature_vpclmulqdq = Feature{
930 .name = "vpclmulqdq",
931 .llvm_name = "vpclmulqdq",
932 .description = "Enable vpclmulqdq instructions",
933 .dependencies = &[_]*const Feature {
934 &feature_sse,
935 },
936};
937
938pub const feature_avx512vpopcntdq = Feature{
939 .name = "avx512vpopcntdq",
940 .llvm_name = "avx512vpopcntdq",
941 .description = "Enable AVX-512 Population Count Instructions",
942 .dependencies = &[_]*const Feature {
943 &feature_sse,
944 },
945};
946
947pub const feature_waitpkg = Feature{
948 .name = "waitpkg",
949 .llvm_name = "waitpkg",
950 .description = "Wait and pause enhancements",
951 .dependencies = &[_]*const Feature {
952 },
953};
954
955pub const feature_wbnoinvd = Feature{
956 .name = "wbnoinvd",
957 .llvm_name = "wbnoinvd",
958 .description = "Write Back No Invalidate",
959 .dependencies = &[_]*const Feature {
960 },
961};
962
963pub const feature_x87 = Feature{
964 .name = "x87",
965 .llvm_name = "x87",
966 .description = "Enable X87 float instructions",
967 .dependencies = &[_]*const Feature {
968 },
969};
970
971pub const feature_xop = Feature{
972 .name = "xop",
973 .llvm_name = "xop",
974 .description = "Enable XOP instructions",
975 .dependencies = &[_]*const Feature {
976 &feature_sse,
977 },
978};
979
980pub const feature_xsave = Feature{
981 .name = "xsave",
982 .llvm_name = "xsave",
983 .description = "Support xsave instructions",
984 .dependencies = &[_]*const Feature {
985 },
986};
987
988pub const feature_xsavec = Feature{
989 .name = "xsavec",
990 .llvm_name = "xsavec",
991 .description = "Support xsavec instructions",
992 .dependencies = &[_]*const Feature {
993 },
994};
995
996pub const feature_xsaveopt = Feature{
997 .name = "xsaveopt",
998 .llvm_name = "xsaveopt",
999 .description = "Support xsaveopt instructions",
1000 .dependencies = &[_]*const Feature {
1001 },
1002};
1003
1004pub const feature_xsaves = Feature{
1005 .name = "xsaves",
1006 .llvm_name = "xsaves",
1007 .description = "Support xsaves instructions",
1008 .dependencies = &[_]*const Feature {
1009 },
1010};
1011
1012pub const feature_bitMode16 = Feature{
1013 .name = "bitMode16",
1014 .llvm_name = "16bit-mode",
1015 .description = "16-bit mode (i8086)",
1016 .dependencies = &[_]*const Feature {
1017 },
1018};
1019
1020pub const feature_bitMode32 = Feature{
1021 .name = "bitMode32",
1022 .llvm_name = "32bit-mode",
1023 .description = "32-bit mode (80386)",
1024 .dependencies = &[_]*const Feature {
1025 },
1026};
1027
1028pub const feature_bitMode64 = Feature{
1029 .name = "bitMode64",
1030 .llvm_name = "64bit-mode",
1031 .description = "64-bit mode (x86_64)",
1032 .dependencies = &[_]*const Feature {
1033 },
1034};
1035
1036pub const features = &[_]*const Feature {
1037 &feature_dnow3,
1038 &feature_dnowa3,
1039 &feature_bit64,
1040 &feature_adx,
1041 &feature_aes,
1042 &feature_avx,
1043 &feature_avx2,
1044 &feature_avx512f,
1045 &feature_avx512bf16,
1046 &feature_avx512bitalg,
1047 &feature_bmi,
1048 &feature_bmi2,
1049 &feature_avx512bw,
1050 &feature_branchfusion,
1051 &feature_avx512cd,
1052 &feature_cldemote,
1053 &feature_clflushopt,
1054 &feature_clwb,
1055 &feature_clzero,
1056 &feature_cmov,
1057 &feature_cx8,
1058 &feature_cx16,
1059 &feature_avx512dq,
1060 &feature_enqcmd,
1061 &feature_avx512er,
1062 &feature_ermsb,
1063 &feature_f16c,
1064 &feature_fma,
1065 &feature_fma4,
1066 &feature_fsgsbase,
1067 &feature_fxsr,
1068 &feature_fast11bytenop,
1069 &feature_fast15bytenop,
1070 &feature_fastBextr,
1071 &feature_fastHops,
1072 &feature_fastLzcnt,
1073 &feature_fastPartialYmmOrZmmWrite,
1074 &feature_fastShldRotate,
1075 &feature_fastScalarFsqrt,
1076 &feature_fastScalarShiftMasks,
1077 &feature_fastVariableShuffle,
1078 &feature_fastVectorFsqrt,
1079 &feature_fastVectorShiftMasks,
1080 &feature_gfni,
1081 &feature_fastGather,
1082 &feature_avx512ifma,
1083 &feature_invpcid,
1084 &feature_sahf,
1085 &feature_leaSp,
1086 &feature_leaUsesAg,
1087 &feature_lwp,
1088 &feature_lzcnt,
1089 &feature_falseDepsLzcntTzcnt,
1090 &feature_mmx,
1091 &feature_movbe,
1092 &feature_movdir64b,
1093 &feature_movdiri,
1094 &feature_mpx,
1095 &feature_mwaitx,
1096 &feature_macrofusion,
1097 &feature_mergeToThreewayBranch,
1098 &feature_nopl,
1099 &feature_pclmul,
1100 &feature_pconfig,
1101 &feature_avx512pf,
1102 &feature_pku,
1103 &feature_popcnt,
1104 &feature_falseDepsPopcnt,
1105 &feature_prefetchwt1,
1106 &feature_prfchw,
1107 &feature_ptwrite,
1108 &feature_padShortFunctions,
1109 &feature_prefer256Bit,
1110 &feature_rdpid,
1111 &feature_rdrnd,
1112 &feature_rdseed,
1113 &feature_rtm,
1114 &feature_retpoline,
1115 &feature_retpolineExternalThunk,
1116 &feature_retpolineIndirectBranches,
1117 &feature_retpolineIndirectCalls,
1118 &feature_sgx,
1119 &feature_sha,
1120 &feature_shstk,
1121 &feature_sse,
1122 &feature_sse2,
1123 &feature_sse3,
1124 &feature_sse4a,
1125 &feature_sse41,
1126 &feature_sse42,
1127 &feature_sseUnalignedMem,
1128 &feature_ssse3,
1129 &feature_slow3opsLea,
1130 &feature_idivlToDivb,
1131 &feature_idivqToDivl,
1132 &feature_slowIncdec,
1133 &feature_slowLea,
1134 &feature_slowPmaddwd,
1135 &feature_slowPmulld,
1136 &feature_slowShld,
1137 &feature_slowTwoMemOps,
1138 &feature_slowUnalignedMem16,
1139 &feature_slowUnalignedMem32,
1140 &feature_softFloat,
1141 &feature_tbm,
1142 &feature_vaes,
1143 &feature_avx512vbmi,
1144 &feature_avx512vbmi2,
1145 &feature_avx512vl,
1146 &feature_avx512vnni,
1147 &feature_avx512vp2intersect,
1148 &feature_vpclmulqdq,
1149 &feature_avx512vpopcntdq,
1150 &feature_waitpkg,
1151 &feature_wbnoinvd,
1152 &feature_x87,
1153 &feature_xop,
1154 &feature_xsave,
1155 &feature_xsavec,
1156 &feature_xsaveopt,
1157 &feature_xsaves,
1158 &feature_bitMode16,
1159 &feature_bitMode32,
1160 &feature_bitMode64,
1161};
1162
1163pub const cpu_amdfam10 = Cpu{
1164 .name = "amdfam10",
1165 .llvm_name = "amdfam10",
1166 .dependencies = &[_]*const Feature {
1167 &feature_mmx,
1168 &feature_dnowa3,
1169 &feature_bit64,
1170 &feature_cmov,
1171 &feature_cx8,
1172 &feature_cx16,
1173 &feature_fxsr,
1174 &feature_fastScalarShiftMasks,
1175 &feature_sahf,
1176 &feature_lzcnt,
1177 &feature_nopl,
1178 &feature_popcnt,
1179 &feature_sse,
1180 &feature_sse4a,
1181 &feature_slowShld,
1182 &feature_x87,
1183 },
1184};
1185
1186pub const cpu_athlon = Cpu{
1187 .name = "athlon",
1188 .llvm_name = "athlon",
1189 .dependencies = &[_]*const Feature {
1190 &feature_mmx,
1191 &feature_dnowa3,
1192 &feature_cmov,
1193 &feature_cx8,
1194 &feature_nopl,
1195 &feature_slowShld,
1196 &feature_slowUnalignedMem16,
1197 &feature_x87,
1198 },
1199};
1200
1201pub const cpu_athlon4 = Cpu{
1202 .name = "athlon4",
1203 .llvm_name = "athlon-4",
1204 .dependencies = &[_]*const Feature {
1205 &feature_mmx,
1206 &feature_dnowa3,
1207 &feature_cmov,
1208 &feature_cx8,
1209 &feature_fxsr,
1210 &feature_nopl,
1211 &feature_sse,
1212 &feature_slowShld,
1213 &feature_slowUnalignedMem16,
1214 &feature_x87,
1215 },
1216};
1217
1218pub const cpu_athlonFx = Cpu{
1219 .name = "athlonFx",
1220 .llvm_name = "athlon-fx",
1221 .dependencies = &[_]*const Feature {
1222 &feature_mmx,
1223 &feature_dnowa3,
1224 &feature_bit64,
1225 &feature_cmov,
1226 &feature_cx8,
1227 &feature_fxsr,
1228 &feature_fastScalarShiftMasks,
1229 &feature_nopl,
1230 &feature_sse,
1231 &feature_sse2,
1232 &feature_slowShld,
1233 &feature_slowUnalignedMem16,
1234 &feature_x87,
1235 },
1236};
1237
1238pub const cpu_athlonMp = Cpu{
1239 .name = "athlonMp",
1240 .llvm_name = "athlon-mp",
1241 .dependencies = &[_]*const Feature {
1242 &feature_mmx,
1243 &feature_dnowa3,
1244 &feature_cmov,
1245 &feature_cx8,
1246 &feature_fxsr,
1247 &feature_nopl,
1248 &feature_sse,
1249 &feature_slowShld,
1250 &feature_slowUnalignedMem16,
1251 &feature_x87,
1252 },
1253};
1254
1255pub const cpu_athlonTbird = Cpu{
1256 .name = "athlonTbird",
1257 .llvm_name = "athlon-tbird",
1258 .dependencies = &[_]*const Feature {
1259 &feature_mmx,
1260 &feature_dnowa3,
1261 &feature_cmov,
1262 &feature_cx8,
1263 &feature_nopl,
1264 &feature_slowShld,
1265 &feature_slowUnalignedMem16,
1266 &feature_x87,
1267 },
1268};
1269
1270pub const cpu_athlonXp = Cpu{
1271 .name = "athlonXp",
1272 .llvm_name = "athlon-xp",
1273 .dependencies = &[_]*const Feature {
1274 &feature_mmx,
1275 &feature_dnowa3,
1276 &feature_cmov,
1277 &feature_cx8,
1278 &feature_fxsr,
1279 &feature_nopl,
1280 &feature_sse,
1281 &feature_slowShld,
1282 &feature_slowUnalignedMem16,
1283 &feature_x87,
1284 },
1285};
1286
1287pub const cpu_athlon64 = Cpu{
1288 .name = "athlon64",
1289 .llvm_name = "athlon64",
1290 .dependencies = &[_]*const Feature {
1291 &feature_mmx,
1292 &feature_dnowa3,
1293 &feature_bit64,
1294 &feature_cmov,
1295 &feature_cx8,
1296 &feature_fxsr,
1297 &feature_fastScalarShiftMasks,
1298 &feature_nopl,
1299 &feature_sse,
1300 &feature_sse2,
1301 &feature_slowShld,
1302 &feature_slowUnalignedMem16,
1303 &feature_x87,
1304 },
1305};
1306
1307pub const cpu_athlon64Sse3 = Cpu{
1308 .name = "athlon64Sse3",
1309 .llvm_name = "athlon64-sse3",
1310 .dependencies = &[_]*const Feature {
1311 &feature_mmx,
1312 &feature_dnowa3,
1313 &feature_bit64,
1314 &feature_cmov,
1315 &feature_cx8,
1316 &feature_cx16,
1317 &feature_fxsr,
1318 &feature_fastScalarShiftMasks,
1319 &feature_nopl,
1320 &feature_sse,
1321 &feature_sse3,
1322 &feature_slowShld,
1323 &feature_slowUnalignedMem16,
1324 &feature_x87,
1325 },
1326};
1327
1328pub const cpu_atom = Cpu{
1329 .name = "atom",
1330 .llvm_name = "atom",
1331 .dependencies = &[_]*const Feature {
1332 &feature_bit64,
1333 &feature_cmov,
1334 &feature_cx8,
1335 &feature_cx16,
1336 &feature_fxsr,
1337 &feature_sahf,
1338 &feature_leaSp,
1339 &feature_leaUsesAg,
1340 &feature_mmx,
1341 &feature_movbe,
1342 &feature_nopl,
1343 &feature_padShortFunctions,
1344 &feature_sse,
1345 &feature_ssse3,
1346 &feature_idivlToDivb,
1347 &feature_idivqToDivl,
1348 &feature_slowTwoMemOps,
1349 &feature_slowUnalignedMem16,
1350 &feature_x87,
1351 },
1352};
1353
1354pub const cpu_barcelona = Cpu{
1355 .name = "barcelona",
1356 .llvm_name = "barcelona",
1357 .dependencies = &[_]*const Feature {
1358 &feature_mmx,
1359 &feature_dnowa3,
1360 &feature_bit64,
1361 &feature_cmov,
1362 &feature_cx8,
1363 &feature_cx16,
1364 &feature_fxsr,
1365 &feature_fastScalarShiftMasks,
1366 &feature_sahf,
1367 &feature_lzcnt,
1368 &feature_nopl,
1369 &feature_popcnt,
1370 &feature_sse,
1371 &feature_sse4a,
1372 &feature_slowShld,
1373 &feature_x87,
1374 },
1375};
1376
1377pub const cpu_bdver1 = Cpu{
1378 .name = "bdver1",
1379 .llvm_name = "bdver1",
1380 .dependencies = &[_]*const Feature {
1381 &feature_bit64,
1382 &feature_sse,
1383 &feature_aes,
1384 &feature_branchfusion,
1385 &feature_cmov,
1386 &feature_cx8,
1387 &feature_cx16,
1388 &feature_fxsr,
1389 &feature_fast11bytenop,
1390 &feature_fastScalarShiftMasks,
1391 &feature_sahf,
1392 &feature_lwp,
1393 &feature_lzcnt,
1394 &feature_mmx,
1395 &feature_nopl,
1396 &feature_pclmul,
1397 &feature_popcnt,
1398 &feature_prfchw,
1399 &feature_slowShld,
1400 &feature_x87,
1401 &feature_xop,
1402 &feature_xsave,
1403 },
1404};
1405
1406pub const cpu_bdver2 = Cpu{
1407 .name = "bdver2",
1408 .llvm_name = "bdver2",
1409 .dependencies = &[_]*const Feature {
1410 &feature_bit64,
1411 &feature_sse,
1412 &feature_aes,
1413 &feature_bmi,
1414 &feature_branchfusion,
1415 &feature_cmov,
1416 &feature_cx8,
1417 &feature_cx16,
1418 &feature_f16c,
1419 &feature_fma,
1420 &feature_fxsr,
1421 &feature_fast11bytenop,
1422 &feature_fastBextr,
1423 &feature_fastScalarShiftMasks,
1424 &feature_sahf,
1425 &feature_lwp,
1426 &feature_lzcnt,
1427 &feature_mmx,
1428 &feature_nopl,
1429 &feature_pclmul,
1430 &feature_popcnt,
1431 &feature_prfchw,
1432 &feature_slowShld,
1433 &feature_tbm,
1434 &feature_x87,
1435 &feature_xop,
1436 &feature_xsave,
1437 },
1438};
1439
1440pub const cpu_bdver3 = Cpu{
1441 .name = "bdver3",
1442 .llvm_name = "bdver3",
1443 .dependencies = &[_]*const Feature {
1444 &feature_bit64,
1445 &feature_sse,
1446 &feature_aes,
1447 &feature_bmi,
1448 &feature_branchfusion,
1449 &feature_cmov,
1450 &feature_cx8,
1451 &feature_cx16,
1452 &feature_f16c,
1453 &feature_fma,
1454 &feature_fsgsbase,
1455 &feature_fxsr,
1456 &feature_fast11bytenop,
1457 &feature_fastBextr,
1458 &feature_fastScalarShiftMasks,
1459 &feature_sahf,
1460 &feature_lwp,
1461 &feature_lzcnt,
1462 &feature_mmx,
1463 &feature_nopl,
1464 &feature_pclmul,
1465 &feature_popcnt,
1466 &feature_prfchw,
1467 &feature_slowShld,
1468 &feature_tbm,
1469 &feature_x87,
1470 &feature_xop,
1471 &feature_xsave,
1472 &feature_xsaveopt,
1473 },
1474};
1475
1476pub const cpu_bdver4 = Cpu{
1477 .name = "bdver4",
1478 .llvm_name = "bdver4",
1479 .dependencies = &[_]*const Feature {
1480 &feature_bit64,
1481 &feature_sse,
1482 &feature_aes,
1483 &feature_avx2,
1484 &feature_bmi,
1485 &feature_bmi2,
1486 &feature_branchfusion,
1487 &feature_cmov,
1488 &feature_cx8,
1489 &feature_cx16,
1490 &feature_f16c,
1491 &feature_fma,
1492 &feature_fsgsbase,
1493 &feature_fxsr,
1494 &feature_fast11bytenop,
1495 &feature_fastBextr,
1496 &feature_fastScalarShiftMasks,
1497 &feature_sahf,
1498 &feature_lwp,
1499 &feature_lzcnt,
1500 &feature_mmx,
1501 &feature_mwaitx,
1502 &feature_nopl,
1503 &feature_pclmul,
1504 &feature_popcnt,
1505 &feature_prfchw,
1506 &feature_slowShld,
1507 &feature_tbm,
1508 &feature_x87,
1509 &feature_xop,
1510 &feature_xsave,
1511 &feature_xsaveopt,
1512 },
1513};
1514
1515pub const cpu_bonnell = Cpu{
1516 .name = "bonnell",
1517 .llvm_name = "bonnell",
1518 .dependencies = &[_]*const Feature {
1519 &feature_bit64,
1520 &feature_cmov,
1521 &feature_cx8,
1522 &feature_cx16,
1523 &feature_fxsr,
1524 &feature_sahf,
1525 &feature_leaSp,
1526 &feature_leaUsesAg,
1527 &feature_mmx,
1528 &feature_movbe,
1529 &feature_nopl,
1530 &feature_padShortFunctions,
1531 &feature_sse,
1532 &feature_ssse3,
1533 &feature_idivlToDivb,
1534 &feature_idivqToDivl,
1535 &feature_slowTwoMemOps,
1536 &feature_slowUnalignedMem16,
1537 &feature_x87,
1538 },
1539};
1540
1541pub const cpu_broadwell = Cpu{
1542 .name = "broadwell",
1543 .llvm_name = "broadwell",
1544 .dependencies = &[_]*const Feature {
1545 &feature_bit64,
1546 &feature_adx,
1547 &feature_sse,
1548 &feature_avx,
1549 &feature_avx2,
1550 &feature_bmi,
1551 &feature_bmi2,
1552 &feature_cmov,
1553 &feature_cx8,
1554 &feature_cx16,
1555 &feature_ermsb,
1556 &feature_f16c,
1557 &feature_fma,
1558 &feature_fsgsbase,
1559 &feature_fxsr,
1560 &feature_fastShldRotate,
1561 &feature_fastScalarFsqrt,
1562 &feature_fastVariableShuffle,
1563 &feature_invpcid,
1564 &feature_sahf,
1565 &feature_lzcnt,
1566 &feature_falseDepsLzcntTzcnt,
1567 &feature_mmx,
1568 &feature_movbe,
1569 &feature_macrofusion,
1570 &feature_mergeToThreewayBranch,
1571 &feature_nopl,
1572 &feature_pclmul,
1573 &feature_popcnt,
1574 &feature_falseDepsPopcnt,
1575 &feature_prfchw,
1576 &feature_rdrnd,
1577 &feature_rdseed,
1578 &feature_sse42,
1579 &feature_slow3opsLea,
1580 &feature_idivqToDivl,
1581 &feature_x87,
1582 &feature_xsave,
1583 &feature_xsaveopt,
1584 },
1585};
1586
1587pub const cpu_btver1 = Cpu{
1588 .name = "btver1",
1589 .llvm_name = "btver1",
1590 .dependencies = &[_]*const Feature {
1591 &feature_bit64,
1592 &feature_cmov,
1593 &feature_cx8,
1594 &feature_cx16,
1595 &feature_fxsr,
1596 &feature_fast15bytenop,
1597 &feature_fastScalarShiftMasks,
1598 &feature_fastVectorShiftMasks,
1599 &feature_sahf,
1600 &feature_lzcnt,
1601 &feature_mmx,
1602 &feature_nopl,
1603 &feature_popcnt,
1604 &feature_prfchw,
1605 &feature_sse,
1606 &feature_sse4a,
1607 &feature_ssse3,
1608 &feature_slowShld,
1609 &feature_x87,
1610 },
1611};
1612
1613pub const cpu_btver2 = Cpu{
1614 .name = "btver2",
1615 .llvm_name = "btver2",
1616 .dependencies = &[_]*const Feature {
1617 &feature_bit64,
1618 &feature_sse,
1619 &feature_aes,
1620 &feature_avx,
1621 &feature_bmi,
1622 &feature_cmov,
1623 &feature_cx8,
1624 &feature_cx16,
1625 &feature_f16c,
1626 &feature_fxsr,
1627 &feature_fast15bytenop,
1628 &feature_fastBextr,
1629 &feature_fastHops,
1630 &feature_fastLzcnt,
1631 &feature_fastPartialYmmOrZmmWrite,
1632 &feature_fastScalarShiftMasks,
1633 &feature_fastVectorShiftMasks,
1634 &feature_sahf,
1635 &feature_lzcnt,
1636 &feature_mmx,
1637 &feature_movbe,
1638 &feature_nopl,
1639 &feature_pclmul,
1640 &feature_popcnt,
1641 &feature_prfchw,
1642 &feature_sse4a,
1643 &feature_ssse3,
1644 &feature_slowShld,
1645 &feature_x87,
1646 &feature_xsave,
1647 &feature_xsaveopt,
1648 },
1649};
1650
1651pub const cpu_c3 = Cpu{
1652 .name = "c3",
1653 .llvm_name = "c3",
1654 .dependencies = &[_]*const Feature {
1655 &feature_mmx,
1656 &feature_dnow3,
1657 &feature_slowUnalignedMem16,
1658 &feature_x87,
1659 },
1660};
1661
1662pub const cpu_c32 = Cpu{
1663 .name = "c32",
1664 .llvm_name = "c3-2",
1665 .dependencies = &[_]*const Feature {
1666 &feature_cmov,
1667 &feature_cx8,
1668 &feature_fxsr,
1669 &feature_mmx,
1670 &feature_sse,
1671 &feature_slowUnalignedMem16,
1672 &feature_x87,
1673 },
1674};
1675
1676pub const cpu_cannonlake = Cpu{
1677 .name = "cannonlake",
1678 .llvm_name = "cannonlake",
1679 .dependencies = &[_]*const Feature {
1680 &feature_bit64,
1681 &feature_adx,
1682 &feature_sse,
1683 &feature_aes,
1684 &feature_avx,
1685 &feature_avx2,
1686 &feature_avx512f,
1687 &feature_bmi,
1688 &feature_bmi2,
1689 &feature_avx512bw,
1690 &feature_avx512cd,
1691 &feature_clflushopt,
1692 &feature_cmov,
1693 &feature_cx8,
1694 &feature_cx16,
1695 &feature_avx512dq,
1696 &feature_ermsb,
1697 &feature_f16c,
1698 &feature_fma,
1699 &feature_fsgsbase,
1700 &feature_fxsr,
1701 &feature_fastShldRotate,
1702 &feature_fastScalarFsqrt,
1703 &feature_fastVariableShuffle,
1704 &feature_fastVectorFsqrt,
1705 &feature_fastGather,
1706 &feature_avx512ifma,
1707 &feature_invpcid,
1708 &feature_sahf,
1709 &feature_lzcnt,
1710 &feature_mmx,
1711 &feature_movbe,
1712 &feature_mpx,
1713 &feature_macrofusion,
1714 &feature_mergeToThreewayBranch,
1715 &feature_nopl,
1716 &feature_pclmul,
1717 &feature_pku,
1718 &feature_popcnt,
1719 &feature_prfchw,
1720 &feature_rdrnd,
1721 &feature_rdseed,
1722 &feature_sgx,
1723 &feature_sha,
1724 &feature_sse42,
1725 &feature_slow3opsLea,
1726 &feature_idivqToDivl,
1727 &feature_avx512vbmi,
1728 &feature_avx512vl,
1729 &feature_x87,
1730 &feature_xsave,
1731 &feature_xsavec,
1732 &feature_xsaveopt,
1733 &feature_xsaves,
1734 },
1735};
1736
1737pub const cpu_cascadelake = Cpu{
1738 .name = "cascadelake",
1739 .llvm_name = "cascadelake",
1740 .dependencies = &[_]*const Feature {
1741 &feature_bit64,
1742 &feature_adx,
1743 &feature_sse,
1744 &feature_aes,
1745 &feature_avx,
1746 &feature_avx2,
1747 &feature_avx512f,
1748 &feature_bmi,
1749 &feature_bmi2,
1750 &feature_avx512bw,
1751 &feature_avx512cd,
1752 &feature_clflushopt,
1753 &feature_clwb,
1754 &feature_cmov,
1755 &feature_cx8,
1756 &feature_cx16,
1757 &feature_avx512dq,
1758 &feature_ermsb,
1759 &feature_f16c,
1760 &feature_fma,
1761 &feature_fsgsbase,
1762 &feature_fxsr,
1763 &feature_fastShldRotate,
1764 &feature_fastScalarFsqrt,
1765 &feature_fastVariableShuffle,
1766 &feature_fastVectorFsqrt,
1767 &feature_fastGather,
1768 &feature_invpcid,
1769 &feature_sahf,
1770 &feature_lzcnt,
1771 &feature_mmx,
1772 &feature_movbe,
1773 &feature_mpx,
1774 &feature_macrofusion,
1775 &feature_mergeToThreewayBranch,
1776 &feature_nopl,
1777 &feature_pclmul,
1778 &feature_pku,
1779 &feature_popcnt,
1780 &feature_falseDepsPopcnt,
1781 &feature_prfchw,
1782 &feature_rdrnd,
1783 &feature_rdseed,
1784 &feature_sse42,
1785 &feature_slow3opsLea,
1786 &feature_idivqToDivl,
1787 &feature_avx512vl,
1788 &feature_avx512vnni,
1789 &feature_x87,
1790 &feature_xsave,
1791 &feature_xsavec,
1792 &feature_xsaveopt,
1793 &feature_xsaves,
1794 },
1795};
1796
1797pub const cpu_cooperlake = Cpu{
1798 .name = "cooperlake",
1799 .llvm_name = "cooperlake",
1800 .dependencies = &[_]*const Feature {
1801 &feature_bit64,
1802 &feature_adx,
1803 &feature_sse,
1804 &feature_aes,
1805 &feature_avx,
1806 &feature_avx2,
1807 &feature_avx512f,
1808 &feature_avx512bf16,
1809 &feature_bmi,
1810 &feature_bmi2,
1811 &feature_avx512bw,
1812 &feature_avx512cd,
1813 &feature_clflushopt,
1814 &feature_clwb,
1815 &feature_cmov,
1816 &feature_cx8,
1817 &feature_cx16,
1818 &feature_avx512dq,
1819 &feature_ermsb,
1820 &feature_f16c,
1821 &feature_fma,
1822 &feature_fsgsbase,
1823 &feature_fxsr,
1824 &feature_fastShldRotate,
1825 &feature_fastScalarFsqrt,
1826 &feature_fastVariableShuffle,
1827 &feature_fastVectorFsqrt,
1828 &feature_fastGather,
1829 &feature_invpcid,
1830 &feature_sahf,
1831 &feature_lzcnt,
1832 &feature_mmx,
1833 &feature_movbe,
1834 &feature_mpx,
1835 &feature_macrofusion,
1836 &feature_mergeToThreewayBranch,
1837 &feature_nopl,
1838 &feature_pclmul,
1839 &feature_pku,
1840 &feature_popcnt,
1841 &feature_falseDepsPopcnt,
1842 &feature_prfchw,
1843 &feature_rdrnd,
1844 &feature_rdseed,
1845 &feature_sse42,
1846 &feature_slow3opsLea,
1847 &feature_idivqToDivl,
1848 &feature_avx512vl,
1849 &feature_avx512vnni,
1850 &feature_x87,
1851 &feature_xsave,
1852 &feature_xsavec,
1853 &feature_xsaveopt,
1854 &feature_xsaves,
1855 },
1856};
1857
1858pub const cpu_coreAvxI = Cpu{
1859 .name = "coreAvxI",
1860 .llvm_name = "core-avx-i",
1861 .dependencies = &[_]*const Feature {
1862 &feature_bit64,
1863 &feature_sse,
1864 &feature_avx,
1865 &feature_cmov,
1866 &feature_cx8,
1867 &feature_cx16,
1868 &feature_f16c,
1869 &feature_fsgsbase,
1870 &feature_fxsr,
1871 &feature_fastShldRotate,
1872 &feature_fastScalarFsqrt,
1873 &feature_sahf,
1874 &feature_mmx,
1875 &feature_macrofusion,
1876 &feature_mergeToThreewayBranch,
1877 &feature_nopl,
1878 &feature_pclmul,
1879 &feature_popcnt,
1880 &feature_falseDepsPopcnt,
1881 &feature_rdrnd,
1882 &feature_sse42,
1883 &feature_slow3opsLea,
1884 &feature_idivqToDivl,
1885 &feature_slowUnalignedMem32,
1886 &feature_x87,
1887 &feature_xsave,
1888 &feature_xsaveopt,
1889 },
1890};
1891
1892pub const cpu_coreAvx2 = Cpu{
1893 .name = "coreAvx2",
1894 .llvm_name = "core-avx2",
1895 .dependencies = &[_]*const Feature {
1896 &feature_bit64,
1897 &feature_sse,
1898 &feature_avx,
1899 &feature_avx2,
1900 &feature_bmi,
1901 &feature_bmi2,
1902 &feature_cmov,
1903 &feature_cx8,
1904 &feature_cx16,
1905 &feature_ermsb,
1906 &feature_f16c,
1907 &feature_fma,
1908 &feature_fsgsbase,
1909 &feature_fxsr,
1910 &feature_fastShldRotate,
1911 &feature_fastScalarFsqrt,
1912 &feature_fastVariableShuffle,
1913 &feature_invpcid,
1914 &feature_sahf,
1915 &feature_lzcnt,
1916 &feature_falseDepsLzcntTzcnt,
1917 &feature_mmx,
1918 &feature_movbe,
1919 &feature_macrofusion,
1920 &feature_mergeToThreewayBranch,
1921 &feature_nopl,
1922 &feature_pclmul,
1923 &feature_popcnt,
1924 &feature_falseDepsPopcnt,
1925 &feature_rdrnd,
1926 &feature_sse42,
1927 &feature_slow3opsLea,
1928 &feature_idivqToDivl,
1929 &feature_x87,
1930 &feature_xsave,
1931 &feature_xsaveopt,
1932 },
1933};
1934
1935pub const cpu_core2 = Cpu{
1936 .name = "core2",
1937 .llvm_name = "core2",
1938 .dependencies = &[_]*const Feature {
1939 &feature_bit64,
1940 &feature_cmov,
1941 &feature_cx8,
1942 &feature_cx16,
1943 &feature_fxsr,
1944 &feature_sahf,
1945 &feature_mmx,
1946 &feature_macrofusion,
1947 &feature_nopl,
1948 &feature_sse,
1949 &feature_ssse3,
1950 &feature_slowUnalignedMem16,
1951 &feature_x87,
1952 },
1953};
1954
1955pub const cpu_corei7 = Cpu{
1956 .name = "corei7",
1957 .llvm_name = "corei7",
1958 .dependencies = &[_]*const Feature {
1959 &feature_bit64,
1960 &feature_cmov,
1961 &feature_cx8,
1962 &feature_cx16,
1963 &feature_fxsr,
1964 &feature_sahf,
1965 &feature_mmx,
1966 &feature_macrofusion,
1967 &feature_nopl,
1968 &feature_popcnt,
1969 &feature_sse,
1970 &feature_sse42,
1971 &feature_x87,
1972 },
1973};
1974
1975pub const cpu_corei7Avx = Cpu{
1976 .name = "corei7Avx",
1977 .llvm_name = "corei7-avx",
1978 .dependencies = &[_]*const Feature {
1979 &feature_bit64,
1980 &feature_sse,
1981 &feature_avx,
1982 &feature_cmov,
1983 &feature_cx8,
1984 &feature_cx16,
1985 &feature_fxsr,
1986 &feature_fastShldRotate,
1987 &feature_fastScalarFsqrt,
1988 &feature_sahf,
1989 &feature_mmx,
1990 &feature_macrofusion,
1991 &feature_mergeToThreewayBranch,
1992 &feature_nopl,
1993 &feature_pclmul,
1994 &feature_popcnt,
1995 &feature_falseDepsPopcnt,
1996 &feature_sse42,
1997 &feature_slow3opsLea,
1998 &feature_idivqToDivl,
1999 &feature_slowUnalignedMem32,
2000 &feature_x87,
2001 &feature_xsave,
2002 &feature_xsaveopt,
2003 },
2004};
2005
2006pub const cpu_generic = Cpu{
2007 .name = "generic",
2008 .llvm_name = "generic",
2009 .dependencies = &[_]*const Feature {
2010 &feature_cx8,
2011 &feature_slowUnalignedMem16,
2012 &feature_x87,
2013 },
2014};
2015
2016pub const cpu_geode = Cpu{
2017 .name = "geode",
2018 .llvm_name = "geode",
2019 .dependencies = &[_]*const Feature {
2020 &feature_mmx,
2021 &feature_dnowa3,
2022 &feature_cx8,
2023 &feature_slowUnalignedMem16,
2024 &feature_x87,
2025 },
2026};
2027
2028pub const cpu_goldmont = Cpu{
2029 .name = "goldmont",
2030 .llvm_name = "goldmont",
2031 .dependencies = &[_]*const Feature {
2032 &feature_bit64,
2033 &feature_sse,
2034 &feature_aes,
2035 &feature_clflushopt,
2036 &feature_cmov,
2037 &feature_cx8,
2038 &feature_cx16,
2039 &feature_fsgsbase,
2040 &feature_fxsr,
2041 &feature_sahf,
2042 &feature_mmx,
2043 &feature_movbe,
2044 &feature_mpx,
2045 &feature_nopl,
2046 &feature_pclmul,
2047 &feature_popcnt,
2048 &feature_falseDepsPopcnt,
2049 &feature_prfchw,
2050 &feature_rdrnd,
2051 &feature_rdseed,
2052 &feature_sha,
2053 &feature_sse42,
2054 &feature_ssse3,
2055 &feature_slowIncdec,
2056 &feature_slowLea,
2057 &feature_slowTwoMemOps,
2058 &feature_x87,
2059 &feature_xsave,
2060 &feature_xsavec,
2061 &feature_xsaveopt,
2062 &feature_xsaves,
2063 },
2064};
2065
2066pub const cpu_goldmontPlus = Cpu{
2067 .name = "goldmontPlus",
2068 .llvm_name = "goldmont-plus",
2069 .dependencies = &[_]*const Feature {
2070 &feature_bit64,
2071 &feature_sse,
2072 &feature_aes,
2073 &feature_clflushopt,
2074 &feature_cmov,
2075 &feature_cx8,
2076 &feature_cx16,
2077 &feature_fsgsbase,
2078 &feature_fxsr,
2079 &feature_sahf,
2080 &feature_mmx,
2081 &feature_movbe,
2082 &feature_mpx,
2083 &feature_nopl,
2084 &feature_pclmul,
2085 &feature_popcnt,
2086 &feature_prfchw,
2087 &feature_ptwrite,
2088 &feature_rdpid,
2089 &feature_rdrnd,
2090 &feature_rdseed,
2091 &feature_sgx,
2092 &feature_sha,
2093 &feature_sse42,
2094 &feature_ssse3,
2095 &feature_slowIncdec,
2096 &feature_slowLea,
2097 &feature_slowTwoMemOps,
2098 &feature_x87,
2099 &feature_xsave,
2100 &feature_xsavec,
2101 &feature_xsaveopt,
2102 &feature_xsaves,
2103 },
2104};
2105
2106pub const cpu_haswell = Cpu{
2107 .name = "haswell",
2108 .llvm_name = "haswell",
2109 .dependencies = &[_]*const Feature {
2110 &feature_bit64,
2111 &feature_sse,
2112 &feature_avx,
2113 &feature_avx2,
2114 &feature_bmi,
2115 &feature_bmi2,
2116 &feature_cmov,
2117 &feature_cx8,
2118 &feature_cx16,
2119 &feature_ermsb,
2120 &feature_f16c,
2121 &feature_fma,
2122 &feature_fsgsbase,
2123 &feature_fxsr,
2124 &feature_fastShldRotate,
2125 &feature_fastScalarFsqrt,
2126 &feature_fastVariableShuffle,
2127 &feature_invpcid,
2128 &feature_sahf,
2129 &feature_lzcnt,
2130 &feature_falseDepsLzcntTzcnt,
2131 &feature_mmx,
2132 &feature_movbe,
2133 &feature_macrofusion,
2134 &feature_mergeToThreewayBranch,
2135 &feature_nopl,
2136 &feature_pclmul,
2137 &feature_popcnt,
2138 &feature_falseDepsPopcnt,
2139 &feature_rdrnd,
2140 &feature_sse42,
2141 &feature_slow3opsLea,
2142 &feature_idivqToDivl,
2143 &feature_x87,
2144 &feature_xsave,
2145 &feature_xsaveopt,
2146 },
2147};
2148
2149pub const cpu_i386 = Cpu{
2150 .name = "i386",
2151 .llvm_name = "i386",
2152 .dependencies = &[_]*const Feature {
2153 &feature_slowUnalignedMem16,
2154 &feature_x87,
2155 },
2156};
2157
2158pub const cpu_i486 = Cpu{
2159 .name = "i486",
2160 .llvm_name = "i486",
2161 .dependencies = &[_]*const Feature {
2162 &feature_slowUnalignedMem16,
2163 &feature_x87,
2164 },
2165};
2166
2167pub const cpu_i586 = Cpu{
2168 .name = "i586",
2169 .llvm_name = "i586",
2170 .dependencies = &[_]*const Feature {
2171 &feature_cx8,
2172 &feature_slowUnalignedMem16,
2173 &feature_x87,
2174 },
2175};
2176
2177pub const cpu_i686 = Cpu{
2178 .name = "i686",
2179 .llvm_name = "i686",
2180 .dependencies = &[_]*const Feature {
2181 &feature_cmov,
2182 &feature_cx8,
2183 &feature_slowUnalignedMem16,
2184 &feature_x87,
2185 },
2186};
2187
2188pub const cpu_icelakeClient = Cpu{
2189 .name = "icelakeClient",
2190 .llvm_name = "icelake-client",
2191 .dependencies = &[_]*const Feature {
2192 &feature_bit64,
2193 &feature_adx,
2194 &feature_sse,
2195 &feature_aes,
2196 &feature_avx,
2197 &feature_avx2,
2198 &feature_avx512f,
2199 &feature_avx512bitalg,
2200 &feature_bmi,
2201 &feature_bmi2,
2202 &feature_avx512bw,
2203 &feature_avx512cd,
2204 &feature_clflushopt,
2205 &feature_clwb,
2206 &feature_cmov,
2207 &feature_cx8,
2208 &feature_cx16,
2209 &feature_avx512dq,
2210 &feature_ermsb,
2211 &feature_f16c,
2212 &feature_fma,
2213 &feature_fsgsbase,
2214 &feature_fxsr,
2215 &feature_fastShldRotate,
2216 &feature_fastScalarFsqrt,
2217 &feature_fastVariableShuffle,
2218 &feature_fastVectorFsqrt,
2219 &feature_gfni,
2220 &feature_fastGather,
2221 &feature_avx512ifma,
2222 &feature_invpcid,
2223 &feature_sahf,
2224 &feature_lzcnt,
2225 &feature_mmx,
2226 &feature_movbe,
2227 &feature_mpx,
2228 &feature_macrofusion,
2229 &feature_mergeToThreewayBranch,
2230 &feature_nopl,
2231 &feature_pclmul,
2232 &feature_pku,
2233 &feature_popcnt,
2234 &feature_prfchw,
2235 &feature_rdpid,
2236 &feature_rdrnd,
2237 &feature_rdseed,
2238 &feature_sgx,
2239 &feature_sha,
2240 &feature_sse42,
2241 &feature_slow3opsLea,
2242 &feature_idivqToDivl,
2243 &feature_vaes,
2244 &feature_avx512vbmi,
2245 &feature_avx512vbmi2,
2246 &feature_avx512vl,
2247 &feature_avx512vnni,
2248 &feature_vpclmulqdq,
2249 &feature_avx512vpopcntdq,
2250 &feature_x87,
2251 &feature_xsave,
2252 &feature_xsavec,
2253 &feature_xsaveopt,
2254 &feature_xsaves,
2255 },
2256};
2257
2258pub const cpu_icelakeServer = Cpu{
2259 .name = "icelakeServer",
2260 .llvm_name = "icelake-server",
2261 .dependencies = &[_]*const Feature {
2262 &feature_bit64,
2263 &feature_adx,
2264 &feature_sse,
2265 &feature_aes,
2266 &feature_avx,
2267 &feature_avx2,
2268 &feature_avx512f,
2269 &feature_avx512bitalg,
2270 &feature_bmi,
2271 &feature_bmi2,
2272 &feature_avx512bw,
2273 &feature_avx512cd,
2274 &feature_clflushopt,
2275 &feature_clwb,
2276 &feature_cmov,
2277 &feature_cx8,
2278 &feature_cx16,
2279 &feature_avx512dq,
2280 &feature_ermsb,
2281 &feature_f16c,
2282 &feature_fma,
2283 &feature_fsgsbase,
2284 &feature_fxsr,
2285 &feature_fastShldRotate,
2286 &feature_fastScalarFsqrt,
2287 &feature_fastVariableShuffle,
2288 &feature_fastVectorFsqrt,
2289 &feature_gfni,
2290 &feature_fastGather,
2291 &feature_avx512ifma,
2292 &feature_invpcid,
2293 &feature_sahf,
2294 &feature_lzcnt,
2295 &feature_mmx,
2296 &feature_movbe,
2297 &feature_mpx,
2298 &feature_macrofusion,
2299 &feature_mergeToThreewayBranch,
2300 &feature_nopl,
2301 &feature_pclmul,
2302 &feature_pconfig,
2303 &feature_pku,
2304 &feature_popcnt,
2305 &feature_prfchw,
2306 &feature_rdpid,
2307 &feature_rdrnd,
2308 &feature_rdseed,
2309 &feature_sgx,
2310 &feature_sha,
2311 &feature_sse42,
2312 &feature_slow3opsLea,
2313 &feature_idivqToDivl,
2314 &feature_vaes,
2315 &feature_avx512vbmi,
2316 &feature_avx512vbmi2,
2317 &feature_avx512vl,
2318 &feature_avx512vnni,
2319 &feature_vpclmulqdq,
2320 &feature_avx512vpopcntdq,
2321 &feature_wbnoinvd,
2322 &feature_x87,
2323 &feature_xsave,
2324 &feature_xsavec,
2325 &feature_xsaveopt,
2326 &feature_xsaves,
2327 },
2328};
2329
2330pub const cpu_ivybridge = Cpu{
2331 .name = "ivybridge",
2332 .llvm_name = "ivybridge",
2333 .dependencies = &[_]*const Feature {
2334 &feature_bit64,
2335 &feature_sse,
2336 &feature_avx,
2337 &feature_cmov,
2338 &feature_cx8,
2339 &feature_cx16,
2340 &feature_f16c,
2341 &feature_fsgsbase,
2342 &feature_fxsr,
2343 &feature_fastShldRotate,
2344 &feature_fastScalarFsqrt,
2345 &feature_sahf,
2346 &feature_mmx,
2347 &feature_macrofusion,
2348 &feature_mergeToThreewayBranch,
2349 &feature_nopl,
2350 &feature_pclmul,
2351 &feature_popcnt,
2352 &feature_falseDepsPopcnt,
2353 &feature_rdrnd,
2354 &feature_sse42,
2355 &feature_slow3opsLea,
2356 &feature_idivqToDivl,
2357 &feature_slowUnalignedMem32,
2358 &feature_x87,
2359 &feature_xsave,
2360 &feature_xsaveopt,
2361 },
2362};
2363
2364pub const cpu_k6 = Cpu{
2365 .name = "k6",
2366 .llvm_name = "k6",
2367 .dependencies = &[_]*const Feature {
2368 &feature_cx8,
2369 &feature_mmx,
2370 &feature_slowUnalignedMem16,
2371 &feature_x87,
2372 },
2373};
2374
2375pub const cpu_k62 = Cpu{
2376 .name = "k62",
2377 .llvm_name = "k6-2",
2378 .dependencies = &[_]*const Feature {
2379 &feature_mmx,
2380 &feature_dnow3,
2381 &feature_cx8,
2382 &feature_slowUnalignedMem16,
2383 &feature_x87,
2384 },
2385};
2386
2387pub const cpu_k63 = Cpu{
2388 .name = "k63",
2389 .llvm_name = "k6-3",
2390 .dependencies = &[_]*const Feature {
2391 &feature_mmx,
2392 &feature_dnow3,
2393 &feature_cx8,
2394 &feature_slowUnalignedMem16,
2395 &feature_x87,
2396 },
2397};
2398
2399pub const cpu_k8 = Cpu{
2400 .name = "k8",
2401 .llvm_name = "k8",
2402 .dependencies = &[_]*const Feature {
2403 &feature_mmx,
2404 &feature_dnowa3,
2405 &feature_bit64,
2406 &feature_cmov,
2407 &feature_cx8,
2408 &feature_fxsr,
2409 &feature_fastScalarShiftMasks,
2410 &feature_nopl,
2411 &feature_sse,
2412 &feature_sse2,
2413 &feature_slowShld,
2414 &feature_slowUnalignedMem16,
2415 &feature_x87,
2416 },
2417};
2418
2419pub const cpu_k8Sse3 = Cpu{
2420 .name = "k8Sse3",
2421 .llvm_name = "k8-sse3",
2422 .dependencies = &[_]*const Feature {
2423 &feature_mmx,
2424 &feature_dnowa3,
2425 &feature_bit64,
2426 &feature_cmov,
2427 &feature_cx8,
2428 &feature_cx16,
2429 &feature_fxsr,
2430 &feature_fastScalarShiftMasks,
2431 &feature_nopl,
2432 &feature_sse,
2433 &feature_sse3,
2434 &feature_slowShld,
2435 &feature_slowUnalignedMem16,
2436 &feature_x87,
2437 },
2438};
2439
2440pub const cpu_knl = Cpu{
2441 .name = "knl",
2442 .llvm_name = "knl",
2443 .dependencies = &[_]*const Feature {
2444 &feature_bit64,
2445 &feature_adx,
2446 &feature_sse,
2447 &feature_aes,
2448 &feature_avx512f,
2449 &feature_bmi,
2450 &feature_bmi2,
2451 &feature_avx512cd,
2452 &feature_cmov,
2453 &feature_cx8,
2454 &feature_cx16,
2455 &feature_avx512er,
2456 &feature_f16c,
2457 &feature_fma,
2458 &feature_fsgsbase,
2459 &feature_fxsr,
2460 &feature_fastPartialYmmOrZmmWrite,
2461 &feature_fastGather,
2462 &feature_sahf,
2463 &feature_lzcnt,
2464 &feature_mmx,
2465 &feature_movbe,
2466 &feature_nopl,
2467 &feature_pclmul,
2468 &feature_avx512pf,
2469 &feature_popcnt,
2470 &feature_prefetchwt1,
2471 &feature_prfchw,
2472 &feature_rdrnd,
2473 &feature_rdseed,
2474 &feature_slow3opsLea,
2475 &feature_idivqToDivl,
2476 &feature_slowIncdec,
2477 &feature_slowPmaddwd,
2478 &feature_slowTwoMemOps,
2479 &feature_x87,
2480 &feature_xsave,
2481 &feature_xsaveopt,
2482 },
2483};
2484
2485pub const cpu_knm = Cpu{
2486 .name = "knm",
2487 .llvm_name = "knm",
2488 .dependencies = &[_]*const Feature {
2489 &feature_bit64,
2490 &feature_adx,
2491 &feature_sse,
2492 &feature_aes,
2493 &feature_avx512f,
2494 &feature_bmi,
2495 &feature_bmi2,
2496 &feature_avx512cd,
2497 &feature_cmov,
2498 &feature_cx8,
2499 &feature_cx16,
2500 &feature_avx512er,
2501 &feature_f16c,
2502 &feature_fma,
2503 &feature_fsgsbase,
2504 &feature_fxsr,
2505 &feature_fastPartialYmmOrZmmWrite,
2506 &feature_fastGather,
2507 &feature_sahf,
2508 &feature_lzcnt,
2509 &feature_mmx,
2510 &feature_movbe,
2511 &feature_nopl,
2512 &feature_pclmul,
2513 &feature_avx512pf,
2514 &feature_popcnt,
2515 &feature_prefetchwt1,
2516 &feature_prfchw,
2517 &feature_rdrnd,
2518 &feature_rdseed,
2519 &feature_slow3opsLea,
2520 &feature_idivqToDivl,
2521 &feature_slowIncdec,
2522 &feature_slowPmaddwd,
2523 &feature_slowTwoMemOps,
2524 &feature_avx512vpopcntdq,
2525 &feature_x87,
2526 &feature_xsave,
2527 &feature_xsaveopt,
2528 },
2529};
2530
2531pub const cpu_lakemont = Cpu{
2532 .name = "lakemont",
2533 .llvm_name = "lakemont",
2534 .dependencies = &[_]*const Feature {
2535 },
2536};
2537
2538pub const cpu_nehalem = Cpu{
2539 .name = "nehalem",
2540 .llvm_name = "nehalem",
2541 .dependencies = &[_]*const Feature {
2542 &feature_bit64,
2543 &feature_cmov,
2544 &feature_cx8,
2545 &feature_cx16,
2546 &feature_fxsr,
2547 &feature_sahf,
2548 &feature_mmx,
2549 &feature_macrofusion,
2550 &feature_nopl,
2551 &feature_popcnt,
2552 &feature_sse,
2553 &feature_sse42,
2554 &feature_x87,
2555 },
2556};
2557
2558pub const cpu_nocona = Cpu{
2559 .name = "nocona",
2560 .llvm_name = "nocona",
2561 .dependencies = &[_]*const Feature {
2562 &feature_bit64,
2563 &feature_cmov,
2564 &feature_cx8,
2565 &feature_cx16,
2566 &feature_fxsr,
2567 &feature_mmx,
2568 &feature_nopl,
2569 &feature_sse,
2570 &feature_sse3,
2571 &feature_slowUnalignedMem16,
2572 &feature_x87,
2573 },
2574};
2575
2576pub const cpu_opteron = Cpu{
2577 .name = "opteron",
2578 .llvm_name = "opteron",
2579 .dependencies = &[_]*const Feature {
2580 &feature_mmx,
2581 &feature_dnowa3,
2582 &feature_bit64,
2583 &feature_cmov,
2584 &feature_cx8,
2585 &feature_fxsr,
2586 &feature_fastScalarShiftMasks,
2587 &feature_nopl,
2588 &feature_sse,
2589 &feature_sse2,
2590 &feature_slowShld,
2591 &feature_slowUnalignedMem16,
2592 &feature_x87,
2593 },
2594};
2595
2596pub const cpu_opteronSse3 = Cpu{
2597 .name = "opteronSse3",
2598 .llvm_name = "opteron-sse3",
2599 .dependencies = &[_]*const Feature {
2600 &feature_mmx,
2601 &feature_dnowa3,
2602 &feature_bit64,
2603 &feature_cmov,
2604 &feature_cx8,
2605 &feature_cx16,
2606 &feature_fxsr,
2607 &feature_fastScalarShiftMasks,
2608 &feature_nopl,
2609 &feature_sse,
2610 &feature_sse3,
2611 &feature_slowShld,
2612 &feature_slowUnalignedMem16,
2613 &feature_x87,
2614 },
2615};
2616
2617pub const cpu_penryn = Cpu{
2618 .name = "penryn",
2619 .llvm_name = "penryn",
2620 .dependencies = &[_]*const Feature {
2621 &feature_bit64,
2622 &feature_cmov,
2623 &feature_cx8,
2624 &feature_cx16,
2625 &feature_fxsr,
2626 &feature_sahf,
2627 &feature_mmx,
2628 &feature_macrofusion,
2629 &feature_nopl,
2630 &feature_sse,
2631 &feature_sse41,
2632 &feature_slowUnalignedMem16,
2633 &feature_x87,
2634 },
2635};
2636
2637pub const cpu_pentium = Cpu{
2638 .name = "pentium",
2639 .llvm_name = "pentium",
2640 .dependencies = &[_]*const Feature {
2641 &feature_cx8,
2642 &feature_slowUnalignedMem16,
2643 &feature_x87,
2644 },
2645};
2646
2647pub const cpu_pentiumM = Cpu{
2648 .name = "pentiumM",
2649 .llvm_name = "pentium-m",
2650 .dependencies = &[_]*const Feature {
2651 &feature_cmov,
2652 &feature_cx8,
2653 &feature_fxsr,
2654 &feature_mmx,
2655 &feature_nopl,
2656 &feature_sse,
2657 &feature_sse2,
2658 &feature_slowUnalignedMem16,
2659 &feature_x87,
2660 },
2661};
2662
2663pub const cpu_pentiumMmx = Cpu{
2664 .name = "pentiumMmx",
2665 .llvm_name = "pentium-mmx",
2666 .dependencies = &[_]*const Feature {
2667 &feature_cx8,
2668 &feature_mmx,
2669 &feature_slowUnalignedMem16,
2670 &feature_x87,
2671 },
2672};
2673
2674pub const cpu_pentium2 = Cpu{
2675 .name = "pentium2",
2676 .llvm_name = "pentium2",
2677 .dependencies = &[_]*const Feature {
2678 &feature_cmov,
2679 &feature_cx8,
2680 &feature_fxsr,
2681 &feature_mmx,
2682 &feature_nopl,
2683 &feature_slowUnalignedMem16,
2684 &feature_x87,
2685 },
2686};
2687
2688pub const cpu_pentium3 = Cpu{
2689 .name = "pentium3",
2690 .llvm_name = "pentium3",
2691 .dependencies = &[_]*const Feature {
2692 &feature_cmov,
2693 &feature_cx8,
2694 &feature_fxsr,
2695 &feature_mmx,
2696 &feature_nopl,
2697 &feature_sse,
2698 &feature_slowUnalignedMem16,
2699 &feature_x87,
2700 },
2701};
2702
2703pub const cpu_pentium3m = Cpu{
2704 .name = "pentium3m",
2705 .llvm_name = "pentium3m",
2706 .dependencies = &[_]*const Feature {
2707 &feature_cmov,
2708 &feature_cx8,
2709 &feature_fxsr,
2710 &feature_mmx,
2711 &feature_nopl,
2712 &feature_sse,
2713 &feature_slowUnalignedMem16,
2714 &feature_x87,
2715 },
2716};
2717
2718pub const cpu_pentium4 = Cpu{
2719 .name = "pentium4",
2720 .llvm_name = "pentium4",
2721 .dependencies = &[_]*const Feature {
2722 &feature_cmov,
2723 &feature_cx8,
2724 &feature_fxsr,
2725 &feature_mmx,
2726 &feature_nopl,
2727 &feature_sse,
2728 &feature_sse2,
2729 &feature_slowUnalignedMem16,
2730 &feature_x87,
2731 },
2732};
2733
2734pub const cpu_pentium4m = Cpu{
2735 .name = "pentium4m",
2736 .llvm_name = "pentium4m",
2737 .dependencies = &[_]*const Feature {
2738 &feature_cmov,
2739 &feature_cx8,
2740 &feature_fxsr,
2741 &feature_mmx,
2742 &feature_nopl,
2743 &feature_sse,
2744 &feature_sse2,
2745 &feature_slowUnalignedMem16,
2746 &feature_x87,
2747 },
2748};
2749
2750pub const cpu_pentiumpro = Cpu{
2751 .name = "pentiumpro",
2752 .llvm_name = "pentiumpro",
2753 .dependencies = &[_]*const Feature {
2754 &feature_cmov,
2755 &feature_cx8,
2756 &feature_nopl,
2757 &feature_slowUnalignedMem16,
2758 &feature_x87,
2759 },
2760};
2761
2762pub const cpu_prescott = Cpu{
2763 .name = "prescott",
2764 .llvm_name = "prescott",
2765 .dependencies = &[_]*const Feature {
2766 &feature_cmov,
2767 &feature_cx8,
2768 &feature_fxsr,
2769 &feature_mmx,
2770 &feature_nopl,
2771 &feature_sse,
2772 &feature_sse3,
2773 &feature_slowUnalignedMem16,
2774 &feature_x87,
2775 },
2776};
2777
2778pub const cpu_sandybridge = Cpu{
2779 .name = "sandybridge",
2780 .llvm_name = "sandybridge",
2781 .dependencies = &[_]*const Feature {
2782 &feature_bit64,
2783 &feature_sse,
2784 &feature_avx,
2785 &feature_cmov,
2786 &feature_cx8,
2787 &feature_cx16,
2788 &feature_fxsr,
2789 &feature_fastShldRotate,
2790 &feature_fastScalarFsqrt,
2791 &feature_sahf,
2792 &feature_mmx,
2793 &feature_macrofusion,
2794 &feature_mergeToThreewayBranch,
2795 &feature_nopl,
2796 &feature_pclmul,
2797 &feature_popcnt,
2798 &feature_falseDepsPopcnt,
2799 &feature_sse42,
2800 &feature_slow3opsLea,
2801 &feature_idivqToDivl,
2802 &feature_slowUnalignedMem32,
2803 &feature_x87,
2804 &feature_xsave,
2805 &feature_xsaveopt,
2806 },
2807};
2808
2809pub const cpu_silvermont = Cpu{
2810 .name = "silvermont",
2811 .llvm_name = "silvermont",
2812 .dependencies = &[_]*const Feature {
2813 &feature_bit64,
2814 &feature_cmov,
2815 &feature_cx8,
2816 &feature_cx16,
2817 &feature_fxsr,
2818 &feature_sahf,
2819 &feature_mmx,
2820 &feature_movbe,
2821 &feature_nopl,
2822 &feature_sse,
2823 &feature_pclmul,
2824 &feature_popcnt,
2825 &feature_falseDepsPopcnt,
2826 &feature_prfchw,
2827 &feature_rdrnd,
2828 &feature_sse42,
2829 &feature_ssse3,
2830 &feature_idivqToDivl,
2831 &feature_slowIncdec,
2832 &feature_slowLea,
2833 &feature_slowPmulld,
2834 &feature_slowTwoMemOps,
2835 &feature_x87,
2836 },
2837};
2838
2839pub const cpu_skx = Cpu{
2840 .name = "skx",
2841 .llvm_name = "skx",
2842 .dependencies = &[_]*const Feature {
2843 &feature_bit64,
2844 &feature_adx,
2845 &feature_sse,
2846 &feature_aes,
2847 &feature_avx,
2848 &feature_avx2,
2849 &feature_avx512f,
2850 &feature_bmi,
2851 &feature_bmi2,
2852 &feature_avx512bw,
2853 &feature_avx512cd,
2854 &feature_clflushopt,
2855 &feature_clwb,
2856 &feature_cmov,
2857 &feature_cx8,
2858 &feature_cx16,
2859 &feature_avx512dq,
2860 &feature_ermsb,
2861 &feature_f16c,
2862 &feature_fma,
2863 &feature_fsgsbase,
2864 &feature_fxsr,
2865 &feature_fastShldRotate,
2866 &feature_fastScalarFsqrt,
2867 &feature_fastVariableShuffle,
2868 &feature_fastVectorFsqrt,
2869 &feature_fastGather,
2870 &feature_invpcid,
2871 &feature_sahf,
2872 &feature_lzcnt,
2873 &feature_mmx,
2874 &feature_movbe,
2875 &feature_mpx,
2876 &feature_macrofusion,
2877 &feature_mergeToThreewayBranch,
2878 &feature_nopl,
2879 &feature_pclmul,
2880 &feature_pku,
2881 &feature_popcnt,
2882 &feature_falseDepsPopcnt,
2883 &feature_prfchw,
2884 &feature_rdrnd,
2885 &feature_rdseed,
2886 &feature_sse42,
2887 &feature_slow3opsLea,
2888 &feature_idivqToDivl,
2889 &feature_avx512vl,
2890 &feature_x87,
2891 &feature_xsave,
2892 &feature_xsavec,
2893 &feature_xsaveopt,
2894 &feature_xsaves,
2895 },
2896};
2897
2898pub const cpu_skylake = Cpu{
2899 .name = "skylake",
2900 .llvm_name = "skylake",
2901 .dependencies = &[_]*const Feature {
2902 &feature_bit64,
2903 &feature_adx,
2904 &feature_sse,
2905 &feature_aes,
2906 &feature_avx,
2907 &feature_avx2,
2908 &feature_bmi,
2909 &feature_bmi2,
2910 &feature_clflushopt,
2911 &feature_cmov,
2912 &feature_cx8,
2913 &feature_cx16,
2914 &feature_ermsb,
2915 &feature_f16c,
2916 &feature_fma,
2917 &feature_fsgsbase,
2918 &feature_fxsr,
2919 &feature_fastShldRotate,
2920 &feature_fastScalarFsqrt,
2921 &feature_fastVariableShuffle,
2922 &feature_fastVectorFsqrt,
2923 &feature_fastGather,
2924 &feature_invpcid,
2925 &feature_sahf,
2926 &feature_lzcnt,
2927 &feature_mmx,
2928 &feature_movbe,
2929 &feature_mpx,
2930 &feature_macrofusion,
2931 &feature_mergeToThreewayBranch,
2932 &feature_nopl,
2933 &feature_pclmul,
2934 &feature_popcnt,
2935 &feature_falseDepsPopcnt,
2936 &feature_prfchw,
2937 &feature_rdrnd,
2938 &feature_rdseed,
2939 &feature_sgx,
2940 &feature_sse42,
2941 &feature_slow3opsLea,
2942 &feature_idivqToDivl,
2943 &feature_x87,
2944 &feature_xsave,
2945 &feature_xsavec,
2946 &feature_xsaveopt,
2947 &feature_xsaves,
2948 },
2949};
2950
2951pub const cpu_skylakeAvx512 = Cpu{
2952 .name = "skylakeAvx512",
2953 .llvm_name = "skylake-avx512",
2954 .dependencies = &[_]*const Feature {
2955 &feature_bit64,
2956 &feature_adx,
2957 &feature_sse,
2958 &feature_aes,
2959 &feature_avx,
2960 &feature_avx2,
2961 &feature_avx512f,
2962 &feature_bmi,
2963 &feature_bmi2,
2964 &feature_avx512bw,
2965 &feature_avx512cd,
2966 &feature_clflushopt,
2967 &feature_clwb,
2968 &feature_cmov,
2969 &feature_cx8,
2970 &feature_cx16,
2971 &feature_avx512dq,
2972 &feature_ermsb,
2973 &feature_f16c,
2974 &feature_fma,
2975 &feature_fsgsbase,
2976 &feature_fxsr,
2977 &feature_fastShldRotate,
2978 &feature_fastScalarFsqrt,
2979 &feature_fastVariableShuffle,
2980 &feature_fastVectorFsqrt,
2981 &feature_fastGather,
2982 &feature_invpcid,
2983 &feature_sahf,
2984 &feature_lzcnt,
2985 &feature_mmx,
2986 &feature_movbe,
2987 &feature_mpx,
2988 &feature_macrofusion,
2989 &feature_mergeToThreewayBranch,
2990 &feature_nopl,
2991 &feature_pclmul,
2992 &feature_pku,
2993 &feature_popcnt,
2994 &feature_falseDepsPopcnt,
2995 &feature_prfchw,
2996 &feature_rdrnd,
2997 &feature_rdseed,
2998 &feature_sse42,
2999 &feature_slow3opsLea,
3000 &feature_idivqToDivl,
3001 &feature_avx512vl,
3002 &feature_x87,
3003 &feature_xsave,
3004 &feature_xsavec,
3005 &feature_xsaveopt,
3006 &feature_xsaves,
3007 },
3008};
3009
3010pub const cpu_slm = Cpu{
3011 .name = "slm",
3012 .llvm_name = "slm",
3013 .dependencies = &[_]*const Feature {
3014 &feature_bit64,
3015 &feature_cmov,
3016 &feature_cx8,
3017 &feature_cx16,
3018 &feature_fxsr,
3019 &feature_sahf,
3020 &feature_mmx,
3021 &feature_movbe,
3022 &feature_nopl,
3023 &feature_sse,
3024 &feature_pclmul,
3025 &feature_popcnt,
3026 &feature_falseDepsPopcnt,
3027 &feature_prfchw,
3028 &feature_rdrnd,
3029 &feature_sse42,
3030 &feature_ssse3,
3031 &feature_idivqToDivl,
3032 &feature_slowIncdec,
3033 &feature_slowLea,
3034 &feature_slowPmulld,
3035 &feature_slowTwoMemOps,
3036 &feature_x87,
3037 },
3038};
3039
3040pub const cpu_tremont = Cpu{
3041 .name = "tremont",
3042 .llvm_name = "tremont",
3043 .dependencies = &[_]*const Feature {
3044 &feature_bit64,
3045 &feature_sse,
3046 &feature_aes,
3047 &feature_cldemote,
3048 &feature_clflushopt,
3049 &feature_cmov,
3050 &feature_cx8,
3051 &feature_cx16,
3052 &feature_fsgsbase,
3053 &feature_fxsr,
3054 &feature_gfni,
3055 &feature_sahf,
3056 &feature_mmx,
3057 &feature_movbe,
3058 &feature_movdir64b,
3059 &feature_movdiri,
3060 &feature_mpx,
3061 &feature_nopl,
3062 &feature_pclmul,
3063 &feature_popcnt,
3064 &feature_prfchw,
3065 &feature_ptwrite,
3066 &feature_rdpid,
3067 &feature_rdrnd,
3068 &feature_rdseed,
3069 &feature_sgx,
3070 &feature_sha,
3071 &feature_sse42,
3072 &feature_ssse3,
3073 &feature_slowIncdec,
3074 &feature_slowLea,
3075 &feature_slowTwoMemOps,
3076 &feature_waitpkg,
3077 &feature_x87,
3078 &feature_xsave,
3079 &feature_xsavec,
3080 &feature_xsaveopt,
3081 &feature_xsaves,
3082 },
3083};
3084
3085pub const cpu_westmere = Cpu{
3086 .name = "westmere",
3087 .llvm_name = "westmere",
3088 .dependencies = &[_]*const Feature {
3089 &feature_bit64,
3090 &feature_cmov,
3091 &feature_cx8,
3092 &feature_cx16,
3093 &feature_fxsr,
3094 &feature_sahf,
3095 &feature_mmx,
3096 &feature_macrofusion,
3097 &feature_nopl,
3098 &feature_sse,
3099 &feature_pclmul,
3100 &feature_popcnt,
3101 &feature_sse42,
3102 &feature_x87,
3103 },
3104};
3105
3106pub const cpu_winchipC6 = Cpu{
3107 .name = "winchipC6",
3108 .llvm_name = "winchip-c6",
3109 .dependencies = &[_]*const Feature {
3110 &feature_mmx,
3111 &feature_slowUnalignedMem16,
3112 &feature_x87,
3113 },
3114};
3115
3116pub const cpu_winchip2 = Cpu{
3117 .name = "winchip2",
3118 .llvm_name = "winchip2",
3119 .dependencies = &[_]*const Feature {
3120 &feature_mmx,
3121 &feature_dnow3,
3122 &feature_slowUnalignedMem16,
3123 &feature_x87,
3124 },
3125};
3126
3127pub const cpu_x8664 = Cpu{
3128 .name = "x8664",
3129 .llvm_name = "x86-64",
3130 .dependencies = &[_]*const Feature {
3131 &feature_bit64,
3132 &feature_cmov,
3133 &feature_cx8,
3134 &feature_fxsr,
3135 &feature_mmx,
3136 &feature_macrofusion,
3137 &feature_nopl,
3138 &feature_sse,
3139 &feature_sse2,
3140 &feature_slow3opsLea,
3141 &feature_slowIncdec,
3142 &feature_x87,
3143 },
3144};
3145
3146pub const cpu_yonah = Cpu{
3147 .name = "yonah",
3148 .llvm_name = "yonah",
3149 .dependencies = &[_]*const Feature {
3150 &feature_cmov,
3151 &feature_cx8,
3152 &feature_fxsr,
3153 &feature_mmx,
3154 &feature_nopl,
3155 &feature_sse,
3156 &feature_sse3,
3157 &feature_slowUnalignedMem16,
3158 &feature_x87,
3159 },
3160};
3161
3162pub const cpu_znver1 = Cpu{
3163 .name = "znver1",
3164 .llvm_name = "znver1",
3165 .dependencies = &[_]*const Feature {
3166 &feature_bit64,
3167 &feature_adx,
3168 &feature_sse,
3169 &feature_aes,
3170 &feature_avx2,
3171 &feature_bmi,
3172 &feature_bmi2,
3173 &feature_branchfusion,
3174 &feature_clflushopt,
3175 &feature_clzero,
3176 &feature_cmov,
3177 &feature_cx8,
3178 &feature_cx16,
3179 &feature_f16c,
3180 &feature_fma,
3181 &feature_fsgsbase,
3182 &feature_fxsr,
3183 &feature_fast15bytenop,
3184 &feature_fastBextr,
3185 &feature_fastLzcnt,
3186 &feature_fastScalarShiftMasks,
3187 &feature_sahf,
3188 &feature_lzcnt,
3189 &feature_mmx,
3190 &feature_movbe,
3191 &feature_mwaitx,
3192 &feature_nopl,
3193 &feature_pclmul,
3194 &feature_popcnt,
3195 &feature_prfchw,
3196 &feature_rdrnd,
3197 &feature_rdseed,
3198 &feature_sha,
3199 &feature_sse4a,
3200 &feature_slowShld,
3201 &feature_x87,
3202 &feature_xsave,
3203 &feature_xsavec,
3204 &feature_xsaveopt,
3205 &feature_xsaves,
3206 },
3207};
3208
3209pub const cpu_znver2 = Cpu{
3210 .name = "znver2",
3211 .llvm_name = "znver2",
3212 .dependencies = &[_]*const Feature {
3213 &feature_bit64,
3214 &feature_adx,
3215 &feature_sse,
3216 &feature_aes,
3217 &feature_avx2,
3218 &feature_bmi,
3219 &feature_bmi2,
3220 &feature_branchfusion,
3221 &feature_clflushopt,
3222 &feature_clwb,
3223 &feature_clzero,
3224 &feature_cmov,
3225 &feature_cx8,
3226 &feature_cx16,
3227 &feature_f16c,
3228 &feature_fma,
3229 &feature_fsgsbase,
3230 &feature_fxsr,
3231 &feature_fast15bytenop,
3232 &feature_fastBextr,
3233 &feature_fastLzcnt,
3234 &feature_fastScalarShiftMasks,
3235 &feature_sahf,
3236 &feature_lzcnt,
3237 &feature_mmx,
3238 &feature_movbe,
3239 &feature_mwaitx,
3240 &feature_nopl,
3241 &feature_pclmul,
3242 &feature_popcnt,
3243 &feature_prfchw,
3244 &feature_rdpid,
3245 &feature_rdrnd,
3246 &feature_rdseed,
3247 &feature_sha,
3248 &feature_sse4a,
3249 &feature_slowShld,
3250 &feature_wbnoinvd,
3251 &feature_x87,
3252 &feature_xsave,
3253 &feature_xsavec,
3254 &feature_xsaveopt,
3255 &feature_xsaves,
3256 },
3257};
3258
3259pub const cpus = &[_]*const Cpu {
3260 &cpu_amdfam10,
3261 &cpu_athlon,
3262 &cpu_athlon4,
3263 &cpu_athlonFx,
3264 &cpu_athlonMp,
3265 &cpu_athlonTbird,
3266 &cpu_athlonXp,
3267 &cpu_athlon64,
3268 &cpu_athlon64Sse3,
3269 &cpu_atom,
3270 &cpu_barcelona,
3271 &cpu_bdver1,
3272 &cpu_bdver2,
3273 &cpu_bdver3,
3274 &cpu_bdver4,
3275 &cpu_bonnell,
3276 &cpu_broadwell,
3277 &cpu_btver1,
3278 &cpu_btver2,
3279 &cpu_c3,
3280 &cpu_c32,
3281 &cpu_cannonlake,
3282 &cpu_cascadelake,
3283 &cpu_cooperlake,
3284 &cpu_coreAvxI,
3285 &cpu_coreAvx2,
3286 &cpu_core2,
3287 &cpu_corei7,
3288 &cpu_corei7Avx,
3289 &cpu_generic,
3290 &cpu_geode,
3291 &cpu_goldmont,
3292 &cpu_goldmontPlus,
3293 &cpu_haswell,
3294 &cpu_i386,
3295 &cpu_i486,
3296 &cpu_i586,
3297 &cpu_i686,
3298 &cpu_icelakeClient,
3299 &cpu_icelakeServer,
3300 &cpu_ivybridge,
3301 &cpu_k6,
3302 &cpu_k62,
3303 &cpu_k63,
3304 &cpu_k8,
3305 &cpu_k8Sse3,
3306 &cpu_knl,
3307 &cpu_knm,
3308 &cpu_lakemont,
3309 &cpu_nehalem,
3310 &cpu_nocona,
3311 &cpu_opteron,
3312 &cpu_opteronSse3,
3313 &cpu_penryn,
3314 &cpu_pentium,
3315 &cpu_pentiumM,
3316 &cpu_pentiumMmx,
3317 &cpu_pentium2,
3318 &cpu_pentium3,
3319 &cpu_pentium3m,
3320 &cpu_pentium4,
3321 &cpu_pentium4m,
3322 &cpu_pentiumpro,
3323 &cpu_prescott,
3324 &cpu_sandybridge,
3325 &cpu_silvermont,
3326 &cpu_skx,
3327 &cpu_skylake,
3328 &cpu_skylakeAvx512,
3329 &cpu_slm,
3330 &cpu_tremont,
3331 &cpu_westmere,
3332 &cpu_winchipC6,
3333 &cpu_winchip2,
3334 &cpu_x8664,
3335 &cpu_yonah,
3336 &cpu_znver1,
3337 &cpu_znver2,
1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;
3
4pub const Feature = enum {
5 @"16bit_mode",
6 @"32bit_mode",
7 @"3dnow",
8 @"3dnowa",
9 @"64bit",
10 @"64bit_mode",
11 adx,
12 aes,
13 avx,
14 avx2,
15 avx512bf16,
16 avx512bitalg,
17 avx512bw,
18 avx512cd,
19 avx512dq,
20 avx512er,
21 avx512f,
22 avx512ifma,
23 avx512pf,
24 avx512vbmi,
25 avx512vbmi2,
26 avx512vl,
27 avx512vnni,
28 avx512vp2intersect,
29 avx512vpopcntdq,
30 bmi,
31 bmi2,
32 branchfusion,
33 cldemote,
34 clflushopt,
35 clwb,
36 clzero,
37 cmov,
38 cx16,
39 cx8,
40 enqcmd,
41 ermsb,
42 f16c,
43 false_deps_lzcnt_tzcnt,
44 false_deps_popcnt,
45 fast_11bytenop,
46 fast_15bytenop,
47 fast_bextr,
48 fast_gather,
49 fast_hops,
50 fast_lzcnt,
51 fast_partial_ymm_or_zmm_write,
52 fast_scalar_fsqrt,
53 fast_scalar_shift_masks,
54 fast_shld_rotate,
55 fast_variable_shuffle,
56 fast_vector_fsqrt,
57 fast_vector_shift_masks,
58 fma,
59 fma4,
60 fsgsbase,
61 fxsr,
62 gfni,
63 idivl_to_divb,
64 idivq_to_divl,
65 invpcid,
66 lea_sp,
67 lea_uses_ag,
68 lwp,
69 lzcnt,
70 macrofusion,
71 merge_to_threeway_branch,
72 mmx,
73 movbe,
74 movdir64b,
75 movdiri,
76 mpx,
77 mwaitx,
78 nopl,
79 pad_short_functions,
80 pclmul,
81 pconfig,
82 pku,
83 popcnt,
84 prefer_256_bit,
85 prefetchwt1,
86 prfchw,
87 ptwrite,
88 rdpid,
89 rdrnd,
90 rdseed,
91 retpoline,
92 retpoline_external_thunk,
93 retpoline_indirect_branches,
94 retpoline_indirect_calls,
95 rtm,
96 sahf,
97 sgx,
98 sha,
99 shstk,
100 slow_3ops_lea,
101 slow_incdec,
102 slow_lea,
103 slow_pmaddwd,
104 slow_pmulld,
105 slow_shld,
106 slow_two_mem_ops,
107 slow_unaligned_mem_16,
108 slow_unaligned_mem_32,
109 soft_float,
110 sse,
111 sse2,
112 sse3,
113 sse4_1,
114 sse4_2,
115 sse4a,
116 sse_unaligned_mem,
117 ssse3,
118 tbm,
119 vaes,
120 vpclmulqdq,
121 waitpkg,
122 wbnoinvd,
123 x87,
124 xop,
125 xsave,
126 xsavec,
127 xsaveopt,
128 xsaves,
129};
130
131pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
132
133pub const all_features = blk: {
134 const len = @typeInfo(Feature).Enum.fields.len;
135 std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits);
136 var result: [len]Cpu.Feature = undefined;
137
138 result[@enumToInt(Feature.@"16bit_mode")] = .{
139 .index = @enumToInt(Feature.@"16bit_mode"),
140 .name = @tagName(Feature.@"16bit_mode"),
141 .llvm_name = "16bit-mode",
142 .description = "16-bit mode (i8086)",
143 .dependencies = 0,
144 };
145
146 result[@enumToInt(Feature.@"32bit_mode")] = .{
147 .index = @enumToInt(Feature.@"32bit_mode"),
148 .name = @tagName(Feature.@"32bit_mode"),
149 .llvm_name = "32bit-mode",
150 .description = "32-bit mode (80386)",
151 .dependencies = 0,
152 };
153
154 result[@enumToInt(Feature.@"3dnow")] = .{
155 .index = @enumToInt(Feature.@"3dnow"),
156 .name = @tagName(Feature.@"3dnow"),
157 .llvm_name = "3dnow",
158 .description = "Enable 3DNow! instructions",
159 .dependencies = featureSet(&[_]Feature{
160 .mmx,
161 }),
162 };
163
164 result[@enumToInt(Feature.@"3dnowa")] = .{
165 .index = @enumToInt(Feature.@"3dnowa"),
166 .name = @tagName(Feature.@"3dnowa"),
167 .llvm_name = "3dnowa",
168 .description = "Enable 3DNow! Athlon instructions",
169 .dependencies = featureSet(&[_]Feature{
170 .mmx,
171 }),
172 };
173
174 result[@enumToInt(Feature.@"64bit")] = .{
175 .index = @enumToInt(Feature.@"64bit"),
176 .name = @tagName(Feature.@"64bit"),
177 .llvm_name = "64bit",
178 .description = "Support 64-bit instructions",
179 .dependencies = 0,
180 };
181
182 result[@enumToInt(Feature.@"64bit_mode")] = .{
183 .index = @enumToInt(Feature.@"64bit_mode"),
184 .name = @tagName(Feature.@"64bit_mode"),
185 .llvm_name = "64bit-mode",
186 .description = "64-bit mode (x86_64)",
187 .dependencies = 0,
188 };
189
190 result[@enumToInt(Feature.adx)] = .{
191 .index = @enumToInt(Feature.adx),
192 .name = @tagName(Feature.adx),
193 .llvm_name = "adx",
194 .description = "Support ADX instructions",
195 .dependencies = featureSet(&[_]Feature{}),
196 };
197
198 result[@enumToInt(Feature.aes)] = .{
199 .index = @enumToInt(Feature.aes),
200 .name = @tagName(Feature.aes),
201 .llvm_name = "aes",
202 .description = "Enable AES instructions",
203 .dependencies = featureSet(&[_]Feature{
204 .sse,
205 }),
206 };
207
208 result[@enumToInt(Feature.avx)] = .{
209 .index = @enumToInt(Feature.avx),
210 .name = @tagName(Feature.avx),
211 .llvm_name = "avx",
212 .description = "Enable AVX instructions",
213 .dependencies = featureSet(&[_]Feature{
214 .sse,
215 }),
216 };
217
218 result[@enumToInt(Feature.avx2)] = .{
219 .index = @enumToInt(Feature.avx2),
220 .name = @tagName(Feature.avx2),
221 .llvm_name = "avx2",
222 .description = "Enable AVX2 instructions",
223 .dependencies = featureSet(&[_]Feature{
224 .sse,
225 }),
226 };
227
228 result[@enumToInt(Feature.avx512f)] = .{
229 .index = @enumToInt(Feature.avx512f),
230 .name = @tagName(Feature.avx512f),
231 .llvm_name = "avx512f",
232 .description = "Enable AVX-512 instructions",
233 .dependencies = featureSet(&[_]Feature{
234 .sse,
235 }),
236 };
237
238 result[@enumToInt(Feature.avx512bf16)] = .{
239 .index = @enumToInt(Feature.avx512bf16),
240 .name = @tagName(Feature.avx512bf16),
241 .llvm_name = "avx512bf16",
242 .description = "Support bfloat16 floating point",
243 .dependencies = featureSet(&[_]Feature{
244 .sse,
245 }),
246 };
247
248 result[@enumToInt(Feature.avx512bitalg)] = .{
249 .index = @enumToInt(Feature.avx512bitalg),
250 .name = @tagName(Feature.avx512bitalg),
251 .llvm_name = "avx512bitalg",
252 .description = "Enable AVX-512 Bit Algorithms",
253 .dependencies = featureSet(&[_]Feature{
254 .sse,
255 }),
256 };
257
258 result[@enumToInt(Feature.bmi)] = .{
259 .index = @enumToInt(Feature.bmi),
260 .name = @tagName(Feature.bmi),
261 .llvm_name = "bmi",
262 .description = "Support BMI instructions",
263 .dependencies = featureSet(&[_]Feature{}),
264 };
265
266 result[@enumToInt(Feature.bmi2)] = .{
267 .index = @enumToInt(Feature.bmi2),
268 .name = @tagName(Feature.bmi2),
269 .llvm_name = "bmi2",
270 .description = "Support BMI2 instructions",
271 .dependencies = featureSet(&[_]Feature{}),
272 };
273
274 result[@enumToInt(Feature.avx512bw)] = .{
275 .index = @enumToInt(Feature.avx512bw),
276 .name = @tagName(Feature.avx512bw),
277 .llvm_name = "avx512bw",
278 .description = "Enable AVX-512 Byte and Word Instructions",
279 .dependencies = featureSet(&[_]Feature{
280 .sse,
281 }),
282 };
283
284 result[@enumToInt(Feature.branchfusion)] = .{
285 .index = @enumToInt(Feature.branchfusion),
286 .name = @tagName(Feature.branchfusion),
287 .llvm_name = "branchfusion",
288 .description = "CMP/TEST can be fused with conditional branches",
289 .dependencies = featureSet(&[_]Feature{}),
290 };
291
292 result[@enumToInt(Feature.avx512cd)] = .{
293 .index = @enumToInt(Feature.avx512cd),
294 .name = @tagName(Feature.avx512cd),
295 .llvm_name = "avx512cd",
296 .description = "Enable AVX-512 Conflict Detection Instructions",
297 .dependencies = featureSet(&[_]Feature{
298 .sse,
299 }),
300 };
301
302 result[@enumToInt(Feature.cldemote)] = .{
303 .index = @enumToInt(Feature.cldemote),
304 .name = @tagName(Feature.cldemote),
305 .llvm_name = "cldemote",
306 .description = "Enable Cache Demote",
307 .dependencies = featureSet(&[_]Feature{}),
308 };
309
310 result[@enumToInt(Feature.clflushopt)] = .{
311 .index = @enumToInt(Feature.clflushopt),
312 .name = @tagName(Feature.clflushopt),
313 .llvm_name = "clflushopt",
314 .description = "Flush A Cache Line Optimized",
315 .dependencies = featureSet(&[_]Feature{}),
316 };
317
318 result[@enumToInt(Feature.clwb)] = .{
319 .index = @enumToInt(Feature.clwb),
320 .name = @tagName(Feature.clwb),
321 .llvm_name = "clwb",
322 .description = "Cache Line Write Back",
323 .dependencies = featureSet(&[_]Feature{}),
324 };
325
326 result[@enumToInt(Feature.clzero)] = .{
327 .index = @enumToInt(Feature.clzero),
328 .name = @tagName(Feature.clzero),
329 .llvm_name = "clzero",
330 .description = "Enable Cache Line Zero",
331 .dependencies = featureSet(&[_]Feature{}),
332 };
333
334 result[@enumToInt(Feature.cmov)] = .{
335 .index = @enumToInt(Feature.cmov),
336 .name = @tagName(Feature.cmov),
337 .llvm_name = "cmov",
338 .description = "Enable conditional move instructions",
339 .dependencies = featureSet(&[_]Feature{}),
340 };
341
342 result[@enumToInt(Feature.cx8)] = .{
343 .index = @enumToInt(Feature.cx8),
344 .name = @tagName(Feature.cx8),
345 .llvm_name = "cx8",
346 .description = "Support CMPXCHG8B instructions",
347 .dependencies = featureSet(&[_]Feature{}),
348 };
349
350 result[@enumToInt(Feature.cx16)] = .{
351 .index = @enumToInt(Feature.cx16),
352 .name = @tagName(Feature.cx16),
353 .llvm_name = "cx16",
354 .description = "64-bit with cmpxchg16b",
355 .dependencies = featureSet(&[_]Feature{
356 .cx8,
357 }),
358 };
359
360 result[@enumToInt(Feature.avx512dq)] = .{
361 .index = @enumToInt(Feature.avx512dq),
362 .name = @tagName(Feature.avx512dq),
363 .llvm_name = "avx512dq",
364 .description = "Enable AVX-512 Doubleword and Quadword Instructions",
365 .dependencies = featureSet(&[_]Feature{
366 .sse,
367 }),
368 };
369
370 result[@enumToInt(Feature.enqcmd)] = .{
371 .index = @enumToInt(Feature.enqcmd),
372 .name = @tagName(Feature.enqcmd),
373 .llvm_name = "enqcmd",
374 .description = "Has ENQCMD instructions",
375 .dependencies = 0,
376 };
377
378 result[@enumToInt(Feature.avx512er)] = .{
379 .index = @enumToInt(Feature.avx512er),
380 .name = @tagName(Feature.avx512er),
381 .llvm_name = "avx512er",
382 .description = "Enable AVX-512 Exponential and Reciprocal Instructions",
383 .dependencies = featureSet(&[_]Feature{
384 .sse,
385 }),
386 };
387
388 result[@enumToInt(Feature.ermsb)] = .{
389 .index = @enumToInt(Feature.ermsb),
390 .name = @tagName(Feature.ermsb),
391 .llvm_name = "ermsb",
392 .description = "REP MOVS/STOS are fast",
393 .dependencies = 0,
394 };
395
396 result[@enumToInt(Feature.f16c)] = .{
397 .index = @enumToInt(Feature.f16c),
398 .name = @tagName(Feature.f16c),
399 .llvm_name = "f16c",
400 .description = "Support 16-bit floating point conversion instructions",
401 .dependencies = featureSet(&[_]Feature{
402 .sse,
403 }),
404 };
405
406 result[@enumToInt(Feature.fma)] = .{
407 .index = @enumToInt(Feature.fma),
408 .name = @tagName(Feature.fma),
409 .llvm_name = "fma",
410 .description = "Enable three-operand fused multiple-add",
411 .dependencies = featureSet(&[_]Feature{
412 .sse,
413 }),
414 };
415
416 result[@enumToInt(Feature.fma4)] = .{
417 .index = @enumToInt(Feature.fma4),
418 .name = @tagName(Feature.fma4),
419 .llvm_name = "fma4",
420 .description = "Enable four-operand fused multiple-add",
421 .dependencies = featureSet(&[_]Feature{
422 .sse,
423 }),
424 };
425
426 result[@enumToInt(Feature.fsgsbase)] = .{
427 .index = @enumToInt(Feature.fsgsbase),
428 .name = @tagName(Feature.fsgsbase),
429 .llvm_name = "fsgsbase",
430 .description = "Support FS/GS Base instructions",
431 .dependencies = 0,
432 };
433
434 result[@enumToInt(Feature.fxsr)] = .{
435 .index = @enumToInt(Feature.fxsr),
436 .name = @tagName(Feature.fxsr),
437 .llvm_name = "fxsr",
438 .description = "Support fxsave/fxrestore instructions",
439 .dependencies = 0,
440 };
441
442 result[@enumToInt(Feature.fast_11bytenop)] = .{
443 .index = @enumToInt(Feature.fast_11bytenop),
444 .name = @tagName(Feature.fast_11bytenop),
445 .llvm_name = "fast-11bytenop",
446 .description = "Target can quickly decode up to 11 byte NOPs",
447 .dependencies = 0,
448 };
449
450 result[@enumToInt(Feature.fast_15bytenop)] = .{
451 .index = @enumToInt(Feature.fast_15bytenop),
452 .name = @tagName(Feature.fast_15bytenop),
453 .llvm_name = "fast-15bytenop",
454 .description = "Target can quickly decode up to 15 byte NOPs",
455 .dependencies = 0,
456 };
457
458 result[@enumToInt(Feature.fast_bextr)] = .{
459 .index = @enumToInt(Feature.fast_bextr),
460 .name = @tagName(Feature.fast_bextr),
461 .llvm_name = "fast-bextr",
462 .description = "Indicates that the BEXTR instruction is implemented as a single uop with good throughput",
463 .dependencies = 0,
464 };
465
466 result[@enumToInt(Feature.fast_hops)] = .{
467 .index = @enumToInt(Feature.fast_hops),
468 .name = @tagName(Feature.fast_hops),
469 .llvm_name = "fast-hops",
470 .description = "Prefer horizontal vector math instructions (haddp, phsub, etc.) over normal vector instructions with shuffles",
471 .dependencies = featureSet(&[_]Feature{
472 .sse,
473 }),
474 };
475
476 result[@enumToInt(Feature.fast_lzcnt)] = .{
477 .index = @enumToInt(Feature.fast_lzcnt),
478 .name = @tagName(Feature.fast_lzcnt),
479 .llvm_name = "fast-lzcnt",
480 .description = "LZCNT instructions are as fast as most simple integer ops",
481 .dependencies = 0,
482 };
483
484 result[@enumToInt(Feature.fast_partial_ymm_or_zmm_write)] = .{
485 .index = @enumToInt(Feature.fast_partial_ymm_or_zmm_write),
486 .name = @tagName(Feature.fast_partial_ymm_or_zmm_write),
487 .llvm_name = "fast-partial-ymm-or-zmm-write",
488 .description = "Partial writes to YMM/ZMM registers are fast",
489 .dependencies = 0,
490 };
491
492 result[@enumToInt(Feature.fast_shld_rotate)] = .{
493 .index = @enumToInt(Feature.fast_shld_rotate),
494 .name = @tagName(Feature.fast_shld_rotate),
495 .llvm_name = "fast-shld-rotate",
496 .description = "SHLD can be used as a faster rotate",
497 .dependencies = 0,
498 };
499
500 result[@enumToInt(Feature.fast_scalar_fsqrt)] = .{
501 .index = @enumToInt(Feature.fast_scalar_fsqrt),
502 .name = @tagName(Feature.fast_scalar_fsqrt),
503 .llvm_name = "fast-scalar-fsqrt",
504 .description = "Scalar SQRT is fast (disable Newton-Raphson)",
505 .dependencies = 0,
506 };
507
508 result[@enumToInt(Feature.fast_scalar_shift_masks)] = .{
509 .index = @enumToInt(Feature.fast_scalar_shift_masks),
510 .name = @tagName(Feature.fast_scalar_shift_masks),
511 .llvm_name = "fast-scalar-shift-masks",
512 .description = "Prefer a left/right scalar logical shift pair over a shift+and pair",
513 .dependencies = 0,
514 };
515
516 result[@enumToInt(Feature.fast_variable_shuffle)] = .{
517 .index = @enumToInt(Feature.fast_variable_shuffle),
518 .name = @tagName(Feature.fast_variable_shuffle),
519 .llvm_name = "fast-variable-shuffle",
520 .description = "Shuffles with variable masks are fast",
521 .dependencies = 0,
522 };
523
524 result[@enumToInt(Feature.fast_vector_fsqrt)] = .{
525 .index = @enumToInt(Feature.fast_vector_fsqrt),
526 .name = @tagName(Feature.fast_vector_fsqrt),
527 .llvm_name = "fast-vector-fsqrt",
528 .description = "Vector SQRT is fast (disable Newton-Raphson)",
529 .dependencies = 0,
530 };
531
532 result[@enumToInt(Feature.fast_vector_shift_masks)] = .{
533 .index = @enumToInt(Feature.fast_vector_shift_masks),
534 .name = @tagName(Feature.fast_vector_shift_masks),
535 .llvm_name = "fast-vector-shift-masks",
536 .description = "Prefer a left/right vector logical shift pair over a shift+and pair",
537 .dependencies = 0,
538 };
539
540 result[@enumToInt(Feature.gfni)] = .{
541 .index = @enumToInt(Feature.gfni),
542 .name = @tagName(Feature.gfni),
543 .llvm_name = "gfni",
544 .description = "Enable Galois Field Arithmetic Instructions",
545 .dependencies = featureSet(&[_]Feature{
546 .sse,
547 }),
548 };
549
550 result[@enumToInt(Feature.fast_gather)] = .{
551 .index = @enumToInt(Feature.fast_gather),
552 .name = @tagName(Feature.fast_gather),
553 .llvm_name = "fast-gather",
554 .description = "Indicates if gather is reasonably fast",
555 .dependencies = 0,
556 };
557
558 result[@enumToInt(Feature.avx512ifma)] = .{
559 .index = @enumToInt(Feature.avx512ifma),
560 .name = @tagName(Feature.avx512ifma),
561 .llvm_name = "avx512ifma",
562 .description = "Enable AVX-512 Integer Fused Multiple-Add",
563 .dependencies = featureSet(&[_]Feature{
564 .sse,
565 }),
566 };
567
568 result[@enumToInt(Feature.invpcid)] = .{
569 .index = @enumToInt(Feature.invpcid),
570 .name = @tagName(Feature.invpcid),
571 .llvm_name = "invpcid",
572 .description = "Invalidate Process-Context Identifier",
573 .dependencies = 0,
574 };
575
576 result[@enumToInt(Feature.sahf)] = .{
577 .index = @enumToInt(Feature.sahf),
578 .name = @tagName(Feature.sahf),
579 .llvm_name = "sahf",
580 .description = "Support LAHF and SAHF instructions",
581 .dependencies = 0,
582 };
583
584 result[@enumToInt(Feature.lea_sp)] = .{
585 .index = @enumToInt(Feature.lea_sp),
586 .name = @tagName(Feature.lea_sp),
587 .llvm_name = "lea-sp",
588 .description = "Use LEA for adjusting the stack pointer",
589 .dependencies = 0,
590 };
591
592 result[@enumToInt(Feature.lea_uses_ag)] = .{
593 .index = @enumToInt(Feature.lea_uses_ag),
594 .name = @tagName(Feature.lea_uses_ag),
595 .llvm_name = "lea-uses-ag",
596 .description = "LEA instruction needs inputs at AG stage",
597 .dependencies = 0,
598 };
599
600 result[@enumToInt(Feature.lwp)] = .{
601 .index = @enumToInt(Feature.lwp),
602 .name = @tagName(Feature.lwp),
603 .llvm_name = "lwp",
604 .description = "Enable LWP instructions",
605 .dependencies = 0,
606 };
607
608 result[@enumToInt(Feature.lzcnt)] = .{
609 .index = @enumToInt(Feature.lzcnt),
610 .name = @tagName(Feature.lzcnt),
611 .llvm_name = "lzcnt",
612 .description = "Support LZCNT instruction",
613 .dependencies = 0,
614 };
615
616 result[@enumToInt(Feature.false_deps_lzcnt_tzcnt)] = .{
617 .index = @enumToInt(Feature.false_deps_lzcnt_tzcnt),
618 .name = @tagName(Feature.false_deps_lzcnt_tzcnt),
619 .llvm_name = "false-deps-lzcnt-tzcnt",
620 .description = "LZCNT/TZCNT have a false dependency on dest register",
621 .dependencies = 0,
622 };
623
624 result[@enumToInt(Feature.mmx)] = .{
625 .index = @enumToInt(Feature.mmx),
626 .name = @tagName(Feature.mmx),
627 .llvm_name = "mmx",
628 .description = "Enable MMX instructions",
629 .dependencies = 0,
630 };
631
632 result[@enumToInt(Feature.movbe)] = .{
633 .index = @enumToInt(Feature.movbe),
634 .name = @tagName(Feature.movbe),
635 .llvm_name = "movbe",
636 .description = "Support MOVBE instruction",
637 .dependencies = 0,
638 };
639
640 result[@enumToInt(Feature.movdir64b)] = .{
641 .index = @enumToInt(Feature.movdir64b),
642 .name = @tagName(Feature.movdir64b),
643 .llvm_name = "movdir64b",
644 .description = "Support movdir64b instruction",
645 .dependencies = 0,
646 };
647
648 result[@enumToInt(Feature.movdiri)] = .{
649 .index = @enumToInt(Feature.movdiri),
650 .name = @tagName(Feature.movdiri),
651 .llvm_name = "movdiri",
652 .description = "Support movdiri instruction",
653 .dependencies = 0,
654 };
655
656 result[@enumToInt(Feature.mpx)] = .{
657 .index = @enumToInt(Feature.mpx),
658 .name = @tagName(Feature.mpx),
659 .llvm_name = "mpx",
660 .description = "Support MPX instructions",
661 .dependencies = 0,
662 };
663
664 result[@enumToInt(Feature.mwaitx)] = .{
665 .index = @enumToInt(Feature.mwaitx),
666 .name = @tagName(Feature.mwaitx),
667 .llvm_name = "mwaitx",
668 .description = "Enable MONITORX/MWAITX timer functionality",
669 .dependencies = 0,
670 };
671
672 result[@enumToInt(Feature.macrofusion)] = .{
673 .index = @enumToInt(Feature.macrofusion),
674 .name = @tagName(Feature.macrofusion),
675 .llvm_name = "macrofusion",
676 .description = "Various instructions can be fused with conditional branches",
677 .dependencies = 0,
678 };
679
680 result[@enumToInt(Feature.merge_to_threeway_branch)] = .{
681 .index = @enumToInt(Feature.merge_to_threeway_branch),
682 .name = @tagName(Feature.merge_to_threeway_branch),
683 .llvm_name = "merge-to-threeway-branch",
684 .description = "Merge branches to a three-way conditional branch",
685 .dependencies = 0,
686 };
687
688 result[@enumToInt(Feature.nopl)] = .{
689 .index = @enumToInt(Feature.nopl),
690 .name = @tagName(Feature.nopl),
691 .llvm_name = "nopl",
692 .description = "Enable NOPL instruction",
693 .dependencies = 0,
694 };
695
696 result[@enumToInt(Feature.pclmul)] = .{
697 .index = @enumToInt(Feature.pclmul),
698 .name = @tagName(Feature.pclmul),
699 .llvm_name = "pclmul",
700 .description = "Enable packed carry-less multiplication instructions",
701 .dependencies = featureSet(&[_]Feature{
702 .sse,
703 }),
704 };
705
706 result[@enumToInt(Feature.pconfig)] = .{
707 .index = @enumToInt(Feature.pconfig),
708 .name = @tagName(Feature.pconfig),
709 .llvm_name = "pconfig",
710 .description = "platform configuration instruction",
711 .dependencies = 0,
712 };
713
714 result[@enumToInt(Feature.avx512pf)] = .{
715 .index = @enumToInt(Feature.avx512pf),
716 .name = @tagName(Feature.avx512pf),
717 .llvm_name = "avx512pf",
718 .description = "Enable AVX-512 PreFetch Instructions",
719 .dependencies = featureSet(&[_]Feature{
720 .sse,
721 }),
722 };
723
724 result[@enumToInt(Feature.pku)] = .{
725 .index = @enumToInt(Feature.pku),
726 .name = @tagName(Feature.pku),
727 .llvm_name = "pku",
728 .description = "Enable protection keys",
729 .dependencies = 0,
730 };
731
732 result[@enumToInt(Feature.popcnt)] = .{
733 .index = @enumToInt(Feature.popcnt),
734 .name = @tagName(Feature.popcnt),
735 .llvm_name = "popcnt",
736 .description = "Support POPCNT instruction",
737 .dependencies = 0,
738 };
739
740 result[@enumToInt(Feature.false_deps_popcnt)] = .{
741 .index = @enumToInt(Feature.false_deps_popcnt),
742 .name = @tagName(Feature.false_deps_popcnt),
743 .llvm_name = "false-deps-popcnt",
744 .description = "POPCNT has a false dependency on dest register",
745 .dependencies = 0,
746 };
747
748 result[@enumToInt(Feature.prefetchwt1)] = .{
749 .index = @enumToInt(Feature.prefetchwt1),
750 .name = @tagName(Feature.prefetchwt1),
751 .llvm_name = "prefetchwt1",
752 .description = "Prefetch with Intent to Write and T1 Hint",
753 .dependencies = 0,
754 };
755
756 result[@enumToInt(Feature.prfchw)] = .{
757 .index = @enumToInt(Feature.prfchw),
758 .name = @tagName(Feature.prfchw),
759 .llvm_name = "prfchw",
760 .description = "Support PRFCHW instructions",
761 .dependencies = 0,
762 };
763
764 result[@enumToInt(Feature.ptwrite)] = .{
765 .index = @enumToInt(Feature.ptwrite),
766 .name = @tagName(Feature.ptwrite),
767 .llvm_name = "ptwrite",
768 .description = "Support ptwrite instruction",
769 .dependencies = 0,
770 };
771
772 result[@enumToInt(Feature.pad_short_functions)] = .{
773 .index = @enumToInt(Feature.pad_short_functions),
774 .name = @tagName(Feature.pad_short_functions),
775 .llvm_name = "pad-short-functions",
776 .description = "Pad short functions",
777 .dependencies = 0,
778 };
779
780 result[@enumToInt(Feature.prefer_256_bit)] = .{
781 .index = @enumToInt(Feature.prefer_256_bit),
782 .name = @tagName(Feature.prefer_256_bit),
783 .llvm_name = "prefer-256-bit",
784 .description = "Prefer 256-bit AVX instructions",
785 .dependencies = 0,
786 };
787
788 result[@enumToInt(Feature.rdpid)] = .{
789 .index = @enumToInt(Feature.rdpid),
790 .name = @tagName(Feature.rdpid),
791 .llvm_name = "rdpid",
792 .description = "Support RDPID instructions",
793 .dependencies = 0,
794 };
795
796 result[@enumToInt(Feature.rdrnd)] = .{
797 .index = @enumToInt(Feature.rdrnd),
798 .name = @tagName(Feature.rdrnd),
799 .llvm_name = "rdrnd",
800 .description = "Support RDRAND instruction",
801 .dependencies = 0,
802 };
803
804 result[@enumToInt(Feature.rdseed)] = .{
805 .index = @enumToInt(Feature.rdseed),
806 .name = @tagName(Feature.rdseed),
807 .llvm_name = "rdseed",
808 .description = "Support RDSEED instruction",
809 .dependencies = 0,
810 };
811
812 result[@enumToInt(Feature.rtm)] = .{
813 .index = @enumToInt(Feature.rtm),
814 .name = @tagName(Feature.rtm),
815 .llvm_name = "rtm",
816 .description = "Support RTM instructions",
817 .dependencies = 0,
818 };
819
820 result[@enumToInt(Feature.retpoline)] = .{
821 .index = @enumToInt(Feature.retpoline),
822 .name = @tagName(Feature.retpoline),
823 .llvm_name = "retpoline",
824 .description = "Remove speculation of indirect branches from the generated code, either by avoiding them entirely or lowering them with a speculation blocking construct",
825 .dependencies = featureSet(&[_]Feature{
826 .retpoline_indirect_calls,
827 .retpoline_indirect_branches,
828 }),
829 };
830
831 result[@enumToInt(Feature.retpoline_external_thunk)] = .{
832 .index = @enumToInt(Feature.retpoline_external_thunk),
833 .name = @tagName(Feature.retpoline_external_thunk),
834 .llvm_name = "retpoline-external-thunk",
835 .description = "When lowering an indirect call or branch using a `retpoline`, rely on the specified user provided thunk rather than emitting one ourselves. Only has effect when combined with some other retpoline feature",
836 .dependencies = featureSet(&[_]Feature{
837 .retpoline_indirect_calls,
838 }),
839 };
840
841 result[@enumToInt(Feature.retpoline_indirect_branches)] = .{
842 .index = @enumToInt(Feature.retpoline_indirect_branches),
843 .name = @tagName(Feature.retpoline_indirect_branches),
844 .llvm_name = "retpoline-indirect-branches",
845 .description = "Remove speculation of indirect branches from the generated code",
846 .dependencies = 0,
847 };
848
849 result[@enumToInt(Feature.retpoline_indirect_calls)] = .{
850 .index = @enumToInt(Feature.retpoline_indirect_calls),
851 .name = @tagName(Feature.retpoline_indirect_calls),
852 .llvm_name = "retpoline-indirect-calls",
853 .description = "Remove speculation of indirect calls from the generated code",
854 .dependencies = 0,
855 };
856
857 result[@enumToInt(Feature.sgx)] = .{
858 .index = @enumToInt(Feature.sgx),
859 .name = @tagName(Feature.sgx),
860 .llvm_name = "sgx",
861 .description = "Enable Software Guard Extensions",
862 .dependencies = 0,
863 };
864
865 result[@enumToInt(Feature.sha)] = .{
866 .index = @enumToInt(Feature.sha),
867 .name = @tagName(Feature.sha),
868 .llvm_name = "sha",
869 .description = "Enable SHA instructions",
870 .dependencies = featureSet(&[_]Feature{
871 .sse,
872 }),
873 };
874
875 result[@enumToInt(Feature.shstk)] = .{
876 .index = @enumToInt(Feature.shstk),
877 .name = @tagName(Feature.shstk),
878 .llvm_name = "shstk",
879 .description = "Support CET Shadow-Stack instructions",
880 .dependencies = 0,
881 };
882
883 result[@enumToInt(Feature.sse)] = .{
884 .index = @enumToInt(Feature.sse),
885 .name = @tagName(Feature.sse),
886 .llvm_name = "sse",
887 .description = "Enable SSE instructions",
888 .dependencies = 0,
889 };
890
891 result[@enumToInt(Feature.sse2)] = .{
892 .index = @enumToInt(Feature.sse2),
893 .name = @tagName(Feature.sse2),
894 .llvm_name = "sse2",
895 .description = "Enable SSE2 instructions",
896 .dependencies = featureSet(&[_]Feature{
897 .sse,
898 }),
899 };
900
901 result[@enumToInt(Feature.sse3)] = .{
902 .index = @enumToInt(Feature.sse3),
903 .name = @tagName(Feature.sse3),
904 .llvm_name = "sse3",
905 .description = "Enable SSE3 instructions",
906 .dependencies = featureSet(&[_]Feature{
907 .sse,
908 }),
909 };
910
911 result[@enumToInt(Feature.sse4a)] = .{
912 .index = @enumToInt(Feature.sse4a),
913 .name = @tagName(Feature.sse4a),
914 .llvm_name = "sse4a",
915 .description = "Support SSE 4a instructions",
916 .dependencies = featureSet(&[_]Feature{
917 .sse,
918 }),
919 };
920
921 result[@enumToInt(Feature.sse4_1)] = .{
922 .index = @enumToInt(Feature.sse4_1),
923 .name = @tagName(Feature.sse4_1),
924 .llvm_name = "sse4.1",
925 .description = "Enable SSE 4.1 instructions",
926 .dependencies = featureSet(&[_]Feature{
927 .sse,
928 }),
929 };
930
931 result[@enumToInt(Feature.sse4_2)] = .{
932 .index = @enumToInt(Feature.sse4_2),
933 .name = @tagName(Feature.sse4_2),
934 .llvm_name = "sse4.2",
935 .description = "Enable SSE 4.2 instructions",
936 .dependencies = featureSet(&[_]Feature{
937 .sse,
938 }),
939 };
940
941 result[@enumToInt(Feature.sse_unaligned_mem)] = .{
942 .index = @enumToInt(Feature.sse_unaligned_mem),
943 .name = @tagName(Feature.sse_unaligned_mem),
944 .llvm_name = "sse-unaligned-mem",
945 .description = "Allow unaligned memory operands with SSE instructions",
946 .dependencies = 0,
947 };
948
949 result[@enumToInt(Feature.ssse3)] = .{
950 .index = @enumToInt(Feature.ssse3),
951 .name = @tagName(Feature.ssse3),
952 .llvm_name = "ssse3",
953 .description = "Enable SSSE3 instructions",
954 .dependencies = featureSet(&[_]Feature{
955 .sse,
956 }),
957 };
958
959 result[@enumToInt(Feature.slow_3ops_lea)] = .{
960 .index = @enumToInt(Feature.slow_3ops_lea),
961 .name = @tagName(Feature.slow_3ops_lea),
962 .llvm_name = "slow-3ops-lea",
963 .description = "LEA instruction with 3 ops or certain registers is slow",
964 .dependencies = 0,
965 };
966
967 result[@enumToInt(Feature.idivl_to_divb)] = .{
968 .index = @enumToInt(Feature.idivl_to_divb),
969 .name = @tagName(Feature.idivl_to_divb),
970 .llvm_name = "idivl-to-divb",
971 .description = "Use 8-bit divide for positive values less than 256",
972 .dependencies = 0,
973 };
974
975 result[@enumToInt(Feature.idivq_to_divl)] = .{
976 .index = @enumToInt(Feature.idivq_to_divl),
977 .name = @tagName(Feature.idivq_to_divl),
978 .llvm_name = "idivq-to-divl",
979 .description = "Use 32-bit divide for positive values less than 2^32",
980 .dependencies = 0,
981 };
982
983 result[@enumToInt(Feature.slow_incdec)] = .{
984 .index = @enumToInt(Feature.slow_incdec),
985 .name = @tagName(Feature.slow_incdec),
986 .llvm_name = "slow-incdec",
987 .description = "INC and DEC instructions are slower than ADD and SUB",
988 .dependencies = 0,
989 };
990
991 result[@enumToInt(Feature.slow_lea)] = .{
992 .index = @enumToInt(Feature.slow_lea),
993 .name = @tagName(Feature.slow_lea),
994 .llvm_name = "slow-lea",
995 .description = "LEA instruction with certain arguments is slow",
996 .dependencies = 0,
997 };
998
999 result[@enumToInt(Feature.slow_pmaddwd)] = .{
1000 .index = @enumToInt(Feature.slow_pmaddwd),
1001 .name = @tagName(Feature.slow_pmaddwd),
1002 .llvm_name = "slow-pmaddwd",
1003 .description = "PMADDWD is slower than PMULLD",
1004 .dependencies = 0,
1005 };
1006
1007 result[@enumToInt(Feature.slow_pmulld)] = .{
1008 .index = @enumToInt(Feature.slow_pmulld),
1009 .name = @tagName(Feature.slow_pmulld),
1010 .llvm_name = "slow-pmulld",
1011 .description = "PMULLD instruction is slow",
1012 .dependencies = 0,
1013 };
1014
1015 result[@enumToInt(Feature.slow_shld)] = .{
1016 .index = @enumToInt(Feature.slow_shld),
1017 .name = @tagName(Feature.slow_shld),
1018 .llvm_name = "slow-shld",
1019 .description = "SHLD instruction is slow",
1020 .dependencies = 0,
1021 };
1022
1023 result[@enumToInt(Feature.slow_two_mem_ops)] = .{
1024 .index = @enumToInt(Feature.slow_two_mem_ops),
1025 .name = @tagName(Feature.slow_two_mem_ops),
1026 .llvm_name = "slow-two-mem-ops",
1027 .description = "Two memory operand instructions are slow",
1028 .dependencies = 0,
1029 };
1030
1031 result[@enumToInt(Feature.slow_unaligned_mem_16)] = .{
1032 .index = @enumToInt(Feature.slow_unaligned_mem_16),
1033 .name = @tagName(Feature.slow_unaligned_mem_16),
1034 .llvm_name = "slow-unaligned-mem-16",
1035 .description = "Slow unaligned 16-byte memory access",
1036 .dependencies = 0,
1037 };
1038
1039 result[@enumToInt(Feature.slow_unaligned_mem_32)] = .{
1040 .index = @enumToInt(Feature.slow_unaligned_mem_32),
1041 .name = @tagName(Feature.slow_unaligned_mem_32),
1042 .llvm_name = "slow-unaligned-mem-32",
1043 .description = "Slow unaligned 32-byte memory access",
1044 .dependencies = 0,
1045 };
1046
1047 result[@enumToInt(Feature.soft_float)] = .{
1048 .index = @enumToInt(Feature.soft_float),
1049 .name = @tagName(Feature.soft_float),
1050 .llvm_name = "soft-float",
1051 .description = "Use software floating point features",
1052 .dependencies = 0,
1053 };
1054
1055 result[@enumToInt(Feature.tbm)] = .{
1056 .index = @enumToInt(Feature.tbm),
1057 .name = @tagName(Feature.tbm),
1058 .llvm_name = "tbm",
1059 .description = "Enable TBM instructions",
1060 .dependencies = 0,
1061 };
1062
1063 result[@enumToInt(Feature.vaes)] = .{
1064 .index = @enumToInt(Feature.vaes),
1065 .name = @tagName(Feature.vaes),
1066 .llvm_name = "vaes",
1067 .description = "Promote selected AES instructions to AVX512/AVX registers",
1068 .dependencies = featureSet(&[_]Feature{
1069 .sse,
1070 }),
1071 };
1072
1073 result[@enumToInt(Feature.avx512vbmi)] = .{
1074 .index = @enumToInt(Feature.avx512vbmi),
1075 .name = @tagName(Feature.avx512vbmi),
1076 .llvm_name = "avx512vbmi",
1077 .description = "Enable AVX-512 Vector Byte Manipulation Instructions",
1078 .dependencies = featureSet(&[_]Feature{
1079 .sse,
1080 }),
1081 };
1082
1083 result[@enumToInt(Feature.avx512vbmi2)] = .{
1084 .index = @enumToInt(Feature.avx512vbmi2),
1085 .name = @tagName(Feature.avx512vbmi2),
1086 .llvm_name = "avx512vbmi2",
1087 .description = "Enable AVX-512 further Vector Byte Manipulation Instructions",
1088 .dependencies = featureSet(&[_]Feature{
1089 .sse,
1090 }),
1091 };
1092
1093 result[@enumToInt(Feature.avx512vl)] = .{
1094 .index = @enumToInt(Feature.avx512vl),
1095 .name = @tagName(Feature.avx512vl),
1096 .llvm_name = "avx512vl",
1097 .description = "Enable AVX-512 Vector Length eXtensions",
1098 .dependencies = featureSet(&[_]Feature{
1099 .sse,
1100 }),
1101 };
1102
1103 result[@enumToInt(Feature.avx512vnni)] = .{
1104 .index = @enumToInt(Feature.avx512vnni),
1105 .name = @tagName(Feature.avx512vnni),
1106 .llvm_name = "avx512vnni",
1107 .description = "Enable AVX-512 Vector Neural Network Instructions",
1108 .dependencies = featureSet(&[_]Feature{
1109 .sse,
1110 }),
1111 };
1112
1113 result[@enumToInt(Feature.avx512vp2intersect)] = .{
1114 .index = @enumToInt(Feature.avx512vp2intersect),
1115 .name = @tagName(Feature.avx512vp2intersect),
1116 .llvm_name = "avx512vp2intersect",
1117 .description = "Enable AVX-512 vp2intersect",
1118 .dependencies = featureSet(&[_]Feature{
1119 .sse,
1120 }),
1121 };
1122
1123 result[@enumToInt(Feature.vpclmulqdq)] = .{
1124 .index = @enumToInt(Feature.vpclmulqdq),
1125 .name = @tagName(Feature.vpclmulqdq),
1126 .llvm_name = "vpclmulqdq",
1127 .description = "Enable vpclmulqdq instructions",
1128 .dependencies = featureSet(&[_]Feature{
1129 .sse,
1130 }),
1131 };
1132
1133 result[@enumToInt(Feature.avx512vpopcntdq)] = .{
1134 .index = @enumToInt(Feature.avx512vpopcntdq),
1135 .name = @tagName(Feature.avx512vpopcntdq),
1136 .llvm_name = "avx512vpopcntdq",
1137 .description = "Enable AVX-512 Population Count Instructions",
1138 .dependencies = featureSet(&[_]Feature{
1139 .sse,
1140 }),
1141 };
1142
1143 result[@enumToInt(Feature.waitpkg)] = .{
1144 .index = @enumToInt(Feature.waitpkg),
1145 .name = @tagName(Feature.waitpkg),
1146 .llvm_name = "waitpkg",
1147 .description = "Wait and pause enhancements",
1148 .dependencies = 0,
1149 };
1150
1151 result[@enumToInt(Feature.wbnoinvd)] = .{
1152 .index = @enumToInt(Feature.wbnoinvd),
1153 .name = @tagName(Feature.wbnoinvd),
1154 .llvm_name = "wbnoinvd",
1155 .description = "Write Back No Invalidate",
1156 .dependencies = 0,
1157 };
1158
1159 result[@enumToInt(Feature.x87)] = .{
1160 .index = @enumToInt(Feature.x87),
1161 .name = @tagName(Feature.x87),
1162 .llvm_name = "x87",
1163 .description = "Enable X87 float instructions",
1164 .dependencies = 0,
1165 };
1166
1167 result[@enumToInt(Feature.xop)] = .{
1168 .index = @enumToInt(Feature.xop),
1169 .name = @tagName(Feature.xop),
1170 .llvm_name = "xop",
1171 .description = "Enable XOP instructions",
1172 .dependencies = featureSet(&[_]Feature{
1173 .sse,
1174 }),
1175 };
1176
1177 result[@enumToInt(Feature.xsave)] = .{
1178 .index = @enumToInt(Feature.xsave),
1179 .name = @tagName(Feature.xsave),
1180 .llvm_name = "xsave",
1181 .description = "Support xsave instructions",
1182 .dependencies = 0,
1183 };
1184
1185 result[@enumToInt(Feature.xsavec)] = .{
1186 .index = @enumToInt(Feature.xsavec),
1187 .name = @tagName(Feature.xsavec),
1188 .llvm_name = "xsavec",
1189 .description = "Support xsavec instructions",
1190 .dependencies = 0,
1191 };
1192
1193 result[@enumToInt(Feature.xsaveopt)] = .{
1194 .index = @enumToInt(Feature.xsaveopt),
1195 .name = @tagName(Feature.xsaveopt),
1196 .llvm_name = "xsaveopt",
1197 .description = "Support xsaveopt instructions",
1198 .dependencies = 0,
1199 };
1200
1201 result[@enumToInt(Feature.xsaves)] = .{
1202 .index = @enumToInt(Feature.xsaves),
1203 .name = @tagName(Feature.xsaves),
1204 .llvm_name = "xsaves",
1205 .description = "Support xsaves instructions",
1206 .dependencies = 0,
1207 };
1208
1209 break :blk result;
1210};
1211
1212pub const cpu = struct {
1213 pub const amdfam10 = Cpu{
1214 .name = "amdfam10",
1215 .llvm_name = "amdfam10",
1216 .dependencies = featureSet(&[_]Feature{
1217 .mmx,
1218 .dnowa3,
1219 .bit64,
1220 .cmov,
1221 .cx8,
1222 .cx16,
1223 .fxsr,
1224 .fast_scalar_shift_masks,
1225 .sahf,
1226 .lzcnt,
1227 .nopl,
1228 .popcnt,
1229 .sse,
1230 .sse4a,
1231 .slow_shld,
1232 .x87,
1233 }),
1234 };
1235
1236 pub const athlon = Cpu{
1237 .name = "athlon",
1238 .llvm_name = "athlon",
1239 .dependencies = featureSet(&[_]Feature{
1240 .mmx,
1241 .dnowa3,
1242 .cmov,
1243 .cx8,
1244 .nopl,
1245 .slow_shld,
1246 .slow_unaligned_mem_16,
1247 .x87,
1248 }),
1249 };
1250
1251 pub const athlon4 = Cpu{
1252 .name = "athlon_4",
1253 .llvm_name = "athlon-4",
1254 .dependencies = featureSet(&[_]Feature{
1255 .mmx,
1256 .dnowa3,
1257 .cmov,
1258 .cx8,
1259 .fxsr,
1260 .nopl,
1261 .sse,
1262 .slow_shld,
1263 .slow_unaligned_mem_16,
1264 .x87,
1265 }),
1266 };
1267
1268 pub const athlon_fx = Cpu{
1269 .name = "athlon_fx",
1270 .llvm_name = "athlon-fx",
1271 .dependencies = featureSet(&[_]Feature{
1272 .mmx,
1273 .dnowa3,
1274 .bit64,
1275 .cmov,
1276 .cx8,
1277 .fxsr,
1278 .fast_scalar_shift_masks,
1279 .nopl,
1280 .sse,
1281 .sse2,
1282 .slow_shld,
1283 .slow_unaligned_mem_16,
1284 .x87,
1285 }),
1286 };
1287
1288 pub const athlon_mp = Cpu{
1289 .name = "athlon_mp",
1290 .llvm_name = "athlon-mp",
1291 .dependencies = featureSet(&[_]Feature{
1292 .mmx,
1293 .dnowa3,
1294 .cmov,
1295 .cx8,
1296 .fxsr,
1297 .nopl,
1298 .sse,
1299 .slow_shld,
1300 .slow_unaligned_mem_16,
1301 .x87,
1302 }),
1303 };
1304
1305 pub const athlon_tbird = Cpu{
1306 .name = "athlon_tbird",
1307 .llvm_name = "athlon-tbird",
1308 .dependencies = featureSet(&[_]Feature{
1309 .mmx,
1310 .dnowa3,
1311 .cmov,
1312 .cx8,
1313 .nopl,
1314 .slow_shld,
1315 .slow_unaligned_mem_16,
1316 .x87,
1317 }),
1318 };
1319
1320 pub const athlon_xp = Cpu{
1321 .name = "athlon_xp",
1322 .llvm_name = "athlon-xp",
1323 .dependencies = featureSet(&[_]Feature{
1324 .mmx,
1325 .dnowa3,
1326 .cmov,
1327 .cx8,
1328 .fxsr,
1329 .nopl,
1330 .sse,
1331 .slow_shld,
1332 .slow_unaligned_mem_16,
1333 .x87,
1334 }),
1335 };
1336
1337 pub const athlon64 = Cpu{
1338 .name = "athlon64",
1339 .llvm_name = "athlon64",
1340 .dependencies = featureSet(&[_]Feature{
1341 .mmx,
1342 .dnowa3,
1343 .bit64,
1344 .cmov,
1345 .cx8,
1346 .fxsr,
1347 .fast_scalar_shift_masks,
1348 .nopl,
1349 .sse,
1350 .sse2,
1351 .slow_shld,
1352 .slow_unaligned_mem_16,
1353 .x87,
1354 }),
1355 };
1356
1357 pub const athlon64_sse3 = Cpu{
1358 .name = "athlon64_sse3",
1359 .llvm_name = "athlon64-sse3",
1360 .dependencies = featureSet(&[_]Feature{
1361 .mmx,
1362 .dnowa3,
1363 .bit64,
1364 .cmov,
1365 .cx8,
1366 .cx16,
1367 .fxsr,
1368 .fast_scalar_shift_masks,
1369 .nopl,
1370 .sse,
1371 .sse3,
1372 .slow_shld,
1373 .slow_unaligned_mem_16,
1374 .x87,
1375 }),
1376 };
1377
1378 pub const atom = Cpu{
1379 .name = "atom",
1380 .llvm_name = "atom",
1381 .dependencies = featureSet(&[_]Feature{
1382 .bit64,
1383 .cmov,
1384 .cx8,
1385 .cx16,
1386 .fxsr,
1387 .sahf,
1388 .lea_sp,
1389 .lea_uses_ag,
1390 .mmx,
1391 .movbe,
1392 .nopl,
1393 .pad_short_functions,
1394 .sse,
1395 .ssse3,
1396 .idivl_to_divb,
1397 .idivq_to_divl,
1398 .slow_two_mem_ops,
1399 .slow_unaligned_mem_16,
1400 .x87,
1401 }),
1402 };
1403
1404 pub const barcelona = Cpu{
1405 .name = "barcelona",
1406 .llvm_name = "barcelona",
1407 .dependencies = featureSet(&[_]Feature{
1408 .mmx,
1409 .dnowa3,
1410 .bit64,
1411 .cmov,
1412 .cx8,
1413 .cx16,
1414 .fxsr,
1415 .fast_scalar_shift_masks,
1416 .sahf,
1417 .lzcnt,
1418 .nopl,
1419 .popcnt,
1420 .sse,
1421 .sse4a,
1422 .slow_shld,
1423 .x87,
1424 }),
1425 };
1426
1427 pub const bdver1 = Cpu{
1428 .name = "bdver1",
1429 .llvm_name = "bdver1",
1430 .dependencies = featureSet(&[_]Feature{
1431 .bit64,
1432 .sse,
1433 .aes,
1434 .branchfusion,
1435 .cmov,
1436 .cx8,
1437 .cx16,
1438 .fxsr,
1439 .fast11bytenop,
1440 .fast_scalar_shift_masks,
1441 .sahf,
1442 .lwp,
1443 .lzcnt,
1444 .mmx,
1445 .nopl,
1446 .pclmul,
1447 .popcnt,
1448 .prfchw,
1449 .slow_shld,
1450 .x87,
1451 .xop,
1452 .xsave,
1453 }),
1454 };
1455
1456 pub const bdver2 = Cpu{
1457 .name = "bdver2",
1458 .llvm_name = "bdver2",
1459 .dependencies = featureSet(&[_]Feature{
1460 .bit64,
1461 .sse,
1462 .aes,
1463 .bmi,
1464 .branchfusion,
1465 .cmov,
1466 .cx8,
1467 .cx16,
1468 .f16c,
1469 .fma,
1470 .fxsr,
1471 .fast11bytenop,
1472 .fast_bextr,
1473 .fast_scalar_shift_masks,
1474 .sahf,
1475 .lwp,
1476 .lzcnt,
1477 .mmx,
1478 .nopl,
1479 .pclmul,
1480 .popcnt,
1481 .prfchw,
1482 .slow_shld,
1483 .tbm,
1484 .x87,
1485 .xop,
1486 .xsave,
1487 }),
1488 };
1489
1490 pub const bdver3 = Cpu{
1491 .name = "bdver3",
1492 .llvm_name = "bdver3",
1493 .dependencies = featureSet(&[_]Feature{
1494 .bit64,
1495 .sse,
1496 .aes,
1497 .bmi,
1498 .branchfusion,
1499 .cmov,
1500 .cx8,
1501 .cx16,
1502 .f16c,
1503 .fma,
1504 .fsgsbase,
1505 .fxsr,
1506 .fast11bytenop,
1507 .fast_bextr,
1508 .fast_scalar_shift_masks,
1509 .sahf,
1510 .lwp,
1511 .lzcnt,
1512 .mmx,
1513 .nopl,
1514 .pclmul,
1515 .popcnt,
1516 .prfchw,
1517 .slow_shld,
1518 .tbm,
1519 .x87,
1520 .xop,
1521 .xsave,
1522 .xsaveopt,
1523 }),
1524 };
1525
1526 pub const bdver4 = Cpu{
1527 .name = "bdver4",
1528 .llvm_name = "bdver4",
1529 .dependencies = featureSet(&[_]Feature{
1530 .bit64,
1531 .sse,
1532 .aes,
1533 .avx2,
1534 .bmi,
1535 .bmi2,
1536 .branchfusion,
1537 .cmov,
1538 .cx8,
1539 .cx16,
1540 .f16c,
1541 .fma,
1542 .fsgsbase,
1543 .fxsr,
1544 .fast11bytenop,
1545 .fast_bextr,
1546 .fast_scalar_shift_masks,
1547 .sahf,
1548 .lwp,
1549 .lzcnt,
1550 .mmx,
1551 .mwaitx,
1552 .nopl,
1553 .pclmul,
1554 .popcnt,
1555 .prfchw,
1556 .slow_shld,
1557 .tbm,
1558 .x87,
1559 .xop,
1560 .xsave,
1561 .xsaveopt,
1562 }),
1563 };
1564
1565 pub const bonnell = Cpu{
1566 .name = "bonnell",
1567 .llvm_name = "bonnell",
1568 .dependencies = featureSet(&[_]Feature{
1569 .bit64,
1570 .cmov,
1571 .cx8,
1572 .cx16,
1573 .fxsr,
1574 .sahf,
1575 .lea_sp,
1576 .lea_uses_ag,
1577 .mmx,
1578 .movbe,
1579 .nopl,
1580 .pad_short_functions,
1581 .sse,
1582 .ssse3,
1583 .idivl_to_divb,
1584 .idivq_to_divl,
1585 .slow_two_mem_ops,
1586 .slow_unaligned_mem_16,
1587 .x87,
1588 }),
1589 };
1590
1591 pub const broadwell = Cpu{
1592 .name = "broadwell",
1593 .llvm_name = "broadwell",
1594 .dependencies = featureSet(&[_]Feature{
1595 .bit64,
1596 .adx,
1597 .sse,
1598 .avx,
1599 .avx2,
1600 .bmi,
1601 .bmi2,
1602 .cmov,
1603 .cx8,
1604 .cx16,
1605 .ermsb,
1606 .f16c,
1607 .fma,
1608 .fsgsbase,
1609 .fxsr,
1610 .fast_shld_rotate,
1611 .fast_scalar_fsqrt,
1612 .fast_variable_shuffle,
1613 .invpcid,
1614 .sahf,
1615 .lzcnt,
1616 .false_deps_lzcnt_tzcnt,
1617 .mmx,
1618 .movbe,
1619 .macrofusion,
1620 .merge_to_threeway_branch,
1621 .nopl,
1622 .pclmul,
1623 .popcnt,
1624 .false_deps_popcnt,
1625 .prfchw,
1626 .rdrnd,
1627 .rdseed,
1628 .sse42,
1629 .slow_3ops_lea,
1630 .idivq_to_divl,
1631 .x87,
1632 .xsave,
1633 .xsaveopt,
1634 }),
1635 };
1636
1637 pub const btver1 = Cpu{
1638 .name = "btver1",
1639 .llvm_name = "btver1",
1640 .dependencies = featureSet(&[_]Feature{
1641 .bit64,
1642 .cmov,
1643 .cx8,
1644 .cx16,
1645 .fxsr,
1646 .fast15bytenop,
1647 .fast_scalar_shift_masks,
1648 .fast_vector_shift_masks,
1649 .sahf,
1650 .lzcnt,
1651 .mmx,
1652 .nopl,
1653 .popcnt,
1654 .prfchw,
1655 .sse,
1656 .sse4a,
1657 .ssse3,
1658 .slow_shld,
1659 .x87,
1660 }),
1661 };
1662
1663 pub const btver2 = Cpu{
1664 .name = "btver2",
1665 .llvm_name = "btver2",
1666 .dependencies = featureSet(&[_]Feature{
1667 .bit64,
1668 .sse,
1669 .aes,
1670 .avx,
1671 .bmi,
1672 .cmov,
1673 .cx8,
1674 .cx16,
1675 .f16c,
1676 .fxsr,
1677 .fast15bytenop,
1678 .fast_bextr,
1679 .fast_hops,
1680 .fast_lzcnt,
1681 .fast_partial_ymm_or_zmm_write,
1682 .fast_scalar_shift_masks,
1683 .fast_vector_shift_masks,
1684 .sahf,
1685 .lzcnt,
1686 .mmx,
1687 .movbe,
1688 .nopl,
1689 .pclmul,
1690 .popcnt,
1691 .prfchw,
1692 .sse4a,
1693 .ssse3,
1694 .slow_shld,
1695 .x87,
1696 .xsave,
1697 .xsaveopt,
1698 }),
1699 };
1700
1701 pub const c3 = Cpu{
1702 .name = "c3",
1703 .llvm_name = "c3",
1704 .dependencies = featureSet(&[_]Feature{
1705 .mmx,
1706 .dnow3,
1707 .slow_unaligned_mem_16,
1708 .x87,
1709 }),
1710 };
1711
1712 pub const c32 = Cpu{
1713 .name = "c3_2",
1714 .llvm_name = "c3-2",
1715 .dependencies = featureSet(&[_]Feature{
1716 .cmov,
1717 .cx8,
1718 .fxsr,
1719 .mmx,
1720 .sse,
1721 .slow_unaligned_mem_16,
1722 .x87,
1723 }),
1724 };
1725
1726 pub const cannonlake = Cpu{
1727 .name = "cannonlake",
1728 .llvm_name = "cannonlake",
1729 .dependencies = featureSet(&[_]Feature{
1730 .bit64,
1731 .adx,
1732 .sse,
1733 .aes,
1734 .avx,
1735 .avx2,
1736 .avx512f,
1737 .bmi,
1738 .bmi2,
1739 .avx512bw,
1740 .avx512cd,
1741 .clflushopt,
1742 .cmov,
1743 .cx8,
1744 .cx16,
1745 .avx512dq,
1746 .ermsb,
1747 .f16c,
1748 .fma,
1749 .fsgsbase,
1750 .fxsr,
1751 .fast_shld_rotate,
1752 .fast_scalar_fsqrt,
1753 .fast_variable_shuffle,
1754 .fast_vector_fsqrt,
1755 .fast_gather,
1756 .avx512ifma,
1757 .invpcid,
1758 .sahf,
1759 .lzcnt,
1760 .mmx,
1761 .movbe,
1762 .mpx,
1763 .macrofusion,
1764 .merge_to_threeway_branch,
1765 .nopl,
1766 .pclmul,
1767 .pku,
1768 .popcnt,
1769 .prfchw,
1770 .rdrnd,
1771 .rdseed,
1772 .sgx,
1773 .sha,
1774 .sse42,
1775 .slow_3ops_lea,
1776 .idivq_to_divl,
1777 .avx512vbmi,
1778 .avx512vl,
1779 .x87,
1780 .xsave,
1781 .xsavec,
1782 .xsaveopt,
1783 .xsaves,
1784 }),
1785 };
1786
1787 pub const cascadelake = Cpu{
1788 .name = "cascadelake",
1789 .llvm_name = "cascadelake",
1790 .dependencies = featureSet(&[_]Feature{
1791 .bit64,
1792 .adx,
1793 .sse,
1794 .aes,
1795 .avx,
1796 .avx2,
1797 .avx512f,
1798 .bmi,
1799 .bmi2,
1800 .avx512bw,
1801 .avx512cd,
1802 .clflushopt,
1803 .clwb,
1804 .cmov,
1805 .cx8,
1806 .cx16,
1807 .avx512dq,
1808 .ermsb,
1809 .f16c,
1810 .fma,
1811 .fsgsbase,
1812 .fxsr,
1813 .fast_shld_rotate,
1814 .fast_scalar_fsqrt,
1815 .fast_variable_shuffle,
1816 .fast_vector_fsqrt,
1817 .fast_gather,
1818 .invpcid,
1819 .sahf,
1820 .lzcnt,
1821 .mmx,
1822 .movbe,
1823 .mpx,
1824 .macrofusion,
1825 .merge_to_threeway_branch,
1826 .nopl,
1827 .pclmul,
1828 .pku,
1829 .popcnt,
1830 .false_deps_popcnt,
1831 .prfchw,
1832 .rdrnd,
1833 .rdseed,
1834 .sse42,
1835 .slow_3ops_lea,
1836 .idivq_to_divl,
1837 .avx512vl,
1838 .avx512vnni,
1839 .x87,
1840 .xsave,
1841 .xsavec,
1842 .xsaveopt,
1843 .xsaves,
1844 }),
1845 };
1846
1847 pub const cooperlake = Cpu{
1848 .name = "cooperlake",
1849 .llvm_name = "cooperlake",
1850 .dependencies = featureSet(&[_]Feature{
1851 .bit64,
1852 .adx,
1853 .sse,
1854 .aes,
1855 .avx,
1856 .avx2,
1857 .avx512f,
1858 .avx512bf16,
1859 .bmi,
1860 .bmi2,
1861 .avx512bw,
1862 .avx512cd,
1863 .clflushopt,
1864 .clwb,
1865 .cmov,
1866 .cx8,
1867 .cx16,
1868 .avx512dq,
1869 .ermsb,
1870 .f16c,
1871 .fma,
1872 .fsgsbase,
1873 .fxsr,
1874 .fast_shld_rotate,
1875 .fast_scalar_fsqrt,
1876 .fast_variable_shuffle,
1877 .fast_vector_fsqrt,
1878 .fast_gather,
1879 .invpcid,
1880 .sahf,
1881 .lzcnt,
1882 .mmx,
1883 .movbe,
1884 .mpx,
1885 .macrofusion,
1886 .merge_to_threeway_branch,
1887 .nopl,
1888 .pclmul,
1889 .pku,
1890 .popcnt,
1891 .false_deps_popcnt,
1892 .prfchw,
1893 .rdrnd,
1894 .rdseed,
1895 .sse42,
1896 .slow_3ops_lea,
1897 .idivq_to_divl,
1898 .avx512vl,
1899 .avx512vnni,
1900 .x87,
1901 .xsave,
1902 .xsavec,
1903 .xsaveopt,
1904 .xsaves,
1905 }),
1906 };
1907
1908 pub const core_avx_i = Cpu{
1909 .name = "core_avx_i",
1910 .llvm_name = "core-avx-i",
1911 .dependencies = featureSet(&[_]Feature{
1912 .bit64,
1913 .sse,
1914 .avx,
1915 .cmov,
1916 .cx8,
1917 .cx16,
1918 .f16c,
1919 .fsgsbase,
1920 .fxsr,
1921 .fast_shld_rotate,
1922 .fast_scalar_fsqrt,
1923 .sahf,
1924 .mmx,
1925 .macrofusion,
1926 .merge_to_threeway_branch,
1927 .nopl,
1928 .pclmul,
1929 .popcnt,
1930 .false_deps_popcnt,
1931 .rdrnd,
1932 .sse42,
1933 .slow_3ops_lea,
1934 .idivq_to_divl,
1935 .slow_unaligned_mem_32,
1936 .x87,
1937 .xsave,
1938 .xsaveopt,
1939 }),
1940 };
1941
1942 pub const core_avx2 = Cpu{
1943 .name = "core_avx2",
1944 .llvm_name = "core-avx2",
1945 .dependencies = featureSet(&[_]Feature{
1946 .bit64,
1947 .sse,
1948 .avx,
1949 .avx2,
1950 .bmi,
1951 .bmi2,
1952 .cmov,
1953 .cx8,
1954 .cx16,
1955 .ermsb,
1956 .f16c,
1957 .fma,
1958 .fsgsbase,
1959 .fxsr,
1960 .fast_shld_rotate,
1961 .fast_scalar_fsqrt,
1962 .fast_variable_shuffle,
1963 .invpcid,
1964 .sahf,
1965 .lzcnt,
1966 .false_deps_lzcnt_tzcnt,
1967 .mmx,
1968 .movbe,
1969 .macrofusion,
1970 .merge_to_threeway_branch,
1971 .nopl,
1972 .pclmul,
1973 .popcnt,
1974 .false_deps_popcnt,
1975 .rdrnd,
1976 .sse42,
1977 .slow_3ops_lea,
1978 .idivq_to_divl,
1979 .x87,
1980 .xsave,
1981 .xsaveopt,
1982 }),
1983 };
1984
1985 pub const core2 = Cpu{
1986 .name = "core2",
1987 .llvm_name = "core2",
1988 .dependencies = featureSet(&[_]Feature{
1989 .bit64,
1990 .cmov,
1991 .cx8,
1992 .cx16,
1993 .fxsr,
1994 .sahf,
1995 .mmx,
1996 .macrofusion,
1997 .nopl,
1998 .sse,
1999 .ssse3,
2000 .slow_unaligned_mem_16,
2001 .x87,
2002 }),
2003 };
2004
2005 pub const corei7 = Cpu{
2006 .name = "corei7",
2007 .llvm_name = "corei7",
2008 .dependencies = featureSet(&[_]Feature{
2009 .bit64,
2010 .cmov,
2011 .cx8,
2012 .cx16,
2013 .fxsr,
2014 .sahf,
2015 .mmx,
2016 .macrofusion,
2017 .nopl,
2018 .popcnt,
2019 .sse,
2020 .sse42,
2021 .x87,
2022 }),
2023 };
2024
2025 pub const corei7_avx = Cpu{
2026 .name = "corei7_avx",
2027 .llvm_name = "corei7-avx",
2028 .dependencies = featureSet(&[_]Feature{
2029 .bit64,
2030 .sse,
2031 .avx,
2032 .cmov,
2033 .cx8,
2034 .cx16,
2035 .fxsr,
2036 .fast_shld_rotate,
2037 .fast_scalar_fsqrt,
2038 .sahf,
2039 .mmx,
2040 .macrofusion,
2041 .merge_to_threeway_branch,
2042 .nopl,
2043 .pclmul,
2044 .popcnt,
2045 .false_deps_popcnt,
2046 .sse42,
2047 .slow_3ops_lea,
2048 .idivq_to_divl,
2049 .slow_unaligned_mem_32,
2050 .x87,
2051 .xsave,
2052 .xsaveopt,
2053 }),
2054 };
2055
2056 pub const generic = Cpu{
2057 .name = "generic",
2058 .llvm_name = "generic",
2059 .dependencies = featureSet(&[_]Feature{
2060 .cx8,
2061 .slow_unaligned_mem_16,
2062 .x87,
2063 }),
2064 };
2065
2066 pub const geode = Cpu{
2067 .name = "geode",
2068 .llvm_name = "geode",
2069 .dependencies = featureSet(&[_]Feature{
2070 .mmx,
2071 .dnowa3,
2072 .cx8,
2073 .slow_unaligned_mem_16,
2074 .x87,
2075 }),
2076 };
2077
2078 pub const goldmont = Cpu{
2079 .name = "goldmont",
2080 .llvm_name = "goldmont",
2081 .dependencies = featureSet(&[_]Feature{
2082 .bit64,
2083 .sse,
2084 .aes,
2085 .clflushopt,
2086 .cmov,
2087 .cx8,
2088 .cx16,
2089 .fsgsbase,
2090 .fxsr,
2091 .sahf,
2092 .mmx,
2093 .movbe,
2094 .mpx,
2095 .nopl,
2096 .pclmul,
2097 .popcnt,
2098 .false_deps_popcnt,
2099 .prfchw,
2100 .rdrnd,
2101 .rdseed,
2102 .sha,
2103 .sse42,
2104 .ssse3,
2105 .slow_incdec,
2106 .slowLea,
2107 .slow_two_mem_ops,
2108 .x87,
2109 .xsave,
2110 .xsavec,
2111 .xsaveopt,
2112 .xsaves,
2113 }),
2114 };
2115
2116 pub const goldmont_plus = Cpu{
2117 .name = "goldmont_plus",
2118 .llvm_name = "goldmont-plus",
2119 .dependencies = featureSet(&[_]Feature{
2120 .bit64,
2121 .sse,
2122 .aes,
2123 .clflushopt,
2124 .cmov,
2125 .cx8,
2126 .cx16,
2127 .fsgsbase,
2128 .fxsr,
2129 .sahf,
2130 .mmx,
2131 .movbe,
2132 .mpx,
2133 .nopl,
2134 .pclmul,
2135 .popcnt,
2136 .prfchw,
2137 .ptwrite,
2138 .rdpid,
2139 .rdrnd,
2140 .rdseed,
2141 .sgx,
2142 .sha,
2143 .sse42,
2144 .ssse3,
2145 .slow_incdec,
2146 .slowLea,
2147 .slow_two_mem_ops,
2148 .x87,
2149 .xsave,
2150 .xsavec,
2151 .xsaveopt,
2152 .xsaves,
2153 }),
2154 };
2155
2156 pub const haswell = Cpu{
2157 .name = "haswell",
2158 .llvm_name = "haswell",
2159 .dependencies = featureSet(&[_]Feature{
2160 .bit64,
2161 .sse,
2162 .avx,
2163 .avx2,
2164 .bmi,
2165 .bmi2,
2166 .cmov,
2167 .cx8,
2168 .cx16,
2169 .ermsb,
2170 .f16c,
2171 .fma,
2172 .fsgsbase,
2173 .fxsr,
2174 .fast_shld_rotate,
2175 .fast_scalar_fsqrt,
2176 .fast_variable_shuffle,
2177 .invpcid,
2178 .sahf,
2179 .lzcnt,
2180 .false_deps_lzcnt_tzcnt,
2181 .mmx,
2182 .movbe,
2183 .macrofusion,
2184 .merge_to_threeway_branch,
2185 .nopl,
2186 .pclmul,
2187 .popcnt,
2188 .false_deps_popcnt,
2189 .rdrnd,
2190 .sse42,
2191 .slow_3ops_lea,
2192 .idivq_to_divl,
2193 .x87,
2194 .xsave,
2195 .xsaveopt,
2196 }),
2197 };
2198
2199 pub const i386 = Cpu{
2200 .name = "i386",
2201 .llvm_name = "i386",
2202 .dependencies = featureSet(&[_]Feature{
2203 .slow_unaligned_mem_16,
2204 .x87,
2205 }),
2206 };
2207
2208 pub const i486 = Cpu{
2209 .name = "i486",
2210 .llvm_name = "i486",
2211 .dependencies = featureSet(&[_]Feature{
2212 .slow_unaligned_mem_16,
2213 .x87,
2214 }),
2215 };
2216
2217 pub const i586 = Cpu{
2218 .name = "i586",
2219 .llvm_name = "i586",
2220 .dependencies = featureSet(&[_]Feature{
2221 .cx8,
2222 .slow_unaligned_mem_16,
2223 .x87,
2224 }),
2225 };
2226
2227 pub const i686 = Cpu{
2228 .name = "i686",
2229 .llvm_name = "i686",
2230 .dependencies = featureSet(&[_]Feature{
2231 .cmov,
2232 .cx8,
2233 .slow_unaligned_mem_16,
2234 .x87,
2235 }),
2236 };
2237
2238 pub const icelake_client = Cpu{
2239 .name = "icelake_client",
2240 .llvm_name = "icelake-client",
2241 .dependencies = featureSet(&[_]Feature{
2242 .bit64,
2243 .adx,
2244 .sse,
2245 .aes,
2246 .avx,
2247 .avx2,
2248 .avx512f,
2249 .avx512bitalg,
2250 .bmi,
2251 .bmi2,
2252 .avx512bw,
2253 .avx512cd,
2254 .clflushopt,
2255 .clwb,
2256 .cmov,
2257 .cx8,
2258 .cx16,
2259 .avx512dq,
2260 .ermsb,
2261 .f16c,
2262 .fma,
2263 .fsgsbase,
2264 .fxsr,
2265 .fast_shld_rotate,
2266 .fast_scalar_fsqrt,
2267 .fast_variable_shuffle,
2268 .fast_vector_fsqrt,
2269 .gfni,
2270 .fast_gather,
2271 .avx512ifma,
2272 .invpcid,
2273 .sahf,
2274 .lzcnt,
2275 .mmx,
2276 .movbe,
2277 .mpx,
2278 .macrofusion,
2279 .merge_to_threeway_branch,
2280 .nopl,
2281 .pclmul,
2282 .pku,
2283 .popcnt,
2284 .prfchw,
2285 .rdpid,
2286 .rdrnd,
2287 .rdseed,
2288 .sgx,
2289 .sha,
2290 .sse42,
2291 .slow_3ops_lea,
2292 .idivq_to_divl,
2293 .vaes,
2294 .avx512vbmi,
2295 .avx512vbmi2,
2296 .avx512vl,
2297 .avx512vnni,
2298 .vpclmulqdq,
2299 .avx512vpopcntdq,
2300 .x87,
2301 .xsave,
2302 .xsavec,
2303 .xsaveopt,
2304 .xsaves,
2305 }),
2306 };
2307
2308 pub const icelake_server = Cpu{
2309 .name = "icelake_server",
2310 .llvm_name = "icelake-server",
2311 .dependencies = featureSet(&[_]Feature{
2312 .bit64,
2313 .adx,
2314 .sse,
2315 .aes,
2316 .avx,
2317 .avx2,
2318 .avx512f,
2319 .avx512bitalg,
2320 .bmi,
2321 .bmi2,
2322 .avx512bw,
2323 .avx512cd,
2324 .clflushopt,
2325 .clwb,
2326 .cmov,
2327 .cx8,
2328 .cx16,
2329 .avx512dq,
2330 .ermsb,
2331 .f16c,
2332 .fma,
2333 .fsgsbase,
2334 .fxsr,
2335 .fast_shld_rotate,
2336 .fast_scalar_fsqrt,
2337 .fast_variable_shuffle,
2338 .fast_vector_fsqrt,
2339 .gfni,
2340 .fast_gather,
2341 .avx512ifma,
2342 .invpcid,
2343 .sahf,
2344 .lzcnt,
2345 .mmx,
2346 .movbe,
2347 .mpx,
2348 .macrofusion,
2349 .merge_to_threeway_branch,
2350 .nopl,
2351 .pclmul,
2352 .pconfig,
2353 .pku,
2354 .popcnt,
2355 .prfchw,
2356 .rdpid,
2357 .rdrnd,
2358 .rdseed,
2359 .sgx,
2360 .sha,
2361 .sse42,
2362 .slow_3ops_lea,
2363 .idivq_to_divl,
2364 .vaes,
2365 .avx512vbmi,
2366 .avx512vbmi2,
2367 .avx512vl,
2368 .avx512vnni,
2369 .vpclmulqdq,
2370 .avx512vpopcntdq,
2371 .wbnoinvd,
2372 .x87,
2373 .xsave,
2374 .xsavec,
2375 .xsaveopt,
2376 .xsaves,
2377 }),
2378 };
2379
2380 pub const ivybridge = Cpu{
2381 .name = "ivybridge",
2382 .llvm_name = "ivybridge",
2383 .dependencies = featureSet(&[_]Feature{
2384 .bit64,
2385 .sse,
2386 .avx,
2387 .cmov,
2388 .cx8,
2389 .cx16,
2390 .f16c,
2391 .fsgsbase,
2392 .fxsr,
2393 .fast_shld_rotate,
2394 .fast_scalar_fsqrt,
2395 .sahf,
2396 .mmx,
2397 .macrofusion,
2398 .merge_to_threeway_branch,
2399 .nopl,
2400 .pclmul,
2401 .popcnt,
2402 .false_deps_popcnt,
2403 .rdrnd,
2404 .sse42,
2405 .slow_3ops_lea,
2406 .idivq_to_divl,
2407 .slow_unaligned_mem_32,
2408 .x87,
2409 .xsave,
2410 .xsaveopt,
2411 }),
2412 };
2413
2414 pub const k6 = Cpu{
2415 .name = "k6",
2416 .llvm_name = "k6",
2417 .dependencies = featureSet(&[_]Feature{
2418 .cx8,
2419 .mmx,
2420 .slow_unaligned_mem_16,
2421 .x87,
2422 }),
2423 };
2424
2425 pub const k62 = Cpu{
2426 .name = "k6_2",
2427 .llvm_name = "k6-2",
2428 .dependencies = featureSet(&[_]Feature{
2429 .mmx,
2430 .dnow3,
2431 .cx8,
2432 .slow_unaligned_mem_16,
2433 .x87,
2434 }),
2435 };
2436
2437 pub const k63 = Cpu{
2438 .name = "k6_3",
2439 .llvm_name = "k6-3",
2440 .dependencies = featureSet(&[_]Feature{
2441 .mmx,
2442 .dnow3,
2443 .cx8,
2444 .slow_unaligned_mem_16,
2445 .x87,
2446 }),
2447 };
2448
2449 pub const k8 = Cpu{
2450 .name = "k8",
2451 .llvm_name = "k8",
2452 .dependencies = featureSet(&[_]Feature{
2453 .mmx,
2454 .dnowa3,
2455 .bit64,
2456 .cmov,
2457 .cx8,
2458 .fxsr,
2459 .fast_scalar_shift_masks,
2460 .nopl,
2461 .sse,
2462 .sse2,
2463 .slow_shld,
2464 .slow_unaligned_mem_16,
2465 .x87,
2466 }),
2467 };
2468
2469 pub const k8_sse3 = Cpu{
2470 .name = "k8_sse3",
2471 .llvm_name = "k8-sse3",
2472 .dependencies = featureSet(&[_]Feature{
2473 .mmx,
2474 .dnowa3,
2475 .bit64,
2476 .cmov,
2477 .cx8,
2478 .cx16,
2479 .fxsr,
2480 .fast_scalar_shift_masks,
2481 .nopl,
2482 .sse,
2483 .sse3,
2484 .slow_shld,
2485 .slow_unaligned_mem_16,
2486 .x87,
2487 }),
2488 };
2489
2490 pub const knl = Cpu{
2491 .name = "knl",
2492 .llvm_name = "knl",
2493 .dependencies = featureSet(&[_]Feature{
2494 .bit64,
2495 .adx,
2496 .sse,
2497 .aes,
2498 .avx512f,
2499 .bmi,
2500 .bmi2,
2501 .avx512cd,
2502 .cmov,
2503 .cx8,
2504 .cx16,
2505 .avx512er,
2506 .f16c,
2507 .fma,
2508 .fsgsbase,
2509 .fxsr,
2510 .fast_partial_ymm_or_zmm_write,
2511 .fast_gather,
2512 .sahf,
2513 .lzcnt,
2514 .mmx,
2515 .movbe,
2516 .nopl,
2517 .pclmul,
2518 .avx512pf,
2519 .popcnt,
2520 .prefetchwt1,
2521 .prfchw,
2522 .rdrnd,
2523 .rdseed,
2524 .slow_3ops_lea,
2525 .idivq_to_divl,
2526 .slow_incdec,
2527 .slow_pmaddwd,
2528 .slow_two_mem_ops,
2529 .x87,
2530 .xsave,
2531 .xsaveopt,
2532 }),
2533 };
2534
2535 pub const knm = Cpu{
2536 .name = "knm",
2537 .llvm_name = "knm",
2538 .dependencies = featureSet(&[_]Feature{
2539 .bit64,
2540 .adx,
2541 .sse,
2542 .aes,
2543 .avx512f,
2544 .bmi,
2545 .bmi2,
2546 .avx512cd,
2547 .cmov,
2548 .cx8,
2549 .cx16,
2550 .avx512er,
2551 .f16c,
2552 .fma,
2553 .fsgsbase,
2554 .fxsr,
2555 .fast_partial_ymm_or_zmm_write,
2556 .fast_gather,
2557 .sahf,
2558 .lzcnt,
2559 .mmx,
2560 .movbe,
2561 .nopl,
2562 .pclmul,
2563 .avx512pf,
2564 .popcnt,
2565 .prefetchwt1,
2566 .prfchw,
2567 .rdrnd,
2568 .rdseed,
2569 .slow_3ops_lea,
2570 .idivq_to_divl,
2571 .slow_incdec,
2572 .slow_pmaddwd,
2573 .slow_two_mem_ops,
2574 .avx512vpopcntdq,
2575 .x87,
2576 .xsave,
2577 .xsaveopt,
2578 }),
2579 };
2580
2581 pub const lakemont = Cpu{
2582 .name = "lakemont",
2583 .llvm_name = "lakemont",
2584 .dependencies = 0,
2585 };
2586
2587 pub const nehalem = Cpu{
2588 .name = "nehalem",
2589 .llvm_name = "nehalem",
2590 .dependencies = featureSet(&[_]Feature{
2591 .bit64,
2592 .cmov,
2593 .cx8,
2594 .cx16,
2595 .fxsr,
2596 .sahf,
2597 .mmx,
2598 .macrofusion,
2599 .nopl,
2600 .popcnt,
2601 .sse,
2602 .sse42,
2603 .x87,
2604 }),
2605 };
2606
2607 pub const nocona = Cpu{
2608 .name = "nocona",
2609 .llvm_name = "nocona",
2610 .dependencies = featureSet(&[_]Feature{
2611 .bit64,
2612 .cmov,
2613 .cx8,
2614 .cx16,
2615 .fxsr,
2616 .mmx,
2617 .nopl,
2618 .sse,
2619 .sse3,
2620 .slow_unaligned_mem_16,
2621 .x87,
2622 }),
2623 };
2624
2625 pub const opteron = Cpu{
2626 .name = "opteron",
2627 .llvm_name = "opteron",
2628 .dependencies = featureSet(&[_]Feature{
2629 .mmx,
2630 .dnowa3,
2631 .bit64,
2632 .cmov,
2633 .cx8,
2634 .fxsr,
2635 .fast_scalar_shift_masks,
2636 .nopl,
2637 .sse,
2638 .sse2,
2639 .slow_shld,
2640 .slow_unaligned_mem_16,
2641 .x87,
2642 }),
2643 };
2644
2645 pub const opteron_sse3 = Cpu{
2646 .name = "opteron_sse3",
2647 .llvm_name = "opteron-sse3",
2648 .dependencies = featureSet(&[_]Feature{
2649 .mmx,
2650 .dnowa3,
2651 .bit64,
2652 .cmov,
2653 .cx8,
2654 .cx16,
2655 .fxsr,
2656 .fast_scalar_shift_masks,
2657 .nopl,
2658 .sse,
2659 .sse3,
2660 .slow_shld,
2661 .slow_unaligned_mem_16,
2662 .x87,
2663 }),
2664 };
2665
2666 pub const penryn = Cpu{
2667 .name = "penryn",
2668 .llvm_name = "penryn",
2669 .dependencies = featureSet(&[_]Feature{
2670 .bit64,
2671 .cmov,
2672 .cx8,
2673 .cx16,
2674 .fxsr,
2675 .sahf,
2676 .mmx,
2677 .macrofusion,
2678 .nopl,
2679 .sse,
2680 .sse41,
2681 .slow_unaligned_mem_16,
2682 .x87,
2683 }),
2684 };
2685
2686 pub const pentium = Cpu{
2687 .name = "pentium",
2688 .llvm_name = "pentium",
2689 .dependencies = featureSet(&[_]Feature{
2690 .cx8,
2691 .slow_unaligned_mem_16,
2692 .x87,
2693 }),
2694 };
2695
2696 pub const pentium_m = Cpu{
2697 .name = "pentium_m",
2698 .llvm_name = "pentium-m",
2699 .dependencies = featureSet(&[_]Feature{
2700 .cmov,
2701 .cx8,
2702 .fxsr,
2703 .mmx,
2704 .nopl,
2705 .sse,
2706 .sse2,
2707 .slow_unaligned_mem_16,
2708 .x87,
2709 }),
2710 };
2711
2712 pub const pentium_mmx = Cpu{
2713 .name = "pentium_mmx",
2714 .llvm_name = "pentium-mmx",
2715 .dependencies = featureSet(&[_]Feature{
2716 .cx8,
2717 .mmx,
2718 .slow_unaligned_mem_16,
2719 .x87,
2720 }),
2721 };
2722
2723 pub const pentium2 = Cpu{
2724 .name = "pentium2",
2725 .llvm_name = "pentium2",
2726 .dependencies = featureSet(&[_]Feature{
2727 .cmov,
2728 .cx8,
2729 .fxsr,
2730 .mmx,
2731 .nopl,
2732 .slow_unaligned_mem_16,
2733 .x87,
2734 }),
2735 };
2736
2737 pub const pentium3 = Cpu{
2738 .name = "pentium3",
2739 .llvm_name = "pentium3",
2740 .dependencies = featureSet(&[_]Feature{
2741 .cmov,
2742 .cx8,
2743 .fxsr,
2744 .mmx,
2745 .nopl,
2746 .sse,
2747 .slow_unaligned_mem_16,
2748 .x87,
2749 }),
2750 };
2751
2752 pub const pentium3m = Cpu{
2753 .name = "pentium3m",
2754 .llvm_name = "pentium3m",
2755 .dependencies = featureSet(&[_]Feature{
2756 .cmov,
2757 .cx8,
2758 .fxsr,
2759 .mmx,
2760 .nopl,
2761 .sse,
2762 .slow_unaligned_mem_16,
2763 .x87,
2764 }),
2765 };
2766
2767 pub const pentium4 = Cpu{
2768 .name = "pentium4",
2769 .llvm_name = "pentium4",
2770 .dependencies = featureSet(&[_]Feature{
2771 .cmov,
2772 .cx8,
2773 .fxsr,
2774 .mmx,
2775 .nopl,
2776 .sse,
2777 .sse2,
2778 .slow_unaligned_mem_16,
2779 .x87,
2780 }),
2781 };
2782
2783 pub const pentium4m = Cpu{
2784 .name = "pentium4m",
2785 .llvm_name = "pentium4m",
2786 .dependencies = featureSet(&[_]Feature{
2787 .cmov,
2788 .cx8,
2789 .fxsr,
2790 .mmx,
2791 .nopl,
2792 .sse,
2793 .sse2,
2794 .slow_unaligned_mem_16,
2795 .x87,
2796 }),
2797 };
2798
2799 pub const pentiumpro = Cpu{
2800 .name = "pentiumpro",
2801 .llvm_name = "pentiumpro",
2802 .dependencies = featureSet(&[_]Feature{
2803 .cmov,
2804 .cx8,
2805 .nopl,
2806 .slow_unaligned_mem_16,
2807 .x87,
2808 }),
2809 };
2810
2811 pub const prescott = Cpu{
2812 .name = "prescott",
2813 .llvm_name = "prescott",
2814 .dependencies = featureSet(&[_]Feature{
2815 .cmov,
2816 .cx8,
2817 .fxsr,
2818 .mmx,
2819 .nopl,
2820 .sse,
2821 .sse3,
2822 .slow_unaligned_mem_16,
2823 .x87,
2824 }),
2825 };
2826
2827 pub const sandybridge = Cpu{
2828 .name = "sandybridge",
2829 .llvm_name = "sandybridge",
2830 .dependencies = featureSet(&[_]Feature{
2831 .bit64,
2832 .sse,
2833 .avx,
2834 .cmov,
2835 .cx8,
2836 .cx16,
2837 .fxsr,
2838 .fast_shld_rotate,
2839 .fast_scalar_fsqrt,
2840 .sahf,
2841 .mmx,
2842 .macrofusion,
2843 .merge_to_threeway_branch,
2844 .nopl,
2845 .pclmul,
2846 .popcnt,
2847 .false_deps_popcnt,
2848 .sse42,
2849 .slow_3ops_lea,
2850 .idivq_to_divl,
2851 .slow_unaligned_mem_32,
2852 .x87,
2853 .xsave,
2854 .xsaveopt,
2855 }),
2856 };
2857
2858 pub const silvermont = Cpu{
2859 .name = "silvermont",
2860 .llvm_name = "silvermont",
2861 .dependencies = featureSet(&[_]Feature{
2862 .bit64,
2863 .cmov,
2864 .cx8,
2865 .cx16,
2866 .fxsr,
2867 .sahf,
2868 .mmx,
2869 .movbe,
2870 .nopl,
2871 .sse,
2872 .pclmul,
2873 .popcnt,
2874 .false_deps_popcnt,
2875 .prfchw,
2876 .rdrnd,
2877 .sse42,
2878 .ssse3,
2879 .idivq_to_divl,
2880 .slow_incdec,
2881 .slowLea,
2882 .slowPmulld,
2883 .slow_two_mem_ops,
2884 .x87,
2885 }),
2886 };
2887
2888 pub const skx = Cpu{
2889 .name = "skx",
2890 .llvm_name = "skx",
2891 .dependencies = featureSet(&[_]Feature{
2892 .bit64,
2893 .adx,
2894 .sse,
2895 .aes,
2896 .avx,
2897 .avx2,
2898 .avx512f,
2899 .bmi,
2900 .bmi2,
2901 .avx512bw,
2902 .avx512cd,
2903 .clflushopt,
2904 .clwb,
2905 .cmov,
2906 .cx8,
2907 .cx16,
2908 .avx512dq,
2909 .ermsb,
2910 .f16c,
2911 .fma,
2912 .fsgsbase,
2913 .fxsr,
2914 .fast_shld_rotate,
2915 .fast_scalar_fsqrt,
2916 .fast_variable_shuffle,
2917 .fast_vector_fsqrt,
2918 .fast_gather,
2919 .invpcid,
2920 .sahf,
2921 .lzcnt,
2922 .mmx,
2923 .movbe,
2924 .mpx,
2925 .macrofusion,
2926 .merge_to_threeway_branch,
2927 .nopl,
2928 .pclmul,
2929 .pku,
2930 .popcnt,
2931 .false_deps_popcnt,
2932 .prfchw,
2933 .rdrnd,
2934 .rdseed,
2935 .sse42,
2936 .slow_3ops_lea,
2937 .idivq_to_divl,
2938 .avx512vl,
2939 .x87,
2940 .xsave,
2941 .xsavec,
2942 .xsaveopt,
2943 .xsaves,
2944 }),
2945 };
2946
2947 pub const skylake = Cpu{
2948 .name = "skylake",
2949 .llvm_name = "skylake",
2950 .dependencies = featureSet(&[_]Feature{
2951 .bit64,
2952 .adx,
2953 .sse,
2954 .aes,
2955 .avx,
2956 .avx2,
2957 .bmi,
2958 .bmi2,
2959 .clflushopt,
2960 .cmov,
2961 .cx8,
2962 .cx16,
2963 .ermsb,
2964 .f16c,
2965 .fma,
2966 .fsgsbase,
2967 .fxsr,
2968 .fast_shld_rotate,
2969 .fast_scalar_fsqrt,
2970 .fast_variable_shuffle,
2971 .fast_vector_fsqrt,
2972 .fast_gather,
2973 .invpcid,
2974 .sahf,
2975 .lzcnt,
2976 .mmx,
2977 .movbe,
2978 .mpx,
2979 .macrofusion,
2980 .merge_to_threeway_branch,
2981 .nopl,
2982 .pclmul,
2983 .popcnt,
2984 .false_deps_popcnt,
2985 .prfchw,
2986 .rdrnd,
2987 .rdseed,
2988 .sgx,
2989 .sse42,
2990 .slow_3ops_lea,
2991 .idivq_to_divl,
2992 .x87,
2993 .xsave,
2994 .xsavec,
2995 .xsaveopt,
2996 .xsaves,
2997 }),
2998 };
2999
3000 pub const skylake_avx512 = Cpu{
3001 .name = "skylake_avx512",
3002 .llvm_name = "skylake-avx512",
3003 .dependencies = featureSet(&[_]Feature{
3004 .bit64,
3005 .adx,
3006 .sse,
3007 .aes,
3008 .avx,
3009 .avx2,
3010 .avx512f,
3011 .bmi,
3012 .bmi2,
3013 .avx512bw,
3014 .avx512cd,
3015 .clflushopt,
3016 .clwb,
3017 .cmov,
3018 .cx8,
3019 .cx16,
3020 .avx512dq,
3021 .ermsb,
3022 .f16c,
3023 .fma,
3024 .fsgsbase,
3025 .fxsr,
3026 .fast_shld_rotate,
3027 .fast_scalar_fsqrt,
3028 .fast_variable_shuffle,
3029 .fast_vector_fsqrt,
3030 .fast_gather,
3031 .invpcid,
3032 .sahf,
3033 .lzcnt,
3034 .mmx,
3035 .movbe,
3036 .mpx,
3037 .macrofusion,
3038 .merge_to_threeway_branch,
3039 .nopl,
3040 .pclmul,
3041 .pku,
3042 .popcnt,
3043 .false_deps_popcnt,
3044 .prfchw,
3045 .rdrnd,
3046 .rdseed,
3047 .sse42,
3048 .slow_3ops_lea,
3049 .idivq_to_divl,
3050 .avx512vl,
3051 .x87,
3052 .xsave,
3053 .xsavec,
3054 .xsaveopt,
3055 .xsaves,
3056 }),
3057 };
3058
3059 pub const slm = Cpu{
3060 .name = "slm",
3061 .llvm_name = "slm",
3062 .dependencies = featureSet(&[_]Feature{
3063 .bit64,
3064 .cmov,
3065 .cx8,
3066 .cx16,
3067 .fxsr,
3068 .sahf,
3069 .mmx,
3070 .movbe,
3071 .nopl,
3072 .sse,
3073 .pclmul,
3074 .popcnt,
3075 .false_deps_popcnt,
3076 .prfchw,
3077 .rdrnd,
3078 .sse42,
3079 .ssse3,
3080 .idivq_to_divl,
3081 .slow_incdec,
3082 .slowLea,
3083 .slowPmulld,
3084 .slow_two_mem_ops,
3085 .x87,
3086 }),
3087 };
3088
3089 pub const tremont = Cpu{
3090 .name = "tremont",
3091 .llvm_name = "tremont",
3092 .dependencies = featureSet(&[_]Feature{
3093 .bit64,
3094 .sse,
3095 .aes,
3096 .cldemote,
3097 .clflushopt,
3098 .cmov,
3099 .cx8,
3100 .cx16,
3101 .fsgsbase,
3102 .fxsr,
3103 .gfni,
3104 .sahf,
3105 .mmx,
3106 .movbe,
3107 .movdir64b,
3108 .movdiri,
3109 .mpx,
3110 .nopl,
3111 .pclmul,
3112 .popcnt,
3113 .prfchw,
3114 .ptwrite,
3115 .rdpid,
3116 .rdrnd,
3117 .rdseed,
3118 .sgx,
3119 .sha,
3120 .sse42,
3121 .ssse3,
3122 .slow_incdec,
3123 .slowLea,
3124 .slow_two_mem_ops,
3125 .waitpkg,
3126 .x87,
3127 .xsave,
3128 .xsavec,
3129 .xsaveopt,
3130 .xsaves,
3131 }),
3132 };
3133
3134 pub const westmere = Cpu{
3135 .name = "westmere",
3136 .llvm_name = "westmere",
3137 .dependencies = featureSet(&[_]Feature{
3138 .bit64,
3139 .cmov,
3140 .cx8,
3141 .cx16,
3142 .fxsr,
3143 .sahf,
3144 .mmx,
3145 .macrofusion,
3146 .nopl,
3147 .sse,
3148 .pclmul,
3149 .popcnt,
3150 .sse42,
3151 .x87,
3152 }),
3153 };
3154
3155 pub const winchip_c6 = Cpu{
3156 .name = "winchip_c6",
3157 .llvm_name = "winchip-c6",
3158 .dependencies = featureSet(&[_]Feature{
3159 .mmx,
3160 .slow_unaligned_mem_16,
3161 .x87,
3162 }),
3163 };
3164
3165 pub const winchip2 = Cpu{
3166 .name = "winchip2",
3167 .llvm_name = "winchip2",
3168 .dependencies = featureSet(&[_]Feature{
3169 .mmx,
3170 .dnow3,
3171 .slow_unaligned_mem_16,
3172 .x87,
3173 }),
3174 };
3175
3176 pub const x86_64 = Cpu{
3177 .name = "x86_64",
3178 .llvm_name = "x86-64",
3179 .dependencies = featureSet(&[_]Feature{
3180 .bit64,
3181 .cmov,
3182 .cx8,
3183 .fxsr,
3184 .mmx,
3185 .macrofusion,
3186 .nopl,
3187 .sse,
3188 .sse2,
3189 .slow_3ops_lea,
3190 .slow_incdec,
3191 .x87,
3192 }),
3193 };
3194
3195 pub const yonah = Cpu{
3196 .name = "yonah",
3197 .llvm_name = "yonah",
3198 .dependencies = featureSet(&[_]Feature{
3199 .cmov,
3200 .cx8,
3201 .fxsr,
3202 .mmx,
3203 .nopl,
3204 .sse,
3205 .sse3,
3206 .slow_unaligned_mem_16,
3207 .x87,
3208 }),
3209 };
3210
3211 pub const znver1 = Cpu{
3212 .name = "znver1",
3213 .llvm_name = "znver1",
3214 .dependencies = featureSet(&[_]Feature{
3215 .bit64,
3216 .adx,
3217 .sse,
3218 .aes,
3219 .avx2,
3220 .bmi,
3221 .bmi2,
3222 .branchfusion,
3223 .clflushopt,
3224 .clzero,
3225 .cmov,
3226 .cx8,
3227 .cx16,
3228 .f16c,
3229 .fma,
3230 .fsgsbase,
3231 .fxsr,
3232 .fast15bytenop,
3233 .fast_bextr,
3234 .fast_lzcnt,
3235 .fast_scalar_shift_masks,
3236 .sahf,
3237 .lzcnt,
3238 .mmx,
3239 .movbe,
3240 .mwaitx,
3241 .nopl,
3242 .pclmul,
3243 .popcnt,
3244 .prfchw,
3245 .rdrnd,
3246 .rdseed,
3247 .sha,
3248 .sse4a,
3249 .slow_shld,
3250 .x87,
3251 .xsave,
3252 .xsavec,
3253 .xsaveopt,
3254 .xsaves,
3255 }),
3256 };
3257
3258 pub const znver2 = Cpu{
3259 .name = "znver2",
3260 .llvm_name = "znver2",
3261 .dependencies = featureSet(&[_]Feature{
3262 .bit64,
3263 .adx,
3264 .sse,
3265 .aes,
3266 .avx2,
3267 .bmi,
3268 .bmi2,
3269 .branchfusion,
3270 .clflushopt,
3271 .clwb,
3272 .clzero,
3273 .cmov,
3274 .cx8,
3275 .cx16,
3276 .f16c,
3277 .fma,
3278 .fsgsbase,
3279 .fxsr,
3280 .fast15bytenop,
3281 .fast_bextr,
3282 .fast_lzcnt,
3283 .fast_scalar_shift_masks,
3284 .sahf,
3285 .lzcnt,
3286 .mmx,
3287 .movbe,
3288 .mwaitx,
3289 .nopl,
3290 .pclmul,
3291 .popcnt,
3292 .prfchw,
3293 .rdpid,
3294 .rdrnd,
3295 .rdseed,
3296 .sha,
3297 .sse4a,
3298 .slow_shld,
3299 .wbnoinvd,
3300 .x87,
3301 .xsave,
3302 .xsavec,
3303 .xsaveopt,
3304 .xsaves,
3305 }),
3306 };
3307};
3308
3309pub const all_cpus = &[_]*const Cpu{
3310 &cpu.amdfam10,
3311 &cpu.athlon,
3312 &cpu.athlon4,
3313 &cpu.athlon_fx,
3314 &cpu.athlon_mp,
3315 &cpu.athlon_tbird,
3316 &cpu.athlon_xp,
3317 &cpu.athlon64,
3318 &cpu.athlon64_sse3,
3319 &cpu.atom,
3320 &cpu.barcelona,
3321 &cpu.bdver1,
3322 &cpu.bdver2,
3323 &cpu.bdver3,
3324 &cpu.bdver4,
3325 &cpu.bonnell,
3326 &cpu.broadwell,
3327 &cpu.btver1,
3328 &cpu.btver2,
3329 &cpu.c3,
3330 &cpu.c32,
3331 &cpu.cannonlake,
3332 &cpu.cascadelake,
3333 &cpu.cooperlake,
3334 &cpu.core_avx_i,
3335 &cpu.core_avx2,
3336 &cpu.core2,
3337 &cpu.corei7,
3338 &cpu.corei7_avx,
3339 &cpu.generic,
3340 &cpu.geode,
3341 &cpu.goldmont,
3342 &cpu.goldmont_plus,
3343 &cpu.haswell,
3344 &cpu.i386,
3345 &cpu.i486,
3346 &cpu.i586,
3347 &cpu.i686,
3348 &cpu.icelake_client,
3349 &cpu.icelake_server,
3350 &cpu.ivybridge,
3351 &cpu.k6,
3352 &cpu.k62,
3353 &cpu.k63,
3354 &cpu.k8,
3355 &cpu.k8_sse3,
3356 &cpu.knl,
3357 &cpu.knm,
3358 &cpu.lakemont,
3359 &cpu.nehalem,
3360 &cpu.nocona,
3361 &cpu.opteron,
3362 &cpu.opteron_sse3,
3363 &cpu.penryn,
3364 &cpu.pentium,
3365 &cpu.pentium_m,
3366 &cpu.pentium_mmx,
3367 &cpu.pentium2,
3368 &cpu.pentium3,
3369 &cpu.pentium3m,
3370 &cpu.pentium4,
3371 &cpu.pentium4m,
3372 &cpu.pentiumpro,
3373 &cpu.prescott,
3374 &cpu.sandybridge,
3375 &cpu.silvermont,
3376 &cpu.skx,
3377 &cpu.skylake,
3378 &cpu.skylake_avx512,
3379 &cpu.slm,
3380 &cpu.tremont,
3381 &cpu.westmere,
3382 &cpu.winchip_c6,
3383 &cpu.winchip2,
3384 &cpu.x86_64,
3385 &cpu.yonah,
3386 &cpu.znver1,
3387 &cpu.znver2,
33383388};