authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-20 01:42:31-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-20 01:42:31-05:00
log8f29d1407350190e1e641ca55f870f00b53d0246
treedd5e25784d7612f9f30a324d612338a44f1b38eb
parent20af858601e015ba76f23033d0af1d672db097ac
signature Commit is signed but in an unrecognized format.

stage1 is building. `zig targets` now self-hosted


10 files changed, 307 insertions(+), 466 deletions(-)

BRANCH_TODO+2
...@@ -1,5 +1,7 @@...@@ -1,5 +1,7 @@
1Finish these thigns before merging teh branch1Finish these thigns before merging teh branch
22
3 * it gets the wrong answers with `-target-feature -sse,-avx`
4
3 * finish refactoring target/arch/*5 * finish refactoring target/arch/*
4 * `zig builtin` integration 6 * `zig builtin` integration
5 * move target details to better location7 * move target details to better location
lib/std/builtin.zig+3
...@@ -1,5 +1,8 @@...@@ -1,5 +1,8 @@
1pub usingnamespace @import("builtin");1pub usingnamespace @import("builtin");
22
3/// Deprecated: use `std.Target.Os`.
4pub const Target = std.Target;
5
3/// Deprecated: use `std.Target.Os`.6/// Deprecated: use `std.Target.Os`.
4pub const Os = std.Target.Os;7pub const Os = std.Target.Os;
58
lib/std/target.zig+31-31
...@@ -49,6 +49,22 @@ pub const Target = union(enum) {...@@ -49,6 +49,22 @@ pub const Target = union(enum) {
49 other,49 other,
50 };50 };
5151
52 pub const aarch64 = @import("target/aarch64.zig");
53 pub const amdgpu = @import("target/amdgpu.zig");
54 pub const arm = @import("target/arm.zig");
55 pub const avr = @import("target/avr.zig");
56 pub const bpf = @import("target/bpf.zig");
57 pub const hexagon = @import("target/hexagon.zig");
58 pub const mips = @import("target/mips.zig");
59 pub const msp430 = @import("target/msp430.zig");
60 pub const nvptx = @import("target/nvptx.zig");
61 pub const powerpc = @import("target/powerpc.zig");
62 pub const riscv = @import("target/riscv.zig");
63 pub const sparc = @import("target/sparc.zig");
64 pub const systemz = @import("target/systemz.zig");
65 pub const wasm = @import("target/wasm.zig");
66 pub const x86 = @import("target/x86.zig");
67
52 pub const Arch = union(enum) {68 pub const Arch = union(enum) {
53 arm: Arm32,69 arm: Arm32,
54 armeb: Arm32,70 armeb: Arm32,
...@@ -101,22 +117,6 @@ pub const Target = union(enum) {...@@ -101,22 +117,6 @@ pub const Target = union(enum) {
101 renderscript32,117 renderscript32,
102 renderscript64,118 renderscript64,
103119
104 pub const aarch64 = @import("target/aarch64.zig");
105 pub const amdgpu = @import("target/amdgpu.zig");
106 pub const arm = @import("target/arm.zig");
107 pub const avr = @import("target/avr.zig");
108 pub const bpf = @import("target/bpf.zig");
109 pub const hexagon = @import("target/hexagon.zig");
110 pub const mips = @import("target/mips.zig");
111 pub const msp430 = @import("target/msp430.zig");
112 pub const nvptx = @import("target/nvptx.zig");
113 pub const powerpc = @import("target/powerpc.zig");
114 pub const riscv = @import("target/riscv.zig");
115 pub const sparc = @import("target/sparc.zig");
116 pub const systemz = @import("target/systemz.zig");
117 pub const wasm = @import("target/wasm.zig");
118 pub const x86 = @import("target/x86.zig");
119
120 pub const Arm32 = enum {120 pub const Arm32 = enum {
121 v8_5a,121 v8_5a,
122 v8_4a,122 v8_4a,
...@@ -251,7 +251,7 @@ pub const Target = union(enum) {...@@ -251,7 +251,7 @@ pub const Target = union(enum) {
251 };251 };
252 for (arch.allFeaturesList()) |feature, index| {252 for (arch.allFeaturesList()) |feature, index| {
253 if (mem.eql(u8, feature_name, feature.name)) {253 if (mem.eql(u8, feature_name, feature.name)) {
254 set |= @splat(2, 1 << index);254 set |= @splat(2, @as(Cpu.Feature.Set, 1) << @intCast(u7, index));
255 break;255 break;
256 }256 }
257 } else {257 } else {
...@@ -440,7 +440,7 @@ pub const Target = union(enum) {...@@ -440,7 +440,7 @@ pub const Target = union(enum) {
440 // TODO .sparc, .sparcv9, .sparcel => sparc.baseline_features,440 // TODO .sparc, .sparcv9, .sparcel => sparc.baseline_features,
441 // TODO .s390x => systemz.baseline_features,441 // TODO .s390x => systemz.baseline_features,
442 .i386 => x86.cpu.pentium4.features,442 .i386 => x86.cpu.pentium4.features,
443 .x86_64 => x86.cpu.x8664.features,443 .x86_64 => x86.cpu.x86_64.features,
444 // TODO .nvptx, .nvptx64 => nvptx.baseline_features,444 // TODO .nvptx, .nvptx64 => nvptx.baseline_features,
445 // TODO .wasm32, .wasm64 => wasm.baseline_features,445 // TODO .wasm32, .wasm64 => wasm.baseline_features,
446446
...@@ -451,21 +451,21 @@ pub const Target = union(enum) {...@@ -451,21 +451,21 @@ pub const Target = union(enum) {
451 /// All CPUs Zig is aware of, sorted lexicographically by name.451 /// All CPUs Zig is aware of, sorted lexicographically by name.
452 pub fn allCpus(arch: Arch) []const *const Cpu {452 pub fn allCpus(arch: Arch) []const *const Cpu {
453 return switch (arch) {453 return switch (arch) {
454 .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,454 // TODO .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
455 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,455 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
456 .avr => avr.all_cpus,456 // TODO .avr => avr.all_cpus,
457 .bpfel, .bpfeb => bpf.all_cpus,457 // TODO .bpfel, .bpfeb => bpf.all_cpus,
458 .hexagon => hexagon.all_cpus,458 // TODO .hexagon => hexagon.all_cpus,
459 .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,459 // TODO .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
460 .msp430 => msp430.all_cpus,460 // TODO .msp430 => msp430.all_cpus,
461 .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,461 // TODO .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
462 .amdgcn => amdgpu.all_cpus,462 // TODO .amdgcn => amdgpu.all_cpus,
463 .riscv32, .riscv64 => riscv.all_cpus,463 // TODO .riscv32, .riscv64 => riscv.all_cpus,
464 .sparc, .sparcv9, .sparcel => sparc.all_cpus,464 // TODO .sparc, .sparcv9, .sparcel => sparc.all_cpus,
465 .s390x => systemz.all_cpus,465 // TODO .s390x => systemz.all_cpus,
466 .i386, .x86_64 => x86.all_cpus,466 .i386, .x86_64 => x86.all_cpus,
467 .nvptx, .nvptx64 => nvptx.all_cpus,467 // TODO .nvptx, .nvptx64 => nvptx.all_cpus,
468 .wasm32, .wasm64 => wasm.all_cpus,468 // TODO .wasm32, .wasm64 => wasm.all_cpus,
469469
470 else => &[0]*const Cpu{},470 else => &[0]*const Cpu{},
471 };471 };
lib/std/target/x86.zig+196-196
...@@ -1213,10 +1213,10 @@ pub const cpu = struct {...@@ -1213,10 +1213,10 @@ pub const cpu = struct {
1213 pub const amdfam10 = Cpu{1213 pub const amdfam10 = Cpu{
1214 .name = "amdfam10",1214 .name = "amdfam10",
1215 .llvm_name = "amdfam10",1215 .llvm_name = "amdfam10",
1216 .dependencies = featureSet(&[_]Feature{1216 .features = featureSet(&[_]Feature{
1217 .mmx,1217 .mmx,
1218 .dnowa3,1218 .@"3dnowa",
1219 .bit64,1219 .@"64bit",
1220 .cmov,1220 .cmov,
1221 .cx8,1221 .cx8,
1222 .cx16,1222 .cx16,
...@@ -1236,9 +1236,9 @@ pub const cpu = struct {...@@ -1236,9 +1236,9 @@ pub const cpu = struct {
1236 pub const athlon = Cpu{1236 pub const athlon = Cpu{
1237 .name = "athlon",1237 .name = "athlon",
1238 .llvm_name = "athlon",1238 .llvm_name = "athlon",
1239 .dependencies = featureSet(&[_]Feature{1239 .features = featureSet(&[_]Feature{
1240 .mmx,1240 .mmx,
1241 .dnowa3,1241 .@"3dnowa",
1242 .cmov,1242 .cmov,
1243 .cx8,1243 .cx8,
1244 .nopl,1244 .nopl,
...@@ -1251,9 +1251,9 @@ pub const cpu = struct {...@@ -1251,9 +1251,9 @@ pub const cpu = struct {
1251 pub const athlon4 = Cpu{1251 pub const athlon4 = Cpu{
1252 .name = "athlon_4",1252 .name = "athlon_4",
1253 .llvm_name = "athlon-4",1253 .llvm_name = "athlon-4",
1254 .dependencies = featureSet(&[_]Feature{1254 .features = featureSet(&[_]Feature{
1255 .mmx,1255 .mmx,
1256 .dnowa3,1256 .@"3dnowa",
1257 .cmov,1257 .cmov,
1258 .cx8,1258 .cx8,
1259 .fxsr,1259 .fxsr,
...@@ -1268,10 +1268,10 @@ pub const cpu = struct {...@@ -1268,10 +1268,10 @@ pub const cpu = struct {
1268 pub const athlon_fx = Cpu{1268 pub const athlon_fx = Cpu{
1269 .name = "athlon_fx",1269 .name = "athlon_fx",
1270 .llvm_name = "athlon-fx",1270 .llvm_name = "athlon-fx",
1271 .dependencies = featureSet(&[_]Feature{1271 .features = featureSet(&[_]Feature{
1272 .mmx,1272 .mmx,
1273 .dnowa3,1273 .@"3dnowa",
1274 .bit64,1274 .@"64bit",
1275 .cmov,1275 .cmov,
1276 .cx8,1276 .cx8,
1277 .fxsr,1277 .fxsr,
...@@ -1288,9 +1288,9 @@ pub const cpu = struct {...@@ -1288,9 +1288,9 @@ pub const cpu = struct {
1288 pub const athlon_mp = Cpu{1288 pub const athlon_mp = Cpu{
1289 .name = "athlon_mp",1289 .name = "athlon_mp",
1290 .llvm_name = "athlon-mp",1290 .llvm_name = "athlon-mp",
1291 .dependencies = featureSet(&[_]Feature{1291 .features = featureSet(&[_]Feature{
1292 .mmx,1292 .mmx,
1293 .dnowa3,1293 .@"3dnowa",
1294 .cmov,1294 .cmov,
1295 .cx8,1295 .cx8,
1296 .fxsr,1296 .fxsr,
...@@ -1305,9 +1305,9 @@ pub const cpu = struct {...@@ -1305,9 +1305,9 @@ pub const cpu = struct {
1305 pub const athlon_tbird = Cpu{1305 pub const athlon_tbird = Cpu{
1306 .name = "athlon_tbird",1306 .name = "athlon_tbird",
1307 .llvm_name = "athlon-tbird",1307 .llvm_name = "athlon-tbird",
1308 .dependencies = featureSet(&[_]Feature{1308 .features = featureSet(&[_]Feature{
1309 .mmx,1309 .mmx,
1310 .dnowa3,1310 .@"3dnowa",
1311 .cmov,1311 .cmov,
1312 .cx8,1312 .cx8,
1313 .nopl,1313 .nopl,
...@@ -1320,9 +1320,9 @@ pub const cpu = struct {...@@ -1320,9 +1320,9 @@ pub const cpu = struct {
1320 pub const athlon_xp = Cpu{1320 pub const athlon_xp = Cpu{
1321 .name = "athlon_xp",1321 .name = "athlon_xp",
1322 .llvm_name = "athlon-xp",1322 .llvm_name = "athlon-xp",
1323 .dependencies = featureSet(&[_]Feature{1323 .features = featureSet(&[_]Feature{
1324 .mmx,1324 .mmx,
1325 .dnowa3,1325 .@"3dnowa",
1326 .cmov,1326 .cmov,
1327 .cx8,1327 .cx8,
1328 .fxsr,1328 .fxsr,
...@@ -1337,10 +1337,10 @@ pub const cpu = struct {...@@ -1337,10 +1337,10 @@ pub const cpu = struct {
1337 pub const athlon64 = Cpu{1337 pub const athlon64 = Cpu{
1338 .name = "athlon64",1338 .name = "athlon64",
1339 .llvm_name = "athlon64",1339 .llvm_name = "athlon64",
1340 .dependencies = featureSet(&[_]Feature{1340 .features = featureSet(&[_]Feature{
1341 .mmx,1341 .mmx,
1342 .dnowa3,1342 .@"3dnowa",
1343 .bit64,1343 .@"64bit",
1344 .cmov,1344 .cmov,
1345 .cx8,1345 .cx8,
1346 .fxsr,1346 .fxsr,
...@@ -1357,10 +1357,10 @@ pub const cpu = struct {...@@ -1357,10 +1357,10 @@ pub const cpu = struct {
1357 pub const athlon64_sse3 = Cpu{1357 pub const athlon64_sse3 = Cpu{
1358 .name = "athlon64_sse3",1358 .name = "athlon64_sse3",
1359 .llvm_name = "athlon64-sse3",1359 .llvm_name = "athlon64-sse3",
1360 .dependencies = featureSet(&[_]Feature{1360 .features = featureSet(&[_]Feature{
1361 .mmx,1361 .mmx,
1362 .dnowa3,1362 .@"3dnowa",
1363 .bit64,1363 .@"64bit",
1364 .cmov,1364 .cmov,
1365 .cx8,1365 .cx8,
1366 .cx16,1366 .cx16,
...@@ -1378,8 +1378,8 @@ pub const cpu = struct {...@@ -1378,8 +1378,8 @@ pub const cpu = struct {
1378 pub const atom = Cpu{1378 pub const atom = Cpu{
1379 .name = "atom",1379 .name = "atom",
1380 .llvm_name = "atom",1380 .llvm_name = "atom",
1381 .dependencies = featureSet(&[_]Feature{1381 .features = featureSet(&[_]Feature{
1382 .bit64,1382 .@"64bit",
1383 .cmov,1383 .cmov,
1384 .cx8,1384 .cx8,
1385 .cx16,1385 .cx16,
...@@ -1404,10 +1404,10 @@ pub const cpu = struct {...@@ -1404,10 +1404,10 @@ pub const cpu = struct {
1404 pub const barcelona = Cpu{1404 pub const barcelona = Cpu{
1405 .name = "barcelona",1405 .name = "barcelona",
1406 .llvm_name = "barcelona",1406 .llvm_name = "barcelona",
1407 .dependencies = featureSet(&[_]Feature{1407 .features = featureSet(&[_]Feature{
1408 .mmx,1408 .mmx,
1409 .dnowa3,1409 .@"3dnowa",
1410 .bit64,1410 .@"64bit",
1411 .cmov,1411 .cmov,
1412 .cx8,1412 .cx8,
1413 .cx16,1413 .cx16,
...@@ -1427,8 +1427,8 @@ pub const cpu = struct {...@@ -1427,8 +1427,8 @@ pub const cpu = struct {
1427 pub const bdver1 = Cpu{1427 pub const bdver1 = Cpu{
1428 .name = "bdver1",1428 .name = "bdver1",
1429 .llvm_name = "bdver1",1429 .llvm_name = "bdver1",
1430 .dependencies = featureSet(&[_]Feature{1430 .features = featureSet(&[_]Feature{
1431 .bit64,1431 .@"64bit",
1432 .sse,1432 .sse,
1433 .aes,1433 .aes,
1434 .branchfusion,1434 .branchfusion,
...@@ -1436,7 +1436,7 @@ pub const cpu = struct {...@@ -1436,7 +1436,7 @@ pub const cpu = struct {
1436 .cx8,1436 .cx8,
1437 .cx16,1437 .cx16,
1438 .fxsr,1438 .fxsr,
1439 .fast11bytenop,1439 .fast_11bytenop,
1440 .fast_scalar_shift_masks,1440 .fast_scalar_shift_masks,
1441 .sahf,1441 .sahf,
1442 .lwp,1442 .lwp,
...@@ -1456,8 +1456,8 @@ pub const cpu = struct {...@@ -1456,8 +1456,8 @@ pub const cpu = struct {
1456 pub const bdver2 = Cpu{1456 pub const bdver2 = Cpu{
1457 .name = "bdver2",1457 .name = "bdver2",
1458 .llvm_name = "bdver2",1458 .llvm_name = "bdver2",
1459 .dependencies = featureSet(&[_]Feature{1459 .features = featureSet(&[_]Feature{
1460 .bit64,1460 .@"64bit",
1461 .sse,1461 .sse,
1462 .aes,1462 .aes,
1463 .bmi,1463 .bmi,
...@@ -1468,7 +1468,7 @@ pub const cpu = struct {...@@ -1468,7 +1468,7 @@ pub const cpu = struct {
1468 .f16c,1468 .f16c,
1469 .fma,1469 .fma,
1470 .fxsr,1470 .fxsr,
1471 .fast11bytenop,1471 .fast_11bytenop,
1472 .fast_bextr,1472 .fast_bextr,
1473 .fast_scalar_shift_masks,1473 .fast_scalar_shift_masks,
1474 .sahf,1474 .sahf,
...@@ -1490,8 +1490,8 @@ pub const cpu = struct {...@@ -1490,8 +1490,8 @@ pub const cpu = struct {
1490 pub const bdver3 = Cpu{1490 pub const bdver3 = Cpu{
1491 .name = "bdver3",1491 .name = "bdver3",
1492 .llvm_name = "bdver3",1492 .llvm_name = "bdver3",
1493 .dependencies = featureSet(&[_]Feature{1493 .features = featureSet(&[_]Feature{
1494 .bit64,1494 .@"64bit",
1495 .sse,1495 .sse,
1496 .aes,1496 .aes,
1497 .bmi,1497 .bmi,
...@@ -1503,7 +1503,7 @@ pub const cpu = struct {...@@ -1503,7 +1503,7 @@ pub const cpu = struct {
1503 .fma,1503 .fma,
1504 .fsgsbase,1504 .fsgsbase,
1505 .fxsr,1505 .fxsr,
1506 .fast11bytenop,1506 .fast_11bytenop,
1507 .fast_bextr,1507 .fast_bextr,
1508 .fast_scalar_shift_masks,1508 .fast_scalar_shift_masks,
1509 .sahf,1509 .sahf,
...@@ -1526,8 +1526,8 @@ pub const cpu = struct {...@@ -1526,8 +1526,8 @@ pub const cpu = struct {
1526 pub const bdver4 = Cpu{1526 pub const bdver4 = Cpu{
1527 .name = "bdver4",1527 .name = "bdver4",
1528 .llvm_name = "bdver4",1528 .llvm_name = "bdver4",
1529 .dependencies = featureSet(&[_]Feature{1529 .features = featureSet(&[_]Feature{
1530 .bit64,1530 .@"64bit",
1531 .sse,1531 .sse,
1532 .aes,1532 .aes,
1533 .avx2,1533 .avx2,
...@@ -1541,7 +1541,7 @@ pub const cpu = struct {...@@ -1541,7 +1541,7 @@ pub const cpu = struct {
1541 .fma,1541 .fma,
1542 .fsgsbase,1542 .fsgsbase,
1543 .fxsr,1543 .fxsr,
1544 .fast11bytenop,1544 .fast_11bytenop,
1545 .fast_bextr,1545 .fast_bextr,
1546 .fast_scalar_shift_masks,1546 .fast_scalar_shift_masks,
1547 .sahf,1547 .sahf,
...@@ -1565,8 +1565,8 @@ pub const cpu = struct {...@@ -1565,8 +1565,8 @@ pub const cpu = struct {
1565 pub const bonnell = Cpu{1565 pub const bonnell = Cpu{
1566 .name = "bonnell",1566 .name = "bonnell",
1567 .llvm_name = "bonnell",1567 .llvm_name = "bonnell",
1568 .dependencies = featureSet(&[_]Feature{1568 .features = featureSet(&[_]Feature{
1569 .bit64,1569 .@"64bit",
1570 .cmov,1570 .cmov,
1571 .cx8,1571 .cx8,
1572 .cx16,1572 .cx16,
...@@ -1591,8 +1591,8 @@ pub const cpu = struct {...@@ -1591,8 +1591,8 @@ pub const cpu = struct {
1591 pub const broadwell = Cpu{1591 pub const broadwell = Cpu{
1592 .name = "broadwell",1592 .name = "broadwell",
1593 .llvm_name = "broadwell",1593 .llvm_name = "broadwell",
1594 .dependencies = featureSet(&[_]Feature{1594 .features = featureSet(&[_]Feature{
1595 .bit64,1595 .@"64bit",
1596 .adx,1596 .adx,
1597 .sse,1597 .sse,
1598 .avx,1598 .avx,
...@@ -1625,7 +1625,7 @@ pub const cpu = struct {...@@ -1625,7 +1625,7 @@ pub const cpu = struct {
1625 .prfchw,1625 .prfchw,
1626 .rdrnd,1626 .rdrnd,
1627 .rdseed,1627 .rdseed,
1628 .sse42,1628 .sse4_2,
1629 .slow_3ops_lea,1629 .slow_3ops_lea,
1630 .idivq_to_divl,1630 .idivq_to_divl,
1631 .x87,1631 .x87,
...@@ -1637,13 +1637,13 @@ pub const cpu = struct {...@@ -1637,13 +1637,13 @@ pub const cpu = struct {
1637 pub const btver1 = Cpu{1637 pub const btver1 = Cpu{
1638 .name = "btver1",1638 .name = "btver1",
1639 .llvm_name = "btver1",1639 .llvm_name = "btver1",
1640 .dependencies = featureSet(&[_]Feature{1640 .features = featureSet(&[_]Feature{
1641 .bit64,1641 .@"64bit",
1642 .cmov,1642 .cmov,
1643 .cx8,1643 .cx8,
1644 .cx16,1644 .cx16,
1645 .fxsr,1645 .fxsr,
1646 .fast15bytenop,1646 .fast_15bytenop,
1647 .fast_scalar_shift_masks,1647 .fast_scalar_shift_masks,
1648 .fast_vector_shift_masks,1648 .fast_vector_shift_masks,
1649 .sahf,1649 .sahf,
...@@ -1663,8 +1663,8 @@ pub const cpu = struct {...@@ -1663,8 +1663,8 @@ pub const cpu = struct {
1663 pub const btver2 = Cpu{1663 pub const btver2 = Cpu{
1664 .name = "btver2",1664 .name = "btver2",
1665 .llvm_name = "btver2",1665 .llvm_name = "btver2",
1666 .dependencies = featureSet(&[_]Feature{1666 .features = featureSet(&[_]Feature{
1667 .bit64,1667 .@"64bit",
1668 .sse,1668 .sse,
1669 .aes,1669 .aes,
1670 .avx,1670 .avx,
...@@ -1674,7 +1674,7 @@ pub const cpu = struct {...@@ -1674,7 +1674,7 @@ pub const cpu = struct {
1674 .cx16,1674 .cx16,
1675 .f16c,1675 .f16c,
1676 .fxsr,1676 .fxsr,
1677 .fast15bytenop,1677 .fast_15bytenop,
1678 .fast_bextr,1678 .fast_bextr,
1679 .fast_hops,1679 .fast_hops,
1680 .fast_lzcnt,1680 .fast_lzcnt,
...@@ -1701,9 +1701,9 @@ pub const cpu = struct {...@@ -1701,9 +1701,9 @@ pub const cpu = struct {
1701 pub const c3 = Cpu{1701 pub const c3 = Cpu{
1702 .name = "c3",1702 .name = "c3",
1703 .llvm_name = "c3",1703 .llvm_name = "c3",
1704 .dependencies = featureSet(&[_]Feature{1704 .features = featureSet(&[_]Feature{
1705 .mmx,1705 .mmx,
1706 .dnow3,1706 .@"3dnow",
1707 .slow_unaligned_mem_16,1707 .slow_unaligned_mem_16,
1708 .x87,1708 .x87,
1709 }),1709 }),
...@@ -1712,7 +1712,7 @@ pub const cpu = struct {...@@ -1712,7 +1712,7 @@ pub const cpu = struct {
1712 pub const c32 = Cpu{1712 pub const c32 = Cpu{
1713 .name = "c3_2",1713 .name = "c3_2",
1714 .llvm_name = "c3-2",1714 .llvm_name = "c3-2",
1715 .dependencies = featureSet(&[_]Feature{1715 .features = featureSet(&[_]Feature{
1716 .cmov,1716 .cmov,
1717 .cx8,1717 .cx8,
1718 .fxsr,1718 .fxsr,
...@@ -1726,8 +1726,8 @@ pub const cpu = struct {...@@ -1726,8 +1726,8 @@ pub const cpu = struct {
1726 pub const cannonlake = Cpu{1726 pub const cannonlake = Cpu{
1727 .name = "cannonlake",1727 .name = "cannonlake",
1728 .llvm_name = "cannonlake",1728 .llvm_name = "cannonlake",
1729 .dependencies = featureSet(&[_]Feature{1729 .features = featureSet(&[_]Feature{
1730 .bit64,1730 .@"64bit",
1731 .adx,1731 .adx,
1732 .sse,1732 .sse,
1733 .aes,1733 .aes,
...@@ -1771,7 +1771,7 @@ pub const cpu = struct {...@@ -1771,7 +1771,7 @@ pub const cpu = struct {
1771 .rdseed,1771 .rdseed,
1772 .sgx,1772 .sgx,
1773 .sha,1773 .sha,
1774 .sse42,1774 .sse4_2,
1775 .slow_3ops_lea,1775 .slow_3ops_lea,
1776 .idivq_to_divl,1776 .idivq_to_divl,
1777 .avx512vbmi,1777 .avx512vbmi,
...@@ -1787,8 +1787,8 @@ pub const cpu = struct {...@@ -1787,8 +1787,8 @@ pub const cpu = struct {
1787 pub const cascadelake = Cpu{1787 pub const cascadelake = Cpu{
1788 .name = "cascadelake",1788 .name = "cascadelake",
1789 .llvm_name = "cascadelake",1789 .llvm_name = "cascadelake",
1790 .dependencies = featureSet(&[_]Feature{1790 .features = featureSet(&[_]Feature{
1791 .bit64,1791 .@"64bit",
1792 .adx,1792 .adx,
1793 .sse,1793 .sse,
1794 .aes,1794 .aes,
...@@ -1831,7 +1831,7 @@ pub const cpu = struct {...@@ -1831,7 +1831,7 @@ pub const cpu = struct {
1831 .prfchw,1831 .prfchw,
1832 .rdrnd,1832 .rdrnd,
1833 .rdseed,1833 .rdseed,
1834 .sse42,1834 .sse4_2,
1835 .slow_3ops_lea,1835 .slow_3ops_lea,
1836 .idivq_to_divl,1836 .idivq_to_divl,
1837 .avx512vl,1837 .avx512vl,
...@@ -1847,8 +1847,8 @@ pub const cpu = struct {...@@ -1847,8 +1847,8 @@ pub const cpu = struct {
1847 pub const cooperlake = Cpu{1847 pub const cooperlake = Cpu{
1848 .name = "cooperlake",1848 .name = "cooperlake",
1849 .llvm_name = "cooperlake",1849 .llvm_name = "cooperlake",
1850 .dependencies = featureSet(&[_]Feature{1850 .features = featureSet(&[_]Feature{
1851 .bit64,1851 .@"64bit",
1852 .adx,1852 .adx,
1853 .sse,1853 .sse,
1854 .aes,1854 .aes,
...@@ -1892,7 +1892,7 @@ pub const cpu = struct {...@@ -1892,7 +1892,7 @@ pub const cpu = struct {
1892 .prfchw,1892 .prfchw,
1893 .rdrnd,1893 .rdrnd,
1894 .rdseed,1894 .rdseed,
1895 .sse42,1895 .sse4_2,
1896 .slow_3ops_lea,1896 .slow_3ops_lea,
1897 .idivq_to_divl,1897 .idivq_to_divl,
1898 .avx512vl,1898 .avx512vl,
...@@ -1908,8 +1908,8 @@ pub const cpu = struct {...@@ -1908,8 +1908,8 @@ pub const cpu = struct {
1908 pub const core_avx_i = Cpu{1908 pub const core_avx_i = Cpu{
1909 .name = "core_avx_i",1909 .name = "core_avx_i",
1910 .llvm_name = "core-avx-i",1910 .llvm_name = "core-avx-i",
1911 .dependencies = featureSet(&[_]Feature{1911 .features = featureSet(&[_]Feature{
1912 .bit64,1912 .@"64bit",
1913 .sse,1913 .sse,
1914 .avx,1914 .avx,
1915 .cmov,1915 .cmov,
...@@ -1929,7 +1929,7 @@ pub const cpu = struct {...@@ -1929,7 +1929,7 @@ pub const cpu = struct {
1929 .popcnt,1929 .popcnt,
1930 .false_deps_popcnt,1930 .false_deps_popcnt,
1931 .rdrnd,1931 .rdrnd,
1932 .sse42,1932 .sse4_2,
1933 .slow_3ops_lea,1933 .slow_3ops_lea,
1934 .idivq_to_divl,1934 .idivq_to_divl,
1935 .slow_unaligned_mem_32,1935 .slow_unaligned_mem_32,
...@@ -1942,8 +1942,8 @@ pub const cpu = struct {...@@ -1942,8 +1942,8 @@ pub const cpu = struct {
1942 pub const core_avx2 = Cpu{1942 pub const core_avx2 = Cpu{
1943 .name = "core_avx2",1943 .name = "core_avx2",
1944 .llvm_name = "core-avx2",1944 .llvm_name = "core-avx2",
1945 .dependencies = featureSet(&[_]Feature{1945 .features = featureSet(&[_]Feature{
1946 .bit64,1946 .@"64bit",
1947 .sse,1947 .sse,
1948 .avx,1948 .avx,
1949 .avx2,1949 .avx2,
...@@ -1973,7 +1973,7 @@ pub const cpu = struct {...@@ -1973,7 +1973,7 @@ pub const cpu = struct {
1973 .popcnt,1973 .popcnt,
1974 .false_deps_popcnt,1974 .false_deps_popcnt,
1975 .rdrnd,1975 .rdrnd,
1976 .sse42,1976 .sse4_2,
1977 .slow_3ops_lea,1977 .slow_3ops_lea,
1978 .idivq_to_divl,1978 .idivq_to_divl,
1979 .x87,1979 .x87,
...@@ -1985,8 +1985,8 @@ pub const cpu = struct {...@@ -1985,8 +1985,8 @@ pub const cpu = struct {
1985 pub const core2 = Cpu{1985 pub const core2 = Cpu{
1986 .name = "core2",1986 .name = "core2",
1987 .llvm_name = "core2",1987 .llvm_name = "core2",
1988 .dependencies = featureSet(&[_]Feature{1988 .features = featureSet(&[_]Feature{
1989 .bit64,1989 .@"64bit",
1990 .cmov,1990 .cmov,
1991 .cx8,1991 .cx8,
1992 .cx16,1992 .cx16,
...@@ -2005,8 +2005,8 @@ pub const cpu = struct {...@@ -2005,8 +2005,8 @@ pub const cpu = struct {
2005 pub const corei7 = Cpu{2005 pub const corei7 = Cpu{
2006 .name = "corei7",2006 .name = "corei7",
2007 .llvm_name = "corei7",2007 .llvm_name = "corei7",
2008 .dependencies = featureSet(&[_]Feature{2008 .features = featureSet(&[_]Feature{
2009 .bit64,2009 .@"64bit",
2010 .cmov,2010 .cmov,
2011 .cx8,2011 .cx8,
2012 .cx16,2012 .cx16,
...@@ -2017,7 +2017,7 @@ pub const cpu = struct {...@@ -2017,7 +2017,7 @@ pub const cpu = struct {
2017 .nopl,2017 .nopl,
2018 .popcnt,2018 .popcnt,
2019 .sse,2019 .sse,
2020 .sse42,2020 .sse4_2,
2021 .x87,2021 .x87,
2022 }),2022 }),
2023 };2023 };
...@@ -2025,8 +2025,8 @@ pub const cpu = struct {...@@ -2025,8 +2025,8 @@ pub const cpu = struct {
2025 pub const corei7_avx = Cpu{2025 pub const corei7_avx = Cpu{
2026 .name = "corei7_avx",2026 .name = "corei7_avx",
2027 .llvm_name = "corei7-avx",2027 .llvm_name = "corei7-avx",
2028 .dependencies = featureSet(&[_]Feature{2028 .features = featureSet(&[_]Feature{
2029 .bit64,2029 .@"64bit",
2030 .sse,2030 .sse,
2031 .avx,2031 .avx,
2032 .cmov,2032 .cmov,
...@@ -2043,7 +2043,7 @@ pub const cpu = struct {...@@ -2043,7 +2043,7 @@ pub const cpu = struct {
2043 .pclmul,2043 .pclmul,
2044 .popcnt,2044 .popcnt,
2045 .false_deps_popcnt,2045 .false_deps_popcnt,
2046 .sse42,2046 .sse4_2,
2047 .slow_3ops_lea,2047 .slow_3ops_lea,
2048 .idivq_to_divl,2048 .idivq_to_divl,
2049 .slow_unaligned_mem_32,2049 .slow_unaligned_mem_32,
...@@ -2056,7 +2056,7 @@ pub const cpu = struct {...@@ -2056,7 +2056,7 @@ pub const cpu = struct {
2056 pub const generic = Cpu{2056 pub const generic = Cpu{
2057 .name = "generic",2057 .name = "generic",
2058 .llvm_name = "generic",2058 .llvm_name = "generic",
2059 .dependencies = featureSet(&[_]Feature{2059 .features = featureSet(&[_]Feature{
2060 .cx8,2060 .cx8,
2061 .slow_unaligned_mem_16,2061 .slow_unaligned_mem_16,
2062 .x87,2062 .x87,
...@@ -2066,9 +2066,9 @@ pub const cpu = struct {...@@ -2066,9 +2066,9 @@ pub const cpu = struct {
2066 pub const geode = Cpu{2066 pub const geode = Cpu{
2067 .name = "geode",2067 .name = "geode",
2068 .llvm_name = "geode",2068 .llvm_name = "geode",
2069 .dependencies = featureSet(&[_]Feature{2069 .features = featureSet(&[_]Feature{
2070 .mmx,2070 .mmx,
2071 .dnowa3,2071 .@"3dnowa",
2072 .cx8,2072 .cx8,
2073 .slow_unaligned_mem_16,2073 .slow_unaligned_mem_16,
2074 .x87,2074 .x87,
...@@ -2078,8 +2078,8 @@ pub const cpu = struct {...@@ -2078,8 +2078,8 @@ pub const cpu = struct {
2078 pub const goldmont = Cpu{2078 pub const goldmont = Cpu{
2079 .name = "goldmont",2079 .name = "goldmont",
2080 .llvm_name = "goldmont",2080 .llvm_name = "goldmont",
2081 .dependencies = featureSet(&[_]Feature{2081 .features = featureSet(&[_]Feature{
2082 .bit64,2082 .@"64bit",
2083 .sse,2083 .sse,
2084 .aes,2084 .aes,
2085 .clflushopt,2085 .clflushopt,
...@@ -2100,10 +2100,10 @@ pub const cpu = struct {...@@ -2100,10 +2100,10 @@ pub const cpu = struct {
2100 .rdrnd,2100 .rdrnd,
2101 .rdseed,2101 .rdseed,
2102 .sha,2102 .sha,
2103 .sse42,2103 .sse4_2,
2104 .ssse3,2104 .ssse3,
2105 .slow_incdec,2105 .slow_incdec,
2106 .slowLea,2106 .slow_lea,
2107 .slow_two_mem_ops,2107 .slow_two_mem_ops,
2108 .x87,2108 .x87,
2109 .xsave,2109 .xsave,
...@@ -2116,8 +2116,8 @@ pub const cpu = struct {...@@ -2116,8 +2116,8 @@ pub const cpu = struct {
2116 pub const goldmont_plus = Cpu{2116 pub const goldmont_plus = Cpu{
2117 .name = "goldmont_plus",2117 .name = "goldmont_plus",
2118 .llvm_name = "goldmont-plus",2118 .llvm_name = "goldmont-plus",
2119 .dependencies = featureSet(&[_]Feature{2119 .features = featureSet(&[_]Feature{
2120 .bit64,2120 .@"64bit",
2121 .sse,2121 .sse,
2122 .aes,2122 .aes,
2123 .clflushopt,2123 .clflushopt,
...@@ -2140,10 +2140,10 @@ pub const cpu = struct {...@@ -2140,10 +2140,10 @@ pub const cpu = struct {
2140 .rdseed,2140 .rdseed,
2141 .sgx,2141 .sgx,
2142 .sha,2142 .sha,
2143 .sse42,2143 .sse4_2,
2144 .ssse3,2144 .ssse3,
2145 .slow_incdec,2145 .slow_incdec,
2146 .slowLea,2146 .slow_lea,
2147 .slow_two_mem_ops,2147 .slow_two_mem_ops,
2148 .x87,2148 .x87,
2149 .xsave,2149 .xsave,
...@@ -2156,8 +2156,8 @@ pub const cpu = struct {...@@ -2156,8 +2156,8 @@ pub const cpu = struct {
2156 pub const haswell = Cpu{2156 pub const haswell = Cpu{
2157 .name = "haswell",2157 .name = "haswell",
2158 .llvm_name = "haswell",2158 .llvm_name = "haswell",
2159 .dependencies = featureSet(&[_]Feature{2159 .features = featureSet(&[_]Feature{
2160 .bit64,2160 .@"64bit",
2161 .sse,2161 .sse,
2162 .avx,2162 .avx,
2163 .avx2,2163 .avx2,
...@@ -2187,7 +2187,7 @@ pub const cpu = struct {...@@ -2187,7 +2187,7 @@ pub const cpu = struct {
2187 .popcnt,2187 .popcnt,
2188 .false_deps_popcnt,2188 .false_deps_popcnt,
2189 .rdrnd,2189 .rdrnd,
2190 .sse42,2190 .sse4_2,
2191 .slow_3ops_lea,2191 .slow_3ops_lea,
2192 .idivq_to_divl,2192 .idivq_to_divl,
2193 .x87,2193 .x87,
...@@ -2196,38 +2196,38 @@ pub const cpu = struct {...@@ -2196,38 +2196,38 @@ pub const cpu = struct {
2196 }),2196 }),
2197 };2197 };
21982198
2199 pub const i386 = Cpu{2199 pub const _i386 = Cpu{
2200 .name = "i386",2200 .name = "_i386",
2201 .llvm_name = "i386",2201 .llvm_name = "i386",
2202 .dependencies = featureSet(&[_]Feature{2202 .features = featureSet(&[_]Feature{
2203 .slow_unaligned_mem_16,2203 .slow_unaligned_mem_16,
2204 .x87,2204 .x87,
2205 }),2205 }),
2206 };2206 };
22072207
2208 pub const i486 = Cpu{2208 pub const _i486 = Cpu{
2209 .name = "i486",2209 .name = "_i486",
2210 .llvm_name = "i486",2210 .llvm_name = "i486",
2211 .dependencies = featureSet(&[_]Feature{2211 .features = featureSet(&[_]Feature{
2212 .slow_unaligned_mem_16,2212 .slow_unaligned_mem_16,
2213 .x87,2213 .x87,
2214 }),2214 }),
2215 };2215 };
22162216
2217 pub const i586 = Cpu{2217 pub const _i586 = Cpu{
2218 .name = "i586",2218 .name = "_i586",
2219 .llvm_name = "i586",2219 .llvm_name = "i586",
2220 .dependencies = featureSet(&[_]Feature{2220 .features = featureSet(&[_]Feature{
2221 .cx8,2221 .cx8,
2222 .slow_unaligned_mem_16,2222 .slow_unaligned_mem_16,
2223 .x87,2223 .x87,
2224 }),2224 }),
2225 };2225 };
22262226
2227 pub const i686 = Cpu{2227 pub const _i686 = Cpu{
2228 .name = "i686",2228 .name = "_i686",
2229 .llvm_name = "i686",2229 .llvm_name = "i686",
2230 .dependencies = featureSet(&[_]Feature{2230 .features = featureSet(&[_]Feature{
2231 .cmov,2231 .cmov,
2232 .cx8,2232 .cx8,
2233 .slow_unaligned_mem_16,2233 .slow_unaligned_mem_16,
...@@ -2238,8 +2238,8 @@ pub const cpu = struct {...@@ -2238,8 +2238,8 @@ pub const cpu = struct {
2238 pub const icelake_client = Cpu{2238 pub const icelake_client = Cpu{
2239 .name = "icelake_client",2239 .name = "icelake_client",
2240 .llvm_name = "icelake-client",2240 .llvm_name = "icelake-client",
2241 .dependencies = featureSet(&[_]Feature{2241 .features = featureSet(&[_]Feature{
2242 .bit64,2242 .@"64bit",
2243 .adx,2243 .adx,
2244 .sse,2244 .sse,
2245 .aes,2245 .aes,
...@@ -2287,7 +2287,7 @@ pub const cpu = struct {...@@ -2287,7 +2287,7 @@ pub const cpu = struct {
2287 .rdseed,2287 .rdseed,
2288 .sgx,2288 .sgx,
2289 .sha,2289 .sha,
2290 .sse42,2290 .sse4_2,
2291 .slow_3ops_lea,2291 .slow_3ops_lea,
2292 .idivq_to_divl,2292 .idivq_to_divl,
2293 .vaes,2293 .vaes,
...@@ -2308,8 +2308,8 @@ pub const cpu = struct {...@@ -2308,8 +2308,8 @@ pub const cpu = struct {
2308 pub const icelake_server = Cpu{2308 pub const icelake_server = Cpu{
2309 .name = "icelake_server",2309 .name = "icelake_server",
2310 .llvm_name = "icelake-server",2310 .llvm_name = "icelake-server",
2311 .dependencies = featureSet(&[_]Feature{2311 .features = featureSet(&[_]Feature{
2312 .bit64,2312 .@"64bit",
2313 .adx,2313 .adx,
2314 .sse,2314 .sse,
2315 .aes,2315 .aes,
...@@ -2358,7 +2358,7 @@ pub const cpu = struct {...@@ -2358,7 +2358,7 @@ pub const cpu = struct {
2358 .rdseed,2358 .rdseed,
2359 .sgx,2359 .sgx,
2360 .sha,2360 .sha,
2361 .sse42,2361 .sse4_2,
2362 .slow_3ops_lea,2362 .slow_3ops_lea,
2363 .idivq_to_divl,2363 .idivq_to_divl,
2364 .vaes,2364 .vaes,
...@@ -2380,8 +2380,8 @@ pub const cpu = struct {...@@ -2380,8 +2380,8 @@ pub const cpu = struct {
2380 pub const ivybridge = Cpu{2380 pub const ivybridge = Cpu{
2381 .name = "ivybridge",2381 .name = "ivybridge",
2382 .llvm_name = "ivybridge",2382 .llvm_name = "ivybridge",
2383 .dependencies = featureSet(&[_]Feature{2383 .features = featureSet(&[_]Feature{
2384 .bit64,2384 .@"64bit",
2385 .sse,2385 .sse,
2386 .avx,2386 .avx,
2387 .cmov,2387 .cmov,
...@@ -2401,7 +2401,7 @@ pub const cpu = struct {...@@ -2401,7 +2401,7 @@ pub const cpu = struct {
2401 .popcnt,2401 .popcnt,
2402 .false_deps_popcnt,2402 .false_deps_popcnt,
2403 .rdrnd,2403 .rdrnd,
2404 .sse42,2404 .sse4_2,
2405 .slow_3ops_lea,2405 .slow_3ops_lea,
2406 .idivq_to_divl,2406 .idivq_to_divl,
2407 .slow_unaligned_mem_32,2407 .slow_unaligned_mem_32,
...@@ -2414,7 +2414,7 @@ pub const cpu = struct {...@@ -2414,7 +2414,7 @@ pub const cpu = struct {
2414 pub const k6 = Cpu{2414 pub const k6 = Cpu{
2415 .name = "k6",2415 .name = "k6",
2416 .llvm_name = "k6",2416 .llvm_name = "k6",
2417 .dependencies = featureSet(&[_]Feature{2417 .features = featureSet(&[_]Feature{
2418 .cx8,2418 .cx8,
2419 .mmx,2419 .mmx,
2420 .slow_unaligned_mem_16,2420 .slow_unaligned_mem_16,
...@@ -2425,9 +2425,9 @@ pub const cpu = struct {...@@ -2425,9 +2425,9 @@ pub const cpu = struct {
2425 pub const k62 = Cpu{2425 pub const k62 = Cpu{
2426 .name = "k6_2",2426 .name = "k6_2",
2427 .llvm_name = "k6-2",2427 .llvm_name = "k6-2",
2428 .dependencies = featureSet(&[_]Feature{2428 .features = featureSet(&[_]Feature{
2429 .mmx,2429 .mmx,
2430 .dnow3,2430 .@"3dnow",
2431 .cx8,2431 .cx8,
2432 .slow_unaligned_mem_16,2432 .slow_unaligned_mem_16,
2433 .x87,2433 .x87,
...@@ -2437,9 +2437,9 @@ pub const cpu = struct {...@@ -2437,9 +2437,9 @@ pub const cpu = struct {
2437 pub const k63 = Cpu{2437 pub const k63 = Cpu{
2438 .name = "k6_3",2438 .name = "k6_3",
2439 .llvm_name = "k6-3",2439 .llvm_name = "k6-3",
2440 .dependencies = featureSet(&[_]Feature{2440 .features = featureSet(&[_]Feature{
2441 .mmx,2441 .mmx,
2442 .dnow3,2442 .@"3dnow",
2443 .cx8,2443 .cx8,
2444 .slow_unaligned_mem_16,2444 .slow_unaligned_mem_16,
2445 .x87,2445 .x87,
...@@ -2449,10 +2449,10 @@ pub const cpu = struct {...@@ -2449,10 +2449,10 @@ pub const cpu = struct {
2449 pub const k8 = Cpu{2449 pub const k8 = Cpu{
2450 .name = "k8",2450 .name = "k8",
2451 .llvm_name = "k8",2451 .llvm_name = "k8",
2452 .dependencies = featureSet(&[_]Feature{2452 .features = featureSet(&[_]Feature{
2453 .mmx,2453 .mmx,
2454 .dnowa3,2454 .@"3dnowa",
2455 .bit64,2455 .@"64bit",
2456 .cmov,2456 .cmov,
2457 .cx8,2457 .cx8,
2458 .fxsr,2458 .fxsr,
...@@ -2469,10 +2469,10 @@ pub const cpu = struct {...@@ -2469,10 +2469,10 @@ pub const cpu = struct {
2469 pub const k8_sse3 = Cpu{2469 pub const k8_sse3 = Cpu{
2470 .name = "k8_sse3",2470 .name = "k8_sse3",
2471 .llvm_name = "k8-sse3",2471 .llvm_name = "k8-sse3",
2472 .dependencies = featureSet(&[_]Feature{2472 .features = featureSet(&[_]Feature{
2473 .mmx,2473 .mmx,
2474 .dnowa3,2474 .@"3dnowa",
2475 .bit64,2475 .@"64bit",
2476 .cmov,2476 .cmov,
2477 .cx8,2477 .cx8,
2478 .cx16,2478 .cx16,
...@@ -2490,8 +2490,8 @@ pub const cpu = struct {...@@ -2490,8 +2490,8 @@ pub const cpu = struct {
2490 pub const knl = Cpu{2490 pub const knl = Cpu{
2491 .name = "knl",2491 .name = "knl",
2492 .llvm_name = "knl",2492 .llvm_name = "knl",
2493 .dependencies = featureSet(&[_]Feature{2493 .features = featureSet(&[_]Feature{
2494 .bit64,2494 .@"64bit",
2495 .adx,2495 .adx,
2496 .sse,2496 .sse,
2497 .aes,2497 .aes,
...@@ -2535,8 +2535,8 @@ pub const cpu = struct {...@@ -2535,8 +2535,8 @@ pub const cpu = struct {
2535 pub const knm = Cpu{2535 pub const knm = Cpu{
2536 .name = "knm",2536 .name = "knm",
2537 .llvm_name = "knm",2537 .llvm_name = "knm",
2538 .dependencies = featureSet(&[_]Feature{2538 .features = featureSet(&[_]Feature{
2539 .bit64,2539 .@"64bit",
2540 .adx,2540 .adx,
2541 .sse,2541 .sse,
2542 .aes,2542 .aes,
...@@ -2581,14 +2581,14 @@ pub const cpu = struct {...@@ -2581,14 +2581,14 @@ pub const cpu = struct {
2581 pub const lakemont = Cpu{2581 pub const lakemont = Cpu{
2582 .name = "lakemont",2582 .name = "lakemont",
2583 .llvm_name = "lakemont",2583 .llvm_name = "lakemont",
2584 .dependencies = 0,2584 .features = 0,
2585 };2585 };
25862586
2587 pub const nehalem = Cpu{2587 pub const nehalem = Cpu{
2588 .name = "nehalem",2588 .name = "nehalem",
2589 .llvm_name = "nehalem",2589 .llvm_name = "nehalem",
2590 .dependencies = featureSet(&[_]Feature{2590 .features = featureSet(&[_]Feature{
2591 .bit64,2591 .@"64bit",
2592 .cmov,2592 .cmov,
2593 .cx8,2593 .cx8,
2594 .cx16,2594 .cx16,
...@@ -2599,7 +2599,7 @@ pub const cpu = struct {...@@ -2599,7 +2599,7 @@ pub const cpu = struct {
2599 .nopl,2599 .nopl,
2600 .popcnt,2600 .popcnt,
2601 .sse,2601 .sse,
2602 .sse42,2602 .sse4_2,
2603 .x87,2603 .x87,
2604 }),2604 }),
2605 };2605 };
...@@ -2607,8 +2607,8 @@ pub const cpu = struct {...@@ -2607,8 +2607,8 @@ pub const cpu = struct {
2607 pub const nocona = Cpu{2607 pub const nocona = Cpu{
2608 .name = "nocona",2608 .name = "nocona",
2609 .llvm_name = "nocona",2609 .llvm_name = "nocona",
2610 .dependencies = featureSet(&[_]Feature{2610 .features = featureSet(&[_]Feature{
2611 .bit64,2611 .@"64bit",
2612 .cmov,2612 .cmov,
2613 .cx8,2613 .cx8,
2614 .cx16,2614 .cx16,
...@@ -2625,10 +2625,10 @@ pub const cpu = struct {...@@ -2625,10 +2625,10 @@ pub const cpu = struct {
2625 pub const opteron = Cpu{2625 pub const opteron = Cpu{
2626 .name = "opteron",2626 .name = "opteron",
2627 .llvm_name = "opteron",2627 .llvm_name = "opteron",
2628 .dependencies = featureSet(&[_]Feature{2628 .features = featureSet(&[_]Feature{
2629 .mmx,2629 .mmx,
2630 .dnowa3,2630 .@"3dnowa",
2631 .bit64,2631 .@"64bit",
2632 .cmov,2632 .cmov,
2633 .cx8,2633 .cx8,
2634 .fxsr,2634 .fxsr,
...@@ -2645,10 +2645,10 @@ pub const cpu = struct {...@@ -2645,10 +2645,10 @@ pub const cpu = struct {
2645 pub const opteron_sse3 = Cpu{2645 pub const opteron_sse3 = Cpu{
2646 .name = "opteron_sse3",2646 .name = "opteron_sse3",
2647 .llvm_name = "opteron-sse3",2647 .llvm_name = "opteron-sse3",
2648 .dependencies = featureSet(&[_]Feature{2648 .features = featureSet(&[_]Feature{
2649 .mmx,2649 .mmx,
2650 .dnowa3,2650 .@"3dnowa",
2651 .bit64,2651 .@"64bit",
2652 .cmov,2652 .cmov,
2653 .cx8,2653 .cx8,
2654 .cx16,2654 .cx16,
...@@ -2666,8 +2666,8 @@ pub const cpu = struct {...@@ -2666,8 +2666,8 @@ pub const cpu = struct {
2666 pub const penryn = Cpu{2666 pub const penryn = Cpu{
2667 .name = "penryn",2667 .name = "penryn",
2668 .llvm_name = "penryn",2668 .llvm_name = "penryn",
2669 .dependencies = featureSet(&[_]Feature{2669 .features = featureSet(&[_]Feature{
2670 .bit64,2670 .@"64bit",
2671 .cmov,2671 .cmov,
2672 .cx8,2672 .cx8,
2673 .cx16,2673 .cx16,
...@@ -2677,7 +2677,7 @@ pub const cpu = struct {...@@ -2677,7 +2677,7 @@ pub const cpu = struct {
2677 .macrofusion,2677 .macrofusion,
2678 .nopl,2678 .nopl,
2679 .sse,2679 .sse,
2680 .sse41,2680 .sse4_1,
2681 .slow_unaligned_mem_16,2681 .slow_unaligned_mem_16,
2682 .x87,2682 .x87,
2683 }),2683 }),
...@@ -2686,7 +2686,7 @@ pub const cpu = struct {...@@ -2686,7 +2686,7 @@ pub const cpu = struct {
2686 pub const pentium = Cpu{2686 pub const pentium = Cpu{
2687 .name = "pentium",2687 .name = "pentium",
2688 .llvm_name = "pentium",2688 .llvm_name = "pentium",
2689 .dependencies = featureSet(&[_]Feature{2689 .features = featureSet(&[_]Feature{
2690 .cx8,2690 .cx8,
2691 .slow_unaligned_mem_16,2691 .slow_unaligned_mem_16,
2692 .x87,2692 .x87,
...@@ -2696,7 +2696,7 @@ pub const cpu = struct {...@@ -2696,7 +2696,7 @@ pub const cpu = struct {
2696 pub const pentium_m = Cpu{2696 pub const pentium_m = Cpu{
2697 .name = "pentium_m",2697 .name = "pentium_m",
2698 .llvm_name = "pentium-m",2698 .llvm_name = "pentium-m",
2699 .dependencies = featureSet(&[_]Feature{2699 .features = featureSet(&[_]Feature{
2700 .cmov,2700 .cmov,
2701 .cx8,2701 .cx8,
2702 .fxsr,2702 .fxsr,
...@@ -2712,7 +2712,7 @@ pub const cpu = struct {...@@ -2712,7 +2712,7 @@ pub const cpu = struct {
2712 pub const pentium_mmx = Cpu{2712 pub const pentium_mmx = Cpu{
2713 .name = "pentium_mmx",2713 .name = "pentium_mmx",
2714 .llvm_name = "pentium-mmx",2714 .llvm_name = "pentium-mmx",
2715 .dependencies = featureSet(&[_]Feature{2715 .features = featureSet(&[_]Feature{
2716 .cx8,2716 .cx8,
2717 .mmx,2717 .mmx,
2718 .slow_unaligned_mem_16,2718 .slow_unaligned_mem_16,
...@@ -2723,7 +2723,7 @@ pub const cpu = struct {...@@ -2723,7 +2723,7 @@ pub const cpu = struct {
2723 pub const pentium2 = Cpu{2723 pub const pentium2 = Cpu{
2724 .name = "pentium2",2724 .name = "pentium2",
2725 .llvm_name = "pentium2",2725 .llvm_name = "pentium2",
2726 .dependencies = featureSet(&[_]Feature{2726 .features = featureSet(&[_]Feature{
2727 .cmov,2727 .cmov,
2728 .cx8,2728 .cx8,
2729 .fxsr,2729 .fxsr,
...@@ -2737,7 +2737,7 @@ pub const cpu = struct {...@@ -2737,7 +2737,7 @@ pub const cpu = struct {
2737 pub const pentium3 = Cpu{2737 pub const pentium3 = Cpu{
2738 .name = "pentium3",2738 .name = "pentium3",
2739 .llvm_name = "pentium3",2739 .llvm_name = "pentium3",
2740 .dependencies = featureSet(&[_]Feature{2740 .features = featureSet(&[_]Feature{
2741 .cmov,2741 .cmov,
2742 .cx8,2742 .cx8,
2743 .fxsr,2743 .fxsr,
...@@ -2752,7 +2752,7 @@ pub const cpu = struct {...@@ -2752,7 +2752,7 @@ pub const cpu = struct {
2752 pub const pentium3m = Cpu{2752 pub const pentium3m = Cpu{
2753 .name = "pentium3m",2753 .name = "pentium3m",
2754 .llvm_name = "pentium3m",2754 .llvm_name = "pentium3m",
2755 .dependencies = featureSet(&[_]Feature{2755 .features = featureSet(&[_]Feature{
2756 .cmov,2756 .cmov,
2757 .cx8,2757 .cx8,
2758 .fxsr,2758 .fxsr,
...@@ -2767,7 +2767,7 @@ pub const cpu = struct {...@@ -2767,7 +2767,7 @@ pub const cpu = struct {
2767 pub const pentium4 = Cpu{2767 pub const pentium4 = Cpu{
2768 .name = "pentium4",2768 .name = "pentium4",
2769 .llvm_name = "pentium4",2769 .llvm_name = "pentium4",
2770 .dependencies = featureSet(&[_]Feature{2770 .features = featureSet(&[_]Feature{
2771 .cmov,2771 .cmov,
2772 .cx8,2772 .cx8,
2773 .fxsr,2773 .fxsr,
...@@ -2783,7 +2783,7 @@ pub const cpu = struct {...@@ -2783,7 +2783,7 @@ pub const cpu = struct {
2783 pub const pentium4m = Cpu{2783 pub const pentium4m = Cpu{
2784 .name = "pentium4m",2784 .name = "pentium4m",
2785 .llvm_name = "pentium4m",2785 .llvm_name = "pentium4m",
2786 .dependencies = featureSet(&[_]Feature{2786 .features = featureSet(&[_]Feature{
2787 .cmov,2787 .cmov,
2788 .cx8,2788 .cx8,
2789 .fxsr,2789 .fxsr,
...@@ -2799,7 +2799,7 @@ pub const cpu = struct {...@@ -2799,7 +2799,7 @@ pub const cpu = struct {
2799 pub const pentiumpro = Cpu{2799 pub const pentiumpro = Cpu{
2800 .name = "pentiumpro",2800 .name = "pentiumpro",
2801 .llvm_name = "pentiumpro",2801 .llvm_name = "pentiumpro",
2802 .dependencies = featureSet(&[_]Feature{2802 .features = featureSet(&[_]Feature{
2803 .cmov,2803 .cmov,
2804 .cx8,2804 .cx8,
2805 .nopl,2805 .nopl,
...@@ -2811,7 +2811,7 @@ pub const cpu = struct {...@@ -2811,7 +2811,7 @@ pub const cpu = struct {
2811 pub const prescott = Cpu{2811 pub const prescott = Cpu{
2812 .name = "prescott",2812 .name = "prescott",
2813 .llvm_name = "prescott",2813 .llvm_name = "prescott",
2814 .dependencies = featureSet(&[_]Feature{2814 .features = featureSet(&[_]Feature{
2815 .cmov,2815 .cmov,
2816 .cx8,2816 .cx8,
2817 .fxsr,2817 .fxsr,
...@@ -2827,8 +2827,8 @@ pub const cpu = struct {...@@ -2827,8 +2827,8 @@ pub const cpu = struct {
2827 pub const sandybridge = Cpu{2827 pub const sandybridge = Cpu{
2828 .name = "sandybridge",2828 .name = "sandybridge",
2829 .llvm_name = "sandybridge",2829 .llvm_name = "sandybridge",
2830 .dependencies = featureSet(&[_]Feature{2830 .features = featureSet(&[_]Feature{
2831 .bit64,2831 .@"64bit",
2832 .sse,2832 .sse,
2833 .avx,2833 .avx,
2834 .cmov,2834 .cmov,
...@@ -2845,7 +2845,7 @@ pub const cpu = struct {...@@ -2845,7 +2845,7 @@ pub const cpu = struct {
2845 .pclmul,2845 .pclmul,
2846 .popcnt,2846 .popcnt,
2847 .false_deps_popcnt,2847 .false_deps_popcnt,
2848 .sse42,2848 .sse4_2,
2849 .slow_3ops_lea,2849 .slow_3ops_lea,
2850 .idivq_to_divl,2850 .idivq_to_divl,
2851 .slow_unaligned_mem_32,2851 .slow_unaligned_mem_32,
...@@ -2858,8 +2858,8 @@ pub const cpu = struct {...@@ -2858,8 +2858,8 @@ pub const cpu = struct {
2858 pub const silvermont = Cpu{2858 pub const silvermont = Cpu{
2859 .name = "silvermont",2859 .name = "silvermont",
2860 .llvm_name = "silvermont",2860 .llvm_name = "silvermont",
2861 .dependencies = featureSet(&[_]Feature{2861 .features = featureSet(&[_]Feature{
2862 .bit64,2862 .@"64bit",
2863 .cmov,2863 .cmov,
2864 .cx8,2864 .cx8,
2865 .cx16,2865 .cx16,
...@@ -2874,12 +2874,12 @@ pub const cpu = struct {...@@ -2874,12 +2874,12 @@ pub const cpu = struct {
2874 .false_deps_popcnt,2874 .false_deps_popcnt,
2875 .prfchw,2875 .prfchw,
2876 .rdrnd,2876 .rdrnd,
2877 .sse42,2877 .sse4_2,
2878 .ssse3,2878 .ssse3,
2879 .idivq_to_divl,2879 .idivq_to_divl,
2880 .slow_incdec,2880 .slow_incdec,
2881 .slowLea,2881 .slow_lea,
2882 .slowPmulld,2882 .slow_pmulld,
2883 .slow_two_mem_ops,2883 .slow_two_mem_ops,
2884 .x87,2884 .x87,
2885 }),2885 }),
...@@ -2888,8 +2888,8 @@ pub const cpu = struct {...@@ -2888,8 +2888,8 @@ pub const cpu = struct {
2888 pub const skx = Cpu{2888 pub const skx = Cpu{
2889 .name = "skx",2889 .name = "skx",
2890 .llvm_name = "skx",2890 .llvm_name = "skx",
2891 .dependencies = featureSet(&[_]Feature{2891 .features = featureSet(&[_]Feature{
2892 .bit64,2892 .@"64bit",
2893 .adx,2893 .adx,
2894 .sse,2894 .sse,
2895 .aes,2895 .aes,
...@@ -2932,7 +2932,7 @@ pub const cpu = struct {...@@ -2932,7 +2932,7 @@ pub const cpu = struct {
2932 .prfchw,2932 .prfchw,
2933 .rdrnd,2933 .rdrnd,
2934 .rdseed,2934 .rdseed,
2935 .sse42,2935 .sse4_2,
2936 .slow_3ops_lea,2936 .slow_3ops_lea,
2937 .idivq_to_divl,2937 .idivq_to_divl,
2938 .avx512vl,2938 .avx512vl,
...@@ -2947,8 +2947,8 @@ pub const cpu = struct {...@@ -2947,8 +2947,8 @@ pub const cpu = struct {
2947 pub const skylake = Cpu{2947 pub const skylake = Cpu{
2948 .name = "skylake",2948 .name = "skylake",
2949 .llvm_name = "skylake",2949 .llvm_name = "skylake",
2950 .dependencies = featureSet(&[_]Feature{2950 .features = featureSet(&[_]Feature{
2951 .bit64,2951 .@"64bit",
2952 .adx,2952 .adx,
2953 .sse,2953 .sse,
2954 .aes,2954 .aes,
...@@ -2986,7 +2986,7 @@ pub const cpu = struct {...@@ -2986,7 +2986,7 @@ pub const cpu = struct {
2986 .rdrnd,2986 .rdrnd,
2987 .rdseed,2987 .rdseed,
2988 .sgx,2988 .sgx,
2989 .sse42,2989 .sse4_2,
2990 .slow_3ops_lea,2990 .slow_3ops_lea,
2991 .idivq_to_divl,2991 .idivq_to_divl,
2992 .x87,2992 .x87,
...@@ -3000,8 +3000,8 @@ pub const cpu = struct {...@@ -3000,8 +3000,8 @@ pub const cpu = struct {
3000 pub const skylake_avx512 = Cpu{3000 pub const skylake_avx512 = Cpu{
3001 .name = "skylake_avx512",3001 .name = "skylake_avx512",
3002 .llvm_name = "skylake-avx512",3002 .llvm_name = "skylake-avx512",
3003 .dependencies = featureSet(&[_]Feature{3003 .features = featureSet(&[_]Feature{
3004 .bit64,3004 .@"64bit",
3005 .adx,3005 .adx,
3006 .sse,3006 .sse,
3007 .aes,3007 .aes,
...@@ -3044,7 +3044,7 @@ pub const cpu = struct {...@@ -3044,7 +3044,7 @@ pub const cpu = struct {
3044 .prfchw,3044 .prfchw,
3045 .rdrnd,3045 .rdrnd,
3046 .rdseed,3046 .rdseed,
3047 .sse42,3047 .sse4_2,
3048 .slow_3ops_lea,3048 .slow_3ops_lea,
3049 .idivq_to_divl,3049 .idivq_to_divl,
3050 .avx512vl,3050 .avx512vl,
...@@ -3059,8 +3059,8 @@ pub const cpu = struct {...@@ -3059,8 +3059,8 @@ pub const cpu = struct {
3059 pub const slm = Cpu{3059 pub const slm = Cpu{
3060 .name = "slm",3060 .name = "slm",
3061 .llvm_name = "slm",3061 .llvm_name = "slm",
3062 .dependencies = featureSet(&[_]Feature{3062 .features = featureSet(&[_]Feature{
3063 .bit64,3063 .@"64bit",
3064 .cmov,3064 .cmov,
3065 .cx8,3065 .cx8,
3066 .cx16,3066 .cx16,
...@@ -3075,12 +3075,12 @@ pub const cpu = struct {...@@ -3075,12 +3075,12 @@ pub const cpu = struct {
3075 .false_deps_popcnt,3075 .false_deps_popcnt,
3076 .prfchw,3076 .prfchw,
3077 .rdrnd,3077 .rdrnd,
3078 .sse42,3078 .sse4_2,
3079 .ssse3,3079 .ssse3,
3080 .idivq_to_divl,3080 .idivq_to_divl,
3081 .slow_incdec,3081 .slow_incdec,
3082 .slowLea,3082 .slow_lea,
3083 .slowPmulld,3083 .slow_pmulld,
3084 .slow_two_mem_ops,3084 .slow_two_mem_ops,
3085 .x87,3085 .x87,
3086 }),3086 }),
...@@ -3089,8 +3089,8 @@ pub const cpu = struct {...@@ -3089,8 +3089,8 @@ pub const cpu = struct {
3089 pub const tremont = Cpu{3089 pub const tremont = Cpu{
3090 .name = "tremont",3090 .name = "tremont",
3091 .llvm_name = "tremont",3091 .llvm_name = "tremont",
3092 .dependencies = featureSet(&[_]Feature{3092 .features = featureSet(&[_]Feature{
3093 .bit64,3093 .@"64bit",
3094 .sse,3094 .sse,
3095 .aes,3095 .aes,
3096 .cldemote,3096 .cldemote,
...@@ -3117,10 +3117,10 @@ pub const cpu = struct {...@@ -3117,10 +3117,10 @@ pub const cpu = struct {
3117 .rdseed,3117 .rdseed,
3118 .sgx,3118 .sgx,
3119 .sha,3119 .sha,
3120 .sse42,3120 .sse4_2,
3121 .ssse3,3121 .ssse3,
3122 .slow_incdec,3122 .slow_incdec,
3123 .slowLea,3123 .slow_lea,
3124 .slow_two_mem_ops,3124 .slow_two_mem_ops,
3125 .waitpkg,3125 .waitpkg,
3126 .x87,3126 .x87,
...@@ -3134,8 +3134,8 @@ pub const cpu = struct {...@@ -3134,8 +3134,8 @@ pub const cpu = struct {
3134 pub const westmere = Cpu{3134 pub const westmere = Cpu{
3135 .name = "westmere",3135 .name = "westmere",
3136 .llvm_name = "westmere",3136 .llvm_name = "westmere",
3137 .dependencies = featureSet(&[_]Feature{3137 .features = featureSet(&[_]Feature{
3138 .bit64,3138 .@"64bit",
3139 .cmov,3139 .cmov,
3140 .cx8,3140 .cx8,
3141 .cx16,3141 .cx16,
...@@ -3147,7 +3147,7 @@ pub const cpu = struct {...@@ -3147,7 +3147,7 @@ pub const cpu = struct {
3147 .sse,3147 .sse,
3148 .pclmul,3148 .pclmul,
3149 .popcnt,3149 .popcnt,
3150 .sse42,3150 .sse4_2,
3151 .x87,3151 .x87,
3152 }),3152 }),
3153 };3153 };
...@@ -3155,7 +3155,7 @@ pub const cpu = struct {...@@ -3155,7 +3155,7 @@ pub const cpu = struct {
3155 pub const winchip_c6 = Cpu{3155 pub const winchip_c6 = Cpu{
3156 .name = "winchip_c6",3156 .name = "winchip_c6",
3157 .llvm_name = "winchip-c6",3157 .llvm_name = "winchip-c6",
3158 .dependencies = featureSet(&[_]Feature{3158 .features = featureSet(&[_]Feature{
3159 .mmx,3159 .mmx,
3160 .slow_unaligned_mem_16,3160 .slow_unaligned_mem_16,
3161 .x87,3161 .x87,
...@@ -3165,9 +3165,9 @@ pub const cpu = struct {...@@ -3165,9 +3165,9 @@ pub const cpu = struct {
3165 pub const winchip2 = Cpu{3165 pub const winchip2 = Cpu{
3166 .name = "winchip2",3166 .name = "winchip2",
3167 .llvm_name = "winchip2",3167 .llvm_name = "winchip2",
3168 .dependencies = featureSet(&[_]Feature{3168 .features = featureSet(&[_]Feature{
3169 .mmx,3169 .mmx,
3170 .dnow3,3170 .@"3dnow",
3171 .slow_unaligned_mem_16,3171 .slow_unaligned_mem_16,
3172 .x87,3172 .x87,
3173 }),3173 }),
...@@ -3176,8 +3176,8 @@ pub const cpu = struct {...@@ -3176,8 +3176,8 @@ pub const cpu = struct {
3176 pub const x86_64 = Cpu{3176 pub const x86_64 = Cpu{
3177 .name = "x86_64",3177 .name = "x86_64",
3178 .llvm_name = "x86-64",3178 .llvm_name = "x86-64",
3179 .dependencies = featureSet(&[_]Feature{3179 .features = featureSet(&[_]Feature{
3180 .bit64,3180 .@"64bit",
3181 .cmov,3181 .cmov,
3182 .cx8,3182 .cx8,
3183 .fxsr,3183 .fxsr,
...@@ -3195,7 +3195,7 @@ pub const cpu = struct {...@@ -3195,7 +3195,7 @@ pub const cpu = struct {
3195 pub const yonah = Cpu{3195 pub const yonah = Cpu{
3196 .name = "yonah",3196 .name = "yonah",
3197 .llvm_name = "yonah",3197 .llvm_name = "yonah",
3198 .dependencies = featureSet(&[_]Feature{3198 .features = featureSet(&[_]Feature{
3199 .cmov,3199 .cmov,
3200 .cx8,3200 .cx8,
3201 .fxsr,3201 .fxsr,
...@@ -3211,8 +3211,8 @@ pub const cpu = struct {...@@ -3211,8 +3211,8 @@ pub const cpu = struct {
3211 pub const znver1 = Cpu{3211 pub const znver1 = Cpu{
3212 .name = "znver1",3212 .name = "znver1",
3213 .llvm_name = "znver1",3213 .llvm_name = "znver1",
3214 .dependencies = featureSet(&[_]Feature{3214 .features = featureSet(&[_]Feature{
3215 .bit64,3215 .@"64bit",
3216 .adx,3216 .adx,
3217 .sse,3217 .sse,
3218 .aes,3218 .aes,
...@@ -3229,7 +3229,7 @@ pub const cpu = struct {...@@ -3229,7 +3229,7 @@ pub const cpu = struct {
3229 .fma,3229 .fma,
3230 .fsgsbase,3230 .fsgsbase,
3231 .fxsr,3231 .fxsr,
3232 .fast15bytenop,3232 .fast_15bytenop,
3233 .fast_bextr,3233 .fast_bextr,
3234 .fast_lzcnt,3234 .fast_lzcnt,
3235 .fast_scalar_shift_masks,3235 .fast_scalar_shift_masks,
...@@ -3258,8 +3258,8 @@ pub const cpu = struct {...@@ -3258,8 +3258,8 @@ pub const cpu = struct {
3258 pub const znver2 = Cpu{3258 pub const znver2 = Cpu{
3259 .name = "znver2",3259 .name = "znver2",
3260 .llvm_name = "znver2",3260 .llvm_name = "znver2",
3261 .dependencies = featureSet(&[_]Feature{3261 .features = featureSet(&[_]Feature{
3262 .bit64,3262 .@"64bit",
3263 .adx,3263 .adx,
3264 .sse,3264 .sse,
3265 .aes,3265 .aes,
...@@ -3277,7 +3277,7 @@ pub const cpu = struct {...@@ -3277,7 +3277,7 @@ pub const cpu = struct {
3277 .fma,3277 .fma,
3278 .fsgsbase,3278 .fsgsbase,
3279 .fxsr,3279 .fxsr,
3280 .fast15bytenop,3280 .fast_15bytenop,
3281 .fast_bextr,3281 .fast_bextr,
3282 .fast_lzcnt,3282 .fast_lzcnt,
3283 .fast_scalar_shift_masks,3283 .fast_scalar_shift_masks,
...@@ -3341,10 +3341,10 @@ pub const all_cpus = &[_]*const Cpu{...@@ -3341,10 +3341,10 @@ pub const all_cpus = &[_]*const Cpu{
3341 &cpu.goldmont,3341 &cpu.goldmont,
3342 &cpu.goldmont_plus,3342 &cpu.goldmont_plus,
3343 &cpu.haswell,3343 &cpu.haswell,
3344 &cpu.i386,3344 &cpu._i386,
3345 &cpu.i486,3345 &cpu._i486,
3346 &cpu.i586,3346 &cpu._i586,
3347 &cpu.i686,3347 &cpu._i686,
3348 &cpu.icelake_client,3348 &cpu.icelake_client,
3349 &cpu.icelake_server,3349 &cpu.icelake_server,
3350 &cpu.ivybridge,3350 &cpu.ivybridge,
src-self-hosted/main.zig+1-1
...@@ -791,7 +791,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro...@@ -791,7 +791,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro
791791
792// cmd:targets /////////////////////////////////////////////////////////////////////////////////////792// cmd:targets /////////////////////////////////////////////////////////////////////////////////////
793793
794fn cmdTargets(allocator: *Allocator, args: []const []const u8) !void {794pub fn cmdTargets(allocator: *Allocator, args: []const []const u8) !void {
795 try stdout.write("Architectures:\n");795 try stdout.write("Architectures:\n");
796 {796 {
797 comptime var i: usize = 0;797 comptime var i: usize = 0;
src-self-hosted/stage1.zig+54-110
...@@ -84,6 +84,11 @@ const Error = extern enum {...@@ -84,6 +84,11 @@ const Error = extern enum {
84 NotLazy,84 NotLazy,
85 IsAsync,85 IsAsync,
86 ImportOutsidePkgPath,86 ImportOutsidePkgPath,
87 UnknownCpu,
88 UnknownSubArchitecture,
89 UnknownCpuFeature,
90 InvalidCpuFeatures,
91 InvalidLlvmCpuFeaturesFormat,
87};92};
8893
89const FILE = std.c.FILE;94const FILE = std.c.FILE;
...@@ -533,99 +538,20 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz...@@ -533,99 +538,20 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz
533}538}
534539
535// ABI warning540// ABI warning
536export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void {541export fn stage2_cmd_targets() c_int {
537 printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| {542 self_hosted_main.cmdTargets(std.heap.c_allocator, &[0][]u8{}) catch |err| {
538 std.debug.warn("Failed to list features: {}\n", .{@errorName(err)});543 std.debug.warn("unable to list targets: {}\n", .{@errorName(err)});
544 return -1;
539 };545 };
540}546 return 0;
541
542fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void {
543 const stdout_stream = &std.io.getStdOut().outStream().stream;
544
545 const arch = Target.parseArchSub(arch_name) catch {
546 std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name});
547 return;
548 };
549
550 try stdout_stream.print("Available features for {}:\n", .{@tagName(arch)});
551
552 const features = arch.allFeaturesList();
553
554 var longest_len: usize = 0;
555 for (features) |feature| {
556 if (feature.name.len > longest_len) {
557 longest_len = feature.name.len;
558 }
559 }
560
561 for (features) |feature| {
562 try stdout_stream.print(" {}", .{feature.name});
563
564 var i: usize = 0;
565 while (i < longest_len - feature.name.len) : (i += 1) {
566 try stdout_stream.write(" ");
567 }
568
569 try stdout_stream.print(" - {}\n", .{feature.description});
570
571 if (show_dependencies and feature.dependencies != 0) {
572 for (feature.dependencies) |dependency| {
573 try stdout_stream.print(" {}\n", .{dependency.name});
574 }
575 }
576 }
577}
578
579// ABI warning
580export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void {
581 printCpusForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| {
582 std.debug.warn("Failed to list features: {}\n", .{@errorName(err)});
583 };
584}
585
586fn printCpusForArch(arch_name: []const u8, show_dependencies: bool) !void {
587 const stdout_stream = &std.io.getStdOut().outStream().stream;
588
589 const arch = Target.parseArchTag(arch_name) catch {
590 std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name});
591 return;
592 };
593
594 const cpus = std.target.getCpusForArch(arch);
595
596 try stdout_stream.print("Available cpus for {}:\n", .{@tagName(arch)});
597
598 var longest_len: usize = 0;
599 for (cpus) |cpu| {
600 if (cpu.name.len > longest_len) {
601 longest_len = cpu.name.len;
602 }
603 }
604
605 for (cpus) |cpu| {
606 try stdout_stream.print(" {}", .{cpu.name});
607
608 var i: usize = 0;
609 while (i < longest_len - cpu.name.len) : (i += 1) {
610 try stdout_stream.write(" ");
611 }
612
613 try stdout_stream.write("\n");
614
615 if (show_dependencies and cpu.dependencies.len > 0) {
616 for (cpu.dependencies) |dependency| {
617 try stdout_stream.print(" {}\n", .{dependency.name});
618 }
619 }
620 }
621}547}
622548
623const Stage2CpuFeatures = struct {549const Stage2CpuFeatures = struct {
624 allocator: *mem.Allocator,550 allocator: *mem.Allocator,
625 cpu_features: Target.Cross.CpuFeatures,551 cpu_features: Target.Cross.CpuFeatures,
626552
627 llvm_cpu_name: ?[:0]const u8,553 llvm_cpu_name: ?[*:0]const u8,
628 llvm_features_str: ?[:0]const u8,554 llvm_features_str: ?[*:0]const u8,
629555
630 builtin_str: [:0]const u8,556 builtin_str: [:0]const u8,
631 cache_hash: [:0]const u8,557 cache_hash: [:0]const u8,
...@@ -636,10 +562,10 @@ const Stage2CpuFeatures = struct {...@@ -636,10 +562,10 @@ const Stage2CpuFeatures = struct {
636 const self = try allocator.create(Self);562 const self = try allocator.create(Self);
637 errdefer allocator.destroy(self);563 errdefer allocator.destroy(self);
638564
639 const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n");565 const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n", .{});
640 errdefer allocator.free(builtin_str);566 errdefer allocator.free(builtin_str);
641567
642 const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n");568 const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n", .{});
643 errdefer allocator.free(cache_hash);569 errdefer allocator.free(cache_hash);
644570
645 self.* = Self{571 self.* = Self{
...@@ -655,7 +581,7 @@ const Stage2CpuFeatures = struct {...@@ -655,7 +581,7 @@ const Stage2CpuFeatures = struct {
655581
656 fn createFromLLVM(582 fn createFromLLVM(
657 allocator: *mem.Allocator,583 allocator: *mem.Allocator,
658 arch: [*:0]const u8,584 arch_name: [*:0]const u8,
659 llvm_cpu_name_z: [*:0]const u8,585 llvm_cpu_name_z: [*:0]const u8,
660 llvm_cpu_features: [*:0]const u8,586 llvm_cpu_features: [*:0]const u8,
661 ) !*Self {587 ) !*Self {
...@@ -687,10 +613,11 @@ const Stage2CpuFeatures = struct {...@@ -687,10 +613,11 @@ const Stage2CpuFeatures = struct {
687 return error.InvalidLlvmCpuFeaturesFormat;613 return error.InvalidLlvmCpuFeaturesFormat;
688 }614 }
689 for (arch.allFeaturesList()) |feature, index| {615 for (arch.allFeaturesList()) |feature, index| {
690 if (mem.eql(u8, feature_name, feature.name)) {616 const this_llvm_name = feature.llvm_name orelse continue;
617 if (mem.eql(u8, llvm_feat, this_llvm_name)) {
691 switch (op) {618 switch (op) {
692 .add => set |= 1 << index,619 .add => set |= @as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index),
693 .sub => set &= ~@as(Target.Cpu.Feature.Set, 1 << index),620 .sub => set &= ~@as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index),
694 }621 }
695 break;622 break;
696 }623 }
...@@ -703,21 +630,19 @@ const Stage2CpuFeatures = struct {...@@ -703,21 +630,19 @@ const Stage2CpuFeatures = struct {
703 const self = try allocator.create(Self);630 const self = try allocator.create(Self);
704 errdefer allocator.destroy(self);631 errdefer allocator.destroy(self);
705632
706 const builtin_str = try std.fmt.allocPrint0(633 const builtin_str = try std.fmt.allocPrint0(allocator, "CpuFeatures{{ .cpu = &Target.{}.cpu.{} }};\n", .{
707 allocator,
708 "CpuFeatures{{ .cpu = &Arch.{}.cpu.{} }};\n",
709 arch.genericName(),634 arch.genericName(),
710 cpu.name,635 cpu.name,
711 );636 });
712 errdefer allocator.free(builtin_str);637 errdefer allocator.free(builtin_str);
713638
714 const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", cpu.name, cpu.features);639 const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", .{ cpu.name, cpu.features });
715 errdefer allocator.free(cache_hash);640 errdefer allocator.free(cache_hash);
716641
717 self.* = Self{642 self.* = Self{
718 .allocator = allocator,643 .allocator = allocator,
719 .cpu_features = .{ .cpu = cpu },644 .cpu_features = .{ .cpu = cpu },
720 .llvm_cpu_name = cpu.llvm_name,645 .llvm_cpu_name = if (cpu.llvm_name) |n| n.ptr else null,
721 .llvm_features_str = null,646 .llvm_features_str = null,
722 .builtin_str = builtin_str,647 .builtin_str = builtin_str,
723 .cache_hash = cache_hash,648 .cache_hash = cache_hash,
...@@ -728,20 +653,22 @@ const Stage2CpuFeatures = struct {...@@ -728,20 +653,22 @@ const Stage2CpuFeatures = struct {
728 fn createFromCpuFeatures(653 fn createFromCpuFeatures(
729 allocator: *mem.Allocator,654 allocator: *mem.Allocator,
730 arch: Target.Arch,655 arch: Target.Arch,
731 features: Target.Cpu.Feature.Set,656 feature_set: Target.Cpu.Feature.Set,
732 ) !*Self {657 ) !*Self {
733 const self = try allocator.create(Self);658 const self = try allocator.create(Self);
734 errdefer allocator.destroy(self);659 errdefer allocator.destroy(self);
735660
736 const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", features);661 const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", .{feature_set});
737 errdefer allocator.free(cache_hash);662 errdefer allocator.free(cache_hash);
738663
739 const generic_arch_name = arch.genericName();664 const generic_arch_name = arch.genericName();
740 var builtin_str_buffer = try std.Buffer.allocPrint(665 var builtin_str_buffer = try std.Buffer.allocPrint(
741 allocator,666 allocator,
742 "CpuFeatures{{ .features = Arch.{}.featureSet(&[_]Arch.{}.Feature{{\n",667 \\CpuFeatures{{
743 generic_arch_name,668 \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{
744 generic_arch_name,669 \\
670 ,
671 .{ generic_arch_name, generic_arch_name },
745 );672 );
746 defer builtin_str_buffer.deinit();673 defer builtin_str_buffer.deinit();
747674
...@@ -750,7 +677,8 @@ const Stage2CpuFeatures = struct {...@@ -750,7 +677,8 @@ const Stage2CpuFeatures = struct {
750677
751 // First, disable all features.678 // First, disable all features.
752 // This way, we only get the ones the user requests.679 // This way, we only get the ones the user requests.
753 for (arch.allFeatures()) |feature| {680 const all_features = arch.allFeaturesList();
681 for (all_features) |feature| {
754 if (feature.llvm_name) |llvm_name| {682 if (feature.llvm_name) |llvm_name| {
755 try llvm_features_buffer.append("-");683 try llvm_features_buffer.append("-");
756 try llvm_features_buffer.append(llvm_name);684 try llvm_features_buffer.append(llvm_name);
...@@ -758,14 +686,16 @@ const Stage2CpuFeatures = struct {...@@ -758,14 +686,16 @@ const Stage2CpuFeatures = struct {
758 }686 }
759 }687 }
760688
761 for (features) |feature| {689 for (all_features) |feature, index| {
690 if (!Target.Cpu.Feature.isEnabled(feature_set, @intCast(u7, index))) continue;
691
762 if (feature.llvm_name) |llvm_name| {692 if (feature.llvm_name) |llvm_name| {
763 try llvm_features_buffer.append("+");693 try llvm_features_buffer.append("+");
764 try llvm_features_buffer.append(llvm_name);694 try llvm_features_buffer.append(llvm_name);
765 try llvm_features_buffer.append(",");695 try llvm_features_buffer.append(",");
766 }696 }
767697
768 try builtin_str_buffer.append(" .");698 try builtin_str_buffer.append(" .");
769 try builtin_str_buffer.append(feature.name);699 try builtin_str_buffer.append(feature.name);
770 try builtin_str_buffer.append(",\n");700 try builtin_str_buffer.append(",\n");
771 }701 }
...@@ -774,13 +704,17 @@ const Stage2CpuFeatures = struct {...@@ -774,13 +704,17 @@ const Stage2CpuFeatures = struct {
774 llvm_features_buffer.shrink(llvm_features_buffer.len() - 1);704 llvm_features_buffer.shrink(llvm_features_buffer.len() - 1);
775 }705 }
776706
777 try builtin_str_buffer.append("})};\n");707 try builtin_str_buffer.append(
708 \\ }),
709 \\};
710 \\
711 );
778712
779 self.* = Self{713 self.* = Self{
780 .allocator = allocator,714 .allocator = allocator,
781 .cpu_features = .{ .features = features },715 .cpu_features = .{ .features = feature_set },
782 .llvm_cpu_name = null,716 .llvm_cpu_name = null,
783 .llvm_features_str = llvm_features_buffer.toOwnedSlice(),717 .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr,
784 .builtin_str = builtin_str_buffer.toOwnedSlice(),718 .builtin_str = builtin_str_buffer.toOwnedSlice(),
785 .cache_hash = cache_hash,719 .cache_hash = cache_hash,
786 };720 };
...@@ -790,7 +724,7 @@ const Stage2CpuFeatures = struct {...@@ -790,7 +724,7 @@ const Stage2CpuFeatures = struct {
790 fn destroy(self: *Self) void {724 fn destroy(self: *Self) void {
791 self.allocator.free(self.cache_hash);725 self.allocator.free(self.cache_hash);
792 self.allocator.free(self.builtin_str);726 self.allocator.free(self.builtin_str);
793 if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str);727 // TODO if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str);
794 self.allocator.destroy(self);728 self.allocator.destroy(self);
795 }729 }
796};730};
...@@ -803,6 +737,9 @@ export fn stage2_cpu_features_parse_cpu(...@@ -803,6 +737,9 @@ export fn stage2_cpu_features_parse_cpu(
803) Error {737) Error {
804 result.* = parseCpu(arch_name, cpu_name) catch |err| switch (err) {738 result.* = parseCpu(arch_name, cpu_name) catch |err| switch (err) {
805 error.OutOfMemory => return .OutOfMemory,739 error.OutOfMemory => return .OutOfMemory,
740 error.UnknownCpu => return .UnknownCpu,
741 error.UnknownArchitecture => return .UnknownArchitecture,
742 error.UnknownSubArchitecture => return .UnknownSubArchitecture,
806 };743 };
807 return .None;744 return .None;
808}745}
...@@ -821,6 +758,10 @@ export fn stage2_cpu_features_parse_features(...@@ -821,6 +758,10 @@ export fn stage2_cpu_features_parse_features(
821) Error {758) Error {
822 result.* = parseFeatures(arch_name, features_text) catch |err| switch (err) {759 result.* = parseFeatures(arch_name, features_text) catch |err| switch (err) {
823 error.OutOfMemory => return .OutOfMemory,760 error.OutOfMemory => return .OutOfMemory,
761 error.UnknownCpuFeature => return .UnknownCpuFeature,
762 error.InvalidCpuFeatures => return .InvalidCpuFeatures,
763 error.UnknownArchitecture => return .UnknownArchitecture,
764 error.UnknownSubArchitecture => return .UnknownSubArchitecture,
824 };765 };
825 return .None;766 return .None;
826}767}
...@@ -853,6 +794,9 @@ export fn stage2_cpu_features_llvm(...@@ -853,6 +794,9 @@ export fn stage2_cpu_features_llvm(
853 llvm_cpu_features,794 llvm_cpu_features,
854 ) catch |err| switch (err) {795 ) catch |err| switch (err) {
855 error.OutOfMemory => return .OutOfMemory,796 error.OutOfMemory => return .OutOfMemory,
797 error.UnknownArchitecture => return .UnknownArchitecture,
798 error.UnknownSubArchitecture => return .UnknownSubArchitecture,
799 error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat,
856 };800 };
857 return .None;801 return .None;
858}802}
src/error.cpp+5
...@@ -58,6 +58,11 @@ const char *err_str(Error err) {...@@ -58,6 +58,11 @@ const char *err_str(Error err) {
58 case ErrorNotLazy: return "not lazy";58 case ErrorNotLazy: return "not lazy";
59 case ErrorIsAsync: return "is async";59 case ErrorIsAsync: return "is async";
60 case ErrorImportOutsidePkgPath: return "import of file outside package path";60 case ErrorImportOutsidePkgPath: return "import of file outside package path";
61 case ErrorUnknownCpu: return "unknown CPU";
62 case ErrorUnknownSubArchitecture: return "unknown sub-architecture";
63 case ErrorUnknownCpuFeature: return "unknown CPU feature";
64 case ErrorInvalidCpuFeatures: return "invalid CPU features";
65 case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format";
61 }66 }
62 return "(invalid error)";67 return "(invalid error)";
63}68}
src/main.cpp+1-112
...@@ -131,11 +131,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {...@@ -131,11 +131,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
131 " --test-name-prefix [text] add prefix to all tests\n"131 " --test-name-prefix [text] add prefix to all tests\n"
132 " --test-cmd [arg] specify test execution command one arg at a time\n"132 " --test-cmd [arg] specify test execution command one arg at a time\n"
133 " --test-cmd-bin appends test binary path to test cmd args\n"133 " --test-cmd-bin appends test binary path to test cmd args\n"
134 "\n"
135 "Targets Options:\n"
136 " --list-features [arch] list available features for the given architecture\n"
137 " --list-cpus [arch] list available cpus for the given architecture\n"
138 " --show-dependencies list feature dependencies for each entry from --list-{features,cpus}\n"
139 , arg0);134 , arg0);
140 return return_code;135 return return_code;
141}136}
...@@ -160,88 +155,6 @@ static int print_libc_usage(const char *arg0, FILE *file, int return_code) {...@@ -160,88 +155,6 @@ static int print_libc_usage(const char *arg0, FILE *file, int return_code) {
160 return return_code;155 return return_code;
161}156}
162157
163static bool arch_available_in_llvm(ZigLLVM_ArchType arch) {
164 LLVMTargetRef target_ref;
165 char *err_msg = nullptr;
166 char triple_string[128];
167 sprintf(triple_string, "%s-unknown-unknown-unknown", ZigLLVMGetArchTypeName(arch));
168 return !LLVMGetTargetFromTriple(triple_string, &target_ref, &err_msg);
169}
170
171static int print_target_list(FILE *f) {
172 ZigTarget native;
173 get_native_target(&native);
174
175 fprintf(f, "Architectures:\n");
176 size_t arch_count = target_arch_count();
177 for (size_t arch_i = 0; arch_i < arch_count; arch_i += 1) {
178 ZigLLVM_ArchType arch = target_arch_enum(arch_i);
179 if (!arch_available_in_llvm(arch))
180 continue;
181 const char *arch_name = target_arch_name(arch);
182 SubArchList sub_arch_list = target_subarch_list(arch);
183 size_t sub_count = target_subarch_count(sub_arch_list);
184 const char *arch_native_str = (native.arch == arch) ? " (native)" : "";
185 fprintf(f, " %s%s\n", arch_name, arch_native_str);
186 for (size_t sub_i = 0; sub_i < sub_count; sub_i += 1) {
187 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
188 const char *sub_name = target_subarch_name(sub);
189 const char *sub_native_str = (native.arch == arch && native.sub_arch == sub) ? " (native)" : "";
190 fprintf(f, " %s%s\n", sub_name, sub_native_str);
191 }
192 }
193
194 fprintf(f, "\nOperating Systems:\n");
195 size_t os_count = target_os_count();
196 for (size_t i = 0; i < os_count; i += 1) {
197 Os os_type = target_os_enum(i);
198 const char *native_str = (native.os == os_type) ? " (native)" : "";
199 fprintf(f, " %s%s\n", target_os_name(os_type), native_str);
200 }
201
202 fprintf(f, "\nC ABIs:\n");
203 size_t abi_count = target_abi_count();
204 for (size_t i = 0; i < abi_count; i += 1) {
205 ZigLLVM_EnvironmentType abi = target_abi_enum(i);
206 const char *native_str = (native.abi == abi) ? " (native)" : "";
207 fprintf(f, " %s%s\n", target_abi_name(abi), native_str);
208 }
209
210 fprintf(f, "\nAvailable libcs:\n");
211 size_t libc_count = target_libc_count();
212 for (size_t i = 0; i < libc_count; i += 1) {
213 ZigTarget libc_target;
214 target_libc_enum(i, &libc_target);
215 bool is_native = native.arch == libc_target.arch &&
216 native.os == libc_target.os &&
217 native.abi == libc_target.abi;
218 const char *native_str = is_native ? " (native)" : "";
219 fprintf(f, " %s-%s-%s%s\n", target_arch_name(libc_target.arch),
220 target_os_name(libc_target.os), target_abi_name(libc_target.abi), native_str);
221 }
222
223 fprintf(f, "\nAvailable glibc versions:\n");
224 ZigGLibCAbi *glibc_abi;
225 Error err;
226 if ((err = glibc_load_metadata(&glibc_abi, get_zig_lib_dir(), true))) {
227 return EXIT_FAILURE;
228 }
229 for (size_t i = 0; i < glibc_abi->all_versions.length; i += 1) {
230 ZigGLibCVersion *this_ver = &glibc_abi->all_versions.at(i);
231 bool is_native = native.glibc_version != nullptr &&
232 native.glibc_version->major == this_ver->major &&
233 native.glibc_version->minor == this_ver->minor &&
234 native.glibc_version->patch == this_ver->patch;
235 const char *native_str = is_native ? " (native)" : "";
236 if (this_ver->patch == 0) {
237 fprintf(f, " %d.%d%s\n", this_ver->major, this_ver->minor, native_str);
238 } else {
239 fprintf(f, " %d.%d.%d%s\n", this_ver->major, this_ver->minor, this_ver->patch, native_str);
240 }
241 }
242 return EXIT_SUCCESS;
243}
244
245enum Cmd {158enum Cmd {
246 CmdNone,159 CmdNone,
247 CmdBuild,160 CmdBuild,
...@@ -538,10 +451,6 @@ int main(int argc, char **argv) {...@@ -538,10 +451,6 @@ int main(int argc, char **argv) {
538 const char *cpu = nullptr;451 const char *cpu = nullptr;
539 const char *features = nullptr;452 const char *features = nullptr;
540453
541 const char *targets_list_features_arch = nullptr;
542 const char *targets_list_cpus_arch = nullptr;
543 bool targets_show_dependencies = false;
544
545 ZigList<const char *> llvm_argv = {0};454 ZigList<const char *> llvm_argv = {0};
546 llvm_argv.append("zig (LLVM option parsing)");455 llvm_argv.append("zig (LLVM option parsing)");
547456
...@@ -792,8 +701,6 @@ int main(int argc, char **argv) {...@@ -792,8 +701,6 @@ int main(int argc, char **argv) {
792 cur_pkg = cur_pkg->parent;701 cur_pkg = cur_pkg->parent;
793 } else if (strcmp(arg, "-ffunction-sections") == 0) {702 } else if (strcmp(arg, "-ffunction-sections") == 0) {
794 function_sections = true;703 function_sections = true;
795 } else if (strcmp(arg, "--show-dependencies") == 0) {
796 targets_show_dependencies = true;
797 } else if (i + 1 >= argc) {704 } else if (i + 1 >= argc) {
798 fprintf(stderr, "Expected another argument after %s\n", arg);705 fprintf(stderr, "Expected another argument after %s\n", arg);
799 return print_error_usage(arg0);706 return print_error_usage(arg0);
...@@ -951,10 +858,6 @@ int main(int argc, char **argv) {...@@ -951,10 +858,6 @@ int main(int argc, char **argv) {
951 , argv[i]);858 , argv[i]);
952 return EXIT_FAILURE;859 return EXIT_FAILURE;
953 }860 }
954 } else if (strcmp(arg, "--list-features") == 0) {
955 targets_list_features_arch = argv[i];
956 } else if (strcmp(arg, "--list-cpus") == 0) {
957 targets_list_cpus_arch = argv[i];
958 } else if (strcmp(arg, "-target-cpu") == 0) {861 } else if (strcmp(arg, "-target-cpu") == 0) {
959 cpu = argv[i];862 cpu = argv[i];
960 } else if (strcmp(arg, "-target-feature") == 0) {863 } else if (strcmp(arg, "-target-feature") == 0) {
...@@ -1468,21 +1371,7 @@ int main(int argc, char **argv) {...@@ -1468,21 +1371,7 @@ int main(int argc, char **argv) {
1468 return main_exit(root_progress_node, EXIT_SUCCESS);1371 return main_exit(root_progress_node, EXIT_SUCCESS);
1469 }1372 }
1470 case CmdTargets:1373 case CmdTargets:
1471 if (targets_list_features_arch != nullptr) {1374 return stage2_cmd_targets();
1472 stage2_list_features_for_arch(
1473 targets_list_features_arch,
1474 strlen(targets_list_features_arch),
1475 targets_show_dependencies);
1476 return 0;
1477 } else if (targets_list_cpus_arch != nullptr) {
1478 stage2_list_cpus_for_arch(
1479 targets_list_cpus_arch,
1480 strlen(targets_list_cpus_arch),
1481 targets_show_dependencies);
1482 return 0;
1483 } else {
1484 return print_target_list(stdout);
1485 }
1486 case CmdNone:1375 case CmdNone:
1487 return print_full_usage(arg0, stderr, EXIT_FAILURE);1376 return print_full_usage(arg0, stderr, EXIT_FAILURE);
1488 }1377 }
src/userland.cpp+5-10
...@@ -89,16 +89,6 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {}...@@ -89,16 +89,6 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {}
89void stage2_progress_disable_tty(Stage2Progress *progress) {}89void stage2_progress_disable_tty(Stage2Progress *progress) {}
90void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){}90void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){}
9191
92void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {
93 const char *msg = "stage0 called stage2_list_features_for_arch";
94 stage2_panic(msg, strlen(msg));
95}
96
97void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {
98 const char *msg = "stage0 called stage2_list_cpus_for_arch";
99 stage2_panic(msg, strlen(msg));
100}
101
102struct Stage2CpuFeatures {92struct Stage2CpuFeatures {
103 const char *llvm_cpu_name;93 const char *llvm_cpu_name;
104 const char *llvm_cpu_features;94 const char *llvm_cpu_features;
...@@ -150,3 +140,8 @@ void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features,...@@ -150,3 +140,8 @@ void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features,
150 *ptr = cpu_features->builtin_str;140 *ptr = cpu_features->builtin_str;
151 *len = strlen(cpu_features->builtin_str);141 *len = strlen(cpu_features->builtin_str);
152}142}
143
144int stage2_cmd_targets(void) {
145 const char *msg = "stage0 called stage2_cmd_targets";
146 stage2_panic(msg, strlen(msg));
147}
src/userland.h+9-6
...@@ -78,6 +78,11 @@ enum Error {...@@ -78,6 +78,11 @@ enum Error {
78 ErrorNotLazy,78 ErrorNotLazy,
79 ErrorIsAsync,79 ErrorIsAsync,
80 ErrorImportOutsidePkgPath,80 ErrorImportOutsidePkgPath,
81 ErrorUnknownCpu,
82 ErrorUnknownSubArchitecture,
83 ErrorUnknownCpuFeature,
84 ErrorInvalidCpuFeatures,
85 ErrorInvalidLlvmCpuFeaturesFormat,
81};86};
8287
83// ABI warning88// ABI warning
...@@ -174,12 +179,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node);...@@ -174,12 +179,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node);
174ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node,179ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node,
175 size_t completed_count, size_t estimated_total_items);180 size_t completed_count, size_t estimated_total_items);
176181
177// ABI warning
178ZIG_EXTERN_C void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures);
179
180// ABI warning
181ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures);
182
183// ABI warning182// ABI warning
184struct Stage2CpuFeatures;183struct Stage2CpuFeatures;
185184
...@@ -212,4 +211,8 @@ ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeat...@@ -212,4 +211,8 @@ ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeat
212ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features,211ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features,
213 const char **ptr, size_t *len);212 const char **ptr, size_t *len);
214213
214// ABI warning
215ZIG_EXTERN_C int stage2_cmd_targets(void);
216
217
215#endif218#endif