authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-19 21:30:36-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-19 21:30:36-05:00
log84f1893c18c4ef12dbe268ed6d11a11966a9d447
treee2c3e3600464c62589a63c7f1bb0f7ffda3fee16
parent96f45c27b65307fe4abd5d1fb1cf314b1f493d8e
signaturelock-open Commit is signed but in an unrecognized format.

remove the concept of "sub-architecture"

in favor of CPU features. Also rearrange the `std.Target` data structure. * note: `@import("builtin")` was already deprecated in favor of `@import("std").builtin`. * `std.builtin.arch` is now deprecated in favor of `std.builtin.cpu.arch`. * `std.Target.CpuFeatures.Cpu` is now `std.Target.Cpu.Model`. * `std.Target.CpuFeatures` is now `std.Target.Cpu`. * `std.Target` no longer has an `arch` field. Instead it has a `cpu` field, which has `arch`, `model`, and `features`. * `std.Target` no longer has a `cpu_features` field. * `std.Target.Arch` is moved to `std.Target.Cpu.Arch` and it is an enum instead of a tagged union. * `std.Target.parseOs` is moved to `std.Target.Os.parse`. * `std.Target.parseAbi` is moved to `std.Target.Abi.parse`. * `std.Target.parseArchSub` is only for arch now and moved to `std.Target.Cpu.Arch.parse`. * `std.Target.parse` is improved to accept CPU name and features. * `std.Target.Arch.getBaselineCpuFeatures` is moved to `std.Target.Cpu.baseline`. * `std.Target.allCpus` is renamed to `std.Target.allCpuModels`. * `std.Target.defaultAbi` is moved to `std.Target.Abi.default`. * Significant cleanup of aarch64 and arm CPU features, resulting in the needed bit count for cpu feature set going from 174 to 138. * Add `std.Target.Cpu.Feature.Set.addFeatureSet` for merging feature sets together. `-target-feature` and `-target-cpu` are removed in favor of `-mcpu`, to conform to established conventions, and it gains additional power to support cpu features. The syntax is: -mcpu=name+on1+on2-off1-off2 closes #4261

28 files changed, 1739 insertions(+), 2225 deletions(-)

lib/std/builtin.zig+2-5
...@@ -6,8 +6,8 @@ pub const Target = std.Target;...@@ -6,8 +6,8 @@ pub const Target = std.Target;
6/// Deprecated: use `std.Target.Os`.6/// Deprecated: use `std.Target.Os`.
7pub const Os = std.Target.Os;7pub const Os = std.Target.Os;
88
9/// Deprecated: use `std.Target.Arch`.9/// Deprecated: use `std.Target.Cpu.Arch`.
10pub const Arch = std.Target.Arch;10pub const Arch = std.Target.Cpu.Arch;
1111
12/// Deprecated: use `std.Target.Abi`.12/// Deprecated: use `std.Target.Abi`.
13pub const Abi = std.Target.Abi;13pub const Abi = std.Target.Abi;
...@@ -18,9 +18,6 @@ pub const ObjectFormat = std.Target.ObjectFormat;...@@ -18,9 +18,6 @@ pub const ObjectFormat = std.Target.ObjectFormat;
18/// Deprecated: use `std.Target.SubSystem`.18/// Deprecated: use `std.Target.SubSystem`.
19pub const SubSystem = std.Target.SubSystem;19pub const SubSystem = std.Target.SubSystem;
2020
21/// Deprecated: use `std.Target.CpuFeatures`.
22pub const CpuFeatures = std.Target.CpuFeatures;
23
24/// Deprecated: use `std.Target.Cpu`.21/// Deprecated: use `std.Target.Cpu`.
25pub const Cpu = std.Target.Cpu;22pub const Cpu = std.Target.Cpu;
2623
lib/std/target.zig+550-642
...@@ -47,6 +47,18 @@ pub const Target = union(enum) {...@@ -47,6 +47,18 @@ pub const Target = union(enum) {
47 emscripten,47 emscripten,
48 uefi,48 uefi,
49 other,49 other,
50
51 pub fn parse(text: []const u8) !Os {
52 if (mem.eql(u8, text, "native")) return builtin.os;
53
54 const info = @typeInfo(Os);
55 inline for (info.Enum.fields) |field| {
56 if (mem.eql(u8, text, field.name)) {
57 return @field(Os, field.name);
58 }
59 }
60 return error.UnknownOperatingSystem;
61 }
50 };62 };
5163
52 pub const aarch64 = @import("target/aarch64.zig");64 pub const aarch64 = @import("target/aarch64.zig");
...@@ -65,457 +77,6 @@ pub const Target = union(enum) {...@@ -65,457 +77,6 @@ pub const Target = union(enum) {
65 pub const wasm = @import("target/wasm.zig");77 pub const wasm = @import("target/wasm.zig");
66 pub const x86 = @import("target/x86.zig");78 pub const x86 = @import("target/x86.zig");
6779
68 pub const Arch = union(enum) {
69 arm: Arm32,
70 armeb: Arm32,
71 aarch64: Arm64,
72 aarch64_be: Arm64,
73 aarch64_32: Arm64,
74 arc,
75 avr,
76 bpfel,
77 bpfeb,
78 hexagon,
79 mips,
80 mipsel,
81 mips64,
82 mips64el,
83 msp430,
84 powerpc,
85 powerpc64,
86 powerpc64le,
87 r600,
88 amdgcn,
89 riscv32,
90 riscv64,
91 sparc,
92 sparcv9,
93 sparcel,
94 s390x,
95 tce,
96 tcele,
97 thumb: Arm32,
98 thumbeb: Arm32,
99 i386,
100 x86_64,
101 xcore,
102 nvptx,
103 nvptx64,
104 le32,
105 le64,
106 amdil,
107 amdil64,
108 hsail,
109 hsail64,
110 spir,
111 spir64,
112 kalimba: Kalimba,
113 shave,
114 lanai,
115 wasm32,
116 wasm64,
117 renderscript32,
118 renderscript64,
119
120 pub const Arm32 = enum {
121 v8_5a,
122 v8_4a,
123 v8_3a,
124 v8_2a,
125 v8_1a,
126 v8a,
127 v8r,
128 v8m_baseline,
129 v8m_mainline,
130 v8_1m_mainline,
131 v7a,
132 v7em,
133 v7m,
134 v7s,
135 v7k,
136 v7ve,
137 v6,
138 v6m,
139 v6k,
140 v6t2,
141 v5,
142 v5te,
143 v4t,
144
145 pub fn version(version: Arm32) comptime_int {
146 return switch (version) {
147 .v8_5a, .v8_4a, .v8_3a, .v8_2a, .v8_1a, .v8a, .v8r, .v8m_baseline, .v8m_mainline, .v8_1m_mainline => 8,
148 .v7a, .v7em, .v7m, .v7s, .v7k, .v7ve => 7,
149 .v6, .v6m, .v6k, .v6t2 => 6,
150 .v5, .v5te => 5,
151 .v4t => 4,
152 };
153 }
154 };
155 pub const Arm64 = enum {
156 v8_5a,
157 v8_4a,
158 v8_3a,
159 v8_2a,
160 v8_1a,
161 v8a,
162 };
163 pub const Kalimba = enum {
164 v5,
165 v4,
166 v3,
167 };
168 pub const Mips = enum {
169 r6,
170 };
171
172 pub fn subArchName(arch: Arch) ?[]const u8 {
173 return switch (arch) {
174 .arm, .armeb, .thumb, .thumbeb => |arm32| @tagName(arm32),
175 .aarch64, .aarch64_be, .aarch64_32 => |arm64| @tagName(arm64),
176 .kalimba => |kalimba| @tagName(kalimba),
177 else => return null,
178 };
179 }
180
181 pub fn subArchFeature(arch: Arch) ?Cpu.Feature.Set.Index {
182 return switch (arch) {
183 .arm, .armeb, .thumb, .thumbeb => |arm32| switch (arm32) {
184 .v8_5a => @enumToInt(arm.Feature.armv8_5_a),
185 .v8_4a => @enumToInt(arm.Feature.armv8_4_a),
186 .v8_3a => @enumToInt(arm.Feature.armv8_3_a),
187 .v8_2a => @enumToInt(arm.Feature.armv8_2_a),
188 .v8_1a => @enumToInt(arm.Feature.armv8_1_a),
189 .v8a => @enumToInt(arm.Feature.armv8_a),
190 .v8r => @enumToInt(arm.Feature.armv8_r),
191 .v8m_baseline => @enumToInt(arm.Feature.armv8_m_base),
192 .v8m_mainline => @enumToInt(arm.Feature.armv8_m_main),
193 .v8_1m_mainline => @enumToInt(arm.Feature.armv8_1_m_main),
194 .v7a => @enumToInt(arm.Feature.armv7_a),
195 .v7em => @enumToInt(arm.Feature.armv7e_m),
196 .v7m => @enumToInt(arm.Feature.armv7_m),
197 .v7s => @enumToInt(arm.Feature.armv7s),
198 .v7k => @enumToInt(arm.Feature.armv7k),
199 .v7ve => @enumToInt(arm.Feature.armv7ve),
200 .v6 => @enumToInt(arm.Feature.armv6),
201 .v6m => @enumToInt(arm.Feature.armv6_m),
202 .v6k => @enumToInt(arm.Feature.armv6k),
203 .v6t2 => @enumToInt(arm.Feature.armv6t2),
204 .v5 => @enumToInt(arm.Feature.armv5t),
205 .v5te => @enumToInt(arm.Feature.armv5te),
206 .v4t => @enumToInt(arm.Feature.armv4t),
207 },
208 .aarch64, .aarch64_be, .aarch64_32 => |arm64| switch (arm64) {
209 .v8_5a => @enumToInt(aarch64.Feature.v8_5a),
210 .v8_4a => @enumToInt(aarch64.Feature.v8_4a),
211 .v8_3a => @enumToInt(aarch64.Feature.v8_3a),
212 .v8_2a => @enumToInt(aarch64.Feature.v8_2a),
213 .v8_1a => @enumToInt(aarch64.Feature.v8_1a),
214 .v8a => @enumToInt(aarch64.Feature.v8a),
215 },
216 else => return null,
217 };
218 }
219
220 pub fn isARM(arch: Arch) bool {
221 return switch (arch) {
222 .arm, .armeb => true,
223 else => false,
224 };
225 }
226
227 pub fn isThumb(arch: Arch) bool {
228 return switch (arch) {
229 .thumb, .thumbeb => true,
230 else => false,
231 };
232 }
233
234 pub fn isWasm(arch: Arch) bool {
235 return switch (arch) {
236 .wasm32, .wasm64 => true,
237 else => false,
238 };
239 }
240
241 pub fn isRISCV(arch: Arch) bool {
242 return switch (arch) {
243 .riscv32, .riscv64 => true,
244 else => false,
245 };
246 }
247
248 pub fn isMIPS(arch: Arch) bool {
249 return switch (arch) {
250 .mips, .mipsel, .mips64, .mips64el => true,
251 else => false,
252 };
253 }
254
255 pub fn parseCpu(arch: Arch, cpu_name: []const u8) !*const Cpu {
256 for (arch.allCpus()) |cpu| {
257 if (mem.eql(u8, cpu_name, cpu.name)) {
258 return cpu;
259 }
260 }
261 return error.UnknownCpu;
262 }
263
264 /// Comma-separated list of features, with + or - in front of each feature. This
265 /// form represents a deviation from baseline CPU, which is provided as a parameter.
266 /// Extra commas are ignored.
267 pub fn parseCpuFeatureSet(arch: Arch, cpu: *const Cpu, features_text: []const u8) !Cpu.Feature.Set {
268 const all_features = arch.allFeaturesList();
269 var set = cpu.features;
270 var it = mem.tokenize(features_text, ",");
271 while (it.next()) |item_text| {
272 var feature_name: []const u8 = undefined;
273 var op: enum {
274 add,
275 sub,
276 } = undefined;
277 if (mem.startsWith(u8, item_text, "+")) {
278 op = .add;
279 feature_name = item_text[1..];
280 } else if (mem.startsWith(u8, item_text, "-")) {
281 op = .sub;
282 feature_name = item_text[1..];
283 } else {
284 return error.InvalidCpuFeatures;
285 }
286 for (all_features) |feature, index_usize| {
287 const index = @intCast(Cpu.Feature.Set.Index, index_usize);
288 if (mem.eql(u8, feature_name, feature.name)) {
289 switch (op) {
290 .add => set.addFeature(index),
291 .sub => set.removeFeature(index),
292 }
293 break;
294 }
295 } else {
296 return error.UnknownCpuFeature;
297 }
298 }
299 return set;
300 }
301
302 pub fn toElfMachine(arch: Arch) std.elf.EM {
303 return switch (arch) {
304 .avr => ._AVR,
305 .msp430 => ._MSP430,
306 .arc => ._ARC,
307 .arm => ._ARM,
308 .armeb => ._ARM,
309 .hexagon => ._HEXAGON,
310 .le32 => ._NONE,
311 .mips => ._MIPS,
312 .mipsel => ._MIPS_RS3_LE,
313 .powerpc => ._PPC,
314 .r600 => ._NONE,
315 .riscv32 => ._RISCV,
316 .sparc => ._SPARC,
317 .sparcel => ._SPARC,
318 .tce => ._NONE,
319 .tcele => ._NONE,
320 .thumb => ._ARM,
321 .thumbeb => ._ARM,
322 .i386 => ._386,
323 .xcore => ._XCORE,
324 .nvptx => ._NONE,
325 .amdil => ._NONE,
326 .hsail => ._NONE,
327 .spir => ._NONE,
328 .kalimba => ._CSR_KALIMBA,
329 .shave => ._NONE,
330 .lanai => ._LANAI,
331 .wasm32 => ._NONE,
332 .renderscript32 => ._NONE,
333 .aarch64_32 => ._AARCH64,
334 .aarch64 => ._AARCH64,
335 .aarch64_be => ._AARCH64,
336 .mips64 => ._MIPS,
337 .mips64el => ._MIPS_RS3_LE,
338 .powerpc64 => ._PPC64,
339 .powerpc64le => ._PPC64,
340 .riscv64 => ._RISCV,
341 .x86_64 => ._X86_64,
342 .nvptx64 => ._NONE,
343 .le64 => ._NONE,
344 .amdil64 => ._NONE,
345 .hsail64 => ._NONE,
346 .spir64 => ._NONE,
347 .wasm64 => ._NONE,
348 .renderscript64 => ._NONE,
349 .amdgcn => ._NONE,
350 .bpfel => ._BPF,
351 .bpfeb => ._BPF,
352 .sparcv9 => ._SPARCV9,
353 .s390x => ._S390,
354 };
355 }
356
357 pub fn endian(arch: Arch) builtin.Endian {
358 return switch (arch) {
359 .avr,
360 .arm,
361 .aarch64_32,
362 .aarch64,
363 .amdgcn,
364 .amdil,
365 .amdil64,
366 .bpfel,
367 .hexagon,
368 .hsail,
369 .hsail64,
370 .kalimba,
371 .le32,
372 .le64,
373 .mipsel,
374 .mips64el,
375 .msp430,
376 .nvptx,
377 .nvptx64,
378 .sparcel,
379 .tcele,
380 .powerpc64le,
381 .r600,
382 .riscv32,
383 .riscv64,
384 .i386,
385 .x86_64,
386 .wasm32,
387 .wasm64,
388 .xcore,
389 .thumb,
390 .spir,
391 .spir64,
392 .renderscript32,
393 .renderscript64,
394 .shave,
395 => .Little,
396
397 .arc,
398 .armeb,
399 .aarch64_be,
400 .bpfeb,
401 .mips,
402 .mips64,
403 .powerpc,
404 .powerpc64,
405 .thumbeb,
406 .sparc,
407 .sparcv9,
408 .tce,
409 .lanai,
410 .s390x,
411 => .Big,
412 };
413 }
414
415 /// Returns a name that matches the lib/std/target/* directory name.
416 pub fn genericName(arch: Arch) []const u8 {
417 return switch (arch) {
418 .arm, .armeb, .thumb, .thumbeb => "arm",
419 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
420 .avr => "avr",
421 .bpfel, .bpfeb => "bpf",
422 .hexagon => "hexagon",
423 .mips, .mipsel, .mips64, .mips64el => "mips",
424 .msp430 => "msp430",
425 .powerpc, .powerpc64, .powerpc64le => "powerpc",
426 .amdgcn => "amdgpu",
427 .riscv32, .riscv64 => "riscv",
428 .sparc, .sparcv9, .sparcel => "sparc",
429 .s390x => "systemz",
430 .i386, .x86_64 => "x86",
431 .nvptx, .nvptx64 => "nvptx",
432 .wasm32, .wasm64 => "wasm",
433 else => @tagName(arch),
434 };
435 }
436
437 /// All CPU features Zig is aware of, sorted lexicographically by name.
438 pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
439 return switch (arch) {
440 .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
441 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
442 .avr => &avr.all_features,
443 .bpfel, .bpfeb => &bpf.all_features,
444 .hexagon => &hexagon.all_features,
445 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
446 .msp430 => &msp430.all_features,
447 .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
448 .amdgcn => &amdgpu.all_features,
449 .riscv32, .riscv64 => &riscv.all_features,
450 .sparc, .sparcv9, .sparcel => &sparc.all_features,
451 .s390x => &systemz.all_features,
452 .i386, .x86_64 => &x86.all_features,
453 .nvptx, .nvptx64 => &nvptx.all_features,
454 .wasm32, .wasm64 => &wasm.all_features,
455
456 else => &[0]Cpu.Feature{},
457 };
458 }
459
460 /// The "default" set of CPU features for cross-compiling. A conservative set
461 /// of features that is expected to be supported on most available hardware.
462 pub fn getBaselineCpuFeatures(arch: Arch) CpuFeatures {
463 const S = struct {
464 const generic_cpu = Cpu{
465 .name = "generic",
466 .llvm_name = null,
467 .features = Cpu.Feature.Set.empty,
468 };
469 };
470 const cpu = switch (arch) {
471 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.generic,
472 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic,
473 .avr => &avr.cpu.avr1,
474 .bpfel, .bpfeb => &bpf.cpu.generic,
475 .hexagon => &hexagon.cpu.generic,
476 .mips, .mipsel => &mips.cpu.mips32,
477 .mips64, .mips64el => &mips.cpu.mips64,
478 .msp430 => &msp430.cpu.generic,
479 .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic,
480 .amdgcn => &amdgpu.cpu.generic,
481 .riscv32 => &riscv.cpu.baseline_rv32,
482 .riscv64 => &riscv.cpu.baseline_rv64,
483 .sparc, .sparcv9, .sparcel => &sparc.cpu.generic,
484 .s390x => &systemz.cpu.generic,
485 .i386 => &x86.cpu.pentium4,
486 .x86_64 => &x86.cpu.x86_64,
487 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
488 .wasm32, .wasm64 => &wasm.cpu.generic,
489
490 else => &S.generic_cpu,
491 };
492 return CpuFeatures.initFromCpu(arch, cpu);
493 }
494
495 /// All CPUs Zig is aware of, sorted lexicographically by name.
496 pub fn allCpus(arch: Arch) []const *const Cpu {
497 return switch (arch) {
498 .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
499 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
500 .avr => avr.all_cpus,
501 .bpfel, .bpfeb => bpf.all_cpus,
502 .hexagon => hexagon.all_cpus,
503 .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
504 .msp430 => msp430.all_cpus,
505 .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
506 .amdgcn => amdgpu.all_cpus,
507 .riscv32, .riscv64 => riscv.all_cpus,
508 .sparc, .sparcv9, .sparcel => sparc.all_cpus,
509 .s390x => systemz.all_cpus,
510 .i386, .x86_64 => x86.all_cpus,
511 .nvptx, .nvptx64 => nvptx.all_cpus,
512 .wasm32, .wasm64 => wasm.all_cpus,
513
514 else => &[0]*const Cpu{},
515 };
516 }
517 };
518
519 pub const Abi = enum {80 pub const Abi = enum {
520 none,81 none,
521 gnu,82 gnu,
...@@ -539,11 +100,104 @@ pub const Target = union(enum) {...@@ -539,11 +100,104 @@ pub const Target = union(enum) {
539 coreclr,100 coreclr,
540 simulator,101 simulator,
541 macabi,102 macabi,
103
104 pub fn default(arch: Cpu.Arch, target_os: Os) Abi {
105 switch (arch) {
106 .wasm32, .wasm64 => return .musl,
107 else => {},
108 }
109 switch (target_os) {
110 .freestanding,
111 .ananas,
112 .cloudabi,
113 .dragonfly,
114 .lv2,
115 .solaris,
116 .haiku,
117 .minix,
118 .rtems,
119 .nacl,
120 .cnk,
121 .aix,
122 .cuda,
123 .nvcl,
124 .amdhsa,
125 .ps4,
126 .elfiamcu,
127 .mesa3d,
128 .contiki,
129 .amdpal,
130 .hermit,
131 .other,
132 => return .eabi,
133 .openbsd,
134 .macosx,
135 .freebsd,
136 .ios,
137 .tvos,
138 .watchos,
139 .fuchsia,
140 .kfreebsd,
141 .netbsd,
142 .hurd,
143 => return .gnu,
144 .windows,
145 .uefi,
146 => return .msvc,
147 .linux,
148 .wasi,
149 .emscripten,
150 => return .musl,
151 }
152 }
153
154 pub fn parse(text: []const u8) !Abi {
155 if (mem.eql(u8, text, "native")) return builtin.abi;
156
157 const info = @typeInfo(Abi);
158 inline for (info.Enum.fields) |field| {
159 if (mem.eql(u8, text, field.name)) {
160 return @field(Abi, field.name);
161 }
162 }
163 return error.UnknownApplicationBinaryInterface;
164 }
165 };
166
167 pub const ObjectFormat = enum {
168 unknown,
169 coff,
170 elf,
171 macho,
172 wasm,
173 };
174
175 pub const SubSystem = enum {
176 Console,
177 Windows,
178 Posix,
179 Native,
180 EfiApplication,
181 EfiBootServiceDriver,
182 EfiRom,
183 EfiRuntimeDriver,
184 };
185
186 pub const Cross = struct {
187 cpu: Cpu,
188 os: Os,
189 abi: Abi,
542 };190 };
543191
544 pub const Cpu = struct {192 pub const Cpu = struct {
545 name: []const u8,193 /// Architecture
546 llvm_name: ?[:0]const u8,194 arch: Arch,
195
196 /// The CPU model to target. It has a set of features
197 /// which are overridden with the `features` field.
198 model: *const Model,
199
200 /// An explicit list of the entire CPU feature set. It may differ from the specific CPU model's features.
547 features: Feature.Set,201 features: Feature.Set,
548202
549 pub const Feature = struct {203 pub const Feature = struct {
...@@ -569,7 +223,7 @@ pub const Target = union(enum) {...@@ -569,7 +223,7 @@ pub const Target = union(enum) {
569 pub const Set = struct {223 pub const Set = struct {
570 ints: [usize_count]usize,224 ints: [usize_count]usize,
571225
572 pub const needed_bit_count = 174;226 pub const needed_bit_count = 138;
573 pub const byte_count = (needed_bit_count + 7) / 8;227 pub const byte_count = (needed_bit_count + 7) / 8;
574 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);228 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
575 pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize)));229 pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize)));
...@@ -593,6 +247,12 @@ pub const Target = union(enum) {...@@ -593,6 +247,12 @@ pub const Target = union(enum) {
593 set.ints[usize_index] |= @as(usize, 1) << bit_index;247 set.ints[usize_index] |= @as(usize, 1) << bit_index;
594 }248 }
595249
250 /// Adds the specified feature set but not its dependencies.
251 pub fn addFeatureSet(set: *Set, other_set: Set) void {
252 set.ints = @as(@Vector(usize_count, usize), set.ints) |
253 @as(@Vector(usize_count, usize), other_set.ints);
254 }
255
596 /// Removes the specified feature but not its dependents.256 /// Removes the specified feature but not its dependents.
597 pub fn removeFeature(set: *Set, arch_feature_index: Index) void {257 pub fn removeFeature(set: *Set, arch_feature_index: Index) void {
598 const usize_index = arch_feature_index / @bitSizeOf(usize);258 const usize_index = arch_feature_index / @bitSizeOf(usize);
...@@ -608,8 +268,7 @@ pub const Target = union(enum) {...@@ -608,8 +268,7 @@ pub const Target = union(enum) {
608 for (all_features_list) |feature, index_usize| {268 for (all_features_list) |feature, index_usize| {
609 const index = @intCast(Index, index_usize);269 const index = @intCast(Index, index_usize);
610 if (set.isEnabled(index)) {270 if (set.isEnabled(index)) {
611 set.ints = @as(@Vector(usize_count, usize), set.ints) |271 set.addFeatureSet(feature.dependencies);
612 @as(@Vector(usize_count, usize), feature.dependencies.ints);
613 }272 }
614 }273 }
615 const nothing_changed = mem.eql(usize, &old, &set.ints);274 const nothing_changed = mem.eql(usize, &old, &set.ints);
...@@ -644,77 +303,362 @@ pub const Target = union(enum) {...@@ -644,77 +303,362 @@ pub const Target = union(enum) {
644 };303 };
645 }304 }
646 };305 };
647 };
648306
649 pub const ObjectFormat = enum {307 pub const Arch = enum {
650 unknown,308 arm,
651 coff,309 armeb,
652 elf,310 aarch64,
653 macho,311 aarch64_be,
654 wasm,312 aarch64_32,
655 };313 arc,
314 avr,
315 bpfel,
316 bpfeb,
317 hexagon,
318 mips,
319 mipsel,
320 mips64,
321 mips64el,
322 msp430,
323 powerpc,
324 powerpc64,
325 powerpc64le,
326 r600,
327 amdgcn,
328 riscv32,
329 riscv64,
330 sparc,
331 sparcv9,
332 sparcel,
333 s390x,
334 tce,
335 tcele,
336 thumb,
337 thumbeb,
338 i386,
339 x86_64,
340 xcore,
341 nvptx,
342 nvptx64,
343 le32,
344 le64,
345 amdil,
346 amdil64,
347 hsail,
348 hsail64,
349 spir,
350 spir64,
351 kalimba,
352 shave,
353 lanai,
354 wasm32,
355 wasm64,
356 renderscript32,
357 renderscript64,
358
359 pub fn isARM(arch: Arch) bool {
360 return switch (arch) {
361 .arm, .armeb => true,
362 else => false,
363 };
364 }
656365
657 pub const SubSystem = enum {366 pub fn isThumb(arch: Arch) bool {
658 Console,367 return switch (arch) {
659 Windows,368 .thumb, .thumbeb => true,
660 Posix,369 else => false,
661 Native,370 };
662 EfiApplication,371 }
663 EfiBootServiceDriver,
664 EfiRom,
665 EfiRuntimeDriver,
666 };
667372
668 pub const Cross = struct {373 pub fn isWasm(arch: Arch) bool {
669 arch: Arch,374 return switch (arch) {
670 os: Os,375 .wasm32, .wasm64 => true,
671 abi: Abi,376 else => false,
672 cpu_features: CpuFeatures,377 };
673 };378 }
674379
675 pub const CpuFeatures = struct {380 pub fn isRISCV(arch: Arch) bool {
676 /// The CPU to target. It has a set of features381 return switch (arch) {
677 /// which are overridden with the `features` field.382 .riscv32, .riscv64 => true,
678 cpu: *const Cpu,383 else => false,
384 };
385 }
386
387 pub fn isMIPS(arch: Arch) bool {
388 return switch (arch) {
389 .mips, .mipsel, .mips64, .mips64el => true,
390 else => false,
391 };
392 }
393
394 pub fn parseCpuModel(arch: Arch, cpu_name: []const u8) !*const Cpu.Model {
395 for (arch.allCpuModels()) |cpu| {
396 if (mem.eql(u8, cpu_name, cpu.name)) {
397 return cpu;
398 }
399 }
400 return error.UnknownCpu;
401 }
402
403 pub fn toElfMachine(arch: Arch) std.elf.EM {
404 return switch (arch) {
405 .avr => ._AVR,
406 .msp430 => ._MSP430,
407 .arc => ._ARC,
408 .arm => ._ARM,
409 .armeb => ._ARM,
410 .hexagon => ._HEXAGON,
411 .le32 => ._NONE,
412 .mips => ._MIPS,
413 .mipsel => ._MIPS_RS3_LE,
414 .powerpc => ._PPC,
415 .r600 => ._NONE,
416 .riscv32 => ._RISCV,
417 .sparc => ._SPARC,
418 .sparcel => ._SPARC,
419 .tce => ._NONE,
420 .tcele => ._NONE,
421 .thumb => ._ARM,
422 .thumbeb => ._ARM,
423 .i386 => ._386,
424 .xcore => ._XCORE,
425 .nvptx => ._NONE,
426 .amdil => ._NONE,
427 .hsail => ._NONE,
428 .spir => ._NONE,
429 .kalimba => ._CSR_KALIMBA,
430 .shave => ._NONE,
431 .lanai => ._LANAI,
432 .wasm32 => ._NONE,
433 .renderscript32 => ._NONE,
434 .aarch64_32 => ._AARCH64,
435 .aarch64 => ._AARCH64,
436 .aarch64_be => ._AARCH64,
437 .mips64 => ._MIPS,
438 .mips64el => ._MIPS_RS3_LE,
439 .powerpc64 => ._PPC64,
440 .powerpc64le => ._PPC64,
441 .riscv64 => ._RISCV,
442 .x86_64 => ._X86_64,
443 .nvptx64 => ._NONE,
444 .le64 => ._NONE,
445 .amdil64 => ._NONE,
446 .hsail64 => ._NONE,
447 .spir64 => ._NONE,
448 .wasm64 => ._NONE,
449 .renderscript64 => ._NONE,
450 .amdgcn => ._NONE,
451 .bpfel => ._BPF,
452 .bpfeb => ._BPF,
453 .sparcv9 => ._SPARCV9,
454 .s390x => ._S390,
455 };
456 }
457
458 pub fn endian(arch: Arch) builtin.Endian {
459 return switch (arch) {
460 .avr,
461 .arm,
462 .aarch64_32,
463 .aarch64,
464 .amdgcn,
465 .amdil,
466 .amdil64,
467 .bpfel,
468 .hexagon,
469 .hsail,
470 .hsail64,
471 .kalimba,
472 .le32,
473 .le64,
474 .mipsel,
475 .mips64el,
476 .msp430,
477 .nvptx,
478 .nvptx64,
479 .sparcel,
480 .tcele,
481 .powerpc64le,
482 .r600,
483 .riscv32,
484 .riscv64,
485 .i386,
486 .x86_64,
487 .wasm32,
488 .wasm64,
489 .xcore,
490 .thumb,
491 .spir,
492 .spir64,
493 .renderscript32,
494 .renderscript64,
495 .shave,
496 => .Little,
497
498 .arc,
499 .armeb,
500 .aarch64_be,
501 .bpfeb,
502 .mips,
503 .mips64,
504 .powerpc,
505 .powerpc64,
506 .thumbeb,
507 .sparc,
508 .sparcv9,
509 .tce,
510 .lanai,
511 .s390x,
512 => .Big,
513 };
514 }
515
516 /// Returns a name that matches the lib/std/target/* directory name.
517 pub fn genericName(arch: Arch) []const u8 {
518 return switch (arch) {
519 .arm, .armeb, .thumb, .thumbeb => "arm",
520 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
521 .avr => "avr",
522 .bpfel, .bpfeb => "bpf",
523 .hexagon => "hexagon",
524 .mips, .mipsel, .mips64, .mips64el => "mips",
525 .msp430 => "msp430",
526 .powerpc, .powerpc64, .powerpc64le => "powerpc",
527 .amdgcn => "amdgpu",
528 .riscv32, .riscv64 => "riscv",
529 .sparc, .sparcv9, .sparcel => "sparc",
530 .s390x => "systemz",
531 .i386, .x86_64 => "x86",
532 .nvptx, .nvptx64 => "nvptx",
533 .wasm32, .wasm64 => "wasm",
534 else => @tagName(arch),
535 };
536 }
679537
680 /// Explicitly provide the entire CPU feature set.538 /// All CPU features Zig is aware of, sorted lexicographically by name.
681 features: Cpu.Feature.Set,539 pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
540 return switch (arch) {
541 .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
542 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
543 .avr => &avr.all_features,
544 .bpfel, .bpfeb => &bpf.all_features,
545 .hexagon => &hexagon.all_features,
546 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
547 .msp430 => &msp430.all_features,
548 .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
549 .amdgcn => &amdgpu.all_features,
550 .riscv32, .riscv64 => &riscv.all_features,
551 .sparc, .sparcv9, .sparcel => &sparc.all_features,
552 .s390x => &systemz.all_features,
553 .i386, .x86_64 => &x86.all_features,
554 .nvptx, .nvptx64 => &nvptx.all_features,
555 .wasm32, .wasm64 => &wasm.all_features,
556
557 else => &[0]Cpu.Feature{},
558 };
559 }
560
561 /// All processors Zig is aware of, sorted lexicographically by name.
562 pub fn allCpuModels(arch: Arch) []const *const Cpu.Model {
563 return switch (arch) {
564 .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
565 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
566 .avr => avr.all_cpus,
567 .bpfel, .bpfeb => bpf.all_cpus,
568 .hexagon => hexagon.all_cpus,
569 .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
570 .msp430 => msp430.all_cpus,
571 .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
572 .amdgcn => amdgpu.all_cpus,
573 .riscv32, .riscv64 => riscv.all_cpus,
574 .sparc, .sparcv9, .sparcel => sparc.all_cpus,
575 .s390x => systemz.all_cpus,
576 .i386, .x86_64 => x86.all_cpus,
577 .nvptx, .nvptx64 => nvptx.all_cpus,
578 .wasm32, .wasm64 => wasm.all_cpus,
579
580 else => &[0]*const Model{},
581 };
582 }
583
584 pub fn parse(text: []const u8) !Arch {
585 if (mem.eql(u8, text, "native")) return builtin.arch;
586
587 const info = @typeInfo(Arch);
588 inline for (info.Enum.fields) |field| {
589 if (mem.eql(u8, text, field.name)) {
590 return @as(Arch, @field(Arch, field.name));
591 }
592 }
593 return error.UnknownArchitecture;
594 }
595 };
682596
683 pub fn initFromCpu(arch: Arch, cpu: *const Cpu) CpuFeatures {597 pub const Model = struct {
684 var features = cpu.features;598 name: []const u8,
685 if (arch.subArchFeature()) |sub_arch_index| {599 llvm_name: ?[:0]const u8,
686 features.addFeature(sub_arch_index);600 features: Feature.Set,
601
602 pub fn toCpu(model: *const Model, arch: Arch) Cpu {
603 var features = model.features;
604 features.populateDependencies(arch.allFeaturesList());
605 return .{
606 .arch = arch,
607 .model = model,
608 .features = features,
609 };
687 }610 }
688 features.populateDependencies(arch.allFeaturesList());611 };
689 return CpuFeatures{612
690 .cpu = cpu,613 /// The "default" set of CPU features for cross-compiling. A conservative set
691 .features = features,614 /// of features that is expected to be supported on most available hardware.
615 pub fn baseline(arch: Arch) Cpu {
616 const S = struct {
617 const generic_model = Model{
618 .name = "generic",
619 .llvm_name = null,
620 .features = Cpu.Feature.Set.empty,
621 };
622 };
623 const model = switch (arch) {
624 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
625 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic,
626 .avr => &avr.cpu.avr1,
627 .bpfel, .bpfeb => &bpf.cpu.generic,
628 .hexagon => &hexagon.cpu.generic,
629 .mips, .mipsel => &mips.cpu.mips32,
630 .mips64, .mips64el => &mips.cpu.mips64,
631 .msp430 => &msp430.cpu.generic,
632 .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic,
633 .amdgcn => &amdgpu.cpu.generic,
634 .riscv32 => &riscv.cpu.baseline_rv32,
635 .riscv64 => &riscv.cpu.baseline_rv64,
636 .sparc, .sparcv9, .sparcel => &sparc.cpu.generic,
637 .s390x => &systemz.cpu.generic,
638 .i386 => &x86.cpu.pentium4,
639 .x86_64 => &x86.cpu.x86_64,
640 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
641 .wasm32, .wasm64 => &wasm.cpu.generic,
642
643 else => &S.generic_model,
692 };644 };
645 return model.toCpu(arch);
693 }646 }
694 };647 };
695648
696 pub const current = Target{649 pub const current = Target{
697 .Cross = Cross{650 .Cross = Cross{
698 .arch = builtin.arch,651 .cpu = builtin.cpu,
699 .os = builtin.os,652 .os = builtin.os,
700 .abi = builtin.abi,653 .abi = builtin.abi,
701 .cpu_features = builtin.cpu_features,
702 },654 },
703 };655 };
704656
705 pub const stack_align = 16;657 pub const stack_align = 16;
706658
707 pub fn getCpuFeatures(self: Target) CpuFeatures {
708 return switch (self) {
709 .Native => builtin.cpu_features,
710 .Cross => |cross| cross.cpu_features,
711 };
712 }
713
714 pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 {659 pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 {
715 return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{660 return std.fmt.allocPrint(allocator, "{}-{}-{}", .{
716 @tagName(self.getArch()),661 @tagName(self.getArch()),
717 Target.archSubArchName(self.getArch()),
718 @tagName(self.getOs()),662 @tagName(self.getOs()),
719 @tagName(self.getAbi()),663 @tagName(self.getAbi()),
720 });664 });
...@@ -776,139 +720,81 @@ pub const Target = union(enum) {...@@ -776,139 +720,81 @@ pub const Target = union(enum) {
776 });720 });
777 }721 }
778722
779 /// TODO: Support CPU features here?723 pub const ParseOptions = struct {
780 /// https://github.com/ziglang/zig/issues/4261724 /// This is sometimes called a "triple". It looks roughly like this:
781 pub fn parse(text: []const u8) !Target {725 /// riscv64-linux-gnu
782 var it = mem.separate(text, "-");726 /// The fields are, respectively:
727 /// * CPU Architecture
728 /// * Operating System
729 /// * C ABI (optional)
730 /// "native" can be used for any of the fields.
731 arch_os_abi: []const u8,
732
733 /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"
734 /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features
735 /// to remove from the set.
736 /// The default value of `null` means to use the "baseline" feature set.
737 /// "native" can be used to perform CPU introspection.
738 cpu: ?[]const u8 = null,
739 };
740
741 pub fn parse(args: ParseOptions) !Target {
742 var it = mem.separate(args.arch_os_abi, "-");
783 const arch_name = it.next() orelse return error.MissingArchitecture;743 const arch_name = it.next() orelse return error.MissingArchitecture;
784 const os_name = it.next() orelse return error.MissingOperatingSystem;744 const os_name = it.next() orelse return error.MissingOperatingSystem;
785 const abi_name = it.next();745 const abi_name = it.next();
786 const arch = try parseArchSub(arch_name);746 if (it.next() != null) return error.UnexpectedExtraField;
787747
788 var cross = Cross{748 const arch = try Cpu.Arch.parse(arch_name);
789 .arch = arch,749 const os = try Os.parse(os_name);
790 .cpu_features = arch.getBaselineCpuFeatures(),750 const abi = if (abi_name) |n| try Abi.parse(n) else Abi.default(arch, os);
791 .os = try parseOs(os_name),
792 .abi = undefined,
793 };
794 cross.abi = if (abi_name) |n| try parseAbi(n) else defaultAbi(cross.arch, cross.os);
795 return Target{ .Cross = cross };
796 }
797751
798 pub fn defaultAbi(arch: Arch, target_os: Os) Abi {752 const all_features = arch.allFeaturesList();
799 switch (arch) {753 const cpu: Cpu = if (args.cpu) |cpu_text| blk: {
800 .wasm32, .wasm64 => return .musl,754 var index: usize = 0;
801 else => {},755 while (index < cpu_text.len and cpu_text[index] != '+' and cpu_text[index] != '-') {
802 }756 index += 1;
803 switch (target_os) {757 }
804 .freestanding,758 const cpu_name = cpu_text[0..index];
805 .ananas,759 const cpu_model = try arch.parseCpuModel(cpu_name);
806 .cloudabi,760
807 .dragonfly,761 var set = cpu_model.features;
808 .lv2,762 while (index < cpu_text.len) {
809 .solaris,763 const op = cpu_text[index];
810 .haiku,764 index += 1;
811 .minix,765 const start = index;
812 .rtems,766 while (index < cpu_text.len and cpu_text[index] != '+' and cpu_text[index] != '-') {
813 .nacl,767 index += 1;
814 .cnk,768 }
815 .aix,769 const feature_name = cpu_text[start..index];
816 .cuda,770 for (all_features) |feature, feat_index_usize| {
817 .nvcl,771 const feat_index = @intCast(Cpu.Feature.Set.Index, feat_index_usize);
818 .amdhsa,772 if (mem.eql(u8, feature_name, feature.name)) {
819 .ps4,773 switch (op) {
820 .elfiamcu,774 '+' => set.addFeature(feat_index),
821 .mesa3d,775 '-' => set.removeFeature(feat_index),
822 .contiki,776 else => unreachable,
823 .amdpal,
824 .hermit,
825 .other,
826 => return .eabi,
827 .openbsd,
828 .macosx,
829 .freebsd,
830 .ios,
831 .tvos,
832 .watchos,
833 .fuchsia,
834 .kfreebsd,
835 .netbsd,
836 .hurd,
837 => return .gnu,
838 .windows,
839 .uefi,
840 => return .msvc,
841 .linux,
842 .wasi,
843 .emscripten,
844 => return .musl,
845 }
846 }
847
848 pub const ParseArchSubError = error{
849 UnknownArchitecture,
850 UnknownSubArchitecture,
851 };
852
853 pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch {
854 const info = @typeInfo(Arch);
855 inline for (info.Union.fields) |field| {
856 if (mem.startsWith(u8, text, field.name)) {
857 if (field.field_type == void) {
858 return @as(Arch, @field(Arch, field.name));
859 } else {
860 const sub_info = @typeInfo(field.field_type);
861 inline for (sub_info.Enum.fields) |sub_field| {
862 const combined = field.name ++ sub_field.name;
863 if (mem.eql(u8, text, combined)) {
864 return @unionInit(Arch, field.name, @field(field.field_type, sub_field.name));
865 }777 }
778 break;
866 }779 }
867 return error.UnknownSubArchitecture;780 } else {
781 return error.UnknownCpuFeature;
868 }782 }
869 }783 }
870 }784 set.populateDependencies(all_features);
871 return error.UnknownArchitecture;785 break :blk .{
872 }786 .arch = arch,
873787 .model = cpu_model,
874 pub fn parseOs(text: []const u8) !Os {788 .features = set,
875 const info = @typeInfo(Os);789 };
876 inline for (info.Enum.fields) |field| {790 } else Cpu.baseline(arch);
877 if (mem.eql(u8, text, field.name)) {
878 return @field(Os, field.name);
879 }
880 }
881 return error.UnknownOperatingSystem;
882 }
883
884 pub fn parseAbi(text: []const u8) !Abi {
885 const info = @typeInfo(Abi);
886 inline for (info.Enum.fields) |field| {
887 if (mem.eql(u8, text, field.name)) {
888 return @field(Abi, field.name);
889 }
890 }
891 return error.UnknownApplicationBinaryInterface;
892 }
893791
894 fn archSubArchName(arch: Arch) []const u8 {792 var cross = Cross{
895 return switch (arch) {793 .cpu = cpu,
896 .arm => |sub| @tagName(sub),794 .os = os,
897 .armeb => |sub| @tagName(sub),795 .abi = abi,
898 .thumb => |sub| @tagName(sub),
899 .thumbeb => |sub| @tagName(sub),
900 .aarch64 => |sub| @tagName(sub),
901 .aarch64_be => |sub| @tagName(sub),
902 .kalimba => |sub| @tagName(sub),
903 else => "",
904 };796 };
905 }797 return Target{ .Cross = cross };
906
907 pub fn subArchName(self: Target) []const u8 {
908 switch (self) {
909 .Native => return archSubArchName(builtin.arch),
910 .Cross => |cross| return archSubArchName(cross.arch),
911 }
912 }798 }
913799
914 pub fn oFileExt(self: Target) []const u8 {800 pub fn oFileExt(self: Target) []const u8 {
...@@ -967,11 +853,15 @@ pub const Target = union(enum) {...@@ -967,11 +853,15 @@ pub const Target = union(enum) {
967 };853 };
968 }854 }
969855
970 pub fn getArch(self: Target) Arch {856 pub fn getCpu(self: Target) Cpu {
971 switch (self) {857 return switch (self) {
972 .Native => return builtin.arch,858 .Native => builtin.cpu,
973 .Cross => |t| return t.arch,859 .Cross => |cross| cross.cpu,
974 }860 };
861 }
862
863 pub fn getArch(self: Target) Cpu.Arch {
864 return self.getCpu().arch;
975 }865 }
976866
977 pub fn getAbi(self: Target) Abi {867 pub fn getAbi(self: Target) Abi {
...@@ -1372,14 +1262,32 @@ pub const Target = union(enum) {...@@ -1372,14 +1262,32 @@ pub const Target = union(enum) {
1372 }1262 }
1373};1263};
13741264
1375test "parseCpuFeatureSet" {1265test "Target.parse" {
1376 const arch: Target.Arch = .x86_64;1266 {
1377 const baseline = arch.getBaselineCpuFeatures();1267 const target = (try Target.parse(.{
1378 const set = try arch.parseCpuFeatureSet(baseline.cpu, "-sse,-avx,-cx8");1268 .arch_os_abi = "x86_64-linux-gnu",
1379 std.testing.expect(!Target.x86.featureSetHas(set, .sse));1269 .cpu = "x86_64-sse-avx-cx8",
1380 std.testing.expect(!Target.x86.featureSetHas(set, .avx));1270 })).Cross;
1381 std.testing.expect(!Target.x86.featureSetHas(set, .cx8));1271
1382 // These are expected because they are part of the baseline1272 std.testing.expect(target.os == .linux);
1383 std.testing.expect(Target.x86.featureSetHas(set, .cmov));1273 std.testing.expect(target.abi == .gnu);
1384 std.testing.expect(Target.x86.featureSetHas(set, .fxsr));1274 std.testing.expect(target.cpu.arch == .x86_64);
1275 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .sse));
1276 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .avx));
1277 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .cx8));
1278 std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .cmov));
1279 std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .fxsr));
1280 }
1281 {
1282 const target = (try Target.parse(.{
1283 .arch_os_abi = "arm-linux-musleabihf",
1284 .cpu = "generic+v8a",
1285 })).Cross;
1286
1287 std.testing.expect(target.os == .linux);
1288 std.testing.expect(target.abi == .musleabihf);
1289 std.testing.expect(target.cpu.arch == .arm);
1290 std.testing.expect(target.cpu.model == &Target.arm.cpu.generic);
1291 std.testing.expect(Target.arm.featureSetHas(target.cpu.features, .v8a));
1292 }
1385}1293}
lib/std/target/aarch64.zig+189-362
...@@ -1,14 +1,8 @@...@@ -1,14 +1,8 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 a35,
6 a53,
7 a55,
8 a57,
9 a72,
10 a73,
11 a75,
12 a76,6 a76,
13 aes,7 aes,
14 aggressive_fma,8 aggressive_fma,
...@@ -40,11 +34,7 @@ pub const Feature = enum {...@@ -40,11 +34,7 @@ pub const Feature = enum {
40 dit,34 dit,
41 dotprod,35 dotprod,
42 exynos_cheap_as_move,36 exynos_cheap_as_move,
43 exynosm1,
44 exynosm2,
45 exynosm3,
46 exynosm4,37 exynosm4,
47 falkor,
48 fmi,38 fmi,
49 force_32bit_jump_tables,39 force_32bit_jump_tables,
50 fp_armv8,40 fp_armv8,
...@@ -58,7 +48,6 @@ pub const Feature = enum {...@@ -58,7 +48,6 @@ pub const Feature = enum {
58 fuse_csel,48 fuse_csel,
59 fuse_literals,49 fuse_literals,
60 jsconv,50 jsconv,
61 kryo,
62 lor,51 lor,
63 lse,52 lse,
64 lsl_fast,53 lsl_fast,
...@@ -103,7 +92,6 @@ pub const Feature = enum {...@@ -103,7 +92,6 @@ pub const Feature = enum {
103 reserve_x6,92 reserve_x6,
104 reserve_x7,93 reserve_x7,
105 reserve_x9,94 reserve_x9,
106 saphira,
107 sb,95 sb,
108 sel2,96 sel2,
109 sha2,97 sha2,
...@@ -122,17 +110,11 @@ pub const Feature = enum {...@@ -122,17 +110,11 @@ pub const Feature = enum {
122 sve2_bitperm,110 sve2_bitperm,
123 sve2_sha3,111 sve2_sha3,
124 sve2_sm4,112 sve2_sm4,
125 thunderx,
126 thunderx2t99,
127 thunderxt81,
128 thunderxt83,
129 thunderxt88,
130 tlb_rmi,113 tlb_rmi,
131 tpidr_el1,114 tpidr_el1,
132 tpidr_el2,115 tpidr_el2,
133 tpidr_el3,116 tpidr_el3,
134 tracev8_4,117 tracev8_4,
135 tsv110,
136 uaops,118 uaops,
137 use_aa,119 use_aa,
138 use_postra_scheduler,120 use_postra_scheduler,
...@@ -151,120 +133,20 @@ pub const Feature = enum {...@@ -151,120 +133,20 @@ pub const Feature = enum {
151 zcz_gp,133 zcz_gp,
152};134};
153135
154pub usingnamespace Cpu.Feature.feature_set_fns(Feature);136pub usingnamespace CpuFeature.feature_set_fns(Feature);
155137
156pub const all_features = blk: {138pub const all_features = blk: {
157 @setEvalBranchQuota(2000);139 @setEvalBranchQuota(2000);
158 const len = @typeInfo(Feature).Enum.fields.len;140 const len = @typeInfo(Feature).Enum.fields.len;
159 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);141 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
160 var result: [len]Cpu.Feature = undefined;142 var result: [len]CpuFeature = undefined;
161 result[@enumToInt(Feature.a35)] = .{
162 .llvm_name = "a35",
163 .description = "Cortex-A35 ARM processors",
164 .dependencies = featureSet(&[_]Feature{
165 .crc,
166 .crypto,
167 .fp_armv8,
168 .neon,
169 .perfmon,
170 }),
171 };
172 result[@enumToInt(Feature.a53)] = .{
173 .llvm_name = "a53",
174 .description = "Cortex-A53 ARM processors",
175 .dependencies = featureSet(&[_]Feature{
176 .balance_fp_ops,
177 .crc,
178 .crypto,
179 .custom_cheap_as_move,
180 .fp_armv8,
181 .fuse_aes,
182 .neon,
183 .perfmon,
184 .use_aa,
185 .use_postra_scheduler,
186 }),
187 };
188 result[@enumToInt(Feature.a55)] = .{
189 .llvm_name = "a55",
190 .description = "Cortex-A55 ARM processors",
191 .dependencies = featureSet(&[_]Feature{
192 .crypto,
193 .dotprod,
194 .fp_armv8,
195 .fullfp16,
196 .fuse_aes,
197 .neon,
198 .perfmon,
199 .rcpc,
200 .v8_2a,
201 }),
202 };
203 result[@enumToInt(Feature.a57)] = .{
204 .llvm_name = "a57",
205 .description = "Cortex-A57 ARM processors",
206 .dependencies = featureSet(&[_]Feature{
207 .balance_fp_ops,
208 .crc,
209 .crypto,
210 .custom_cheap_as_move,
211 .fp_armv8,
212 .fuse_aes,
213 .fuse_literals,
214 .neon,
215 .perfmon,
216 .predictable_select_expensive,
217 .use_postra_scheduler,
218 }),
219 };
220 result[@enumToInt(Feature.a72)] = .{
221 .llvm_name = "a72",
222 .description = "Cortex-A72 ARM processors",
223 .dependencies = featureSet(&[_]Feature{
224 .crc,
225 .crypto,
226 .fp_armv8,
227 .fuse_aes,
228 .neon,
229 .perfmon,
230 }),
231 };
232 result[@enumToInt(Feature.a73)] = .{
233 .llvm_name = "a73",
234 .description = "Cortex-A73 ARM processors",
235 .dependencies = featureSet(&[_]Feature{
236 .crc,
237 .crypto,
238 .fp_armv8,
239 .fuse_aes,
240 .neon,
241 .perfmon,
242 }),
243 };
244 result[@enumToInt(Feature.a75)] = .{
245 .llvm_name = "a75",
246 .description = "Cortex-A75 ARM processors",
247 .dependencies = featureSet(&[_]Feature{
248 .crypto,
249 .dotprod,
250 .fp_armv8,
251 .fullfp16,
252 .fuse_aes,
253 .neon,
254 .perfmon,
255 .rcpc,
256 .v8_2a,
257 }),
258 };
259 result[@enumToInt(Feature.a76)] = .{143 result[@enumToInt(Feature.a76)] = .{
260 .llvm_name = "a76",144 .llvm_name = "a76",
261 .description = "Cortex-A76 ARM processors",145 .description = "Cortex-A76 ARM processors",
262 .dependencies = featureSet(&[_]Feature{146 .dependencies = featureSet(&[_]Feature{
263 .crypto,147 .crypto,
264 .dotprod,148 .dotprod,
265 .fp_armv8,
266 .fullfp16,149 .fullfp16,
267 .neon,
268 .rcpc,150 .rcpc,
269 .ssbs,151 .ssbs,
270 .v8_2a,152 .v8_2a,
...@@ -412,11 +294,10 @@ pub const all_features = blk: {...@@ -412,11 +294,10 @@ pub const all_features = blk: {
412 .arith_cbz_fusion,294 .arith_cbz_fusion,
413 .crypto,295 .crypto,
414 .disable_latency_sched_heuristic,296 .disable_latency_sched_heuristic,
415 .fp_armv8,
416 .fuse_aes,297 .fuse_aes,
417 .fuse_crypto_eor,298 .fuse_crypto_eor,
418 .neon,
419 .perfmon,299 .perfmon,
300 .v8a,
420 .zcm,301 .zcm,
421 .zcz,302 .zcz,
422 .zcz_fp_workaround,303 .zcz_fp_workaround,
...@@ -444,58 +325,6 @@ pub const all_features = blk: {...@@ -444,58 +325,6 @@ pub const all_features = blk: {
444 .custom_cheap_as_move,325 .custom_cheap_as_move,
445 }),326 }),
446 };327 };
447 result[@enumToInt(Feature.exynosm1)] = .{
448 .llvm_name = "exynosm1",
449 .description = "Samsung Exynos-M1 processors",
450 .dependencies = featureSet(&[_]Feature{
451 .crc,
452 .crypto,
453 .exynos_cheap_as_move,
454 .force_32bit_jump_tables,
455 .fuse_aes,
456 .perfmon,
457 .slow_misaligned_128store,
458 .slow_paired_128,
459 .use_postra_scheduler,
460 .use_reciprocal_square_root,
461 .zcz_fp,
462 }),
463 };
464 result[@enumToInt(Feature.exynosm2)] = .{
465 .llvm_name = "exynosm2",
466 .description = "Samsung Exynos-M2 processors",
467 .dependencies = featureSet(&[_]Feature{
468 .crc,
469 .crypto,
470 .exynos_cheap_as_move,
471 .force_32bit_jump_tables,
472 .fuse_aes,
473 .perfmon,
474 .slow_misaligned_128store,
475 .slow_paired_128,
476 .use_postra_scheduler,
477 .zcz_fp,
478 }),
479 };
480 result[@enumToInt(Feature.exynosm3)] = .{
481 .llvm_name = "exynosm3",
482 .description = "Samsung Exynos-M3 processors",
483 .dependencies = featureSet(&[_]Feature{
484 .crc,
485 .crypto,
486 .exynos_cheap_as_move,
487 .force_32bit_jump_tables,
488 .fuse_address,
489 .fuse_aes,
490 .fuse_csel,
491 .fuse_literals,
492 .lsl_fast,
493 .perfmon,
494 .predictable_select_expensive,
495 .use_postra_scheduler,
496 .zcz_fp,
497 }),
498 };
499 result[@enumToInt(Feature.exynosm4)] = .{328 result[@enumToInt(Feature.exynosm4)] = .{
500 .llvm_name = "exynosm4",329 .llvm_name = "exynosm4",
501 .description = "Samsung Exynos-M4 processors",330 .description = "Samsung Exynos-M4 processors",
...@@ -519,24 +348,6 @@ pub const all_features = blk: {...@@ -519,24 +348,6 @@ pub const all_features = blk: {
519 .zcz,348 .zcz,
520 }),349 }),
521 };350 };
522 result[@enumToInt(Feature.falkor)] = .{
523 .llvm_name = "falkor",
524 .description = "Qualcomm Falkor processors",
525 .dependencies = featureSet(&[_]Feature{
526 .crc,
527 .crypto,
528 .custom_cheap_as_move,
529 .fp_armv8,
530 .lsl_fast,
531 .neon,
532 .perfmon,
533 .predictable_select_expensive,
534 .rdm,
535 .slow_strqro_store,
536 .use_postra_scheduler,
537 .zcz,
538 }),
539 };
540 result[@enumToInt(Feature.fmi)] = .{351 result[@enumToInt(Feature.fmi)] = .{
541 .llvm_name = "fmi",352 .llvm_name = "fmi",
542 .description = "Enable v8.4-A Flag Manipulation Instructions",353 .description = "Enable v8.4-A Flag Manipulation Instructions",
...@@ -608,22 +419,6 @@ pub const all_features = blk: {...@@ -608,22 +419,6 @@ pub const all_features = blk: {
608 .fp_armv8,419 .fp_armv8,
609 }),420 }),
610 };421 };
611 result[@enumToInt(Feature.kryo)] = .{
612 .llvm_name = "kryo",
613 .description = "Qualcomm Kryo processors",
614 .dependencies = featureSet(&[_]Feature{
615 .crc,
616 .crypto,
617 .custom_cheap_as_move,
618 .fp_armv8,
619 .lsl_fast,
620 .neon,
621 .perfmon,
622 .predictable_select_expensive,
623 .use_postra_scheduler,
624 .zcz,
625 }),
626 };
627 result[@enumToInt(Feature.lor)] = .{422 result[@enumToInt(Feature.lor)] = .{
628 .llvm_name = "lor",423 .llvm_name = "lor",
629 .description = "Enables ARM v8.1 Limited Ordering Regions extension",424 .description = "Enables ARM v8.1 Limited Ordering Regions extension",
...@@ -852,23 +647,6 @@ pub const all_features = blk: {...@@ -852,23 +647,6 @@ pub const all_features = blk: {
852 .description = "Reserve X9, making it unavailable as a GPR",647 .description = "Reserve X9, making it unavailable as a GPR",
853 .dependencies = featureSet(&[_]Feature{}),648 .dependencies = featureSet(&[_]Feature{}),
854 };649 };
855 result[@enumToInt(Feature.saphira)] = .{
856 .llvm_name = "saphira",
857 .description = "Qualcomm Saphira processors",
858 .dependencies = featureSet(&[_]Feature{
859 .crypto,
860 .custom_cheap_as_move,
861 .fp_armv8,
862 .lsl_fast,
863 .neon,
864 .perfmon,
865 .predictable_select_expensive,
866 .spe,
867 .use_postra_scheduler,
868 .v8_4a,
869 .zcz,
870 }),
871 };
872 result[@enumToInt(Feature.sb)] = .{650 result[@enumToInt(Feature.sb)] = .{
873 .llvm_name = "sb",651 .llvm_name = "sb",
874 .description = "Enable v8.5 Speculation Barrier",652 .description = "Enable v8.5 Speculation Barrier",
...@@ -979,74 +757,6 @@ pub const all_features = blk: {...@@ -979,74 +757,6 @@ pub const all_features = blk: {
979 .sve2,757 .sve2,
980 }),758 }),
981 };759 };
982 result[@enumToInt(Feature.thunderx)] = .{
983 .llvm_name = "thunderx",
984 .description = "Cavium ThunderX processors",
985 .dependencies = featureSet(&[_]Feature{
986 .crc,
987 .crypto,
988 .fp_armv8,
989 .neon,
990 .perfmon,
991 .predictable_select_expensive,
992 .use_postra_scheduler,
993 }),
994 };
995 result[@enumToInt(Feature.thunderx2t99)] = .{
996 .llvm_name = "thunderx2t99",
997 .description = "Cavium ThunderX2 processors",
998 .dependencies = featureSet(&[_]Feature{
999 .aggressive_fma,
1000 .arith_bcc_fusion,
1001 .crc,
1002 .crypto,
1003 .fp_armv8,
1004 .lse,
1005 .neon,
1006 .predictable_select_expensive,
1007 .use_postra_scheduler,
1008 .v8_1a,
1009 }),
1010 };
1011 result[@enumToInt(Feature.thunderxt81)] = .{
1012 .llvm_name = "thunderxt81",
1013 .description = "Cavium ThunderX processors",
1014 .dependencies = featureSet(&[_]Feature{
1015 .crc,
1016 .crypto,
1017 .fp_armv8,
1018 .neon,
1019 .perfmon,
1020 .predictable_select_expensive,
1021 .use_postra_scheduler,
1022 }),
1023 };
1024 result[@enumToInt(Feature.thunderxt83)] = .{
1025 .llvm_name = "thunderxt83",
1026 .description = "Cavium ThunderX processors",
1027 .dependencies = featureSet(&[_]Feature{
1028 .crc,
1029 .crypto,
1030 .fp_armv8,
1031 .neon,
1032 .perfmon,
1033 .predictable_select_expensive,
1034 .use_postra_scheduler,
1035 }),
1036 };
1037 result[@enumToInt(Feature.thunderxt88)] = .{
1038 .llvm_name = "thunderxt88",
1039 .description = "Cavium ThunderX processors",
1040 .dependencies = featureSet(&[_]Feature{
1041 .crc,
1042 .crypto,
1043 .fp_armv8,
1044 .neon,
1045 .perfmon,
1046 .predictable_select_expensive,
1047 .use_postra_scheduler,
1048 }),
1049 };
1050 result[@enumToInt(Feature.tlb_rmi)] = .{760 result[@enumToInt(Feature.tlb_rmi)] = .{
1051 .llvm_name = "tlb-rmi",761 .llvm_name = "tlb-rmi",
1052 .description = "Enable v8.4-A TLB Range and Maintenance Instructions",762 .description = "Enable v8.4-A TLB Range and Maintenance Instructions",
...@@ -1072,24 +782,6 @@ pub const all_features = blk: {...@@ -1072,24 +782,6 @@ pub const all_features = blk: {
1072 .description = "Enable v8.4-A Trace extension",782 .description = "Enable v8.4-A Trace extension",
1073 .dependencies = featureSet(&[_]Feature{}),783 .dependencies = featureSet(&[_]Feature{}),
1074 };784 };
1075 result[@enumToInt(Feature.tsv110)] = .{
1076 .llvm_name = "tsv110",
1077 .description = "HiSilicon TS-V110 processors",
1078 .dependencies = featureSet(&[_]Feature{
1079 .crypto,
1080 .custom_cheap_as_move,
1081 .dotprod,
1082 .fp_armv8,
1083 .fp16fml,
1084 .fullfp16,
1085 .fuse_aes,
1086 .neon,
1087 .perfmon,
1088 .spe,
1089 .use_postra_scheduler,
1090 .v8_2a,
1091 }),
1092 };
1093 result[@enumToInt(Feature.uaops)] = .{785 result[@enumToInt(Feature.uaops)] = .{
1094 .llvm_name = "uaops",786 .llvm_name = "uaops",
1095 .description = "Enable v8.2 UAO PState",787 .description = "Enable v8.2 UAO PState",
...@@ -1229,190 +921,325 @@ pub const all_features = blk: {...@@ -1229,190 +921,325 @@ pub const all_features = blk: {
1229};921};
1230922
1231pub const cpu = struct {923pub const cpu = struct {
1232 pub const apple_latest = Cpu{924 pub const apple_latest = CpuModel{
1233 .name = "apple_latest",925 .name = "apple_latest",
1234 .llvm_name = "apple-latest",926 .llvm_name = "apple-latest",
1235 .features = featureSet(&[_]Feature{927 .features = featureSet(&[_]Feature{
1236 .cyclone,928 .cyclone,
1237 }),929 }),
1238 };930 };
1239 pub const cortex_a35 = Cpu{931 pub const cortex_a35 = CpuModel{
1240 .name = "cortex_a35",932 .name = "cortex_a35",
1241 .llvm_name = "cortex-a35",933 .llvm_name = "cortex-a35",
1242 .features = featureSet(&[_]Feature{934 .features = featureSet(&[_]Feature{
1243 .a35,935 .crc,
936 .crypto,
937 .perfmon,
938 .v8a,
1244 }),939 }),
1245 };940 };
1246 pub const cortex_a53 = Cpu{941 pub const cortex_a53 = CpuModel{
1247 .name = "cortex_a53",942 .name = "cortex_a53",
1248 .llvm_name = "cortex-a53",943 .llvm_name = "cortex-a53",
1249 .features = featureSet(&[_]Feature{944 .features = featureSet(&[_]Feature{
1250 .a53,945 .balance_fp_ops,
946 .crc,
947 .crypto,
948 .custom_cheap_as_move,
949 .fuse_aes,
950 .perfmon,
951 .use_aa,
952 .use_postra_scheduler,
953 .v8a,
1251 }),954 }),
1252 };955 };
1253 pub const cortex_a55 = Cpu{956 pub const cortex_a55 = CpuModel{
1254 .name = "cortex_a55",957 .name = "cortex_a55",
1255 .llvm_name = "cortex-a55",958 .llvm_name = "cortex-a55",
1256 .features = featureSet(&[_]Feature{959 .features = featureSet(&[_]Feature{
1257 .a55,960 .crypto,
961 .dotprod,
962 .fullfp16,
963 .fuse_aes,
964 .perfmon,
965 .rcpc,
966 .v8_2a,
1258 }),967 }),
1259 };968 };
1260 pub const cortex_a57 = Cpu{969 pub const cortex_a57 = CpuModel{
1261 .name = "cortex_a57",970 .name = "cortex_a57",
1262 .llvm_name = "cortex-a57",971 .llvm_name = "cortex-a57",
1263 .features = featureSet(&[_]Feature{972 .features = featureSet(&[_]Feature{
1264 .a57,973 .balance_fp_ops,
974 .crc,
975 .crypto,
976 .custom_cheap_as_move,
977 .fuse_aes,
978 .fuse_literals,
979 .perfmon,
980 .predictable_select_expensive,
981 .use_postra_scheduler,
982 .v8a,
1265 }),983 }),
1266 };984 };
1267 pub const cortex_a72 = Cpu{985 pub const cortex_a72 = CpuModel{
1268 .name = "cortex_a72",986 .name = "cortex_a72",
1269 .llvm_name = "cortex-a72",987 .llvm_name = "cortex-a72",
1270 .features = featureSet(&[_]Feature{988 .features = featureSet(&[_]Feature{
1271 .a72,989 .crc,
990 .crypto,
991 .fuse_aes,
992 .perfmon,
993 .v8a,
1272 }),994 }),
1273 };995 };
1274 pub const cortex_a73 = Cpu{996 pub const cortex_a73 = CpuModel{
1275 .name = "cortex_a73",997 .name = "cortex_a73",
1276 .llvm_name = "cortex-a73",998 .llvm_name = "cortex-a73",
1277 .features = featureSet(&[_]Feature{999 .features = featureSet(&[_]Feature{
1278 .a73,1000 .crc,
1001 .crypto,
1002 .fuse_aes,
1003 .perfmon,
1004 .v8a,
1279 }),1005 }),
1280 };1006 };
1281 pub const cortex_a75 = Cpu{1007 pub const cortex_a75 = CpuModel{
1282 .name = "cortex_a75",1008 .name = "cortex_a75",
1283 .llvm_name = "cortex-a75",1009 .llvm_name = "cortex-a75",
1284 .features = featureSet(&[_]Feature{1010 .features = featureSet(&[_]Feature{
1285 .a75,1011 .crypto,
1012 .dotprod,
1013 .fullfp16,
1014 .fuse_aes,
1015 .perfmon,
1016 .rcpc,
1017 .v8_2a,
1286 }),1018 }),
1287 };1019 };
1288 pub const cortex_a76 = Cpu{1020 pub const cortex_a76 = CpuModel{
1289 .name = "cortex_a76",1021 .name = "cortex_a76",
1290 .llvm_name = "cortex-a76",1022 .llvm_name = "cortex-a76",
1291 .features = featureSet(&[_]Feature{1023 .features = featureSet(&[_]Feature{
1292 .a76,1024 .a76,
1293 }),1025 }),
1294 };1026 };
1295 pub const cortex_a76ae = Cpu{1027 pub const cortex_a76ae = CpuModel{
1296 .name = "cortex_a76ae",1028 .name = "cortex_a76ae",
1297 .llvm_name = "cortex-a76ae",1029 .llvm_name = "cortex-a76ae",
1298 .features = featureSet(&[_]Feature{1030 .features = featureSet(&[_]Feature{
1299 .a76,1031 .a76,
1300 }),1032 }),
1301 };1033 };
1302 pub const cyclone = Cpu{1034 pub const cyclone = CpuModel{
1303 .name = "cyclone",1035 .name = "cyclone",
1304 .llvm_name = "cyclone",1036 .llvm_name = "cyclone",
1305 .features = featureSet(&[_]Feature{1037 .features = featureSet(&[_]Feature{
1306 .cyclone,1038 .cyclone,
1307 }),1039 }),
1308 };1040 };
1309 pub const exynos_m1 = Cpu{1041 pub const exynos_m1 = CpuModel{
1310 .name = "exynos_m1",1042 .name = "exynos_m1",
1311 .llvm_name = "exynos-m1",1043 .llvm_name = "exynos-m1",
1312 .features = featureSet(&[_]Feature{1044 .features = featureSet(&[_]Feature{
1313 .exynosm1,1045 .crc,
1046 .crypto,
1047 .exynos_cheap_as_move,
1048 .force_32bit_jump_tables,
1049 .fuse_aes,
1050 .perfmon,
1051 .slow_misaligned_128store,
1052 .slow_paired_128,
1053 .use_postra_scheduler,
1054 .use_reciprocal_square_root,
1055 .v8a,
1056 .zcz_fp,
1314 }),1057 }),
1315 };1058 };
1316 pub const exynos_m2 = Cpu{1059 pub const exynos_m2 = CpuModel{
1317 .name = "exynos_m2",1060 .name = "exynos_m2",
1318 .llvm_name = "exynos-m2",1061 .llvm_name = "exynos-m2",
1319 .features = featureSet(&[_]Feature{1062 .features = featureSet(&[_]Feature{
1320 .exynosm2,1063 .crc,
1064 .crypto,
1065 .exynos_cheap_as_move,
1066 .force_32bit_jump_tables,
1067 .fuse_aes,
1068 .perfmon,
1069 .slow_misaligned_128store,
1070 .slow_paired_128,
1071 .use_postra_scheduler,
1072 .v8a,
1073 .zcz_fp,
1321 }),1074 }),
1322 };1075 };
1323 pub const exynos_m3 = Cpu{1076 pub const exynos_m3 = CpuModel{
1324 .name = "exynos_m3",1077 .name = "exynos_m3",
1325 .llvm_name = "exynos-m3",1078 .llvm_name = "exynos-m3",
1326 .features = featureSet(&[_]Feature{1079 .features = featureSet(&[_]Feature{
1327 .exynosm3,1080 .crc,
1081 .crypto,
1082 .exynos_cheap_as_move,
1083 .force_32bit_jump_tables,
1084 .fuse_address,
1085 .fuse_aes,
1086 .fuse_csel,
1087 .fuse_literals,
1088 .lsl_fast,
1089 .perfmon,
1090 .predictable_select_expensive,
1091 .use_postra_scheduler,
1092 .v8a,
1093 .zcz_fp,
1328 }),1094 }),
1329 };1095 };
1330 pub const exynos_m4 = Cpu{1096 pub const exynos_m4 = CpuModel{
1331 .name = "exynos_m4",1097 .name = "exynos_m4",
1332 .llvm_name = "exynos-m4",1098 .llvm_name = "exynos-m4",
1333 .features = featureSet(&[_]Feature{1099 .features = featureSet(&[_]Feature{
1334 .exynosm4,1100 .exynosm4,
1335 }),1101 }),
1336 };1102 };
1337 pub const exynos_m5 = Cpu{1103 pub const exynos_m5 = CpuModel{
1338 .name = "exynos_m5",1104 .name = "exynos_m5",
1339 .llvm_name = "exynos-m5",1105 .llvm_name = "exynos-m5",
1340 .features = featureSet(&[_]Feature{1106 .features = featureSet(&[_]Feature{
1341 .exynosm4,1107 .exynosm4,
1342 }),1108 }),
1343 };1109 };
1344 pub const falkor = Cpu{1110 pub const falkor = CpuModel{
1345 .name = "falkor",1111 .name = "falkor",
1346 .llvm_name = "falkor",1112 .llvm_name = "falkor",
1347 .features = featureSet(&[_]Feature{1113 .features = featureSet(&[_]Feature{
1348 .falkor,1114 .crc,
1115 .crypto,
1116 .custom_cheap_as_move,
1117 .lsl_fast,
1118 .perfmon,
1119 .predictable_select_expensive,
1120 .rdm,
1121 .slow_strqro_store,
1122 .use_postra_scheduler,
1123 .v8a,
1124 .zcz,
1349 }),1125 }),
1350 };1126 };
1351 pub const generic = Cpu{1127 pub const generic = CpuModel{
1352 .name = "generic",1128 .name = "generic",
1353 .llvm_name = "generic",1129 .llvm_name = "generic",
1354 .features = featureSet(&[_]Feature{1130 .features = featureSet(&[_]Feature{
1355 .fp_armv8,
1356 .fuse_aes,1131 .fuse_aes,
1357 .neon,
1358 .perfmon,1132 .perfmon,
1359 .use_postra_scheduler,1133 .use_postra_scheduler,
1134 .v8a,
1360 }),1135 }),
1361 };1136 };
1362 pub const kryo = Cpu{1137 pub const kryo = CpuModel{
1363 .name = "kryo",1138 .name = "kryo",
1364 .llvm_name = "kryo",1139 .llvm_name = "kryo",
1365 .features = featureSet(&[_]Feature{1140 .features = featureSet(&[_]Feature{
1366 .kryo,1141 .crc,
1142 .crypto,
1143 .custom_cheap_as_move,
1144 .lsl_fast,
1145 .perfmon,
1146 .predictable_select_expensive,
1147 .use_postra_scheduler,
1148 .zcz,
1149 .v8a,
1367 }),1150 }),
1368 };1151 };
1369 pub const saphira = Cpu{1152 pub const saphira = CpuModel{
1370 .name = "saphira",1153 .name = "saphira",
1371 .llvm_name = "saphira",1154 .llvm_name = "saphira",
1372 .features = featureSet(&[_]Feature{1155 .features = featureSet(&[_]Feature{
1373 .saphira,1156 .crypto,
1157 .custom_cheap_as_move,
1158 .lsl_fast,
1159 .perfmon,
1160 .predictable_select_expensive,
1161 .spe,
1162 .use_postra_scheduler,
1163 .v8_4a,
1164 .zcz,
1374 }),1165 }),
1375 };1166 };
1376 pub const thunderx = Cpu{1167 pub const thunderx = CpuModel{
1377 .name = "thunderx",1168 .name = "thunderx",
1378 .llvm_name = "thunderx",1169 .llvm_name = "thunderx",
1379 .features = featureSet(&[_]Feature{1170 .features = featureSet(&[_]Feature{
1380 .thunderx,1171 .crc,
1172 .crypto,
1173 .perfmon,
1174 .predictable_select_expensive,
1175 .use_postra_scheduler,
1176 .v8a,
1381 }),1177 }),
1382 };1178 };
1383 pub const thunderx2t99 = Cpu{1179 pub const thunderx2t99 = CpuModel{
1384 .name = "thunderx2t99",1180 .name = "thunderx2t99",
1385 .llvm_name = "thunderx2t99",1181 .llvm_name = "thunderx2t99",
1386 .features = featureSet(&[_]Feature{1182 .features = featureSet(&[_]Feature{
1387 .thunderx2t99,1183 .aggressive_fma,
1184 .arith_bcc_fusion,
1185 .crc,
1186 .crypto,
1187 .lse,
1188 .predictable_select_expensive,
1189 .use_postra_scheduler,
1190 .v8_1a,
1388 }),1191 }),
1389 };1192 };
1390 pub const thunderxt81 = Cpu{1193 pub const thunderxt81 = CpuModel{
1391 .name = "thunderxt81",1194 .name = "thunderxt81",
1392 .llvm_name = "thunderxt81",1195 .llvm_name = "thunderxt81",
1393 .features = featureSet(&[_]Feature{1196 .features = featureSet(&[_]Feature{
1394 .thunderxt81,1197 .crc,
1198 .crypto,
1199 .perfmon,
1200 .predictable_select_expensive,
1201 .use_postra_scheduler,
1202 .v8a,
1395 }),1203 }),
1396 };1204 };
1397 pub const thunderxt83 = Cpu{1205 pub const thunderxt83 = CpuModel{
1398 .name = "thunderxt83",1206 .name = "thunderxt83",
1399 .llvm_name = "thunderxt83",1207 .llvm_name = "thunderxt83",
1400 .features = featureSet(&[_]Feature{1208 .features = featureSet(&[_]Feature{
1401 .thunderxt83,1209 .crc,
1210 .crypto,
1211 .perfmon,
1212 .predictable_select_expensive,
1213 .use_postra_scheduler,
1214 .v8a,
1402 }),1215 }),
1403 };1216 };
1404 pub const thunderxt88 = Cpu{1217 pub const thunderxt88 = CpuModel{
1405 .name = "thunderxt88",1218 .name = "thunderxt88",
1406 .llvm_name = "thunderxt88",1219 .llvm_name = "thunderxt88",
1407 .features = featureSet(&[_]Feature{1220 .features = featureSet(&[_]Feature{
1408 .thunderxt88,1221 .crc,
1222 .crypto,
1223 .perfmon,
1224 .predictable_select_expensive,
1225 .use_postra_scheduler,
1226 .v8a,
1409 }),1227 }),
1410 };1228 };
1411 pub const tsv110 = Cpu{1229 pub const tsv110 = CpuModel{
1412 .name = "tsv110",1230 .name = "tsv110",
1413 .llvm_name = "tsv110",1231 .llvm_name = "tsv110",
1414 .features = featureSet(&[_]Feature{1232 .features = featureSet(&[_]Feature{
1415 .tsv110,1233 .crypto,
1234 .custom_cheap_as_move,
1235 .dotprod,
1236 .fp16fml,
1237 .fullfp16,
1238 .fuse_aes,
1239 .perfmon,
1240 .spe,
1241 .use_postra_scheduler,
1242 .v8_2a,
1416 }),1243 }),
1417 };1244 };
1418};1245};
...@@ -1420,7 +1247,7 @@ pub const cpu = struct {...@@ -1420,7 +1247,7 @@ pub const cpu = struct {
1420/// All aarch64 CPUs, sorted alphabetically by name.1247/// All aarch64 CPUs, sorted alphabetically by name.
1421/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage11248/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
1422/// compiler has inefficient memory and CPU usage, affecting build times.1249/// compiler has inefficient memory and CPU usage, affecting build times.
1423pub const all_cpus = &[_]*const Cpu{1250pub const all_cpus = &[_]*const CpuModel{
1424 &cpu.apple_latest,1251 &cpu.apple_latest,
1425 &cpu.cortex_a35,1252 &cpu.cortex_a35,
1426 &cpu.cortex_a53,1253 &cpu.cortex_a53,
lib/std/target/amdgpu.zig+45-44
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 @"16_bit_insts",6 @"16_bit_insts",
...@@ -111,12 +112,12 @@ pub const Feature = enum {...@@ -111,12 +112,12 @@ pub const Feature = enum {
111 xnack,112 xnack,
112};113};
113114
114pub usingnamespace Cpu.Feature.feature_set_fns(Feature);115pub usingnamespace CpuFeature.feature_set_fns(Feature);
115116
116pub const all_features = blk: {117pub const all_features = blk: {
117 const len = @typeInfo(Feature).Enum.fields.len;118 const len = @typeInfo(Feature).Enum.fields.len;
118 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);119 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
119 var result: [len]Cpu.Feature = undefined;120 var result: [len]CpuFeature = undefined;
120 result[@enumToInt(Feature.@"16_bit_insts")] = .{121 result[@enumToInt(Feature.@"16_bit_insts")] = .{
121 .llvm_name = "16-bit-insts",122 .llvm_name = "16-bit-insts",
122 .description = "Has i16/f16 instructions",123 .description = "Has i16/f16 instructions",
...@@ -778,7 +779,7 @@ pub const all_features = blk: {...@@ -778,7 +779,7 @@ pub const all_features = blk: {
778};779};
779780
780pub const cpu = struct {781pub const cpu = struct {
781 pub const bonaire = Cpu{782 pub const bonaire = CpuModel{
782 .name = "bonaire",783 .name = "bonaire",
783 .llvm_name = "bonaire",784 .llvm_name = "bonaire",
784 .features = featureSet(&[_]Feature{785 .features = featureSet(&[_]Feature{
...@@ -788,7 +789,7 @@ pub const cpu = struct {...@@ -788,7 +789,7 @@ pub const cpu = struct {
788 .sea_islands,789 .sea_islands,
789 }),790 }),
790 };791 };
791 pub const carrizo = Cpu{792 pub const carrizo = CpuModel{
792 .name = "carrizo",793 .name = "carrizo",
793 .llvm_name = "carrizo",794 .llvm_name = "carrizo",
794 .features = featureSet(&[_]Feature{795 .features = featureSet(&[_]Feature{
...@@ -801,7 +802,7 @@ pub const cpu = struct {...@@ -801,7 +802,7 @@ pub const cpu = struct {
801 .xnack,802 .xnack,
802 }),803 }),
803 };804 };
804 pub const fiji = Cpu{805 pub const fiji = CpuModel{
805 .name = "fiji",806 .name = "fiji",
806 .llvm_name = "fiji",807 .llvm_name = "fiji",
807 .features = featureSet(&[_]Feature{808 .features = featureSet(&[_]Feature{
...@@ -812,14 +813,14 @@ pub const cpu = struct {...@@ -812,14 +813,14 @@ pub const cpu = struct {
812 .volcanic_islands,813 .volcanic_islands,
813 }),814 }),
814 };815 };
815 pub const generic = Cpu{816 pub const generic = CpuModel{
816 .name = "generic",817 .name = "generic",
817 .llvm_name = "generic",818 .llvm_name = "generic",
818 .features = featureSet(&[_]Feature{819 .features = featureSet(&[_]Feature{
819 .wavefrontsize64,820 .wavefrontsize64,
820 }),821 }),
821 };822 };
822 pub const generic_hsa = Cpu{823 pub const generic_hsa = CpuModel{
823 .name = "generic_hsa",824 .name = "generic_hsa",
824 .llvm_name = "generic-hsa",825 .llvm_name = "generic-hsa",
825 .features = featureSet(&[_]Feature{826 .features = featureSet(&[_]Feature{
...@@ -827,7 +828,7 @@ pub const cpu = struct {...@@ -827,7 +828,7 @@ pub const cpu = struct {
827 .wavefrontsize64,828 .wavefrontsize64,
828 }),829 }),
829 };830 };
830 pub const gfx1010 = Cpu{831 pub const gfx1010 = CpuModel{
831 .name = "gfx1010",832 .name = "gfx1010",
832 .llvm_name = "gfx1010",833 .llvm_name = "gfx1010",
833 .features = featureSet(&[_]Feature{834 .features = featureSet(&[_]Feature{
...@@ -853,7 +854,7 @@ pub const cpu = struct {...@@ -853,7 +854,7 @@ pub const cpu = struct {
853 .wavefrontsize32,854 .wavefrontsize32,
854 }),855 }),
855 };856 };
856 pub const gfx1011 = Cpu{857 pub const gfx1011 = CpuModel{
857 .name = "gfx1011",858 .name = "gfx1011",
858 .llvm_name = "gfx1011",859 .llvm_name = "gfx1011",
859 .features = featureSet(&[_]Feature{860 .features = featureSet(&[_]Feature{
...@@ -882,7 +883,7 @@ pub const cpu = struct {...@@ -882,7 +883,7 @@ pub const cpu = struct {
882 .wavefrontsize32,883 .wavefrontsize32,
883 }),884 }),
884 };885 };
885 pub const gfx1012 = Cpu{886 pub const gfx1012 = CpuModel{
886 .name = "gfx1012",887 .name = "gfx1012",
887 .llvm_name = "gfx1012",888 .llvm_name = "gfx1012",
888 .features = featureSet(&[_]Feature{889 .features = featureSet(&[_]Feature{
...@@ -912,7 +913,7 @@ pub const cpu = struct {...@@ -912,7 +913,7 @@ pub const cpu = struct {
912 .wavefrontsize32,913 .wavefrontsize32,
913 }),914 }),
914 };915 };
915 pub const gfx600 = Cpu{916 pub const gfx600 = CpuModel{
916 .name = "gfx600",917 .name = "gfx600",
917 .llvm_name = "gfx600",918 .llvm_name = "gfx600",
918 .features = featureSet(&[_]Feature{919 .features = featureSet(&[_]Feature{
...@@ -924,7 +925,7 @@ pub const cpu = struct {...@@ -924,7 +925,7 @@ pub const cpu = struct {
924 .southern_islands,925 .southern_islands,
925 }),926 }),
926 };927 };
927 pub const gfx601 = Cpu{928 pub const gfx601 = CpuModel{
928 .name = "gfx601",929 .name = "gfx601",
929 .llvm_name = "gfx601",930 .llvm_name = "gfx601",
930 .features = featureSet(&[_]Feature{931 .features = featureSet(&[_]Feature{
...@@ -934,7 +935,7 @@ pub const cpu = struct {...@@ -934,7 +935,7 @@ pub const cpu = struct {
934 .southern_islands,935 .southern_islands,
935 }),936 }),
936 };937 };
937 pub const gfx700 = Cpu{938 pub const gfx700 = CpuModel{
938 .name = "gfx700",939 .name = "gfx700",
939 .llvm_name = "gfx700",940 .llvm_name = "gfx700",
940 .features = featureSet(&[_]Feature{941 .features = featureSet(&[_]Feature{
...@@ -944,7 +945,7 @@ pub const cpu = struct {...@@ -944,7 +945,7 @@ pub const cpu = struct {
944 .sea_islands,945 .sea_islands,
945 }),946 }),
946 };947 };
947 pub const gfx701 = Cpu{948 pub const gfx701 = CpuModel{
948 .name = "gfx701",949 .name = "gfx701",
949 .llvm_name = "gfx701",950 .llvm_name = "gfx701",
950 .features = featureSet(&[_]Feature{951 .features = featureSet(&[_]Feature{
...@@ -956,7 +957,7 @@ pub const cpu = struct {...@@ -956,7 +957,7 @@ pub const cpu = struct {
956 .sea_islands,957 .sea_islands,
957 }),958 }),
958 };959 };
959 pub const gfx702 = Cpu{960 pub const gfx702 = CpuModel{
960 .name = "gfx702",961 .name = "gfx702",
961 .llvm_name = "gfx702",962 .llvm_name = "gfx702",
962 .features = featureSet(&[_]Feature{963 .features = featureSet(&[_]Feature{
...@@ -967,7 +968,7 @@ pub const cpu = struct {...@@ -967,7 +968,7 @@ pub const cpu = struct {
967 .sea_islands,968 .sea_islands,
968 }),969 }),
969 };970 };
970 pub const gfx703 = Cpu{971 pub const gfx703 = CpuModel{
971 .name = "gfx703",972 .name = "gfx703",
972 .llvm_name = "gfx703",973 .llvm_name = "gfx703",
973 .features = featureSet(&[_]Feature{974 .features = featureSet(&[_]Feature{
...@@ -977,7 +978,7 @@ pub const cpu = struct {...@@ -977,7 +978,7 @@ pub const cpu = struct {
977 .sea_islands,978 .sea_islands,
978 }),979 }),
979 };980 };
980 pub const gfx704 = Cpu{981 pub const gfx704 = CpuModel{
981 .name = "gfx704",982 .name = "gfx704",
982 .llvm_name = "gfx704",983 .llvm_name = "gfx704",
983 .features = featureSet(&[_]Feature{984 .features = featureSet(&[_]Feature{
...@@ -987,7 +988,7 @@ pub const cpu = struct {...@@ -987,7 +988,7 @@ pub const cpu = struct {
987 .sea_islands,988 .sea_islands,
988 }),989 }),
989 };990 };
990 pub const gfx801 = Cpu{991 pub const gfx801 = CpuModel{
991 .name = "gfx801",992 .name = "gfx801",
992 .llvm_name = "gfx801",993 .llvm_name = "gfx801",
993 .features = featureSet(&[_]Feature{994 .features = featureSet(&[_]Feature{
...@@ -1000,7 +1001,7 @@ pub const cpu = struct {...@@ -1000,7 +1001,7 @@ pub const cpu = struct {
1000 .xnack,1001 .xnack,
1001 }),1002 }),
1002 };1003 };
1003 pub const gfx802 = Cpu{1004 pub const gfx802 = CpuModel{
1004 .name = "gfx802",1005 .name = "gfx802",
1005 .llvm_name = "gfx802",1006 .llvm_name = "gfx802",
1006 .features = featureSet(&[_]Feature{1007 .features = featureSet(&[_]Feature{
...@@ -1012,7 +1013,7 @@ pub const cpu = struct {...@@ -1012,7 +1013,7 @@ pub const cpu = struct {
1012 .volcanic_islands,1013 .volcanic_islands,
1013 }),1014 }),
1014 };1015 };
1015 pub const gfx803 = Cpu{1016 pub const gfx803 = CpuModel{
1016 .name = "gfx803",1017 .name = "gfx803",
1017 .llvm_name = "gfx803",1018 .llvm_name = "gfx803",
1018 .features = featureSet(&[_]Feature{1019 .features = featureSet(&[_]Feature{
...@@ -1023,7 +1024,7 @@ pub const cpu = struct {...@@ -1023,7 +1024,7 @@ pub const cpu = struct {
1023 .volcanic_islands,1024 .volcanic_islands,
1024 }),1025 }),
1025 };1026 };
1026 pub const gfx810 = Cpu{1027 pub const gfx810 = CpuModel{
1027 .name = "gfx810",1028 .name = "gfx810",
1028 .llvm_name = "gfx810",1029 .llvm_name = "gfx810",
1029 .features = featureSet(&[_]Feature{1030 .features = featureSet(&[_]Feature{
...@@ -1033,7 +1034,7 @@ pub const cpu = struct {...@@ -1033,7 +1034,7 @@ pub const cpu = struct {
1033 .xnack,1034 .xnack,
1034 }),1035 }),
1035 };1036 };
1036 pub const gfx900 = Cpu{1037 pub const gfx900 = CpuModel{
1037 .name = "gfx900",1038 .name = "gfx900",
1038 .llvm_name = "gfx900",1039 .llvm_name = "gfx900",
1039 .features = featureSet(&[_]Feature{1040 .features = featureSet(&[_]Feature{
...@@ -1045,7 +1046,7 @@ pub const cpu = struct {...@@ -1045,7 +1046,7 @@ pub const cpu = struct {
1045 .no_xnack_support,1046 .no_xnack_support,
1046 }),1047 }),
1047 };1048 };
1048 pub const gfx902 = Cpu{1049 pub const gfx902 = CpuModel{
1049 .name = "gfx902",1050 .name = "gfx902",
1050 .llvm_name = "gfx902",1051 .llvm_name = "gfx902",
1051 .features = featureSet(&[_]Feature{1052 .features = featureSet(&[_]Feature{
...@@ -1057,7 +1058,7 @@ pub const cpu = struct {...@@ -1057,7 +1058,7 @@ pub const cpu = struct {
1057 .xnack,1058 .xnack,
1058 }),1059 }),
1059 };1060 };
1060 pub const gfx904 = Cpu{1061 pub const gfx904 = CpuModel{
1061 .name = "gfx904",1062 .name = "gfx904",
1062 .llvm_name = "gfx904",1063 .llvm_name = "gfx904",
1063 .features = featureSet(&[_]Feature{1064 .features = featureSet(&[_]Feature{
...@@ -1069,7 +1070,7 @@ pub const cpu = struct {...@@ -1069,7 +1070,7 @@ pub const cpu = struct {
1069 .no_xnack_support,1070 .no_xnack_support,
1070 }),1071 }),
1071 };1072 };
1072 pub const gfx906 = Cpu{1073 pub const gfx906 = CpuModel{
1073 .name = "gfx906",1074 .name = "gfx906",
1074 .llvm_name = "gfx906",1075 .llvm_name = "gfx906",
1075 .features = featureSet(&[_]Feature{1076 .features = featureSet(&[_]Feature{
...@@ -1084,7 +1085,7 @@ pub const cpu = struct {...@@ -1084,7 +1085,7 @@ pub const cpu = struct {
1084 .no_xnack_support,1085 .no_xnack_support,
1085 }),1086 }),
1086 };1087 };
1087 pub const gfx908 = Cpu{1088 pub const gfx908 = CpuModel{
1088 .name = "gfx908",1089 .name = "gfx908",
1089 .llvm_name = "gfx908",1090 .llvm_name = "gfx908",
1090 .features = featureSet(&[_]Feature{1091 .features = featureSet(&[_]Feature{
...@@ -1106,7 +1107,7 @@ pub const cpu = struct {...@@ -1106,7 +1107,7 @@ pub const cpu = struct {
1106 .sram_ecc,1107 .sram_ecc,
1107 }),1108 }),
1108 };1109 };
1109 pub const gfx909 = Cpu{1110 pub const gfx909 = CpuModel{
1110 .name = "gfx909",1111 .name = "gfx909",
1111 .llvm_name = "gfx909",1112 .llvm_name = "gfx909",
1112 .features = featureSet(&[_]Feature{1113 .features = featureSet(&[_]Feature{
...@@ -1117,7 +1118,7 @@ pub const cpu = struct {...@@ -1117,7 +1118,7 @@ pub const cpu = struct {
1117 .xnack,1118 .xnack,
1118 }),1119 }),
1119 };1120 };
1120 pub const hainan = Cpu{1121 pub const hainan = CpuModel{
1121 .name = "hainan",1122 .name = "hainan",
1122 .llvm_name = "hainan",1123 .llvm_name = "hainan",
1123 .features = featureSet(&[_]Feature{1124 .features = featureSet(&[_]Feature{
...@@ -1127,7 +1128,7 @@ pub const cpu = struct {...@@ -1127,7 +1128,7 @@ pub const cpu = struct {
1127 .southern_islands,1128 .southern_islands,
1128 }),1129 }),
1129 };1130 };
1130 pub const hawaii = Cpu{1131 pub const hawaii = CpuModel{
1131 .name = "hawaii",1132 .name = "hawaii",
1132 .llvm_name = "hawaii",1133 .llvm_name = "hawaii",
1133 .features = featureSet(&[_]Feature{1134 .features = featureSet(&[_]Feature{
...@@ -1139,7 +1140,7 @@ pub const cpu = struct {...@@ -1139,7 +1140,7 @@ pub const cpu = struct {
1139 .sea_islands,1140 .sea_islands,
1140 }),1141 }),
1141 };1142 };
1142 pub const iceland = Cpu{1143 pub const iceland = CpuModel{
1143 .name = "iceland",1144 .name = "iceland",
1144 .llvm_name = "iceland",1145 .llvm_name = "iceland",
1145 .features = featureSet(&[_]Feature{1146 .features = featureSet(&[_]Feature{
...@@ -1151,7 +1152,7 @@ pub const cpu = struct {...@@ -1151,7 +1152,7 @@ pub const cpu = struct {
1151 .volcanic_islands,1152 .volcanic_islands,
1152 }),1153 }),
1153 };1154 };
1154 pub const kabini = Cpu{1155 pub const kabini = CpuModel{
1155 .name = "kabini",1156 .name = "kabini",
1156 .llvm_name = "kabini",1157 .llvm_name = "kabini",
1157 .features = featureSet(&[_]Feature{1158 .features = featureSet(&[_]Feature{
...@@ -1161,7 +1162,7 @@ pub const cpu = struct {...@@ -1161,7 +1162,7 @@ pub const cpu = struct {
1161 .sea_islands,1162 .sea_islands,
1162 }),1163 }),
1163 };1164 };
1164 pub const kaveri = Cpu{1165 pub const kaveri = CpuModel{
1165 .name = "kaveri",1166 .name = "kaveri",
1166 .llvm_name = "kaveri",1167 .llvm_name = "kaveri",
1167 .features = featureSet(&[_]Feature{1168 .features = featureSet(&[_]Feature{
...@@ -1171,7 +1172,7 @@ pub const cpu = struct {...@@ -1171,7 +1172,7 @@ pub const cpu = struct {
1171 .sea_islands,1172 .sea_islands,
1172 }),1173 }),
1173 };1174 };
1174 pub const mullins = Cpu{1175 pub const mullins = CpuModel{
1175 .name = "mullins",1176 .name = "mullins",
1176 .llvm_name = "mullins",1177 .llvm_name = "mullins",
1177 .features = featureSet(&[_]Feature{1178 .features = featureSet(&[_]Feature{
...@@ -1181,7 +1182,7 @@ pub const cpu = struct {...@@ -1181,7 +1182,7 @@ pub const cpu = struct {
1181 .sea_islands,1182 .sea_islands,
1182 }),1183 }),
1183 };1184 };
1184 pub const oland = Cpu{1185 pub const oland = CpuModel{
1185 .name = "oland",1186 .name = "oland",
1186 .llvm_name = "oland",1187 .llvm_name = "oland",
1187 .features = featureSet(&[_]Feature{1188 .features = featureSet(&[_]Feature{
...@@ -1191,7 +1192,7 @@ pub const cpu = struct {...@@ -1191,7 +1192,7 @@ pub const cpu = struct {
1191 .southern_islands,1192 .southern_islands,
1192 }),1193 }),
1193 };1194 };
1194 pub const pitcairn = Cpu{1195 pub const pitcairn = CpuModel{
1195 .name = "pitcairn",1196 .name = "pitcairn",
1196 .llvm_name = "pitcairn",1197 .llvm_name = "pitcairn",
1197 .features = featureSet(&[_]Feature{1198 .features = featureSet(&[_]Feature{
...@@ -1201,7 +1202,7 @@ pub const cpu = struct {...@@ -1201,7 +1202,7 @@ pub const cpu = struct {
1201 .southern_islands,1202 .southern_islands,
1202 }),1203 }),
1203 };1204 };
1204 pub const polaris10 = Cpu{1205 pub const polaris10 = CpuModel{
1205 .name = "polaris10",1206 .name = "polaris10",
1206 .llvm_name = "polaris10",1207 .llvm_name = "polaris10",
1207 .features = featureSet(&[_]Feature{1208 .features = featureSet(&[_]Feature{
...@@ -1212,7 +1213,7 @@ pub const cpu = struct {...@@ -1212,7 +1213,7 @@ pub const cpu = struct {
1212 .volcanic_islands,1213 .volcanic_islands,
1213 }),1214 }),
1214 };1215 };
1215 pub const polaris11 = Cpu{1216 pub const polaris11 = CpuModel{
1216 .name = "polaris11",1217 .name = "polaris11",
1217 .llvm_name = "polaris11",1218 .llvm_name = "polaris11",
1218 .features = featureSet(&[_]Feature{1219 .features = featureSet(&[_]Feature{
...@@ -1223,7 +1224,7 @@ pub const cpu = struct {...@@ -1223,7 +1224,7 @@ pub const cpu = struct {
1223 .volcanic_islands,1224 .volcanic_islands,
1224 }),1225 }),
1225 };1226 };
1226 pub const stoney = Cpu{1227 pub const stoney = CpuModel{
1227 .name = "stoney",1228 .name = "stoney",
1228 .llvm_name = "stoney",1229 .llvm_name = "stoney",
1229 .features = featureSet(&[_]Feature{1230 .features = featureSet(&[_]Feature{
...@@ -1233,7 +1234,7 @@ pub const cpu = struct {...@@ -1233,7 +1234,7 @@ pub const cpu = struct {
1233 .xnack,1234 .xnack,
1234 }),1235 }),
1235 };1236 };
1236 pub const tahiti = Cpu{1237 pub const tahiti = CpuModel{
1237 .name = "tahiti",1238 .name = "tahiti",
1238 .llvm_name = "tahiti",1239 .llvm_name = "tahiti",
1239 .features = featureSet(&[_]Feature{1240 .features = featureSet(&[_]Feature{
...@@ -1245,7 +1246,7 @@ pub const cpu = struct {...@@ -1245,7 +1246,7 @@ pub const cpu = struct {
1245 .southern_islands,1246 .southern_islands,
1246 }),1247 }),
1247 };1248 };
1248 pub const tonga = Cpu{1249 pub const tonga = CpuModel{
1249 .name = "tonga",1250 .name = "tonga",
1250 .llvm_name = "tonga",1251 .llvm_name = "tonga",
1251 .features = featureSet(&[_]Feature{1252 .features = featureSet(&[_]Feature{
...@@ -1257,7 +1258,7 @@ pub const cpu = struct {...@@ -1257,7 +1258,7 @@ pub const cpu = struct {
1257 .volcanic_islands,1258 .volcanic_islands,
1258 }),1259 }),
1259 };1260 };
1260 pub const verde = Cpu{1261 pub const verde = CpuModel{
1261 .name = "verde",1262 .name = "verde",
1262 .llvm_name = "verde",1263 .llvm_name = "verde",
1263 .features = featureSet(&[_]Feature{1264 .features = featureSet(&[_]Feature{
...@@ -1272,7 +1273,7 @@ pub const cpu = struct {...@@ -1272,7 +1273,7 @@ pub const cpu = struct {
1272/// All amdgpu CPUs, sorted alphabetically by name.1273/// All amdgpu CPUs, sorted alphabetically by name.
1273/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage11274/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
1274/// compiler has inefficient memory and CPU usage, affecting build times.1275/// compiler has inefficient memory and CPU usage, affecting build times.
1275pub const all_cpus = &[_]*const Cpu{1276pub const all_cpus = &[_]*const CpuModel{
1276 &cpu.bonaire,1277 &cpu.bonaire,
1277 &cpu.carrizo,1278 &cpu.carrizo,
1278 &cpu.fiji,1279 &cpu.fiji,
lib/std/target/arm.zig+85-87
...@@ -390,14 +390,14 @@ pub const all_features = blk: {...@@ -390,14 +390,14 @@ pub const all_features = blk: {
390 .llvm_name = "iwmmxt",390 .llvm_name = "iwmmxt",
391 .description = "ARMv5te architecture",391 .description = "ARMv5te architecture",
392 .dependencies = featureSet(&[_]Feature{392 .dependencies = featureSet(&[_]Feature{
393 .armv5te,393 .v5te,
394 }),394 }),
395 };395 };
396 result[@enumToInt(Feature.iwmmxt2)] = .{396 result[@enumToInt(Feature.iwmmxt2)] = .{
397 .llvm_name = "iwmmxt2",397 .llvm_name = "iwmmxt2",
398 .description = "ARMv5te architecture",398 .description = "ARMv5te architecture",
399 .dependencies = featureSet(&[_]Feature{399 .dependencies = featureSet(&[_]Feature{
400 .armv5te,400 .v5te,
401 }),401 }),
402 };402 };
403 result[@enumToInt(Feature.lob)] = .{403 result[@enumToInt(Feature.lob)] = .{
...@@ -1089,7 +1089,7 @@ pub const all_features = blk: {...@@ -1089,7 +1089,7 @@ pub const all_features = blk: {
1089 .llvm_name = "xscale",1089 .llvm_name = "xscale",
1090 .description = "ARMv5te architecture",1090 .description = "ARMv5te architecture",
1091 .dependencies = featureSet(&[_]Feature{1091 .dependencies = featureSet(&[_]Feature{
1092 .armv5te,1092 .v5te,
1093 }),1093 }),
1094 };1094 };
1095 result[@enumToInt(Feature.zcz)] = .{1095 result[@enumToInt(Feature.zcz)] = .{
...@@ -1110,49 +1110,49 @@ pub const cpu = struct {...@@ -1110,49 +1110,49 @@ pub const cpu = struct {
1110 .name = "arm1020e",1110 .name = "arm1020e",
1111 .llvm_name = "arm1020e",1111 .llvm_name = "arm1020e",
1112 .features = featureSet(&[_]Feature{1112 .features = featureSet(&[_]Feature{
1113 .armv5te,1113 .v5te,
1114 }),1114 }),
1115 };1115 };
1116 pub const arm1020t = CpuModel{1116 pub const arm1020t = CpuModel{
1117 .name = "arm1020t",1117 .name = "arm1020t",
1118 .llvm_name = "arm1020t",1118 .llvm_name = "arm1020t",
1119 .features = featureSet(&[_]Feature{1119 .features = featureSet(&[_]Feature{
1120 .armv5t,1120 .v5t,
1121 }),1121 }),
1122 };1122 };
1123 pub const arm1022e = CpuModel{1123 pub const arm1022e = CpuModel{
1124 .name = "arm1022e",1124 .name = "arm1022e",
1125 .llvm_name = "arm1022e",1125 .llvm_name = "arm1022e",
1126 .features = featureSet(&[_]Feature{1126 .features = featureSet(&[_]Feature{
1127 .armv5te,1127 .v5te,
1128 }),1128 }),
1129 };1129 };
1130 pub const arm10e = CpuModel{1130 pub const arm10e = CpuModel{
1131 .name = "arm10e",1131 .name = "arm10e",
1132 .llvm_name = "arm10e",1132 .llvm_name = "arm10e",
1133 .features = featureSet(&[_]Feature{1133 .features = featureSet(&[_]Feature{
1134 .armv5te,1134 .v5te,
1135 }),1135 }),
1136 };1136 };
1137 pub const arm10tdmi = CpuModel{1137 pub const arm10tdmi = CpuModel{
1138 .name = "arm10tdmi",1138 .name = "arm10tdmi",
1139 .llvm_name = "arm10tdmi",1139 .llvm_name = "arm10tdmi",
1140 .features = featureSet(&[_]Feature{1140 .features = featureSet(&[_]Feature{
1141 .armv5t,1141 .v5t,
1142 }),1142 }),
1143 };1143 };
1144 pub const arm1136j_s = CpuModel{1144 pub const arm1136j_s = CpuModel{
1145 .name = "arm1136j_s",1145 .name = "arm1136j_s",
1146 .llvm_name = "arm1136j-s",1146 .llvm_name = "arm1136j-s",
1147 .features = featureSet(&[_]Feature{1147 .features = featureSet(&[_]Feature{
1148 .armv6,1148 .v6,
1149 }),1149 }),
1150 };1150 };
1151 pub const arm1136jf_s = CpuModel{1151 pub const arm1136jf_s = CpuModel{
1152 .name = "arm1136jf_s",1152 .name = "arm1136jf_s",
1153 .llvm_name = "arm1136jf-s",1153 .llvm_name = "arm1136jf-s",
1154 .features = featureSet(&[_]Feature{1154 .features = featureSet(&[_]Feature{
1155 .armv6,1155 .v6,
1156 .slowfpvmlx,1156 .slowfpvmlx,
1157 .vfp2,1157 .vfp2,
1158 }),1158 }),
...@@ -1161,14 +1161,14 @@ pub const cpu = struct {...@@ -1161,14 +1161,14 @@ pub const cpu = struct {
1161 .name = "arm1156t2_s",1161 .name = "arm1156t2_s",
1162 .llvm_name = "arm1156t2-s",1162 .llvm_name = "arm1156t2-s",
1163 .features = featureSet(&[_]Feature{1163 .features = featureSet(&[_]Feature{
1164 .armv6t2,1164 .v6t2,
1165 }),1165 }),
1166 };1166 };
1167 pub const arm1156t2f_s = CpuModel{1167 pub const arm1156t2f_s = CpuModel{
1168 .name = "arm1156t2f_s",1168 .name = "arm1156t2f_s",
1169 .llvm_name = "arm1156t2f-s",1169 .llvm_name = "arm1156t2f-s",
1170 .features = featureSet(&[_]Feature{1170 .features = featureSet(&[_]Feature{
1171 .armv6t2,1171 .v6t2,
1172 .slowfpvmlx,1172 .slowfpvmlx,
1173 .vfp2,1173 .vfp2,
1174 }),1174 }),
...@@ -1177,21 +1177,21 @@ pub const cpu = struct {...@@ -1177,21 +1177,21 @@ pub const cpu = struct {
1177 .name = "arm1176j_s",1177 .name = "arm1176j_s",
1178 .llvm_name = "arm1176j-s",1178 .llvm_name = "arm1176j-s",
1179 .features = featureSet(&[_]Feature{1179 .features = featureSet(&[_]Feature{
1180 .armv6kz,1180 .v6kz,
1181 }),1181 }),
1182 };1182 };
1183 pub const arm1176jz_s = CpuModel{1183 pub const arm1176jz_s = CpuModel{
1184 .name = "arm1176jz_s",1184 .name = "arm1176jz_s",
1185 .llvm_name = "arm1176jz-s",1185 .llvm_name = "arm1176jz-s",
1186 .features = featureSet(&[_]Feature{1186 .features = featureSet(&[_]Feature{
1187 .armv6kz,1187 .v6kz,
1188 }),1188 }),
1189 };1189 };
1190 pub const arm1176jzf_s = CpuModel{1190 pub const arm1176jzf_s = CpuModel{
1191 .name = "arm1176jzf_s",1191 .name = "arm1176jzf_s",
1192 .llvm_name = "arm1176jzf-s",1192 .llvm_name = "arm1176jzf-s",
1193 .features = featureSet(&[_]Feature{1193 .features = featureSet(&[_]Feature{
1194 .armv6kz,1194 .v6kz,
1195 .slowfpvmlx,1195 .slowfpvmlx,
1196 .vfp2,1196 .vfp2,
1197 }),1197 }),
...@@ -1200,134 +1200,133 @@ pub const cpu = struct {...@@ -1200,134 +1200,133 @@ pub const cpu = struct {
1200 .name = "arm710t",1200 .name = "arm710t",
1201 .llvm_name = "arm710t",1201 .llvm_name = "arm710t",
1202 .features = featureSet(&[_]Feature{1202 .features = featureSet(&[_]Feature{
1203 .armv4t,1203 .v4t,
1204 }),1204 }),
1205 };1205 };
1206 pub const arm720t = CpuModel{1206 pub const arm720t = CpuModel{
1207 .name = "arm720t",1207 .name = "arm720t",
1208 .llvm_name = "arm720t",1208 .llvm_name = "arm720t",
1209 .features = featureSet(&[_]Feature{1209 .features = featureSet(&[_]Feature{
1210 .armv4t,1210 .v4t,
1211 }),1211 }),
1212 };1212 };
1213 pub const arm7tdmi = CpuModel{1213 pub const arm7tdmi = CpuModel{
1214 .name = "arm7tdmi",1214 .name = "arm7tdmi",
1215 .llvm_name = "arm7tdmi",1215 .llvm_name = "arm7tdmi",
1216 .features = featureSet(&[_]Feature{1216 .features = featureSet(&[_]Feature{
1217 .armv4t,1217 .v4t,
1218 }),1218 }),
1219 };1219 };
1220 pub const arm7tdmi_s = CpuModel{1220 pub const arm7tdmi_s = CpuModel{
1221 .name = "arm7tdmi_s",1221 .name = "arm7tdmi_s",
1222 .llvm_name = "arm7tdmi-s",1222 .llvm_name = "arm7tdmi-s",
1223 .features = featureSet(&[_]Feature{1223 .features = featureSet(&[_]Feature{
1224 .armv4t,1224 .v4t,
1225 }),1225 }),
1226 };1226 };
1227 pub const arm8 = CpuModel{1227 pub const arm8 = CpuModel{
1228 .name = "arm8",1228 .name = "arm8",
1229 .llvm_name = "arm8",1229 .llvm_name = "arm8",
1230 .features = featureSet(&[_]Feature{1230 .features = featureSet(&[_]Feature{
1231 .armv4,1231 .v4,
1232 }),1232 }),
1233 };1233 };
1234 pub const arm810 = CpuModel{1234 pub const arm810 = CpuModel{
1235 .name = "arm810",1235 .name = "arm810",
1236 .llvm_name = "arm810",1236 .llvm_name = "arm810",
1237 .features = featureSet(&[_]Feature{1237 .features = featureSet(&[_]Feature{
1238 .armv4,1238 .v4,
1239 }),1239 }),
1240 };1240 };
1241 pub const arm9 = CpuModel{1241 pub const arm9 = CpuModel{
1242 .name = "arm9",1242 .name = "arm9",
1243 .llvm_name = "arm9",1243 .llvm_name = "arm9",
1244 .features = featureSet(&[_]Feature{1244 .features = featureSet(&[_]Feature{
1245 .armv4t,1245 .v4t,
1246 }),1246 }),
1247 };1247 };
1248 pub const arm920 = CpuModel{1248 pub const arm920 = CpuModel{
1249 .name = "arm920",1249 .name = "arm920",
1250 .llvm_name = "arm920",1250 .llvm_name = "arm920",
1251 .features = featureSet(&[_]Feature{1251 .features = featureSet(&[_]Feature{
1252 .armv4t,1252 .v4t,
1253 }),1253 }),
1254 };1254 };
1255 pub const arm920t = CpuModel{1255 pub const arm920t = CpuModel{
1256 .name = "arm920t",1256 .name = "arm920t",
1257 .llvm_name = "arm920t",1257 .llvm_name = "arm920t",
1258 .features = featureSet(&[_]Feature{1258 .features = featureSet(&[_]Feature{
1259 .armv4t,1259 .v4t,
1260 }),1260 }),
1261 };1261 };
1262 pub const arm922t = CpuModel{1262 pub const arm922t = CpuModel{
1263 .name = "arm922t",1263 .name = "arm922t",
1264 .llvm_name = "arm922t",1264 .llvm_name = "arm922t",
1265 .features = featureSet(&[_]Feature{1265 .features = featureSet(&[_]Feature{
1266 .armv4t,1266 .v4t,
1267 }),1267 }),
1268 };1268 };
1269 pub const arm926ej_s = CpuModel{1269 pub const arm926ej_s = CpuModel{
1270 .name = "arm926ej_s",1270 .name = "arm926ej_s",
1271 .llvm_name = "arm926ej-s",1271 .llvm_name = "arm926ej-s",
1272 .features = featureSet(&[_]Feature{1272 .features = featureSet(&[_]Feature{
1273 .armv5te,1273 .v5te,
1274 }),1274 }),
1275 };1275 };
1276 pub const arm940t = CpuModel{1276 pub const arm940t = CpuModel{
1277 .name = "arm940t",1277 .name = "arm940t",
1278 .llvm_name = "arm940t",1278 .llvm_name = "arm940t",
1279 .features = featureSet(&[_]Feature{1279 .features = featureSet(&[_]Feature{
1280 .armv4t,1280 .v4t,
1281 }),1281 }),
1282 };1282 };
1283 pub const arm946e_s = CpuModel{1283 pub const arm946e_s = CpuModel{
1284 .name = "arm946e_s",1284 .name = "arm946e_s",
1285 .llvm_name = "arm946e-s",1285 .llvm_name = "arm946e-s",
1286 .features = featureSet(&[_]Feature{1286 .features = featureSet(&[_]Feature{
1287 .armv5te,1287 .v5te,
1288 }),1288 }),
1289 };1289 };
1290 pub const arm966e_s = CpuModel{1290 pub const arm966e_s = CpuModel{
1291 .name = "arm966e_s",1291 .name = "arm966e_s",
1292 .llvm_name = "arm966e-s",1292 .llvm_name = "arm966e-s",
1293 .features = featureSet(&[_]Feature{1293 .features = featureSet(&[_]Feature{
1294 .armv5te,1294 .v5te,
1295 }),1295 }),
1296 };1296 };
1297 pub const arm968e_s = CpuModel{1297 pub const arm968e_s = CpuModel{
1298 .name = "arm968e_s",1298 .name = "arm968e_s",
1299 .llvm_name = "arm968e-s",1299 .llvm_name = "arm968e-s",
1300 .features = featureSet(&[_]Feature{1300 .features = featureSet(&[_]Feature{
1301 .armv5te,1301 .v5te,
1302 }),1302 }),
1303 };1303 };
1304 pub const arm9e = CpuModel{1304 pub const arm9e = CpuModel{
1305 .name = "arm9e",1305 .name = "arm9e",
1306 .llvm_name = "arm9e",1306 .llvm_name = "arm9e",
1307 .features = featureSet(&[_]Feature{1307 .features = featureSet(&[_]Feature{
1308 .armv5te,1308 .v5te,
1309 }),1309 }),
1310 };1310 };
1311 pub const arm9tdmi = CpuModel{1311 pub const arm9tdmi = CpuModel{
1312 .name = "arm9tdmi",1312 .name = "arm9tdmi",
1313 .llvm_name = "arm9tdmi",1313 .llvm_name = "arm9tdmi",
1314 .features = featureSet(&[_]Feature{1314 .features = featureSet(&[_]Feature{
1315 .armv4t,1315 .v4t,
1316 }),1316 }),
1317 };1317 };
1318 pub const baseline = CpuModel{1318 pub const baseline = CpuModel{
1319 .name = "baseline",1319 .name = "baseline",
1320 .llvm_name = "generic",1320 .llvm_name = "generic",
1321 .features = featureSet(&[_]Feature{1321 .features = featureSet(&[_]Feature{
1322 .armv6_m,1322 .v6m,
1323 }),1323 }),
1324 };1324 };
1325 pub const cortex_a12 = CpuModel{1325 pub const cortex_a12 = CpuModel{
1326 .name = "cortex_a12",1326 .name = "cortex_a12",
1327 .llvm_name = "cortex-a12",1327 .llvm_name = "cortex-a12",
1328 .features = featureSet(&[_]Feature{1328 .features = featureSet(&[_]Feature{
1329 .a12,1329 .v7a,
1330 .armv7_a,
1331 .avoid_partial_cpsr,1330 .avoid_partial_cpsr,
1332 .mp,1331 .mp,
1333 .ret_addr_stack,1332 .ret_addr_stack,
...@@ -1341,7 +1340,7 @@ pub const cpu = struct {...@@ -1341,7 +1340,7 @@ pub const cpu = struct {
1341 .name = "cortex_a15",1340 .name = "cortex_a15",
1342 .llvm_name = "cortex-a15",1341 .llvm_name = "cortex-a15",
1343 .features = featureSet(&[_]Feature{1342 .features = featureSet(&[_]Feature{
1344 .armv7_a,1343 .v7a,
1345 .avoid_partial_cpsr,1344 .avoid_partial_cpsr,
1346 .dont_widen_vmovs,1345 .dont_widen_vmovs,
1347 .mp,1346 .mp,
...@@ -1358,7 +1357,7 @@ pub const cpu = struct {...@@ -1358,7 +1357,7 @@ pub const cpu = struct {
1358 .name = "cortex_a17",1357 .name = "cortex_a17",
1359 .llvm_name = "cortex-a17",1358 .llvm_name = "cortex-a17",
1360 .features = featureSet(&[_]Feature{1359 .features = featureSet(&[_]Feature{
1361 .armv7_a,1360 .v7a,
1362 .avoid_partial_cpsr,1361 .avoid_partial_cpsr,
1363 .mp,1362 .mp,
1364 .ret_addr_stack,1363 .ret_addr_stack,
...@@ -1372,7 +1371,7 @@ pub const cpu = struct {...@@ -1372,7 +1371,7 @@ pub const cpu = struct {
1372 .name = "cortex_a32",1371 .name = "cortex_a32",
1373 .llvm_name = "cortex-a32",1372 .llvm_name = "cortex-a32",
1374 .features = featureSet(&[_]Feature{1373 .features = featureSet(&[_]Feature{
1375 .armv8_a,1374 .v8a,
1376 .crc,1375 .crc,
1377 .crypto,1376 .crypto,
1378 .hwdiv,1377 .hwdiv,
...@@ -1383,7 +1382,7 @@ pub const cpu = struct {...@@ -1383,7 +1382,7 @@ pub const cpu = struct {
1383 .name = "cortex_a35",1382 .name = "cortex_a35",
1384 .llvm_name = "cortex-a35",1383 .llvm_name = "cortex-a35",
1385 .features = featureSet(&[_]Feature{1384 .features = featureSet(&[_]Feature{
1386 .armv8_a,1385 .v8a,
1387 .crc,1386 .crc,
1388 .crypto,1387 .crypto,
1389 .hwdiv,1388 .hwdiv,
...@@ -1394,7 +1393,7 @@ pub const cpu = struct {...@@ -1394,7 +1393,7 @@ pub const cpu = struct {
1394 .name = "cortex_a5",1393 .name = "cortex_a5",
1395 .llvm_name = "cortex-a5",1394 .llvm_name = "cortex-a5",
1396 .features = featureSet(&[_]Feature{1395 .features = featureSet(&[_]Feature{
1397 .armv7_a,1396 .v7a,
1398 .mp,1397 .mp,
1399 .ret_addr_stack,1398 .ret_addr_stack,
1400 .slow_fp_brcc,1399 .slow_fp_brcc,
...@@ -1408,7 +1407,7 @@ pub const cpu = struct {...@@ -1408,7 +1407,7 @@ pub const cpu = struct {
1408 .name = "cortex_a53",1407 .name = "cortex_a53",
1409 .llvm_name = "cortex-a53",1408 .llvm_name = "cortex-a53",
1410 .features = featureSet(&[_]Feature{1409 .features = featureSet(&[_]Feature{
1411 .armv8_a,1410 .v8a,
1412 .crc,1411 .crc,
1413 .crypto,1412 .crypto,
1414 .fpao,1413 .fpao,
...@@ -1420,7 +1419,7 @@ pub const cpu = struct {...@@ -1420,7 +1419,7 @@ pub const cpu = struct {
1420 .name = "cortex_a55",1419 .name = "cortex_a55",
1421 .llvm_name = "cortex-a55",1420 .llvm_name = "cortex-a55",
1422 .features = featureSet(&[_]Feature{1421 .features = featureSet(&[_]Feature{
1423 .armv8_2_a,1422 .v8_2a,
1424 .dotprod,1423 .dotprod,
1425 .hwdiv,1424 .hwdiv,
1426 .hwdiv_arm,1425 .hwdiv_arm,
...@@ -1430,7 +1429,7 @@ pub const cpu = struct {...@@ -1430,7 +1429,7 @@ pub const cpu = struct {
1430 .name = "cortex_a57",1429 .name = "cortex_a57",
1431 .llvm_name = "cortex-a57",1430 .llvm_name = "cortex-a57",
1432 .features = featureSet(&[_]Feature{1431 .features = featureSet(&[_]Feature{
1433 .armv8_a,1432 .v8a,
1434 .avoid_partial_cpsr,1433 .avoid_partial_cpsr,
1435 .cheap_predicable_cpsr,1434 .cheap_predicable_cpsr,
1436 .crc,1435 .crc,
...@@ -1444,7 +1443,7 @@ pub const cpu = struct {...@@ -1444,7 +1443,7 @@ pub const cpu = struct {
1444 .name = "cortex_a7",1443 .name = "cortex_a7",
1445 .llvm_name = "cortex-a7",1444 .llvm_name = "cortex-a7",
1446 .features = featureSet(&[_]Feature{1445 .features = featureSet(&[_]Feature{
1447 .armv7_a,1446 .v7a,
1448 .mp,1447 .mp,
1449 .ret_addr_stack,1448 .ret_addr_stack,
1450 .slow_fp_brcc,1449 .slow_fp_brcc,
...@@ -1460,7 +1459,7 @@ pub const cpu = struct {...@@ -1460,7 +1459,7 @@ pub const cpu = struct {
1460 .name = "cortex_a72",1459 .name = "cortex_a72",
1461 .llvm_name = "cortex-a72",1460 .llvm_name = "cortex-a72",
1462 .features = featureSet(&[_]Feature{1461 .features = featureSet(&[_]Feature{
1463 .armv8_a,1462 .v8a,
1464 .crc,1463 .crc,
1465 .crypto,1464 .crypto,
1466 .hwdiv,1465 .hwdiv,
...@@ -1471,7 +1470,7 @@ pub const cpu = struct {...@@ -1471,7 +1470,7 @@ pub const cpu = struct {
1471 .name = "cortex_a73",1470 .name = "cortex_a73",
1472 .llvm_name = "cortex-a73",1471 .llvm_name = "cortex-a73",
1473 .features = featureSet(&[_]Feature{1472 .features = featureSet(&[_]Feature{
1474 .armv8_a,1473 .v8a,
1475 .crc,1474 .crc,
1476 .crypto,1475 .crypto,
1477 .hwdiv,1476 .hwdiv,
...@@ -1482,7 +1481,7 @@ pub const cpu = struct {...@@ -1482,7 +1481,7 @@ pub const cpu = struct {
1482 .name = "cortex_a75",1481 .name = "cortex_a75",
1483 .llvm_name = "cortex-a75",1482 .llvm_name = "cortex-a75",
1484 .features = featureSet(&[_]Feature{1483 .features = featureSet(&[_]Feature{
1485 .armv8_2_a,1484 .v8_2a,
1486 .dotprod,1485 .dotprod,
1487 .hwdiv,1486 .hwdiv,
1488 .hwdiv_arm,1487 .hwdiv_arm,
...@@ -1493,7 +1492,7 @@ pub const cpu = struct {...@@ -1493,7 +1492,7 @@ pub const cpu = struct {
1493 .llvm_name = "cortex-a76",1492 .llvm_name = "cortex-a76",
1494 .features = featureSet(&[_]Feature{1493 .features = featureSet(&[_]Feature{
1495 .a76,1494 .a76,
1496 .armv8_2_a,1495 .v8_2a,
1497 .crc,1496 .crc,
1498 .crypto,1497 .crypto,
1499 .dotprod,1498 .dotprod,
...@@ -1507,7 +1506,7 @@ pub const cpu = struct {...@@ -1507,7 +1506,7 @@ pub const cpu = struct {
1507 .llvm_name = "cortex-a76ae",1506 .llvm_name = "cortex-a76ae",
1508 .features = featureSet(&[_]Feature{1507 .features = featureSet(&[_]Feature{
1509 .a76,1508 .a76,
1510 .armv8_2_a,1509 .v8_2a,
1511 .crc,1510 .crc,
1512 .crypto,1511 .crypto,
1513 .dotprod,1512 .dotprod,
...@@ -1520,7 +1519,7 @@ pub const cpu = struct {...@@ -1520,7 +1519,7 @@ pub const cpu = struct {
1520 .name = "cortex_a8",1519 .name = "cortex_a8",
1521 .llvm_name = "cortex-a8",1520 .llvm_name = "cortex-a8",
1522 .features = featureSet(&[_]Feature{1521 .features = featureSet(&[_]Feature{
1523 .armv7_a,1522 .v7a,
1524 .nonpipelined_vfp,1523 .nonpipelined_vfp,
1525 .ret_addr_stack,1524 .ret_addr_stack,
1526 .slow_fp_brcc,1525 .slow_fp_brcc,
...@@ -1534,7 +1533,7 @@ pub const cpu = struct {...@@ -1534,7 +1533,7 @@ pub const cpu = struct {
1534 .name = "cortex_a9",1533 .name = "cortex_a9",
1535 .llvm_name = "cortex-a9",1534 .llvm_name = "cortex-a9",
1536 .features = featureSet(&[_]Feature{1535 .features = featureSet(&[_]Feature{
1537 .armv7_a,1536 .v7a,
1538 .avoid_partial_cpsr,1537 .avoid_partial_cpsr,
1539 .expand_fp_mlx,1538 .expand_fp_mlx,
1540 .fp16,1539 .fp16,
...@@ -1553,28 +1552,28 @@ pub const cpu = struct {...@@ -1553,28 +1552,28 @@ pub const cpu = struct {
1553 .name = "cortex_m0",1552 .name = "cortex_m0",
1554 .llvm_name = "cortex-m0",1553 .llvm_name = "cortex-m0",
1555 .features = featureSet(&[_]Feature{1554 .features = featureSet(&[_]Feature{
1556 .armv6_m,1555 .v6m,
1557 }),1556 }),
1558 };1557 };
1559 pub const cortex_m0plus = CpuModel{1558 pub const cortex_m0plus = CpuModel{
1560 .name = "cortex_m0plus",1559 .name = "cortex_m0plus",
1561 .llvm_name = "cortex-m0plus",1560 .llvm_name = "cortex-m0plus",
1562 .features = featureSet(&[_]Feature{1561 .features = featureSet(&[_]Feature{
1563 .armv6_m,1562 .v6m,
1564 }),1563 }),
1565 };1564 };
1566 pub const cortex_m1 = CpuModel{1565 pub const cortex_m1 = CpuModel{
1567 .name = "cortex_m1",1566 .name = "cortex_m1",
1568 .llvm_name = "cortex-m1",1567 .llvm_name = "cortex-m1",
1569 .features = featureSet(&[_]Feature{1568 .features = featureSet(&[_]Feature{
1570 .armv6_m,1569 .v6m,
1571 }),1570 }),
1572 };1571 };
1573 pub const cortex_m23 = CpuModel{1572 pub const cortex_m23 = CpuModel{
1574 .name = "cortex_m23",1573 .name = "cortex_m23",
1575 .llvm_name = "cortex-m23",1574 .llvm_name = "cortex-m23",
1576 .features = featureSet(&[_]Feature{1575 .features = featureSet(&[_]Feature{
1577 .armv8_m_base,1576 .v8m,
1578 .no_movt,1577 .no_movt,
1579 }),1578 }),
1580 };1579 };
...@@ -1582,7 +1581,7 @@ pub const cpu = struct {...@@ -1582,7 +1581,7 @@ pub const cpu = struct {
1582 .name = "cortex_m3",1581 .name = "cortex_m3",
1583 .llvm_name = "cortex-m3",1582 .llvm_name = "cortex-m3",
1584 .features = featureSet(&[_]Feature{1583 .features = featureSet(&[_]Feature{
1585 .armv7_m,1584 .v7m,
1586 .loop_align,1585 .loop_align,
1587 .m3,1586 .m3,
1588 .no_branch_predictor,1587 .no_branch_predictor,
...@@ -1594,7 +1593,7 @@ pub const cpu = struct {...@@ -1594,7 +1593,7 @@ pub const cpu = struct {
1594 .name = "cortex_m33",1593 .name = "cortex_m33",
1595 .llvm_name = "cortex-m33",1594 .llvm_name = "cortex-m33",
1596 .features = featureSet(&[_]Feature{1595 .features = featureSet(&[_]Feature{
1597 .armv8_m_main,1596 .v8m_main,
1598 .dsp,1597 .dsp,
1599 .fp_armv8d16sp,1598 .fp_armv8d16sp,
1600 .loop_align,1599 .loop_align,
...@@ -1608,7 +1607,7 @@ pub const cpu = struct {...@@ -1608,7 +1607,7 @@ pub const cpu = struct {
1608 .name = "cortex_m35p",1607 .name = "cortex_m35p",
1609 .llvm_name = "cortex-m35p",1608 .llvm_name = "cortex-m35p",
1610 .features = featureSet(&[_]Feature{1609 .features = featureSet(&[_]Feature{
1611 .armv8_m_main,1610 .v8m_main,
1612 .dsp,1611 .dsp,
1613 .fp_armv8d16sp,1612 .fp_armv8d16sp,
1614 .loop_align,1613 .loop_align,
...@@ -1622,7 +1621,7 @@ pub const cpu = struct {...@@ -1622,7 +1621,7 @@ pub const cpu = struct {
1622 .name = "cortex_m4",1621 .name = "cortex_m4",
1623 .llvm_name = "cortex-m4",1622 .llvm_name = "cortex-m4",
1624 .features = featureSet(&[_]Feature{1623 .features = featureSet(&[_]Feature{
1625 .armv7e_m,1624 .v7em,
1626 .loop_align,1625 .loop_align,
1627 .no_branch_predictor,1626 .no_branch_predictor,
1628 .slowfpvmlx,1627 .slowfpvmlx,
...@@ -1635,7 +1634,7 @@ pub const cpu = struct {...@@ -1635,7 +1634,7 @@ pub const cpu = struct {
1635 .name = "cortex_m7",1634 .name = "cortex_m7",
1636 .llvm_name = "cortex-m7",1635 .llvm_name = "cortex-m7",
1637 .features = featureSet(&[_]Feature{1636 .features = featureSet(&[_]Feature{
1638 .armv7e_m,1637 .v7em,
1639 .fp_armv8d16,1638 .fp_armv8d16,
1640 }),1639 }),
1641 };1640 };
...@@ -1643,7 +1642,7 @@ pub const cpu = struct {...@@ -1643,7 +1642,7 @@ pub const cpu = struct {
1643 .name = "cortex_r4",1642 .name = "cortex_r4",
1644 .llvm_name = "cortex-r4",1643 .llvm_name = "cortex-r4",
1645 .features = featureSet(&[_]Feature{1644 .features = featureSet(&[_]Feature{
1646 .armv7_r,1645 .v7r,
1647 .avoid_partial_cpsr,1646 .avoid_partial_cpsr,
1648 .r4,1647 .r4,
1649 .ret_addr_stack,1648 .ret_addr_stack,
...@@ -1653,7 +1652,7 @@ pub const cpu = struct {...@@ -1653,7 +1652,7 @@ pub const cpu = struct {
1653 .name = "cortex_r4f",1652 .name = "cortex_r4f",
1654 .llvm_name = "cortex-r4f",1653 .llvm_name = "cortex-r4f",
1655 .features = featureSet(&[_]Feature{1654 .features = featureSet(&[_]Feature{
1656 .armv7_r,1655 .v7r,
1657 .avoid_partial_cpsr,1656 .avoid_partial_cpsr,
1658 .r4,1657 .r4,
1659 .ret_addr_stack,1658 .ret_addr_stack,
...@@ -1666,7 +1665,7 @@ pub const cpu = struct {...@@ -1666,7 +1665,7 @@ pub const cpu = struct {
1666 .name = "cortex_r5",1665 .name = "cortex_r5",
1667 .llvm_name = "cortex-r5",1666 .llvm_name = "cortex-r5",
1668 .features = featureSet(&[_]Feature{1667 .features = featureSet(&[_]Feature{
1669 .armv7_r,1668 .v7r,
1670 .avoid_partial_cpsr,1669 .avoid_partial_cpsr,
1671 .hwdiv_arm,1670 .hwdiv_arm,
1672 .ret_addr_stack,1671 .ret_addr_stack,
...@@ -1679,7 +1678,7 @@ pub const cpu = struct {...@@ -1679,7 +1678,7 @@ pub const cpu = struct {
1679 .name = "cortex_r52",1678 .name = "cortex_r52",
1680 .llvm_name = "cortex-r52",1679 .llvm_name = "cortex-r52",
1681 .features = featureSet(&[_]Feature{1680 .features = featureSet(&[_]Feature{
1682 .armv8_r,1681 .v8r,
1683 .fpao,1682 .fpao,
1684 .use_aa,1683 .use_aa,
1685 .use_misched,1684 .use_misched,
...@@ -1689,7 +1688,7 @@ pub const cpu = struct {...@@ -1689,7 +1688,7 @@ pub const cpu = struct {
1689 .name = "cortex_r7",1688 .name = "cortex_r7",
1690 .llvm_name = "cortex-r7",1689 .llvm_name = "cortex-r7",
1691 .features = featureSet(&[_]Feature{1690 .features = featureSet(&[_]Feature{
1692 .armv7_r,1691 .v7r,
1693 .avoid_partial_cpsr,1692 .avoid_partial_cpsr,
1694 .fp16,1693 .fp16,
1695 .hwdiv_arm,1694 .hwdiv_arm,
...@@ -1704,7 +1703,7 @@ pub const cpu = struct {...@@ -1704,7 +1703,7 @@ pub const cpu = struct {
1704 .name = "cortex_r8",1703 .name = "cortex_r8",
1705 .llvm_name = "cortex-r8",1704 .llvm_name = "cortex-r8",
1706 .features = featureSet(&[_]Feature{1705 .features = featureSet(&[_]Feature{
1707 .armv7_r,1706 .v7r,
1708 .avoid_partial_cpsr,1707 .avoid_partial_cpsr,
1709 .fp16,1708 .fp16,
1710 .hwdiv_arm,1709 .hwdiv_arm,
...@@ -1719,7 +1718,7 @@ pub const cpu = struct {...@@ -1719,7 +1718,7 @@ pub const cpu = struct {
1719 .name = "cyclone",1718 .name = "cyclone",
1720 .llvm_name = "cyclone",1719 .llvm_name = "cyclone",
1721 .features = featureSet(&[_]Feature{1720 .features = featureSet(&[_]Feature{
1722 .armv8_a,1721 .v8a,
1723 .avoid_movs_shop,1722 .avoid_movs_shop,
1724 .avoid_partial_cpsr,1723 .avoid_partial_cpsr,
1725 .crypto,1724 .crypto,
...@@ -1740,14 +1739,14 @@ pub const cpu = struct {...@@ -1740,14 +1739,14 @@ pub const cpu = struct {
1740 .name = "ep9312",1739 .name = "ep9312",
1741 .llvm_name = "ep9312",1740 .llvm_name = "ep9312",
1742 .features = featureSet(&[_]Feature{1741 .features = featureSet(&[_]Feature{
1743 .armv4t,1742 .v4t,
1744 }),1743 }),
1745 };1744 };
1746 pub const exynos_m1 = CpuModel{1745 pub const exynos_m1 = CpuModel{
1747 .name = "exynos_m1",1746 .name = "exynos_m1",
1748 .llvm_name = "exynos-m1",1747 .llvm_name = "exynos-m1",
1749 .features = featureSet(&[_]Feature{1748 .features = featureSet(&[_]Feature{
1750 .armv8_a,1749 .v8a,
1751 .exynos,1750 .exynos,
1752 }),1751 }),
1753 };1752 };
...@@ -1755,7 +1754,7 @@ pub const cpu = struct {...@@ -1755,7 +1754,7 @@ pub const cpu = struct {
1755 .name = "exynos_m2",1754 .name = "exynos_m2",
1756 .llvm_name = "exynos-m2",1755 .llvm_name = "exynos-m2",
1757 .features = featureSet(&[_]Feature{1756 .features = featureSet(&[_]Feature{
1758 .armv8_a,1757 .v8a,
1759 .exynos,1758 .exynos,
1760 }),1759 }),
1761 };1760 };
...@@ -1763,7 +1762,7 @@ pub const cpu = struct {...@@ -1763,7 +1762,7 @@ pub const cpu = struct {
1763 .name = "exynos_m3",1762 .name = "exynos_m3",
1764 .llvm_name = "exynos-m3",1763 .llvm_name = "exynos-m3",
1765 .features = featureSet(&[_]Feature{1764 .features = featureSet(&[_]Feature{
1766 .armv8_a,1765 .v8a,
1767 .exynos,1766 .exynos,
1768 }),1767 }),
1769 };1768 };
...@@ -1771,7 +1770,7 @@ pub const cpu = struct {...@@ -1771,7 +1770,7 @@ pub const cpu = struct {
1771 .name = "exynos_m4",1770 .name = "exynos_m4",
1772 .llvm_name = "exynos-m4",1771 .llvm_name = "exynos-m4",
1773 .features = featureSet(&[_]Feature{1772 .features = featureSet(&[_]Feature{
1774 .armv8_2_a,1773 .v8_2a,
1775 .dotprod,1774 .dotprod,
1776 .exynos,1775 .exynos,
1777 .fullfp16,1776 .fullfp16,
...@@ -1781,10 +1780,10 @@ pub const cpu = struct {...@@ -1781,10 +1780,10 @@ pub const cpu = struct {
1781 .name = "exynos_m5",1780 .name = "exynos_m5",
1782 .llvm_name = "exynos-m5",1781 .llvm_name = "exynos-m5",
1783 .features = featureSet(&[_]Feature{1782 .features = featureSet(&[_]Feature{
1784 .armv8_2_a,
1785 .dotprod,1783 .dotprod,
1786 .exynos,1784 .exynos,
1787 .fullfp16,1785 .fullfp16,
1786 .v8_2a,
1788 }),1787 }),
1789 };1788 };
1790 pub const generic = CpuModel{1789 pub const generic = CpuModel{
...@@ -1796,20 +1795,20 @@ pub const cpu = struct {...@@ -1796,20 +1795,20 @@ pub const cpu = struct {
1796 .name = "iwmmxt",1795 .name = "iwmmxt",
1797 .llvm_name = "iwmmxt",1796 .llvm_name = "iwmmxt",
1798 .features = featureSet(&[_]Feature{1797 .features = featureSet(&[_]Feature{
1799 .armv5te,1798 .v5te,
1800 }),1799 }),
1801 };1800 };
1802 pub const krait = CpuModel{1801 pub const krait = CpuModel{
1803 .name = "krait",1802 .name = "krait",
1804 .llvm_name = "krait",1803 .llvm_name = "krait",
1805 .features = featureSet(&[_]Feature{1804 .features = featureSet(&[_]Feature{
1806 .armv7_a,
1807 .avoid_partial_cpsr,1805 .avoid_partial_cpsr,
1808 .fp16,1806 .fp16,
1809 .hwdiv,1807 .hwdiv,
1810 .hwdiv_arm,1808 .hwdiv_arm,
1811 .muxed_units,1809 .muxed_units,
1812 .ret_addr_stack,1810 .ret_addr_stack,
1811 .v7a,
1813 .vfp4,1812 .vfp4,
1814 .vldn_align,1813 .vldn_align,
1815 .vmlx_forwarding,1814 .vmlx_forwarding,
...@@ -1819,19 +1818,18 @@ pub const cpu = struct {...@@ -1819,19 +1818,18 @@ pub const cpu = struct {
1819 .name = "kryo",1818 .name = "kryo",
1820 .llvm_name = "kryo",1819 .llvm_name = "kryo",
1821 .features = featureSet(&[_]Feature{1820 .features = featureSet(&[_]Feature{
1822 .armv8_a,
1823 .crc,1821 .crc,
1824 .crypto,1822 .crypto,
1825 .hwdiv,1823 .hwdiv,
1826 .hwdiv_arm,1824 .hwdiv_arm,
1827 .kryo,1825 .v8a,
1828 }),1826 }),
1829 };1827 };
1830 pub const mpcore = CpuModel{1828 pub const mpcore = CpuModel{
1831 .name = "mpcore",1829 .name = "mpcore",
1832 .llvm_name = "mpcore",1830 .llvm_name = "mpcore",
1833 .features = featureSet(&[_]Feature{1831 .features = featureSet(&[_]Feature{
1834 .armv6k,1832 .v6k,
1835 .slowfpvmlx,1833 .slowfpvmlx,
1836 .vfp2,1834 .vfp2,
1837 }),1835 }),
...@@ -1840,21 +1838,21 @@ pub const cpu = struct {...@@ -1840,21 +1838,21 @@ pub const cpu = struct {
1840 .name = "mpcorenovfp",1838 .name = "mpcorenovfp",
1841 .llvm_name = "mpcorenovfp",1839 .llvm_name = "mpcorenovfp",
1842 .features = featureSet(&[_]Feature{1840 .features = featureSet(&[_]Feature{
1843 .armv6k,1841 .v6k,
1844 }),1842 }),
1845 };1843 };
1846 pub const sc000 = CpuModel{1844 pub const sc000 = CpuModel{
1847 .name = "sc000",1845 .name = "sc000",
1848 .llvm_name = "sc000",1846 .llvm_name = "sc000",
1849 .features = featureSet(&[_]Feature{1847 .features = featureSet(&[_]Feature{
1850 .armv6_m,1848 .v6m,
1851 }),1849 }),
1852 };1850 };
1853 pub const sc300 = CpuModel{1851 pub const sc300 = CpuModel{
1854 .name = "sc300",1852 .name = "sc300",
1855 .llvm_name = "sc300",1853 .llvm_name = "sc300",
1856 .features = featureSet(&[_]Feature{1854 .features = featureSet(&[_]Feature{
1857 .armv7_m,1855 .v7m,
1858 .m3,1856 .m3,
1859 .no_branch_predictor,1857 .no_branch_predictor,
1860 .use_aa,1858 .use_aa,
...@@ -1865,35 +1863,35 @@ pub const cpu = struct {...@@ -1865,35 +1863,35 @@ pub const cpu = struct {
1865 .name = "strongarm",1863 .name = "strongarm",
1866 .llvm_name = "strongarm",1864 .llvm_name = "strongarm",
1867 .features = featureSet(&[_]Feature{1865 .features = featureSet(&[_]Feature{
1868 .armv4,1866 .v4,
1869 }),1867 }),
1870 };1868 };
1871 pub const strongarm110 = CpuModel{1869 pub const strongarm110 = CpuModel{
1872 .name = "strongarm110",1870 .name = "strongarm110",
1873 .llvm_name = "strongarm110",1871 .llvm_name = "strongarm110",
1874 .features = featureSet(&[_]Feature{1872 .features = featureSet(&[_]Feature{
1875 .armv4,1873 .v4,
1876 }),1874 }),
1877 };1875 };
1878 pub const strongarm1100 = CpuModel{1876 pub const strongarm1100 = CpuModel{
1879 .name = "strongarm1100",1877 .name = "strongarm1100",
1880 .llvm_name = "strongarm1100",1878 .llvm_name = "strongarm1100",
1881 .features = featureSet(&[_]Feature{1879 .features = featureSet(&[_]Feature{
1882 .armv4,1880 .v4,
1883 }),1881 }),
1884 };1882 };
1885 pub const strongarm1110 = CpuModel{1883 pub const strongarm1110 = CpuModel{
1886 .name = "strongarm1110",1884 .name = "strongarm1110",
1887 .llvm_name = "strongarm1110",1885 .llvm_name = "strongarm1110",
1888 .features = featureSet(&[_]Feature{1886 .features = featureSet(&[_]Feature{
1889 .armv4,1887 .v4,
1890 }),1888 }),
1891 };1889 };
1892 pub const swift = CpuModel{1890 pub const swift = CpuModel{
1893 .name = "swift",1891 .name = "swift",
1894 .llvm_name = "swift",1892 .llvm_name = "swift",
1895 .features = featureSet(&[_]Feature{1893 .features = featureSet(&[_]Feature{
1896 .armv7_a,1894 .v7a,
1897 .avoid_movs_shop,1895 .avoid_movs_shop,
1898 .avoid_partial_cpsr,1896 .avoid_partial_cpsr,
1899 .disable_postra_scheduler,1897 .disable_postra_scheduler,
...@@ -1920,7 +1918,7 @@ pub const cpu = struct {...@@ -1920,7 +1918,7 @@ pub const cpu = struct {
1920 .name = "xscale",1918 .name = "xscale",
1921 .llvm_name = "xscale",1919 .llvm_name = "xscale",
1922 .features = featureSet(&[_]Feature{1920 .features = featureSet(&[_]Feature{
1923 .armv5te,1921 .v5te,
1924 }),1922 }),
1925 };1923 };
1926};1924};
lib/std/target/avr.zig+263-262
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 addsubiw,6 addsubiw,
...@@ -37,12 +38,12 @@ pub const Feature = enum {...@@ -37,12 +38,12 @@ pub const Feature = enum {
37 xmegau,38 xmegau,
38};39};
3940
40pub usingnamespace Cpu.Feature.feature_set_fns(Feature);41pub usingnamespace CpuFeature.feature_set_fns(Feature);
4142
42pub const all_features = blk: {43pub const all_features = blk: {
43 const len = @typeInfo(Feature).Enum.fields.len;44 const len = @typeInfo(Feature).Enum.fields.len;
44 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);45 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
45 var result: [len]Cpu.Feature = undefined;46 var result: [len]CpuFeature = undefined;
46 result[@enumToInt(Feature.addsubiw)] = .{47 result[@enumToInt(Feature.addsubiw)] = .{
47 .llvm_name = "addsubiw",48 .llvm_name = "addsubiw",
48 .description = "Enable 16-bit register-immediate addition and subtraction instructions",49 .description = "Enable 16-bit register-immediate addition and subtraction instructions",
...@@ -293,28 +294,28 @@ pub const all_features = blk: {...@@ -293,28 +294,28 @@ pub const all_features = blk: {
293};294};
294295
295pub const cpu = struct {296pub const cpu = struct {
296 pub const at43usb320 = Cpu{297 pub const at43usb320 = CpuModel{
297 .name = "at43usb320",298 .name = "at43usb320",
298 .llvm_name = "at43usb320",299 .llvm_name = "at43usb320",
299 .features = featureSet(&[_]Feature{300 .features = featureSet(&[_]Feature{
300 .avr31,301 .avr31,
301 }),302 }),
302 };303 };
303 pub const at43usb355 = Cpu{304 pub const at43usb355 = CpuModel{
304 .name = "at43usb355",305 .name = "at43usb355",
305 .llvm_name = "at43usb355",306 .llvm_name = "at43usb355",
306 .features = featureSet(&[_]Feature{307 .features = featureSet(&[_]Feature{
307 .avr3,308 .avr3,
308 }),309 }),
309 };310 };
310 pub const at76c711 = Cpu{311 pub const at76c711 = CpuModel{
311 .name = "at76c711",312 .name = "at76c711",
312 .llvm_name = "at76c711",313 .llvm_name = "at76c711",
313 .features = featureSet(&[_]Feature{314 .features = featureSet(&[_]Feature{
314 .avr3,315 .avr3,
315 }),316 }),
316 };317 };
317 pub const at86rf401 = Cpu{318 pub const at86rf401 = CpuModel{
318 .name = "at86rf401",319 .name = "at86rf401",
319 .llvm_name = "at86rf401",320 .llvm_name = "at86rf401",
320 .features = featureSet(&[_]Feature{321 .features = featureSet(&[_]Feature{
...@@ -323,217 +324,217 @@ pub const cpu = struct {...@@ -323,217 +324,217 @@ pub const cpu = struct {
323 .movw,324 .movw,
324 }),325 }),
325 };326 };
326 pub const at90c8534 = Cpu{327 pub const at90c8534 = CpuModel{
327 .name = "at90c8534",328 .name = "at90c8534",
328 .llvm_name = "at90c8534",329 .llvm_name = "at90c8534",
329 .features = featureSet(&[_]Feature{330 .features = featureSet(&[_]Feature{
330 .avr2,331 .avr2,
331 }),332 }),
332 };333 };
333 pub const at90can128 = Cpu{334 pub const at90can128 = CpuModel{
334 .name = "at90can128",335 .name = "at90can128",
335 .llvm_name = "at90can128",336 .llvm_name = "at90can128",
336 .features = featureSet(&[_]Feature{337 .features = featureSet(&[_]Feature{
337 .avr51,338 .avr51,
338 }),339 }),
339 };340 };
340 pub const at90can32 = Cpu{341 pub const at90can32 = CpuModel{
341 .name = "at90can32",342 .name = "at90can32",
342 .llvm_name = "at90can32",343 .llvm_name = "at90can32",
343 .features = featureSet(&[_]Feature{344 .features = featureSet(&[_]Feature{
344 .avr5,345 .avr5,
345 }),346 }),
346 };347 };
347 pub const at90can64 = Cpu{348 pub const at90can64 = CpuModel{
348 .name = "at90can64",349 .name = "at90can64",
349 .llvm_name = "at90can64",350 .llvm_name = "at90can64",
350 .features = featureSet(&[_]Feature{351 .features = featureSet(&[_]Feature{
351 .avr5,352 .avr5,
352 }),353 }),
353 };354 };
354 pub const at90pwm1 = Cpu{355 pub const at90pwm1 = CpuModel{
355 .name = "at90pwm1",356 .name = "at90pwm1",
356 .llvm_name = "at90pwm1",357 .llvm_name = "at90pwm1",
357 .features = featureSet(&[_]Feature{358 .features = featureSet(&[_]Feature{
358 .avr4,359 .avr4,
359 }),360 }),
360 };361 };
361 pub const at90pwm161 = Cpu{362 pub const at90pwm161 = CpuModel{
362 .name = "at90pwm161",363 .name = "at90pwm161",
363 .llvm_name = "at90pwm161",364 .llvm_name = "at90pwm161",
364 .features = featureSet(&[_]Feature{365 .features = featureSet(&[_]Feature{
365 .avr5,366 .avr5,
366 }),367 }),
367 };368 };
368 pub const at90pwm2 = Cpu{369 pub const at90pwm2 = CpuModel{
369 .name = "at90pwm2",370 .name = "at90pwm2",
370 .llvm_name = "at90pwm2",371 .llvm_name = "at90pwm2",
371 .features = featureSet(&[_]Feature{372 .features = featureSet(&[_]Feature{
372 .avr4,373 .avr4,
373 }),374 }),
374 };375 };
375 pub const at90pwm216 = Cpu{376 pub const at90pwm216 = CpuModel{
376 .name = "at90pwm216",377 .name = "at90pwm216",
377 .llvm_name = "at90pwm216",378 .llvm_name = "at90pwm216",
378 .features = featureSet(&[_]Feature{379 .features = featureSet(&[_]Feature{
379 .avr5,380 .avr5,
380 }),381 }),
381 };382 };
382 pub const at90pwm2b = Cpu{383 pub const at90pwm2b = CpuModel{
383 .name = "at90pwm2b",384 .name = "at90pwm2b",
384 .llvm_name = "at90pwm2b",385 .llvm_name = "at90pwm2b",
385 .features = featureSet(&[_]Feature{386 .features = featureSet(&[_]Feature{
386 .avr4,387 .avr4,
387 }),388 }),
388 };389 };
389 pub const at90pwm3 = Cpu{390 pub const at90pwm3 = CpuModel{
390 .name = "at90pwm3",391 .name = "at90pwm3",
391 .llvm_name = "at90pwm3",392 .llvm_name = "at90pwm3",
392 .features = featureSet(&[_]Feature{393 .features = featureSet(&[_]Feature{
393 .avr4,394 .avr4,
394 }),395 }),
395 };396 };
396 pub const at90pwm316 = Cpu{397 pub const at90pwm316 = CpuModel{
397 .name = "at90pwm316",398 .name = "at90pwm316",
398 .llvm_name = "at90pwm316",399 .llvm_name = "at90pwm316",
399 .features = featureSet(&[_]Feature{400 .features = featureSet(&[_]Feature{
400 .avr5,401 .avr5,
401 }),402 }),
402 };403 };
403 pub const at90pwm3b = Cpu{404 pub const at90pwm3b = CpuModel{
404 .name = "at90pwm3b",405 .name = "at90pwm3b",
405 .llvm_name = "at90pwm3b",406 .llvm_name = "at90pwm3b",
406 .features = featureSet(&[_]Feature{407 .features = featureSet(&[_]Feature{
407 .avr4,408 .avr4,
408 }),409 }),
409 };410 };
410 pub const at90pwm81 = Cpu{411 pub const at90pwm81 = CpuModel{
411 .name = "at90pwm81",412 .name = "at90pwm81",
412 .llvm_name = "at90pwm81",413 .llvm_name = "at90pwm81",
413 .features = featureSet(&[_]Feature{414 .features = featureSet(&[_]Feature{
414 .avr4,415 .avr4,
415 }),416 }),
416 };417 };
417 pub const at90s1200 = Cpu{418 pub const at90s1200 = CpuModel{
418 .name = "at90s1200",419 .name = "at90s1200",
419 .llvm_name = "at90s1200",420 .llvm_name = "at90s1200",
420 .features = featureSet(&[_]Feature{421 .features = featureSet(&[_]Feature{
421 .avr0,422 .avr0,
422 }),423 }),
423 };424 };
424 pub const at90s2313 = Cpu{425 pub const at90s2313 = CpuModel{
425 .name = "at90s2313",426 .name = "at90s2313",
426 .llvm_name = "at90s2313",427 .llvm_name = "at90s2313",
427 .features = featureSet(&[_]Feature{428 .features = featureSet(&[_]Feature{
428 .avr2,429 .avr2,
429 }),430 }),
430 };431 };
431 pub const at90s2323 = Cpu{432 pub const at90s2323 = CpuModel{
432 .name = "at90s2323",433 .name = "at90s2323",
433 .llvm_name = "at90s2323",434 .llvm_name = "at90s2323",
434 .features = featureSet(&[_]Feature{435 .features = featureSet(&[_]Feature{
435 .avr2,436 .avr2,
436 }),437 }),
437 };438 };
438 pub const at90s2333 = Cpu{439 pub const at90s2333 = CpuModel{
439 .name = "at90s2333",440 .name = "at90s2333",
440 .llvm_name = "at90s2333",441 .llvm_name = "at90s2333",
441 .features = featureSet(&[_]Feature{442 .features = featureSet(&[_]Feature{
442 .avr2,443 .avr2,
443 }),444 }),
444 };445 };
445 pub const at90s2343 = Cpu{446 pub const at90s2343 = CpuModel{
446 .name = "at90s2343",447 .name = "at90s2343",
447 .llvm_name = "at90s2343",448 .llvm_name = "at90s2343",
448 .features = featureSet(&[_]Feature{449 .features = featureSet(&[_]Feature{
449 .avr2,450 .avr2,
450 }),451 }),
451 };452 };
452 pub const at90s4414 = Cpu{453 pub const at90s4414 = CpuModel{
453 .name = "at90s4414",454 .name = "at90s4414",
454 .llvm_name = "at90s4414",455 .llvm_name = "at90s4414",
455 .features = featureSet(&[_]Feature{456 .features = featureSet(&[_]Feature{
456 .avr2,457 .avr2,
457 }),458 }),
458 };459 };
459 pub const at90s4433 = Cpu{460 pub const at90s4433 = CpuModel{
460 .name = "at90s4433",461 .name = "at90s4433",
461 .llvm_name = "at90s4433",462 .llvm_name = "at90s4433",
462 .features = featureSet(&[_]Feature{463 .features = featureSet(&[_]Feature{
463 .avr2,464 .avr2,
464 }),465 }),
465 };466 };
466 pub const at90s4434 = Cpu{467 pub const at90s4434 = CpuModel{
467 .name = "at90s4434",468 .name = "at90s4434",
468 .llvm_name = "at90s4434",469 .llvm_name = "at90s4434",
469 .features = featureSet(&[_]Feature{470 .features = featureSet(&[_]Feature{
470 .avr2,471 .avr2,
471 }),472 }),
472 };473 };
473 pub const at90s8515 = Cpu{474 pub const at90s8515 = CpuModel{
474 .name = "at90s8515",475 .name = "at90s8515",
475 .llvm_name = "at90s8515",476 .llvm_name = "at90s8515",
476 .features = featureSet(&[_]Feature{477 .features = featureSet(&[_]Feature{
477 .avr2,478 .avr2,
478 }),479 }),
479 };480 };
480 pub const at90s8535 = Cpu{481 pub const at90s8535 = CpuModel{
481 .name = "at90s8535",482 .name = "at90s8535",
482 .llvm_name = "at90s8535",483 .llvm_name = "at90s8535",
483 .features = featureSet(&[_]Feature{484 .features = featureSet(&[_]Feature{
484 .avr2,485 .avr2,
485 }),486 }),
486 };487 };
487 pub const at90scr100 = Cpu{488 pub const at90scr100 = CpuModel{
488 .name = "at90scr100",489 .name = "at90scr100",
489 .llvm_name = "at90scr100",490 .llvm_name = "at90scr100",
490 .features = featureSet(&[_]Feature{491 .features = featureSet(&[_]Feature{
491 .avr5,492 .avr5,
492 }),493 }),
493 };494 };
494 pub const at90usb1286 = Cpu{495 pub const at90usb1286 = CpuModel{
495 .name = "at90usb1286",496 .name = "at90usb1286",
496 .llvm_name = "at90usb1286",497 .llvm_name = "at90usb1286",
497 .features = featureSet(&[_]Feature{498 .features = featureSet(&[_]Feature{
498 .avr51,499 .avr51,
499 }),500 }),
500 };501 };
501 pub const at90usb1287 = Cpu{502 pub const at90usb1287 = CpuModel{
502 .name = "at90usb1287",503 .name = "at90usb1287",
503 .llvm_name = "at90usb1287",504 .llvm_name = "at90usb1287",
504 .features = featureSet(&[_]Feature{505 .features = featureSet(&[_]Feature{
505 .avr51,506 .avr51,
506 }),507 }),
507 };508 };
508 pub const at90usb162 = Cpu{509 pub const at90usb162 = CpuModel{
509 .name = "at90usb162",510 .name = "at90usb162",
510 .llvm_name = "at90usb162",511 .llvm_name = "at90usb162",
511 .features = featureSet(&[_]Feature{512 .features = featureSet(&[_]Feature{
512 .avr35,513 .avr35,
513 }),514 }),
514 };515 };
515 pub const at90usb646 = Cpu{516 pub const at90usb646 = CpuModel{
516 .name = "at90usb646",517 .name = "at90usb646",
517 .llvm_name = "at90usb646",518 .llvm_name = "at90usb646",
518 .features = featureSet(&[_]Feature{519 .features = featureSet(&[_]Feature{
519 .avr5,520 .avr5,
520 }),521 }),
521 };522 };
522 pub const at90usb647 = Cpu{523 pub const at90usb647 = CpuModel{
523 .name = "at90usb647",524 .name = "at90usb647",
524 .llvm_name = "at90usb647",525 .llvm_name = "at90usb647",
525 .features = featureSet(&[_]Feature{526 .features = featureSet(&[_]Feature{
526 .avr5,527 .avr5,
527 }),528 }),
528 };529 };
529 pub const at90usb82 = Cpu{530 pub const at90usb82 = CpuModel{
530 .name = "at90usb82",531 .name = "at90usb82",
531 .llvm_name = "at90usb82",532 .llvm_name = "at90usb82",
532 .features = featureSet(&[_]Feature{533 .features = featureSet(&[_]Feature{
533 .avr35,534 .avr35,
534 }),535 }),
535 };536 };
536 pub const at94k = Cpu{537 pub const at94k = CpuModel{
537 .name = "at94k",538 .name = "at94k",
538 .llvm_name = "at94k",539 .llvm_name = "at94k",
539 .features = featureSet(&[_]Feature{540 .features = featureSet(&[_]Feature{
...@@ -543,133 +544,133 @@ pub const cpu = struct {...@@ -543,133 +544,133 @@ pub const cpu = struct {
543 .mul,544 .mul,
544 }),545 }),
545 };546 };
546 pub const ata5272 = Cpu{547 pub const ata5272 = CpuModel{
547 .name = "ata5272",548 .name = "ata5272",
548 .llvm_name = "ata5272",549 .llvm_name = "ata5272",
549 .features = featureSet(&[_]Feature{550 .features = featureSet(&[_]Feature{
550 .avr25,551 .avr25,
551 }),552 }),
552 };553 };
553 pub const ata5505 = Cpu{554 pub const ata5505 = CpuModel{
554 .name = "ata5505",555 .name = "ata5505",
555 .llvm_name = "ata5505",556 .llvm_name = "ata5505",
556 .features = featureSet(&[_]Feature{557 .features = featureSet(&[_]Feature{
557 .avr35,558 .avr35,
558 }),559 }),
559 };560 };
560 pub const ata5790 = Cpu{561 pub const ata5790 = CpuModel{
561 .name = "ata5790",562 .name = "ata5790",
562 .llvm_name = "ata5790",563 .llvm_name = "ata5790",
563 .features = featureSet(&[_]Feature{564 .features = featureSet(&[_]Feature{
564 .avr5,565 .avr5,
565 }),566 }),
566 };567 };
567 pub const ata5795 = Cpu{568 pub const ata5795 = CpuModel{
568 .name = "ata5795",569 .name = "ata5795",
569 .llvm_name = "ata5795",570 .llvm_name = "ata5795",
570 .features = featureSet(&[_]Feature{571 .features = featureSet(&[_]Feature{
571 .avr5,572 .avr5,
572 }),573 }),
573 };574 };
574 pub const ata6285 = Cpu{575 pub const ata6285 = CpuModel{
575 .name = "ata6285",576 .name = "ata6285",
576 .llvm_name = "ata6285",577 .llvm_name = "ata6285",
577 .features = featureSet(&[_]Feature{578 .features = featureSet(&[_]Feature{
578 .avr4,579 .avr4,
579 }),580 }),
580 };581 };
581 pub const ata6286 = Cpu{582 pub const ata6286 = CpuModel{
582 .name = "ata6286",583 .name = "ata6286",
583 .llvm_name = "ata6286",584 .llvm_name = "ata6286",
584 .features = featureSet(&[_]Feature{585 .features = featureSet(&[_]Feature{
585 .avr4,586 .avr4,
586 }),587 }),
587 };588 };
588 pub const ata6289 = Cpu{589 pub const ata6289 = CpuModel{
589 .name = "ata6289",590 .name = "ata6289",
590 .llvm_name = "ata6289",591 .llvm_name = "ata6289",
591 .features = featureSet(&[_]Feature{592 .features = featureSet(&[_]Feature{
592 .avr4,593 .avr4,
593 }),594 }),
594 };595 };
595 pub const atmega103 = Cpu{596 pub const atmega103 = CpuModel{
596 .name = "atmega103",597 .name = "atmega103",
597 .llvm_name = "atmega103",598 .llvm_name = "atmega103",
598 .features = featureSet(&[_]Feature{599 .features = featureSet(&[_]Feature{
599 .avr31,600 .avr31,
600 }),601 }),
601 };602 };
602 pub const atmega128 = Cpu{603 pub const atmega128 = CpuModel{
603 .name = "atmega128",604 .name = "atmega128",
604 .llvm_name = "atmega128",605 .llvm_name = "atmega128",
605 .features = featureSet(&[_]Feature{606 .features = featureSet(&[_]Feature{
606 .avr51,607 .avr51,
607 }),608 }),
608 };609 };
609 pub const atmega1280 = Cpu{610 pub const atmega1280 = CpuModel{
610 .name = "atmega1280",611 .name = "atmega1280",
611 .llvm_name = "atmega1280",612 .llvm_name = "atmega1280",
612 .features = featureSet(&[_]Feature{613 .features = featureSet(&[_]Feature{
613 .avr51,614 .avr51,
614 }),615 }),
615 };616 };
616 pub const atmega1281 = Cpu{617 pub const atmega1281 = CpuModel{
617 .name = "atmega1281",618 .name = "atmega1281",
618 .llvm_name = "atmega1281",619 .llvm_name = "atmega1281",
619 .features = featureSet(&[_]Feature{620 .features = featureSet(&[_]Feature{
620 .avr51,621 .avr51,
621 }),622 }),
622 };623 };
623 pub const atmega1284 = Cpu{624 pub const atmega1284 = CpuModel{
624 .name = "atmega1284",625 .name = "atmega1284",
625 .llvm_name = "atmega1284",626 .llvm_name = "atmega1284",
626 .features = featureSet(&[_]Feature{627 .features = featureSet(&[_]Feature{
627 .avr51,628 .avr51,
628 }),629 }),
629 };630 };
630 pub const atmega1284p = Cpu{631 pub const atmega1284p = CpuModel{
631 .name = "atmega1284p",632 .name = "atmega1284p",
632 .llvm_name = "atmega1284p",633 .llvm_name = "atmega1284p",
633 .features = featureSet(&[_]Feature{634 .features = featureSet(&[_]Feature{
634 .avr51,635 .avr51,
635 }),636 }),
636 };637 };
637 pub const atmega1284rfr2 = Cpu{638 pub const atmega1284rfr2 = CpuModel{
638 .name = "atmega1284rfr2",639 .name = "atmega1284rfr2",
639 .llvm_name = "atmega1284rfr2",640 .llvm_name = "atmega1284rfr2",
640 .features = featureSet(&[_]Feature{641 .features = featureSet(&[_]Feature{
641 .avr51,642 .avr51,
642 }),643 }),
643 };644 };
644 pub const atmega128a = Cpu{645 pub const atmega128a = CpuModel{
645 .name = "atmega128a",646 .name = "atmega128a",
646 .llvm_name = "atmega128a",647 .llvm_name = "atmega128a",
647 .features = featureSet(&[_]Feature{648 .features = featureSet(&[_]Feature{
648 .avr51,649 .avr51,
649 }),650 }),
650 };651 };
651 pub const atmega128rfa1 = Cpu{652 pub const atmega128rfa1 = CpuModel{
652 .name = "atmega128rfa1",653 .name = "atmega128rfa1",
653 .llvm_name = "atmega128rfa1",654 .llvm_name = "atmega128rfa1",
654 .features = featureSet(&[_]Feature{655 .features = featureSet(&[_]Feature{
655 .avr51,656 .avr51,
656 }),657 }),
657 };658 };
658 pub const atmega128rfr2 = Cpu{659 pub const atmega128rfr2 = CpuModel{
659 .name = "atmega128rfr2",660 .name = "atmega128rfr2",
660 .llvm_name = "atmega128rfr2",661 .llvm_name = "atmega128rfr2",
661 .features = featureSet(&[_]Feature{662 .features = featureSet(&[_]Feature{
662 .avr51,663 .avr51,
663 }),664 }),
664 };665 };
665 pub const atmega16 = Cpu{666 pub const atmega16 = CpuModel{
666 .name = "atmega16",667 .name = "atmega16",
667 .llvm_name = "atmega16",668 .llvm_name = "atmega16",
668 .features = featureSet(&[_]Feature{669 .features = featureSet(&[_]Feature{
669 .avr5,670 .avr5,
670 }),671 }),
671 };672 };
672 pub const atmega161 = Cpu{673 pub const atmega161 = CpuModel{
673 .name = "atmega161",674 .name = "atmega161",
674 .llvm_name = "atmega161",675 .llvm_name = "atmega161",
675 .features = featureSet(&[_]Feature{676 .features = featureSet(&[_]Feature{
...@@ -680,14 +681,14 @@ pub const cpu = struct {...@@ -680,14 +681,14 @@ pub const cpu = struct {
680 .spm,681 .spm,
681 }),682 }),
682 };683 };
683 pub const atmega162 = Cpu{684 pub const atmega162 = CpuModel{
684 .name = "atmega162",685 .name = "atmega162",
685 .llvm_name = "atmega162",686 .llvm_name = "atmega162",
686 .features = featureSet(&[_]Feature{687 .features = featureSet(&[_]Feature{
687 .avr5,688 .avr5,
688 }),689 }),
689 };690 };
690 pub const atmega163 = Cpu{691 pub const atmega163 = CpuModel{
691 .name = "atmega163",692 .name = "atmega163",
692 .llvm_name = "atmega163",693 .llvm_name = "atmega163",
693 .features = featureSet(&[_]Feature{694 .features = featureSet(&[_]Feature{
...@@ -698,623 +699,623 @@ pub const cpu = struct {...@@ -698,623 +699,623 @@ pub const cpu = struct {
698 .spm,699 .spm,
699 }),700 }),
700 };701 };
701 pub const atmega164a = Cpu{702 pub const atmega164a = CpuModel{
702 .name = "atmega164a",703 .name = "atmega164a",
703 .llvm_name = "atmega164a",704 .llvm_name = "atmega164a",
704 .features = featureSet(&[_]Feature{705 .features = featureSet(&[_]Feature{
705 .avr5,706 .avr5,
706 }),707 }),
707 };708 };
708 pub const atmega164p = Cpu{709 pub const atmega164p = CpuModel{
709 .name = "atmega164p",710 .name = "atmega164p",
710 .llvm_name = "atmega164p",711 .llvm_name = "atmega164p",
711 .features = featureSet(&[_]Feature{712 .features = featureSet(&[_]Feature{
712 .avr5,713 .avr5,
713 }),714 }),
714 };715 };
715 pub const atmega164pa = Cpu{716 pub const atmega164pa = CpuModel{
716 .name = "atmega164pa",717 .name = "atmega164pa",
717 .llvm_name = "atmega164pa",718 .llvm_name = "atmega164pa",
718 .features = featureSet(&[_]Feature{719 .features = featureSet(&[_]Feature{
719 .avr5,720 .avr5,
720 }),721 }),
721 };722 };
722 pub const atmega165 = Cpu{723 pub const atmega165 = CpuModel{
723 .name = "atmega165",724 .name = "atmega165",
724 .llvm_name = "atmega165",725 .llvm_name = "atmega165",
725 .features = featureSet(&[_]Feature{726 .features = featureSet(&[_]Feature{
726 .avr5,727 .avr5,
727 }),728 }),
728 };729 };
729 pub const atmega165a = Cpu{730 pub const atmega165a = CpuModel{
730 .name = "atmega165a",731 .name = "atmega165a",
731 .llvm_name = "atmega165a",732 .llvm_name = "atmega165a",
732 .features = featureSet(&[_]Feature{733 .features = featureSet(&[_]Feature{
733 .avr5,734 .avr5,
734 }),735 }),
735 };736 };
736 pub const atmega165p = Cpu{737 pub const atmega165p = CpuModel{
737 .name = "atmega165p",738 .name = "atmega165p",
738 .llvm_name = "atmega165p",739 .llvm_name = "atmega165p",
739 .features = featureSet(&[_]Feature{740 .features = featureSet(&[_]Feature{
740 .avr5,741 .avr5,
741 }),742 }),
742 };743 };
743 pub const atmega165pa = Cpu{744 pub const atmega165pa = CpuModel{
744 .name = "atmega165pa",745 .name = "atmega165pa",
745 .llvm_name = "atmega165pa",746 .llvm_name = "atmega165pa",
746 .features = featureSet(&[_]Feature{747 .features = featureSet(&[_]Feature{
747 .avr5,748 .avr5,
748 }),749 }),
749 };750 };
750 pub const atmega168 = Cpu{751 pub const atmega168 = CpuModel{
751 .name = "atmega168",752 .name = "atmega168",
752 .llvm_name = "atmega168",753 .llvm_name = "atmega168",
753 .features = featureSet(&[_]Feature{754 .features = featureSet(&[_]Feature{
754 .avr5,755 .avr5,
755 }),756 }),
756 };757 };
757 pub const atmega168a = Cpu{758 pub const atmega168a = CpuModel{
758 .name = "atmega168a",759 .name = "atmega168a",
759 .llvm_name = "atmega168a",760 .llvm_name = "atmega168a",
760 .features = featureSet(&[_]Feature{761 .features = featureSet(&[_]Feature{
761 .avr5,762 .avr5,
762 }),763 }),
763 };764 };
764 pub const atmega168p = Cpu{765 pub const atmega168p = CpuModel{
765 .name = "atmega168p",766 .name = "atmega168p",
766 .llvm_name = "atmega168p",767 .llvm_name = "atmega168p",
767 .features = featureSet(&[_]Feature{768 .features = featureSet(&[_]Feature{
768 .avr5,769 .avr5,
769 }),770 }),
770 };771 };
771 pub const atmega168pa = Cpu{772 pub const atmega168pa = CpuModel{
772 .name = "atmega168pa",773 .name = "atmega168pa",
773 .llvm_name = "atmega168pa",774 .llvm_name = "atmega168pa",
774 .features = featureSet(&[_]Feature{775 .features = featureSet(&[_]Feature{
775 .avr5,776 .avr5,
776 }),777 }),
777 };778 };
778 pub const atmega169 = Cpu{779 pub const atmega169 = CpuModel{
779 .name = "atmega169",780 .name = "atmega169",
780 .llvm_name = "atmega169",781 .llvm_name = "atmega169",
781 .features = featureSet(&[_]Feature{782 .features = featureSet(&[_]Feature{
782 .avr5,783 .avr5,
783 }),784 }),
784 };785 };
785 pub const atmega169a = Cpu{786 pub const atmega169a = CpuModel{
786 .name = "atmega169a",787 .name = "atmega169a",
787 .llvm_name = "atmega169a",788 .llvm_name = "atmega169a",
788 .features = featureSet(&[_]Feature{789 .features = featureSet(&[_]Feature{
789 .avr5,790 .avr5,
790 }),791 }),
791 };792 };
792 pub const atmega169p = Cpu{793 pub const atmega169p = CpuModel{
793 .name = "atmega169p",794 .name = "atmega169p",
794 .llvm_name = "atmega169p",795 .llvm_name = "atmega169p",
795 .features = featureSet(&[_]Feature{796 .features = featureSet(&[_]Feature{
796 .avr5,797 .avr5,
797 }),798 }),
798 };799 };
799 pub const atmega169pa = Cpu{800 pub const atmega169pa = CpuModel{
800 .name = "atmega169pa",801 .name = "atmega169pa",
801 .llvm_name = "atmega169pa",802 .llvm_name = "atmega169pa",
802 .features = featureSet(&[_]Feature{803 .features = featureSet(&[_]Feature{
803 .avr5,804 .avr5,
804 }),805 }),
805 };806 };
806 pub const atmega16a = Cpu{807 pub const atmega16a = CpuModel{
807 .name = "atmega16a",808 .name = "atmega16a",
808 .llvm_name = "atmega16a",809 .llvm_name = "atmega16a",
809 .features = featureSet(&[_]Feature{810 .features = featureSet(&[_]Feature{
810 .avr5,811 .avr5,
811 }),812 }),
812 };813 };
813 pub const atmega16hva = Cpu{814 pub const atmega16hva = CpuModel{
814 .name = "atmega16hva",815 .name = "atmega16hva",
815 .llvm_name = "atmega16hva",816 .llvm_name = "atmega16hva",
816 .features = featureSet(&[_]Feature{817 .features = featureSet(&[_]Feature{
817 .avr5,818 .avr5,
818 }),819 }),
819 };820 };
820 pub const atmega16hva2 = Cpu{821 pub const atmega16hva2 = CpuModel{
821 .name = "atmega16hva2",822 .name = "atmega16hva2",
822 .llvm_name = "atmega16hva2",823 .llvm_name = "atmega16hva2",
823 .features = featureSet(&[_]Feature{824 .features = featureSet(&[_]Feature{
824 .avr5,825 .avr5,
825 }),826 }),
826 };827 };
827 pub const atmega16hvb = Cpu{828 pub const atmega16hvb = CpuModel{
828 .name = "atmega16hvb",829 .name = "atmega16hvb",
829 .llvm_name = "atmega16hvb",830 .llvm_name = "atmega16hvb",
830 .features = featureSet(&[_]Feature{831 .features = featureSet(&[_]Feature{
831 .avr5,832 .avr5,
832 }),833 }),
833 };834 };
834 pub const atmega16hvbrevb = Cpu{835 pub const atmega16hvbrevb = CpuModel{
835 .name = "atmega16hvbrevb",836 .name = "atmega16hvbrevb",
836 .llvm_name = "atmega16hvbrevb",837 .llvm_name = "atmega16hvbrevb",
837 .features = featureSet(&[_]Feature{838 .features = featureSet(&[_]Feature{
838 .avr5,839 .avr5,
839 }),840 }),
840 };841 };
841 pub const atmega16m1 = Cpu{842 pub const atmega16m1 = CpuModel{
842 .name = "atmega16m1",843 .name = "atmega16m1",
843 .llvm_name = "atmega16m1",844 .llvm_name = "atmega16m1",
844 .features = featureSet(&[_]Feature{845 .features = featureSet(&[_]Feature{
845 .avr5,846 .avr5,
846 }),847 }),
847 };848 };
848 pub const atmega16u2 = Cpu{849 pub const atmega16u2 = CpuModel{
849 .name = "atmega16u2",850 .name = "atmega16u2",
850 .llvm_name = "atmega16u2",851 .llvm_name = "atmega16u2",
851 .features = featureSet(&[_]Feature{852 .features = featureSet(&[_]Feature{
852 .avr35,853 .avr35,
853 }),854 }),
854 };855 };
855 pub const atmega16u4 = Cpu{856 pub const atmega16u4 = CpuModel{
856 .name = "atmega16u4",857 .name = "atmega16u4",
857 .llvm_name = "atmega16u4",858 .llvm_name = "atmega16u4",
858 .features = featureSet(&[_]Feature{859 .features = featureSet(&[_]Feature{
859 .avr5,860 .avr5,
860 }),861 }),
861 };862 };
862 pub const atmega2560 = Cpu{863 pub const atmega2560 = CpuModel{
863 .name = "atmega2560",864 .name = "atmega2560",
864 .llvm_name = "atmega2560",865 .llvm_name = "atmega2560",
865 .features = featureSet(&[_]Feature{866 .features = featureSet(&[_]Feature{
866 .avr6,867 .avr6,
867 }),868 }),
868 };869 };
869 pub const atmega2561 = Cpu{870 pub const atmega2561 = CpuModel{
870 .name = "atmega2561",871 .name = "atmega2561",
871 .llvm_name = "atmega2561",872 .llvm_name = "atmega2561",
872 .features = featureSet(&[_]Feature{873 .features = featureSet(&[_]Feature{
873 .avr6,874 .avr6,
874 }),875 }),
875 };876 };
876 pub const atmega2564rfr2 = Cpu{877 pub const atmega2564rfr2 = CpuModel{
877 .name = "atmega2564rfr2",878 .name = "atmega2564rfr2",
878 .llvm_name = "atmega2564rfr2",879 .llvm_name = "atmega2564rfr2",
879 .features = featureSet(&[_]Feature{880 .features = featureSet(&[_]Feature{
880 .avr6,881 .avr6,
881 }),882 }),
882 };883 };
883 pub const atmega256rfr2 = Cpu{884 pub const atmega256rfr2 = CpuModel{
884 .name = "atmega256rfr2",885 .name = "atmega256rfr2",
885 .llvm_name = "atmega256rfr2",886 .llvm_name = "atmega256rfr2",
886 .features = featureSet(&[_]Feature{887 .features = featureSet(&[_]Feature{
887 .avr6,888 .avr6,
888 }),889 }),
889 };890 };
890 pub const atmega32 = Cpu{891 pub const atmega32 = CpuModel{
891 .name = "atmega32",892 .name = "atmega32",
892 .llvm_name = "atmega32",893 .llvm_name = "atmega32",
893 .features = featureSet(&[_]Feature{894 .features = featureSet(&[_]Feature{
894 .avr5,895 .avr5,
895 }),896 }),
896 };897 };
897 pub const atmega323 = Cpu{898 pub const atmega323 = CpuModel{
898 .name = "atmega323",899 .name = "atmega323",
899 .llvm_name = "atmega323",900 .llvm_name = "atmega323",
900 .features = featureSet(&[_]Feature{901 .features = featureSet(&[_]Feature{
901 .avr5,902 .avr5,
902 }),903 }),
903 };904 };
904 pub const atmega324a = Cpu{905 pub const atmega324a = CpuModel{
905 .name = "atmega324a",906 .name = "atmega324a",
906 .llvm_name = "atmega324a",907 .llvm_name = "atmega324a",
907 .features = featureSet(&[_]Feature{908 .features = featureSet(&[_]Feature{
908 .avr5,909 .avr5,
909 }),910 }),
910 };911 };
911 pub const atmega324p = Cpu{912 pub const atmega324p = CpuModel{
912 .name = "atmega324p",913 .name = "atmega324p",
913 .llvm_name = "atmega324p",914 .llvm_name = "atmega324p",
914 .features = featureSet(&[_]Feature{915 .features = featureSet(&[_]Feature{
915 .avr5,916 .avr5,
916 }),917 }),
917 };918 };
918 pub const atmega324pa = Cpu{919 pub const atmega324pa = CpuModel{
919 .name = "atmega324pa",920 .name = "atmega324pa",
920 .llvm_name = "atmega324pa",921 .llvm_name = "atmega324pa",
921 .features = featureSet(&[_]Feature{922 .features = featureSet(&[_]Feature{
922 .avr5,923 .avr5,
923 }),924 }),
924 };925 };
925 pub const atmega325 = Cpu{926 pub const atmega325 = CpuModel{
926 .name = "atmega325",927 .name = "atmega325",
927 .llvm_name = "atmega325",928 .llvm_name = "atmega325",
928 .features = featureSet(&[_]Feature{929 .features = featureSet(&[_]Feature{
929 .avr5,930 .avr5,
930 }),931 }),
931 };932 };
932 pub const atmega3250 = Cpu{933 pub const atmega3250 = CpuModel{
933 .name = "atmega3250",934 .name = "atmega3250",
934 .llvm_name = "atmega3250",935 .llvm_name = "atmega3250",
935 .features = featureSet(&[_]Feature{936 .features = featureSet(&[_]Feature{
936 .avr5,937 .avr5,
937 }),938 }),
938 };939 };
939 pub const atmega3250a = Cpu{940 pub const atmega3250a = CpuModel{
940 .name = "atmega3250a",941 .name = "atmega3250a",
941 .llvm_name = "atmega3250a",942 .llvm_name = "atmega3250a",
942 .features = featureSet(&[_]Feature{943 .features = featureSet(&[_]Feature{
943 .avr5,944 .avr5,
944 }),945 }),
945 };946 };
946 pub const atmega3250p = Cpu{947 pub const atmega3250p = CpuModel{
947 .name = "atmega3250p",948 .name = "atmega3250p",
948 .llvm_name = "atmega3250p",949 .llvm_name = "atmega3250p",
949 .features = featureSet(&[_]Feature{950 .features = featureSet(&[_]Feature{
950 .avr5,951 .avr5,
951 }),952 }),
952 };953 };
953 pub const atmega3250pa = Cpu{954 pub const atmega3250pa = CpuModel{
954 .name = "atmega3250pa",955 .name = "atmega3250pa",
955 .llvm_name = "atmega3250pa",956 .llvm_name = "atmega3250pa",
956 .features = featureSet(&[_]Feature{957 .features = featureSet(&[_]Feature{
957 .avr5,958 .avr5,
958 }),959 }),
959 };960 };
960 pub const atmega325a = Cpu{961 pub const atmega325a = CpuModel{
961 .name = "atmega325a",962 .name = "atmega325a",
962 .llvm_name = "atmega325a",963 .llvm_name = "atmega325a",
963 .features = featureSet(&[_]Feature{964 .features = featureSet(&[_]Feature{
964 .avr5,965 .avr5,
965 }),966 }),
966 };967 };
967 pub const atmega325p = Cpu{968 pub const atmega325p = CpuModel{
968 .name = "atmega325p",969 .name = "atmega325p",
969 .llvm_name = "atmega325p",970 .llvm_name = "atmega325p",
970 .features = featureSet(&[_]Feature{971 .features = featureSet(&[_]Feature{
971 .avr5,972 .avr5,
972 }),973 }),
973 };974 };
974 pub const atmega325pa = Cpu{975 pub const atmega325pa = CpuModel{
975 .name = "atmega325pa",976 .name = "atmega325pa",
976 .llvm_name = "atmega325pa",977 .llvm_name = "atmega325pa",
977 .features = featureSet(&[_]Feature{978 .features = featureSet(&[_]Feature{
978 .avr5,979 .avr5,
979 }),980 }),
980 };981 };
981 pub const atmega328 = Cpu{982 pub const atmega328 = CpuModel{
982 .name = "atmega328",983 .name = "atmega328",
983 .llvm_name = "atmega328",984 .llvm_name = "atmega328",
984 .features = featureSet(&[_]Feature{985 .features = featureSet(&[_]Feature{
985 .avr5,986 .avr5,
986 }),987 }),
987 };988 };
988 pub const atmega328p = Cpu{989 pub const atmega328p = CpuModel{
989 .name = "atmega328p",990 .name = "atmega328p",
990 .llvm_name = "atmega328p",991 .llvm_name = "atmega328p",
991 .features = featureSet(&[_]Feature{992 .features = featureSet(&[_]Feature{
992 .avr5,993 .avr5,
993 }),994 }),
994 };995 };
995 pub const atmega329 = Cpu{996 pub const atmega329 = CpuModel{
996 .name = "atmega329",997 .name = "atmega329",
997 .llvm_name = "atmega329",998 .llvm_name = "atmega329",
998 .features = featureSet(&[_]Feature{999 .features = featureSet(&[_]Feature{
999 .avr5,1000 .avr5,
1000 }),1001 }),
1001 };1002 };
1002 pub const atmega3290 = Cpu{1003 pub const atmega3290 = CpuModel{
1003 .name = "atmega3290",1004 .name = "atmega3290",
1004 .llvm_name = "atmega3290",1005 .llvm_name = "atmega3290",
1005 .features = featureSet(&[_]Feature{1006 .features = featureSet(&[_]Feature{
1006 .avr5,1007 .avr5,
1007 }),1008 }),
1008 };1009 };
1009 pub const atmega3290a = Cpu{1010 pub const atmega3290a = CpuModel{
1010 .name = "atmega3290a",1011 .name = "atmega3290a",
1011 .llvm_name = "atmega3290a",1012 .llvm_name = "atmega3290a",
1012 .features = featureSet(&[_]Feature{1013 .features = featureSet(&[_]Feature{
1013 .avr5,1014 .avr5,
1014 }),1015 }),
1015 };1016 };
1016 pub const atmega3290p = Cpu{1017 pub const atmega3290p = CpuModel{
1017 .name = "atmega3290p",1018 .name = "atmega3290p",
1018 .llvm_name = "atmega3290p",1019 .llvm_name = "atmega3290p",
1019 .features = featureSet(&[_]Feature{1020 .features = featureSet(&[_]Feature{
1020 .avr5,1021 .avr5,
1021 }),1022 }),
1022 };1023 };
1023 pub const atmega3290pa = Cpu{1024 pub const atmega3290pa = CpuModel{
1024 .name = "atmega3290pa",1025 .name = "atmega3290pa",
1025 .llvm_name = "atmega3290pa",1026 .llvm_name = "atmega3290pa",
1026 .features = featureSet(&[_]Feature{1027 .features = featureSet(&[_]Feature{
1027 .avr5,1028 .avr5,
1028 }),1029 }),
1029 };1030 };
1030 pub const atmega329a = Cpu{1031 pub const atmega329a = CpuModel{
1031 .name = "atmega329a",1032 .name = "atmega329a",
1032 .llvm_name = "atmega329a",1033 .llvm_name = "atmega329a",
1033 .features = featureSet(&[_]Feature{1034 .features = featureSet(&[_]Feature{
1034 .avr5,1035 .avr5,
1035 }),1036 }),
1036 };1037 };
1037 pub const atmega329p = Cpu{1038 pub const atmega329p = CpuModel{
1038 .name = "atmega329p",1039 .name = "atmega329p",
1039 .llvm_name = "atmega329p",1040 .llvm_name = "atmega329p",
1040 .features = featureSet(&[_]Feature{1041 .features = featureSet(&[_]Feature{
1041 .avr5,1042 .avr5,
1042 }),1043 }),
1043 };1044 };
1044 pub const atmega329pa = Cpu{1045 pub const atmega329pa = CpuModel{
1045 .name = "atmega329pa",1046 .name = "atmega329pa",
1046 .llvm_name = "atmega329pa",1047 .llvm_name = "atmega329pa",
1047 .features = featureSet(&[_]Feature{1048 .features = featureSet(&[_]Feature{
1048 .avr5,1049 .avr5,
1049 }),1050 }),
1050 };1051 };
1051 pub const atmega32a = Cpu{1052 pub const atmega32a = CpuModel{
1052 .name = "atmega32a",1053 .name = "atmega32a",
1053 .llvm_name = "atmega32a",1054 .llvm_name = "atmega32a",
1054 .features = featureSet(&[_]Feature{1055 .features = featureSet(&[_]Feature{
1055 .avr5,1056 .avr5,
1056 }),1057 }),
1057 };1058 };
1058 pub const atmega32c1 = Cpu{1059 pub const atmega32c1 = CpuModel{
1059 .name = "atmega32c1",1060 .name = "atmega32c1",
1060 .llvm_name = "atmega32c1",1061 .llvm_name = "atmega32c1",
1061 .features = featureSet(&[_]Feature{1062 .features = featureSet(&[_]Feature{
1062 .avr5,1063 .avr5,
1063 }),1064 }),
1064 };1065 };
1065 pub const atmega32hvb = Cpu{1066 pub const atmega32hvb = CpuModel{
1066 .name = "atmega32hvb",1067 .name = "atmega32hvb",
1067 .llvm_name = "atmega32hvb",1068 .llvm_name = "atmega32hvb",
1068 .features = featureSet(&[_]Feature{1069 .features = featureSet(&[_]Feature{
1069 .avr5,1070 .avr5,
1070 }),1071 }),
1071 };1072 };
1072 pub const atmega32hvbrevb = Cpu{1073 pub const atmega32hvbrevb = CpuModel{
1073 .name = "atmega32hvbrevb",1074 .name = "atmega32hvbrevb",
1074 .llvm_name = "atmega32hvbrevb",1075 .llvm_name = "atmega32hvbrevb",
1075 .features = featureSet(&[_]Feature{1076 .features = featureSet(&[_]Feature{
1076 .avr5,1077 .avr5,
1077 }),1078 }),
1078 };1079 };
1079 pub const atmega32m1 = Cpu{1080 pub const atmega32m1 = CpuModel{
1080 .name = "atmega32m1",1081 .name = "atmega32m1",
1081 .llvm_name = "atmega32m1",1082 .llvm_name = "atmega32m1",
1082 .features = featureSet(&[_]Feature{1083 .features = featureSet(&[_]Feature{
1083 .avr5,1084 .avr5,
1084 }),1085 }),
1085 };1086 };
1086 pub const atmega32u2 = Cpu{1087 pub const atmega32u2 = CpuModel{
1087 .name = "atmega32u2",1088 .name = "atmega32u2",
1088 .llvm_name = "atmega32u2",1089 .llvm_name = "atmega32u2",
1089 .features = featureSet(&[_]Feature{1090 .features = featureSet(&[_]Feature{
1090 .avr35,1091 .avr35,
1091 }),1092 }),
1092 };1093 };
1093 pub const atmega32u4 = Cpu{1094 pub const atmega32u4 = CpuModel{
1094 .name = "atmega32u4",1095 .name = "atmega32u4",
1095 .llvm_name = "atmega32u4",1096 .llvm_name = "atmega32u4",
1096 .features = featureSet(&[_]Feature{1097 .features = featureSet(&[_]Feature{
1097 .avr5,1098 .avr5,
1098 }),1099 }),
1099 };1100 };
1100 pub const atmega32u6 = Cpu{1101 pub const atmega32u6 = CpuModel{
1101 .name = "atmega32u6",1102 .name = "atmega32u6",
1102 .llvm_name = "atmega32u6",1103 .llvm_name = "atmega32u6",
1103 .features = featureSet(&[_]Feature{1104 .features = featureSet(&[_]Feature{
1104 .avr5,1105 .avr5,
1105 }),1106 }),
1106 };1107 };
1107 pub const atmega406 = Cpu{1108 pub const atmega406 = CpuModel{
1108 .name = "atmega406",1109 .name = "atmega406",
1109 .llvm_name = "atmega406",1110 .llvm_name = "atmega406",
1110 .features = featureSet(&[_]Feature{1111 .features = featureSet(&[_]Feature{
1111 .avr5,1112 .avr5,
1112 }),1113 }),
1113 };1114 };
1114 pub const atmega48 = Cpu{1115 pub const atmega48 = CpuModel{
1115 .name = "atmega48",1116 .name = "atmega48",
1116 .llvm_name = "atmega48",1117 .llvm_name = "atmega48",
1117 .features = featureSet(&[_]Feature{1118 .features = featureSet(&[_]Feature{
1118 .avr4,1119 .avr4,
1119 }),1120 }),
1120 };1121 };
1121 pub const atmega48a = Cpu{1122 pub const atmega48a = CpuModel{
1122 .name = "atmega48a",1123 .name = "atmega48a",
1123 .llvm_name = "atmega48a",1124 .llvm_name = "atmega48a",
1124 .features = featureSet(&[_]Feature{1125 .features = featureSet(&[_]Feature{
1125 .avr4,1126 .avr4,
1126 }),1127 }),
1127 };1128 };
1128 pub const atmega48p = Cpu{1129 pub const atmega48p = CpuModel{
1129 .name = "atmega48p",1130 .name = "atmega48p",
1130 .llvm_name = "atmega48p",1131 .llvm_name = "atmega48p",
1131 .features = featureSet(&[_]Feature{1132 .features = featureSet(&[_]Feature{
1132 .avr4,1133 .avr4,
1133 }),1134 }),
1134 };1135 };
1135 pub const atmega48pa = Cpu{1136 pub const atmega48pa = CpuModel{
1136 .name = "atmega48pa",1137 .name = "atmega48pa",
1137 .llvm_name = "atmega48pa",1138 .llvm_name = "atmega48pa",
1138 .features = featureSet(&[_]Feature{1139 .features = featureSet(&[_]Feature{
1139 .avr4,1140 .avr4,
1140 }),1141 }),
1141 };1142 };
1142 pub const atmega64 = Cpu{1143 pub const atmega64 = CpuModel{
1143 .name = "atmega64",1144 .name = "atmega64",
1144 .llvm_name = "atmega64",1145 .llvm_name = "atmega64",
1145 .features = featureSet(&[_]Feature{1146 .features = featureSet(&[_]Feature{
1146 .avr5,1147 .avr5,
1147 }),1148 }),
1148 };1149 };
1149 pub const atmega640 = Cpu{1150 pub const atmega640 = CpuModel{
1150 .name = "atmega640",1151 .name = "atmega640",
1151 .llvm_name = "atmega640",1152 .llvm_name = "atmega640",
1152 .features = featureSet(&[_]Feature{1153 .features = featureSet(&[_]Feature{
1153 .avr5,1154 .avr5,
1154 }),1155 }),
1155 };1156 };
1156 pub const atmega644 = Cpu{1157 pub const atmega644 = CpuModel{
1157 .name = "atmega644",1158 .name = "atmega644",
1158 .llvm_name = "atmega644",1159 .llvm_name = "atmega644",
1159 .features = featureSet(&[_]Feature{1160 .features = featureSet(&[_]Feature{
1160 .avr5,1161 .avr5,
1161 }),1162 }),
1162 };1163 };
1163 pub const atmega644a = Cpu{1164 pub const atmega644a = CpuModel{
1164 .name = "atmega644a",1165 .name = "atmega644a",
1165 .llvm_name = "atmega644a",1166 .llvm_name = "atmega644a",
1166 .features = featureSet(&[_]Feature{1167 .features = featureSet(&[_]Feature{
1167 .avr5,1168 .avr5,
1168 }),1169 }),
1169 };1170 };
1170 pub const atmega644p = Cpu{1171 pub const atmega644p = CpuModel{
1171 .name = "atmega644p",1172 .name = "atmega644p",
1172 .llvm_name = "atmega644p",1173 .llvm_name = "atmega644p",
1173 .features = featureSet(&[_]Feature{1174 .features = featureSet(&[_]Feature{
1174 .avr5,1175 .avr5,
1175 }),1176 }),
1176 };1177 };
1177 pub const atmega644pa = Cpu{1178 pub const atmega644pa = CpuModel{
1178 .name = "atmega644pa",1179 .name = "atmega644pa",
1179 .llvm_name = "atmega644pa",1180 .llvm_name = "atmega644pa",
1180 .features = featureSet(&[_]Feature{1181 .features = featureSet(&[_]Feature{
1181 .avr5,1182 .avr5,
1182 }),1183 }),
1183 };1184 };
1184 pub const atmega644rfr2 = Cpu{1185 pub const atmega644rfr2 = CpuModel{
1185 .name = "atmega644rfr2",1186 .name = "atmega644rfr2",
1186 .llvm_name = "atmega644rfr2",1187 .llvm_name = "atmega644rfr2",
1187 .features = featureSet(&[_]Feature{1188 .features = featureSet(&[_]Feature{
1188 .avr5,1189 .avr5,
1189 }),1190 }),
1190 };1191 };
1191 pub const atmega645 = Cpu{1192 pub const atmega645 = CpuModel{
1192 .name = "atmega645",1193 .name = "atmega645",
1193 .llvm_name = "atmega645",1194 .llvm_name = "atmega645",
1194 .features = featureSet(&[_]Feature{1195 .features = featureSet(&[_]Feature{
1195 .avr5,1196 .avr5,
1196 }),1197 }),
1197 };1198 };
1198 pub const atmega6450 = Cpu{1199 pub const atmega6450 = CpuModel{
1199 .name = "atmega6450",1200 .name = "atmega6450",
1200 .llvm_name = "atmega6450",1201 .llvm_name = "atmega6450",
1201 .features = featureSet(&[_]Feature{1202 .features = featureSet(&[_]Feature{
1202 .avr5,1203 .avr5,
1203 }),1204 }),
1204 };1205 };
1205 pub const atmega6450a = Cpu{1206 pub const atmega6450a = CpuModel{
1206 .name = "atmega6450a",1207 .name = "atmega6450a",
1207 .llvm_name = "atmega6450a",1208 .llvm_name = "atmega6450a",
1208 .features = featureSet(&[_]Feature{1209 .features = featureSet(&[_]Feature{
1209 .avr5,1210 .avr5,
1210 }),1211 }),
1211 };1212 };
1212 pub const atmega6450p = Cpu{1213 pub const atmega6450p = CpuModel{
1213 .name = "atmega6450p",1214 .name = "atmega6450p",
1214 .llvm_name = "atmega6450p",1215 .llvm_name = "atmega6450p",
1215 .features = featureSet(&[_]Feature{1216 .features = featureSet(&[_]Feature{
1216 .avr5,1217 .avr5,
1217 }),1218 }),
1218 };1219 };
1219 pub const atmega645a = Cpu{1220 pub const atmega645a = CpuModel{
1220 .name = "atmega645a",1221 .name = "atmega645a",
1221 .llvm_name = "atmega645a",1222 .llvm_name = "atmega645a",
1222 .features = featureSet(&[_]Feature{1223 .features = featureSet(&[_]Feature{
1223 .avr5,1224 .avr5,
1224 }),1225 }),
1225 };1226 };
1226 pub const atmega645p = Cpu{1227 pub const atmega645p = CpuModel{
1227 .name = "atmega645p",1228 .name = "atmega645p",
1228 .llvm_name = "atmega645p",1229 .llvm_name = "atmega645p",
1229 .features = featureSet(&[_]Feature{1230 .features = featureSet(&[_]Feature{
1230 .avr5,1231 .avr5,
1231 }),1232 }),
1232 };1233 };
1233 pub const atmega649 = Cpu{1234 pub const atmega649 = CpuModel{
1234 .name = "atmega649",1235 .name = "atmega649",
1235 .llvm_name = "atmega649",1236 .llvm_name = "atmega649",
1236 .features = featureSet(&[_]Feature{1237 .features = featureSet(&[_]Feature{
1237 .avr5,1238 .avr5,
1238 }),1239 }),
1239 };1240 };
1240 pub const atmega6490 = Cpu{1241 pub const atmega6490 = CpuModel{
1241 .name = "atmega6490",1242 .name = "atmega6490",
1242 .llvm_name = "atmega6490",1243 .llvm_name = "atmega6490",
1243 .features = featureSet(&[_]Feature{1244 .features = featureSet(&[_]Feature{
1244 .avr5,1245 .avr5,
1245 }),1246 }),
1246 };1247 };
1247 pub const atmega6490a = Cpu{1248 pub const atmega6490a = CpuModel{
1248 .name = "atmega6490a",1249 .name = "atmega6490a",
1249 .llvm_name = "atmega6490a",1250 .llvm_name = "atmega6490a",
1250 .features = featureSet(&[_]Feature{1251 .features = featureSet(&[_]Feature{
1251 .avr5,1252 .avr5,
1252 }),1253 }),
1253 };1254 };
1254 pub const atmega6490p = Cpu{1255 pub const atmega6490p = CpuModel{
1255 .name = "atmega6490p",1256 .name = "atmega6490p",
1256 .llvm_name = "atmega6490p",1257 .llvm_name = "atmega6490p",
1257 .features = featureSet(&[_]Feature{1258 .features = featureSet(&[_]Feature{
1258 .avr5,1259 .avr5,
1259 }),1260 }),
1260 };1261 };
1261 pub const atmega649a = Cpu{1262 pub const atmega649a = CpuModel{
1262 .name = "atmega649a",1263 .name = "atmega649a",
1263 .llvm_name = "atmega649a",1264 .llvm_name = "atmega649a",
1264 .features = featureSet(&[_]Feature{1265 .features = featureSet(&[_]Feature{
1265 .avr5,1266 .avr5,
1266 }),1267 }),
1267 };1268 };
1268 pub const atmega649p = Cpu{1269 pub const atmega649p = CpuModel{
1269 .name = "atmega649p",1270 .name = "atmega649p",
1270 .llvm_name = "atmega649p",1271 .llvm_name = "atmega649p",
1271 .features = featureSet(&[_]Feature{1272 .features = featureSet(&[_]Feature{
1272 .avr5,1273 .avr5,
1273 }),1274 }),
1274 };1275 };
1275 pub const atmega64a = Cpu{1276 pub const atmega64a = CpuModel{
1276 .name = "atmega64a",1277 .name = "atmega64a",
1277 .llvm_name = "atmega64a",1278 .llvm_name = "atmega64a",
1278 .features = featureSet(&[_]Feature{1279 .features = featureSet(&[_]Feature{
1279 .avr5,1280 .avr5,
1280 }),1281 }),
1281 };1282 };
1282 pub const atmega64c1 = Cpu{1283 pub const atmega64c1 = CpuModel{
1283 .name = "atmega64c1",1284 .name = "atmega64c1",
1284 .llvm_name = "atmega64c1",1285 .llvm_name = "atmega64c1",
1285 .features = featureSet(&[_]Feature{1286 .features = featureSet(&[_]Feature{
1286 .avr5,1287 .avr5,
1287 }),1288 }),
1288 };1289 };
1289 pub const atmega64hve = Cpu{1290 pub const atmega64hve = CpuModel{
1290 .name = "atmega64hve",1291 .name = "atmega64hve",
1291 .llvm_name = "atmega64hve",1292 .llvm_name = "atmega64hve",
1292 .features = featureSet(&[_]Feature{1293 .features = featureSet(&[_]Feature{
1293 .avr5,1294 .avr5,
1294 }),1295 }),
1295 };1296 };
1296 pub const atmega64m1 = Cpu{1297 pub const atmega64m1 = CpuModel{
1297 .name = "atmega64m1",1298 .name = "atmega64m1",
1298 .llvm_name = "atmega64m1",1299 .llvm_name = "atmega64m1",
1299 .features = featureSet(&[_]Feature{1300 .features = featureSet(&[_]Feature{
1300 .avr5,1301 .avr5,
1301 }),1302 }),
1302 };1303 };
1303 pub const atmega64rfr2 = Cpu{1304 pub const atmega64rfr2 = CpuModel{
1304 .name = "atmega64rfr2",1305 .name = "atmega64rfr2",
1305 .llvm_name = "atmega64rfr2",1306 .llvm_name = "atmega64rfr2",
1306 .features = featureSet(&[_]Feature{1307 .features = featureSet(&[_]Feature{
1307 .avr5,1308 .avr5,
1308 }),1309 }),
1309 };1310 };
1310 pub const atmega8 = Cpu{1311 pub const atmega8 = CpuModel{
1311 .name = "atmega8",1312 .name = "atmega8",
1312 .llvm_name = "atmega8",1313 .llvm_name = "atmega8",
1313 .features = featureSet(&[_]Feature{1314 .features = featureSet(&[_]Feature{
1314 .avr4,1315 .avr4,
1315 }),1316 }),
1316 };1317 };
1317 pub const atmega8515 = Cpu{1318 pub const atmega8515 = CpuModel{
1318 .name = "atmega8515",1319 .name = "atmega8515",
1319 .llvm_name = "atmega8515",1320 .llvm_name = "atmega8515",
1320 .features = featureSet(&[_]Feature{1321 .features = featureSet(&[_]Feature{
...@@ -1325,7 +1326,7 @@ pub const cpu = struct {...@@ -1325,7 +1326,7 @@ pub const cpu = struct {
1325 .spm,1326 .spm,
1326 }),1327 }),
1327 };1328 };
1328 pub const atmega8535 = Cpu{1329 pub const atmega8535 = CpuModel{
1329 .name = "atmega8535",1330 .name = "atmega8535",
1330 .llvm_name = "atmega8535",1331 .llvm_name = "atmega8535",
1331 .features = featureSet(&[_]Feature{1332 .features = featureSet(&[_]Feature{
...@@ -1336,175 +1337,175 @@ pub const cpu = struct {...@@ -1336,175 +1337,175 @@ pub const cpu = struct {
1336 .spm,1337 .spm,
1337 }),1338 }),
1338 };1339 };
1339 pub const atmega88 = Cpu{1340 pub const atmega88 = CpuModel{
1340 .name = "atmega88",1341 .name = "atmega88",
1341 .llvm_name = "atmega88",1342 .llvm_name = "atmega88",
1342 .features = featureSet(&[_]Feature{1343 .features = featureSet(&[_]Feature{
1343 .avr4,1344 .avr4,
1344 }),1345 }),
1345 };1346 };
1346 pub const atmega88a = Cpu{1347 pub const atmega88a = CpuModel{
1347 .name = "atmega88a",1348 .name = "atmega88a",
1348 .llvm_name = "atmega88a",1349 .llvm_name = "atmega88a",
1349 .features = featureSet(&[_]Feature{1350 .features = featureSet(&[_]Feature{
1350 .avr4,1351 .avr4,
1351 }),1352 }),
1352 };1353 };
1353 pub const atmega88p = Cpu{1354 pub const atmega88p = CpuModel{
1354 .name = "atmega88p",1355 .name = "atmega88p",
1355 .llvm_name = "atmega88p",1356 .llvm_name = "atmega88p",
1356 .features = featureSet(&[_]Feature{1357 .features = featureSet(&[_]Feature{
1357 .avr4,1358 .avr4,
1358 }),1359 }),
1359 };1360 };
1360 pub const atmega88pa = Cpu{1361 pub const atmega88pa = CpuModel{
1361 .name = "atmega88pa",1362 .name = "atmega88pa",
1362 .llvm_name = "atmega88pa",1363 .llvm_name = "atmega88pa",
1363 .features = featureSet(&[_]Feature{1364 .features = featureSet(&[_]Feature{
1364 .avr4,1365 .avr4,
1365 }),1366 }),
1366 };1367 };
1367 pub const atmega8a = Cpu{1368 pub const atmega8a = CpuModel{
1368 .name = "atmega8a",1369 .name = "atmega8a",
1369 .llvm_name = "atmega8a",1370 .llvm_name = "atmega8a",
1370 .features = featureSet(&[_]Feature{1371 .features = featureSet(&[_]Feature{
1371 .avr4,1372 .avr4,
1372 }),1373 }),
1373 };1374 };
1374 pub const atmega8hva = Cpu{1375 pub const atmega8hva = CpuModel{
1375 .name = "atmega8hva",1376 .name = "atmega8hva",
1376 .llvm_name = "atmega8hva",1377 .llvm_name = "atmega8hva",
1377 .features = featureSet(&[_]Feature{1378 .features = featureSet(&[_]Feature{
1378 .avr4,1379 .avr4,
1379 }),1380 }),
1380 };1381 };
1381 pub const atmega8u2 = Cpu{1382 pub const atmega8u2 = CpuModel{
1382 .name = "atmega8u2",1383 .name = "atmega8u2",
1383 .llvm_name = "atmega8u2",1384 .llvm_name = "atmega8u2",
1384 .features = featureSet(&[_]Feature{1385 .features = featureSet(&[_]Feature{
1385 .avr35,1386 .avr35,
1386 }),1387 }),
1387 };1388 };
1388 pub const attiny10 = Cpu{1389 pub const attiny10 = CpuModel{
1389 .name = "attiny10",1390 .name = "attiny10",
1390 .llvm_name = "attiny10",1391 .llvm_name = "attiny10",
1391 .features = featureSet(&[_]Feature{1392 .features = featureSet(&[_]Feature{
1392 .avrtiny,1393 .avrtiny,
1393 }),1394 }),
1394 };1395 };
1395 pub const attiny102 = Cpu{1396 pub const attiny102 = CpuModel{
1396 .name = "attiny102",1397 .name = "attiny102",
1397 .llvm_name = "attiny102",1398 .llvm_name = "attiny102",
1398 .features = featureSet(&[_]Feature{1399 .features = featureSet(&[_]Feature{
1399 .avrtiny,1400 .avrtiny,
1400 }),1401 }),
1401 };1402 };
1402 pub const attiny104 = Cpu{1403 pub const attiny104 = CpuModel{
1403 .name = "attiny104",1404 .name = "attiny104",
1404 .llvm_name = "attiny104",1405 .llvm_name = "attiny104",
1405 .features = featureSet(&[_]Feature{1406 .features = featureSet(&[_]Feature{
1406 .avrtiny,1407 .avrtiny,
1407 }),1408 }),
1408 };1409 };
1409 pub const attiny11 = Cpu{1410 pub const attiny11 = CpuModel{
1410 .name = "attiny11",1411 .name = "attiny11",
1411 .llvm_name = "attiny11",1412 .llvm_name = "attiny11",
1412 .features = featureSet(&[_]Feature{1413 .features = featureSet(&[_]Feature{
1413 .avr1,1414 .avr1,
1414 }),1415 }),
1415 };1416 };
1416 pub const attiny12 = Cpu{1417 pub const attiny12 = CpuModel{
1417 .name = "attiny12",1418 .name = "attiny12",
1418 .llvm_name = "attiny12",1419 .llvm_name = "attiny12",
1419 .features = featureSet(&[_]Feature{1420 .features = featureSet(&[_]Feature{
1420 .avr1,1421 .avr1,
1421 }),1422 }),
1422 };1423 };
1423 pub const attiny13 = Cpu{1424 pub const attiny13 = CpuModel{
1424 .name = "attiny13",1425 .name = "attiny13",
1425 .llvm_name = "attiny13",1426 .llvm_name = "attiny13",
1426 .features = featureSet(&[_]Feature{1427 .features = featureSet(&[_]Feature{
1427 .avr25,1428 .avr25,
1428 }),1429 }),
1429 };1430 };
1430 pub const attiny13a = Cpu{1431 pub const attiny13a = CpuModel{
1431 .name = "attiny13a",1432 .name = "attiny13a",
1432 .llvm_name = "attiny13a",1433 .llvm_name = "attiny13a",
1433 .features = featureSet(&[_]Feature{1434 .features = featureSet(&[_]Feature{
1434 .avr25,1435 .avr25,
1435 }),1436 }),
1436 };1437 };
1437 pub const attiny15 = Cpu{1438 pub const attiny15 = CpuModel{
1438 .name = "attiny15",1439 .name = "attiny15",
1439 .llvm_name = "attiny15",1440 .llvm_name = "attiny15",
1440 .features = featureSet(&[_]Feature{1441 .features = featureSet(&[_]Feature{
1441 .avr1,1442 .avr1,
1442 }),1443 }),
1443 };1444 };
1444 pub const attiny1634 = Cpu{1445 pub const attiny1634 = CpuModel{
1445 .name = "attiny1634",1446 .name = "attiny1634",
1446 .llvm_name = "attiny1634",1447 .llvm_name = "attiny1634",
1447 .features = featureSet(&[_]Feature{1448 .features = featureSet(&[_]Feature{
1448 .avr35,1449 .avr35,
1449 }),1450 }),
1450 };1451 };
1451 pub const attiny167 = Cpu{1452 pub const attiny167 = CpuModel{
1452 .name = "attiny167",1453 .name = "attiny167",
1453 .llvm_name = "attiny167",1454 .llvm_name = "attiny167",
1454 .features = featureSet(&[_]Feature{1455 .features = featureSet(&[_]Feature{
1455 .avr35,1456 .avr35,
1456 }),1457 }),
1457 };1458 };
1458 pub const attiny20 = Cpu{1459 pub const attiny20 = CpuModel{
1459 .name = "attiny20",1460 .name = "attiny20",
1460 .llvm_name = "attiny20",1461 .llvm_name = "attiny20",
1461 .features = featureSet(&[_]Feature{1462 .features = featureSet(&[_]Feature{
1462 .avrtiny,1463 .avrtiny,
1463 }),1464 }),
1464 };1465 };
1465 pub const attiny22 = Cpu{1466 pub const attiny22 = CpuModel{
1466 .name = "attiny22",1467 .name = "attiny22",
1467 .llvm_name = "attiny22",1468 .llvm_name = "attiny22",
1468 .features = featureSet(&[_]Feature{1469 .features = featureSet(&[_]Feature{
1469 .avr2,1470 .avr2,
1470 }),1471 }),
1471 };1472 };
1472 pub const attiny2313 = Cpu{1473 pub const attiny2313 = CpuModel{
1473 .name = "attiny2313",1474 .name = "attiny2313",
1474 .llvm_name = "attiny2313",1475 .llvm_name = "attiny2313",
1475 .features = featureSet(&[_]Feature{1476 .features = featureSet(&[_]Feature{
1476 .avr25,1477 .avr25,
1477 }),1478 }),
1478 };1479 };
1479 pub const attiny2313a = Cpu{1480 pub const attiny2313a = CpuModel{
1480 .name = "attiny2313a",1481 .name = "attiny2313a",
1481 .llvm_name = "attiny2313a",1482 .llvm_name = "attiny2313a",
1482 .features = featureSet(&[_]Feature{1483 .features = featureSet(&[_]Feature{
1483 .avr25,1484 .avr25,
1484 }),1485 }),
1485 };1486 };
1486 pub const attiny24 = Cpu{1487 pub const attiny24 = CpuModel{
1487 .name = "attiny24",1488 .name = "attiny24",
1488 .llvm_name = "attiny24",1489 .llvm_name = "attiny24",
1489 .features = featureSet(&[_]Feature{1490 .features = featureSet(&[_]Feature{
1490 .avr25,1491 .avr25,
1491 }),1492 }),
1492 };1493 };
1493 pub const attiny24a = Cpu{1494 pub const attiny24a = CpuModel{
1494 .name = "attiny24a",1495 .name = "attiny24a",
1495 .llvm_name = "attiny24a",1496 .llvm_name = "attiny24a",
1496 .features = featureSet(&[_]Feature{1497 .features = featureSet(&[_]Feature{
1497 .avr25,1498 .avr25,
1498 }),1499 }),
1499 };1500 };
1500 pub const attiny25 = Cpu{1501 pub const attiny25 = CpuModel{
1501 .name = "attiny25",1502 .name = "attiny25",
1502 .llvm_name = "attiny25",1503 .llvm_name = "attiny25",
1503 .features = featureSet(&[_]Feature{1504 .features = featureSet(&[_]Feature{
1504 .avr25,1505 .avr25,
1505 }),1506 }),
1506 };1507 };
1507 pub const attiny26 = Cpu{1508 pub const attiny26 = CpuModel{
1508 .name = "attiny26",1509 .name = "attiny26",
1509 .llvm_name = "attiny26",1510 .llvm_name = "attiny26",
1510 .features = featureSet(&[_]Feature{1511 .features = featureSet(&[_]Feature{
...@@ -1512,602 +1513,602 @@ pub const cpu = struct {...@@ -1512,602 +1513,602 @@ pub const cpu = struct {
1512 .lpmx,1513 .lpmx,
1513 }),1514 }),
1514 };1515 };
1515 pub const attiny261 = Cpu{1516 pub const attiny261 = CpuModel{
1516 .name = "attiny261",1517 .name = "attiny261",
1517 .llvm_name = "attiny261",1518 .llvm_name = "attiny261",
1518 .features = featureSet(&[_]Feature{1519 .features = featureSet(&[_]Feature{
1519 .avr25,1520 .avr25,
1520 }),1521 }),
1521 };1522 };
1522 pub const attiny261a = Cpu{1523 pub const attiny261a = CpuModel{
1523 .name = "attiny261a",1524 .name = "attiny261a",
1524 .llvm_name = "attiny261a",1525 .llvm_name = "attiny261a",
1525 .features = featureSet(&[_]Feature{1526 .features = featureSet(&[_]Feature{
1526 .avr25,1527 .avr25,
1527 }),1528 }),
1528 };1529 };
1529 pub const attiny28 = Cpu{1530 pub const attiny28 = CpuModel{
1530 .name = "attiny28",1531 .name = "attiny28",
1531 .llvm_name = "attiny28",1532 .llvm_name = "attiny28",
1532 .features = featureSet(&[_]Feature{1533 .features = featureSet(&[_]Feature{
1533 .avr1,1534 .avr1,
1534 }),1535 }),
1535 };1536 };
1536 pub const attiny4 = Cpu{1537 pub const attiny4 = CpuModel{
1537 .name = "attiny4",1538 .name = "attiny4",
1538 .llvm_name = "attiny4",1539 .llvm_name = "attiny4",
1539 .features = featureSet(&[_]Feature{1540 .features = featureSet(&[_]Feature{
1540 .avrtiny,1541 .avrtiny,
1541 }),1542 }),
1542 };1543 };
1543 pub const attiny40 = Cpu{1544 pub const attiny40 = CpuModel{
1544 .name = "attiny40",1545 .name = "attiny40",
1545 .llvm_name = "attiny40",1546 .llvm_name = "attiny40",
1546 .features = featureSet(&[_]Feature{1547 .features = featureSet(&[_]Feature{
1547 .avrtiny,1548 .avrtiny,
1548 }),1549 }),
1549 };1550 };
1550 pub const attiny4313 = Cpu{1551 pub const attiny4313 = CpuModel{
1551 .name = "attiny4313",1552 .name = "attiny4313",
1552 .llvm_name = "attiny4313",1553 .llvm_name = "attiny4313",
1553 .features = featureSet(&[_]Feature{1554 .features = featureSet(&[_]Feature{
1554 .avr25,1555 .avr25,
1555 }),1556 }),
1556 };1557 };
1557 pub const attiny43u = Cpu{1558 pub const attiny43u = CpuModel{
1558 .name = "attiny43u",1559 .name = "attiny43u",
1559 .llvm_name = "attiny43u",1560 .llvm_name = "attiny43u",
1560 .features = featureSet(&[_]Feature{1561 .features = featureSet(&[_]Feature{
1561 .avr25,1562 .avr25,
1562 }),1563 }),
1563 };1564 };
1564 pub const attiny44 = Cpu{1565 pub const attiny44 = CpuModel{
1565 .name = "attiny44",1566 .name = "attiny44",
1566 .llvm_name = "attiny44",1567 .llvm_name = "attiny44",
1567 .features = featureSet(&[_]Feature{1568 .features = featureSet(&[_]Feature{
1568 .avr25,1569 .avr25,
1569 }),1570 }),
1570 };1571 };
1571 pub const attiny44a = Cpu{1572 pub const attiny44a = CpuModel{
1572 .name = "attiny44a",1573 .name = "attiny44a",
1573 .llvm_name = "attiny44a",1574 .llvm_name = "attiny44a",
1574 .features = featureSet(&[_]Feature{1575 .features = featureSet(&[_]Feature{
1575 .avr25,1576 .avr25,
1576 }),1577 }),
1577 };1578 };
1578 pub const attiny45 = Cpu{1579 pub const attiny45 = CpuModel{
1579 .name = "attiny45",1580 .name = "attiny45",
1580 .llvm_name = "attiny45",1581 .llvm_name = "attiny45",
1581 .features = featureSet(&[_]Feature{1582 .features = featureSet(&[_]Feature{
1582 .avr25,1583 .avr25,
1583 }),1584 }),
1584 };1585 };
1585 pub const attiny461 = Cpu{1586 pub const attiny461 = CpuModel{
1586 .name = "attiny461",1587 .name = "attiny461",
1587 .llvm_name = "attiny461",1588 .llvm_name = "attiny461",
1588 .features = featureSet(&[_]Feature{1589 .features = featureSet(&[_]Feature{
1589 .avr25,1590 .avr25,
1590 }),1591 }),
1591 };1592 };
1592 pub const attiny461a = Cpu{1593 pub const attiny461a = CpuModel{
1593 .name = "attiny461a",1594 .name = "attiny461a",
1594 .llvm_name = "attiny461a",1595 .llvm_name = "attiny461a",
1595 .features = featureSet(&[_]Feature{1596 .features = featureSet(&[_]Feature{
1596 .avr25,1597 .avr25,
1597 }),1598 }),
1598 };1599 };
1599 pub const attiny48 = Cpu{1600 pub const attiny48 = CpuModel{
1600 .name = "attiny48",1601 .name = "attiny48",
1601 .llvm_name = "attiny48",1602 .llvm_name = "attiny48",
1602 .features = featureSet(&[_]Feature{1603 .features = featureSet(&[_]Feature{
1603 .avr25,1604 .avr25,
1604 }),1605 }),
1605 };1606 };
1606 pub const attiny5 = Cpu{1607 pub const attiny5 = CpuModel{
1607 .name = "attiny5",1608 .name = "attiny5",
1608 .llvm_name = "attiny5",1609 .llvm_name = "attiny5",
1609 .features = featureSet(&[_]Feature{1610 .features = featureSet(&[_]Feature{
1610 .avrtiny,1611 .avrtiny,
1611 }),1612 }),
1612 };1613 };
1613 pub const attiny828 = Cpu{1614 pub const attiny828 = CpuModel{
1614 .name = "attiny828",1615 .name = "attiny828",
1615 .llvm_name = "attiny828",1616 .llvm_name = "attiny828",
1616 .features = featureSet(&[_]Feature{1617 .features = featureSet(&[_]Feature{
1617 .avr25,1618 .avr25,
1618 }),1619 }),
1619 };1620 };
1620 pub const attiny84 = Cpu{1621 pub const attiny84 = CpuModel{
1621 .name = "attiny84",1622 .name = "attiny84",
1622 .llvm_name = "attiny84",1623 .llvm_name = "attiny84",
1623 .features = featureSet(&[_]Feature{1624 .features = featureSet(&[_]Feature{
1624 .avr25,1625 .avr25,
1625 }),1626 }),
1626 };1627 };
1627 pub const attiny84a = Cpu{1628 pub const attiny84a = CpuModel{
1628 .name = "attiny84a",1629 .name = "attiny84a",
1629 .llvm_name = "attiny84a",1630 .llvm_name = "attiny84a",
1630 .features = featureSet(&[_]Feature{1631 .features = featureSet(&[_]Feature{
1631 .avr25,1632 .avr25,
1632 }),1633 }),
1633 };1634 };
1634 pub const attiny85 = Cpu{1635 pub const attiny85 = CpuModel{
1635 .name = "attiny85",1636 .name = "attiny85",
1636 .llvm_name = "attiny85",1637 .llvm_name = "attiny85",
1637 .features = featureSet(&[_]Feature{1638 .features = featureSet(&[_]Feature{
1638 .avr25,1639 .avr25,
1639 }),1640 }),
1640 };1641 };
1641 pub const attiny861 = Cpu{1642 pub const attiny861 = CpuModel{
1642 .name = "attiny861",1643 .name = "attiny861",
1643 .llvm_name = "attiny861",1644 .llvm_name = "attiny861",
1644 .features = featureSet(&[_]Feature{1645 .features = featureSet(&[_]Feature{
1645 .avr25,1646 .avr25,
1646 }),1647 }),
1647 };1648 };
1648 pub const attiny861a = Cpu{1649 pub const attiny861a = CpuModel{
1649 .name = "attiny861a",1650 .name = "attiny861a",
1650 .llvm_name = "attiny861a",1651 .llvm_name = "attiny861a",
1651 .features = featureSet(&[_]Feature{1652 .features = featureSet(&[_]Feature{
1652 .avr25,1653 .avr25,
1653 }),1654 }),
1654 };1655 };
1655 pub const attiny87 = Cpu{1656 pub const attiny87 = CpuModel{
1656 .name = "attiny87",1657 .name = "attiny87",
1657 .llvm_name = "attiny87",1658 .llvm_name = "attiny87",
1658 .features = featureSet(&[_]Feature{1659 .features = featureSet(&[_]Feature{
1659 .avr25,1660 .avr25,
1660 }),1661 }),
1661 };1662 };
1662 pub const attiny88 = Cpu{1663 pub const attiny88 = CpuModel{
1663 .name = "attiny88",1664 .name = "attiny88",
1664 .llvm_name = "attiny88",1665 .llvm_name = "attiny88",
1665 .features = featureSet(&[_]Feature{1666 .features = featureSet(&[_]Feature{
1666 .avr25,1667 .avr25,
1667 }),1668 }),
1668 };1669 };
1669 pub const attiny9 = Cpu{1670 pub const attiny9 = CpuModel{
1670 .name = "attiny9",1671 .name = "attiny9",
1671 .llvm_name = "attiny9",1672 .llvm_name = "attiny9",
1672 .features = featureSet(&[_]Feature{1673 .features = featureSet(&[_]Feature{
1673 .avrtiny,1674 .avrtiny,
1674 }),1675 }),
1675 };1676 };
1676 pub const atxmega128a1 = Cpu{1677 pub const atxmega128a1 = CpuModel{
1677 .name = "atxmega128a1",1678 .name = "atxmega128a1",
1678 .llvm_name = "atxmega128a1",1679 .llvm_name = "atxmega128a1",
1679 .features = featureSet(&[_]Feature{1680 .features = featureSet(&[_]Feature{
1680 .xmega,1681 .xmega,
1681 }),1682 }),
1682 };1683 };
1683 pub const atxmega128a1u = Cpu{1684 pub const atxmega128a1u = CpuModel{
1684 .name = "atxmega128a1u",1685 .name = "atxmega128a1u",
1685 .llvm_name = "atxmega128a1u",1686 .llvm_name = "atxmega128a1u",
1686 .features = featureSet(&[_]Feature{1687 .features = featureSet(&[_]Feature{
1687 .xmegau,1688 .xmegau,
1688 }),1689 }),
1689 };1690 };
1690 pub const atxmega128a3 = Cpu{1691 pub const atxmega128a3 = CpuModel{
1691 .name = "atxmega128a3",1692 .name = "atxmega128a3",
1692 .llvm_name = "atxmega128a3",1693 .llvm_name = "atxmega128a3",
1693 .features = featureSet(&[_]Feature{1694 .features = featureSet(&[_]Feature{
1694 .xmega,1695 .xmega,
1695 }),1696 }),
1696 };1697 };
1697 pub const atxmega128a3u = Cpu{1698 pub const atxmega128a3u = CpuModel{
1698 .name = "atxmega128a3u",1699 .name = "atxmega128a3u",
1699 .llvm_name = "atxmega128a3u",1700 .llvm_name = "atxmega128a3u",
1700 .features = featureSet(&[_]Feature{1701 .features = featureSet(&[_]Feature{
1701 .xmegau,1702 .xmegau,
1702 }),1703 }),
1703 };1704 };
1704 pub const atxmega128a4u = Cpu{1705 pub const atxmega128a4u = CpuModel{
1705 .name = "atxmega128a4u",1706 .name = "atxmega128a4u",
1706 .llvm_name = "atxmega128a4u",1707 .llvm_name = "atxmega128a4u",
1707 .features = featureSet(&[_]Feature{1708 .features = featureSet(&[_]Feature{
1708 .xmegau,1709 .xmegau,
1709 }),1710 }),
1710 };1711 };
1711 pub const atxmega128b1 = Cpu{1712 pub const atxmega128b1 = CpuModel{
1712 .name = "atxmega128b1",1713 .name = "atxmega128b1",
1713 .llvm_name = "atxmega128b1",1714 .llvm_name = "atxmega128b1",
1714 .features = featureSet(&[_]Feature{1715 .features = featureSet(&[_]Feature{
1715 .xmegau,1716 .xmegau,
1716 }),1717 }),
1717 };1718 };
1718 pub const atxmega128b3 = Cpu{1719 pub const atxmega128b3 = CpuModel{
1719 .name = "atxmega128b3",1720 .name = "atxmega128b3",
1720 .llvm_name = "atxmega128b3",1721 .llvm_name = "atxmega128b3",
1721 .features = featureSet(&[_]Feature{1722 .features = featureSet(&[_]Feature{
1722 .xmegau,1723 .xmegau,
1723 }),1724 }),
1724 };1725 };
1725 pub const atxmega128c3 = Cpu{1726 pub const atxmega128c3 = CpuModel{
1726 .name = "atxmega128c3",1727 .name = "atxmega128c3",
1727 .llvm_name = "atxmega128c3",1728 .llvm_name = "atxmega128c3",
1728 .features = featureSet(&[_]Feature{1729 .features = featureSet(&[_]Feature{
1729 .xmegau,1730 .xmegau,
1730 }),1731 }),
1731 };1732 };
1732 pub const atxmega128d3 = Cpu{1733 pub const atxmega128d3 = CpuModel{
1733 .name = "atxmega128d3",1734 .name = "atxmega128d3",
1734 .llvm_name = "atxmega128d3",1735 .llvm_name = "atxmega128d3",
1735 .features = featureSet(&[_]Feature{1736 .features = featureSet(&[_]Feature{
1736 .xmega,1737 .xmega,
1737 }),1738 }),
1738 };1739 };
1739 pub const atxmega128d4 = Cpu{1740 pub const atxmega128d4 = CpuModel{
1740 .name = "atxmega128d4",1741 .name = "atxmega128d4",
1741 .llvm_name = "atxmega128d4",1742 .llvm_name = "atxmega128d4",
1742 .features = featureSet(&[_]Feature{1743 .features = featureSet(&[_]Feature{
1743 .xmega,1744 .xmega,
1744 }),1745 }),
1745 };1746 };
1746 pub const atxmega16a4 = Cpu{1747 pub const atxmega16a4 = CpuModel{
1747 .name = "atxmega16a4",1748 .name = "atxmega16a4",
1748 .llvm_name = "atxmega16a4",1749 .llvm_name = "atxmega16a4",
1749 .features = featureSet(&[_]Feature{1750 .features = featureSet(&[_]Feature{
1750 .xmega,1751 .xmega,
1751 }),1752 }),
1752 };1753 };
1753 pub const atxmega16a4u = Cpu{1754 pub const atxmega16a4u = CpuModel{
1754 .name = "atxmega16a4u",1755 .name = "atxmega16a4u",
1755 .llvm_name = "atxmega16a4u",1756 .llvm_name = "atxmega16a4u",
1756 .features = featureSet(&[_]Feature{1757 .features = featureSet(&[_]Feature{
1757 .xmegau,1758 .xmegau,
1758 }),1759 }),
1759 };1760 };
1760 pub const atxmega16c4 = Cpu{1761 pub const atxmega16c4 = CpuModel{
1761 .name = "atxmega16c4",1762 .name = "atxmega16c4",
1762 .llvm_name = "atxmega16c4",1763 .llvm_name = "atxmega16c4",
1763 .features = featureSet(&[_]Feature{1764 .features = featureSet(&[_]Feature{
1764 .xmegau,1765 .xmegau,
1765 }),1766 }),
1766 };1767 };
1767 pub const atxmega16d4 = Cpu{1768 pub const atxmega16d4 = CpuModel{
1768 .name = "atxmega16d4",1769 .name = "atxmega16d4",
1769 .llvm_name = "atxmega16d4",1770 .llvm_name = "atxmega16d4",
1770 .features = featureSet(&[_]Feature{1771 .features = featureSet(&[_]Feature{
1771 .xmega,1772 .xmega,
1772 }),1773 }),
1773 };1774 };
1774 pub const atxmega16e5 = Cpu{1775 pub const atxmega16e5 = CpuModel{
1775 .name = "atxmega16e5",1776 .name = "atxmega16e5",
1776 .llvm_name = "atxmega16e5",1777 .llvm_name = "atxmega16e5",
1777 .features = featureSet(&[_]Feature{1778 .features = featureSet(&[_]Feature{
1778 .xmega,1779 .xmega,
1779 }),1780 }),
1780 };1781 };
1781 pub const atxmega192a3 = Cpu{1782 pub const atxmega192a3 = CpuModel{
1782 .name = "atxmega192a3",1783 .name = "atxmega192a3",
1783 .llvm_name = "atxmega192a3",1784 .llvm_name = "atxmega192a3",
1784 .features = featureSet(&[_]Feature{1785 .features = featureSet(&[_]Feature{
1785 .xmega,1786 .xmega,
1786 }),1787 }),
1787 };1788 };
1788 pub const atxmega192a3u = Cpu{1789 pub const atxmega192a3u = CpuModel{
1789 .name = "atxmega192a3u",1790 .name = "atxmega192a3u",
1790 .llvm_name = "atxmega192a3u",1791 .llvm_name = "atxmega192a3u",
1791 .features = featureSet(&[_]Feature{1792 .features = featureSet(&[_]Feature{
1792 .xmegau,1793 .xmegau,
1793 }),1794 }),
1794 };1795 };
1795 pub const atxmega192c3 = Cpu{1796 pub const atxmega192c3 = CpuModel{
1796 .name = "atxmega192c3",1797 .name = "atxmega192c3",
1797 .llvm_name = "atxmega192c3",1798 .llvm_name = "atxmega192c3",
1798 .features = featureSet(&[_]Feature{1799 .features = featureSet(&[_]Feature{
1799 .xmegau,1800 .xmegau,
1800 }),1801 }),
1801 };1802 };
1802 pub const atxmega192d3 = Cpu{1803 pub const atxmega192d3 = CpuModel{
1803 .name = "atxmega192d3",1804 .name = "atxmega192d3",
1804 .llvm_name = "atxmega192d3",1805 .llvm_name = "atxmega192d3",
1805 .features = featureSet(&[_]Feature{1806 .features = featureSet(&[_]Feature{
1806 .xmega,1807 .xmega,
1807 }),1808 }),
1808 };1809 };
1809 pub const atxmega256a3 = Cpu{1810 pub const atxmega256a3 = CpuModel{
1810 .name = "atxmega256a3",1811 .name = "atxmega256a3",
1811 .llvm_name = "atxmega256a3",1812 .llvm_name = "atxmega256a3",
1812 .features = featureSet(&[_]Feature{1813 .features = featureSet(&[_]Feature{
1813 .xmega,1814 .xmega,
1814 }),1815 }),
1815 };1816 };
1816 pub const atxmega256a3b = Cpu{1817 pub const atxmega256a3b = CpuModel{
1817 .name = "atxmega256a3b",1818 .name = "atxmega256a3b",
1818 .llvm_name = "atxmega256a3b",1819 .llvm_name = "atxmega256a3b",
1819 .features = featureSet(&[_]Feature{1820 .features = featureSet(&[_]Feature{
1820 .xmega,1821 .xmega,
1821 }),1822 }),
1822 };1823 };
1823 pub const atxmega256a3bu = Cpu{1824 pub const atxmega256a3bu = CpuModel{
1824 .name = "atxmega256a3bu",1825 .name = "atxmega256a3bu",
1825 .llvm_name = "atxmega256a3bu",1826 .llvm_name = "atxmega256a3bu",
1826 .features = featureSet(&[_]Feature{1827 .features = featureSet(&[_]Feature{
1827 .xmegau,1828 .xmegau,
1828 }),1829 }),
1829 };1830 };
1830 pub const atxmega256a3u = Cpu{1831 pub const atxmega256a3u = CpuModel{
1831 .name = "atxmega256a3u",1832 .name = "atxmega256a3u",
1832 .llvm_name = "atxmega256a3u",1833 .llvm_name = "atxmega256a3u",
1833 .features = featureSet(&[_]Feature{1834 .features = featureSet(&[_]Feature{
1834 .xmegau,1835 .xmegau,
1835 }),1836 }),
1836 };1837 };
1837 pub const atxmega256c3 = Cpu{1838 pub const atxmega256c3 = CpuModel{
1838 .name = "atxmega256c3",1839 .name = "atxmega256c3",
1839 .llvm_name = "atxmega256c3",1840 .llvm_name = "atxmega256c3",
1840 .features = featureSet(&[_]Feature{1841 .features = featureSet(&[_]Feature{
1841 .xmegau,1842 .xmegau,
1842 }),1843 }),
1843 };1844 };
1844 pub const atxmega256d3 = Cpu{1845 pub const atxmega256d3 = CpuModel{
1845 .name = "atxmega256d3",1846 .name = "atxmega256d3",
1846 .llvm_name = "atxmega256d3",1847 .llvm_name = "atxmega256d3",
1847 .features = featureSet(&[_]Feature{1848 .features = featureSet(&[_]Feature{
1848 .xmega,1849 .xmega,
1849 }),1850 }),
1850 };1851 };
1851 pub const atxmega32a4 = Cpu{1852 pub const atxmega32a4 = CpuModel{
1852 .name = "atxmega32a4",1853 .name = "atxmega32a4",
1853 .llvm_name = "atxmega32a4",1854 .llvm_name = "atxmega32a4",
1854 .features = featureSet(&[_]Feature{1855 .features = featureSet(&[_]Feature{
1855 .xmega,1856 .xmega,
1856 }),1857 }),
1857 };1858 };
1858 pub const atxmega32a4u = Cpu{1859 pub const atxmega32a4u = CpuModel{
1859 .name = "atxmega32a4u",1860 .name = "atxmega32a4u",
1860 .llvm_name = "atxmega32a4u",1861 .llvm_name = "atxmega32a4u",
1861 .features = featureSet(&[_]Feature{1862 .features = featureSet(&[_]Feature{
1862 .xmegau,1863 .xmegau,
1863 }),1864 }),
1864 };1865 };
1865 pub const atxmega32c4 = Cpu{1866 pub const atxmega32c4 = CpuModel{
1866 .name = "atxmega32c4",1867 .name = "atxmega32c4",
1867 .llvm_name = "atxmega32c4",1868 .llvm_name = "atxmega32c4",
1868 .features = featureSet(&[_]Feature{1869 .features = featureSet(&[_]Feature{
1869 .xmegau,1870 .xmegau,
1870 }),1871 }),
1871 };1872 };
1872 pub const atxmega32d4 = Cpu{1873 pub const atxmega32d4 = CpuModel{
1873 .name = "atxmega32d4",1874 .name = "atxmega32d4",
1874 .llvm_name = "atxmega32d4",1875 .llvm_name = "atxmega32d4",
1875 .features = featureSet(&[_]Feature{1876 .features = featureSet(&[_]Feature{
1876 .xmega,1877 .xmega,
1877 }),1878 }),
1878 };1879 };
1879 pub const atxmega32e5 = Cpu{1880 pub const atxmega32e5 = CpuModel{
1880 .name = "atxmega32e5",1881 .name = "atxmega32e5",
1881 .llvm_name = "atxmega32e5",1882 .llvm_name = "atxmega32e5",
1882 .features = featureSet(&[_]Feature{1883 .features = featureSet(&[_]Feature{
1883 .xmega,1884 .xmega,
1884 }),1885 }),
1885 };1886 };
1886 pub const atxmega32x1 = Cpu{1887 pub const atxmega32x1 = CpuModel{
1887 .name = "atxmega32x1",1888 .name = "atxmega32x1",
1888 .llvm_name = "atxmega32x1",1889 .llvm_name = "atxmega32x1",
1889 .features = featureSet(&[_]Feature{1890 .features = featureSet(&[_]Feature{
1890 .xmega,1891 .xmega,
1891 }),1892 }),
1892 };1893 };
1893 pub const atxmega384c3 = Cpu{1894 pub const atxmega384c3 = CpuModel{
1894 .name = "atxmega384c3",1895 .name = "atxmega384c3",
1895 .llvm_name = "atxmega384c3",1896 .llvm_name = "atxmega384c3",
1896 .features = featureSet(&[_]Feature{1897 .features = featureSet(&[_]Feature{
1897 .xmegau,1898 .xmegau,
1898 }),1899 }),
1899 };1900 };
1900 pub const atxmega384d3 = Cpu{1901 pub const atxmega384d3 = CpuModel{
1901 .name = "atxmega384d3",1902 .name = "atxmega384d3",
1902 .llvm_name = "atxmega384d3",1903 .llvm_name = "atxmega384d3",
1903 .features = featureSet(&[_]Feature{1904 .features = featureSet(&[_]Feature{
1904 .xmega,1905 .xmega,
1905 }),1906 }),
1906 };1907 };
1907 pub const atxmega64a1 = Cpu{1908 pub const atxmega64a1 = CpuModel{
1908 .name = "atxmega64a1",1909 .name = "atxmega64a1",
1909 .llvm_name = "atxmega64a1",1910 .llvm_name = "atxmega64a1",
1910 .features = featureSet(&[_]Feature{1911 .features = featureSet(&[_]Feature{
1911 .xmega,1912 .xmega,
1912 }),1913 }),
1913 };1914 };
1914 pub const atxmega64a1u = Cpu{1915 pub const atxmega64a1u = CpuModel{
1915 .name = "atxmega64a1u",1916 .name = "atxmega64a1u",
1916 .llvm_name = "atxmega64a1u",1917 .llvm_name = "atxmega64a1u",
1917 .features = featureSet(&[_]Feature{1918 .features = featureSet(&[_]Feature{
1918 .xmegau,1919 .xmegau,
1919 }),1920 }),
1920 };1921 };
1921 pub const atxmega64a3 = Cpu{1922 pub const atxmega64a3 = CpuModel{
1922 .name = "atxmega64a3",1923 .name = "atxmega64a3",
1923 .llvm_name = "atxmega64a3",1924 .llvm_name = "atxmega64a3",
1924 .features = featureSet(&[_]Feature{1925 .features = featureSet(&[_]Feature{
1925 .xmega,1926 .xmega,
1926 }),1927 }),
1927 };1928 };
1928 pub const atxmega64a3u = Cpu{1929 pub const atxmega64a3u = CpuModel{
1929 .name = "atxmega64a3u",1930 .name = "atxmega64a3u",
1930 .llvm_name = "atxmega64a3u",1931 .llvm_name = "atxmega64a3u",
1931 .features = featureSet(&[_]Feature{1932 .features = featureSet(&[_]Feature{
1932 .xmegau,1933 .xmegau,
1933 }),1934 }),
1934 };1935 };
1935 pub const atxmega64a4u = Cpu{1936 pub const atxmega64a4u = CpuModel{
1936 .name = "atxmega64a4u",1937 .name = "atxmega64a4u",
1937 .llvm_name = "atxmega64a4u",1938 .llvm_name = "atxmega64a4u",
1938 .features = featureSet(&[_]Feature{1939 .features = featureSet(&[_]Feature{
1939 .xmegau,1940 .xmegau,
1940 }),1941 }),
1941 };1942 };
1942 pub const atxmega64b1 = Cpu{1943 pub const atxmega64b1 = CpuModel{
1943 .name = "atxmega64b1",1944 .name = "atxmega64b1",
1944 .llvm_name = "atxmega64b1",1945 .llvm_name = "atxmega64b1",
1945 .features = featureSet(&[_]Feature{1946 .features = featureSet(&[_]Feature{
1946 .xmegau,1947 .xmegau,
1947 }),1948 }),
1948 };1949 };
1949 pub const atxmega64b3 = Cpu{1950 pub const atxmega64b3 = CpuModel{
1950 .name = "atxmega64b3",1951 .name = "atxmega64b3",
1951 .llvm_name = "atxmega64b3",1952 .llvm_name = "atxmega64b3",
1952 .features = featureSet(&[_]Feature{1953 .features = featureSet(&[_]Feature{
1953 .xmegau,1954 .xmegau,
1954 }),1955 }),
1955 };1956 };
1956 pub const atxmega64c3 = Cpu{1957 pub const atxmega64c3 = CpuModel{
1957 .name = "atxmega64c3",1958 .name = "atxmega64c3",
1958 .llvm_name = "atxmega64c3",1959 .llvm_name = "atxmega64c3",
1959 .features = featureSet(&[_]Feature{1960 .features = featureSet(&[_]Feature{
1960 .xmegau,1961 .xmegau,
1961 }),1962 }),
1962 };1963 };
1963 pub const atxmega64d3 = Cpu{1964 pub const atxmega64d3 = CpuModel{
1964 .name = "atxmega64d3",1965 .name = "atxmega64d3",
1965 .llvm_name = "atxmega64d3",1966 .llvm_name = "atxmega64d3",
1966 .features = featureSet(&[_]Feature{1967 .features = featureSet(&[_]Feature{
1967 .xmega,1968 .xmega,
1968 }),1969 }),
1969 };1970 };
1970 pub const atxmega64d4 = Cpu{1971 pub const atxmega64d4 = CpuModel{
1971 .name = "atxmega64d4",1972 .name = "atxmega64d4",
1972 .llvm_name = "atxmega64d4",1973 .llvm_name = "atxmega64d4",
1973 .features = featureSet(&[_]Feature{1974 .features = featureSet(&[_]Feature{
1974 .xmega,1975 .xmega,
1975 }),1976 }),
1976 };1977 };
1977 pub const atxmega8e5 = Cpu{1978 pub const atxmega8e5 = CpuModel{
1978 .name = "atxmega8e5",1979 .name = "atxmega8e5",
1979 .llvm_name = "atxmega8e5",1980 .llvm_name = "atxmega8e5",
1980 .features = featureSet(&[_]Feature{1981 .features = featureSet(&[_]Feature{
1981 .xmega,1982 .xmega,
1982 }),1983 }),
1983 };1984 };
1984 pub const avr1 = Cpu{1985 pub const avr1 = CpuModel{
1985 .name = "avr1",1986 .name = "avr1",
1986 .llvm_name = "avr1",1987 .llvm_name = "avr1",
1987 .features = featureSet(&[_]Feature{1988 .features = featureSet(&[_]Feature{
1988 .avr1,1989 .avr1,
1989 }),1990 }),
1990 };1991 };
1991 pub const avr2 = Cpu{1992 pub const avr2 = CpuModel{
1992 .name = "avr2",1993 .name = "avr2",
1993 .llvm_name = "avr2",1994 .llvm_name = "avr2",
1994 .features = featureSet(&[_]Feature{1995 .features = featureSet(&[_]Feature{
1995 .avr2,1996 .avr2,
1996 }),1997 }),
1997 };1998 };
1998 pub const avr25 = Cpu{1999 pub const avr25 = CpuModel{
1999 .name = "avr25",2000 .name = "avr25",
2000 .llvm_name = "avr25",2001 .llvm_name = "avr25",
2001 .features = featureSet(&[_]Feature{2002 .features = featureSet(&[_]Feature{
2002 .avr25,2003 .avr25,
2003 }),2004 }),
2004 };2005 };
2005 pub const avr3 = Cpu{2006 pub const avr3 = CpuModel{
2006 .name = "avr3",2007 .name = "avr3",
2007 .llvm_name = "avr3",2008 .llvm_name = "avr3",
2008 .features = featureSet(&[_]Feature{2009 .features = featureSet(&[_]Feature{
2009 .avr3,2010 .avr3,
2010 }),2011 }),
2011 };2012 };
2012 pub const avr31 = Cpu{2013 pub const avr31 = CpuModel{
2013 .name = "avr31",2014 .name = "avr31",
2014 .llvm_name = "avr31",2015 .llvm_name = "avr31",
2015 .features = featureSet(&[_]Feature{2016 .features = featureSet(&[_]Feature{
2016 .avr31,2017 .avr31,
2017 }),2018 }),
2018 };2019 };
2019 pub const avr35 = Cpu{2020 pub const avr35 = CpuModel{
2020 .name = "avr35",2021 .name = "avr35",
2021 .llvm_name = "avr35",2022 .llvm_name = "avr35",
2022 .features = featureSet(&[_]Feature{2023 .features = featureSet(&[_]Feature{
2023 .avr35,2024 .avr35,
2024 }),2025 }),
2025 };2026 };
2026 pub const avr4 = Cpu{2027 pub const avr4 = CpuModel{
2027 .name = "avr4",2028 .name = "avr4",
2028 .llvm_name = "avr4",2029 .llvm_name = "avr4",
2029 .features = featureSet(&[_]Feature{2030 .features = featureSet(&[_]Feature{
2030 .avr4,2031 .avr4,
2031 }),2032 }),
2032 };2033 };
2033 pub const avr5 = Cpu{2034 pub const avr5 = CpuModel{
2034 .name = "avr5",2035 .name = "avr5",
2035 .llvm_name = "avr5",2036 .llvm_name = "avr5",
2036 .features = featureSet(&[_]Feature{2037 .features = featureSet(&[_]Feature{
2037 .avr5,2038 .avr5,
2038 }),2039 }),
2039 };2040 };
2040 pub const avr51 = Cpu{2041 pub const avr51 = CpuModel{
2041 .name = "avr51",2042 .name = "avr51",
2042 .llvm_name = "avr51",2043 .llvm_name = "avr51",
2043 .features = featureSet(&[_]Feature{2044 .features = featureSet(&[_]Feature{
2044 .avr51,2045 .avr51,
2045 }),2046 }),
2046 };2047 };
2047 pub const avr6 = Cpu{2048 pub const avr6 = CpuModel{
2048 .name = "avr6",2049 .name = "avr6",
2049 .llvm_name = "avr6",2050 .llvm_name = "avr6",
2050 .features = featureSet(&[_]Feature{2051 .features = featureSet(&[_]Feature{
2051 .avr6,2052 .avr6,
2052 }),2053 }),
2053 };2054 };
2054 pub const avrtiny = Cpu{2055 pub const avrtiny = CpuModel{
2055 .name = "avrtiny",2056 .name = "avrtiny",
2056 .llvm_name = "avrtiny",2057 .llvm_name = "avrtiny",
2057 .features = featureSet(&[_]Feature{2058 .features = featureSet(&[_]Feature{
2058 .avrtiny,2059 .avrtiny,
2059 }),2060 }),
2060 };2061 };
2061 pub const avrxmega1 = Cpu{2062 pub const avrxmega1 = CpuModel{
2062 .name = "avrxmega1",2063 .name = "avrxmega1",
2063 .llvm_name = "avrxmega1",2064 .llvm_name = "avrxmega1",
2064 .features = featureSet(&[_]Feature{2065 .features = featureSet(&[_]Feature{
2065 .xmega,2066 .xmega,
2066 }),2067 }),
2067 };2068 };
2068 pub const avrxmega2 = Cpu{2069 pub const avrxmega2 = CpuModel{
2069 .name = "avrxmega2",2070 .name = "avrxmega2",
2070 .llvm_name = "avrxmega2",2071 .llvm_name = "avrxmega2",
2071 .features = featureSet(&[_]Feature{2072 .features = featureSet(&[_]Feature{
2072 .xmega,2073 .xmega,
2073 }),2074 }),
2074 };2075 };
2075 pub const avrxmega3 = Cpu{2076 pub const avrxmega3 = CpuModel{
2076 .name = "avrxmega3",2077 .name = "avrxmega3",
2077 .llvm_name = "avrxmega3",2078 .llvm_name = "avrxmega3",
2078 .features = featureSet(&[_]Feature{2079 .features = featureSet(&[_]Feature{
2079 .xmega,2080 .xmega,
2080 }),2081 }),
2081 };2082 };
2082 pub const avrxmega4 = Cpu{2083 pub const avrxmega4 = CpuModel{
2083 .name = "avrxmega4",2084 .name = "avrxmega4",
2084 .llvm_name = "avrxmega4",2085 .llvm_name = "avrxmega4",
2085 .features = featureSet(&[_]Feature{2086 .features = featureSet(&[_]Feature{
2086 .xmega,2087 .xmega,
2087 }),2088 }),
2088 };2089 };
2089 pub const avrxmega5 = Cpu{2090 pub const avrxmega5 = CpuModel{
2090 .name = "avrxmega5",2091 .name = "avrxmega5",
2091 .llvm_name = "avrxmega5",2092 .llvm_name = "avrxmega5",
2092 .features = featureSet(&[_]Feature{2093 .features = featureSet(&[_]Feature{
2093 .xmega,2094 .xmega,
2094 }),2095 }),
2095 };2096 };
2096 pub const avrxmega6 = Cpu{2097 pub const avrxmega6 = CpuModel{
2097 .name = "avrxmega6",2098 .name = "avrxmega6",
2098 .llvm_name = "avrxmega6",2099 .llvm_name = "avrxmega6",
2099 .features = featureSet(&[_]Feature{2100 .features = featureSet(&[_]Feature{
2100 .xmega,2101 .xmega,
2101 }),2102 }),
2102 };2103 };
2103 pub const avrxmega7 = Cpu{2104 pub const avrxmega7 = CpuModel{
2104 .name = "avrxmega7",2105 .name = "avrxmega7",
2105 .llvm_name = "avrxmega7",2106 .llvm_name = "avrxmega7",
2106 .features = featureSet(&[_]Feature{2107 .features = featureSet(&[_]Feature{
2107 .xmega,2108 .xmega,
2108 }),2109 }),
2109 };2110 };
2110 pub const m3000 = Cpu{2111 pub const m3000 = CpuModel{
2111 .name = "m3000",2112 .name = "m3000",
2112 .llvm_name = "m3000",2113 .llvm_name = "m3000",
2113 .features = featureSet(&[_]Feature{2114 .features = featureSet(&[_]Feature{
...@@ -2119,7 +2120,7 @@ pub const cpu = struct {...@@ -2119,7 +2120,7 @@ pub const cpu = struct {
2119/// All avr CPUs, sorted alphabetically by name.2120/// All avr CPUs, sorted alphabetically by name.
2120/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage12121/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2121/// compiler has inefficient memory and CPU usage, affecting build times.2122/// compiler has inefficient memory and CPU usage, affecting build times.
2122pub const all_cpus = &[_]*const Cpu{2123pub const all_cpus = &[_]*const CpuModel{
2123 &cpu.at43usb320,2124 &cpu.at43usb320,
2124 &cpu.at43usb355,2125 &cpu.at43usb355,
2125 &cpu.at76c711,2126 &cpu.at76c711,
lib/std/target/bpf.zig+11-10
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 alu32,6 alu32,
...@@ -7,12 +8,12 @@ pub const Feature = enum {...@@ -7,12 +8,12 @@ pub const Feature = enum {
7 dwarfris,8 dwarfris,
8};9};
910
10pub usingnamespace Cpu.Feature.feature_set_fns(Feature);11pub usingnamespace CpuFeature.feature_set_fns(Feature);
1112
12pub const all_features = blk: {13pub const all_features = blk: {
13 const len = @typeInfo(Feature).Enum.fields.len;14 const len = @typeInfo(Feature).Enum.fields.len;
14 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);15 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
15 var result: [len]Cpu.Feature = undefined;16 var result: [len]CpuFeature = undefined;
16 result[@enumToInt(Feature.alu32)] = .{17 result[@enumToInt(Feature.alu32)] = .{
17 .llvm_name = "alu32",18 .llvm_name = "alu32",
18 .description = "Enable ALU32 instructions",19 .description = "Enable ALU32 instructions",
...@@ -37,27 +38,27 @@ pub const all_features = blk: {...@@ -37,27 +38,27 @@ pub const all_features = blk: {
37};38};
3839
39pub const cpu = struct {40pub const cpu = struct {
40 pub const generic = Cpu{41 pub const generic = CpuModel{
41 .name = "generic",42 .name = "generic",
42 .llvm_name = "generic",43 .llvm_name = "generic",
43 .features = featureSet(&[_]Feature{}),44 .features = featureSet(&[_]Feature{}),
44 };45 };
45 pub const probe = Cpu{46 pub const probe = CpuModel{
46 .name = "probe",47 .name = "probe",
47 .llvm_name = "probe",48 .llvm_name = "probe",
48 .features = featureSet(&[_]Feature{}),49 .features = featureSet(&[_]Feature{}),
49 };50 };
50 pub const v1 = Cpu{51 pub const v1 = CpuModel{
51 .name = "v1",52 .name = "v1",
52 .llvm_name = "v1",53 .llvm_name = "v1",
53 .features = featureSet(&[_]Feature{}),54 .features = featureSet(&[_]Feature{}),
54 };55 };
55 pub const v2 = Cpu{56 pub const v2 = CpuModel{
56 .name = "v2",57 .name = "v2",
57 .llvm_name = "v2",58 .llvm_name = "v2",
58 .features = featureSet(&[_]Feature{}),59 .features = featureSet(&[_]Feature{}),
59 };60 };
60 pub const v3 = Cpu{61 pub const v3 = CpuModel{
61 .name = "v3",62 .name = "v3",
62 .llvm_name = "v3",63 .llvm_name = "v3",
63 .features = featureSet(&[_]Feature{}),64 .features = featureSet(&[_]Feature{}),
...@@ -67,7 +68,7 @@ pub const cpu = struct {...@@ -67,7 +68,7 @@ pub const cpu = struct {
67/// All bpf CPUs, sorted alphabetically by name.68/// All bpf CPUs, sorted alphabetically by name.
68/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage169/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
69/// compiler has inefficient memory and CPU usage, affecting build times.70/// compiler has inefficient memory and CPU usage, affecting build times.
70pub const all_cpus = &[_]*const Cpu{71pub const all_cpus = &[_]*const CpuModel{
71 &cpu.generic,72 &cpu.generic,
72 &cpu.probe,73 &cpu.probe,
73 &cpu.v1,74 &cpu.v1,
lib/std/target/hexagon.zig+13-12
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 duplex,6 duplex,
...@@ -28,12 +29,12 @@ pub const Feature = enum {...@@ -28,12 +29,12 @@ pub const Feature = enum {
28 zreg,29 zreg,
29};30};
3031
31pub usingnamespace Cpu.Feature.feature_set_fns(Feature);32pub usingnamespace CpuFeature.feature_set_fns(Feature);
3233
33pub const all_features = blk: {34pub const all_features = blk: {
34 const len = @typeInfo(Feature).Enum.fields.len;35 const len = @typeInfo(Feature).Enum.fields.len;
35 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);36 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
36 var result: [len]Cpu.Feature = undefined;37 var result: [len]CpuFeature = undefined;
37 result[@enumToInt(Feature.duplex)] = .{38 result[@enumToInt(Feature.duplex)] = .{
38 .llvm_name = "duplex",39 .llvm_name = "duplex",
39 .description = "Enable generation of duplex instruction",40 .description = "Enable generation of duplex instruction",
...@@ -186,7 +187,7 @@ pub const all_features = blk: {...@@ -186,7 +187,7 @@ pub const all_features = blk: {
186};187};
187188
188pub const cpu = struct {189pub const cpu = struct {
189 pub const generic = Cpu{190 pub const generic = CpuModel{
190 .name = "generic",191 .name = "generic",
191 .llvm_name = "generic",192 .llvm_name = "generic",
192 .features = featureSet(&[_]Feature{193 .features = featureSet(&[_]Feature{
...@@ -201,7 +202,7 @@ pub const cpu = struct {...@@ -201,7 +202,7 @@ pub const cpu = struct {
201 .v60,202 .v60,
202 }),203 }),
203 };204 };
204 pub const hexagonv5 = Cpu{205 pub const hexagonv5 = CpuModel{
205 .name = "hexagonv5",206 .name = "hexagonv5",
206 .llvm_name = "hexagonv5",207 .llvm_name = "hexagonv5",
207 .features = featureSet(&[_]Feature{208 .features = featureSet(&[_]Feature{
...@@ -214,7 +215,7 @@ pub const cpu = struct {...@@ -214,7 +215,7 @@ pub const cpu = struct {
214 .v5,215 .v5,
215 }),216 }),
216 };217 };
217 pub const hexagonv55 = Cpu{218 pub const hexagonv55 = CpuModel{
218 .name = "hexagonv55",219 .name = "hexagonv55",
219 .llvm_name = "hexagonv55",220 .llvm_name = "hexagonv55",
220 .features = featureSet(&[_]Feature{221 .features = featureSet(&[_]Feature{
...@@ -228,7 +229,7 @@ pub const cpu = struct {...@@ -228,7 +229,7 @@ pub const cpu = struct {
228 .v55,229 .v55,
229 }),230 }),
230 };231 };
231 pub const hexagonv60 = Cpu{232 pub const hexagonv60 = CpuModel{
232 .name = "hexagonv60",233 .name = "hexagonv60",
233 .llvm_name = "hexagonv60",234 .llvm_name = "hexagonv60",
234 .features = featureSet(&[_]Feature{235 .features = featureSet(&[_]Feature{
...@@ -243,7 +244,7 @@ pub const cpu = struct {...@@ -243,7 +244,7 @@ pub const cpu = struct {
243 .v60,244 .v60,
244 }),245 }),
245 };246 };
246 pub const hexagonv62 = Cpu{247 pub const hexagonv62 = CpuModel{
247 .name = "hexagonv62",248 .name = "hexagonv62",
248 .llvm_name = "hexagonv62",249 .llvm_name = "hexagonv62",
249 .features = featureSet(&[_]Feature{250 .features = featureSet(&[_]Feature{
...@@ -259,7 +260,7 @@ pub const cpu = struct {...@@ -259,7 +260,7 @@ pub const cpu = struct {
259 .v62,260 .v62,
260 }),261 }),
261 };262 };
262 pub const hexagonv65 = Cpu{263 pub const hexagonv65 = CpuModel{
263 .name = "hexagonv65",264 .name = "hexagonv65",
264 .llvm_name = "hexagonv65",265 .llvm_name = "hexagonv65",
265 .features = featureSet(&[_]Feature{266 .features = featureSet(&[_]Feature{
...@@ -277,7 +278,7 @@ pub const cpu = struct {...@@ -277,7 +278,7 @@ pub const cpu = struct {
277 .v65,278 .v65,
278 }),279 }),
279 };280 };
280 pub const hexagonv66 = Cpu{281 pub const hexagonv66 = CpuModel{
281 .name = "hexagonv66",282 .name = "hexagonv66",
282 .llvm_name = "hexagonv66",283 .llvm_name = "hexagonv66",
283 .features = featureSet(&[_]Feature{284 .features = featureSet(&[_]Feature{
...@@ -301,7 +302,7 @@ pub const cpu = struct {...@@ -301,7 +302,7 @@ pub const cpu = struct {
301/// All hexagon CPUs, sorted alphabetically by name.302/// All hexagon CPUs, sorted alphabetically by name.
302/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1303/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
303/// compiler has inefficient memory and CPU usage, affecting build times.304/// compiler has inefficient memory and CPU usage, affecting build times.
304pub const all_cpus = &[_]*const Cpu{305pub const all_cpus = &[_]*const CpuModel{
305 &cpu.generic,306 &cpu.generic,
306 &cpu.hexagonv5,307 &cpu.hexagonv5,
307 &cpu.hexagonv55,308 &cpu.hexagonv55,
lib/std/target/mips.zig+23-22
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 abs2008,6 abs2008,
...@@ -53,12 +54,12 @@ pub const Feature = enum {...@@ -53,12 +54,12 @@ pub const Feature = enum {
53 virt,54 virt,
54};55};
5556
56pub usingnamespace Cpu.Feature.feature_set_fns(Feature);57pub usingnamespace CpuFeature.feature_set_fns(Feature);
5758
58pub const all_features = blk: {59pub const all_features = blk: {
59 const len = @typeInfo(Feature).Enum.fields.len;60 const len = @typeInfo(Feature).Enum.fields.len;
60 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);61 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
61 var result: [len]Cpu.Feature = undefined;62 var result: [len]CpuFeature = undefined;
62 result[@enumToInt(Feature.abs2008)] = .{63 result[@enumToInt(Feature.abs2008)] = .{
63 .llvm_name = "abs2008",64 .llvm_name = "abs2008",
64 .description = "Disable IEEE 754-2008 abs.fmt mode",65 .description = "Disable IEEE 754-2008 abs.fmt mode",
...@@ -372,112 +373,112 @@ pub const all_features = blk: {...@@ -372,112 +373,112 @@ pub const all_features = blk: {
372};373};
373374
374pub const cpu = struct {375pub const cpu = struct {
375 pub const mips1 = Cpu{376 pub const mips1 = CpuModel{
376 .name = "mips1",377 .name = "mips1",
377 .llvm_name = "mips1",378 .llvm_name = "mips1",
378 .features = featureSet(&[_]Feature{379 .features = featureSet(&[_]Feature{
379 .mips1,380 .mips1,
380 }),381 }),
381 };382 };
382 pub const mips2 = Cpu{383 pub const mips2 = CpuModel{
383 .name = "mips2",384 .name = "mips2",
384 .llvm_name = "mips2",385 .llvm_name = "mips2",
385 .features = featureSet(&[_]Feature{386 .features = featureSet(&[_]Feature{
386 .mips2,387 .mips2,
387 }),388 }),
388 };389 };
389 pub const mips3 = Cpu{390 pub const mips3 = CpuModel{
390 .name = "mips3",391 .name = "mips3",
391 .llvm_name = "mips3",392 .llvm_name = "mips3",
392 .features = featureSet(&[_]Feature{393 .features = featureSet(&[_]Feature{
393 .mips3,394 .mips3,
394 }),395 }),
395 };396 };
396 pub const mips32 = Cpu{397 pub const mips32 = CpuModel{
397 .name = "mips32",398 .name = "mips32",
398 .llvm_name = "mips32",399 .llvm_name = "mips32",
399 .features = featureSet(&[_]Feature{400 .features = featureSet(&[_]Feature{
400 .mips32,401 .mips32,
401 }),402 }),
402 };403 };
403 pub const mips32r2 = Cpu{404 pub const mips32r2 = CpuModel{
404 .name = "mips32r2",405 .name = "mips32r2",
405 .llvm_name = "mips32r2",406 .llvm_name = "mips32r2",
406 .features = featureSet(&[_]Feature{407 .features = featureSet(&[_]Feature{
407 .mips32r2,408 .mips32r2,
408 }),409 }),
409 };410 };
410 pub const mips32r3 = Cpu{411 pub const mips32r3 = CpuModel{
411 .name = "mips32r3",412 .name = "mips32r3",
412 .llvm_name = "mips32r3",413 .llvm_name = "mips32r3",
413 .features = featureSet(&[_]Feature{414 .features = featureSet(&[_]Feature{
414 .mips32r3,415 .mips32r3,
415 }),416 }),
416 };417 };
417 pub const mips32r5 = Cpu{418 pub const mips32r5 = CpuModel{
418 .name = "mips32r5",419 .name = "mips32r5",
419 .llvm_name = "mips32r5",420 .llvm_name = "mips32r5",
420 .features = featureSet(&[_]Feature{421 .features = featureSet(&[_]Feature{
421 .mips32r5,422 .mips32r5,
422 }),423 }),
423 };424 };
424 pub const mips32r6 = Cpu{425 pub const mips32r6 = CpuModel{
425 .name = "mips32r6",426 .name = "mips32r6",
426 .llvm_name = "mips32r6",427 .llvm_name = "mips32r6",
427 .features = featureSet(&[_]Feature{428 .features = featureSet(&[_]Feature{
428 .mips32r6,429 .mips32r6,
429 }),430 }),
430 };431 };
431 pub const mips4 = Cpu{432 pub const mips4 = CpuModel{
432 .name = "mips4",433 .name = "mips4",
433 .llvm_name = "mips4",434 .llvm_name = "mips4",
434 .features = featureSet(&[_]Feature{435 .features = featureSet(&[_]Feature{
435 .mips4,436 .mips4,
436 }),437 }),
437 };438 };
438 pub const mips5 = Cpu{439 pub const mips5 = CpuModel{
439 .name = "mips5",440 .name = "mips5",
440 .llvm_name = "mips5",441 .llvm_name = "mips5",
441 .features = featureSet(&[_]Feature{442 .features = featureSet(&[_]Feature{
442 .mips5,443 .mips5,
443 }),444 }),
444 };445 };
445 pub const mips64 = Cpu{446 pub const mips64 = CpuModel{
446 .name = "mips64",447 .name = "mips64",
447 .llvm_name = "mips64",448 .llvm_name = "mips64",
448 .features = featureSet(&[_]Feature{449 .features = featureSet(&[_]Feature{
449 .mips64,450 .mips64,
450 }),451 }),
451 };452 };
452 pub const mips64r2 = Cpu{453 pub const mips64r2 = CpuModel{
453 .name = "mips64r2",454 .name = "mips64r2",
454 .llvm_name = "mips64r2",455 .llvm_name = "mips64r2",
455 .features = featureSet(&[_]Feature{456 .features = featureSet(&[_]Feature{
456 .mips64r2,457 .mips64r2,
457 }),458 }),
458 };459 };
459 pub const mips64r3 = Cpu{460 pub const mips64r3 = CpuModel{
460 .name = "mips64r3",461 .name = "mips64r3",
461 .llvm_name = "mips64r3",462 .llvm_name = "mips64r3",
462 .features = featureSet(&[_]Feature{463 .features = featureSet(&[_]Feature{
463 .mips64r3,464 .mips64r3,
464 }),465 }),
465 };466 };
466 pub const mips64r5 = Cpu{467 pub const mips64r5 = CpuModel{
467 .name = "mips64r5",468 .name = "mips64r5",
468 .llvm_name = "mips64r5",469 .llvm_name = "mips64r5",
469 .features = featureSet(&[_]Feature{470 .features = featureSet(&[_]Feature{
470 .mips64r5,471 .mips64r5,
471 }),472 }),
472 };473 };
473 pub const mips64r6 = Cpu{474 pub const mips64r6 = CpuModel{
474 .name = "mips64r6",475 .name = "mips64r6",
475 .llvm_name = "mips64r6",476 .llvm_name = "mips64r6",
476 .features = featureSet(&[_]Feature{477 .features = featureSet(&[_]Feature{
477 .mips64r6,478 .mips64r6,
478 }),479 }),
479 };480 };
480 pub const octeon = Cpu{481 pub const octeon = CpuModel{
481 .name = "octeon",482 .name = "octeon",
482 .llvm_name = "octeon",483 .llvm_name = "octeon",
483 .features = featureSet(&[_]Feature{484 .features = featureSet(&[_]Feature{
...@@ -485,7 +486,7 @@ pub const cpu = struct {...@@ -485,7 +486,7 @@ pub const cpu = struct {
485 .mips64r2,486 .mips64r2,
486 }),487 }),
487 };488 };
488 pub const p5600 = Cpu{489 pub const p5600 = CpuModel{
489 .name = "p5600",490 .name = "p5600",
490 .llvm_name = "p5600",491 .llvm_name = "p5600",
491 .features = featureSet(&[_]Feature{492 .features = featureSet(&[_]Feature{
...@@ -497,7 +498,7 @@ pub const cpu = struct {...@@ -497,7 +498,7 @@ pub const cpu = struct {
497/// All mips CPUs, sorted alphabetically by name.498/// All mips CPUs, sorted alphabetically by name.
498/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1499/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
499/// compiler has inefficient memory and CPU usage, affecting build times.500/// compiler has inefficient memory and CPU usage, affecting build times.
500pub const all_cpus = &[_]*const Cpu{501pub const all_cpus = &[_]*const CpuModel{
501 &cpu.mips1,502 &cpu.mips1,
502 &cpu.mips2,503 &cpu.mips2,
503 &cpu.mips3,504 &cpu.mips3,
lib/std/target/msp430.zig+9-8
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 ext,6 ext,
...@@ -8,12 +9,12 @@ pub const Feature = enum {...@@ -8,12 +9,12 @@ pub const Feature = enum {
8 hwmultf5,9 hwmultf5,
9};10};
1011
11pub usingnamespace Cpu.Feature.feature_set_fns(Feature);12pub usingnamespace CpuFeature.feature_set_fns(Feature);
1213
13pub const all_features = blk: {14pub const all_features = blk: {
14 const len = @typeInfo(Feature).Enum.fields.len;15 const len = @typeInfo(Feature).Enum.fields.len;
15 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);16 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
16 var result: [len]Cpu.Feature = undefined;17 var result: [len]CpuFeature = undefined;
17 result[@enumToInt(Feature.ext)] = .{18 result[@enumToInt(Feature.ext)] = .{
18 .llvm_name = "ext",19 .llvm_name = "ext",
19 .description = "Enable MSP430-X extensions",20 .description = "Enable MSP430-X extensions",
...@@ -43,17 +44,17 @@ pub const all_features = blk: {...@@ -43,17 +44,17 @@ pub const all_features = blk: {
43};44};
4445
45pub const cpu = struct {46pub const cpu = struct {
46 pub const generic = Cpu{47 pub const generic = CpuModel{
47 .name = "generic",48 .name = "generic",
48 .llvm_name = "generic",49 .llvm_name = "generic",
49 .features = featureSet(&[_]Feature{}),50 .features = featureSet(&[_]Feature{}),
50 };51 };
51 pub const msp430 = Cpu{52 pub const msp430 = CpuModel{
52 .name = "msp430",53 .name = "msp430",
53 .llvm_name = "msp430",54 .llvm_name = "msp430",
54 .features = featureSet(&[_]Feature{}),55 .features = featureSet(&[_]Feature{}),
55 };56 };
56 pub const msp430x = Cpu{57 pub const msp430x = CpuModel{
57 .name = "msp430x",58 .name = "msp430x",
58 .llvm_name = "msp430x",59 .llvm_name = "msp430x",
59 .features = featureSet(&[_]Feature{60 .features = featureSet(&[_]Feature{
...@@ -65,7 +66,7 @@ pub const cpu = struct {...@@ -65,7 +66,7 @@ pub const cpu = struct {
65/// All msp430 CPUs, sorted alphabetically by name.66/// All msp430 CPUs, sorted alphabetically by name.
66/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage167/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
67/// compiler has inefficient memory and CPU usage, affecting build times.68/// compiler has inefficient memory and CPU usage, affecting build times.
68pub const all_cpus = &[_]*const Cpu{69pub const all_cpus = &[_]*const CpuModel{
69 &cpu.generic,70 &cpu.generic,
70 &cpu.msp430,71 &cpu.msp430,
71 &cpu.msp430x,72 &cpu.msp430x,
lib/std/target/nvptx.zig+21-20
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 ptx32,6 ptx32,
...@@ -29,12 +30,12 @@ pub const Feature = enum {...@@ -29,12 +30,12 @@ pub const Feature = enum {
29 sm_75,30 sm_75,
30};31};
3132
32pub usingnamespace Cpu.Feature.feature_set_fns(Feature);33pub usingnamespace CpuFeature.feature_set_fns(Feature);
3334
34pub const all_features = blk: {35pub const all_features = blk: {
35 const len = @typeInfo(Feature).Enum.fields.len;36 const len = @typeInfo(Feature).Enum.fields.len;
36 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);37 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
37 var result: [len]Cpu.Feature = undefined;38 var result: [len]CpuFeature = undefined;
38 result[@enumToInt(Feature.ptx32)] = .{39 result[@enumToInt(Feature.ptx32)] = .{
39 .llvm_name = "ptx32",40 .llvm_name = "ptx32",
40 .description = "Use PTX version 3.2",41 .description = "Use PTX version 3.2",
...@@ -169,28 +170,28 @@ pub const all_features = blk: {...@@ -169,28 +170,28 @@ pub const all_features = blk: {
169};170};
170171
171pub const cpu = struct {172pub const cpu = struct {
172 pub const sm_20 = Cpu{173 pub const sm_20 = CpuModel{
173 .name = "sm_20",174 .name = "sm_20",
174 .llvm_name = "sm_20",175 .llvm_name = "sm_20",
175 .features = featureSet(&[_]Feature{176 .features = featureSet(&[_]Feature{
176 .sm_20,177 .sm_20,
177 }),178 }),
178 };179 };
179 pub const sm_21 = Cpu{180 pub const sm_21 = CpuModel{
180 .name = "sm_21",181 .name = "sm_21",
181 .llvm_name = "sm_21",182 .llvm_name = "sm_21",
182 .features = featureSet(&[_]Feature{183 .features = featureSet(&[_]Feature{
183 .sm_21,184 .sm_21,
184 }),185 }),
185 };186 };
186 pub const sm_30 = Cpu{187 pub const sm_30 = CpuModel{
187 .name = "sm_30",188 .name = "sm_30",
188 .llvm_name = "sm_30",189 .llvm_name = "sm_30",
189 .features = featureSet(&[_]Feature{190 .features = featureSet(&[_]Feature{
190 .sm_30,191 .sm_30,
191 }),192 }),
192 };193 };
193 pub const sm_32 = Cpu{194 pub const sm_32 = CpuModel{
194 .name = "sm_32",195 .name = "sm_32",
195 .llvm_name = "sm_32",196 .llvm_name = "sm_32",
196 .features = featureSet(&[_]Feature{197 .features = featureSet(&[_]Feature{
...@@ -198,14 +199,14 @@ pub const cpu = struct {...@@ -198,14 +199,14 @@ pub const cpu = struct {
198 .sm_32,199 .sm_32,
199 }),200 }),
200 };201 };
201 pub const sm_35 = Cpu{202 pub const sm_35 = CpuModel{
202 .name = "sm_35",203 .name = "sm_35",
203 .llvm_name = "sm_35",204 .llvm_name = "sm_35",
204 .features = featureSet(&[_]Feature{205 .features = featureSet(&[_]Feature{
205 .sm_35,206 .sm_35,
206 }),207 }),
207 };208 };
208 pub const sm_37 = Cpu{209 pub const sm_37 = CpuModel{
209 .name = "sm_37",210 .name = "sm_37",
210 .llvm_name = "sm_37",211 .llvm_name = "sm_37",
211 .features = featureSet(&[_]Feature{212 .features = featureSet(&[_]Feature{
...@@ -213,7 +214,7 @@ pub const cpu = struct {...@@ -213,7 +214,7 @@ pub const cpu = struct {
213 .sm_37,214 .sm_37,
214 }),215 }),
215 };216 };
216 pub const sm_50 = Cpu{217 pub const sm_50 = CpuModel{
217 .name = "sm_50",218 .name = "sm_50",
218 .llvm_name = "sm_50",219 .llvm_name = "sm_50",
219 .features = featureSet(&[_]Feature{220 .features = featureSet(&[_]Feature{
...@@ -221,7 +222,7 @@ pub const cpu = struct {...@@ -221,7 +222,7 @@ pub const cpu = struct {
221 .sm_50,222 .sm_50,
222 }),223 }),
223 };224 };
224 pub const sm_52 = Cpu{225 pub const sm_52 = CpuModel{
225 .name = "sm_52",226 .name = "sm_52",
226 .llvm_name = "sm_52",227 .llvm_name = "sm_52",
227 .features = featureSet(&[_]Feature{228 .features = featureSet(&[_]Feature{
...@@ -229,7 +230,7 @@ pub const cpu = struct {...@@ -229,7 +230,7 @@ pub const cpu = struct {
229 .sm_52,230 .sm_52,
230 }),231 }),
231 };232 };
232 pub const sm_53 = Cpu{233 pub const sm_53 = CpuModel{
233 .name = "sm_53",234 .name = "sm_53",
234 .llvm_name = "sm_53",235 .llvm_name = "sm_53",
235 .features = featureSet(&[_]Feature{236 .features = featureSet(&[_]Feature{
...@@ -237,7 +238,7 @@ pub const cpu = struct {...@@ -237,7 +238,7 @@ pub const cpu = struct {
237 .sm_53,238 .sm_53,
238 }),239 }),
239 };240 };
240 pub const sm_60 = Cpu{241 pub const sm_60 = CpuModel{
241 .name = "sm_60",242 .name = "sm_60",
242 .llvm_name = "sm_60",243 .llvm_name = "sm_60",
243 .features = featureSet(&[_]Feature{244 .features = featureSet(&[_]Feature{
...@@ -245,7 +246,7 @@ pub const cpu = struct {...@@ -245,7 +246,7 @@ pub const cpu = struct {
245 .sm_60,246 .sm_60,
246 }),247 }),
247 };248 };
248 pub const sm_61 = Cpu{249 pub const sm_61 = CpuModel{
249 .name = "sm_61",250 .name = "sm_61",
250 .llvm_name = "sm_61",251 .llvm_name = "sm_61",
251 .features = featureSet(&[_]Feature{252 .features = featureSet(&[_]Feature{
...@@ -253,7 +254,7 @@ pub const cpu = struct {...@@ -253,7 +254,7 @@ pub const cpu = struct {
253 .sm_61,254 .sm_61,
254 }),255 }),
255 };256 };
256 pub const sm_62 = Cpu{257 pub const sm_62 = CpuModel{
257 .name = "sm_62",258 .name = "sm_62",
258 .llvm_name = "sm_62",259 .llvm_name = "sm_62",
259 .features = featureSet(&[_]Feature{260 .features = featureSet(&[_]Feature{
...@@ -261,7 +262,7 @@ pub const cpu = struct {...@@ -261,7 +262,7 @@ pub const cpu = struct {
261 .sm_62,262 .sm_62,
262 }),263 }),
263 };264 };
264 pub const sm_70 = Cpu{265 pub const sm_70 = CpuModel{
265 .name = "sm_70",266 .name = "sm_70",
266 .llvm_name = "sm_70",267 .llvm_name = "sm_70",
267 .features = featureSet(&[_]Feature{268 .features = featureSet(&[_]Feature{
...@@ -269,7 +270,7 @@ pub const cpu = struct {...@@ -269,7 +270,7 @@ pub const cpu = struct {
269 .sm_70,270 .sm_70,
270 }),271 }),
271 };272 };
272 pub const sm_72 = Cpu{273 pub const sm_72 = CpuModel{
273 .name = "sm_72",274 .name = "sm_72",
274 .llvm_name = "sm_72",275 .llvm_name = "sm_72",
275 .features = featureSet(&[_]Feature{276 .features = featureSet(&[_]Feature{
...@@ -277,7 +278,7 @@ pub const cpu = struct {...@@ -277,7 +278,7 @@ pub const cpu = struct {
277 .sm_72,278 .sm_72,
278 }),279 }),
279 };280 };
280 pub const sm_75 = Cpu{281 pub const sm_75 = CpuModel{
281 .name = "sm_75",282 .name = "sm_75",
282 .llvm_name = "sm_75",283 .llvm_name = "sm_75",
283 .features = featureSet(&[_]Feature{284 .features = featureSet(&[_]Feature{
...@@ -290,7 +291,7 @@ pub const cpu = struct {...@@ -290,7 +291,7 @@ pub const cpu = struct {
290/// All nvptx CPUs, sorted alphabetically by name.291/// All nvptx CPUs, sorted alphabetically by name.
291/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1292/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
292/// compiler has inefficient memory and CPU usage, affecting build times.293/// compiler has inefficient memory and CPU usage, affecting build times.
293pub const all_cpus = &[_]*const Cpu{294pub const all_cpus = &[_]*const CpuModel{
294 &cpu.sm_20,295 &cpu.sm_20,
295 &cpu.sm_21,296 &cpu.sm_21,
296 &cpu.sm_30,297 &cpu.sm_30,
lib/std/target/powerpc.zig+43-42
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 @"64bit",6 @"64bit",
...@@ -55,12 +56,12 @@ pub const Feature = enum {...@@ -55,12 +56,12 @@ pub const Feature = enum {
55 vsx,56 vsx,
56};57};
5758
58pub usingnamespace Cpu.Feature.feature_set_fns(Feature);59pub usingnamespace CpuFeature.feature_set_fns(Feature);
5960
60pub const all_features = blk: {61pub const all_features = blk: {
61 const len = @typeInfo(Feature).Enum.fields.len;62 const len = @typeInfo(Feature).Enum.fields.len;
62 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);63 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
63 var result: [len]Cpu.Feature = undefined;64 var result: [len]CpuFeature = undefined;
64 result[@enumToInt(Feature.@"64bit")] = .{65 result[@enumToInt(Feature.@"64bit")] = .{
65 .llvm_name = "64bit",66 .llvm_name = "64bit",
66 .description = "Enable 64-bit instructions",67 .description = "Enable 64-bit instructions",
...@@ -377,7 +378,7 @@ pub const all_features = blk: {...@@ -377,7 +378,7 @@ pub const all_features = blk: {
377};378};
378379
379pub const cpu = struct {380pub const cpu = struct {
380 pub const @"440" = Cpu{381 pub const @"440" = CpuModel{
381 .name = "440",382 .name = "440",
382 .llvm_name = "440",383 .llvm_name = "440",
383 .features = featureSet(&[_]Feature{384 .features = featureSet(&[_]Feature{
...@@ -389,7 +390,7 @@ pub const cpu = struct {...@@ -389,7 +390,7 @@ pub const cpu = struct {
389 .msync,390 .msync,
390 }),391 }),
391 };392 };
392 pub const @"450" = Cpu{393 pub const @"450" = CpuModel{
393 .name = "450",394 .name = "450",
394 .llvm_name = "450",395 .llvm_name = "450",
395 .features = featureSet(&[_]Feature{396 .features = featureSet(&[_]Feature{
...@@ -401,21 +402,21 @@ pub const cpu = struct {...@@ -401,21 +402,21 @@ pub const cpu = struct {
401 .msync,402 .msync,
402 }),403 }),
403 };404 };
404 pub const @"601" = Cpu{405 pub const @"601" = CpuModel{
405 .name = "601",406 .name = "601",
406 .llvm_name = "601",407 .llvm_name = "601",
407 .features = featureSet(&[_]Feature{408 .features = featureSet(&[_]Feature{
408 .fpu,409 .fpu,
409 }),410 }),
410 };411 };
411 pub const @"602" = Cpu{412 pub const @"602" = CpuModel{
412 .name = "602",413 .name = "602",
413 .llvm_name = "602",414 .llvm_name = "602",
414 .features = featureSet(&[_]Feature{415 .features = featureSet(&[_]Feature{
415 .fpu,416 .fpu,
416 }),417 }),
417 };418 };
418 pub const @"603" = Cpu{419 pub const @"603" = CpuModel{
419 .name = "603",420 .name = "603",
420 .llvm_name = "603",421 .llvm_name = "603",
421 .features = featureSet(&[_]Feature{422 .features = featureSet(&[_]Feature{
...@@ -423,7 +424,7 @@ pub const cpu = struct {...@@ -423,7 +424,7 @@ pub const cpu = struct {
423 .frsqrte,424 .frsqrte,
424 }),425 }),
425 };426 };
426 pub const @"603e" = Cpu{427 pub const @"603e" = CpuModel{
427 .name = "603e",428 .name = "603e",
428 .llvm_name = "603e",429 .llvm_name = "603e",
429 .features = featureSet(&[_]Feature{430 .features = featureSet(&[_]Feature{
...@@ -431,7 +432,7 @@ pub const cpu = struct {...@@ -431,7 +432,7 @@ pub const cpu = struct {
431 .frsqrte,432 .frsqrte,
432 }),433 }),
433 };434 };
434 pub const @"603ev" = Cpu{435 pub const @"603ev" = CpuModel{
435 .name = "603ev",436 .name = "603ev",
436 .llvm_name = "603ev",437 .llvm_name = "603ev",
437 .features = featureSet(&[_]Feature{438 .features = featureSet(&[_]Feature{
...@@ -439,7 +440,7 @@ pub const cpu = struct {...@@ -439,7 +440,7 @@ pub const cpu = struct {
439 .frsqrte,440 .frsqrte,
440 }),441 }),
441 };442 };
442 pub const @"604" = Cpu{443 pub const @"604" = CpuModel{
443 .name = "604",444 .name = "604",
444 .llvm_name = "604",445 .llvm_name = "604",
445 .features = featureSet(&[_]Feature{446 .features = featureSet(&[_]Feature{
...@@ -447,7 +448,7 @@ pub const cpu = struct {...@@ -447,7 +448,7 @@ pub const cpu = struct {
447 .frsqrte,448 .frsqrte,
448 }),449 }),
449 };450 };
450 pub const @"604e" = Cpu{451 pub const @"604e" = CpuModel{
451 .name = "604e",452 .name = "604e",
452 .llvm_name = "604e",453 .llvm_name = "604e",
453 .features = featureSet(&[_]Feature{454 .features = featureSet(&[_]Feature{
...@@ -455,7 +456,7 @@ pub const cpu = struct {...@@ -455,7 +456,7 @@ pub const cpu = struct {
455 .frsqrte,456 .frsqrte,
456 }),457 }),
457 };458 };
458 pub const @"620" = Cpu{459 pub const @"620" = CpuModel{
459 .name = "620",460 .name = "620",
460 .llvm_name = "620",461 .llvm_name = "620",
461 .features = featureSet(&[_]Feature{462 .features = featureSet(&[_]Feature{
...@@ -463,7 +464,7 @@ pub const cpu = struct {...@@ -463,7 +464,7 @@ pub const cpu = struct {
463 .frsqrte,464 .frsqrte,
464 }),465 }),
465 };466 };
466 pub const @"7400" = Cpu{467 pub const @"7400" = CpuModel{
467 .name = "7400",468 .name = "7400",
468 .llvm_name = "7400",469 .llvm_name = "7400",
469 .features = featureSet(&[_]Feature{470 .features = featureSet(&[_]Feature{
...@@ -472,7 +473,7 @@ pub const cpu = struct {...@@ -472,7 +473,7 @@ pub const cpu = struct {
472 .frsqrte,473 .frsqrte,
473 }),474 }),
474 };475 };
475 pub const @"7450" = Cpu{476 pub const @"7450" = CpuModel{
476 .name = "7450",477 .name = "7450",
477 .llvm_name = "7450",478 .llvm_name = "7450",
478 .features = featureSet(&[_]Feature{479 .features = featureSet(&[_]Feature{
...@@ -481,7 +482,7 @@ pub const cpu = struct {...@@ -481,7 +482,7 @@ pub const cpu = struct {
481 .frsqrte,482 .frsqrte,
482 }),483 }),
483 };484 };
484 pub const @"750" = Cpu{485 pub const @"750" = CpuModel{
485 .name = "750",486 .name = "750",
486 .llvm_name = "750",487 .llvm_name = "750",
487 .features = featureSet(&[_]Feature{488 .features = featureSet(&[_]Feature{
...@@ -489,7 +490,7 @@ pub const cpu = struct {...@@ -489,7 +490,7 @@ pub const cpu = struct {
489 .frsqrte,490 .frsqrte,
490 }),491 }),
491 };492 };
492 pub const @"970" = Cpu{493 pub const @"970" = CpuModel{
493 .name = "970",494 .name = "970",
494 .llvm_name = "970",495 .llvm_name = "970",
495 .features = featureSet(&[_]Feature{496 .features = featureSet(&[_]Feature{
...@@ -502,7 +503,7 @@ pub const cpu = struct {...@@ -502,7 +503,7 @@ pub const cpu = struct {
502 .stfiwx,503 .stfiwx,
503 }),504 }),
504 };505 };
505 pub const a2 = Cpu{506 pub const a2 = CpuModel{
506 .name = "a2",507 .name = "a2",
507 .llvm_name = "a2",508 .llvm_name = "a2",
508 .features = featureSet(&[_]Feature{509 .features = featureSet(&[_]Feature{
...@@ -527,7 +528,7 @@ pub const cpu = struct {...@@ -527,7 +528,7 @@ pub const cpu = struct {
527 .stfiwx,528 .stfiwx,
528 }),529 }),
529 };530 };
530 pub const a2q = Cpu{531 pub const a2q = CpuModel{
531 .name = "a2q",532 .name = "a2q",
532 .llvm_name = "a2q",533 .llvm_name = "a2q",
533 .features = featureSet(&[_]Feature{534 .features = featureSet(&[_]Feature{
...@@ -553,7 +554,7 @@ pub const cpu = struct {...@@ -553,7 +554,7 @@ pub const cpu = struct {
553 .stfiwx,554 .stfiwx,
554 }),555 }),
555 };556 };
556 pub const e500 = Cpu{557 pub const e500 = CpuModel{
557 .name = "e500",558 .name = "e500",
558 .llvm_name = "e500",559 .llvm_name = "e500",
559 .features = featureSet(&[_]Feature{560 .features = featureSet(&[_]Feature{
...@@ -562,7 +563,7 @@ pub const cpu = struct {...@@ -562,7 +563,7 @@ pub const cpu = struct {
562 .isel,563 .isel,
563 }),564 }),
564 };565 };
565 pub const e500mc = Cpu{566 pub const e500mc = CpuModel{
566 .name = "e500mc",567 .name = "e500mc",
567 .llvm_name = "e500mc",568 .llvm_name = "e500mc",
568 .features = featureSet(&[_]Feature{569 .features = featureSet(&[_]Feature{
...@@ -572,7 +573,7 @@ pub const cpu = struct {...@@ -572,7 +573,7 @@ pub const cpu = struct {
572 .stfiwx,573 .stfiwx,
573 }),574 }),
574 };575 };
575 pub const e5500 = Cpu{576 pub const e5500 = CpuModel{
576 .name = "e5500",577 .name = "e5500",
577 .llvm_name = "e5500",578 .llvm_name = "e5500",
578 .features = featureSet(&[_]Feature{579 .features = featureSet(&[_]Feature{
...@@ -584,7 +585,7 @@ pub const cpu = struct {...@@ -584,7 +585,7 @@ pub const cpu = struct {
584 .stfiwx,585 .stfiwx,
585 }),586 }),
586 };587 };
587 pub const g3 = Cpu{588 pub const g3 = CpuModel{
588 .name = "g3",589 .name = "g3",
589 .llvm_name = "g3",590 .llvm_name = "g3",
590 .features = featureSet(&[_]Feature{591 .features = featureSet(&[_]Feature{
...@@ -592,7 +593,7 @@ pub const cpu = struct {...@@ -592,7 +593,7 @@ pub const cpu = struct {
592 .frsqrte,593 .frsqrte,
593 }),594 }),
594 };595 };
595 pub const g4 = Cpu{596 pub const g4 = CpuModel{
596 .name = "g4",597 .name = "g4",
597 .llvm_name = "g4",598 .llvm_name = "g4",
598 .features = featureSet(&[_]Feature{599 .features = featureSet(&[_]Feature{
...@@ -601,7 +602,7 @@ pub const cpu = struct {...@@ -601,7 +602,7 @@ pub const cpu = struct {
601 .frsqrte,602 .frsqrte,
602 }),603 }),
603 };604 };
604 pub const @"g4+" = Cpu{605 pub const @"g4+" = CpuModel{
605 .name = "g4+",606 .name = "g4+",
606 .llvm_name = "g4+",607 .llvm_name = "g4+",
607 .features = featureSet(&[_]Feature{608 .features = featureSet(&[_]Feature{
...@@ -610,7 +611,7 @@ pub const cpu = struct {...@@ -610,7 +611,7 @@ pub const cpu = struct {
610 .frsqrte,611 .frsqrte,
611 }),612 }),
612 };613 };
613 pub const g5 = Cpu{614 pub const g5 = CpuModel{
614 .name = "g5",615 .name = "g5",
615 .llvm_name = "g5",616 .llvm_name = "g5",
616 .features = featureSet(&[_]Feature{617 .features = featureSet(&[_]Feature{
...@@ -623,28 +624,28 @@ pub const cpu = struct {...@@ -623,28 +624,28 @@ pub const cpu = struct {
623 .stfiwx,624 .stfiwx,
624 }),625 }),
625 };626 };
626 pub const generic = Cpu{627 pub const generic = CpuModel{
627 .name = "generic",628 .name = "generic",
628 .llvm_name = "generic",629 .llvm_name = "generic",
629 .features = featureSet(&[_]Feature{630 .features = featureSet(&[_]Feature{
630 .hard_float,631 .hard_float,
631 }),632 }),
632 };633 };
633 pub const ppc = Cpu{634 pub const ppc = CpuModel{
634 .name = "ppc",635 .name = "ppc",
635 .llvm_name = "ppc",636 .llvm_name = "ppc",
636 .features = featureSet(&[_]Feature{637 .features = featureSet(&[_]Feature{
637 .hard_float,638 .hard_float,
638 }),639 }),
639 };640 };
640 pub const ppc32 = Cpu{641 pub const ppc32 = CpuModel{
641 .name = "ppc32",642 .name = "ppc32",
642 .llvm_name = "ppc32",643 .llvm_name = "ppc32",
643 .features = featureSet(&[_]Feature{644 .features = featureSet(&[_]Feature{
644 .hard_float,645 .hard_float,
645 }),646 }),
646 };647 };
647 pub const ppc64 = Cpu{648 pub const ppc64 = CpuModel{
648 .name = "ppc64",649 .name = "ppc64",
649 .llvm_name = "ppc64",650 .llvm_name = "ppc64",
650 .features = featureSet(&[_]Feature{651 .features = featureSet(&[_]Feature{
...@@ -657,7 +658,7 @@ pub const cpu = struct {...@@ -657,7 +658,7 @@ pub const cpu = struct {
657 .stfiwx,658 .stfiwx,
658 }),659 }),
659 };660 };
660 pub const ppc64le = Cpu{661 pub const ppc64le = CpuModel{
661 .name = "ppc64le",662 .name = "ppc64le",
662 .llvm_name = "ppc64le",663 .llvm_name = "ppc64le",
663 .features = featureSet(&[_]Feature{664 .features = featureSet(&[_]Feature{
...@@ -692,7 +693,7 @@ pub const cpu = struct {...@@ -692,7 +693,7 @@ pub const cpu = struct {
692 .vsx,693 .vsx,
693 }),694 }),
694 };695 };
695 pub const pwr3 = Cpu{696 pub const pwr3 = CpuModel{
696 .name = "pwr3",697 .name = "pwr3",
697 .llvm_name = "pwr3",698 .llvm_name = "pwr3",
698 .features = featureSet(&[_]Feature{699 .features = featureSet(&[_]Feature{
...@@ -704,7 +705,7 @@ pub const cpu = struct {...@@ -704,7 +705,7 @@ pub const cpu = struct {
704 .stfiwx,705 .stfiwx,
705 }),706 }),
706 };707 };
707 pub const pwr4 = Cpu{708 pub const pwr4 = CpuModel{
708 .name = "pwr4",709 .name = "pwr4",
709 .llvm_name = "pwr4",710 .llvm_name = "pwr4",
710 .features = featureSet(&[_]Feature{711 .features = featureSet(&[_]Feature{
...@@ -717,7 +718,7 @@ pub const cpu = struct {...@@ -717,7 +718,7 @@ pub const cpu = struct {
717 .stfiwx,718 .stfiwx,
718 }),719 }),
719 };720 };
720 pub const pwr5 = Cpu{721 pub const pwr5 = CpuModel{
721 .name = "pwr5",722 .name = "pwr5",
722 .llvm_name = "pwr5",723 .llvm_name = "pwr5",
723 .features = featureSet(&[_]Feature{724 .features = featureSet(&[_]Feature{
...@@ -732,7 +733,7 @@ pub const cpu = struct {...@@ -732,7 +733,7 @@ pub const cpu = struct {
732 .stfiwx,733 .stfiwx,
733 }),734 }),
734 };735 };
735 pub const pwr5x = Cpu{736 pub const pwr5x = CpuModel{
736 .name = "pwr5x",737 .name = "pwr5x",
737 .llvm_name = "pwr5x",738 .llvm_name = "pwr5x",
738 .features = featureSet(&[_]Feature{739 .features = featureSet(&[_]Feature{
...@@ -748,7 +749,7 @@ pub const cpu = struct {...@@ -748,7 +749,7 @@ pub const cpu = struct {
748 .stfiwx,749 .stfiwx,
749 }),750 }),
750 };751 };
751 pub const pwr6 = Cpu{752 pub const pwr6 = CpuModel{
752 .name = "pwr6",753 .name = "pwr6",
753 .llvm_name = "pwr6",754 .llvm_name = "pwr6",
754 .features = featureSet(&[_]Feature{755 .features = featureSet(&[_]Feature{
...@@ -768,7 +769,7 @@ pub const cpu = struct {...@@ -768,7 +769,7 @@ pub const cpu = struct {
768 .stfiwx,769 .stfiwx,
769 }),770 }),
770 };771 };
771 pub const pwr6x = Cpu{772 pub const pwr6x = CpuModel{
772 .name = "pwr6x",773 .name = "pwr6x",
773 .llvm_name = "pwr6x",774 .llvm_name = "pwr6x",
774 .features = featureSet(&[_]Feature{775 .features = featureSet(&[_]Feature{
...@@ -788,7 +789,7 @@ pub const cpu = struct {...@@ -788,7 +789,7 @@ pub const cpu = struct {
788 .stfiwx,789 .stfiwx,
789 }),790 }),
790 };791 };
791 pub const pwr7 = Cpu{792 pub const pwr7 = CpuModel{
792 .name = "pwr7",793 .name = "pwr7",
793 .llvm_name = "pwr7",794 .llvm_name = "pwr7",
794 .features = featureSet(&[_]Feature{795 .features = featureSet(&[_]Feature{
...@@ -816,7 +817,7 @@ pub const cpu = struct {...@@ -816,7 +817,7 @@ pub const cpu = struct {
816 .vsx,817 .vsx,
817 }),818 }),
818 };819 };
819 pub const pwr8 = Cpu{820 pub const pwr8 = CpuModel{
820 .name = "pwr8",821 .name = "pwr8",
821 .llvm_name = "pwr8",822 .llvm_name = "pwr8",
822 .features = featureSet(&[_]Feature{823 .features = featureSet(&[_]Feature{
...@@ -851,7 +852,7 @@ pub const cpu = struct {...@@ -851,7 +852,7 @@ pub const cpu = struct {
851 .vsx,852 .vsx,
852 }),853 }),
853 };854 };
854 pub const pwr9 = Cpu{855 pub const pwr9 = CpuModel{
855 .name = "pwr9",856 .name = "pwr9",
856 .llvm_name = "pwr9",857 .llvm_name = "pwr9",
857 .features = featureSet(&[_]Feature{858 .features = featureSet(&[_]Feature{
...@@ -897,7 +898,7 @@ pub const cpu = struct {...@@ -897,7 +898,7 @@ pub const cpu = struct {
897/// All powerpc CPUs, sorted alphabetically by name.898/// All powerpc CPUs, sorted alphabetically by name.
898/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1899/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
899/// compiler has inefficient memory and CPU usage, affecting build times.900/// compiler has inefficient memory and CPU usage, affecting build times.
900pub const all_cpus = &[_]*const Cpu{901pub const all_cpus = &[_]*const CpuModel{
901 &cpu.@"440",902 &cpu.@"440",
902 &cpu.@"450",903 &cpu.@"450",
903 &cpu.@"601",904 &cpu.@"601",
lib/std/target/riscv.zig+10-9
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 @"64bit",6 @"64bit",
...@@ -12,12 +13,12 @@ pub const Feature = enum {...@@ -12,12 +13,12 @@ pub const Feature = enum {
12 relax,13 relax,
13};14};
1415
15pub usingnamespace Cpu.Feature.feature_set_fns(Feature);16pub usingnamespace CpuFeature.feature_set_fns(Feature);
1617
17pub const all_features = blk: {18pub const all_features = blk: {
18 const len = @typeInfo(Feature).Enum.fields.len;19 const len = @typeInfo(Feature).Enum.fields.len;
19 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);20 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
20 var result: [len]Cpu.Feature = undefined;21 var result: [len]CpuFeature = undefined;
21 result[@enumToInt(Feature.@"64bit")] = .{22 result[@enumToInt(Feature.@"64bit")] = .{
22 .llvm_name = "64bit",23 .llvm_name = "64bit",
23 .description = "Implements RV64",24 .description = "Implements RV64",
...@@ -69,7 +70,7 @@ pub const all_features = blk: {...@@ -69,7 +70,7 @@ pub const all_features = blk: {
69};70};
7071
71pub const cpu = struct {72pub const cpu = struct {
72 pub const baseline_rv32 = Cpu{73 pub const baseline_rv32 = CpuModel{
73 .name = "baseline_rv32",74 .name = "baseline_rv32",
74 .llvm_name = "generic-rv32",75 .llvm_name = "generic-rv32",
75 .features = featureSet(&[_]Feature{76 .features = featureSet(&[_]Feature{
...@@ -81,7 +82,7 @@ pub const cpu = struct {...@@ -81,7 +82,7 @@ pub const cpu = struct {
81 }),82 }),
82 };83 };
8384
84 pub const baseline_rv64 = Cpu{85 pub const baseline_rv64 = CpuModel{
85 .name = "baseline_rv64",86 .name = "baseline_rv64",
86 .llvm_name = "generic-rv64",87 .llvm_name = "generic-rv64",
87 .features = featureSet(&[_]Feature{88 .features = featureSet(&[_]Feature{
...@@ -94,13 +95,13 @@ pub const cpu = struct {...@@ -94,13 +95,13 @@ pub const cpu = struct {
94 }),95 }),
95 };96 };
9697
97 pub const generic_rv32 = Cpu{98 pub const generic_rv32 = CpuModel{
98 .name = "generic_rv32",99 .name = "generic_rv32",
99 .llvm_name = "generic-rv32",100 .llvm_name = "generic-rv32",
100 .features = featureSet(&[_]Feature{}),101 .features = featureSet(&[_]Feature{}),
101 };102 };
102103
103 pub const generic_rv64 = Cpu{104 pub const generic_rv64 = CpuModel{
104 .name = "generic_rv64",105 .name = "generic_rv64",
105 .llvm_name = "generic-rv64",106 .llvm_name = "generic-rv64",
106 .features = featureSet(&[_]Feature{107 .features = featureSet(&[_]Feature{
...@@ -112,7 +113,7 @@ pub const cpu = struct {...@@ -112,7 +113,7 @@ pub const cpu = struct {
112/// All riscv CPUs, sorted alphabetically by name.113/// All riscv CPUs, sorted alphabetically by name.
113/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1114/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
114/// compiler has inefficient memory and CPU usage, affecting build times.115/// compiler has inefficient memory and CPU usage, affecting build times.
115pub const all_cpus = &[_]*const Cpu{116pub const all_cpus = &[_]*const CpuModel{
116 &cpu.baseline_rv32,117 &cpu.baseline_rv32,
117 &cpu.baseline_rv64,118 &cpu.baseline_rv64,
118 &cpu.generic_rv32,119 &cpu.generic_rv32,
lib/std/target/sparc.zig+46-45
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 deprecated_v8,6 deprecated_v8,
...@@ -23,12 +24,12 @@ pub const Feature = enum {...@@ -23,12 +24,12 @@ pub const Feature = enum {
23 vis3,24 vis3,
24};25};
2526
26pub usingnamespace Cpu.Feature.feature_set_fns(Feature);27pub usingnamespace CpuFeature.feature_set_fns(Feature);
2728
28pub const all_features = blk: {29pub const all_features = blk: {
29 const len = @typeInfo(Feature).Enum.fields.len;30 const len = @typeInfo(Feature).Enum.fields.len;
30 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);31 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
31 var result: [len]Cpu.Feature = undefined;32 var result: [len]CpuFeature = undefined;
32 result[@enumToInt(Feature.deprecated_v8)] = .{33 result[@enumToInt(Feature.deprecated_v8)] = .{
33 .llvm_name = "deprecated-v8",34 .llvm_name = "deprecated-v8",
34 .description = "Enable deprecated V8 instructions in V9 mode",35 .description = "Enable deprecated V8 instructions in V9 mode",
...@@ -133,7 +134,7 @@ pub const all_features = blk: {...@@ -133,7 +134,7 @@ pub const all_features = blk: {
133};134};
134135
135pub const cpu = struct {136pub const cpu = struct {
136 pub const at697e = Cpu{137 pub const at697e = CpuModel{
137 .name = "at697e",138 .name = "at697e",
138 .llvm_name = "at697e",139 .llvm_name = "at697e",
139 .features = featureSet(&[_]Feature{140 .features = featureSet(&[_]Feature{
...@@ -141,7 +142,7 @@ pub const cpu = struct {...@@ -141,7 +142,7 @@ pub const cpu = struct {
141 .leon,142 .leon,
142 }),143 }),
143 };144 };
144 pub const at697f = Cpu{145 pub const at697f = CpuModel{
145 .name = "at697f",146 .name = "at697f",
146 .llvm_name = "at697f",147 .llvm_name = "at697f",
147 .features = featureSet(&[_]Feature{148 .features = featureSet(&[_]Feature{
...@@ -149,17 +150,17 @@ pub const cpu = struct {...@@ -149,17 +150,17 @@ pub const cpu = struct {
149 .leon,150 .leon,
150 }),151 }),
151 };152 };
152 pub const f934 = Cpu{153 pub const f934 = CpuModel{
153 .name = "f934",154 .name = "f934",
154 .llvm_name = "f934",155 .llvm_name = "f934",
155 .features = featureSet(&[_]Feature{}),156 .features = featureSet(&[_]Feature{}),
156 };157 };
157 pub const generic = Cpu{158 pub const generic = CpuModel{
158 .name = "generic",159 .name = "generic",
159 .llvm_name = "generic",160 .llvm_name = "generic",
160 .features = featureSet(&[_]Feature{}),161 .features = featureSet(&[_]Feature{}),
161 };162 };
162 pub const gr712rc = Cpu{163 pub const gr712rc = CpuModel{
163 .name = "gr712rc",164 .name = "gr712rc",
164 .llvm_name = "gr712rc",165 .llvm_name = "gr712rc",
165 .features = featureSet(&[_]Feature{166 .features = featureSet(&[_]Feature{
...@@ -167,7 +168,7 @@ pub const cpu = struct {...@@ -167,7 +168,7 @@ pub const cpu = struct {
167 .leon,168 .leon,
168 }),169 }),
169 };170 };
170 pub const gr740 = Cpu{171 pub const gr740 = CpuModel{
171 .name = "gr740",172 .name = "gr740",
172 .llvm_name = "gr740",173 .llvm_name = "gr740",
173 .features = featureSet(&[_]Feature{174 .features = featureSet(&[_]Feature{
...@@ -178,19 +179,19 @@ pub const cpu = struct {...@@ -178,19 +179,19 @@ pub const cpu = struct {
178 .leonpwrpsr,179 .leonpwrpsr,
179 }),180 }),
180 };181 };
181 pub const hypersparc = Cpu{182 pub const hypersparc = CpuModel{
182 .name = "hypersparc",183 .name = "hypersparc",
183 .llvm_name = "hypersparc",184 .llvm_name = "hypersparc",
184 .features = featureSet(&[_]Feature{}),185 .features = featureSet(&[_]Feature{}),
185 };186 };
186 pub const leon2 = Cpu{187 pub const leon2 = CpuModel{
187 .name = "leon2",188 .name = "leon2",
188 .llvm_name = "leon2",189 .llvm_name = "leon2",
189 .features = featureSet(&[_]Feature{190 .features = featureSet(&[_]Feature{
190 .leon,191 .leon,
191 }),192 }),
192 };193 };
193 pub const leon3 = Cpu{194 pub const leon3 = CpuModel{
194 .name = "leon3",195 .name = "leon3",
195 .llvm_name = "leon3",196 .llvm_name = "leon3",
196 .features = featureSet(&[_]Feature{197 .features = featureSet(&[_]Feature{
...@@ -198,7 +199,7 @@ pub const cpu = struct {...@@ -198,7 +199,7 @@ pub const cpu = struct {
198 .leon,199 .leon,
199 }),200 }),
200 };201 };
201 pub const leon4 = Cpu{202 pub const leon4 = CpuModel{
202 .name = "leon4",203 .name = "leon4",
203 .llvm_name = "leon4",204 .llvm_name = "leon4",
204 .features = featureSet(&[_]Feature{205 .features = featureSet(&[_]Feature{
...@@ -207,7 +208,7 @@ pub const cpu = struct {...@@ -207,7 +208,7 @@ pub const cpu = struct {
207 .leon,208 .leon,
208 }),209 }),
209 };210 };
210 pub const ma2080 = Cpu{211 pub const ma2080 = CpuModel{
211 .name = "ma2080",212 .name = "ma2080",
212 .llvm_name = "ma2080",213 .llvm_name = "ma2080",
213 .features = featureSet(&[_]Feature{214 .features = featureSet(&[_]Feature{
...@@ -215,7 +216,7 @@ pub const cpu = struct {...@@ -215,7 +216,7 @@ pub const cpu = struct {
215 .leon,216 .leon,
216 }),217 }),
217 };218 };
218 pub const ma2085 = Cpu{219 pub const ma2085 = CpuModel{
219 .name = "ma2085",220 .name = "ma2085",
220 .llvm_name = "ma2085",221 .llvm_name = "ma2085",
221 .features = featureSet(&[_]Feature{222 .features = featureSet(&[_]Feature{
...@@ -223,7 +224,7 @@ pub const cpu = struct {...@@ -223,7 +224,7 @@ pub const cpu = struct {
223 .leon,224 .leon,
224 }),225 }),
225 };226 };
226 pub const ma2100 = Cpu{227 pub const ma2100 = CpuModel{
227 .name = "ma2100",228 .name = "ma2100",
228 .llvm_name = "ma2100",229 .llvm_name = "ma2100",
229 .features = featureSet(&[_]Feature{230 .features = featureSet(&[_]Feature{
...@@ -231,7 +232,7 @@ pub const cpu = struct {...@@ -231,7 +232,7 @@ pub const cpu = struct {
231 .leon,232 .leon,
232 }),233 }),
233 };234 };
234 pub const ma2150 = Cpu{235 pub const ma2150 = CpuModel{
235 .name = "ma2150",236 .name = "ma2150",
236 .llvm_name = "ma2150",237 .llvm_name = "ma2150",
237 .features = featureSet(&[_]Feature{238 .features = featureSet(&[_]Feature{
...@@ -239,7 +240,7 @@ pub const cpu = struct {...@@ -239,7 +240,7 @@ pub const cpu = struct {
239 .leon,240 .leon,
240 }),241 }),
241 };242 };
242 pub const ma2155 = Cpu{243 pub const ma2155 = CpuModel{
243 .name = "ma2155",244 .name = "ma2155",
244 .llvm_name = "ma2155",245 .llvm_name = "ma2155",
245 .features = featureSet(&[_]Feature{246 .features = featureSet(&[_]Feature{
...@@ -247,7 +248,7 @@ pub const cpu = struct {...@@ -247,7 +248,7 @@ pub const cpu = struct {
247 .leon,248 .leon,
248 }),249 }),
249 };250 };
250 pub const ma2450 = Cpu{251 pub const ma2450 = CpuModel{
251 .name = "ma2450",252 .name = "ma2450",
252 .llvm_name = "ma2450",253 .llvm_name = "ma2450",
253 .features = featureSet(&[_]Feature{254 .features = featureSet(&[_]Feature{
...@@ -255,7 +256,7 @@ pub const cpu = struct {...@@ -255,7 +256,7 @@ pub const cpu = struct {
255 .leon,256 .leon,
256 }),257 }),
257 };258 };
258 pub const ma2455 = Cpu{259 pub const ma2455 = CpuModel{
259 .name = "ma2455",260 .name = "ma2455",
260 .llvm_name = "ma2455",261 .llvm_name = "ma2455",
261 .features = featureSet(&[_]Feature{262 .features = featureSet(&[_]Feature{
...@@ -263,7 +264,7 @@ pub const cpu = struct {...@@ -263,7 +264,7 @@ pub const cpu = struct {
263 .leon,264 .leon,
264 }),265 }),
265 };266 };
266 pub const ma2480 = Cpu{267 pub const ma2480 = CpuModel{
267 .name = "ma2480",268 .name = "ma2480",
268 .llvm_name = "ma2480",269 .llvm_name = "ma2480",
269 .features = featureSet(&[_]Feature{270 .features = featureSet(&[_]Feature{
...@@ -271,7 +272,7 @@ pub const cpu = struct {...@@ -271,7 +272,7 @@ pub const cpu = struct {
271 .leon,272 .leon,
272 }),273 }),
273 };274 };
274 pub const ma2485 = Cpu{275 pub const ma2485 = CpuModel{
275 .name = "ma2485",276 .name = "ma2485",
276 .llvm_name = "ma2485",277 .llvm_name = "ma2485",
277 .features = featureSet(&[_]Feature{278 .features = featureSet(&[_]Feature{
...@@ -279,7 +280,7 @@ pub const cpu = struct {...@@ -279,7 +280,7 @@ pub const cpu = struct {
279 .leon,280 .leon,
280 }),281 }),
281 };282 };
282 pub const ma2x5x = Cpu{283 pub const ma2x5x = CpuModel{
283 .name = "ma2x5x",284 .name = "ma2x5x",
284 .llvm_name = "ma2x5x",285 .llvm_name = "ma2x5x",
285 .features = featureSet(&[_]Feature{286 .features = featureSet(&[_]Feature{
...@@ -287,7 +288,7 @@ pub const cpu = struct {...@@ -287,7 +288,7 @@ pub const cpu = struct {
287 .leon,288 .leon,
288 }),289 }),
289 };290 };
290 pub const ma2x8x = Cpu{291 pub const ma2x8x = CpuModel{
291 .name = "ma2x8x",292 .name = "ma2x8x",
292 .llvm_name = "ma2x8x",293 .llvm_name = "ma2x8x",
293 .features = featureSet(&[_]Feature{294 .features = featureSet(&[_]Feature{
...@@ -295,7 +296,7 @@ pub const cpu = struct {...@@ -295,7 +296,7 @@ pub const cpu = struct {
295 .leon,296 .leon,
296 }),297 }),
297 };298 };
298 pub const myriad2 = Cpu{299 pub const myriad2 = CpuModel{
299 .name = "myriad2",300 .name = "myriad2",
300 .llvm_name = "myriad2",301 .llvm_name = "myriad2",
301 .features = featureSet(&[_]Feature{302 .features = featureSet(&[_]Feature{
...@@ -303,7 +304,7 @@ pub const cpu = struct {...@@ -303,7 +304,7 @@ pub const cpu = struct {
303 .leon,304 .leon,
304 }),305 }),
305 };306 };
306 pub const myriad2_1 = Cpu{307 pub const myriad2_1 = CpuModel{
307 .name = "myriad2_1",308 .name = "myriad2_1",
308 .llvm_name = "myriad2.1",309 .llvm_name = "myriad2.1",
309 .features = featureSet(&[_]Feature{310 .features = featureSet(&[_]Feature{
...@@ -311,7 +312,7 @@ pub const cpu = struct {...@@ -311,7 +312,7 @@ pub const cpu = struct {
311 .leon,312 .leon,
312 }),313 }),
313 };314 };
314 pub const myriad2_2 = Cpu{315 pub const myriad2_2 = CpuModel{
315 .name = "myriad2_2",316 .name = "myriad2_2",
316 .llvm_name = "myriad2.2",317 .llvm_name = "myriad2.2",
317 .features = featureSet(&[_]Feature{318 .features = featureSet(&[_]Feature{
...@@ -319,7 +320,7 @@ pub const cpu = struct {...@@ -319,7 +320,7 @@ pub const cpu = struct {
319 .leon,320 .leon,
320 }),321 }),
321 };322 };
322 pub const myriad2_3 = Cpu{323 pub const myriad2_3 = CpuModel{
323 .name = "myriad2_3",324 .name = "myriad2_3",
324 .llvm_name = "myriad2.3",325 .llvm_name = "myriad2.3",
325 .features = featureSet(&[_]Feature{326 .features = featureSet(&[_]Feature{
...@@ -327,7 +328,7 @@ pub const cpu = struct {...@@ -327,7 +328,7 @@ pub const cpu = struct {
327 .leon,328 .leon,
328 }),329 }),
329 };330 };
330 pub const niagara = Cpu{331 pub const niagara = CpuModel{
331 .name = "niagara",332 .name = "niagara",
332 .llvm_name = "niagara",333 .llvm_name = "niagara",
333 .features = featureSet(&[_]Feature{334 .features = featureSet(&[_]Feature{
...@@ -337,7 +338,7 @@ pub const cpu = struct {...@@ -337,7 +338,7 @@ pub const cpu = struct {
337 .vis2,338 .vis2,
338 }),339 }),
339 };340 };
340 pub const niagara2 = Cpu{341 pub const niagara2 = CpuModel{
341 .name = "niagara2",342 .name = "niagara2",
342 .llvm_name = "niagara2",343 .llvm_name = "niagara2",
343 .features = featureSet(&[_]Feature{344 .features = featureSet(&[_]Feature{
...@@ -348,7 +349,7 @@ pub const cpu = struct {...@@ -348,7 +349,7 @@ pub const cpu = struct {
348 .vis2,349 .vis2,
349 }),350 }),
350 };351 };
351 pub const niagara3 = Cpu{352 pub const niagara3 = CpuModel{
352 .name = "niagara3",353 .name = "niagara3",
353 .llvm_name = "niagara3",354 .llvm_name = "niagara3",
354 .features = featureSet(&[_]Feature{355 .features = featureSet(&[_]Feature{
...@@ -359,7 +360,7 @@ pub const cpu = struct {...@@ -359,7 +360,7 @@ pub const cpu = struct {
359 .vis2,360 .vis2,
360 }),361 }),
361 };362 };
362 pub const niagara4 = Cpu{363 pub const niagara4 = CpuModel{
363 .name = "niagara4",364 .name = "niagara4",
364 .llvm_name = "niagara4",365 .llvm_name = "niagara4",
365 .features = featureSet(&[_]Feature{366 .features = featureSet(&[_]Feature{
...@@ -371,32 +372,32 @@ pub const cpu = struct {...@@ -371,32 +372,32 @@ pub const cpu = struct {
371 .vis3,372 .vis3,
372 }),373 }),
373 };374 };
374 pub const sparclet = Cpu{375 pub const sparclet = CpuModel{
375 .name = "sparclet",376 .name = "sparclet",
376 .llvm_name = "sparclet",377 .llvm_name = "sparclet",
377 .features = featureSet(&[_]Feature{}),378 .features = featureSet(&[_]Feature{}),
378 };379 };
379 pub const sparclite = Cpu{380 pub const sparclite = CpuModel{
380 .name = "sparclite",381 .name = "sparclite",
381 .llvm_name = "sparclite",382 .llvm_name = "sparclite",
382 .features = featureSet(&[_]Feature{}),383 .features = featureSet(&[_]Feature{}),
383 };384 };
384 pub const sparclite86x = Cpu{385 pub const sparclite86x = CpuModel{
385 .name = "sparclite86x",386 .name = "sparclite86x",
386 .llvm_name = "sparclite86x",387 .llvm_name = "sparclite86x",
387 .features = featureSet(&[_]Feature{}),388 .features = featureSet(&[_]Feature{}),
388 };389 };
389 pub const supersparc = Cpu{390 pub const supersparc = CpuModel{
390 .name = "supersparc",391 .name = "supersparc",
391 .llvm_name = "supersparc",392 .llvm_name = "supersparc",
392 .features = featureSet(&[_]Feature{}),393 .features = featureSet(&[_]Feature{}),
393 };394 };
394 pub const tsc701 = Cpu{395 pub const tsc701 = CpuModel{
395 .name = "tsc701",396 .name = "tsc701",
396 .llvm_name = "tsc701",397 .llvm_name = "tsc701",
397 .features = featureSet(&[_]Feature{}),398 .features = featureSet(&[_]Feature{}),
398 };399 };
399 pub const ultrasparc = Cpu{400 pub const ultrasparc = CpuModel{
400 .name = "ultrasparc",401 .name = "ultrasparc",
401 .llvm_name = "ultrasparc",402 .llvm_name = "ultrasparc",
402 .features = featureSet(&[_]Feature{403 .features = featureSet(&[_]Feature{
...@@ -405,7 +406,7 @@ pub const cpu = struct {...@@ -405,7 +406,7 @@ pub const cpu = struct {
405 .vis,406 .vis,
406 }),407 }),
407 };408 };
408 pub const ultrasparc3 = Cpu{409 pub const ultrasparc3 = CpuModel{
409 .name = "ultrasparc3",410 .name = "ultrasparc3",
410 .llvm_name = "ultrasparc3",411 .llvm_name = "ultrasparc3",
411 .features = featureSet(&[_]Feature{412 .features = featureSet(&[_]Feature{
...@@ -415,7 +416,7 @@ pub const cpu = struct {...@@ -415,7 +416,7 @@ pub const cpu = struct {
415 .vis2,416 .vis2,
416 }),417 }),
417 };418 };
418 pub const ut699 = Cpu{419 pub const ut699 = CpuModel{
419 .name = "ut699",420 .name = "ut699",
420 .llvm_name = "ut699",421 .llvm_name = "ut699",
421 .features = featureSet(&[_]Feature{422 .features = featureSet(&[_]Feature{
...@@ -426,7 +427,7 @@ pub const cpu = struct {...@@ -426,7 +427,7 @@ pub const cpu = struct {
426 .no_fsmuld,427 .no_fsmuld,
427 }),428 }),
428 };429 };
429 pub const v7 = Cpu{430 pub const v7 = CpuModel{
430 .name = "v7",431 .name = "v7",
431 .llvm_name = "v7",432 .llvm_name = "v7",
432 .features = featureSet(&[_]Feature{433 .features = featureSet(&[_]Feature{
...@@ -434,12 +435,12 @@ pub const cpu = struct {...@@ -434,12 +435,12 @@ pub const cpu = struct {
434 .soft_mul_div,435 .soft_mul_div,
435 }),436 }),
436 };437 };
437 pub const v8 = Cpu{438 pub const v8 = CpuModel{
438 .name = "v8",439 .name = "v8",
439 .llvm_name = "v8",440 .llvm_name = "v8",
440 .features = featureSet(&[_]Feature{}),441 .features = featureSet(&[_]Feature{}),
441 };442 };
442 pub const v9 = Cpu{443 pub const v9 = CpuModel{
443 .name = "v9",444 .name = "v9",
444 .llvm_name = "v9",445 .llvm_name = "v9",
445 .features = featureSet(&[_]Feature{446 .features = featureSet(&[_]Feature{
...@@ -451,7 +452,7 @@ pub const cpu = struct {...@@ -451,7 +452,7 @@ pub const cpu = struct {
451/// All sparc CPUs, sorted alphabetically by name.452/// All sparc CPUs, sorted alphabetically by name.
452/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1453/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
453/// compiler has inefficient memory and CPU usage, affecting build times.454/// compiler has inefficient memory and CPU usage, affecting build times.
454pub const all_cpus = &[_]*const Cpu{455pub const all_cpus = &[_]*const CpuModel{
455 &cpu.at697e,456 &cpu.at697e,
456 &cpu.at697f,457 &cpu.at697f,
457 &cpu.f934,458 &cpu.f934,
lib/std/target/systemz.zig+18-17
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 deflate_conversion,6 deflate_conversion,
...@@ -39,12 +40,12 @@ pub const Feature = enum {...@@ -39,12 +40,12 @@ pub const Feature = enum {
39 vector_packed_decimal_enhancement,40 vector_packed_decimal_enhancement,
40};41};
4142
42pub usingnamespace Cpu.Feature.feature_set_fns(Feature);43pub usingnamespace CpuFeature.feature_set_fns(Feature);
4344
44pub const all_features = blk: {45pub const all_features = blk: {
45 const len = @typeInfo(Feature).Enum.fields.len;46 const len = @typeInfo(Feature).Enum.fields.len;
46 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);47 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
47 var result: [len]Cpu.Feature = undefined;48 var result: [len]CpuFeature = undefined;
48 result[@enumToInt(Feature.deflate_conversion)] = .{49 result[@enumToInt(Feature.deflate_conversion)] = .{
49 .llvm_name = "deflate-conversion",50 .llvm_name = "deflate-conversion",
50 .description = "Assume that the deflate-conversion facility is installed",51 .description = "Assume that the deflate-conversion facility is installed",
...@@ -229,7 +230,7 @@ pub const all_features = blk: {...@@ -229,7 +230,7 @@ pub const all_features = blk: {
229};230};
230231
231pub const cpu = struct {232pub const cpu = struct {
232 pub const arch10 = Cpu{233 pub const arch10 = CpuModel{
233 .name = "arch10",234 .name = "arch10",
234 .llvm_name = "arch10",235 .llvm_name = "arch10",
235 .features = featureSet(&[_]Feature{236 .features = featureSet(&[_]Feature{
...@@ -252,7 +253,7 @@ pub const cpu = struct {...@@ -252,7 +253,7 @@ pub const cpu = struct {
252 .transactional_execution,253 .transactional_execution,
253 }),254 }),
254 };255 };
255 pub const arch11 = Cpu{256 pub const arch11 = CpuModel{
256 .name = "arch11",257 .name = "arch11",
257 .llvm_name = "arch11",258 .llvm_name = "arch11",
258 .features = featureSet(&[_]Feature{259 .features = featureSet(&[_]Feature{
...@@ -280,7 +281,7 @@ pub const cpu = struct {...@@ -280,7 +281,7 @@ pub const cpu = struct {
280 .vector,281 .vector,
281 }),282 }),
282 };283 };
283 pub const arch12 = Cpu{284 pub const arch12 = CpuModel{
284 .name = "arch12",285 .name = "arch12",
285 .llvm_name = "arch12",286 .llvm_name = "arch12",
286 .features = featureSet(&[_]Feature{287 .features = featureSet(&[_]Feature{
...@@ -315,7 +316,7 @@ pub const cpu = struct {...@@ -315,7 +316,7 @@ pub const cpu = struct {
315 .vector_packed_decimal,316 .vector_packed_decimal,
316 }),317 }),
317 };318 };
318 pub const arch13 = Cpu{319 pub const arch13 = CpuModel{
319 .name = "arch13",320 .name = "arch13",
320 .llvm_name = "arch13",321 .llvm_name = "arch13",
321 .features = featureSet(&[_]Feature{322 .features = featureSet(&[_]Feature{
...@@ -356,12 +357,12 @@ pub const cpu = struct {...@@ -356,12 +357,12 @@ pub const cpu = struct {
356 .vector_packed_decimal_enhancement,357 .vector_packed_decimal_enhancement,
357 }),358 }),
358 };359 };
359 pub const arch8 = Cpu{360 pub const arch8 = CpuModel{
360 .name = "arch8",361 .name = "arch8",
361 .llvm_name = "arch8",362 .llvm_name = "arch8",
362 .features = featureSet(&[_]Feature{}),363 .features = featureSet(&[_]Feature{}),
363 };364 };
364 pub const arch9 = Cpu{365 pub const arch9 = CpuModel{
365 .name = "arch9",366 .name = "arch9",
366 .llvm_name = "arch9",367 .llvm_name = "arch9",
367 .features = featureSet(&[_]Feature{368 .features = featureSet(&[_]Feature{
...@@ -377,17 +378,17 @@ pub const cpu = struct {...@@ -377,17 +378,17 @@ pub const cpu = struct {
377 .reset_reference_bits_multiple,378 .reset_reference_bits_multiple,
378 }),379 }),
379 };380 };
380 pub const generic = Cpu{381 pub const generic = CpuModel{
381 .name = "generic",382 .name = "generic",
382 .llvm_name = "generic",383 .llvm_name = "generic",
383 .features = featureSet(&[_]Feature{}),384 .features = featureSet(&[_]Feature{}),
384 };385 };
385 pub const z10 = Cpu{386 pub const z10 = CpuModel{
386 .name = "z10",387 .name = "z10",
387 .llvm_name = "z10",388 .llvm_name = "z10",
388 .features = featureSet(&[_]Feature{}),389 .features = featureSet(&[_]Feature{}),
389 };390 };
390 pub const z13 = Cpu{391 pub const z13 = CpuModel{
391 .name = "z13",392 .name = "z13",
392 .llvm_name = "z13",393 .llvm_name = "z13",
393 .features = featureSet(&[_]Feature{394 .features = featureSet(&[_]Feature{
...@@ -415,7 +416,7 @@ pub const cpu = struct {...@@ -415,7 +416,7 @@ pub const cpu = struct {
415 .vector,416 .vector,
416 }),417 }),
417 };418 };
418 pub const z14 = Cpu{419 pub const z14 = CpuModel{
419 .name = "z14",420 .name = "z14",
420 .llvm_name = "z14",421 .llvm_name = "z14",
421 .features = featureSet(&[_]Feature{422 .features = featureSet(&[_]Feature{
...@@ -450,7 +451,7 @@ pub const cpu = struct {...@@ -450,7 +451,7 @@ pub const cpu = struct {
450 .vector_packed_decimal,451 .vector_packed_decimal,
451 }),452 }),
452 };453 };
453 pub const z196 = Cpu{454 pub const z196 = CpuModel{
454 .name = "z196",455 .name = "z196",
455 .llvm_name = "z196",456 .llvm_name = "z196",
456 .features = featureSet(&[_]Feature{457 .features = featureSet(&[_]Feature{
...@@ -466,7 +467,7 @@ pub const cpu = struct {...@@ -466,7 +467,7 @@ pub const cpu = struct {
466 .reset_reference_bits_multiple,467 .reset_reference_bits_multiple,
467 }),468 }),
468 };469 };
469 pub const zEC12 = Cpu{470 pub const zEC12 = CpuModel{
470 .name = "zEC12",471 .name = "zEC12",
471 .llvm_name = "zEC12",472 .llvm_name = "zEC12",
472 .features = featureSet(&[_]Feature{473 .features = featureSet(&[_]Feature{
...@@ -494,7 +495,7 @@ pub const cpu = struct {...@@ -494,7 +495,7 @@ pub const cpu = struct {
494/// All systemz CPUs, sorted alphabetically by name.495/// All systemz CPUs, sorted alphabetically by name.
495/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1496/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
496/// compiler has inefficient memory and CPU usage, affecting build times.497/// compiler has inefficient memory and CPU usage, affecting build times.
497pub const all_cpus = &[_]*const Cpu{498pub const all_cpus = &[_]*const CpuModel{
498 &cpu.arch10,499 &cpu.arch10,
499 &cpu.arch11,500 &cpu.arch11,
500 &cpu.arch12,501 &cpu.arch12,
lib/std/target/wasm.zig+9-8
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 atomics,6 atomics,
...@@ -14,12 +15,12 @@ pub const Feature = enum {...@@ -14,12 +15,12 @@ pub const Feature = enum {
14 unimplemented_simd128,15 unimplemented_simd128,
15};16};
1617
17pub usingnamespace Cpu.Feature.feature_set_fns(Feature);18pub usingnamespace CpuFeature.feature_set_fns(Feature);
1819
19pub const all_features = blk: {20pub const all_features = blk: {
20 const len = @typeInfo(Feature).Enum.fields.len;21 const len = @typeInfo(Feature).Enum.fields.len;
21 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);22 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
22 var result: [len]Cpu.Feature = undefined;23 var result: [len]CpuFeature = undefined;
23 result[@enumToInt(Feature.atomics)] = .{24 result[@enumToInt(Feature.atomics)] = .{
24 .llvm_name = "atomics",25 .llvm_name = "atomics",
25 .description = "Enable Atomics",26 .description = "Enable Atomics",
...@@ -81,7 +82,7 @@ pub const all_features = blk: {...@@ -81,7 +82,7 @@ pub const all_features = blk: {
81};82};
8283
83pub const cpu = struct {84pub const cpu = struct {
84 pub const bleeding_edge = Cpu{85 pub const bleeding_edge = CpuModel{
85 .name = "bleeding_edge",86 .name = "bleeding_edge",
86 .llvm_name = "bleeding-edge",87 .llvm_name = "bleeding-edge",
87 .features = featureSet(&[_]Feature{88 .features = featureSet(&[_]Feature{
...@@ -92,12 +93,12 @@ pub const cpu = struct {...@@ -92,12 +93,12 @@ pub const cpu = struct {
92 .simd128,93 .simd128,
93 }),94 }),
94 };95 };
95 pub const generic = Cpu{96 pub const generic = CpuModel{
96 .name = "generic",97 .name = "generic",
97 .llvm_name = "generic",98 .llvm_name = "generic",
98 .features = featureSet(&[_]Feature{}),99 .features = featureSet(&[_]Feature{}),
99 };100 };
100 pub const mvp = Cpu{101 pub const mvp = CpuModel{
101 .name = "mvp",102 .name = "mvp",
102 .llvm_name = "mvp",103 .llvm_name = "mvp",
103 .features = featureSet(&[_]Feature{}),104 .features = featureSet(&[_]Feature{}),
...@@ -107,7 +108,7 @@ pub const cpu = struct {...@@ -107,7 +108,7 @@ pub const cpu = struct {
107/// All wasm CPUs, sorted alphabetically by name.108/// All wasm CPUs, sorted alphabetically by name.
108/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1109/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
109/// compiler has inefficient memory and CPU usage, affecting build times.110/// compiler has inefficient memory and CPU usage, affecting build times.
110pub const all_cpus = &[_]*const Cpu{111pub const all_cpus = &[_]*const CpuModel{
111 &cpu.bleeding_edge,112 &cpu.bleeding_edge,
112 &cpu.generic,113 &cpu.generic,
113 &cpu.mvp,114 &cpu.mvp,
lib/std/target/x86.zig+84-83
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const Cpu = std.Target.Cpu;2const CpuFeature = std.Target.Cpu.Feature;
3const CpuModel = std.Target.Cpu.Model;
34
4pub const Feature = enum {5pub const Feature = enum {
5 @"3dnow",6 @"3dnow",
...@@ -125,12 +126,12 @@ pub const Feature = enum {...@@ -125,12 +126,12 @@ pub const Feature = enum {
125 xsaves,126 xsaves,
126};127};
127128
128pub usingnamespace Cpu.Feature.feature_set_fns(Feature);129pub usingnamespace CpuFeature.feature_set_fns(Feature);
129130
130pub const all_features = blk: {131pub const all_features = blk: {
131 const len = @typeInfo(Feature).Enum.fields.len;132 const len = @typeInfo(Feature).Enum.fields.len;
132 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);133 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
133 var result: [len]Cpu.Feature = undefined;134 var result: [len]CpuFeature = undefined;
134 result[@enumToInt(Feature.@"3dnow")] = .{135 result[@enumToInt(Feature.@"3dnow")] = .{
135 .llvm_name = "3dnow",136 .llvm_name = "3dnow",
136 .description = "Enable 3DNow! instructions",137 .description = "Enable 3DNow! instructions",
...@@ -829,7 +830,7 @@ pub const all_features = blk: {...@@ -829,7 +830,7 @@ pub const all_features = blk: {
829};830};
830831
831pub const cpu = struct {832pub const cpu = struct {
832 pub const amdfam10 = Cpu{833 pub const amdfam10 = CpuModel{
833 .name = "amdfam10",834 .name = "amdfam10",
834 .llvm_name = "amdfam10",835 .llvm_name = "amdfam10",
835 .features = featureSet(&[_]Feature{836 .features = featureSet(&[_]Feature{
...@@ -849,7 +850,7 @@ pub const cpu = struct {...@@ -849,7 +850,7 @@ pub const cpu = struct {
849 .x87,850 .x87,
850 }),851 }),
851 };852 };
852 pub const athlon = Cpu{853 pub const athlon = CpuModel{
853 .name = "athlon",854 .name = "athlon",
854 .llvm_name = "athlon",855 .llvm_name = "athlon",
855 .features = featureSet(&[_]Feature{856 .features = featureSet(&[_]Feature{
...@@ -862,7 +863,7 @@ pub const cpu = struct {...@@ -862,7 +863,7 @@ pub const cpu = struct {
862 .x87,863 .x87,
863 }),864 }),
864 };865 };
865 pub const athlon_4 = Cpu{866 pub const athlon_4 = CpuModel{
866 .name = "athlon_4",867 .name = "athlon_4",
867 .llvm_name = "athlon-4",868 .llvm_name = "athlon-4",
868 .features = featureSet(&[_]Feature{869 .features = featureSet(&[_]Feature{
...@@ -877,7 +878,7 @@ pub const cpu = struct {...@@ -877,7 +878,7 @@ pub const cpu = struct {
877 .x87,878 .x87,
878 }),879 }),
879 };880 };
880 pub const athlon_fx = Cpu{881 pub const athlon_fx = CpuModel{
881 .name = "athlon_fx",882 .name = "athlon_fx",
882 .llvm_name = "athlon-fx",883 .llvm_name = "athlon-fx",
883 .features = featureSet(&[_]Feature{884 .features = featureSet(&[_]Feature{
...@@ -894,7 +895,7 @@ pub const cpu = struct {...@@ -894,7 +895,7 @@ pub const cpu = struct {
894 .x87,895 .x87,
895 }),896 }),
896 };897 };
897 pub const athlon_mp = Cpu{898 pub const athlon_mp = CpuModel{
898 .name = "athlon_mp",899 .name = "athlon_mp",
899 .llvm_name = "athlon-mp",900 .llvm_name = "athlon-mp",
900 .features = featureSet(&[_]Feature{901 .features = featureSet(&[_]Feature{
...@@ -909,7 +910,7 @@ pub const cpu = struct {...@@ -909,7 +910,7 @@ pub const cpu = struct {
909 .x87,910 .x87,
910 }),911 }),
911 };912 };
912 pub const athlon_tbird = Cpu{913 pub const athlon_tbird = CpuModel{
913 .name = "athlon_tbird",914 .name = "athlon_tbird",
914 .llvm_name = "athlon-tbird",915 .llvm_name = "athlon-tbird",
915 .features = featureSet(&[_]Feature{916 .features = featureSet(&[_]Feature{
...@@ -922,7 +923,7 @@ pub const cpu = struct {...@@ -922,7 +923,7 @@ pub const cpu = struct {
922 .x87,923 .x87,
923 }),924 }),
924 };925 };
925 pub const athlon_xp = Cpu{926 pub const athlon_xp = CpuModel{
926 .name = "athlon_xp",927 .name = "athlon_xp",
927 .llvm_name = "athlon-xp",928 .llvm_name = "athlon-xp",
928 .features = featureSet(&[_]Feature{929 .features = featureSet(&[_]Feature{
...@@ -937,7 +938,7 @@ pub const cpu = struct {...@@ -937,7 +938,7 @@ pub const cpu = struct {
937 .x87,938 .x87,
938 }),939 }),
939 };940 };
940 pub const athlon64 = Cpu{941 pub const athlon64 = CpuModel{
941 .name = "athlon64",942 .name = "athlon64",
942 .llvm_name = "athlon64",943 .llvm_name = "athlon64",
943 .features = featureSet(&[_]Feature{944 .features = featureSet(&[_]Feature{
...@@ -954,7 +955,7 @@ pub const cpu = struct {...@@ -954,7 +955,7 @@ pub const cpu = struct {
954 .x87,955 .x87,
955 }),956 }),
956 };957 };
957 pub const athlon64_sse3 = Cpu{958 pub const athlon64_sse3 = CpuModel{
958 .name = "athlon64_sse3",959 .name = "athlon64_sse3",
959 .llvm_name = "athlon64-sse3",960 .llvm_name = "athlon64-sse3",
960 .features = featureSet(&[_]Feature{961 .features = featureSet(&[_]Feature{
...@@ -972,7 +973,7 @@ pub const cpu = struct {...@@ -972,7 +973,7 @@ pub const cpu = struct {
972 .x87,973 .x87,
973 }),974 }),
974 };975 };
975 pub const atom = Cpu{976 pub const atom = CpuModel{
976 .name = "atom",977 .name = "atom",
977 .llvm_name = "atom",978 .llvm_name = "atom",
978 .features = featureSet(&[_]Feature{979 .features = featureSet(&[_]Feature{
...@@ -996,7 +997,7 @@ pub const cpu = struct {...@@ -996,7 +997,7 @@ pub const cpu = struct {
996 .x87,997 .x87,
997 }),998 }),
998 };999 };
999 pub const barcelona = Cpu{1000 pub const barcelona = CpuModel{
1000 .name = "barcelona",1001 .name = "barcelona",
1001 .llvm_name = "barcelona",1002 .llvm_name = "barcelona",
1002 .features = featureSet(&[_]Feature{1003 .features = featureSet(&[_]Feature{
...@@ -1016,7 +1017,7 @@ pub const cpu = struct {...@@ -1016,7 +1017,7 @@ pub const cpu = struct {
1016 .x87,1017 .x87,
1017 }),1018 }),
1018 };1019 };
1019 pub const bdver1 = Cpu{1020 pub const bdver1 = CpuModel{
1020 .name = "bdver1",1021 .name = "bdver1",
1021 .llvm_name = "bdver1",1022 .llvm_name = "bdver1",
1022 .features = featureSet(&[_]Feature{1023 .features = featureSet(&[_]Feature{
...@@ -1043,7 +1044,7 @@ pub const cpu = struct {...@@ -1043,7 +1044,7 @@ pub const cpu = struct {
1043 .xsave,1044 .xsave,
1044 }),1045 }),
1045 };1046 };
1046 pub const bdver2 = Cpu{1047 pub const bdver2 = CpuModel{
1047 .name = "bdver2",1048 .name = "bdver2",
1048 .llvm_name = "bdver2",1049 .llvm_name = "bdver2",
1049 .features = featureSet(&[_]Feature{1050 .features = featureSet(&[_]Feature{
...@@ -1075,7 +1076,7 @@ pub const cpu = struct {...@@ -1075,7 +1076,7 @@ pub const cpu = struct {
1075 .xsave,1076 .xsave,
1076 }),1077 }),
1077 };1078 };
1078 pub const bdver3 = Cpu{1079 pub const bdver3 = CpuModel{
1079 .name = "bdver3",1080 .name = "bdver3",
1080 .llvm_name = "bdver3",1081 .llvm_name = "bdver3",
1081 .features = featureSet(&[_]Feature{1082 .features = featureSet(&[_]Feature{
...@@ -1109,7 +1110,7 @@ pub const cpu = struct {...@@ -1109,7 +1110,7 @@ pub const cpu = struct {
1109 .xsaveopt,1110 .xsaveopt,
1110 }),1111 }),
1111 };1112 };
1112 pub const bdver4 = Cpu{1113 pub const bdver4 = CpuModel{
1113 .name = "bdver4",1114 .name = "bdver4",
1114 .llvm_name = "bdver4",1115 .llvm_name = "bdver4",
1115 .features = featureSet(&[_]Feature{1116 .features = featureSet(&[_]Feature{
...@@ -1146,7 +1147,7 @@ pub const cpu = struct {...@@ -1146,7 +1147,7 @@ pub const cpu = struct {
1146 .xsaveopt,1147 .xsaveopt,
1147 }),1148 }),
1148 };1149 };
1149 pub const bonnell = Cpu{1150 pub const bonnell = CpuModel{
1150 .name = "bonnell",1151 .name = "bonnell",
1151 .llvm_name = "bonnell",1152 .llvm_name = "bonnell",
1152 .features = featureSet(&[_]Feature{1153 .features = featureSet(&[_]Feature{
...@@ -1170,7 +1171,7 @@ pub const cpu = struct {...@@ -1170,7 +1171,7 @@ pub const cpu = struct {
1170 .x87,1171 .x87,
1171 }),1172 }),
1172 };1173 };
1173 pub const broadwell = Cpu{1174 pub const broadwell = CpuModel{
1174 .name = "broadwell",1175 .name = "broadwell",
1175 .llvm_name = "broadwell",1176 .llvm_name = "broadwell",
1176 .features = featureSet(&[_]Feature{1177 .features = featureSet(&[_]Feature{
...@@ -1214,7 +1215,7 @@ pub const cpu = struct {...@@ -1214,7 +1215,7 @@ pub const cpu = struct {
1214 .xsaveopt,1215 .xsaveopt,
1215 }),1216 }),
1216 };1217 };
1217 pub const btver1 = Cpu{1218 pub const btver1 = CpuModel{
1218 .name = "btver1",1219 .name = "btver1",
1219 .llvm_name = "btver1",1220 .llvm_name = "btver1",
1220 .features = featureSet(&[_]Feature{1221 .features = featureSet(&[_]Feature{
...@@ -1238,7 +1239,7 @@ pub const cpu = struct {...@@ -1238,7 +1239,7 @@ pub const cpu = struct {
1238 .x87,1239 .x87,
1239 }),1240 }),
1240 };1241 };
1241 pub const btver2 = Cpu{1242 pub const btver2 = CpuModel{
1242 .name = "btver2",1243 .name = "btver2",
1243 .llvm_name = "btver2",1244 .llvm_name = "btver2",
1244 .features = featureSet(&[_]Feature{1245 .features = featureSet(&[_]Feature{
...@@ -1274,7 +1275,7 @@ pub const cpu = struct {...@@ -1274,7 +1275,7 @@ pub const cpu = struct {
1274 .xsaveopt,1275 .xsaveopt,
1275 }),1276 }),
1276 };1277 };
1277 pub const c3 = Cpu{1278 pub const c3 = CpuModel{
1278 .name = "c3",1279 .name = "c3",
1279 .llvm_name = "c3",1280 .llvm_name = "c3",
1280 .features = featureSet(&[_]Feature{1281 .features = featureSet(&[_]Feature{
...@@ -1283,7 +1284,7 @@ pub const cpu = struct {...@@ -1283,7 +1284,7 @@ pub const cpu = struct {
1283 .x87,1284 .x87,
1284 }),1285 }),
1285 };1286 };
1286 pub const c3_2 = Cpu{1287 pub const c3_2 = CpuModel{
1287 .name = "c3_2",1288 .name = "c3_2",
1288 .llvm_name = "c3-2",1289 .llvm_name = "c3-2",
1289 .features = featureSet(&[_]Feature{1290 .features = featureSet(&[_]Feature{
...@@ -1296,7 +1297,7 @@ pub const cpu = struct {...@@ -1296,7 +1297,7 @@ pub const cpu = struct {
1296 .x87,1297 .x87,
1297 }),1298 }),
1298 };1299 };
1299 pub const cannonlake = Cpu{1300 pub const cannonlake = CpuModel{
1300 .name = "cannonlake",1301 .name = "cannonlake",
1301 .llvm_name = "cannonlake",1302 .llvm_name = "cannonlake",
1302 .features = featureSet(&[_]Feature{1303 .features = featureSet(&[_]Feature{
...@@ -1355,7 +1356,7 @@ pub const cpu = struct {...@@ -1355,7 +1356,7 @@ pub const cpu = struct {
1355 .xsaves,1356 .xsaves,
1356 }),1357 }),
1357 };1358 };
1358 pub const cascadelake = Cpu{1359 pub const cascadelake = CpuModel{
1359 .name = "cascadelake",1360 .name = "cascadelake",
1360 .llvm_name = "cascadelake",1361 .llvm_name = "cascadelake",
1361 .features = featureSet(&[_]Feature{1362 .features = featureSet(&[_]Feature{
...@@ -1413,7 +1414,7 @@ pub const cpu = struct {...@@ -1413,7 +1414,7 @@ pub const cpu = struct {
1413 .xsaves,1414 .xsaves,
1414 }),1415 }),
1415 };1416 };
1416 pub const cooperlake = Cpu{1417 pub const cooperlake = CpuModel{
1417 .name = "cooperlake",1418 .name = "cooperlake",
1418 .llvm_name = "cooperlake",1419 .llvm_name = "cooperlake",
1419 .features = featureSet(&[_]Feature{1420 .features = featureSet(&[_]Feature{
...@@ -1472,7 +1473,7 @@ pub const cpu = struct {...@@ -1472,7 +1473,7 @@ pub const cpu = struct {
1472 .xsaves,1473 .xsaves,
1473 }),1474 }),
1474 };1475 };
1475 pub const core_avx_i = Cpu{1476 pub const core_avx_i = CpuModel{
1476 .name = "core_avx_i",1477 .name = "core_avx_i",
1477 .llvm_name = "core-avx-i",1478 .llvm_name = "core-avx-i",
1478 .features = featureSet(&[_]Feature{1479 .features = featureSet(&[_]Feature{
...@@ -1504,7 +1505,7 @@ pub const cpu = struct {...@@ -1504,7 +1505,7 @@ pub const cpu = struct {
1504 .xsaveopt,1505 .xsaveopt,
1505 }),1506 }),
1506 };1507 };
1507 pub const core_avx2 = Cpu{1508 pub const core_avx2 = CpuModel{
1508 .name = "core_avx2",1509 .name = "core_avx2",
1509 .llvm_name = "core-avx2",1510 .llvm_name = "core-avx2",
1510 .features = featureSet(&[_]Feature{1511 .features = featureSet(&[_]Feature{
...@@ -1545,7 +1546,7 @@ pub const cpu = struct {...@@ -1545,7 +1546,7 @@ pub const cpu = struct {
1545 .xsaveopt,1546 .xsaveopt,
1546 }),1547 }),
1547 };1548 };
1548 pub const core2 = Cpu{1549 pub const core2 = CpuModel{
1549 .name = "core2",1550 .name = "core2",
1550 .llvm_name = "core2",1551 .llvm_name = "core2",
1551 .features = featureSet(&[_]Feature{1552 .features = featureSet(&[_]Feature{
...@@ -1563,7 +1564,7 @@ pub const cpu = struct {...@@ -1563,7 +1564,7 @@ pub const cpu = struct {
1563 .x87,1564 .x87,
1564 }),1565 }),
1565 };1566 };
1566 pub const corei7 = Cpu{1567 pub const corei7 = CpuModel{
1567 .name = "corei7",1568 .name = "corei7",
1568 .llvm_name = "corei7",1569 .llvm_name = "corei7",
1569 .features = featureSet(&[_]Feature{1570 .features = featureSet(&[_]Feature{
...@@ -1581,7 +1582,7 @@ pub const cpu = struct {...@@ -1581,7 +1582,7 @@ pub const cpu = struct {
1581 .x87,1582 .x87,
1582 }),1583 }),
1583 };1584 };
1584 pub const corei7_avx = Cpu{1585 pub const corei7_avx = CpuModel{
1585 .name = "corei7_avx",1586 .name = "corei7_avx",
1586 .llvm_name = "corei7-avx",1587 .llvm_name = "corei7-avx",
1587 .features = featureSet(&[_]Feature{1588 .features = featureSet(&[_]Feature{
...@@ -1610,7 +1611,7 @@ pub const cpu = struct {...@@ -1610,7 +1611,7 @@ pub const cpu = struct {
1610 .xsaveopt,1611 .xsaveopt,
1611 }),1612 }),
1612 };1613 };
1613 pub const generic = Cpu{1614 pub const generic = CpuModel{
1614 .name = "generic",1615 .name = "generic",
1615 .llvm_name = "generic",1616 .llvm_name = "generic",
1616 .features = featureSet(&[_]Feature{1617 .features = featureSet(&[_]Feature{
...@@ -1619,7 +1620,7 @@ pub const cpu = struct {...@@ -1619,7 +1620,7 @@ pub const cpu = struct {
1619 .x87,1620 .x87,
1620 }),1621 }),
1621 };1622 };
1622 pub const geode = Cpu{1623 pub const geode = CpuModel{
1623 .name = "geode",1624 .name = "geode",
1624 .llvm_name = "geode",1625 .llvm_name = "geode",
1625 .features = featureSet(&[_]Feature{1626 .features = featureSet(&[_]Feature{
...@@ -1629,7 +1630,7 @@ pub const cpu = struct {...@@ -1629,7 +1630,7 @@ pub const cpu = struct {
1629 .x87,1630 .x87,
1630 }),1631 }),
1631 };1632 };
1632 pub const goldmont = Cpu{1633 pub const goldmont = CpuModel{
1633 .name = "goldmont",1634 .name = "goldmont",
1634 .llvm_name = "goldmont",1635 .llvm_name = "goldmont",
1635 .features = featureSet(&[_]Feature{1636 .features = featureSet(&[_]Feature{
...@@ -1665,7 +1666,7 @@ pub const cpu = struct {...@@ -1665,7 +1666,7 @@ pub const cpu = struct {
1665 .xsaves,1666 .xsaves,
1666 }),1667 }),
1667 };1668 };
1668 pub const goldmont_plus = Cpu{1669 pub const goldmont_plus = CpuModel{
1669 .name = "goldmont_plus",1670 .name = "goldmont_plus",
1670 .llvm_name = "goldmont-plus",1671 .llvm_name = "goldmont-plus",
1671 .features = featureSet(&[_]Feature{1672 .features = featureSet(&[_]Feature{
...@@ -1703,7 +1704,7 @@ pub const cpu = struct {...@@ -1703,7 +1704,7 @@ pub const cpu = struct {
1703 .xsaves,1704 .xsaves,
1704 }),1705 }),
1705 };1706 };
1706 pub const haswell = Cpu{1707 pub const haswell = CpuModel{
1707 .name = "haswell",1708 .name = "haswell",
1708 .llvm_name = "haswell",1709 .llvm_name = "haswell",
1709 .features = featureSet(&[_]Feature{1710 .features = featureSet(&[_]Feature{
...@@ -1744,7 +1745,7 @@ pub const cpu = struct {...@@ -1744,7 +1745,7 @@ pub const cpu = struct {
1744 .xsaveopt,1745 .xsaveopt,
1745 }),1746 }),
1746 };1747 };
1747 pub const _i386 = Cpu{1748 pub const _i386 = CpuModel{
1748 .name = "_i386",1749 .name = "_i386",
1749 .llvm_name = "i386",1750 .llvm_name = "i386",
1750 .features = featureSet(&[_]Feature{1751 .features = featureSet(&[_]Feature{
...@@ -1752,7 +1753,7 @@ pub const cpu = struct {...@@ -1752,7 +1753,7 @@ pub const cpu = struct {
1752 .x87,1753 .x87,
1753 }),1754 }),
1754 };1755 };
1755 pub const _i486 = Cpu{1756 pub const _i486 = CpuModel{
1756 .name = "_i486",1757 .name = "_i486",
1757 .llvm_name = "i486",1758 .llvm_name = "i486",
1758 .features = featureSet(&[_]Feature{1759 .features = featureSet(&[_]Feature{
...@@ -1760,7 +1761,7 @@ pub const cpu = struct {...@@ -1760,7 +1761,7 @@ pub const cpu = struct {
1760 .x87,1761 .x87,
1761 }),1762 }),
1762 };1763 };
1763 pub const _i586 = Cpu{1764 pub const _i586 = CpuModel{
1764 .name = "_i586",1765 .name = "_i586",
1765 .llvm_name = "i586",1766 .llvm_name = "i586",
1766 .features = featureSet(&[_]Feature{1767 .features = featureSet(&[_]Feature{
...@@ -1769,7 +1770,7 @@ pub const cpu = struct {...@@ -1769,7 +1770,7 @@ pub const cpu = struct {
1769 .x87,1770 .x87,
1770 }),1771 }),
1771 };1772 };
1772 pub const _i686 = Cpu{1773 pub const _i686 = CpuModel{
1773 .name = "_i686",1774 .name = "_i686",
1774 .llvm_name = "i686",1775 .llvm_name = "i686",
1775 .features = featureSet(&[_]Feature{1776 .features = featureSet(&[_]Feature{
...@@ -1779,7 +1780,7 @@ pub const cpu = struct {...@@ -1779,7 +1780,7 @@ pub const cpu = struct {
1779 .x87,1780 .x87,
1780 }),1781 }),
1781 };1782 };
1782 pub const icelake_client = Cpu{1783 pub const icelake_client = CpuModel{
1783 .name = "icelake_client",1784 .name = "icelake_client",
1784 .llvm_name = "icelake-client",1785 .llvm_name = "icelake-client",
1785 .features = featureSet(&[_]Feature{1786 .features = featureSet(&[_]Feature{
...@@ -1847,7 +1848,7 @@ pub const cpu = struct {...@@ -1847,7 +1848,7 @@ pub const cpu = struct {
1847 .xsaves,1848 .xsaves,
1848 }),1849 }),
1849 };1850 };
1850 pub const icelake_server = Cpu{1851 pub const icelake_server = CpuModel{
1851 .name = "icelake_server",1852 .name = "icelake_server",
1852 .llvm_name = "icelake-server",1853 .llvm_name = "icelake-server",
1853 .features = featureSet(&[_]Feature{1854 .features = featureSet(&[_]Feature{
...@@ -1917,7 +1918,7 @@ pub const cpu = struct {...@@ -1917,7 +1918,7 @@ pub const cpu = struct {
1917 .xsaves,1918 .xsaves,
1918 }),1919 }),
1919 };1920 };
1920 pub const ivybridge = Cpu{1921 pub const ivybridge = CpuModel{
1921 .name = "ivybridge",1922 .name = "ivybridge",
1922 .llvm_name = "ivybridge",1923 .llvm_name = "ivybridge",
1923 .features = featureSet(&[_]Feature{1924 .features = featureSet(&[_]Feature{
...@@ -1949,7 +1950,7 @@ pub const cpu = struct {...@@ -1949,7 +1950,7 @@ pub const cpu = struct {
1949 .xsaveopt,1950 .xsaveopt,
1950 }),1951 }),
1951 };1952 };
1952 pub const k6 = Cpu{1953 pub const k6 = CpuModel{
1953 .name = "k6",1954 .name = "k6",
1954 .llvm_name = "k6",1955 .llvm_name = "k6",
1955 .features = featureSet(&[_]Feature{1956 .features = featureSet(&[_]Feature{
...@@ -1959,7 +1960,7 @@ pub const cpu = struct {...@@ -1959,7 +1960,7 @@ pub const cpu = struct {
1959 .x87,1960 .x87,
1960 }),1961 }),
1961 };1962 };
1962 pub const k6_2 = Cpu{1963 pub const k6_2 = CpuModel{
1963 .name = "k6_2",1964 .name = "k6_2",
1964 .llvm_name = "k6-2",1965 .llvm_name = "k6-2",
1965 .features = featureSet(&[_]Feature{1966 .features = featureSet(&[_]Feature{
...@@ -1969,7 +1970,7 @@ pub const cpu = struct {...@@ -1969,7 +1970,7 @@ pub const cpu = struct {
1969 .x87,1970 .x87,
1970 }),1971 }),
1971 };1972 };
1972 pub const k6_3 = Cpu{1973 pub const k6_3 = CpuModel{
1973 .name = "k6_3",1974 .name = "k6_3",
1974 .llvm_name = "k6-3",1975 .llvm_name = "k6-3",
1975 .features = featureSet(&[_]Feature{1976 .features = featureSet(&[_]Feature{
...@@ -1979,7 +1980,7 @@ pub const cpu = struct {...@@ -1979,7 +1980,7 @@ pub const cpu = struct {
1979 .x87,1980 .x87,
1980 }),1981 }),
1981 };1982 };
1982 pub const k8 = Cpu{1983 pub const k8 = CpuModel{
1983 .name = "k8",1984 .name = "k8",
1984 .llvm_name = "k8",1985 .llvm_name = "k8",
1985 .features = featureSet(&[_]Feature{1986 .features = featureSet(&[_]Feature{
...@@ -1996,7 +1997,7 @@ pub const cpu = struct {...@@ -1996,7 +1997,7 @@ pub const cpu = struct {
1996 .x87,1997 .x87,
1997 }),1998 }),
1998 };1999 };
1999 pub const k8_sse3 = Cpu{2000 pub const k8_sse3 = CpuModel{
2000 .name = "k8_sse3",2001 .name = "k8_sse3",
2001 .llvm_name = "k8-sse3",2002 .llvm_name = "k8-sse3",
2002 .features = featureSet(&[_]Feature{2003 .features = featureSet(&[_]Feature{
...@@ -2014,7 +2015,7 @@ pub const cpu = struct {...@@ -2014,7 +2015,7 @@ pub const cpu = struct {
2014 .x87,2015 .x87,
2015 }),2016 }),
2016 };2017 };
2017 pub const knl = Cpu{2018 pub const knl = CpuModel{
2018 .name = "knl",2019 .name = "knl",
2019 .llvm_name = "knl",2020 .llvm_name = "knl",
2020 .features = featureSet(&[_]Feature{2021 .features = featureSet(&[_]Feature{
...@@ -2057,7 +2058,7 @@ pub const cpu = struct {...@@ -2057,7 +2058,7 @@ pub const cpu = struct {
2057 .xsaveopt,2058 .xsaveopt,
2058 }),2059 }),
2059 };2060 };
2060 pub const knm = Cpu{2061 pub const knm = CpuModel{
2061 .name = "knm",2062 .name = "knm",
2062 .llvm_name = "knm",2063 .llvm_name = "knm",
2063 .features = featureSet(&[_]Feature{2064 .features = featureSet(&[_]Feature{
...@@ -2101,12 +2102,12 @@ pub const cpu = struct {...@@ -2101,12 +2102,12 @@ pub const cpu = struct {
2101 .xsaveopt,2102 .xsaveopt,
2102 }),2103 }),
2103 };2104 };
2104 pub const lakemont = Cpu{2105 pub const lakemont = CpuModel{
2105 .name = "lakemont",2106 .name = "lakemont",
2106 .llvm_name = "lakemont",2107 .llvm_name = "lakemont",
2107 .features = featureSet(&[_]Feature{}),2108 .features = featureSet(&[_]Feature{}),
2108 };2109 };
2109 pub const nehalem = Cpu{2110 pub const nehalem = CpuModel{
2110 .name = "nehalem",2111 .name = "nehalem",
2111 .llvm_name = "nehalem",2112 .llvm_name = "nehalem",
2112 .features = featureSet(&[_]Feature{2113 .features = featureSet(&[_]Feature{
...@@ -2124,7 +2125,7 @@ pub const cpu = struct {...@@ -2124,7 +2125,7 @@ pub const cpu = struct {
2124 .x87,2125 .x87,
2125 }),2126 }),
2126 };2127 };
2127 pub const nocona = Cpu{2128 pub const nocona = CpuModel{
2128 .name = "nocona",2129 .name = "nocona",
2129 .llvm_name = "nocona",2130 .llvm_name = "nocona",
2130 .features = featureSet(&[_]Feature{2131 .features = featureSet(&[_]Feature{
...@@ -2140,7 +2141,7 @@ pub const cpu = struct {...@@ -2140,7 +2141,7 @@ pub const cpu = struct {
2140 .x87,2141 .x87,
2141 }),2142 }),
2142 };2143 };
2143 pub const opteron = Cpu{2144 pub const opteron = CpuModel{
2144 .name = "opteron",2145 .name = "opteron",
2145 .llvm_name = "opteron",2146 .llvm_name = "opteron",
2146 .features = featureSet(&[_]Feature{2147 .features = featureSet(&[_]Feature{
...@@ -2157,7 +2158,7 @@ pub const cpu = struct {...@@ -2157,7 +2158,7 @@ pub const cpu = struct {
2157 .x87,2158 .x87,
2158 }),2159 }),
2159 };2160 };
2160 pub const opteron_sse3 = Cpu{2161 pub const opteron_sse3 = CpuModel{
2161 .name = "opteron_sse3",2162 .name = "opteron_sse3",
2162 .llvm_name = "opteron-sse3",2163 .llvm_name = "opteron-sse3",
2163 .features = featureSet(&[_]Feature{2164 .features = featureSet(&[_]Feature{
...@@ -2175,7 +2176,7 @@ pub const cpu = struct {...@@ -2175,7 +2176,7 @@ pub const cpu = struct {
2175 .x87,2176 .x87,
2176 }),2177 }),
2177 };2178 };
2178 pub const penryn = Cpu{2179 pub const penryn = CpuModel{
2179 .name = "penryn",2180 .name = "penryn",
2180 .llvm_name = "penryn",2181 .llvm_name = "penryn",
2181 .features = featureSet(&[_]Feature{2182 .features = featureSet(&[_]Feature{
...@@ -2193,7 +2194,7 @@ pub const cpu = struct {...@@ -2193,7 +2194,7 @@ pub const cpu = struct {
2193 .x87,2194 .x87,
2194 }),2195 }),
2195 };2196 };
2196 pub const pentium = Cpu{2197 pub const pentium = CpuModel{
2197 .name = "pentium",2198 .name = "pentium",
2198 .llvm_name = "pentium",2199 .llvm_name = "pentium",
2199 .features = featureSet(&[_]Feature{2200 .features = featureSet(&[_]Feature{
...@@ -2202,7 +2203,7 @@ pub const cpu = struct {...@@ -2202,7 +2203,7 @@ pub const cpu = struct {
2202 .x87,2203 .x87,
2203 }),2204 }),
2204 };2205 };
2205 pub const pentium_m = Cpu{2206 pub const pentium_m = CpuModel{
2206 .name = "pentium_m",2207 .name = "pentium_m",
2207 .llvm_name = "pentium-m",2208 .llvm_name = "pentium-m",
2208 .features = featureSet(&[_]Feature{2209 .features = featureSet(&[_]Feature{
...@@ -2216,7 +2217,7 @@ pub const cpu = struct {...@@ -2216,7 +2217,7 @@ pub const cpu = struct {
2216 .x87,2217 .x87,
2217 }),2218 }),
2218 };2219 };
2219 pub const pentium_mmx = Cpu{2220 pub const pentium_mmx = CpuModel{
2220 .name = "pentium_mmx",2221 .name = "pentium_mmx",
2221 .llvm_name = "pentium-mmx",2222 .llvm_name = "pentium-mmx",
2222 .features = featureSet(&[_]Feature{2223 .features = featureSet(&[_]Feature{
...@@ -2226,7 +2227,7 @@ pub const cpu = struct {...@@ -2226,7 +2227,7 @@ pub const cpu = struct {
2226 .x87,2227 .x87,
2227 }),2228 }),
2228 };2229 };
2229 pub const pentium2 = Cpu{2230 pub const pentium2 = CpuModel{
2230 .name = "pentium2",2231 .name = "pentium2",
2231 .llvm_name = "pentium2",2232 .llvm_name = "pentium2",
2232 .features = featureSet(&[_]Feature{2233 .features = featureSet(&[_]Feature{
...@@ -2239,7 +2240,7 @@ pub const cpu = struct {...@@ -2239,7 +2240,7 @@ pub const cpu = struct {
2239 .x87,2240 .x87,
2240 }),2241 }),
2241 };2242 };
2242 pub const pentium3 = Cpu{2243 pub const pentium3 = CpuModel{
2243 .name = "pentium3",2244 .name = "pentium3",
2244 .llvm_name = "pentium3",2245 .llvm_name = "pentium3",
2245 .features = featureSet(&[_]Feature{2246 .features = featureSet(&[_]Feature{
...@@ -2253,7 +2254,7 @@ pub const cpu = struct {...@@ -2253,7 +2254,7 @@ pub const cpu = struct {
2253 .x87,2254 .x87,
2254 }),2255 }),
2255 };2256 };
2256 pub const pentium3m = Cpu{2257 pub const pentium3m = CpuModel{
2257 .name = "pentium3m",2258 .name = "pentium3m",
2258 .llvm_name = "pentium3m",2259 .llvm_name = "pentium3m",
2259 .features = featureSet(&[_]Feature{2260 .features = featureSet(&[_]Feature{
...@@ -2267,7 +2268,7 @@ pub const cpu = struct {...@@ -2267,7 +2268,7 @@ pub const cpu = struct {
2267 .x87,2268 .x87,
2268 }),2269 }),
2269 };2270 };
2270 pub const pentium4 = Cpu{2271 pub const pentium4 = CpuModel{
2271 .name = "pentium4",2272 .name = "pentium4",
2272 .llvm_name = "pentium4",2273 .llvm_name = "pentium4",
2273 .features = featureSet(&[_]Feature{2274 .features = featureSet(&[_]Feature{
...@@ -2281,7 +2282,7 @@ pub const cpu = struct {...@@ -2281,7 +2282,7 @@ pub const cpu = struct {
2281 .x87,2282 .x87,
2282 }),2283 }),
2283 };2284 };
2284 pub const pentium4m = Cpu{2285 pub const pentium4m = CpuModel{
2285 .name = "pentium4m",2286 .name = "pentium4m",
2286 .llvm_name = "pentium4m",2287 .llvm_name = "pentium4m",
2287 .features = featureSet(&[_]Feature{2288 .features = featureSet(&[_]Feature{
...@@ -2295,7 +2296,7 @@ pub const cpu = struct {...@@ -2295,7 +2296,7 @@ pub const cpu = struct {
2295 .x87,2296 .x87,
2296 }),2297 }),
2297 };2298 };
2298 pub const pentiumpro = Cpu{2299 pub const pentiumpro = CpuModel{
2299 .name = "pentiumpro",2300 .name = "pentiumpro",
2300 .llvm_name = "pentiumpro",2301 .llvm_name = "pentiumpro",
2301 .features = featureSet(&[_]Feature{2302 .features = featureSet(&[_]Feature{
...@@ -2306,7 +2307,7 @@ pub const cpu = struct {...@@ -2306,7 +2307,7 @@ pub const cpu = struct {
2306 .x87,2307 .x87,
2307 }),2308 }),
2308 };2309 };
2309 pub const prescott = Cpu{2310 pub const prescott = CpuModel{
2310 .name = "prescott",2311 .name = "prescott",
2311 .llvm_name = "prescott",2312 .llvm_name = "prescott",
2312 .features = featureSet(&[_]Feature{2313 .features = featureSet(&[_]Feature{
...@@ -2320,7 +2321,7 @@ pub const cpu = struct {...@@ -2320,7 +2321,7 @@ pub const cpu = struct {
2320 .x87,2321 .x87,
2321 }),2322 }),
2322 };2323 };
2323 pub const sandybridge = Cpu{2324 pub const sandybridge = CpuModel{
2324 .name = "sandybridge",2325 .name = "sandybridge",
2325 .llvm_name = "sandybridge",2326 .llvm_name = "sandybridge",
2326 .features = featureSet(&[_]Feature{2327 .features = featureSet(&[_]Feature{
...@@ -2349,7 +2350,7 @@ pub const cpu = struct {...@@ -2349,7 +2350,7 @@ pub const cpu = struct {
2349 .xsaveopt,2350 .xsaveopt,
2350 }),2351 }),
2351 };2352 };
2352 pub const silvermont = Cpu{2353 pub const silvermont = CpuModel{
2353 .name = "silvermont",2354 .name = "silvermont",
2354 .llvm_name = "silvermont",2355 .llvm_name = "silvermont",
2355 .features = featureSet(&[_]Feature{2356 .features = featureSet(&[_]Feature{
...@@ -2377,7 +2378,7 @@ pub const cpu = struct {...@@ -2377,7 +2378,7 @@ pub const cpu = struct {
2377 .x87,2378 .x87,
2378 }),2379 }),
2379 };2380 };
2380 pub const skx = Cpu{2381 pub const skx = CpuModel{
2381 .name = "skx",2382 .name = "skx",
2382 .llvm_name = "skx",2383 .llvm_name = "skx",
2383 .features = featureSet(&[_]Feature{2384 .features = featureSet(&[_]Feature{
...@@ -2434,7 +2435,7 @@ pub const cpu = struct {...@@ -2434,7 +2435,7 @@ pub const cpu = struct {
2434 .xsaves,2435 .xsaves,
2435 }),2436 }),
2436 };2437 };
2437 pub const skylake = Cpu{2438 pub const skylake = CpuModel{
2438 .name = "skylake",2439 .name = "skylake",
2439 .llvm_name = "skylake",2440 .llvm_name = "skylake",
2440 .features = featureSet(&[_]Feature{2441 .features = featureSet(&[_]Feature{
...@@ -2485,7 +2486,7 @@ pub const cpu = struct {...@@ -2485,7 +2486,7 @@ pub const cpu = struct {
2485 .xsaves,2486 .xsaves,
2486 }),2487 }),
2487 };2488 };
2488 pub const skylake_avx512 = Cpu{2489 pub const skylake_avx512 = CpuModel{
2489 .name = "skylake_avx512",2490 .name = "skylake_avx512",
2490 .llvm_name = "skylake-avx512",2491 .llvm_name = "skylake-avx512",
2491 .features = featureSet(&[_]Feature{2492 .features = featureSet(&[_]Feature{
...@@ -2542,7 +2543,7 @@ pub const cpu = struct {...@@ -2542,7 +2543,7 @@ pub const cpu = struct {
2542 .xsaves,2543 .xsaves,
2543 }),2544 }),
2544 };2545 };
2545 pub const slm = Cpu{2546 pub const slm = CpuModel{
2546 .name = "slm",2547 .name = "slm",
2547 .llvm_name = "slm",2548 .llvm_name = "slm",
2548 .features = featureSet(&[_]Feature{2549 .features = featureSet(&[_]Feature{
...@@ -2570,7 +2571,7 @@ pub const cpu = struct {...@@ -2570,7 +2571,7 @@ pub const cpu = struct {
2570 .x87,2571 .x87,
2571 }),2572 }),
2572 };2573 };
2573 pub const tremont = Cpu{2574 pub const tremont = CpuModel{
2574 .name = "tremont",2575 .name = "tremont",
2575 .llvm_name = "tremont",2576 .llvm_name = "tremont",
2576 .features = featureSet(&[_]Feature{2577 .features = featureSet(&[_]Feature{
...@@ -2613,7 +2614,7 @@ pub const cpu = struct {...@@ -2613,7 +2614,7 @@ pub const cpu = struct {
2613 .xsaves,2614 .xsaves,
2614 }),2615 }),
2615 };2616 };
2616 pub const westmere = Cpu{2617 pub const westmere = CpuModel{
2617 .name = "westmere",2618 .name = "westmere",
2618 .llvm_name = "westmere",2619 .llvm_name = "westmere",
2619 .features = featureSet(&[_]Feature{2620 .features = featureSet(&[_]Feature{
...@@ -2632,7 +2633,7 @@ pub const cpu = struct {...@@ -2632,7 +2633,7 @@ pub const cpu = struct {
2632 .x87,2633 .x87,
2633 }),2634 }),
2634 };2635 };
2635 pub const winchip_c6 = Cpu{2636 pub const winchip_c6 = CpuModel{
2636 .name = "winchip_c6",2637 .name = "winchip_c6",
2637 .llvm_name = "winchip-c6",2638 .llvm_name = "winchip-c6",
2638 .features = featureSet(&[_]Feature{2639 .features = featureSet(&[_]Feature{
...@@ -2641,7 +2642,7 @@ pub const cpu = struct {...@@ -2641,7 +2642,7 @@ pub const cpu = struct {
2641 .x87,2642 .x87,
2642 }),2643 }),
2643 };2644 };
2644 pub const winchip2 = Cpu{2645 pub const winchip2 = CpuModel{
2645 .name = "winchip2",2646 .name = "winchip2",
2646 .llvm_name = "winchip2",2647 .llvm_name = "winchip2",
2647 .features = featureSet(&[_]Feature{2648 .features = featureSet(&[_]Feature{
...@@ -2650,7 +2651,7 @@ pub const cpu = struct {...@@ -2650,7 +2651,7 @@ pub const cpu = struct {
2650 .x87,2651 .x87,
2651 }),2652 }),
2652 };2653 };
2653 pub const x86_64 = Cpu{2654 pub const x86_64 = CpuModel{
2654 .name = "x86_64",2655 .name = "x86_64",
2655 .llvm_name = "x86-64",2656 .llvm_name = "x86-64",
2656 .features = featureSet(&[_]Feature{2657 .features = featureSet(&[_]Feature{
...@@ -2667,7 +2668,7 @@ pub const cpu = struct {...@@ -2667,7 +2668,7 @@ pub const cpu = struct {
2667 .x87,2668 .x87,
2668 }),2669 }),
2669 };2670 };
2670 pub const yonah = Cpu{2671 pub const yonah = CpuModel{
2671 .name = "yonah",2672 .name = "yonah",
2672 .llvm_name = "yonah",2673 .llvm_name = "yonah",
2673 .features = featureSet(&[_]Feature{2674 .features = featureSet(&[_]Feature{
...@@ -2681,7 +2682,7 @@ pub const cpu = struct {...@@ -2681,7 +2682,7 @@ pub const cpu = struct {
2681 .x87,2682 .x87,
2682 }),2683 }),
2683 };2684 };
2684 pub const znver1 = Cpu{2685 pub const znver1 = CpuModel{
2685 .name = "znver1",2686 .name = "znver1",
2686 .llvm_name = "znver1",2687 .llvm_name = "znver1",
2687 .features = featureSet(&[_]Feature{2688 .features = featureSet(&[_]Feature{
...@@ -2725,7 +2726,7 @@ pub const cpu = struct {...@@ -2725,7 +2726,7 @@ pub const cpu = struct {
2725 .xsaves,2726 .xsaves,
2726 }),2727 }),
2727 };2728 };
2728 pub const znver2 = Cpu{2729 pub const znver2 = CpuModel{
2729 .name = "znver2",2730 .name = "znver2",
2730 .llvm_name = "znver2",2731 .llvm_name = "znver2",
2731 .features = featureSet(&[_]Feature{2732 .features = featureSet(&[_]Feature{
...@@ -2777,7 +2778,7 @@ pub const cpu = struct {...@@ -2777,7 +2778,7 @@ pub const cpu = struct {
2777/// All x86 CPUs, sorted alphabetically by name.2778/// All x86 CPUs, sorted alphabetically by name.
2778/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage12779/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2779/// compiler has inefficient memory and CPU usage, affecting build times.2780/// compiler has inefficient memory and CPU usage, affecting build times.
2780pub const all_cpus = &[_]*const Cpu{2781pub const all_cpus = &[_]*const CpuModel{
2781 &cpu.amdfam10,2782 &cpu.amdfam10,
2782 &cpu.athlon,2783 &cpu.athlon,
2783 &cpu.athlon_4,2784 &cpu.athlon_4,
src-self-hosted/libc_installation.zig+1-2
...@@ -577,10 +577,9 @@ pub fn detectNativeDynamicLinker(allocator: *Allocator) error{...@@ -577,10 +577,9 @@ pub fn detectNativeDynamicLinker(allocator: *Allocator) error{
577 // skip adding it to `ld_info_list`.577 // skip adding it to `ld_info_list`.
578 const target: Target = .{578 const target: Target = .{
579 .Cross = .{579 .Cross = .{
580 .arch = Target.current.getArch(),580 .cpu = Target.Cpu.baseline(Target.current.getArch()),
581 .os = Target.current.getOs(),581 .os = Target.current.getOs(),
582 .abi = abi,582 .abi = abi,
583 .cpu_features = Target.current.getArch().getBaselineCpuFeatures(),
584 },583 },
585 };584 };
586 const standard_ld_path = target.getStandardDynamicLinkerPath(allocator) catch |err| switch (err) {585 const standard_ld_path = target.getStandardDynamicLinkerPath(allocator) catch |err| switch (err) {
src-self-hosted/print_targets.zig+34-50
...@@ -113,37 +113,14 @@ pub fn cmdTargets(...@@ -113,37 +113,14 @@ pub fn cmdTargets(
113 try jws.beginObject();113 try jws.beginObject();
114114
115 try jws.objectField("arch");115 try jws.objectField("arch");
116 try jws.beginObject();116 try jws.beginArray();
117 {117 {
118 inline for (@typeInfo(Target.Arch).Union.fields) |field| {118 inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| {
119 try jws.objectField(field.name);
120 if (field.field_type == void) {
121 try jws.emitNull();
122 } else {
123 try jws.emitString(@typeName(field.field_type));
124 }
125 }
126 }
127 try jws.endObject();
128
129 try jws.objectField("subArch");
130 try jws.beginObject();
131 const sub_arch_list = [_]type{
132 Target.Arch.Arm32,
133 Target.Arch.Arm64,
134 Target.Arch.Kalimba,
135 Target.Arch.Mips,
136 };
137 inline for (sub_arch_list) |SubArch| {
138 try jws.objectField(@typeName(SubArch));
139 try jws.beginArray();
140 inline for (@typeInfo(SubArch).Enum.fields) |field| {
141 try jws.arrayElem();119 try jws.arrayElem();
142 try jws.emitString(field.name);120 try jws.emitString(field.name);
143 }121 }
144 try jws.endArray();
145 }122 }
146 try jws.endObject();123 try jws.endArray();
147124
148 try jws.objectField("os");125 try jws.objectField("os");
149 try jws.beginArray();126 try jws.beginArray();
...@@ -179,15 +156,15 @@ pub fn cmdTargets(...@@ -179,15 +156,15 @@ pub fn cmdTargets(
179156
180 try jws.objectField("cpus");157 try jws.objectField("cpus");
181 try jws.beginObject();158 try jws.beginObject();
182 inline for (@typeInfo(Target.Arch).Union.fields) |field| {159 inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| {
183 try jws.objectField(field.name);160 try jws.objectField(field.name);
184 try jws.beginObject();161 try jws.beginObject();
185 const arch = @unionInit(Target.Arch, field.name, undefined);162 const arch = @field(Target.Cpu.Arch, field.name);
186 for (arch.allCpus()) |cpu| {163 for (arch.allCpuModels()) |model| {
187 try jws.objectField(cpu.name);164 try jws.objectField(model.name);
188 try jws.beginArray();165 try jws.beginArray();
189 for (arch.allFeaturesList()) |feature, i| {166 for (arch.allFeaturesList()) |feature, i| {
190 if (cpu.features.isEnabled(@intCast(u8, i))) {167 if (model.features.isEnabled(@intCast(u8, i))) {
191 try jws.arrayElem();168 try jws.arrayElem();
192 try jws.emitString(feature.name);169 try jws.emitString(feature.name);
193 }170 }
...@@ -200,10 +177,10 @@ pub fn cmdTargets(...@@ -200,10 +177,10 @@ pub fn cmdTargets(
200177
201 try jws.objectField("cpuFeatures");178 try jws.objectField("cpuFeatures");
202 try jws.beginObject();179 try jws.beginObject();
203 inline for (@typeInfo(Target.Arch).Union.fields) |field| {180 inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| {
204 try jws.objectField(field.name);181 try jws.objectField(field.name);
205 try jws.beginArray();182 try jws.beginArray();
206 const arch = @unionInit(Target.Arch, field.name, undefined);183 const arch = @field(Target.Cpu.Arch, field.name);
207 for (arch.allFeaturesList()) |feature| {184 for (arch.allFeaturesList()) |feature| {
208 try jws.arrayElem();185 try jws.arrayElem();
209 try jws.emitString(feature.name);186 try jws.emitString(feature.name);
...@@ -220,27 +197,34 @@ pub fn cmdTargets(...@@ -220,27 +197,34 @@ pub fn cmdTargets(
220 try jws.objectField("triple");197 try jws.objectField("triple");
221 try jws.emitString(triple);198 try jws.emitString(triple);
222 }199 }
223 try jws.objectField("arch");
224 try jws.emitString(@tagName(native_target.getArch()));
225 try jws.objectField("os");
226 try jws.emitString(@tagName(native_target.getOs()));
227 try jws.objectField("abi");
228 try jws.emitString(@tagName(native_target.getAbi()));
229 try jws.objectField("cpuName");
230 const cpu_features = native_target.getCpuFeatures();
231 try jws.emitString(cpu_features.cpu.name);
232 {200 {
233 try jws.objectField("cpuFeatures");201 try jws.objectField("cpu");
234 try jws.beginArray();202 try jws.beginObject();
235 for (native_target.getArch().allFeaturesList()) |feature, i_usize| {203 try jws.objectField("arch");
236 const index = @intCast(Target.Cpu.Feature.Set.Index, i_usize);204 try jws.emitString(@tagName(native_target.getArch()));
237 if (cpu_features.features.isEnabled(index)) {205
238 try jws.arrayElem();206 try jws.objectField("name");
239 try jws.emitString(feature.name);207 const cpu = native_target.getCpu();
208 try jws.emitString(cpu.model.name);
209
210 {
211 try jws.objectField("features");
212 try jws.beginArray();
213 for (native_target.getArch().allFeaturesList()) |feature, i_usize| {
214 const index = @intCast(Target.Cpu.Feature.Set.Index, i_usize);
215 if (cpu.features.isEnabled(index)) {
216 try jws.arrayElem();
217 try jws.emitString(feature.name);
218 }
240 }219 }
220 try jws.endArray();
241 }221 }
242 try jws.endArray();222 try jws.endObject();
243 }223 }
224 try jws.objectField("os");
225 try jws.emitString(@tagName(native_target.getOs()));
226 try jws.objectField("abi");
227 try jws.emitString(@tagName(native_target.getAbi()));
244 // TODO implement native glibc version detection in self-hosted228 // TODO implement native glibc version detection in self-hosted
245 try jws.endObject();229 try jws.endObject();
246230
src-self-hosted/stage2.zig+133-262
...@@ -88,7 +88,6 @@ const Error = extern enum {...@@ -88,7 +88,6 @@ const Error = extern enum {
88 IsAsync,88 IsAsync,
89 ImportOutsidePkgPath,89 ImportOutsidePkgPath,
90 UnknownCpu,90 UnknownCpu,
91 UnknownSubArchitecture,
92 UnknownCpuFeature,91 UnknownCpuFeature,
93 InvalidCpuFeatures,92 InvalidCpuFeatures,
94 InvalidLlvmCpuFeaturesFormat,93 InvalidLlvmCpuFeaturesFormat,
...@@ -560,25 +559,26 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz...@@ -560,25 +559,26 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz
560 node.context.maybeRefresh();559 node.context.maybeRefresh();
561}560}
562561
563fn cpuFeaturesFromLLVM(562fn detectNativeCpuWithLLVM(
564 arch: Target.Arch,563 arch: Target.Cpu.Arch,
565 llvm_cpu_name_z: ?[*:0]const u8,564 llvm_cpu_name_z: ?[*:0]const u8,
566 llvm_cpu_features_opt: ?[*:0]const u8,565 llvm_cpu_features_opt: ?[*:0]const u8,
567) !Target.CpuFeatures {566) !Target.Cpu {
568 var result = arch.getBaselineCpuFeatures();567 var result = Target.Cpu.baseline(arch);
569568
570 if (llvm_cpu_name_z) |cpu_name_z| {569 if (llvm_cpu_name_z) |cpu_name_z| {
571 const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z);570 const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z);
572571
573 for (arch.allCpus()) |cpu| {572 for (arch.allCpuModels()) |model| {
574 const this_llvm_name = cpu.llvm_name orelse continue;573 const this_llvm_name = model.llvm_name orelse continue;
575 if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) {574 if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) {
576 // Here we use the non-dependencies-populated set,575 // Here we use the non-dependencies-populated set,
577 // so that subtracting features later in this function576 // so that subtracting features later in this function
578 // affect the prepopulated set.577 // affect the prepopulated set.
579 result = Target.CpuFeatures{578 result = Target.Cpu{
580 .cpu = cpu,579 .arch = arch,
581 .features = cpu.features,580 .model = model,
581 .features = model.features,
582 };582 };
583 break;583 break;
584 }584 }
...@@ -632,12 +632,12 @@ export fn stage2_cmd_targets(zig_triple: [*:0]const u8) c_int {...@@ -632,12 +632,12 @@ export fn stage2_cmd_targets(zig_triple: [*:0]const u8) c_int {
632}632}
633633
634fn cmdTargets(zig_triple: [*:0]const u8) !void {634fn cmdTargets(zig_triple: [*:0]const u8) !void {
635 var target = try Target.parse(mem.toSliceConst(u8, zig_triple));635 var target = try Target.parse(.{ .arch_os_abi = mem.toSliceConst(u8, zig_triple) });
636 target.Cross.cpu_features = blk: {636 target.Cross.cpu = blk: {
637 const llvm = @import("llvm.zig");637 const llvm = @import("llvm.zig");
638 const llvm_cpu_name = llvm.GetHostCPUName();638 const llvm_cpu_name = llvm.GetHostCPUName();
639 const llvm_cpu_features = llvm.GetNativeFeatures();639 const llvm_cpu_features = llvm.GetNativeFeatures();
640 break :blk try cpuFeaturesFromLLVM(target.Cross.arch, llvm_cpu_name, llvm_cpu_features);640 break :blk try detectNativeCpuWithLLVM(target.getArch(), llvm_cpu_name, llvm_cpu_features);
641 };641 };
642 return @import("print_targets.zig").cmdTargets(642 return @import("print_targets.zig").cmdTargets(
643 std.heap.c_allocator,643 std.heap.c_allocator,
...@@ -647,208 +647,101 @@ fn cmdTargets(zig_triple: [*:0]const u8) !void {...@@ -647,208 +647,101 @@ fn cmdTargets(zig_triple: [*:0]const u8) !void {
647 );647 );
648}648}
649649
650const Stage2CpuFeatures = struct {
651 allocator: *mem.Allocator,
652 cpu_features: Target.CpuFeatures,
653
654 llvm_features_str: ?[*:0]const u8,
655
656 builtin_str: [:0]const u8,
657 cache_hash: [:0]const u8,
658
659 const Self = @This();
660
661 fn createFromNative(allocator: *mem.Allocator) !*Self {
662 const arch = Target.current.getArch();
663 const llvm = @import("llvm.zig");
664 const llvm_cpu_name = llvm.GetHostCPUName();
665 const llvm_cpu_features = llvm.GetNativeFeatures();
666 const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name, llvm_cpu_features);
667 return createFromCpuFeatures(allocator, arch, cpu_features);
668 }
669
670 fn createFromCpuFeatures(
671 allocator: *mem.Allocator,
672 arch: Target.Arch,
673 cpu_features: Target.CpuFeatures,
674 ) !*Self {
675 const self = try allocator.create(Self);
676 errdefer allocator.destroy(self);
677
678 const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{
679 cpu_features.cpu.name,
680 cpu_features.features.asBytes(),
681 });
682 errdefer allocator.free(cache_hash);
683
684 const generic_arch_name = arch.genericName();
685 var builtin_str_buffer = try std.Buffer.allocPrint(allocator,
686 \\CpuFeatures{{
687 \\ .cpu = &Target.{}.cpu.{},
688 \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{
689 \\
690 , .{
691 generic_arch_name,
692 cpu_features.cpu.name,
693 generic_arch_name,
694 generic_arch_name,
695 });
696 defer builtin_str_buffer.deinit();
697
698 var llvm_features_buffer = try std.Buffer.initSize(allocator, 0);
699 defer llvm_features_buffer.deinit();
700
701 for (arch.allFeaturesList()) |feature, index_usize| {
702 const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize);
703 const is_enabled = cpu_features.features.isEnabled(index);
704
705 if (feature.llvm_name) |llvm_name| {
706 const plus_or_minus = "-+"[@boolToInt(is_enabled)];
707 try llvm_features_buffer.appendByte(plus_or_minus);
708 try llvm_features_buffer.append(llvm_name);
709 try llvm_features_buffer.append(",");
710 }
711
712 if (is_enabled) {
713 // TODO some kind of "zig identifier escape" function rather than
714 // unconditionally using @"" syntax
715 try builtin_str_buffer.append(" .@\"");
716 try builtin_str_buffer.append(feature.name);
717 try builtin_str_buffer.append("\",\n");
718 }
719 }
720
721 try builtin_str_buffer.append(
722 \\ }),
723 \\};
724 \\
725 );
726
727 assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ","));
728 llvm_features_buffer.shrink(llvm_features_buffer.len() - 1);
729
730 self.* = Self{
731 .allocator = allocator,
732 .cpu_features = cpu_features,
733 .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr,
734 .builtin_str = builtin_str_buffer.toOwnedSlice(),
735 .cache_hash = cache_hash,
736 };
737 return self;
738 }
739
740 fn destroy(self: *Self) void {
741 self.allocator.free(self.cache_hash);
742 self.allocator.free(self.builtin_str);
743 // TODO if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str);
744 self.allocator.destroy(self);
745 }
746};
747
748// ABI warning650// ABI warning
749export fn stage2_cpu_features_parse(651export fn stage2_target_parse(
750 result: **Stage2CpuFeatures,652 target: *Stage2Target,
751 zig_triple: ?[*:0]const u8,653 zig_triple: ?[*:0]const u8,
752 cpu_name: ?[*:0]const u8,654 mcpu: ?[*:0]const u8,
753 cpu_features: ?[*:0]const u8,
754) Error {655) Error {
755 result.* = stage2ParseCpuFeatures(zig_triple, cpu_name, cpu_features) catch |err| switch (err) {656 stage2TargetParse(target, zig_triple, mcpu) catch |err| switch (err) {
756 error.OutOfMemory => return .OutOfMemory,657 error.OutOfMemory => return .OutOfMemory,
757 error.UnknownArchitecture => return .UnknownArchitecture,658 error.UnknownArchitecture => return .UnknownArchitecture,
758 error.UnknownSubArchitecture => return .UnknownSubArchitecture,
759 error.UnknownOperatingSystem => return .UnknownOperatingSystem,659 error.UnknownOperatingSystem => return .UnknownOperatingSystem,
760 error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface,660 error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface,
761 error.MissingOperatingSystem => return .MissingOperatingSystem,661 error.MissingOperatingSystem => return .MissingOperatingSystem,
762 error.MissingArchitecture => return .MissingArchitecture,662 error.MissingArchitecture => return .MissingArchitecture,
763 error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat,663 error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat,
764 error.InvalidCpuFeatures => return .InvalidCpuFeatures,664 error.UnknownCpu => return .UnknownCpu,
665 error.UnexpectedExtraField => return .SemanticAnalyzeFail,
666 error.UnknownCpuFeature => return .UnknownCpuFeature,
765 };667 };
766 return .None;668 return .None;
767}669}
768670
769fn stage2ParseCpuFeatures(671fn stage2TargetParse(
672 stage1_target: *Stage2Target,
770 zig_triple_oz: ?[*:0]const u8,673 zig_triple_oz: ?[*:0]const u8,
771 cpu_name_oz: ?[*:0]const u8,674 mcpu_oz: ?[*:0]const u8,
772 cpu_features_oz: ?[*:0]const u8,675) !void {
773) !*Stage2CpuFeatures {676 const target: Target = if (zig_triple_oz) |zig_triple_z| blk: {
774 const zig_triple_z = zig_triple_oz orelse return Stage2CpuFeatures.createFromNative(std.heap.c_allocator);677 const zig_triple = mem.toSliceConst(u8, zig_triple_z);
775 const target = try Target.parse(mem.toSliceConst(u8, zig_triple_z));678 const mcpu = if (mcpu_oz) |mcpu_z| mem.toSliceConst(u8, mcpu_z) else null;
776 const arch = target.Cross.arch;679 break :blk try Target.parse(.{ .arch_os_abi = zig_triple, .cpu = mcpu });
777680 } else Target.Native;
778 const cpu = if (cpu_name_oz) |cpu_name_z| blk: {
779 const cpu_name = mem.toSliceConst(u8, cpu_name_z);
780 break :blk arch.parseCpu(cpu_name) catch |err| switch (err) {
781 error.UnknownCpu => {
782 std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{
783 cpu_name,
784 @tagName(arch),
785 });
786 for (arch.allCpus()) |cpu| {
787 std.debug.warn(" {}\n", .{cpu.name});
788 }
789 process.exit(1);
790 },
791 else => |e| return e,
792 };
793 } else target.Cross.cpu_features.cpu;
794
795 var set = if (cpu_features_oz) |cpu_features_z| blk: {
796 const cpu_features = mem.toSliceConst(u8, cpu_features_z);
797 break :blk arch.parseCpuFeatureSet(cpu, cpu_features) catch |err| switch (err) {
798 error.UnknownCpuFeature => {
799 std.debug.warn(
800 \\Unknown CPU features specified.
801 \\Available CPU features for architecture '{}':
802 \\
803 , .{@tagName(arch)});
804 for (arch.allFeaturesList()) |feature| {
805 std.debug.warn(" {}\n", .{feature.name});
806 }
807 process.exit(1);
808 },
809 else => |e| return e,
810 };
811 } else cpu.features;
812681
813 if (arch.subArchFeature()) |index| {682 try stage1_target.fromTarget(target);
814 set.addFeature(index);683}
815 }
816 set.populateDependencies(arch.allFeaturesList());
817684
818 return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, .{685fn initStage1TargetCpuFeatures(stage1_target: *Stage2Target, cpu: Target.Cpu) !void {
819 .cpu = cpu,686 const allocator = std.heap.c_allocator;
820 .features = set,687 const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{
688 cpu.model.name,
689 cpu.features.asBytes(),
821 });690 });
822}691 errdefer allocator.free(cache_hash);
692
693 const generic_arch_name = cpu.arch.genericName();
694 var builtin_str_buffer = try std.Buffer.allocPrint(allocator,
695 \\Cpu{{
696 \\ .arch = .{},
697 \\ .model = &Target.{}.cpu.{},
698 \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{
699 \\
700 , .{
701 @tagName(cpu.arch),
702 generic_arch_name,
703 cpu.model.name,
704 generic_arch_name,
705 generic_arch_name,
706 });
707 defer builtin_str_buffer.deinit();
823708
824// ABI warning709 var llvm_features_buffer = try std.Buffer.initSize(allocator, 0);
825export fn stage2_cpu_features_get_cache_hash(710 defer llvm_features_buffer.deinit();
826 cpu_features: *const Stage2CpuFeatures,
827 ptr: *[*:0]const u8,
828 len: *usize,
829) void {
830 ptr.* = cpu_features.cache_hash.ptr;
831 len.* = cpu_features.cache_hash.len;
832}
833711
834// ABI warning712 for (cpu.arch.allFeaturesList()) |feature, index_usize| {
835export fn stage2_cpu_features_get_builtin_str(713 const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize);
836 cpu_features: *const Stage2CpuFeatures,714 const is_enabled = cpu.features.isEnabled(index);
837 ptr: *[*:0]const u8,
838 len: *usize,
839) void {
840 ptr.* = cpu_features.builtin_str.ptr;
841 len.* = cpu_features.builtin_str.len;
842}
843715
844// ABI warning716 if (feature.llvm_name) |llvm_name| {
845export fn stage2_cpu_features_get_llvm_cpu(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 {717 const plus_or_minus = "-+"[@boolToInt(is_enabled)];
846 return if (cpu_features.cpu_features.cpu.llvm_name) |s| s.ptr else null;718 try llvm_features_buffer.appendByte(plus_or_minus);
847}719 try llvm_features_buffer.append(llvm_name);
720 try llvm_features_buffer.append(",");
721 }
848722
849// ABI warning723 if (is_enabled) {
850export fn stage2_cpu_features_get_llvm_features(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 {724 // TODO some kind of "zig identifier escape" function rather than
851 return cpu_features.llvm_features_str;725 // unconditionally using @"" syntax
726 try builtin_str_buffer.append(" .@\"");
727 try builtin_str_buffer.append(feature.name);
728 try builtin_str_buffer.append("\",\n");
729 }
730 }
731
732 try builtin_str_buffer.append(
733 \\ }),
734 \\};
735 \\
736 );
737
738 assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ","));
739 llvm_features_buffer.shrink(llvm_features_buffer.len() - 1);
740
741 stage1_target.llvm_cpu_name = if (cpu.model.llvm_name) |s| s.ptr else null;
742 stage1_target.llvm_cpu_features = llvm_features_buffer.toOwnedSlice().ptr;
743 stage1_target.builtin_str = builtin_str_buffer.toOwnedSlice().ptr;
744 stage1_target.cache_hash = cache_hash.ptr;
852}745}
853746
854// ABI warning747// ABI warning
...@@ -1017,12 +910,55 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file:...@@ -1017,12 +910,55 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file:
1017const Stage2Target = extern struct {910const Stage2Target = extern struct {
1018 arch: c_int,911 arch: c_int,
1019 sub_arch: c_int,912 sub_arch: c_int,
913
1020 vendor: c_int,914 vendor: c_int,
1021 os: c_int,
1022 abi: c_int,915 abi: c_int,
1023 glibc_version: ?*Stage2GLibCVersion, // null means default916
1024 cpu_features: *Stage2CpuFeatures,917 os: c_int,
1025 is_native: bool,918 is_native: bool,
919
920 glibc_version: ?*Stage2GLibCVersion, // null means default
921
922 llvm_cpu_name: ?[*:0]const u8,
923 llvm_cpu_features: ?[*:0]const u8,
924 builtin_str: ?[*:0]const u8,
925 cache_hash: ?[*:0]const u8,
926
927 fn toTarget(in_target: Stage2Target) Target {
928 if (in_target.is_native) return .Native;
929
930 const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch
931 const in_sub_arch = in_target.sub_arch - 1; // skip over ZigLLVM_NoSubArch
932 const in_os = in_target.os;
933 const in_abi = in_target.abi - 1; // skip over ZigLLVM_UnknownEnvironment
934
935 return .{
936 .Cross = .{
937 .cpu = Target.Cpu.baseline(enumInt(Target.Cpu.Arch, in_arch)),
938 .os = enumInt(Target.Os, in_os),
939 .abi = enumInt(Target.Abi, in_abi),
940 },
941 };
942 }
943
944 fn fromTarget(self: *Stage2Target, target: Target) !void {
945 const cpu = switch (target) {
946 .Native => blk: {
947 // TODO self-host CPU model and feature detection instead of relying on LLVM
948 const llvm = @import("llvm.zig");
949 const llvm_cpu_name = llvm.GetHostCPUName();
950 const llvm_cpu_features = llvm.GetNativeFeatures();
951 break :blk try detectNativeCpuWithLLVM(target.getArch(), llvm_cpu_name, llvm_cpu_features);
952 },
953 .Cross => target.getCpu(),
954 };
955 self.arch = @enumToInt(target.getArch()) + 1; // skip over ZigLLVM_UnknownArch
956 self.sub_arch = 0;
957 self.vendor = 0;
958 self.os = @enumToInt(target.getOs());
959 self.abi = @enumToInt(target.getAbi()) + 1; // skip over ZigLLVM_UnknownEnvironment
960 try initStage1TargetCpuFeatures(self, cpu);
961 }
1026};962};
1027963
1028// ABI warning964// ABI warning
...@@ -1034,72 +970,7 @@ const Stage2GLibCVersion = extern struct {...@@ -1034,72 +970,7 @@ const Stage2GLibCVersion = extern struct {
1034970
1035// ABI warning971// ABI warning
1036export fn stage2_detect_dynamic_linker(in_target: *const Stage2Target, out_ptr: *[*:0]u8, out_len: *usize) Error {972export fn stage2_detect_dynamic_linker(in_target: *const Stage2Target, out_ptr: *[*:0]u8, out_len: *usize) Error {
1037 const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch973 const target = in_target.toTarget();
1038 const in_sub_arch = in_target.sub_arch - 1; // skip over ZigLLVM_NoSubArch
1039 const in_os = in_target.os;
1040 const in_abi = in_target.abi - 1; // skip over ZigLLVM_UnknownEnvironment
1041 const target: Target = if (in_target.is_native) .Native else .{
1042 .Cross = .{
1043 .arch = switch (enumInt(@TagType(Target.Arch), in_arch)) {
1044 .arm => .{ .arm = enumInt(Target.Arch.Arm32, in_sub_arch) },
1045 .armeb => .{ .armeb = enumInt(Target.Arch.Arm32, in_sub_arch) },
1046 .thumb => .{ .thumb = enumInt(Target.Arch.Arm32, in_sub_arch) },
1047 .thumbeb => .{ .thumbeb = enumInt(Target.Arch.Arm32, in_sub_arch) },
1048
1049 .aarch64 => .{ .aarch64 = enumInt(Target.Arch.Arm64, in_sub_arch) },
1050 .aarch64_be => .{ .aarch64_be = enumInt(Target.Arch.Arm64, in_sub_arch) },
1051 .aarch64_32 => .{ .aarch64_32 = enumInt(Target.Arch.Arm64, in_sub_arch) },
1052
1053 .kalimba => .{ .kalimba = enumInt(Target.Arch.Kalimba, in_sub_arch) },
1054
1055 .arc => .arc,
1056 .avr => .avr,
1057 .bpfel => .bpfel,
1058 .bpfeb => .bpfeb,
1059 .hexagon => .hexagon,
1060 .mips => .mips,
1061 .mipsel => .mipsel,
1062 .mips64 => .mips64,
1063 .mips64el => .mips64el,
1064 .msp430 => .msp430,
1065 .powerpc => .powerpc,
1066 .powerpc64 => .powerpc64,
1067 .powerpc64le => .powerpc64le,
1068 .r600 => .r600,
1069 .amdgcn => .amdgcn,
1070 .riscv32 => .riscv32,
1071 .riscv64 => .riscv64,
1072 .sparc => .sparc,
1073 .sparcv9 => .sparcv9,
1074 .sparcel => .sparcel,
1075 .s390x => .s390x,
1076 .tce => .tce,
1077 .tcele => .tcele,
1078 .i386 => .i386,
1079 .x86_64 => .x86_64,
1080 .xcore => .xcore,
1081 .nvptx => .nvptx,
1082 .nvptx64 => .nvptx64,
1083 .le32 => .le32,
1084 .le64 => .le64,
1085 .amdil => .amdil,
1086 .amdil64 => .amdil64,
1087 .hsail => .hsail,
1088 .hsail64 => .hsail64,
1089 .spir => .spir,
1090 .spir64 => .spir64,
1091 .shave => .shave,
1092 .lanai => .lanai,
1093 .wasm32 => .wasm32,
1094 .wasm64 => .wasm64,
1095 .renderscript32 => .renderscript32,
1096 .renderscript64 => .renderscript64,
1097 },
1098 .os = enumInt(Target.Os, in_os),
1099 .abi = enumInt(Target.Abi, in_abi),
1100 .cpu_features = in_target.cpu_features.cpu_features,
1101 },
1102 };
1103 const result = @import("introspect.zig").detectDynamicLinker(974 const result = @import("introspect.zig").detectDynamicLinker(
1104 std.heap.c_allocator,975 std.heap.c_allocator,
1105 target,976 target,
src/codegen.cpp+17-26
...@@ -8624,14 +8624,11 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {...@@ -8624,14 +8624,11 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
8624 buf_appendf(contents, "pub const arch = %s;\n", cur_arch);8624 buf_appendf(contents, "pub const arch = %s;\n", cur_arch);
8625 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);8625 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);
8626 {8626 {
8627 buf_append_str(contents, "pub const cpu_features: CpuFeatures = ");8627 buf_append_str(contents, "pub const cpu: Cpu = ");
8628 if (g->zig_target->cpu_features != nullptr) {8628 if (g->zig_target->builtin_str != nullptr) {
8629 const char *ptr;8629 buf_append_str(contents, g->zig_target->builtin_str);
8630 size_t len;
8631 stage2_cpu_features_get_builtin_str(g->zig_target->cpu_features, &ptr, &len);
8632 buf_append_mem(contents, ptr, len);
8633 } else {8630 } else {
8634 buf_append_str(contents, "arch.getBaselineCpuFeatures();\n");8631 buf_append_str(contents, "Target.Cpu.baseline(arch);\n");
8635 }8632 }
8636 }8633 }
8637 if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) {8634 if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) {
...@@ -8734,11 +8731,8 @@ static Error define_builtin_compile_vars(CodeGen *g) {...@@ -8734,11 +8731,8 @@ static Error define_builtin_compile_vars(CodeGen *g) {
8734 cache_int(&cache_hash, g->zig_target->vendor);8731 cache_int(&cache_hash, g->zig_target->vendor);
8735 cache_int(&cache_hash, g->zig_target->os);8732 cache_int(&cache_hash, g->zig_target->os);
8736 cache_int(&cache_hash, g->zig_target->abi);8733 cache_int(&cache_hash, g->zig_target->abi);
8737 if (g->zig_target->cpu_features != nullptr) {8734 if (g->zig_target->cache_hash != nullptr) {
8738 const char *ptr;8735 cache_str(&cache_hash, g->zig_target->cache_hash);
8739 size_t len;
8740 stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len);
8741 cache_str(&cache_hash, ptr);
8742 }8736 }
8743 if (g->zig_target->glibc_version != nullptr) {8737 if (g->zig_target->glibc_version != nullptr) {
8744 cache_int(&cache_hash, g->zig_target->glibc_version->major);8738 cache_int(&cache_hash, g->zig_target->glibc_version->major);
...@@ -8873,9 +8867,11 @@ static void init(CodeGen *g) {...@@ -8873,9 +8867,11 @@ static void init(CodeGen *g) {
8873 }8867 }
88748868
8875 // Override CPU and features if defined by user.8869 // Override CPU and features if defined by user.
8876 if (g->zig_target->cpu_features != nullptr) {8870 if (g->zig_target->llvm_cpu_name != nullptr) {
8877 target_specific_cpu_args = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features);8871 target_specific_cpu_args = g->zig_target->llvm_cpu_name;
8878 target_specific_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features);8872 }
8873 if (g->zig_target->llvm_cpu_features != nullptr) {
8874 target_specific_features = g->zig_target->llvm_cpu_features;
8879 }8875 }
8880 if (g->verbose_llvm_cpu_features) {8876 if (g->verbose_llvm_cpu_features) {
8881 fprintf(stderr, "name=%s triple=%s\n", buf_ptr(g->root_out_name), buf_ptr(&g->llvm_triple_str));8877 fprintf(stderr, "name=%s triple=%s\n", buf_ptr(g->root_out_name), buf_ptr(&g->llvm_triple_str));
...@@ -9190,19 +9186,17 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa...@@ -9190,19 +9186,17 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa
9190 args.append("-target");9186 args.append("-target");
9191 args.append(buf_ptr(&g->llvm_triple_str));9187 args.append(buf_ptr(&g->llvm_triple_str));
91929188
9193 const char *llvm_cpu = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features);9189 if (g->zig_target->llvm_cpu_name != nullptr) {
9194 if (llvm_cpu != nullptr) {
9195 args.append("-Xclang");9190 args.append("-Xclang");
9196 args.append("-target-cpu");9191 args.append("-target-cpu");
9197 args.append("-Xclang");9192 args.append("-Xclang");
9198 args.append(llvm_cpu);9193 args.append(g->zig_target->llvm_cpu_name);
9199 }9194 }
9200 const char *llvm_target_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features);9195 if (g->zig_target->llvm_cpu_features != nullptr) {
9201 if (llvm_target_features != nullptr) {
9202 args.append("-Xclang");9196 args.append("-Xclang");
9203 args.append("-target-feature");9197 args.append("-target-feature");
9204 args.append("-Xclang");9198 args.append("-Xclang");
9205 args.append(llvm_target_features);9199 args.append(g->zig_target->llvm_cpu_features);
9206 }9200 }
9207 }9201 }
92089202
...@@ -10406,11 +10400,8 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {...@@ -10406,11 +10400,8 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {
10406 cache_int(ch, g->zig_target->vendor);10400 cache_int(ch, g->zig_target->vendor);
10407 cache_int(ch, g->zig_target->os);10401 cache_int(ch, g->zig_target->os);
10408 cache_int(ch, g->zig_target->abi);10402 cache_int(ch, g->zig_target->abi);
10409 if (g->zig_target->cpu_features != nullptr) {10403 if (g->zig_target->cache_hash != nullptr) {
10410 const char *ptr;10404 cache_str(ch, g->zig_target->cache_hash);
10411 size_t len;
10412 stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len);
10413 cache_str(ch, ptr);
10414 }10405 }
10415 if (g->zig_target->glibc_version != nullptr) {10406 if (g->zig_target->glibc_version != nullptr) {
10416 cache_int(ch, g->zig_target->glibc_version->major);10407 cache_int(ch, g->zig_target->glibc_version->major);
src/error.cpp-1
...@@ -59,7 +59,6 @@ const char *err_str(Error err) {...@@ -59,7 +59,6 @@ const char *err_str(Error err) {
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";61 case ErrorUnknownCpu: return "unknown CPU";
62 case ErrorUnknownSubArchitecture: return "unknown sub-architecture";
63 case ErrorUnknownCpuFeature: return "unknown CPU feature";62 case ErrorUnknownCpuFeature: return "unknown CPU feature";
64 case ErrorInvalidCpuFeatures: return "invalid CPU features";63 case ErrorInvalidCpuFeatures: return "invalid CPU features";
65 case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format";64 case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format";
src/main.cpp+39-47
...@@ -106,8 +106,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {...@@ -106,8 +106,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
106 " --override-lib-dir [arg] override path to Zig lib directory\n"106 " --override-lib-dir [arg] override path to Zig lib directory\n"
107 " -ffunction-sections places each function in a separate section\n"107 " -ffunction-sections places each function in a separate section\n"
108 " -D[macro]=[value] define C [macro] to [value] (1 if [value] omitted)\n"108 " -D[macro]=[value] define C [macro] to [value] (1 if [value] omitted)\n"
109 " -target-cpu [cpu] target one specific CPU by name\n"109 " -mcpu [cpu] specify target CPU and feature set\n"
110 " -target-feature [features] specify the set of CPU features to target\n"
111 " -code-model [default|tiny| set target code model\n"110 " -code-model [default|tiny| set target code model\n"
112 " small|kernel|\n"111 " small|kernel|\n"
113 " medium|large]\n"112 " medium|large]\n"
...@@ -238,6 +237,14 @@ static int zig_error_no_build_file(void) {...@@ -238,6 +237,14 @@ static int zig_error_no_build_file(void) {
238 return EXIT_FAILURE;237 return EXIT_FAILURE;
239}238}
240239
240static bool str_starts_with(const char *s1, const char *s2) {
241 size_t s2_len = strlen(s2);
242 if (strlen(s1) < s2_len) {
243 return false;
244 }
245 return memcmp(s1, s2, s2_len) == 0;
246}
247
241extern "C" int ZigClang_main(int argc, char **argv);248extern "C" int ZigClang_main(int argc, char **argv);
242249
243#ifdef ZIG_ENABLE_MEM_PROFILE250#ifdef ZIG_ENABLE_MEM_PROFILE
...@@ -447,8 +454,7 @@ static int main0(int argc, char **argv) {...@@ -447,8 +454,7 @@ static int main0(int argc, char **argv) {
447 WantStackCheck want_stack_check = WantStackCheckAuto;454 WantStackCheck want_stack_check = WantStackCheckAuto;
448 WantCSanitize want_sanitize_c = WantCSanitizeAuto;455 WantCSanitize want_sanitize_c = WantCSanitizeAuto;
449 bool function_sections = false;456 bool function_sections = false;
450 const char *cpu = nullptr;457 const char *mcpu = nullptr;
451 const char *features = nullptr;
452 CodeModel code_model = CodeModelDefault;458 CodeModel code_model = CodeModelDefault;
453459
454 ZigList<const char *> llvm_argv = {0};460 ZigList<const char *> llvm_argv = {0};
...@@ -716,6 +722,8 @@ static int main0(int argc, char **argv) {...@@ -716,6 +722,8 @@ static int main0(int argc, char **argv) {
716 emit_llvm_ir = true;722 emit_llvm_ir = true;
717 } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) {723 } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) {
718 emit_llvm_ir = false;724 emit_llvm_ir = false;
725 } else if (str_starts_with(arg, "-mcpu=")) {
726 mcpu = arg + strlen("-mcpu=");
719 } else if (i + 1 >= argc) {727 } else if (i + 1 >= argc) {
720 fprintf(stderr, "Expected another argument after %s\n", arg);728 fprintf(stderr, "Expected another argument after %s\n", arg);
721 return print_error_usage(arg0);729 return print_error_usage(arg0);
...@@ -892,10 +900,8 @@ static int main0(int argc, char **argv) {...@@ -892,10 +900,8 @@ static int main0(int argc, char **argv) {
892 , argv[i]);900 , argv[i]);
893 return EXIT_FAILURE;901 return EXIT_FAILURE;
894 }902 }
895 } else if (strcmp(arg, "-target-cpu") == 0) {903 } else if (strcmp(arg, "-mcpu") == 0) {
896 cpu = argv[i];904 mcpu = argv[i];
897 } else if (strcmp(arg, "-target-feature") == 0) {
898 features = argv[i];
899 } else {905 } else {
900 fprintf(stderr, "Invalid argument: %s\n", arg);906 fprintf(stderr, "Invalid argument: %s\n", arg);
901 return print_error_usage(arg0);907 return print_error_usage(arg0);
...@@ -971,55 +977,41 @@ static int main0(int argc, char **argv) {...@@ -971,55 +977,41 @@ static int main0(int argc, char **argv) {
971 init_all_targets();977 init_all_targets();
972978
973 ZigTarget target;979 ZigTarget target;
974 if (target_string == nullptr) {980 if ((err = target_parse_triple(&target, target_string, mcpu))) {
975 get_native_target(&target);981 if (err == ErrorUnknownArchitecture && target.arch != ZigLLVM_UnknownArch) {
976 if (target_glibc != nullptr) {982 fprintf(stderr, "'%s' requires a sub-architecture. Try one of these:\n",
977 fprintf(stderr, "-target-glibc provided but no -target parameter\n");983 target_arch_name(target.arch));
978 return print_error_usage(arg0);984 SubArchList sub_arch_list = target_subarch_list(target.arch);
979 }985 size_t subarch_count = target_subarch_count(sub_arch_list);
980 } else {986 for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) {
981 if ((err = target_parse_triple(&target, target_string))) {987 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
982 if (err == ErrorUnknownArchitecture && target.arch != ZigLLVM_UnknownArch) {988 fprintf(stderr, " %s%s\n", target_arch_name(target.arch), target_subarch_name(sub));
983 fprintf(stderr, "'%s' requires a sub-architecture. Try one of these:\n",
984 target_arch_name(target.arch));
985 SubArchList sub_arch_list = target_subarch_list(target.arch);
986 size_t subarch_count = target_subarch_count(sub_arch_list);
987 for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) {
988 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
989 fprintf(stderr, " %s%s\n", target_arch_name(target.arch), target_subarch_name(sub));
990 }
991 return print_error_usage(arg0);
992 } else {
993 fprintf(stderr, "invalid target: %s\n", err_str(err));
994 return print_error_usage(arg0);
995 }989 }
990 return print_error_usage(arg0);
991 } else {
992 fprintf(stderr, "invalid target: %s\n", err_str(err));
993 return print_error_usage(arg0);
996 }994 }
997 if (target_is_glibc(&target)) {995 }
998 target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>();996 if (target_is_glibc(&target)) {
997 target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>();
999998
1000 if (target_glibc != nullptr) {999 if (target_glibc != nullptr) {
1001 if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) {1000 if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) {
1002 fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err));1001 fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err));
1003 return print_error_usage(arg0);1002 return print_error_usage(arg0);
1004 }
1005 } else {
1006 target_init_default_glibc_version(&target);
1007 }1003 }
1008 } else if (target_glibc != nullptr) {1004 } else {
1009 fprintf(stderr, "'%s' is not a glibc-compatible target", target_string);1005 target_init_default_glibc_version(&target);
1010 return print_error_usage(arg0);
1011 }1006 }
1007 } else if (target_glibc != nullptr) {
1008 fprintf(stderr, "'%s' is not a glibc-compatible target", target_string);
1009 return print_error_usage(arg0);
1012 }1010 }
10131011
1014 Buf zig_triple_buf = BUF_INIT;1012 Buf zig_triple_buf = BUF_INIT;
1015 target_triple_zig(&zig_triple_buf, &target);1013 target_triple_zig(&zig_triple_buf, &target);
10161014
1017 const char *stage2_triple_arg = target.is_native ? nullptr : buf_ptr(&zig_triple_buf);
1018 if ((err = stage2_cpu_features_parse(&target.cpu_features, stage2_triple_arg, cpu, features))) {
1019 fprintf(stderr, "unable to initialize CPU features: %s\n", err_str(err));
1020 return main_exit(root_progress_node, EXIT_FAILURE);
1021 }
1022
1023 // If both output_dir and enable_cache are provided, and doing build-lib, we1015 // If both output_dir and enable_cache are provided, and doing build-lib, we
1024 // will just do a file copy at the end. This helps when bootstrapping zig from zig01016 // will just do a file copy at the end. This helps when bootstrapping zig from zig0
1025 // because we want to pass something like this:1017 // because we want to pass something like this:
src/stage2.cpp+50-43
...@@ -4,6 +4,7 @@...@@ -4,6 +4,7 @@
4#include "stage2.h"4#include "stage2.h"
5#include "util.hpp"5#include "util.hpp"
6#include "zig_llvm.h"6#include "zig_llvm.h"
7#include "target.hpp"
7#include <stdio.h>8#include <stdio.h>
8#include <stdlib.h>9#include <stdlib.h>
9#include <string.h>10#include <string.h>
...@@ -90,54 +91,60 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {}...@@ -90,54 +91,60 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {}
90void stage2_progress_disable_tty(Stage2Progress *progress) {}91void stage2_progress_disable_tty(Stage2Progress *progress) {}
91void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){}92void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){}
9293
93struct Stage2CpuFeatures {94Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, const char *mcpu) {
94 const char *llvm_cpu_name;95 Error err;
95 const char *llvm_cpu_features;
96 const char *builtin_str;
97 const char *cache_hash;
98};
9996
100Error stage2_cpu_features_parse(struct Stage2CpuFeatures **out, const char *zig_triple,
101 const char *cpu_name, const char *cpu_features)
102{
103 if (zig_triple == nullptr) {97 if (zig_triple == nullptr) {
104 Stage2CpuFeatures *result = heap::c_allocator.create<Stage2CpuFeatures>();98 get_native_target(target);
105 result->llvm_cpu_name = ZigLLVMGetHostCPUName();99
106 result->llvm_cpu_features = ZigLLVMGetNativeFeatures();100 target->llvm_cpu_name = ZigLLVMGetHostCPUName();
107 result->builtin_str = "arch.getBaselineCpuFeatures();\n";101 target->llvm_cpu_features = ZigLLVMGetNativeFeatures();
108 result->cache_hash = "native\n\n";102 target->builtin_str = "Target.Cpu.baseline(arch);\n";
109 *out = result;103 target->cache_hash = "native\n\n";
110 return ErrorNone;104 } else {
111 }105 // first initialize all to zero
112 if (cpu_name == nullptr && cpu_features == nullptr) {106 *target = {};
113 Stage2CpuFeatures *result = heap::c_allocator.create<Stage2CpuFeatures>();107
114 result->builtin_str = "arch.getBaselineCpuFeatures();\n";108 SplitIterator it = memSplit(str(zig_triple), str("-"));
115 result->cache_hash = "\n\n";109
116 *out = result;110 Optional<Slice<uint8_t>> opt_archsub = SplitIterator_next(&it);
117 return ErrorNone;111 Optional<Slice<uint8_t>> opt_os = SplitIterator_next(&it);
112 Optional<Slice<uint8_t>> opt_abi = SplitIterator_next(&it);
113
114 if (!opt_archsub.is_some)
115 return ErrorMissingArchitecture;
116
117 if ((err = target_parse_archsub(&target->arch, &target->sub_arch,
118 (char*)opt_archsub.value.ptr, opt_archsub.value.len)))
119 {
120 return err;
121 }
122
123 if (!opt_os.is_some)
124 return ErrorMissingOperatingSystem;
125
126 if ((err = target_parse_os(&target->os, (char*)opt_os.value.ptr, opt_os.value.len))) {
127 return err;
128 }
129
130 if (opt_abi.is_some) {
131 if ((err = target_parse_abi(&target->abi, (char*)opt_abi.value.ptr, opt_abi.value.len))) {
132 return err;
133 }
134 } else {
135 target->abi = target_default_abi(target->arch, target->os);
136 }
137
138 target->builtin_str = "Target.Cpu.baseline(arch);\n";
139 target->cache_hash = "\n\n";
118 }140 }
119141
120 const char *msg = "stage0 called stage2_cpu_features_parse with non-null cpu name or features";142 if (mcpu != nullptr) {
121 stage2_panic(msg, strlen(msg));143 const char *msg = "stage0 can't handle CPU/features in the target";
122}144 stage2_panic(msg, strlen(msg));
145 }
123146
124void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features,147 return ErrorNone;
125 const char **ptr, size_t *len)
126{
127 *ptr = cpu_features->cache_hash;
128 *len = strlen(cpu_features->cache_hash);
129}
130const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features) {
131 return cpu_features->llvm_cpu_name;
132}
133const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features) {
134 return cpu_features->llvm_cpu_features;
135}
136void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features,
137 const char **ptr, size_t *len)
138{
139 *ptr = cpu_features->builtin_str;
140 *len = strlen(cpu_features->builtin_str);
141}148}
142149
143int stage2_cmd_targets(const char *zig_triple) {150int stage2_cmd_targets(const char *zig_triple) {
src/stage2.h+14-25
...@@ -81,7 +81,6 @@ enum Error {...@@ -81,7 +81,6 @@ enum Error {
81 ErrorIsAsync,81 ErrorIsAsync,
82 ErrorImportOutsidePkgPath,82 ErrorImportOutsidePkgPath,
83 ErrorUnknownCpu,83 ErrorUnknownCpu,
84 ErrorUnknownSubArchitecture,
85 ErrorUnknownCpuFeature,84 ErrorUnknownCpuFeature,
86 ErrorInvalidCpuFeatures,85 ErrorInvalidCpuFeatures,
87 ErrorInvalidLlvmCpuFeaturesFormat,86 ErrorInvalidLlvmCpuFeaturesFormat,
...@@ -200,27 +199,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node);...@@ -200,27 +199,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node);
200ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node,199ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node,
201 size_t completed_count, size_t estimated_total_items);200 size_t completed_count, size_t estimated_total_items);
202201
203// ABI warning
204struct Stage2CpuFeatures;
205
206// ABI warning
207ZIG_EXTERN_C enum Error stage2_cpu_features_parse(struct Stage2CpuFeatures **result,
208 const char *zig_triple, const char *cpu_name, const char *cpu_features);
209
210// ABI warning
211ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const struct Stage2CpuFeatures *cpu_features);
212
213// ABI warning
214ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_features(const struct Stage2CpuFeatures *cpu_features);
215
216// ABI warning
217ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeatures *cpu_features,
218 const char **ptr, size_t *len);
219
220// ABI warning
221ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features,
222 const char **ptr, size_t *len);
223
224// ABI warning202// ABI warning
225ZIG_EXTERN_C int stage2_cmd_targets(const char *zig_triple);203ZIG_EXTERN_C int stage2_cmd_targets(const char *zig_triple);
226204
...@@ -296,22 +274,33 @@ struct ZigGLibCVersion {...@@ -296,22 +274,33 @@ struct ZigGLibCVersion {
296 uint32_t patch;274 uint32_t patch;
297};275};
298276
277struct Stage2TargetData;
278
299// ABI warning279// ABI warning
300struct ZigTarget {280struct ZigTarget {
301 enum ZigLLVM_ArchType arch;281 enum ZigLLVM_ArchType arch;
302 enum ZigLLVM_SubArchType sub_arch;282 enum ZigLLVM_SubArchType sub_arch;
283
303 enum ZigLLVM_VendorType vendor;284 enum ZigLLVM_VendorType vendor;
304 Os os;
305 enum ZigLLVM_EnvironmentType abi;285 enum ZigLLVM_EnvironmentType abi;
306 struct ZigGLibCVersion *glibc_version; // null means default286
307 struct Stage2CpuFeatures *cpu_features;287 Os os;
308 bool is_native;288 bool is_native;
289
290 struct ZigGLibCVersion *glibc_version; // null means default
291
292 const char *llvm_cpu_name;
293 const char *llvm_cpu_features;
294 const char *builtin_str;
295 const char *cache_hash;
309};296};
310297
311// ABI warning298// ABI warning
312ZIG_EXTERN_C enum Error stage2_detect_dynamic_linker(const struct ZigTarget *target,299ZIG_EXTERN_C enum Error stage2_detect_dynamic_linker(const struct ZigTarget *target,
313 char **out_ptr, size_t *out_len);300 char **out_ptr, size_t *out_len);
314301
302// ABI warning
303ZIG_EXTERN_C enum Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, const char *mcpu);
315304
316305
317// ABI warning306// ABI warning
src/target.cpp+2-36
...@@ -776,42 +776,8 @@ Error target_parse_abi(ZigLLVM_EnvironmentType *out_abi, const char *abi_ptr, si...@@ -776,42 +776,8 @@ Error target_parse_abi(ZigLLVM_EnvironmentType *out_abi, const char *abi_ptr, si
776 return ErrorUnknownABI;776 return ErrorUnknownABI;
777}777}
778778
779Error target_parse_triple(ZigTarget *target, const char *triple) {779Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu) {
780 Error err;780 return stage2_target_parse(target, triple, mcpu);
781
782 // first initialize all to zero
783 *target = {};
784
785 SplitIterator it = memSplit(str(triple), str("-"));
786
787 Optional<Slice<uint8_t>> opt_archsub = SplitIterator_next(&it);
788 Optional<Slice<uint8_t>> opt_os = SplitIterator_next(&it);
789 Optional<Slice<uint8_t>> opt_abi = SplitIterator_next(&it);
790
791 if (!opt_archsub.is_some)
792 return ErrorMissingArchitecture;
793
794 if ((err = target_parse_archsub(&target->arch, &target->sub_arch,
795 (char*)opt_archsub.value.ptr, opt_archsub.value.len)))
796 {
797 return err;
798 }
799
800 if (!opt_os.is_some)
801 return ErrorMissingOperatingSystem;
802
803 if ((err = target_parse_os(&target->os, (char*)opt_os.value.ptr, opt_os.value.len))) {
804 return err;
805 }
806
807 if (opt_abi.is_some) {
808 if ((err = target_parse_abi(&target->abi, (char*)opt_abi.value.ptr, opt_abi.value.len))) {
809 return err;
810 }
811 } else {
812 target->abi = target_default_abi(target->arch, target->os);
813 }
814 return ErrorNone;
815}781}
816782
817const char *target_arch_name(ZigLLVM_ArchType arch) {783const char *target_arch_name(ZigLLVM_ArchType arch) {
src/target.hpp+1-1
...@@ -50,7 +50,7 @@ enum CIntType {...@@ -50,7 +50,7 @@ enum CIntType {
50 CIntTypeCount,50 CIntTypeCount,
51};51};
5252
53Error target_parse_triple(ZigTarget *target, const char *triple);53Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu);
54Error target_parse_archsub(ZigLLVM_ArchType *arch, ZigLLVM_SubArchType *sub,54Error target_parse_archsub(ZigLLVM_ArchType *arch, ZigLLVM_SubArchType *sub,
55 const char *archsub_ptr, size_t archsub_len);55 const char *archsub_ptr, size_t archsub_len);
56Error target_parse_os(Os *os, const char *os_ptr, size_t os_len);56Error target_parse_os(Os *os, const char *os_ptr, size_t os_len);
test/tests.zig+27-54
...@@ -55,20 +55,18 @@ const test_targets = blk: {...@@ -55,20 +55,18 @@ const test_targets = blk: {
55 TestTarget{55 TestTarget{
56 .target = Target{56 .target = Target{
57 .Cross = CrossTarget{57 .Cross = CrossTarget{
58 .cpu = Target.Cpu.baseline(.x86_64),
58 .os = .linux,59 .os = .linux,
59 .arch = .x86_64,
60 .abi = .none,60 .abi = .none,
61 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
62 },61 },
63 },62 },
64 },63 },
65 TestTarget{64 TestTarget{
66 .target = Target{65 .target = Target{
67 .Cross = CrossTarget{66 .Cross = CrossTarget{
67 .cpu = Target.Cpu.baseline(.x86_64),
68 .os = .linux,68 .os = .linux,
69 .arch = .x86_64,
70 .abi = .gnu,69 .abi = .gnu,
71 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
72 },70 },
73 },71 },
74 .link_libc = true,72 .link_libc = true,
...@@ -76,9 +74,8 @@ const test_targets = blk: {...@@ -76,9 +74,8 @@ const test_targets = blk: {
76 TestTarget{74 TestTarget{
77 .target = Target{75 .target = Target{
78 .Cross = CrossTarget{76 .Cross = CrossTarget{
77 .cpu = Target.Cpu.baseline(.x86_64),
79 .os = .linux,78 .os = .linux,
80 .arch = .x86_64,
81 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
82 .abi = .musl,79 .abi = .musl,
83 },80 },
84 },81 },
...@@ -88,9 +85,8 @@ const test_targets = blk: {...@@ -88,9 +85,8 @@ const test_targets = blk: {
88 TestTarget{85 TestTarget{
89 .target = Target{86 .target = Target{
90 .Cross = CrossTarget{87 .Cross = CrossTarget{
88 .cpu = Target.Cpu.baseline(.i386),
91 .os = .linux,89 .os = .linux,
92 .arch = .i386,
93 .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(),
94 .abi = .none,90 .abi = .none,
95 },91 },
96 },92 },
...@@ -98,9 +94,8 @@ const test_targets = blk: {...@@ -98,9 +94,8 @@ const test_targets = blk: {
98 TestTarget{94 TestTarget{
99 .target = Target{95 .target = Target{
100 .Cross = CrossTarget{96 .Cross = CrossTarget{
97 .cpu = Target.Cpu.baseline(.i386),
101 .os = .linux,98 .os = .linux,
102 .arch = .i386,
103 .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(),
104 .abi = .musl,99 .abi = .musl,
105 },100 },
106 },101 },
...@@ -110,9 +105,8 @@ const test_targets = blk: {...@@ -110,9 +105,8 @@ const test_targets = blk: {
110 TestTarget{105 TestTarget{
111 .target = Target{106 .target = Target{
112 .Cross = CrossTarget{107 .Cross = CrossTarget{
108 .cpu = Target.Cpu.baseline(.aarch64),
113 .os = .linux,109 .os = .linux,
114 .arch = Target.Arch{ .aarch64 = .v8a },
115 .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(),
116 .abi = .none,110 .abi = .none,
117 },111 },
118 },112 },
...@@ -120,9 +114,8 @@ const test_targets = blk: {...@@ -120,9 +114,8 @@ const test_targets = blk: {
120 TestTarget{114 TestTarget{
121 .target = Target{115 .target = Target{
122 .Cross = CrossTarget{116 .Cross = CrossTarget{
117 .cpu = Target.Cpu.baseline(.aarch64),
123 .os = .linux,118 .os = .linux,
124 .arch = Target.Arch{ .aarch64 = .v8a },
125 .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(),
126 .abi = .musl,119 .abi = .musl,
127 },120 },
128 },121 },
...@@ -131,9 +124,8 @@ const test_targets = blk: {...@@ -131,9 +124,8 @@ const test_targets = blk: {
131 TestTarget{124 TestTarget{
132 .target = Target{125 .target = Target{
133 .Cross = CrossTarget{126 .Cross = CrossTarget{
127 .cpu = Target.Cpu.baseline(.aarch64),
134 .os = .linux,128 .os = .linux,
135 .arch = Target.Arch{ .aarch64 = .v8a },
136 .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(),
137 .abi = .gnu,129 .abi = .gnu,
138 },130 },
139 },131 },
...@@ -141,45 +133,32 @@ const test_targets = blk: {...@@ -141,45 +133,32 @@ const test_targets = blk: {
141 },133 },
142134
143 TestTarget{135 TestTarget{
144 .target = Target{136 .target = Target.parse(.{
145 .Cross = CrossTarget{137 .arch_os_abi = "arm-linux-none",
146 .os = .linux,138 .cpu = "generic+v8a",
147 .arch = Target.Arch{ .arm = .v8a },139 }) catch unreachable,
148 .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(),
149 .abi = .none,
150 },
151 },
152 },140 },
153 TestTarget{141 TestTarget{
154 .target = Target{142 .target = Target.parse(.{
155 .Cross = CrossTarget{143 .arch_os_abi = "arm-linux-musleabihf",
156 .os = .linux,144 .cpu = "generic+v8a",
157 .arch = Target.Arch{ .arm = .v8a },145 }) catch unreachable,
158 .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(),
159 .abi = .musleabihf,
160 },
161 },
162 .link_libc = true,146 .link_libc = true,
163 },147 },
164 // TODO https://github.com/ziglang/zig/issues/3287148 // TODO https://github.com/ziglang/zig/issues/3287
165 //TestTarget{149 //TestTarget{
166 // .target = Target{150 // .target = Target.parse(.{
167 // .Cross = CrossTarget{151 // .arch_os_abi = "arm-linux-gnueabihf",
168 // .os = .linux,152 // .cpu = "generic+v8a",
169 // .arch = Target.Arch{ .arm = .v8a },153 // }) catch unreachable,
170 // .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(),
171 // .abi = .gnueabihf,
172 // },
173 // },
174 // .link_libc = true,154 // .link_libc = true,
175 //},155 //},
176156
177 TestTarget{157 TestTarget{
178 .target = Target{158 .target = Target{
179 .Cross = CrossTarget{159 .Cross = CrossTarget{
160 .cpu = Target.Cpu.baseline(.mipsel),
180 .os = .linux,161 .os = .linux,
181 .arch = .mipsel,
182 .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(),
183 .abi = .none,162 .abi = .none,
184 },163 },
185 },164 },
...@@ -187,9 +166,8 @@ const test_targets = blk: {...@@ -187,9 +166,8 @@ const test_targets = blk: {
187 TestTarget{166 TestTarget{
188 .target = Target{167 .target = Target{
189 .Cross = CrossTarget{168 .Cross = CrossTarget{
169 .cpu = Target.Cpu.baseline(.mipsel),
190 .os = .linux,170 .os = .linux,
191 .arch = .mipsel,
192 .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(),
193 .abi = .musl,171 .abi = .musl,
194 },172 },
195 },173 },
...@@ -199,9 +177,8 @@ const test_targets = blk: {...@@ -199,9 +177,8 @@ const test_targets = blk: {
199 TestTarget{177 TestTarget{
200 .target = Target{178 .target = Target{
201 .Cross = CrossTarget{179 .Cross = CrossTarget{
180 .cpu = Target.Cpu.baseline(.x86_64),
202 .os = .macosx,181 .os = .macosx,
203 .arch = .x86_64,
204 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
205 .abi = .gnu,182 .abi = .gnu,
206 },183 },
207 },184 },
...@@ -212,9 +189,8 @@ const test_targets = blk: {...@@ -212,9 +189,8 @@ const test_targets = blk: {
212 TestTarget{189 TestTarget{
213 .target = Target{190 .target = Target{
214 .Cross = CrossTarget{191 .Cross = CrossTarget{
192 .cpu = Target.Cpu.baseline(.i386),
215 .os = .windows,193 .os = .windows,
216 .arch = .i386,
217 .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(),
218 .abi = .msvc,194 .abi = .msvc,
219 },195 },
220 },196 },
...@@ -223,9 +199,8 @@ const test_targets = blk: {...@@ -223,9 +199,8 @@ const test_targets = blk: {
223 TestTarget{199 TestTarget{
224 .target = Target{200 .target = Target{
225 .Cross = CrossTarget{201 .Cross = CrossTarget{
202 .cpu = Target.Cpu.baseline(.x86_64),
226 .os = .windows,203 .os = .windows,
227 .arch = .x86_64,
228 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
229 .abi = .msvc,204 .abi = .msvc,
230 },205 },
231 },206 },
...@@ -234,9 +209,8 @@ const test_targets = blk: {...@@ -234,9 +209,8 @@ const test_targets = blk: {
234 TestTarget{209 TestTarget{
235 .target = Target{210 .target = Target{
236 .Cross = CrossTarget{211 .Cross = CrossTarget{
212 .cpu = Target.Cpu.baseline(.i386),
237 .os = .windows,213 .os = .windows,
238 .arch = .i386,
239 .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(),
240 .abi = .gnu,214 .abi = .gnu,
241 },215 },
242 },216 },
...@@ -246,9 +220,8 @@ const test_targets = blk: {...@@ -246,9 +220,8 @@ const test_targets = blk: {
246 TestTarget{220 TestTarget{
247 .target = Target{221 .target = Target{
248 .Cross = CrossTarget{222 .Cross = CrossTarget{
223 .cpu = Target.Cpu.baseline(.x86_64),
249 .os = .windows,224 .os = .windows,
250 .arch = .x86_64,
251 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
252 .abi = .gnu,225 .abi = .gnu,
253 },226 },
254 },227 },