authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-21 14:19:20-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-02-21 14:19:20-05:00
log10e0b071354d8a1b4ab70041dfdd06a008bd6d3d
treea705cb0f0e25fceb5263e10fc027011e0ee26f76
parente381a42de9c0f0c5439a926b0ac99026a0373f49
parent71573584cdfb1ddb176681fcb7d1544cac7a72ca
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4509 from ziglang/sub-architecture-annihilation

sub-architecture annihilation

35 files changed, 2440 insertions(+), 3457 deletions(-)

lib/std/build.zig+13-23
...@@ -1909,43 +1909,33 @@ pub const LibExeObjStep = struct {...@@ -1909,43 +1909,33 @@ pub const LibExeObjStep = struct {
1909 try zig_args.append(self.target.zigTriple(builder.allocator) catch unreachable);1909 try zig_args.append(self.target.zigTriple(builder.allocator) catch unreachable);
19101910
1911 const all_features = self.target.getArch().allFeaturesList();1911 const all_features = self.target.getArch().allFeaturesList();
1912 var populated_cpu_features = cross.cpu_features.cpu.features;1912 var populated_cpu_features = cross.cpu.model.features;
1913 if (self.target.getArch().subArchFeature()) |sub_arch_index| {
1914 populated_cpu_features.addFeature(sub_arch_index);
1915 }
1916 populated_cpu_features.populateDependencies(all_features);1913 populated_cpu_features.populateDependencies(all_features);
19171914
1918 if (populated_cpu_features.eql(cross.cpu_features.features)) {1915 if (populated_cpu_features.eql(cross.cpu.features)) {
1919 // The CPU name alone is sufficient.1916 // The CPU name alone is sufficient.
1920 // If it is the baseline CPU, no command line args are required.1917 // If it is the baseline CPU, no command line args are required.
1921 if (cross.cpu_features.cpu != self.target.getArch().getBaselineCpuFeatures().cpu) {1918 if (cross.cpu.model != Target.Cpu.baseline(self.target.getArch()).model) {
1922 try zig_args.append("-target-cpu");1919 try zig_args.append("-mcpu");
1923 try zig_args.append(cross.cpu_features.cpu.name);1920 try zig_args.append(cross.cpu.model.name);
1924 }1921 }
1925 } else {1922 } else {
1926 try zig_args.append("-target-cpu");1923 var mcpu_buffer = try std.Buffer.init(builder.allocator, "-mcpu=");
1927 try zig_args.append(cross.cpu_features.cpu.name);1924 try mcpu_buffer.append(cross.cpu.model.name);
19281925
1929 try zig_args.append("-target-feature");
1930 var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0);
1931 for (all_features) |feature, i_usize| {1926 for (all_features) |feature, i_usize| {
1932 const i = @intCast(Target.Cpu.Feature.Set.Index, i_usize);1927 const i = @intCast(Target.Cpu.Feature.Set.Index, i_usize);
1933 const in_cpu_set = populated_cpu_features.isEnabled(i);1928 const in_cpu_set = populated_cpu_features.isEnabled(i);
1934 const in_actual_set = cross.cpu_features.features.isEnabled(i);1929 const in_actual_set = cross.cpu.features.isEnabled(i);
1935 if (in_cpu_set and !in_actual_set) {1930 if (in_cpu_set and !in_actual_set) {
1936 try feature_str_buffer.appendByte('-');1931 try mcpu_buffer.appendByte('-');
1937 try feature_str_buffer.append(feature.name);1932 try mcpu_buffer.append(feature.name);
1938 try feature_str_buffer.appendByte(',');
1939 } else if (!in_cpu_set and in_actual_set) {1933 } else if (!in_cpu_set and in_actual_set) {
1940 try feature_str_buffer.appendByte('+');1934 try mcpu_buffer.appendByte('+');
1941 try feature_str_buffer.append(feature.name);1935 try mcpu_buffer.append(feature.name);
1942 try feature_str_buffer.appendByte(',');
1943 }1936 }
1944 }1937 }
1945 if (mem.endsWith(u8, feature_str_buffer.toSliceConst(), ",")) {1938 try zig_args.append(mcpu_buffer.toSliceConst());
1946 feature_str_buffer.shrink(feature_str_buffer.len() - 1);
1947 }
1948 try zig_args.append(feature_str_buffer.toSliceConst());
1949 }1939 }
1950 },1940 },
1951 }1941 }
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/os/linux/tls.zig+1-1
...@@ -152,7 +152,7 @@ pub fn setThreadPointer(addr: usize) void {...@@ -152,7 +152,7 @@ pub fn setThreadPointer(addr: usize) void {
152 : [addr] "r" (addr)152 : [addr] "r" (addr)
153 );153 );
154 },154 },
155 .arm => |arm| {155 .arm => {
156 const rc = std.os.linux.syscall1(std.os.linux.SYS_set_tls, addr);156 const rc = std.os.linux.syscall1(std.os.linux.SYS_set_tls, addr);
157 assert(rc == 0);157 assert(rc == 0);
158 },158 },
lib/std/target.zig+579-643
...@@ -47,6 +47,16 @@ pub const Target = union(enum) {...@@ -47,6 +47,16 @@ 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 const info = @typeInfo(Os);
53 inline for (info.Enum.fields) |field| {
54 if (mem.eql(u8, text, field.name)) {
55 return @field(Os, field.name);
56 }
57 }
58 return error.UnknownOperatingSystem;
59 }
50 };60 };
5161
52 pub const aarch64 = @import("target/aarch64.zig");62 pub const aarch64 = @import("target/aarch64.zig");
...@@ -65,457 +75,6 @@ pub const Target = union(enum) {...@@ -65,457 +75,6 @@ pub const Target = union(enum) {
65 pub const wasm = @import("target/wasm.zig");75 pub const wasm = @import("target/wasm.zig");
66 pub const x86 = @import("target/x86.zig");76 pub const x86 = @import("target/x86.zig");
6777
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 {78 pub const Abi = enum {
520 none,79 none,
521 gnu,80 gnu,
...@@ -539,11 +98,102 @@ pub const Target = union(enum) {...@@ -539,11 +98,102 @@ pub const Target = union(enum) {
539 coreclr,98 coreclr,
540 simulator,99 simulator,
541 macabi,100 macabi,
101
102 pub fn default(arch: Cpu.Arch, target_os: Os) Abi {
103 switch (arch) {
104 .wasm32, .wasm64 => return .musl,
105 else => {},
106 }
107 switch (target_os) {
108 .freestanding,
109 .ananas,
110 .cloudabi,
111 .dragonfly,
112 .lv2,
113 .solaris,
114 .haiku,
115 .minix,
116 .rtems,
117 .nacl,
118 .cnk,
119 .aix,
120 .cuda,
121 .nvcl,
122 .amdhsa,
123 .ps4,
124 .elfiamcu,
125 .mesa3d,
126 .contiki,
127 .amdpal,
128 .hermit,
129 .other,
130 => return .eabi,
131 .openbsd,
132 .macosx,
133 .freebsd,
134 .ios,
135 .tvos,
136 .watchos,
137 .fuchsia,
138 .kfreebsd,
139 .netbsd,
140 .hurd,
141 => return .gnu,
142 .windows,
143 .uefi,
144 => return .msvc,
145 .linux,
146 .wasi,
147 .emscripten,
148 => return .musl,
149 }
150 }
151
152 pub fn parse(text: []const u8) !Abi {
153 const info = @typeInfo(Abi);
154 inline for (info.Enum.fields) |field| {
155 if (mem.eql(u8, text, field.name)) {
156 return @field(Abi, field.name);
157 }
158 }
159 return error.UnknownApplicationBinaryInterface;
160 }
161 };
162
163 pub const ObjectFormat = enum {
164 unknown,
165 coff,
166 elf,
167 macho,
168 wasm,
169 };
170
171 pub const SubSystem = enum {
172 Console,
173 Windows,
174 Posix,
175 Native,
176 EfiApplication,
177 EfiBootServiceDriver,
178 EfiRom,
179 EfiRuntimeDriver,
180 };
181
182 pub const Cross = struct {
183 cpu: Cpu,
184 os: Os,
185 abi: Abi,
542 };186 };
543187
544 pub const Cpu = struct {188 pub const Cpu = struct {
545 name: []const u8,189 /// Architecture
546 llvm_name: ?[:0]const u8,190 arch: Arch,
191
192 /// The CPU model to target. It has a set of features
193 /// which are overridden with the `features` field.
194 model: *const Model,
195
196 /// An explicit list of the entire CPU feature set. It may differ from the specific CPU model's features.
547 features: Feature.Set,197 features: Feature.Set,
548198
549 pub const Feature = struct {199 pub const Feature = struct {
...@@ -569,7 +219,7 @@ pub const Target = union(enum) {...@@ -569,7 +219,7 @@ pub const Target = union(enum) {
569 pub const Set = struct {219 pub const Set = struct {
570 ints: [usize_count]usize,220 ints: [usize_count]usize,
571221
572 pub const needed_bit_count = 174;222 pub const needed_bit_count = 154;
573 pub const byte_count = (needed_bit_count + 7) / 8;223 pub const byte_count = (needed_bit_count + 7) / 8;
574 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);224 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
575 pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize)));225 pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize)));
...@@ -593,6 +243,12 @@ pub const Target = union(enum) {...@@ -593,6 +243,12 @@ pub const Target = union(enum) {
593 set.ints[usize_index] |= @as(usize, 1) << bit_index;243 set.ints[usize_index] |= @as(usize, 1) << bit_index;
594 }244 }
595245
246 /// Adds the specified feature set but not its dependencies.
247 pub fn addFeatureSet(set: *Set, other_set: Set) void {
248 set.ints = @as(@Vector(usize_count, usize), set.ints) |
249 @as(@Vector(usize_count, usize), other_set.ints);
250 }
251
596 /// Removes the specified feature but not its dependents.252 /// Removes the specified feature but not its dependents.
597 pub fn removeFeature(set: *Set, arch_feature_index: Index) void {253 pub fn removeFeature(set: *Set, arch_feature_index: Index) void {
598 const usize_index = arch_feature_index / @bitSizeOf(usize);254 const usize_index = arch_feature_index / @bitSizeOf(usize);
...@@ -608,8 +264,7 @@ pub const Target = union(enum) {...@@ -608,8 +264,7 @@ pub const Target = union(enum) {
608 for (all_features_list) |feature, index_usize| {264 for (all_features_list) |feature, index_usize| {
609 const index = @intCast(Index, index_usize);265 const index = @intCast(Index, index_usize);
610 if (set.isEnabled(index)) {266 if (set.isEnabled(index)) {
611 set.ints = @as(@Vector(usize_count, usize), set.ints) |267 set.addFeatureSet(feature.dependencies);
612 @as(@Vector(usize_count, usize), feature.dependencies.ints);
613 }268 }
614 }269 }
615 const nothing_changed = mem.eql(usize, &old, &set.ints);270 const nothing_changed = mem.eql(usize, &old, &set.ints);
...@@ -644,77 +299,360 @@ pub const Target = union(enum) {...@@ -644,77 +299,360 @@ pub const Target = union(enum) {
644 };299 };
645 }300 }
646 };301 };
647 };
648302
649 pub const ObjectFormat = enum {303 pub const Arch = enum {
650 unknown,304 arm,
651 coff,305 armeb,
652 elf,306 aarch64,
653 macho,307 aarch64_be,
654 wasm,308 aarch64_32,
655 };309 arc,
310 avr,
311 bpfel,
312 bpfeb,
313 hexagon,
314 mips,
315 mipsel,
316 mips64,
317 mips64el,
318 msp430,
319 powerpc,
320 powerpc64,
321 powerpc64le,
322 r600,
323 amdgcn,
324 riscv32,
325 riscv64,
326 sparc,
327 sparcv9,
328 sparcel,
329 s390x,
330 tce,
331 tcele,
332 thumb,
333 thumbeb,
334 i386,
335 x86_64,
336 xcore,
337 nvptx,
338 nvptx64,
339 le32,
340 le64,
341 amdil,
342 amdil64,
343 hsail,
344 hsail64,
345 spir,
346 spir64,
347 kalimba,
348 shave,
349 lanai,
350 wasm32,
351 wasm64,
352 renderscript32,
353 renderscript64,
354
355 pub fn isARM(arch: Arch) bool {
356 return switch (arch) {
357 .arm, .armeb => true,
358 else => false,
359 };
360 }
656361
657 pub const SubSystem = enum {362 pub fn isThumb(arch: Arch) bool {
658 Console,363 return switch (arch) {
659 Windows,364 .thumb, .thumbeb => true,
660 Posix,365 else => false,
661 Native,366 };
662 EfiApplication,367 }
663 EfiBootServiceDriver,
664 EfiRom,
665 EfiRuntimeDriver,
666 };
667368
668 pub const Cross = struct {369 pub fn isWasm(arch: Arch) bool {
669 arch: Arch,370 return switch (arch) {
670 os: Os,371 .wasm32, .wasm64 => true,
671 abi: Abi,372 else => false,
672 cpu_features: CpuFeatures,373 };
673 };374 }
674375
675 pub const CpuFeatures = struct {376 pub fn isRISCV(arch: Arch) bool {
676 /// The CPU to target. It has a set of features377 return switch (arch) {
677 /// which are overridden with the `features` field.378 .riscv32, .riscv64 => true,
678 cpu: *const Cpu,379 else => false,
380 };
381 }
679382
680 /// Explicitly provide the entire CPU feature set.383 pub fn isMIPS(arch: Arch) bool {
681 features: Cpu.Feature.Set,384 return switch (arch) {
385 .mips, .mipsel, .mips64, .mips64el => true,
386 else => false,
387 };
388 }
682389
683 pub fn initFromCpu(arch: Arch, cpu: *const Cpu) CpuFeatures {390 pub fn parseCpuModel(arch: Arch, cpu_name: []const u8) !*const Cpu.Model {
684 var features = cpu.features;391 for (arch.allCpuModels()) |cpu| {
685 if (arch.subArchFeature()) |sub_arch_index| {392 if (mem.eql(u8, cpu_name, cpu.name)) {
686 features.addFeature(sub_arch_index);393 return cpu;
394 }
395 }
396 return error.UnknownCpu;
397 }
398
399 pub fn toElfMachine(arch: Arch) std.elf.EM {
400 return switch (arch) {
401 .avr => ._AVR,
402 .msp430 => ._MSP430,
403 .arc => ._ARC,
404 .arm => ._ARM,
405 .armeb => ._ARM,
406 .hexagon => ._HEXAGON,
407 .le32 => ._NONE,
408 .mips => ._MIPS,
409 .mipsel => ._MIPS_RS3_LE,
410 .powerpc => ._PPC,
411 .r600 => ._NONE,
412 .riscv32 => ._RISCV,
413 .sparc => ._SPARC,
414 .sparcel => ._SPARC,
415 .tce => ._NONE,
416 .tcele => ._NONE,
417 .thumb => ._ARM,
418 .thumbeb => ._ARM,
419 .i386 => ._386,
420 .xcore => ._XCORE,
421 .nvptx => ._NONE,
422 .amdil => ._NONE,
423 .hsail => ._NONE,
424 .spir => ._NONE,
425 .kalimba => ._CSR_KALIMBA,
426 .shave => ._NONE,
427 .lanai => ._LANAI,
428 .wasm32 => ._NONE,
429 .renderscript32 => ._NONE,
430 .aarch64_32 => ._AARCH64,
431 .aarch64 => ._AARCH64,
432 .aarch64_be => ._AARCH64,
433 .mips64 => ._MIPS,
434 .mips64el => ._MIPS_RS3_LE,
435 .powerpc64 => ._PPC64,
436 .powerpc64le => ._PPC64,
437 .riscv64 => ._RISCV,
438 .x86_64 => ._X86_64,
439 .nvptx64 => ._NONE,
440 .le64 => ._NONE,
441 .amdil64 => ._NONE,
442 .hsail64 => ._NONE,
443 .spir64 => ._NONE,
444 .wasm64 => ._NONE,
445 .renderscript64 => ._NONE,
446 .amdgcn => ._NONE,
447 .bpfel => ._BPF,
448 .bpfeb => ._BPF,
449 .sparcv9 => ._SPARCV9,
450 .s390x => ._S390,
451 };
687 }452 }
688 features.populateDependencies(arch.allFeaturesList());453
689 return CpuFeatures{454 pub fn endian(arch: Arch) builtin.Endian {
690 .cpu = cpu,455 return switch (arch) {
691 .features = features,456 .avr,
457 .arm,
458 .aarch64_32,
459 .aarch64,
460 .amdgcn,
461 .amdil,
462 .amdil64,
463 .bpfel,
464 .hexagon,
465 .hsail,
466 .hsail64,
467 .kalimba,
468 .le32,
469 .le64,
470 .mipsel,
471 .mips64el,
472 .msp430,
473 .nvptx,
474 .nvptx64,
475 .sparcel,
476 .tcele,
477 .powerpc64le,
478 .r600,
479 .riscv32,
480 .riscv64,
481 .i386,
482 .x86_64,
483 .wasm32,
484 .wasm64,
485 .xcore,
486 .thumb,
487 .spir,
488 .spir64,
489 .renderscript32,
490 .renderscript64,
491 .shave,
492 => .Little,
493
494 .arc,
495 .armeb,
496 .aarch64_be,
497 .bpfeb,
498 .mips,
499 .mips64,
500 .powerpc,
501 .powerpc64,
502 .thumbeb,
503 .sparc,
504 .sparcv9,
505 .tce,
506 .lanai,
507 .s390x,
508 => .Big,
509 };
510 }
511
512 /// Returns a name that matches the lib/std/target/* directory name.
513 pub fn genericName(arch: Arch) []const u8 {
514 return switch (arch) {
515 .arm, .armeb, .thumb, .thumbeb => "arm",
516 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
517 .avr => "avr",
518 .bpfel, .bpfeb => "bpf",
519 .hexagon => "hexagon",
520 .mips, .mipsel, .mips64, .mips64el => "mips",
521 .msp430 => "msp430",
522 .powerpc, .powerpc64, .powerpc64le => "powerpc",
523 .amdgcn => "amdgpu",
524 .riscv32, .riscv64 => "riscv",
525 .sparc, .sparcv9, .sparcel => "sparc",
526 .s390x => "systemz",
527 .i386, .x86_64 => "x86",
528 .nvptx, .nvptx64 => "nvptx",
529 .wasm32, .wasm64 => "wasm",
530 else => @tagName(arch),
531 };
532 }
533
534 /// All CPU features Zig is aware of, sorted lexicographically by name.
535 pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
536 return switch (arch) {
537 .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
538 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
539 .avr => &avr.all_features,
540 .bpfel, .bpfeb => &bpf.all_features,
541 .hexagon => &hexagon.all_features,
542 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
543 .msp430 => &msp430.all_features,
544 .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
545 .amdgcn => &amdgpu.all_features,
546 .riscv32, .riscv64 => &riscv.all_features,
547 .sparc, .sparcv9, .sparcel => &sparc.all_features,
548 .s390x => &systemz.all_features,
549 .i386, .x86_64 => &x86.all_features,
550 .nvptx, .nvptx64 => &nvptx.all_features,
551 .wasm32, .wasm64 => &wasm.all_features,
552
553 else => &[0]Cpu.Feature{},
554 };
555 }
556
557 /// All processors Zig is aware of, sorted lexicographically by name.
558 pub fn allCpuModels(arch: Arch) []const *const Cpu.Model {
559 return switch (arch) {
560 .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
561 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
562 .avr => avr.all_cpus,
563 .bpfel, .bpfeb => bpf.all_cpus,
564 .hexagon => hexagon.all_cpus,
565 .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
566 .msp430 => msp430.all_cpus,
567 .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
568 .amdgcn => amdgpu.all_cpus,
569 .riscv32, .riscv64 => riscv.all_cpus,
570 .sparc, .sparcv9, .sparcel => sparc.all_cpus,
571 .s390x => systemz.all_cpus,
572 .i386, .x86_64 => x86.all_cpus,
573 .nvptx, .nvptx64 => nvptx.all_cpus,
574 .wasm32, .wasm64 => wasm.all_cpus,
575
576 else => &[0]*const Model{},
577 };
578 }
579
580 pub fn parse(text: []const u8) !Arch {
581 const info = @typeInfo(Arch);
582 inline for (info.Enum.fields) |field| {
583 if (mem.eql(u8, text, field.name)) {
584 return @as(Arch, @field(Arch, field.name));
585 }
586 }
587 return error.UnknownArchitecture;
588 }
589 };
590
591 pub const Model = struct {
592 name: []const u8,
593 llvm_name: ?[:0]const u8,
594 features: Feature.Set,
595
596 pub fn toCpu(model: *const Model, arch: Arch) Cpu {
597 var features = model.features;
598 features.populateDependencies(arch.allFeaturesList());
599 return .{
600 .arch = arch,
601 .model = model,
602 .features = features,
603 };
604 }
605 };
606
607 /// The "default" set of CPU features for cross-compiling. A conservative set
608 /// of features that is expected to be supported on most available hardware.
609 pub fn baseline(arch: Arch) Cpu {
610 const S = struct {
611 const generic_model = Model{
612 .name = "generic",
613 .llvm_name = null,
614 .features = Cpu.Feature.Set.empty,
615 };
616 };
617 const model = switch (arch) {
618 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
619 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic,
620 .avr => &avr.cpu.avr1,
621 .bpfel, .bpfeb => &bpf.cpu.generic,
622 .hexagon => &hexagon.cpu.generic,
623 .mips, .mipsel => &mips.cpu.mips32,
624 .mips64, .mips64el => &mips.cpu.mips64,
625 .msp430 => &msp430.cpu.generic,
626 .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic,
627 .amdgcn => &amdgpu.cpu.generic,
628 .riscv32 => &riscv.cpu.baseline_rv32,
629 .riscv64 => &riscv.cpu.baseline_rv64,
630 .sparc, .sparcv9, .sparcel => &sparc.cpu.generic,
631 .s390x => &systemz.cpu.generic,
632 .i386 => &x86.cpu.pentium4,
633 .x86_64 => &x86.cpu.x86_64,
634 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
635 .wasm32, .wasm64 => &wasm.cpu.generic,
636
637 else => &S.generic_model,
692 };638 };
639 return model.toCpu(arch);
693 }640 }
694 };641 };
695642
696 pub const current = Target{643 pub const current = Target{
697 .Cross = Cross{644 .Cross = Cross{
698 .arch = builtin.arch,645 .cpu = builtin.cpu,
699 .os = builtin.os,646 .os = builtin.os,
700 .abi = builtin.abi,647 .abi = builtin.abi,
701 .cpu_features = builtin.cpu_features,
702 },648 },
703 };649 };
704650
705 pub const stack_align = 16;651 pub const stack_align = 16;
706652
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 {653 pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 {
715 return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{654 return std.fmt.allocPrint(allocator, "{}-{}-{}", .{
716 @tagName(self.getArch()),655 @tagName(self.getArch()),
717 Target.archSubArchName(self.getArch()),
718 @tagName(self.getOs()),656 @tagName(self.getOs()),
719 @tagName(self.getAbi()),657 @tagName(self.getAbi()),
720 });658 });
...@@ -776,139 +714,115 @@ pub const Target = union(enum) {...@@ -776,139 +714,115 @@ pub const Target = union(enum) {
776 });714 });
777 }715 }
778716
779 /// TODO: Support CPU features here?717 pub const ParseOptions = struct {
780 /// https://github.com/ziglang/zig/issues/4261718 /// This is sometimes called a "triple". It looks roughly like this:
781 pub fn parse(text: []const u8) !Target {719 /// riscv64-linux-gnu
782 var it = mem.separate(text, "-");720 /// The fields are, respectively:
783 const arch_name = it.next() orelse return error.MissingArchitecture;721 /// * CPU Architecture
784 const os_name = it.next() orelse return error.MissingOperatingSystem;722 /// * Operating System
785 const abi_name = it.next();723 /// * C ABI (optional)
786 const arch = try parseArchSub(arch_name);724 arch_os_abi: []const u8,
787725
788 var cross = Cross{726 /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"
789 .arch = arch,727 /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features
790 .cpu_features = arch.getBaselineCpuFeatures(),728 /// to remove from the set.
791 .os = try parseOs(os_name),729 cpu_features: []const u8 = "baseline",
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 }
797730
798 pub fn defaultAbi(arch: Arch, target_os: Os) Abi {731 /// If this is provided, the function will populate some information about parsing failures,
799 switch (arch) {732 /// so that user-friendly error messages can be delivered.
800 .wasm32, .wasm64 => return .musl,733 diagnostics: ?*Diagnostics = null,
801 else => {},
802 }
803 switch (target_os) {
804 .freestanding,
805 .ananas,
806 .cloudabi,
807 .dragonfly,
808 .lv2,
809 .solaris,
810 .haiku,
811 .minix,
812 .rtems,
813 .nacl,
814 .cnk,
815 .aix,
816 .cuda,
817 .nvcl,
818 .amdhsa,
819 .ps4,
820 .elfiamcu,
821 .mesa3d,
822 .contiki,
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 }
847734
848 pub const ParseArchSubError = error{735 pub const Diagnostics = struct {
849 UnknownArchitecture,736 /// If the architecture was determined, this will be populated.
850 UnknownSubArchitecture,737 arch: ?Cpu.Arch = null,
851 };
852738
853 pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch {739 /// If the OS was determined, this will be populated.
854 const info = @typeInfo(Arch);740 os: ?Os = null,
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 }
866 }
867 return error.UnknownSubArchitecture;
868 }
869 }
870 }
871 return error.UnknownArchitecture;
872 }
873741
874 pub fn parseOs(text: []const u8) !Os {742 /// If the ABI was determined, this will be populated.
875 const info = @typeInfo(Os);743 abi: ?Abi = null,
876 inline for (info.Enum.fields) |field| {
877 if (mem.eql(u8, text, field.name)) {
878 return @field(Os, field.name);
879 }
880 }
881 return error.UnknownOperatingSystem;
882 }
883744
884 pub fn parseAbi(text: []const u8) !Abi {745 /// If the CPU name was determined, this will be populated.
885 const info = @typeInfo(Abi);746 cpu_name: ?[]const u8 = null,
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 }
893747
894 fn archSubArchName(arch: Arch) []const u8 {748 /// If error.UnknownCpuFeature is returned, this will be populated.
895 return switch (arch) {749 unknown_feature_name: ?[]const u8 = null,
896 .arm => |sub| @tagName(sub),
897 .armeb => |sub| @tagName(sub),
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 };750 };
905 }751 };
906752
907 pub fn subArchName(self: Target) []const u8 {753 pub fn parse(args: ParseOptions) !Target {
908 switch (self) {754 var dummy_diags: ParseOptions.Diagnostics = undefined;
909 .Native => return archSubArchName(builtin.arch),755 var diags = args.diagnostics orelse &dummy_diags;
910 .Cross => |cross| return archSubArchName(cross.arch),756
757 var it = mem.separate(args.arch_os_abi, "-");
758 const arch_name = it.next() orelse return error.MissingArchitecture;
759 const arch = try Cpu.Arch.parse(arch_name);
760 diags.arch = arch;
761
762 const os_name = it.next() orelse return error.MissingOperatingSystem;
763 const os = try Os.parse(os_name);
764 diags.os = os;
765
766 const abi_name = it.next();
767 const abi = if (abi_name) |n| try Abi.parse(n) else Abi.default(arch, os);
768 diags.abi = abi;
769
770 if (it.next() != null) return error.UnexpectedExtraField;
771
772 const all_features = arch.allFeaturesList();
773 var index: usize = 0;
774 while (index < args.cpu_features.len and
775 args.cpu_features[index] != '+' and
776 args.cpu_features[index] != '-')
777 {
778 index += 1;
911 }779 }
780 const cpu_name = args.cpu_features[0..index];
781 diags.cpu_name = cpu_name;
782
783 const cpu: Cpu = if (mem.eql(u8, cpu_name, "baseline")) Cpu.baseline(arch) else blk: {
784 const cpu_model = try arch.parseCpuModel(cpu_name);
785
786 var set = cpu_model.features;
787 while (index < args.cpu_features.len) {
788 const op = args.cpu_features[index];
789 index += 1;
790 const start = index;
791 while (index < args.cpu_features.len and
792 args.cpu_features[index] != '+' and
793 args.cpu_features[index] != '-')
794 {
795 index += 1;
796 }
797 const feature_name = args.cpu_features[start..index];
798 for (all_features) |feature, feat_index_usize| {
799 const feat_index = @intCast(Cpu.Feature.Set.Index, feat_index_usize);
800 if (mem.eql(u8, feature_name, feature.name)) {
801 switch (op) {
802 '+' => set.addFeature(feat_index),
803 '-' => set.removeFeature(feat_index),
804 else => unreachable,
805 }
806 break;
807 }
808 } else {
809 diags.unknown_feature_name = feature_name;
810 return error.UnknownCpuFeature;
811 }
812 }
813 set.populateDependencies(all_features);
814 break :blk .{
815 .arch = arch,
816 .model = cpu_model,
817 .features = set,
818 };
819 };
820 var cross = Cross{
821 .cpu = cpu,
822 .os = os,
823 .abi = abi,
824 };
825 return Target{ .Cross = cross };
912 }826 }
913827
914 pub fn oFileExt(self: Target) []const u8 {828 pub fn oFileExt(self: Target) []const u8 {
...@@ -967,11 +881,15 @@ pub const Target = union(enum) {...@@ -967,11 +881,15 @@ pub const Target = union(enum) {
967 };881 };
968 }882 }
969883
970 pub fn getArch(self: Target) Arch {884 pub fn getCpu(self: Target) Cpu {
971 switch (self) {885 return switch (self) {
972 .Native => return builtin.arch,886 .Native => builtin.cpu,
973 .Cross => |t| return t.arch,887 .Cross => |cross| cross.cpu,
974 }888 };
889 }
890
891 pub fn getArch(self: Target) Cpu.Arch {
892 return self.getCpu().arch;
975 }893 }
976894
977 pub fn getAbi(self: Target) Abi {895 pub fn getAbi(self: Target) Abi {
...@@ -1372,14 +1290,32 @@ pub const Target = union(enum) {...@@ -1372,14 +1290,32 @@ pub const Target = union(enum) {
1372 }1290 }
1373};1291};
13741292
1375test "parseCpuFeatureSet" {1293test "Target.parse" {
1376 const arch: Target.Arch = .x86_64;1294 {
1377 const baseline = arch.getBaselineCpuFeatures();1295 const target = (try Target.parse(.{
1378 const set = try arch.parseCpuFeatureSet(baseline.cpu, "-sse,-avx,-cx8");1296 .arch_os_abi = "x86_64-linux-gnu",
1379 std.testing.expect(!Target.x86.featureSetHas(set, .sse));1297 .cpu_features = "x86_64-sse-sse2-avx-cx8",
1380 std.testing.expect(!Target.x86.featureSetHas(set, .avx));1298 })).Cross;
1381 std.testing.expect(!Target.x86.featureSetHas(set, .cx8));1299
1382 // These are expected because they are part of the baseline1300 std.testing.expect(target.os == .linux);
1383 std.testing.expect(Target.x86.featureSetHas(set, .cmov));1301 std.testing.expect(target.abi == .gnu);
1384 std.testing.expect(Target.x86.featureSetHas(set, .fxsr));1302 std.testing.expect(target.cpu.arch == .x86_64);
1303 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .sse));
1304 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .avx));
1305 std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .cx8));
1306 std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .cmov));
1307 std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .fxsr));
1308 }
1309 {
1310 const target = (try Target.parse(.{
1311 .arch_os_abi = "arm-linux-musleabihf",
1312 .cpu_features = "generic+v8a",
1313 })).Cross;
1314
1315 std.testing.expect(target.os == .linux);
1316 std.testing.expect(target.abi == .musleabihf);
1317 std.testing.expect(target.cpu.arch == .arm);
1318 std.testing.expect(target.cpu.model == &Target.arm.cpu.generic);
1319 std.testing.expect(Target.arm.featureSetHas(target.cpu.features, .v8a));
1320 }
1385}1321}
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+697-828
...@@ -1,61 +1,14 @@...@@ -1,61 +1,14 @@
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 @"32bit",6 @"32bit",
6 @"8msecext",7 @"8msecext",
7 a12,
8 a15,
9 a17,
10 a32,
11 a35,
12 a5,
13 a53,
14 a55,
15 a57,
16 a7,
17 a72,
18 a73,
19 a75,
20 a76,8 a76,
21 a8,
22 a9,
23 aclass,9 aclass,
24 acquire_release,10 acquire_release,
25 aes,11 aes,
26 armv2,
27 armv2a,
28 armv3,
29 armv3m,
30 armv4,
31 armv4t,
32 armv5t,
33 armv5te,
34 armv5tej,
35 armv6,
36 armv6_m,
37 armv6j,
38 armv6k,
39 armv6kz,
40 armv6s_m,
41 armv6t2,
42 armv7_a,
43 armv7_m,
44 armv7_r,
45 armv7e_m,
46 armv7k,
47 armv7s,
48 armv7ve,
49 armv8_a,
50 armv8_m_base,
51 armv8_m_main,
52 armv8_r,
53 armv8_1_a,
54 armv8_1_m_main,
55 armv8_2_a,
56 armv8_3_a,
57 armv8_4_a,
58 armv8_5_a,
59 avoid_movs_shop,12 avoid_movs_shop,
60 avoid_partial_cpsr,13 avoid_partial_cpsr,
61 cheap_predicable_cpsr,14 cheap_predicable_cpsr,
...@@ -71,13 +24,13 @@ pub const Feature = enum {...@@ -71,13 +24,13 @@ pub const Feature = enum {
71 execute_only,24 execute_only,
72 expand_fp_mlx,25 expand_fp_mlx,
73 exynos,26 exynos,
27 fp16,
28 fp16fml,
29 fp64,
74 fp_armv8,30 fp_armv8,
75 fp_armv8d16,31 fp_armv8d16,
76 fp_armv8d16sp,32 fp_armv8d16sp,
77 fp_armv8sp,33 fp_armv8sp,
78 fp16,
79 fp16fml,
80 fp64,
81 fpao,34 fpao,
82 fpregs,35 fpregs,
83 fpregs16,36 fpregs16,
...@@ -85,12 +38,28 @@ pub const Feature = enum {...@@ -85,12 +38,28 @@ pub const Feature = enum {
85 fullfp16,38 fullfp16,
86 fuse_aes,39 fuse_aes,
87 fuse_literals,40 fuse_literals,
41 has_v4t,
42 has_v5t,
43 has_v5te,
44 has_v6,
45 has_v6k,
46 has_v6m,
47 has_v6t2,
48 has_v7,
49 has_v7clrex,
50 has_v8_1a,
51 has_v8_1m_main,
52 has_v8_2a,
53 has_v8_3a,
54 has_v8_4a,
55 has_v8_5a,
56 has_v8,
57 has_v8m,
58 has_v8m_main,
88 hwdiv,59 hwdiv,
89 hwdiv_arm,60 hwdiv_arm,
90 iwmmxt,61 iwmmxt,
91 iwmmxt2,62 iwmmxt2,
92 krait,
93 kryo,
94 lob,63 lob,
95 long_calls,64 long_calls,
96 loop_align,65 loop_align,
...@@ -114,9 +83,6 @@ pub const Feature = enum {...@@ -114,9 +83,6 @@ pub const Feature = enum {
114 prefer_vmovsr,83 prefer_vmovsr,
115 prof_unpr,84 prof_unpr,
116 r4,85 r4,
117 r5,
118 r52,
119 r7,
120 ras,86 ras,
121 rclass,87 rclass,
122 read_tp_hard,88 read_tp_hard,
...@@ -134,29 +100,44 @@ pub const Feature = enum {...@@ -134,29 +100,44 @@ pub const Feature = enum {
134 splat_vfp_neon,100 splat_vfp_neon,
135 strict_align,101 strict_align,
136 swift,102 swift,
137 thumb_mode,
138 thumb2,103 thumb2,
104 thumb_mode,
139 trustzone,105 trustzone,
140 use_aa,106 use_aa,
141 use_misched,107 use_misched,
108 v2,
109 v2a,
110 v3,
111 v3m,
112 v4,
142 v4t,113 v4t,
143 v5t,114 v5t,
144 v5te,115 v5te,
116 v5tej,
145 v6,117 v6,
118 v6j,
146 v6k,119 v6k,
120 v6kz,
147 v6m,121 v6m,
122 v6sm,
148 v6t2,123 v6t2,
149 v7,124 v7a,
150 v7clrex,125 v7em,
151 v8,126 v7k,
127 v7m,
128 v7r,
129 v7s,
130 v7ve,
131 v8a,
132 v8m,
133 v8m_main,
134 v8r,
152 v8_1a,135 v8_1a,
153 v8_1m_main,136 v8_1m_main,
154 v8_2a,137 v8_2a,
155 v8_3a,138 v8_3a,
156 v8_4a,139 v8_4a,
157 v8_5a,140 v8_5a,
158 v8m,
159 v8m_main,
160 vfp2,141 vfp2,
161 vfp2d16,142 vfp2d16,
162 vfp2d16sp,143 vfp2d16sp,
...@@ -178,13 +159,13 @@ pub const Feature = enum {...@@ -178,13 +159,13 @@ pub const Feature = enum {
178 zcz,159 zcz,
179};160};
180161
181pub usingnamespace Cpu.Feature.feature_set_fns(Feature);162pub usingnamespace CpuFeature.feature_set_fns(Feature);
182163
183pub const all_features = blk: {164pub const all_features = blk: {
184 @setEvalBranchQuota(10000);165 @setEvalBranchQuota(10000);
185 const len = @typeInfo(Feature).Enum.fields.len;166 const len = @typeInfo(Feature).Enum.fields.len;
186 std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);167 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
187 var result: [len]Cpu.Feature = undefined;168 var result: [len]CpuFeature = undefined;
188 result[@enumToInt(Feature.@"32bit")] = .{169 result[@enumToInt(Feature.@"32bit")] = .{
189 .llvm_name = "32bit",170 .llvm_name = "32bit",
190 .description = "Prefer 32-bit Thumb instrs",171 .description = "Prefer 32-bit Thumb instrs",
...@@ -195,86 +176,11 @@ pub const all_features = blk: {...@@ -195,86 +176,11 @@ pub const all_features = blk: {
195 .description = "Enable support for ARMv8-M Security Extensions",176 .description = "Enable support for ARMv8-M Security Extensions",
196 .dependencies = featureSet(&[_]Feature{}),177 .dependencies = featureSet(&[_]Feature{}),
197 };178 };
198 result[@enumToInt(Feature.a12)] = .{
199 .llvm_name = "a12",
200 .description = "Cortex-A12 ARM processors",
201 .dependencies = featureSet(&[_]Feature{}),
202 };
203 result[@enumToInt(Feature.a15)] = .{
204 .llvm_name = "a15",
205 .description = "Cortex-A15 ARM processors",
206 .dependencies = featureSet(&[_]Feature{}),
207 };
208 result[@enumToInt(Feature.a17)] = .{
209 .llvm_name = "a17",
210 .description = "Cortex-A17 ARM processors",
211 .dependencies = featureSet(&[_]Feature{}),
212 };
213 result[@enumToInt(Feature.a32)] = .{
214 .llvm_name = "a32",
215 .description = "Cortex-A32 ARM processors",
216 .dependencies = featureSet(&[_]Feature{}),
217 };
218 result[@enumToInt(Feature.a35)] = .{
219 .llvm_name = "a35",
220 .description = "Cortex-A35 ARM processors",
221 .dependencies = featureSet(&[_]Feature{}),
222 };
223 result[@enumToInt(Feature.a5)] = .{
224 .llvm_name = "a5",
225 .description = "Cortex-A5 ARM processors",
226 .dependencies = featureSet(&[_]Feature{}),
227 };
228 result[@enumToInt(Feature.a53)] = .{
229 .llvm_name = "a53",
230 .description = "Cortex-A53 ARM processors",
231 .dependencies = featureSet(&[_]Feature{}),
232 };
233 result[@enumToInt(Feature.a55)] = .{
234 .llvm_name = "a55",
235 .description = "Cortex-A55 ARM processors",
236 .dependencies = featureSet(&[_]Feature{}),
237 };
238 result[@enumToInt(Feature.a57)] = .{
239 .llvm_name = "a57",
240 .description = "Cortex-A57 ARM processors",
241 .dependencies = featureSet(&[_]Feature{}),
242 };
243 result[@enumToInt(Feature.a7)] = .{
244 .llvm_name = "a7",
245 .description = "Cortex-A7 ARM processors",
246 .dependencies = featureSet(&[_]Feature{}),
247 };
248 result[@enumToInt(Feature.a72)] = .{
249 .llvm_name = "a72",
250 .description = "Cortex-A72 ARM processors",
251 .dependencies = featureSet(&[_]Feature{}),
252 };
253 result[@enumToInt(Feature.a73)] = .{
254 .llvm_name = "a73",
255 .description = "Cortex-A73 ARM processors",
256 .dependencies = featureSet(&[_]Feature{}),
257 };
258 result[@enumToInt(Feature.a75)] = .{
259 .llvm_name = "a75",
260 .description = "Cortex-A75 ARM processors",
261 .dependencies = featureSet(&[_]Feature{}),
262 };
263 result[@enumToInt(Feature.a76)] = .{179 result[@enumToInt(Feature.a76)] = .{
264 .llvm_name = "a76",180 .llvm_name = "a76",
265 .description = "Cortex-A76 ARM processors",181 .description = "Cortex-A76 ARM processors",
266 .dependencies = featureSet(&[_]Feature{}),182 .dependencies = featureSet(&[_]Feature{}),
267 };183 };
268 result[@enumToInt(Feature.a8)] = .{
269 .llvm_name = "a8",
270 .description = "Cortex-A8 ARM processors",
271 .dependencies = featureSet(&[_]Feature{}),
272 };
273 result[@enumToInt(Feature.a9)] = .{
274 .llvm_name = "a9",
275 .description = "Cortex-A9 ARM processors",
276 .dependencies = featureSet(&[_]Feature{}),
277 };
278 result[@enumToInt(Feature.aclass)] = .{184 result[@enumToInt(Feature.aclass)] = .{
279 .llvm_name = "aclass",185 .llvm_name = "aclass",
280 .description = "Is application profile ('A' series)",186 .description = "Is application profile ('A' series)",
...@@ -292,368 +198,6 @@ pub const all_features = blk: {...@@ -292,368 +198,6 @@ pub const all_features = blk: {
292 .neon,198 .neon,
293 }),199 }),
294 };200 };
295 result[@enumToInt(Feature.armv2)] = .{
296 .llvm_name = "armv2",
297 .description = "ARMv2 architecture",
298 .dependencies = featureSet(&[_]Feature{}),
299 };
300 result[@enumToInt(Feature.armv2a)] = .{
301 .llvm_name = "armv2a",
302 .description = "ARMv2a architecture",
303 .dependencies = featureSet(&[_]Feature{}),
304 };
305 result[@enumToInt(Feature.armv3)] = .{
306 .llvm_name = "armv3",
307 .description = "ARMv3 architecture",
308 .dependencies = featureSet(&[_]Feature{}),
309 };
310 result[@enumToInt(Feature.armv3m)] = .{
311 .llvm_name = "armv3m",
312 .description = "ARMv3m architecture",
313 .dependencies = featureSet(&[_]Feature{}),
314 };
315 result[@enumToInt(Feature.armv4)] = .{
316 .llvm_name = "armv4",
317 .description = "ARMv4 architecture",
318 .dependencies = featureSet(&[_]Feature{}),
319 };
320 result[@enumToInt(Feature.armv4t)] = .{
321 .llvm_name = "armv4t",
322 .description = "ARMv4t architecture",
323 .dependencies = featureSet(&[_]Feature{
324 .v4t,
325 }),
326 };
327 result[@enumToInt(Feature.armv5t)] = .{
328 .llvm_name = "armv5t",
329 .description = "ARMv5t architecture",
330 .dependencies = featureSet(&[_]Feature{
331 .v5t,
332 }),
333 };
334 result[@enumToInt(Feature.armv5te)] = .{
335 .llvm_name = "armv5te",
336 .description = "ARMv5te architecture",
337 .dependencies = featureSet(&[_]Feature{
338 .v5te,
339 }),
340 };
341 result[@enumToInt(Feature.armv5tej)] = .{
342 .llvm_name = "armv5tej",
343 .description = "ARMv5tej architecture",
344 .dependencies = featureSet(&[_]Feature{
345 .v5te,
346 }),
347 };
348 result[@enumToInt(Feature.armv6)] = .{
349 .llvm_name = "armv6",
350 .description = "ARMv6 architecture",
351 .dependencies = featureSet(&[_]Feature{
352 .dsp,
353 .v6,
354 }),
355 };
356 result[@enumToInt(Feature.armv6_m)] = .{
357 .llvm_name = "armv6-m",
358 .description = "ARMv6m architecture",
359 .dependencies = featureSet(&[_]Feature{
360 .db,
361 .mclass,
362 .noarm,
363 .strict_align,
364 .thumb_mode,
365 .v6m,
366 }),
367 };
368 result[@enumToInt(Feature.armv6j)] = .{
369 .llvm_name = "armv6j",
370 .description = "ARMv7a architecture",
371 .dependencies = featureSet(&[_]Feature{
372 .armv6,
373 }),
374 };
375 result[@enumToInt(Feature.armv6k)] = .{
376 .llvm_name = "armv6k",
377 .description = "ARMv6k architecture",
378 .dependencies = featureSet(&[_]Feature{
379 .v6k,
380 }),
381 };
382 result[@enumToInt(Feature.armv6kz)] = .{
383 .llvm_name = "armv6kz",
384 .description = "ARMv6kz architecture",
385 .dependencies = featureSet(&[_]Feature{
386 .trustzone,
387 .v6k,
388 }),
389 };
390 result[@enumToInt(Feature.armv6s_m)] = .{
391 .llvm_name = "armv6s-m",
392 .description = "ARMv6sm architecture",
393 .dependencies = featureSet(&[_]Feature{
394 .db,
395 .mclass,
396 .noarm,
397 .strict_align,
398 .thumb_mode,
399 .v6m,
400 }),
401 };
402 result[@enumToInt(Feature.armv6t2)] = .{
403 .llvm_name = "armv6t2",
404 .description = "ARMv6t2 architecture",
405 .dependencies = featureSet(&[_]Feature{
406 .dsp,
407 .v6t2,
408 }),
409 };
410 result[@enumToInt(Feature.armv7_a)] = .{
411 .llvm_name = "armv7-a",
412 .description = "ARMv7a architecture",
413 .dependencies = featureSet(&[_]Feature{
414 .aclass,
415 .db,
416 .dsp,
417 .neon,
418 .v7,
419 }),
420 };
421 result[@enumToInt(Feature.armv7_m)] = .{
422 .llvm_name = "armv7-m",
423 .description = "ARMv7m architecture",
424 .dependencies = featureSet(&[_]Feature{
425 .db,
426 .hwdiv,
427 .mclass,
428 .noarm,
429 .thumb_mode,
430 .thumb2,
431 .v7,
432 }),
433 };
434 result[@enumToInt(Feature.armv7_r)] = .{
435 .llvm_name = "armv7-r",
436 .description = "ARMv7r architecture",
437 .dependencies = featureSet(&[_]Feature{
438 .db,
439 .dsp,
440 .hwdiv,
441 .rclass,
442 .v7,
443 }),
444 };
445 result[@enumToInt(Feature.armv7e_m)] = .{
446 .llvm_name = "armv7e-m",
447 .description = "ARMv7em architecture",
448 .dependencies = featureSet(&[_]Feature{
449 .db,
450 .dsp,
451 .hwdiv,
452 .mclass,
453 .noarm,
454 .thumb_mode,
455 .thumb2,
456 .v7,
457 }),
458 };
459 result[@enumToInt(Feature.armv7k)] = .{
460 .llvm_name = "armv7k",
461 .description = "ARMv7a architecture",
462 .dependencies = featureSet(&[_]Feature{
463 .armv7_a,
464 }),
465 };
466 result[@enumToInt(Feature.armv7s)] = .{
467 .llvm_name = "armv7s",
468 .description = "ARMv7a architecture",
469 .dependencies = featureSet(&[_]Feature{
470 .armv7_a,
471 }),
472 };
473 result[@enumToInt(Feature.armv7ve)] = .{
474 .llvm_name = "armv7ve",
475 .description = "ARMv7ve architecture",
476 .dependencies = featureSet(&[_]Feature{
477 .aclass,
478 .db,
479 .dsp,
480 .mp,
481 .neon,
482 .trustzone,
483 .v7,
484 .virtualization,
485 }),
486 };
487 result[@enumToInt(Feature.armv8_a)] = .{
488 .llvm_name = "armv8-a",
489 .description = "ARMv8a architecture",
490 .dependencies = featureSet(&[_]Feature{
491 .aclass,
492 .crc,
493 .crypto,
494 .db,
495 .dsp,
496 .fp_armv8,
497 .mp,
498 .neon,
499 .trustzone,
500 .v8,
501 .virtualization,
502 }),
503 };
504 result[@enumToInt(Feature.armv8_m_base)] = .{
505 .llvm_name = "armv8-m.base",
506 .description = "ARMv8mBaseline architecture",
507 .dependencies = featureSet(&[_]Feature{
508 .@"8msecext",
509 .acquire_release,
510 .db,
511 .hwdiv,
512 .mclass,
513 .noarm,
514 .strict_align,
515 .thumb_mode,
516 .v7clrex,
517 .v8m,
518 }),
519 };
520 result[@enumToInt(Feature.armv8_m_main)] = .{
521 .llvm_name = "armv8-m.main",
522 .description = "ARMv8mMainline architecture",
523 .dependencies = featureSet(&[_]Feature{
524 .@"8msecext",
525 .acquire_release,
526 .db,
527 .hwdiv,
528 .mclass,
529 .noarm,
530 .thumb_mode,
531 .v8m_main,
532 }),
533 };
534 result[@enumToInt(Feature.armv8_r)] = .{
535 .llvm_name = "armv8-r",
536 .description = "ARMv8r architecture",
537 .dependencies = featureSet(&[_]Feature{
538 .crc,
539 .db,
540 .dfb,
541 .dsp,
542 .fp_armv8,
543 .mp,
544 .neon,
545 .rclass,
546 .v8,
547 .virtualization,
548 }),
549 };
550 result[@enumToInt(Feature.armv8_1_a)] = .{
551 .llvm_name = "armv8.1-a",
552 .description = "ARMv81a architecture",
553 .dependencies = featureSet(&[_]Feature{
554 .aclass,
555 .crc,
556 .crypto,
557 .db,
558 .dsp,
559 .fp_armv8,
560 .mp,
561 .neon,
562 .trustzone,
563 .v8_1a,
564 .virtualization,
565 }),
566 };
567 result[@enumToInt(Feature.armv8_1_m_main)] = .{
568 .llvm_name = "armv8.1-m.main",
569 .description = "ARMv81mMainline architecture",
570 .dependencies = featureSet(&[_]Feature{
571 .@"8msecext",
572 .acquire_release,
573 .db,
574 .hwdiv,
575 .lob,
576 .mclass,
577 .noarm,
578 .ras,
579 .thumb_mode,
580 .v8_1m_main,
581 }),
582 };
583 result[@enumToInt(Feature.armv8_2_a)] = .{
584 .llvm_name = "armv8.2-a",
585 .description = "ARMv82a architecture",
586 .dependencies = featureSet(&[_]Feature{
587 .aclass,
588 .crc,
589 .crypto,
590 .db,
591 .dsp,
592 .fp_armv8,
593 .mp,
594 .neon,
595 .ras,
596 .trustzone,
597 .v8_2a,
598 .virtualization,
599 }),
600 };
601 result[@enumToInt(Feature.armv8_3_a)] = .{
602 .llvm_name = "armv8.3-a",
603 .description = "ARMv83a architecture",
604 .dependencies = featureSet(&[_]Feature{
605 .aclass,
606 .crc,
607 .crypto,
608 .db,
609 .dsp,
610 .fp_armv8,
611 .mp,
612 .neon,
613 .ras,
614 .trustzone,
615 .v8_3a,
616 .virtualization,
617 }),
618 };
619 result[@enumToInt(Feature.armv8_4_a)] = .{
620 .llvm_name = "armv8.4-a",
621 .description = "ARMv84a architecture",
622 .dependencies = featureSet(&[_]Feature{
623 .aclass,
624 .crc,
625 .crypto,
626 .db,
627 .dotprod,
628 .dsp,
629 .fp_armv8,
630 .mp,
631 .neon,
632 .ras,
633 .trustzone,
634 .v8_4a,
635 .virtualization,
636 }),
637 };
638 result[@enumToInt(Feature.armv8_5_a)] = .{
639 .llvm_name = "armv8.5-a",
640 .description = "ARMv85a architecture",
641 .dependencies = featureSet(&[_]Feature{
642 .aclass,
643 .crc,
644 .crypto,
645 .db,
646 .dotprod,
647 .dsp,
648 .fp_armv8,
649 .mp,
650 .neon,
651 .ras,
652 .trustzone,
653 .v8_5a,
654 .virtualization,
655 }),
656 };
657 result[@enumToInt(Feature.avoid_movs_shop)] = .{201 result[@enumToInt(Feature.avoid_movs_shop)] = .{
658 .llvm_name = "avoid-movs-shop",202 .llvm_name = "avoid-movs-shop",
659 .description = "Avoid movs instructions with shifter operand",203 .description = "Avoid movs instructions with shifter operand",
...@@ -753,6 +297,25 @@ pub const all_features = blk: {...@@ -753,6 +297,25 @@ pub const all_features = blk: {
753 .zcz,297 .zcz,
754 }),298 }),
755 };299 };
300 result[@enumToInt(Feature.fp16)] = .{
301 .llvm_name = "fp16",
302 .description = "Enable half-precision floating point",
303 .dependencies = featureSet(&[_]Feature{}),
304 };
305 result[@enumToInt(Feature.fp16fml)] = .{
306 .llvm_name = "fp16fml",
307 .description = "Enable full half-precision floating point fml instructions",
308 .dependencies = featureSet(&[_]Feature{
309 .fullfp16,
310 }),
311 };
312 result[@enumToInt(Feature.fp64)] = .{
313 .llvm_name = "fp64",
314 .description = "Floating point unit supports double precision",
315 .dependencies = featureSet(&[_]Feature{
316 .fpregs64,
317 }),
318 };
756 result[@enumToInt(Feature.fp_armv8)] = .{319 result[@enumToInt(Feature.fp_armv8)] = .{
757 .llvm_name = "fp-armv8",320 .llvm_name = "fp-armv8",
758 .description = "Enable ARMv8 FP",321 .description = "Enable ARMv8 FP",
...@@ -770,40 +333,21 @@ pub const all_features = blk: {...@@ -770,40 +333,21 @@ pub const all_features = blk: {
770 .fp64,333 .fp64,
771 .vfp4d16,334 .vfp4d16,
772 }),335 }),
773 };336 };
774 result[@enumToInt(Feature.fp_armv8d16sp)] = .{337 result[@enumToInt(Feature.fp_armv8d16sp)] = .{
775 .llvm_name = "fp-armv8d16sp",338 .llvm_name = "fp-armv8d16sp",
776 .description = "Enable ARMv8 FP with only 16 d-registers and no double precision",339 .description = "Enable ARMv8 FP with only 16 d-registers and no double precision",
777 .dependencies = featureSet(&[_]Feature{
778 .vfp4d16sp,
779 }),
780 };
781 result[@enumToInt(Feature.fp_armv8sp)] = .{
782 .llvm_name = "fp-armv8sp",
783 .description = "Enable ARMv8 FP with no double precision",
784 .dependencies = featureSet(&[_]Feature{
785 .d32,
786 .fp_armv8d16sp,
787 .vfp4sp,
788 }),
789 };
790 result[@enumToInt(Feature.fp16)] = .{
791 .llvm_name = "fp16",
792 .description = "Enable half-precision floating point",
793 .dependencies = featureSet(&[_]Feature{}),
794 };
795 result[@enumToInt(Feature.fp16fml)] = .{
796 .llvm_name = "fp16fml",
797 .description = "Enable full half-precision floating point fml instructions",
798 .dependencies = featureSet(&[_]Feature{340 .dependencies = featureSet(&[_]Feature{
799 .fullfp16,341 .vfp4d16sp,
800 }),342 }),
801 };343 };
802 result[@enumToInt(Feature.fp64)] = .{344 result[@enumToInt(Feature.fp_armv8sp)] = .{
803 .llvm_name = "fp64",345 .llvm_name = "fp-armv8sp",
804 .description = "Floating point unit supports double precision",346 .description = "Enable ARMv8 FP with no double precision",
805 .dependencies = featureSet(&[_]Feature{347 .dependencies = featureSet(&[_]Feature{
806 .fpregs64,348 .d32,
349 .fp_armv8d16sp,
350 .vfp4sp,
807 }),351 }),
808 };352 };
809 result[@enumToInt(Feature.fpao)] = .{353 result[@enumToInt(Feature.fpao)] = .{
...@@ -848,6 +392,135 @@ pub const all_features = blk: {...@@ -848,6 +392,135 @@ pub const all_features = blk: {
848 .description = "CPU fuses literal generation operations",392 .description = "CPU fuses literal generation operations",
849 .dependencies = featureSet(&[_]Feature{}),393 .dependencies = featureSet(&[_]Feature{}),
850 };394 };
395 result[@enumToInt(Feature.has_v4t)] = .{
396 .llvm_name = "v4t",
397 .description = "Support ARM v4T instructions",
398 .dependencies = featureSet(&[_]Feature{}),
399 };
400 result[@enumToInt(Feature.has_v5t)] = .{
401 .llvm_name = "v5t",
402 .description = "Support ARM v5T instructions",
403 .dependencies = featureSet(&[_]Feature{
404 .has_v4t,
405 }),
406 };
407 result[@enumToInt(Feature.has_v5te)] = .{
408 .llvm_name = "v5te",
409 .description = "Support ARM v5TE, v5TEj, and v5TExp instructions",
410 .dependencies = featureSet(&[_]Feature{
411 .has_v5t,
412 }),
413 };
414 result[@enumToInt(Feature.has_v6)] = .{
415 .llvm_name = "v6",
416 .description = "Support ARM v6 instructions",
417 .dependencies = featureSet(&[_]Feature{
418 .has_v5te,
419 }),
420 };
421 result[@enumToInt(Feature.has_v6k)] = .{
422 .llvm_name = "v6k",
423 .description = "Support ARM v6k instructions",
424 .dependencies = featureSet(&[_]Feature{
425 .has_v6,
426 }),
427 };
428 result[@enumToInt(Feature.has_v6m)] = .{
429 .llvm_name = "v6m",
430 .description = "Support ARM v6M instructions",
431 .dependencies = featureSet(&[_]Feature{
432 .has_v6,
433 }),
434 };
435 result[@enumToInt(Feature.has_v6t2)] = .{
436 .llvm_name = "v6t2",
437 .description = "Support ARM v6t2 instructions",
438 .dependencies = featureSet(&[_]Feature{
439 .thumb2,
440 .has_v6k,
441 .has_v8m,
442 }),
443 };
444 result[@enumToInt(Feature.has_v7)] = .{
445 .llvm_name = "v7",
446 .description = "Support ARM v7 instructions",
447 .dependencies = featureSet(&[_]Feature{
448 .perfmon,
449 .has_v6t2,
450 .has_v7clrex,
451 }),
452 };
453 result[@enumToInt(Feature.has_v7clrex)] = .{
454 .llvm_name = "v7clrex",
455 .description = "Has v7 clrex instruction",
456 .dependencies = featureSet(&[_]Feature{}),
457 };
458 result[@enumToInt(Feature.has_v8)] = .{
459 .llvm_name = "v8",
460 .description = "Support ARM v8 instructions",
461 .dependencies = featureSet(&[_]Feature{
462 .acquire_release,
463 .has_v7,
464 }),
465 };
466 result[@enumToInt(Feature.has_v8_1a)] = .{
467 .llvm_name = "v8.1a",
468 .description = "Support ARM v8.1a instructions",
469 .dependencies = featureSet(&[_]Feature{
470 .has_v8,
471 }),
472 };
473 result[@enumToInt(Feature.has_v8_1m_main)] = .{
474 .llvm_name = "v8.1m.main",
475 .description = "Support ARM v8-1M Mainline instructions",
476 .dependencies = featureSet(&[_]Feature{
477 .has_v8m_main,
478 }),
479 };
480 result[@enumToInt(Feature.has_v8_2a)] = .{
481 .llvm_name = "v8.2a",
482 .description = "Support ARM v8.2a instructions",
483 .dependencies = featureSet(&[_]Feature{
484 .has_v8_1a,
485 }),
486 };
487 result[@enumToInt(Feature.has_v8_3a)] = .{
488 .llvm_name = "v8.3a",
489 .description = "Support ARM v8.3a instructions",
490 .dependencies = featureSet(&[_]Feature{
491 .has_v8_2a,
492 }),
493 };
494 result[@enumToInt(Feature.has_v8_4a)] = .{
495 .llvm_name = "v8.4a",
496 .description = "Support ARM v8.4a instructions",
497 .dependencies = featureSet(&[_]Feature{
498 .dotprod,
499 .has_v8_3a,
500 }),
501 };
502 result[@enumToInt(Feature.has_v8_5a)] = .{
503 .llvm_name = "v8.5a",
504 .description = "Support ARM v8.5a instructions",
505 .dependencies = featureSet(&[_]Feature{
506 .sb,
507 .has_v8_4a,
508 }),
509 };
510 result[@enumToInt(Feature.has_v8m)] = .{
511 .llvm_name = "v8m",
512 .description = "Support ARM v8M Baseline instructions",
513 .dependencies = featureSet(&[_]Feature{
514 .has_v6m,
515 }),
516 };
517 result[@enumToInt(Feature.has_v8m_main)] = .{
518 .llvm_name = "v8m.main",
519 .description = "Support ARM v8M Mainline instructions",
520 .dependencies = featureSet(&[_]Feature{
521 .has_v7,
522 }),
523 };
851 result[@enumToInt(Feature.hwdiv)] = .{524 result[@enumToInt(Feature.hwdiv)] = .{
852 .llvm_name = "hwdiv",525 .llvm_name = "hwdiv",
853 .description = "Enable divide instructions in Thumb",526 .description = "Enable divide instructions in Thumb",
...@@ -862,26 +535,16 @@ pub const all_features = blk: {...@@ -862,26 +535,16 @@ pub const all_features = blk: {
862 .llvm_name = "iwmmxt",535 .llvm_name = "iwmmxt",
863 .description = "ARMv5te architecture",536 .description = "ARMv5te architecture",
864 .dependencies = featureSet(&[_]Feature{537 .dependencies = featureSet(&[_]Feature{
865 .armv5te,538 .has_v5te,
866 }),539 }),
867 };540 };
868 result[@enumToInt(Feature.iwmmxt2)] = .{541 result[@enumToInt(Feature.iwmmxt2)] = .{
869 .llvm_name = "iwmmxt2",542 .llvm_name = "iwmmxt2",
870 .description = "ARMv5te architecture",543 .description = "ARMv5te architecture",
871 .dependencies = featureSet(&[_]Feature{544 .dependencies = featureSet(&[_]Feature{
872 .armv5te,545 .has_v5te,
873 }),546 }),
874 };547 };
875 result[@enumToInt(Feature.krait)] = .{
876 .llvm_name = "krait",
877 .description = "Qualcomm Krait processors",
878 .dependencies = featureSet(&[_]Feature{}),
879 };
880 result[@enumToInt(Feature.kryo)] = .{
881 .llvm_name = "kryo",
882 .description = "Qualcomm Kryo processors",
883 .dependencies = featureSet(&[_]Feature{}),
884 };
885 result[@enumToInt(Feature.lob)] = .{548 result[@enumToInt(Feature.lob)] = .{
886 .llvm_name = "lob",549 .llvm_name = "lob",
887 .description = "Enable Low Overhead Branch extensions",550 .description = "Enable Low Overhead Branch extensions",
...@@ -924,7 +587,7 @@ pub const all_features = blk: {...@@ -924,7 +587,7 @@ pub const all_features = blk: {
924 .dsp,587 .dsp,
925 .fpregs16,588 .fpregs16,
926 .fpregs64,589 .fpregs64,
927 .v8_1m_main,590 .has_v8_1m_main,
928 }),591 }),
929 };592 };
930 result[@enumToInt(Feature.mve_fp)] = .{593 result[@enumToInt(Feature.mve_fp)] = .{
...@@ -1008,21 +671,6 @@ pub const all_features = blk: {...@@ -1008,21 +671,6 @@ pub const all_features = blk: {
1008 .description = "Cortex-R4 ARM processors",671 .description = "Cortex-R4 ARM processors",
1009 .dependencies = featureSet(&[_]Feature{}),672 .dependencies = featureSet(&[_]Feature{}),
1010 };673 };
1011 result[@enumToInt(Feature.r5)] = .{
1012 .llvm_name = "r5",
1013 .description = "Cortex-R5 ARM processors",
1014 .dependencies = featureSet(&[_]Feature{}),
1015 };
1016 result[@enumToInt(Feature.r52)] = .{
1017 .llvm_name = "r52",
1018 .description = "Cortex-R52 ARM processors",
1019 .dependencies = featureSet(&[_]Feature{}),
1020 };
1021 result[@enumToInt(Feature.r7)] = .{
1022 .llvm_name = "r7",
1023 .description = "Cortex-R7 ARM processors",
1024 .dependencies = featureSet(&[_]Feature{}),
1025 };
1026 result[@enumToInt(Feature.ras)] = .{674 result[@enumToInt(Feature.ras)] = .{
1027 .llvm_name = "ras",675 .llvm_name = "ras",
1028 .description = "Enable Reliability, Availability and Serviceability extensions",676 .description = "Enable Reliability, Availability and Serviceability extensions",
...@@ -1112,16 +760,16 @@ pub const all_features = blk: {...@@ -1112,16 +760,16 @@ pub const all_features = blk: {
1112 .description = "Swift ARM processors",760 .description = "Swift ARM processors",
1113 .dependencies = featureSet(&[_]Feature{}),761 .dependencies = featureSet(&[_]Feature{}),
1114 };762 };
1115 result[@enumToInt(Feature.thumb_mode)] = .{
1116 .llvm_name = "thumb-mode",
1117 .description = "Thumb mode",
1118 .dependencies = featureSet(&[_]Feature{}),
1119 };
1120 result[@enumToInt(Feature.thumb2)] = .{763 result[@enumToInt(Feature.thumb2)] = .{
1121 .llvm_name = "thumb2",764 .llvm_name = "thumb2",
1122 .description = "Enable Thumb2 instructions",765 .description = "Enable Thumb2 instructions",
1123 .dependencies = featureSet(&[_]Feature{}),766 .dependencies = featureSet(&[_]Feature{}),
1124 };767 };
768 result[@enumToInt(Feature.thumb_mode)] = .{
769 .llvm_name = "thumb-mode",
770 .description = "Thumb mode",
771 .dependencies = featureSet(&[_]Feature{}),
772 };
1125 result[@enumToInt(Feature.trustzone)] = .{773 result[@enumToInt(Feature.trustzone)] = .{
1126 .llvm_name = "trustzone",774 .llvm_name = "trustzone",
1127 .description = "Enable support for TrustZone security extensions",775 .description = "Enable support for TrustZone security extensions",
...@@ -1137,133 +785,366 @@ pub const all_features = blk: {...@@ -1137,133 +785,366 @@ pub const all_features = blk: {
1137 .description = "Use the MachineScheduler",785 .description = "Use the MachineScheduler",
1138 .dependencies = featureSet(&[_]Feature{}),786 .dependencies = featureSet(&[_]Feature{}),
1139 };787 };
1140 result[@enumToInt(Feature.v4t)] = .{788 result[@enumToInt(Feature.v2)] = .{
1141 .llvm_name = "v4t",789 .llvm_name = "armv2",
1142 .description = "Support ARM v4T instructions",790 .description = "ARMv2 architecture",
791 .dependencies = featureSet(&[_]Feature{}),
792 };
793 result[@enumToInt(Feature.v2a)] = .{
794 .llvm_name = "armv2a",
795 .description = "ARMv2a architecture",
796 .dependencies = featureSet(&[_]Feature{}),
797 };
798 result[@enumToInt(Feature.v3)] = .{
799 .llvm_name = "armv3",
800 .description = "ARMv3 architecture",
1143 .dependencies = featureSet(&[_]Feature{}),801 .dependencies = featureSet(&[_]Feature{}),
1144 };802 };
1145 result[@enumToInt(Feature.v5t)] = .{803 result[@enumToInt(Feature.v3m)] = .{
1146 .llvm_name = "v5t",804 .llvm_name = "armv3m",
1147 .description = "Support ARM v5T instructions",805 .description = "ARMv3m architecture",
806 .dependencies = featureSet(&[_]Feature{}),
807 };
808 result[@enumToInt(Feature.v4)] = .{
809 .llvm_name = "armv4",
810 .description = "ARMv4 architecture",
811 .dependencies = featureSet(&[_]Feature{}),
812 };
813 result[@enumToInt(Feature.v4t)] = .{
814 .llvm_name = "armv4t",
815 .description = "ARMv4t architecture",
816 .dependencies = featureSet(&[_]Feature{
817 .has_v4t,
818 }),
819 };
820 result[@enumToInt(Feature.v5t)] = .{
821 .llvm_name = "armv5t",
822 .description = "ARMv5t architecture",
823 .dependencies = featureSet(&[_]Feature{
824 .has_v5t,
825 }),
826 };
827 result[@enumToInt(Feature.v5te)] = .{
828 .llvm_name = "armv5te",
829 .description = "ARMv5te architecture",
830 .dependencies = featureSet(&[_]Feature{
831 .has_v5te,
832 }),
833 };
834 result[@enumToInt(Feature.v5tej)] = .{
835 .llvm_name = "armv5tej",
836 .description = "ARMv5tej architecture",
837 .dependencies = featureSet(&[_]Feature{
838 .has_v5te,
839 }),
840 };
841 result[@enumToInt(Feature.v6)] = .{
842 .llvm_name = "armv6",
843 .description = "ARMv6 architecture",
844 .dependencies = featureSet(&[_]Feature{
845 .dsp,
846 .has_v6,
847 }),
848 };
849 result[@enumToInt(Feature.v6m)] = .{
850 .llvm_name = "armv6-m",
851 .description = "ARMv6m architecture",
852 .dependencies = featureSet(&[_]Feature{
853 .db,
854 .mclass,
855 .noarm,
856 .strict_align,
857 .thumb_mode,
858 .has_v6m,
859 }),
860 };
861 result[@enumToInt(Feature.v6j)] = .{
862 .llvm_name = "armv6j",
863 .description = "ARMv7a architecture",
864 .dependencies = featureSet(&[_]Feature{
865 .v6,
866 }),
867 };
868 result[@enumToInt(Feature.v6k)] = .{
869 .llvm_name = "armv6k",
870 .description = "ARMv6k architecture",
871 .dependencies = featureSet(&[_]Feature{
872 .has_v6k,
873 }),
874 };
875 result[@enumToInt(Feature.v6kz)] = .{
876 .llvm_name = "armv6kz",
877 .description = "ARMv6kz architecture",
878 .dependencies = featureSet(&[_]Feature{
879 .trustzone,
880 .has_v6k,
881 }),
882 };
883 result[@enumToInt(Feature.v6sm)] = .{
884 .llvm_name = "armv6s-m",
885 .description = "ARMv6sm architecture",
886 .dependencies = featureSet(&[_]Feature{
887 .db,
888 .mclass,
889 .noarm,
890 .strict_align,
891 .thumb_mode,
892 .has_v6m,
893 }),
894 };
895 result[@enumToInt(Feature.v6t2)] = .{
896 .llvm_name = "armv6t2",
897 .description = "ARMv6t2 architecture",
898 .dependencies = featureSet(&[_]Feature{
899 .dsp,
900 .has_v6t2,
901 }),
902 };
903 result[@enumToInt(Feature.v7a)] = .{
904 .llvm_name = "armv7-a",
905 .description = "ARMv7a architecture",
906 .dependencies = featureSet(&[_]Feature{
907 .aclass,
908 .db,
909 .dsp,
910 .neon,
911 .has_v7,
912 }),
913 };
914 result[@enumToInt(Feature.v7m)] = .{
915 .llvm_name = "armv7-m",
916 .description = "ARMv7m architecture",
917 .dependencies = featureSet(&[_]Feature{
918 .db,
919 .hwdiv,
920 .mclass,
921 .noarm,
922 .thumb_mode,
923 .thumb2,
924 .has_v7,
925 }),
926 };
927 result[@enumToInt(Feature.v7r)] = .{
928 .llvm_name = "armv7-r",
929 .description = "ARMv7r architecture",
930 .dependencies = featureSet(&[_]Feature{
931 .db,
932 .dsp,
933 .hwdiv,
934 .rclass,
935 .has_v7,
936 }),
937 };
938 result[@enumToInt(Feature.v7em)] = .{
939 .llvm_name = "armv7e-m",
940 .description = "ARMv7em architecture",
1148 .dependencies = featureSet(&[_]Feature{941 .dependencies = featureSet(&[_]Feature{
1149 .v4t,942 .db,
943 .dsp,
944 .hwdiv,
945 .mclass,
946 .noarm,
947 .thumb_mode,
948 .thumb2,
949 .has_v7,
1150 }),950 }),
1151 };951 };
1152 result[@enumToInt(Feature.v5te)] = .{952 result[@enumToInt(Feature.v7k)] = .{
1153 .llvm_name = "v5te",953 .llvm_name = "armv7k",
1154 .description = "Support ARM v5TE, v5TEj, and v5TExp instructions",954 .description = "ARMv7a architecture",
1155 .dependencies = featureSet(&[_]Feature{955 .dependencies = featureSet(&[_]Feature{
1156 .v5t,956 .v7a,
1157 }),957 }),
1158 };958 };
1159 result[@enumToInt(Feature.v6)] = .{959 result[@enumToInt(Feature.v7s)] = .{
1160 .llvm_name = "v6",960 .llvm_name = "armv7s",
1161 .description = "Support ARM v6 instructions",961 .description = "ARMv7a architecture",
1162 .dependencies = featureSet(&[_]Feature{962 .dependencies = featureSet(&[_]Feature{
1163 .v5te,963 .v7a,
1164 }),964 }),
1165 };965 };
1166 result[@enumToInt(Feature.v6k)] = .{966 result[@enumToInt(Feature.v7ve)] = .{
1167 .llvm_name = "v6k",967 .llvm_name = "armv7ve",
1168 .description = "Support ARM v6k instructions",968 .description = "ARMv7ve architecture",
1169 .dependencies = featureSet(&[_]Feature{969 .dependencies = featureSet(&[_]Feature{
1170 .v6,970 .aclass,
971 .db,
972 .dsp,
973 .mp,
974 .neon,
975 .trustzone,
976 .has_v7,
977 .virtualization,
1171 }),978 }),
1172 };979 };
1173 result[@enumToInt(Feature.v6m)] = .{980 result[@enumToInt(Feature.v8a)] = .{
1174 .llvm_name = "v6m",981 .llvm_name = "armv8-a",
1175 .description = "Support ARM v6M instructions",982 .description = "ARMv8a architecture",
1176 .dependencies = featureSet(&[_]Feature{983 .dependencies = featureSet(&[_]Feature{
1177 .v6,984 .aclass,
985 .crc,
986 .crypto,
987 .db,
988 .dsp,
989 .fp_armv8,
990 .mp,
991 .neon,
992 .trustzone,
993 .has_v8,
994 .virtualization,
1178 }),995 }),
1179 };996 };
1180 result[@enumToInt(Feature.v6t2)] = .{997 result[@enumToInt(Feature.v8m)] = .{
1181 .llvm_name = "v6t2",998 .llvm_name = "armv8-m.base",
1182 .description = "Support ARM v6t2 instructions",999 .description = "ARMv8mBaseline architecture",
1183 .dependencies = featureSet(&[_]Feature{1000 .dependencies = featureSet(&[_]Feature{
1184 .thumb2,1001 .@"8msecext",
1185 .v6k,1002 .acquire_release,
1186 .v8m,1003 .db,
1004 .hwdiv,
1005 .mclass,
1006 .noarm,
1007 .strict_align,
1008 .thumb_mode,
1009 .has_v7clrex,
1010 .has_v8m,
1187 }),1011 }),
1188 };1012 };
1189 result[@enumToInt(Feature.v7)] = .{1013 result[@enumToInt(Feature.v8m_main)] = .{
1190 .llvm_name = "v7",1014 .llvm_name = "armv8-m.main",
1191 .description = "Support ARM v7 instructions",1015 .description = "ARMv8mMainline architecture",
1192 .dependencies = featureSet(&[_]Feature{1016 .dependencies = featureSet(&[_]Feature{
1193 .perfmon,1017 .@"8msecext",
1194 .v6t2,1018 .acquire_release,
1195 .v7clrex,1019 .db,
1020 .hwdiv,
1021 .mclass,
1022 .noarm,
1023 .thumb_mode,
1024 .has_v8m_main,
1196 }),1025 }),
1197 };1026 };
1198 result[@enumToInt(Feature.v7clrex)] = .{1027 result[@enumToInt(Feature.v8r)] = .{
1199 .llvm_name = "v7clrex",1028 .llvm_name = "armv8-r",
1200 .description = "Has v7 clrex instruction",1029 .description = "ARMv8r architecture",
1201 .dependencies = featureSet(&[_]Feature{}),
1202 };
1203 result[@enumToInt(Feature.v8)] = .{
1204 .llvm_name = "v8",
1205 .description = "Support ARM v8 instructions",
1206 .dependencies = featureSet(&[_]Feature{1030 .dependencies = featureSet(&[_]Feature{
1207 .acquire_release,1031 .crc,
1208 .v7,1032 .db,
1033 .dfb,
1034 .dsp,
1035 .fp_armv8,
1036 .mp,
1037 .neon,
1038 .rclass,
1039 .has_v8,
1040 .virtualization,
1209 }),1041 }),
1210 };1042 };
1211 result[@enumToInt(Feature.v8_1a)] = .{1043 result[@enumToInt(Feature.v8_1a)] = .{
1212 .llvm_name = "v8.1a",1044 .llvm_name = "armv8.1-a",
1213 .description = "Support ARM v8.1a instructions",1045 .description = "ARMv81a architecture",
1214 .dependencies = featureSet(&[_]Feature{1046 .dependencies = featureSet(&[_]Feature{
1215 .v8,1047 .aclass,
1048 .crc,
1049 .crypto,
1050 .db,
1051 .dsp,
1052 .fp_armv8,
1053 .mp,
1054 .neon,
1055 .trustzone,
1056 .has_v8_1a,
1057 .virtualization,
1216 }),1058 }),
1217 };1059 };
1218 result[@enumToInt(Feature.v8_1m_main)] = .{1060 result[@enumToInt(Feature.v8_1m_main)] = .{
1219 .llvm_name = "v8.1m.main",1061 .llvm_name = "armv8.1-m.main",
1220 .description = "Support ARM v8-1M Mainline instructions",1062 .description = "ARMv81mMainline architecture",
1221 .dependencies = featureSet(&[_]Feature{1063 .dependencies = featureSet(&[_]Feature{
1222 .v8m_main,1064 .@"8msecext",
1065 .acquire_release,
1066 .db,
1067 .hwdiv,
1068 .lob,
1069 .mclass,
1070 .noarm,
1071 .ras,
1072 .thumb_mode,
1073 .has_v8_1m_main,
1223 }),1074 }),
1224 };1075 };
1225 result[@enumToInt(Feature.v8_2a)] = .{1076 result[@enumToInt(Feature.v8_2a)] = .{
1226 .llvm_name = "v8.2a",1077 .llvm_name = "armv8.2-a",
1227 .description = "Support ARM v8.2a instructions",1078 .description = "ARMv82a architecture",
1228 .dependencies = featureSet(&[_]Feature{1079 .dependencies = featureSet(&[_]Feature{
1229 .v8_1a,1080 .aclass,
1081 .crc,
1082 .crypto,
1083 .db,
1084 .dsp,
1085 .fp_armv8,
1086 .mp,
1087 .neon,
1088 .ras,
1089 .trustzone,
1090 .has_v8_2a,
1091 .virtualization,
1230 }),1092 }),
1231 };1093 };
1232 result[@enumToInt(Feature.v8_3a)] = .{1094 result[@enumToInt(Feature.v8_3a)] = .{
1233 .llvm_name = "v8.3a",1095 .llvm_name = "armv8.3-a",
1234 .description = "Support ARM v8.3a instructions",1096 .description = "ARMv83a architecture",
1235 .dependencies = featureSet(&[_]Feature{1097 .dependencies = featureSet(&[_]Feature{
1236 .v8_2a,1098 .aclass,
1099 .crc,
1100 .crypto,
1101 .db,
1102 .dsp,
1103 .fp_armv8,
1104 .mp,
1105 .neon,
1106 .ras,
1107 .trustzone,
1108 .has_v8_3a,
1109 .virtualization,
1237 }),1110 }),
1238 };1111 };
1239 result[@enumToInt(Feature.v8_4a)] = .{1112 result[@enumToInt(Feature.v8_4a)] = .{
1240 .llvm_name = "v8.4a",1113 .llvm_name = "armv8.4-a",
1241 .description = "Support ARM v8.4a instructions",1114 .description = "ARMv84a architecture",
1242 .dependencies = featureSet(&[_]Feature{1115 .dependencies = featureSet(&[_]Feature{
1116 .aclass,
1117 .crc,
1118 .crypto,
1119 .db,
1243 .dotprod,1120 .dotprod,
1244 .v8_3a,1121 .dsp,
1122 .fp_armv8,
1123 .mp,
1124 .neon,
1125 .ras,
1126 .trustzone,
1127 .has_v8_4a,
1128 .virtualization,
1245 }),1129 }),
1246 };1130 };
1247 result[@enumToInt(Feature.v8_5a)] = .{1131 result[@enumToInt(Feature.v8_5a)] = .{
1248 .llvm_name = "v8.5a",1132 .llvm_name = "armv8.5-a",
1249 .description = "Support ARM v8.5a instructions",1133 .description = "ARMv85a architecture",
1250 .dependencies = featureSet(&[_]Feature{
1251 .sb,
1252 .v8_4a,
1253 }),
1254 };
1255 result[@enumToInt(Feature.v8m)] = .{
1256 .llvm_name = "v8m",
1257 .description = "Support ARM v8M Baseline instructions",
1258 .dependencies = featureSet(&[_]Feature{
1259 .v6m,
1260 }),
1261 };
1262 result[@enumToInt(Feature.v8m_main)] = .{
1263 .llvm_name = "v8m.main",
1264 .description = "Support ARM v8M Mainline instructions",
1265 .dependencies = featureSet(&[_]Feature{1134 .dependencies = featureSet(&[_]Feature{
1266 .v7,1135 .aclass,
1136 .crc,
1137 .crypto,
1138 .db,
1139 .dotprod,
1140 .dsp,
1141 .fp_armv8,
1142 .mp,
1143 .neon,
1144 .ras,
1145 .trustzone,
1146 .has_v8_5a,
1147 .virtualization,
1267 }),1148 }),
1268 };1149 };
1269 result[@enumToInt(Feature.vfp2)] = .{1150 result[@enumToInt(Feature.vfp2)] = .{
...@@ -1398,7 +1279,7 @@ pub const all_features = blk: {...@@ -1398,7 +1279,7 @@ pub const all_features = blk: {
1398 .llvm_name = "xscale",1279 .llvm_name = "xscale",
1399 .description = "ARMv5te architecture",1280 .description = "ARMv5te architecture",
1400 .dependencies = featureSet(&[_]Feature{1281 .dependencies = featureSet(&[_]Feature{
1401 .armv5te,1282 .has_v5te,
1402 }),1283 }),
1403 };1284 };
1404 result[@enumToInt(Feature.zcz)] = .{1285 result[@enumToInt(Feature.zcz)] = .{
...@@ -1415,221 +1296,227 @@ pub const all_features = blk: {...@@ -1415,221 +1296,227 @@ pub const all_features = blk: {
1415};1296};
14161297
1417pub const cpu = struct {1298pub const cpu = struct {
1418 pub const arm1020e = Cpu{1299 pub const arm1020e = CpuModel{
1419 .name = "arm1020e",1300 .name = "arm1020e",
1420 .llvm_name = "arm1020e",1301 .llvm_name = "arm1020e",
1421 .features = featureSet(&[_]Feature{1302 .features = featureSet(&[_]Feature{
1422 .armv5te,1303 .v5te,
1423 }),1304 }),
1424 };1305 };
1425 pub const arm1020t = Cpu{1306 pub const arm1020t = CpuModel{
1426 .name = "arm1020t",1307 .name = "arm1020t",
1427 .llvm_name = "arm1020t",1308 .llvm_name = "arm1020t",
1428 .features = featureSet(&[_]Feature{1309 .features = featureSet(&[_]Feature{
1429 .armv5t,1310 .v5t,
1430 }),1311 }),
1431 };1312 };
1432 pub const arm1022e = Cpu{1313 pub const arm1022e = CpuModel{
1433 .name = "arm1022e",1314 .name = "arm1022e",
1434 .llvm_name = "arm1022e",1315 .llvm_name = "arm1022e",
1435 .features = featureSet(&[_]Feature{1316 .features = featureSet(&[_]Feature{
1436 .armv5te,1317 .v5te,
1437 }),1318 }),
1438 };1319 };
1439 pub const arm10e = Cpu{1320 pub const arm10e = CpuModel{
1440 .name = "arm10e",1321 .name = "arm10e",
1441 .llvm_name = "arm10e",1322 .llvm_name = "arm10e",
1442 .features = featureSet(&[_]Feature{1323 .features = featureSet(&[_]Feature{
1443 .armv5te,1324 .v5te,
1444 }),1325 }),
1445 };1326 };
1446 pub const arm10tdmi = Cpu{1327 pub const arm10tdmi = CpuModel{
1447 .name = "arm10tdmi",1328 .name = "arm10tdmi",
1448 .llvm_name = "arm10tdmi",1329 .llvm_name = "arm10tdmi",
1449 .features = featureSet(&[_]Feature{1330 .features = featureSet(&[_]Feature{
1450 .armv5t,1331 .v5t,
1451 }),1332 }),
1452 };1333 };
1453 pub const arm1136j_s = Cpu{1334 pub const arm1136j_s = CpuModel{
1454 .name = "arm1136j_s",1335 .name = "arm1136j_s",
1455 .llvm_name = "arm1136j-s",1336 .llvm_name = "arm1136j-s",
1456 .features = featureSet(&[_]Feature{1337 .features = featureSet(&[_]Feature{
1457 .armv6,1338 .v6,
1458 }),1339 }),
1459 };1340 };
1460 pub const arm1136jf_s = Cpu{1341 pub const arm1136jf_s = CpuModel{
1461 .name = "arm1136jf_s",1342 .name = "arm1136jf_s",
1462 .llvm_name = "arm1136jf-s",1343 .llvm_name = "arm1136jf-s",
1463 .features = featureSet(&[_]Feature{1344 .features = featureSet(&[_]Feature{
1464 .armv6,1345 .v6,
1465 .slowfpvmlx,1346 .slowfpvmlx,
1466 .vfp2,1347 .vfp2,
1467 }),1348 }),
1468 };1349 };
1469 pub const arm1156t2_s = Cpu{1350 pub const arm1156t2_s = CpuModel{
1470 .name = "arm1156t2_s",1351 .name = "arm1156t2_s",
1471 .llvm_name = "arm1156t2-s",1352 .llvm_name = "arm1156t2-s",
1472 .features = featureSet(&[_]Feature{1353 .features = featureSet(&[_]Feature{
1473 .armv6t2,1354 .v6t2,
1474 }),1355 }),
1475 };1356 };
1476 pub const arm1156t2f_s = Cpu{1357 pub const arm1156t2f_s = CpuModel{
1477 .name = "arm1156t2f_s",1358 .name = "arm1156t2f_s",
1478 .llvm_name = "arm1156t2f-s",1359 .llvm_name = "arm1156t2f-s",
1479 .features = featureSet(&[_]Feature{1360 .features = featureSet(&[_]Feature{
1480 .armv6t2,1361 .v6t2,
1481 .slowfpvmlx,1362 .slowfpvmlx,
1482 .vfp2,1363 .vfp2,
1483 }),1364 }),
1484 };1365 };
1485 pub const arm1176j_s = Cpu{1366 pub const arm1176j_s = CpuModel{
1486 .name = "arm1176j_s",1367 .name = "arm1176j_s",
1487 .llvm_name = "arm1176j-s",1368 .llvm_name = "arm1176j-s",
1488 .features = featureSet(&[_]Feature{1369 .features = featureSet(&[_]Feature{
1489 .armv6kz,1370 .v6kz,
1490 }),1371 }),
1491 };1372 };
1492 pub const arm1176jz_s = Cpu{1373 pub const arm1176jz_s = CpuModel{
1493 .name = "arm1176jz_s",1374 .name = "arm1176jz_s",
1494 .llvm_name = "arm1176jz-s",1375 .llvm_name = "arm1176jz-s",
1495 .features = featureSet(&[_]Feature{1376 .features = featureSet(&[_]Feature{
1496 .armv6kz,1377 .v6kz,
1497 }),1378 }),
1498 };1379 };
1499 pub const arm1176jzf_s = Cpu{1380 pub const arm1176jzf_s = CpuModel{
1500 .name = "arm1176jzf_s",1381 .name = "arm1176jzf_s",
1501 .llvm_name = "arm1176jzf-s",1382 .llvm_name = "arm1176jzf-s",
1502 .features = featureSet(&[_]Feature{1383 .features = featureSet(&[_]Feature{
1503 .armv6kz,1384 .v6kz,
1504 .slowfpvmlx,1385 .slowfpvmlx,
1505 .vfp2,1386 .vfp2,
1506 }),1387 }),
1507 };1388 };
1508 pub const arm710t = Cpu{1389 pub const arm710t = CpuModel{
1509 .name = "arm710t",1390 .name = "arm710t",
1510 .llvm_name = "arm710t",1391 .llvm_name = "arm710t",
1511 .features = featureSet(&[_]Feature{1392 .features = featureSet(&[_]Feature{
1512 .armv4t,1393 .v4t,
1513 }),1394 }),
1514 };1395 };
1515 pub const arm720t = Cpu{1396 pub const arm720t = CpuModel{
1516 .name = "arm720t",1397 .name = "arm720t",
1517 .llvm_name = "arm720t",1398 .llvm_name = "arm720t",
1518 .features = featureSet(&[_]Feature{1399 .features = featureSet(&[_]Feature{
1519 .armv4t,1400 .v4t,
1520 }),1401 }),
1521 };1402 };
1522 pub const arm7tdmi = Cpu{1403 pub const arm7tdmi = CpuModel{
1523 .name = "arm7tdmi",1404 .name = "arm7tdmi",
1524 .llvm_name = "arm7tdmi",1405 .llvm_name = "arm7tdmi",
1525 .features = featureSet(&[_]Feature{1406 .features = featureSet(&[_]Feature{
1526 .armv4t,1407 .v4t,
1527 }),1408 }),
1528 };1409 };
1529 pub const arm7tdmi_s = Cpu{1410 pub const arm7tdmi_s = CpuModel{
1530 .name = "arm7tdmi_s",1411 .name = "arm7tdmi_s",
1531 .llvm_name = "arm7tdmi-s",1412 .llvm_name = "arm7tdmi-s",
1532 .features = featureSet(&[_]Feature{1413 .features = featureSet(&[_]Feature{
1533 .armv4t,1414 .v4t,
1534 }),1415 }),
1535 };1416 };
1536 pub const arm8 = Cpu{1417 pub const arm8 = CpuModel{
1537 .name = "arm8",1418 .name = "arm8",
1538 .llvm_name = "arm8",1419 .llvm_name = "arm8",
1539 .features = featureSet(&[_]Feature{1420 .features = featureSet(&[_]Feature{
1540 .armv4,1421 .v4,
1541 }),1422 }),
1542 };1423 };
1543 pub const arm810 = Cpu{1424 pub const arm810 = CpuModel{
1544 .name = "arm810",1425 .name = "arm810",
1545 .llvm_name = "arm810",1426 .llvm_name = "arm810",
1546 .features = featureSet(&[_]Feature{1427 .features = featureSet(&[_]Feature{
1547 .armv4,1428 .v4,
1548 }),1429 }),
1549 };1430 };
1550 pub const arm9 = Cpu{1431 pub const arm9 = CpuModel{
1551 .name = "arm9",1432 .name = "arm9",
1552 .llvm_name = "arm9",1433 .llvm_name = "arm9",
1553 .features = featureSet(&[_]Feature{1434 .features = featureSet(&[_]Feature{
1554 .armv4t,1435 .v4t,
1555 }),1436 }),
1556 };1437 };
1557 pub const arm920 = Cpu{1438 pub const arm920 = CpuModel{
1558 .name = "arm920",1439 .name = "arm920",
1559 .llvm_name = "arm920",1440 .llvm_name = "arm920",
1560 .features = featureSet(&[_]Feature{1441 .features = featureSet(&[_]Feature{
1561 .armv4t,1442 .v4t,
1562 }),1443 }),
1563 };1444 };
1564 pub const arm920t = Cpu{1445 pub const arm920t = CpuModel{
1565 .name = "arm920t",1446 .name = "arm920t",
1566 .llvm_name = "arm920t",1447 .llvm_name = "arm920t",
1567 .features = featureSet(&[_]Feature{1448 .features = featureSet(&[_]Feature{
1568 .armv4t,1449 .v4t,
1569 }),1450 }),
1570 };1451 };
1571 pub const arm922t = Cpu{1452 pub const arm922t = CpuModel{
1572 .name = "arm922t",1453 .name = "arm922t",
1573 .llvm_name = "arm922t",1454 .llvm_name = "arm922t",
1574 .features = featureSet(&[_]Feature{1455 .features = featureSet(&[_]Feature{
1575 .armv4t,1456 .v4t,
1576 }),1457 }),
1577 };1458 };
1578 pub const arm926ej_s = Cpu{1459 pub const arm926ej_s = CpuModel{
1579 .name = "arm926ej_s",1460 .name = "arm926ej_s",
1580 .llvm_name = "arm926ej-s",1461 .llvm_name = "arm926ej-s",
1581 .features = featureSet(&[_]Feature{1462 .features = featureSet(&[_]Feature{
1582 .armv5te,1463 .v5te,
1583 }),1464 }),
1584 };1465 };
1585 pub const arm940t = Cpu{1466 pub const arm940t = CpuModel{
1586 .name = "arm940t",1467 .name = "arm940t",
1587 .llvm_name = "arm940t",1468 .llvm_name = "arm940t",
1588 .features = featureSet(&[_]Feature{1469 .features = featureSet(&[_]Feature{
1589 .armv4t,1470 .v4t,
1590 }),1471 }),
1591 };1472 };
1592 pub const arm946e_s = Cpu{1473 pub const arm946e_s = CpuModel{
1593 .name = "arm946e_s",1474 .name = "arm946e_s",
1594 .llvm_name = "arm946e-s",1475 .llvm_name = "arm946e-s",
1595 .features = featureSet(&[_]Feature{1476 .features = featureSet(&[_]Feature{
1596 .armv5te,1477 .v5te,
1597 }),1478 }),
1598 };1479 };
1599 pub const arm966e_s = Cpu{1480 pub const arm966e_s = CpuModel{
1600 .name = "arm966e_s",1481 .name = "arm966e_s",
1601 .llvm_name = "arm966e-s",1482 .llvm_name = "arm966e-s",
1602 .features = featureSet(&[_]Feature{1483 .features = featureSet(&[_]Feature{
1603 .armv5te,1484 .v5te,
1604 }),1485 }),
1605 };1486 };
1606 pub const arm968e_s = Cpu{1487 pub const arm968e_s = CpuModel{
1607 .name = "arm968e_s",1488 .name = "arm968e_s",
1608 .llvm_name = "arm968e-s",1489 .llvm_name = "arm968e-s",
1609 .features = featureSet(&[_]Feature{1490 .features = featureSet(&[_]Feature{
1610 .armv5te,1491 .v5te,
1611 }),1492 }),
1612 };1493 };
1613 pub const arm9e = Cpu{1494 pub const arm9e = CpuModel{
1614 .name = "arm9e",1495 .name = "arm9e",
1615 .llvm_name = "arm9e",1496 .llvm_name = "arm9e",
1616 .features = featureSet(&[_]Feature{1497 .features = featureSet(&[_]Feature{
1617 .armv5te,1498 .v5te,
1618 }),1499 }),
1619 };1500 };
1620 pub const arm9tdmi = Cpu{1501 pub const arm9tdmi = CpuModel{
1621 .name = "arm9tdmi",1502 .name = "arm9tdmi",
1622 .llvm_name = "arm9tdmi",1503 .llvm_name = "arm9tdmi",
1623 .features = featureSet(&[_]Feature{1504 .features = featureSet(&[_]Feature{
1624 .armv4t,1505 .v4t,
1506 }),
1507 };
1508 pub const baseline = CpuModel{
1509 .name = "baseline",
1510 .llvm_name = "generic",
1511 .features = featureSet(&[_]Feature{
1512 .v6m,
1625 }),1513 }),
1626 };1514 };
1627 pub const cortex_a12 = Cpu{1515 pub const cortex_a12 = CpuModel{
1628 .name = "cortex_a12",1516 .name = "cortex_a12",
1629 .llvm_name = "cortex-a12",1517 .llvm_name = "cortex-a12",
1630 .features = featureSet(&[_]Feature{1518 .features = featureSet(&[_]Feature{
1631 .a12,1519 .v7a,
1632 .armv7_a,
1633 .avoid_partial_cpsr,1520 .avoid_partial_cpsr,
1634 .mp,1521 .mp,
1635 .ret_addr_stack,1522 .ret_addr_stack,
...@@ -1639,12 +1526,11 @@ pub const cpu = struct {...@@ -1639,12 +1526,11 @@ pub const cpu = struct {
1639 .vmlx_forwarding,1526 .vmlx_forwarding,
1640 }),1527 }),
1641 };1528 };
1642 pub const cortex_a15 = Cpu{1529 pub const cortex_a15 = CpuModel{
1643 .name = "cortex_a15",1530 .name = "cortex_a15",
1644 .llvm_name = "cortex-a15",1531 .llvm_name = "cortex-a15",
1645 .features = featureSet(&[_]Feature{1532 .features = featureSet(&[_]Feature{
1646 .a15,1533 .v7a,
1647 .armv7_a,
1648 .avoid_partial_cpsr,1534 .avoid_partial_cpsr,
1649 .dont_widen_vmovs,1535 .dont_widen_vmovs,
1650 .mp,1536 .mp,
...@@ -1657,12 +1543,11 @@ pub const cpu = struct {...@@ -1657,12 +1543,11 @@ pub const cpu = struct {
1657 .vldn_align,1543 .vldn_align,
1658 }),1544 }),
1659 };1545 };
1660 pub const cortex_a17 = Cpu{1546 pub const cortex_a17 = CpuModel{
1661 .name = "cortex_a17",1547 .name = "cortex_a17",
1662 .llvm_name = "cortex-a17",1548 .llvm_name = "cortex-a17",
1663 .features = featureSet(&[_]Feature{1549 .features = featureSet(&[_]Feature{
1664 .a17,1550 .v7a,
1665 .armv7_a,
1666 .avoid_partial_cpsr,1551 .avoid_partial_cpsr,
1667 .mp,1552 .mp,
1668 .ret_addr_stack,1553 .ret_addr_stack,
...@@ -1672,35 +1557,33 @@ pub const cpu = struct {...@@ -1672,35 +1557,33 @@ pub const cpu = struct {
1672 .vmlx_forwarding,1557 .vmlx_forwarding,
1673 }),1558 }),
1674 };1559 };
1675 pub const cortex_a32 = Cpu{1560 pub const cortex_a32 = CpuModel{
1676 .name = "cortex_a32",1561 .name = "cortex_a32",
1677 .llvm_name = "cortex-a32",1562 .llvm_name = "cortex-a32",
1678 .features = featureSet(&[_]Feature{1563 .features = featureSet(&[_]Feature{
1679 .armv8_a,
1680 .crc,1564 .crc,
1681 .crypto,1565 .crypto,
1682 .hwdiv,1566 .hwdiv,
1683 .hwdiv_arm,1567 .hwdiv_arm,
1568 .v8a,
1684 }),1569 }),
1685 };1570 };
1686 pub const cortex_a35 = Cpu{1571 pub const cortex_a35 = CpuModel{
1687 .name = "cortex_a35",1572 .name = "cortex_a35",
1688 .llvm_name = "cortex-a35",1573 .llvm_name = "cortex-a35",
1689 .features = featureSet(&[_]Feature{1574 .features = featureSet(&[_]Feature{
1690 .a35,
1691 .armv8_a,
1692 .crc,1575 .crc,
1693 .crypto,1576 .crypto,
1694 .hwdiv,1577 .hwdiv,
1695 .hwdiv_arm,1578 .hwdiv_arm,
1579 .v8a,
1696 }),1580 }),
1697 };1581 };
1698 pub const cortex_a5 = Cpu{1582 pub const cortex_a5 = CpuModel{
1699 .name = "cortex_a5",1583 .name = "cortex_a5",
1700 .llvm_name = "cortex-a5",1584 .llvm_name = "cortex-a5",
1701 .features = featureSet(&[_]Feature{1585 .features = featureSet(&[_]Feature{
1702 .a5,1586 .v7a,
1703 .armv7_a,
1704 .mp,1587 .mp,
1705 .ret_addr_stack,1588 .ret_addr_stack,
1706 .slow_fp_brcc,1589 .slow_fp_brcc,
...@@ -1710,12 +1593,11 @@ pub const cpu = struct {...@@ -1710,12 +1593,11 @@ pub const cpu = struct {
1710 .vmlx_forwarding,1593 .vmlx_forwarding,
1711 }),1594 }),
1712 };1595 };
1713 pub const cortex_a53 = Cpu{1596 pub const cortex_a53 = CpuModel{
1714 .name = "cortex_a53",1597 .name = "cortex_a53",
1715 .llvm_name = "cortex-a53",1598 .llvm_name = "cortex-a53",
1716 .features = featureSet(&[_]Feature{1599 .features = featureSet(&[_]Feature{
1717 .a53,1600 .v8a,
1718 .armv8_a,
1719 .crc,1601 .crc,
1720 .crypto,1602 .crypto,
1721 .fpao,1603 .fpao,
...@@ -1723,23 +1605,21 @@ pub const cpu = struct {...@@ -1723,23 +1605,21 @@ pub const cpu = struct {
1723 .hwdiv_arm,1605 .hwdiv_arm,
1724 }),1606 }),
1725 };1607 };
1726 pub const cortex_a55 = Cpu{1608 pub const cortex_a55 = CpuModel{
1727 .name = "cortex_a55",1609 .name = "cortex_a55",
1728 .llvm_name = "cortex-a55",1610 .llvm_name = "cortex-a55",
1729 .features = featureSet(&[_]Feature{1611 .features = featureSet(&[_]Feature{
1730 .a55,1612 .v8_2a,
1731 .armv8_2_a,
1732 .dotprod,1613 .dotprod,
1733 .hwdiv,1614 .hwdiv,
1734 .hwdiv_arm,1615 .hwdiv_arm,
1735 }),1616 }),
1736 };1617 };
1737 pub const cortex_a57 = Cpu{1618 pub const cortex_a57 = CpuModel{
1738 .name = "cortex_a57",1619 .name = "cortex_a57",
1739 .llvm_name = "cortex-a57",1620 .llvm_name = "cortex-a57",
1740 .features = featureSet(&[_]Feature{1621 .features = featureSet(&[_]Feature{
1741 .a57,1622 .v8a,
1742 .armv8_a,
1743 .avoid_partial_cpsr,1623 .avoid_partial_cpsr,
1744 .cheap_predicable_cpsr,1624 .cheap_predicable_cpsr,
1745 .crc,1625 .crc,
...@@ -1749,12 +1629,11 @@ pub const cpu = struct {...@@ -1749,12 +1629,11 @@ pub const cpu = struct {
1749 .hwdiv_arm,1629 .hwdiv_arm,
1750 }),1630 }),
1751 };1631 };
1752 pub const cortex_a7 = Cpu{1632 pub const cortex_a7 = CpuModel{
1753 .name = "cortex_a7",1633 .name = "cortex_a7",
1754 .llvm_name = "cortex-a7",1634 .llvm_name = "cortex-a7",
1755 .features = featureSet(&[_]Feature{1635 .features = featureSet(&[_]Feature{
1756 .a7,1636 .v7a,
1757 .armv7_a,
1758 .mp,1637 .mp,
1759 .ret_addr_stack,1638 .ret_addr_stack,
1760 .slow_fp_brcc,1639 .slow_fp_brcc,
...@@ -1766,47 +1645,44 @@ pub const cpu = struct {...@@ -1766,47 +1645,44 @@ pub const cpu = struct {
1766 .vmlx_hazards,1645 .vmlx_hazards,
1767 }),1646 }),
1768 };1647 };
1769 pub const cortex_a72 = Cpu{1648 pub const cortex_a72 = CpuModel{
1770 .name = "cortex_a72",1649 .name = "cortex_a72",
1771 .llvm_name = "cortex-a72",1650 .llvm_name = "cortex-a72",
1772 .features = featureSet(&[_]Feature{1651 .features = featureSet(&[_]Feature{
1773 .a72,1652 .v8a,
1774 .armv8_a,
1775 .crc,1653 .crc,
1776 .crypto,1654 .crypto,
1777 .hwdiv,1655 .hwdiv,
1778 .hwdiv_arm,1656 .hwdiv_arm,
1779 }),1657 }),
1780 };1658 };
1781 pub const cortex_a73 = Cpu{1659 pub const cortex_a73 = CpuModel{
1782 .name = "cortex_a73",1660 .name = "cortex_a73",
1783 .llvm_name = "cortex-a73",1661 .llvm_name = "cortex-a73",
1784 .features = featureSet(&[_]Feature{1662 .features = featureSet(&[_]Feature{
1785 .a73,1663 .v8a,
1786 .armv8_a,
1787 .crc,1664 .crc,
1788 .crypto,1665 .crypto,
1789 .hwdiv,1666 .hwdiv,
1790 .hwdiv_arm,1667 .hwdiv_arm,
1791 }),1668 }),
1792 };1669 };
1793 pub const cortex_a75 = Cpu{1670 pub const cortex_a75 = CpuModel{
1794 .name = "cortex_a75",1671 .name = "cortex_a75",
1795 .llvm_name = "cortex-a75",1672 .llvm_name = "cortex-a75",
1796 .features = featureSet(&[_]Feature{1673 .features = featureSet(&[_]Feature{
1797 .a75,1674 .v8_2a,
1798 .armv8_2_a,
1799 .dotprod,1675 .dotprod,
1800 .hwdiv,1676 .hwdiv,
1801 .hwdiv_arm,1677 .hwdiv_arm,
1802 }),1678 }),
1803 };1679 };
1804 pub const cortex_a76 = Cpu{1680 pub const cortex_a76 = CpuModel{
1805 .name = "cortex_a76",1681 .name = "cortex_a76",
1806 .llvm_name = "cortex-a76",1682 .llvm_name = "cortex-a76",
1807 .features = featureSet(&[_]Feature{1683 .features = featureSet(&[_]Feature{
1808 .a76,1684 .a76,
1809 .armv8_2_a,1685 .v8_2a,
1810 .crc,1686 .crc,
1811 .crypto,1687 .crypto,
1812 .dotprod,1688 .dotprod,
...@@ -1815,12 +1691,12 @@ pub const cpu = struct {...@@ -1815,12 +1691,12 @@ pub const cpu = struct {
1815 .hwdiv_arm,1691 .hwdiv_arm,
1816 }),1692 }),
1817 };1693 };
1818 pub const cortex_a76ae = Cpu{1694 pub const cortex_a76ae = CpuModel{
1819 .name = "cortex_a76ae",1695 .name = "cortex_a76ae",
1820 .llvm_name = "cortex-a76ae",1696 .llvm_name = "cortex-a76ae",
1821 .features = featureSet(&[_]Feature{1697 .features = featureSet(&[_]Feature{
1822 .a76,1698 .a76,
1823 .armv8_2_a,1699 .v8_2a,
1824 .crc,1700 .crc,
1825 .crypto,1701 .crypto,
1826 .dotprod,1702 .dotprod,
...@@ -1829,12 +1705,11 @@ pub const cpu = struct {...@@ -1829,12 +1705,11 @@ pub const cpu = struct {
1829 .hwdiv_arm,1705 .hwdiv_arm,
1830 }),1706 }),
1831 };1707 };
1832 pub const cortex_a8 = Cpu{1708 pub const cortex_a8 = CpuModel{
1833 .name = "cortex_a8",1709 .name = "cortex_a8",
1834 .llvm_name = "cortex-a8",1710 .llvm_name = "cortex-a8",
1835 .features = featureSet(&[_]Feature{1711 .features = featureSet(&[_]Feature{
1836 .a8,1712 .v7a,
1837 .armv7_a,
1838 .nonpipelined_vfp,1713 .nonpipelined_vfp,
1839 .ret_addr_stack,1714 .ret_addr_stack,
1840 .slow_fp_brcc,1715 .slow_fp_brcc,
...@@ -1844,12 +1719,11 @@ pub const cpu = struct {...@@ -1844,12 +1719,11 @@ pub const cpu = struct {
1844 .vmlx_hazards,1719 .vmlx_hazards,
1845 }),1720 }),
1846 };1721 };
1847 pub const cortex_a9 = Cpu{1722 pub const cortex_a9 = CpuModel{
1848 .name = "cortex_a9",1723 .name = "cortex_a9",
1849 .llvm_name = "cortex-a9",1724 .llvm_name = "cortex-a9",
1850 .features = featureSet(&[_]Feature{1725 .features = featureSet(&[_]Feature{
1851 .a9,1726 .v7a,
1852 .armv7_a,
1853 .avoid_partial_cpsr,1727 .avoid_partial_cpsr,
1854 .expand_fp_mlx,1728 .expand_fp_mlx,
1855 .fp16,1729 .fp16,
...@@ -1864,40 +1738,40 @@ pub const cpu = struct {...@@ -1864,40 +1738,40 @@ pub const cpu = struct {
1864 .vmlx_hazards,1738 .vmlx_hazards,
1865 }),1739 }),
1866 };1740 };
1867 pub const cortex_m0 = Cpu{1741 pub const cortex_m0 = CpuModel{
1868 .name = "cortex_m0",1742 .name = "cortex_m0",
1869 .llvm_name = "cortex-m0",1743 .llvm_name = "cortex-m0",
1870 .features = featureSet(&[_]Feature{1744 .features = featureSet(&[_]Feature{
1871 .armv6_m,1745 .v6m,
1872 }),1746 }),
1873 };1747 };
1874 pub const cortex_m0plus = Cpu{1748 pub const cortex_m0plus = CpuModel{
1875 .name = "cortex_m0plus",1749 .name = "cortex_m0plus",
1876 .llvm_name = "cortex-m0plus",1750 .llvm_name = "cortex-m0plus",
1877 .features = featureSet(&[_]Feature{1751 .features = featureSet(&[_]Feature{
1878 .armv6_m,1752 .v6m,
1879 }),1753 }),
1880 };1754 };
1881 pub const cortex_m1 = Cpu{1755 pub const cortex_m1 = CpuModel{
1882 .name = "cortex_m1",1756 .name = "cortex_m1",
1883 .llvm_name = "cortex-m1",1757 .llvm_name = "cortex-m1",
1884 .features = featureSet(&[_]Feature{1758 .features = featureSet(&[_]Feature{
1885 .armv6_m,1759 .v6m,
1886 }),1760 }),
1887 };1761 };
1888 pub const cortex_m23 = Cpu{1762 pub const cortex_m23 = CpuModel{
1889 .name = "cortex_m23",1763 .name = "cortex_m23",
1890 .llvm_name = "cortex-m23",1764 .llvm_name = "cortex-m23",
1891 .features = featureSet(&[_]Feature{1765 .features = featureSet(&[_]Feature{
1892 .armv8_m_base,1766 .v8m,
1893 .no_movt,1767 .no_movt,
1894 }),1768 }),
1895 };1769 };
1896 pub const cortex_m3 = Cpu{1770 pub const cortex_m3 = CpuModel{
1897 .name = "cortex_m3",1771 .name = "cortex_m3",
1898 .llvm_name = "cortex-m3",1772 .llvm_name = "cortex-m3",
1899 .features = featureSet(&[_]Feature{1773 .features = featureSet(&[_]Feature{
1900 .armv7_m,1774 .v7m,
1901 .loop_align,1775 .loop_align,
1902 .m3,1776 .m3,
1903 .no_branch_predictor,1777 .no_branch_predictor,
...@@ -1905,11 +1779,11 @@ pub const cpu = struct {...@@ -1905,11 +1779,11 @@ pub const cpu = struct {
1905 .use_misched,1779 .use_misched,
1906 }),1780 }),
1907 };1781 };
1908 pub const cortex_m33 = Cpu{1782 pub const cortex_m33 = CpuModel{
1909 .name = "cortex_m33",1783 .name = "cortex_m33",
1910 .llvm_name = "cortex-m33",1784 .llvm_name = "cortex-m33",
1911 .features = featureSet(&[_]Feature{1785 .features = featureSet(&[_]Feature{
1912 .armv8_m_main,1786 .v8m_main,
1913 .dsp,1787 .dsp,
1914 .fp_armv8d16sp,1788 .fp_armv8d16sp,
1915 .loop_align,1789 .loop_align,
...@@ -1919,11 +1793,11 @@ pub const cpu = struct {...@@ -1919,11 +1793,11 @@ pub const cpu = struct {
1919 .use_misched,1793 .use_misched,
1920 }),1794 }),
1921 };1795 };
1922 pub const cortex_m35p = Cpu{1796 pub const cortex_m35p = CpuModel{
1923 .name = "cortex_m35p",1797 .name = "cortex_m35p",
1924 .llvm_name = "cortex-m35p",1798 .llvm_name = "cortex-m35p",
1925 .features = featureSet(&[_]Feature{1799 .features = featureSet(&[_]Feature{
1926 .armv8_m_main,1800 .v8m_main,
1927 .dsp,1801 .dsp,
1928 .fp_armv8d16sp,1802 .fp_armv8d16sp,
1929 .loop_align,1803 .loop_align,
...@@ -1933,11 +1807,11 @@ pub const cpu = struct {...@@ -1933,11 +1807,11 @@ pub const cpu = struct {
1933 .use_misched,1807 .use_misched,
1934 }),1808 }),
1935 };1809 };
1936 pub const cortex_m4 = Cpu{1810 pub const cortex_m4 = CpuModel{
1937 .name = "cortex_m4",1811 .name = "cortex_m4",
1938 .llvm_name = "cortex-m4",1812 .llvm_name = "cortex-m4",
1939 .features = featureSet(&[_]Feature{1813 .features = featureSet(&[_]Feature{
1940 .armv7e_m,1814 .v7em,
1941 .loop_align,1815 .loop_align,
1942 .no_branch_predictor,1816 .no_branch_predictor,
1943 .slowfpvmlx,1817 .slowfpvmlx,
...@@ -1946,29 +1820,29 @@ pub const cpu = struct {...@@ -1946,29 +1820,29 @@ pub const cpu = struct {
1946 .vfp4d16sp,1820 .vfp4d16sp,
1947 }),1821 }),
1948 };1822 };
1949 pub const cortex_m7 = Cpu{1823 pub const cortex_m7 = CpuModel{
1950 .name = "cortex_m7",1824 .name = "cortex_m7",
1951 .llvm_name = "cortex-m7",1825 .llvm_name = "cortex-m7",
1952 .features = featureSet(&[_]Feature{1826 .features = featureSet(&[_]Feature{
1953 .armv7e_m,1827 .v7em,
1954 .fp_armv8d16,1828 .fp_armv8d16,
1955 }),1829 }),
1956 };1830 };
1957 pub const cortex_r4 = Cpu{1831 pub const cortex_r4 = CpuModel{
1958 .name = "cortex_r4",1832 .name = "cortex_r4",
1959 .llvm_name = "cortex-r4",1833 .llvm_name = "cortex-r4",
1960 .features = featureSet(&[_]Feature{1834 .features = featureSet(&[_]Feature{
1961 .armv7_r,1835 .v7r,
1962 .avoid_partial_cpsr,1836 .avoid_partial_cpsr,
1963 .r4,1837 .r4,
1964 .ret_addr_stack,1838 .ret_addr_stack,
1965 }),1839 }),
1966 };1840 };
1967 pub const cortex_r4f = Cpu{1841 pub const cortex_r4f = CpuModel{
1968 .name = "cortex_r4f",1842 .name = "cortex_r4f",
1969 .llvm_name = "cortex-r4f",1843 .llvm_name = "cortex-r4f",
1970 .features = featureSet(&[_]Feature{1844 .features = featureSet(&[_]Feature{
1971 .armv7_r,1845 .v7r,
1972 .avoid_partial_cpsr,1846 .avoid_partial_cpsr,
1973 .r4,1847 .r4,
1974 .ret_addr_stack,1848 .ret_addr_stack,
...@@ -1977,52 +1851,49 @@ pub const cpu = struct {...@@ -1977,52 +1851,49 @@ pub const cpu = struct {
1977 .vfp3d16,1851 .vfp3d16,
1978 }),1852 }),
1979 };1853 };
1980 pub const cortex_r5 = Cpu{1854 pub const cortex_r5 = CpuModel{
1981 .name = "cortex_r5",1855 .name = "cortex_r5",
1982 .llvm_name = "cortex-r5",1856 .llvm_name = "cortex-r5",
1983 .features = featureSet(&[_]Feature{1857 .features = featureSet(&[_]Feature{
1984 .armv7_r,1858 .v7r,
1985 .avoid_partial_cpsr,1859 .avoid_partial_cpsr,
1986 .hwdiv_arm,1860 .hwdiv_arm,
1987 .r5,
1988 .ret_addr_stack,1861 .ret_addr_stack,
1989 .slow_fp_brcc,1862 .slow_fp_brcc,
1990 .slowfpvmlx,1863 .slowfpvmlx,
1991 .vfp3d16,1864 .vfp3d16,
1992 }),1865 }),
1993 };1866 };
1994 pub const cortex_r52 = Cpu{1867 pub const cortex_r52 = CpuModel{
1995 .name = "cortex_r52",1868 .name = "cortex_r52",
1996 .llvm_name = "cortex-r52",1869 .llvm_name = "cortex-r52",
1997 .features = featureSet(&[_]Feature{1870 .features = featureSet(&[_]Feature{
1998 .armv8_r,1871 .v8r,
1999 .fpao,1872 .fpao,
2000 .r52,
2001 .use_aa,1873 .use_aa,
2002 .use_misched,1874 .use_misched,
2003 }),1875 }),
2004 };1876 };
2005 pub const cortex_r7 = Cpu{1877 pub const cortex_r7 = CpuModel{
2006 .name = "cortex_r7",1878 .name = "cortex_r7",
2007 .llvm_name = "cortex-r7",1879 .llvm_name = "cortex-r7",
2008 .features = featureSet(&[_]Feature{1880 .features = featureSet(&[_]Feature{
2009 .armv7_r,1881 .v7r,
2010 .avoid_partial_cpsr,1882 .avoid_partial_cpsr,
2011 .fp16,1883 .fp16,
2012 .hwdiv_arm,1884 .hwdiv_arm,
2013 .mp,1885 .mp,
2014 .r7,
2015 .ret_addr_stack,1886 .ret_addr_stack,
2016 .slow_fp_brcc,1887 .slow_fp_brcc,
2017 .slowfpvmlx,1888 .slowfpvmlx,
2018 .vfp3d16,1889 .vfp3d16,
2019 }),1890 }),
2020 };1891 };
2021 pub const cortex_r8 = Cpu{1892 pub const cortex_r8 = CpuModel{
2022 .name = "cortex_r8",1893 .name = "cortex_r8",
2023 .llvm_name = "cortex-r8",1894 .llvm_name = "cortex-r8",
2024 .features = featureSet(&[_]Feature{1895 .features = featureSet(&[_]Feature{
2025 .armv7_r,1896 .v7r,
2026 .avoid_partial_cpsr,1897 .avoid_partial_cpsr,
2027 .fp16,1898 .fp16,
2028 .hwdiv_arm,1899 .hwdiv_arm,
...@@ -2033,11 +1904,11 @@ pub const cpu = struct {...@@ -2033,11 +1904,11 @@ pub const cpu = struct {
2033 .vfp3d16,1904 .vfp3d16,
2034 }),1905 }),
2035 };1906 };
2036 pub const cyclone = Cpu{1907 pub const cyclone = CpuModel{
2037 .name = "cyclone",1908 .name = "cyclone",
2038 .llvm_name = "cyclone",1909 .llvm_name = "cyclone",
2039 .features = featureSet(&[_]Feature{1910 .features = featureSet(&[_]Feature{
2040 .armv8_a,1911 .v8a,
2041 .avoid_movs_shop,1912 .avoid_movs_shop,
2042 .avoid_partial_cpsr,1913 .avoid_partial_cpsr,
2043 .crypto,1914 .crypto,
...@@ -2054,165 +1925,163 @@ pub const cpu = struct {...@@ -2054,165 +1925,163 @@ pub const cpu = struct {
2054 .zcz,1925 .zcz,
2055 }),1926 }),
2056 };1927 };
2057 pub const ep9312 = Cpu{1928 pub const ep9312 = CpuModel{
2058 .name = "ep9312",1929 .name = "ep9312",
2059 .llvm_name = "ep9312",1930 .llvm_name = "ep9312",
2060 .features = featureSet(&[_]Feature{1931 .features = featureSet(&[_]Feature{
2061 .armv4t,1932 .v4t,
2062 }),1933 }),
2063 };1934 };
2064 pub const exynos_m1 = Cpu{1935 pub const exynos_m1 = CpuModel{
2065 .name = "exynos_m1",1936 .name = "exynos_m1",
2066 .llvm_name = "exynos-m1",1937 .llvm_name = "exynos-m1",
2067 .features = featureSet(&[_]Feature{1938 .features = featureSet(&[_]Feature{
2068 .armv8_a,1939 .v8a,
2069 .exynos,1940 .exynos,
2070 }),1941 }),
2071 };1942 };
2072 pub const exynos_m2 = Cpu{1943 pub const exynos_m2 = CpuModel{
2073 .name = "exynos_m2",1944 .name = "exynos_m2",
2074 .llvm_name = "exynos-m2",1945 .llvm_name = "exynos-m2",
2075 .features = featureSet(&[_]Feature{1946 .features = featureSet(&[_]Feature{
2076 .armv8_a,1947 .v8a,
2077 .exynos,1948 .exynos,
2078 }),1949 }),
2079 };1950 };
2080 pub const exynos_m3 = Cpu{1951 pub const exynos_m3 = CpuModel{
2081 .name = "exynos_m3",1952 .name = "exynos_m3",
2082 .llvm_name = "exynos-m3",1953 .llvm_name = "exynos-m3",
2083 .features = featureSet(&[_]Feature{1954 .features = featureSet(&[_]Feature{
2084 .armv8_a,1955 .v8_2a,
2085 .exynos,1956 .exynos,
2086 }),1957 }),
2087 };1958 };
2088 pub const exynos_m4 = Cpu{1959 pub const exynos_m4 = CpuModel{
2089 .name = "exynos_m4",1960 .name = "exynos_m4",
2090 .llvm_name = "exynos-m4",1961 .llvm_name = "exynos-m4",
2091 .features = featureSet(&[_]Feature{1962 .features = featureSet(&[_]Feature{
2092 .armv8_2_a,1963 .v8_2a,
2093 .dotprod,1964 .dotprod,
2094 .exynos,1965 .exynos,
2095 .fullfp16,1966 .fullfp16,
2096 }),1967 }),
2097 };1968 };
2098 pub const exynos_m5 = Cpu{1969 pub const exynos_m5 = CpuModel{
2099 .name = "exynos_m5",1970 .name = "exynos_m5",
2100 .llvm_name = "exynos-m5",1971 .llvm_name = "exynos-m5",
2101 .features = featureSet(&[_]Feature{1972 .features = featureSet(&[_]Feature{
2102 .armv8_2_a,
2103 .dotprod,1973 .dotprod,
2104 .exynos,1974 .exynos,
2105 .fullfp16,1975 .fullfp16,
1976 .v8_2a,
2106 }),1977 }),
2107 };1978 };
2108 pub const generic = Cpu{1979 pub const generic = CpuModel{
2109 .name = "generic",1980 .name = "generic",
2110 .llvm_name = "generic",1981 .llvm_name = "generic",
2111 .features = featureSet(&[_]Feature{}),1982 .features = featureSet(&[_]Feature{}),
2112 };1983 };
2113 pub const iwmmxt = Cpu{1984 pub const iwmmxt = CpuModel{
2114 .name = "iwmmxt",1985 .name = "iwmmxt",
2115 .llvm_name = "iwmmxt",1986 .llvm_name = "iwmmxt",
2116 .features = featureSet(&[_]Feature{1987 .features = featureSet(&[_]Feature{
2117 .armv5te,1988 .v5te,
2118 }),1989 }),
2119 };1990 };
2120 pub const krait = Cpu{1991 pub const krait = CpuModel{
2121 .name = "krait",1992 .name = "krait",
2122 .llvm_name = "krait",1993 .llvm_name = "krait",
2123 .features = featureSet(&[_]Feature{1994 .features = featureSet(&[_]Feature{
2124 .armv7_a,
2125 .avoid_partial_cpsr,1995 .avoid_partial_cpsr,
2126 .fp16,1996 .fp16,
2127 .hwdiv,1997 .hwdiv,
2128 .hwdiv_arm,1998 .hwdiv_arm,
2129 .krait,
2130 .muxed_units,1999 .muxed_units,
2131 .ret_addr_stack,2000 .ret_addr_stack,
2001 .v7a,
2132 .vfp4,2002 .vfp4,
2133 .vldn_align,2003 .vldn_align,
2134 .vmlx_forwarding,2004 .vmlx_forwarding,
2135 }),2005 }),
2136 };2006 };
2137 pub const kryo = Cpu{2007 pub const kryo = CpuModel{
2138 .name = "kryo",2008 .name = "kryo",
2139 .llvm_name = "kryo",2009 .llvm_name = "kryo",
2140 .features = featureSet(&[_]Feature{2010 .features = featureSet(&[_]Feature{
2141 .armv8_a,
2142 .crc,2011 .crc,
2143 .crypto,2012 .crypto,
2144 .hwdiv,2013 .hwdiv,
2145 .hwdiv_arm,2014 .hwdiv_arm,
2146 .kryo,2015 .v8a,
2147 }),2016 }),
2148 };2017 };
2149 pub const mpcore = Cpu{2018 pub const mpcore = CpuModel{
2150 .name = "mpcore",2019 .name = "mpcore",
2151 .llvm_name = "mpcore",2020 .llvm_name = "mpcore",
2152 .features = featureSet(&[_]Feature{2021 .features = featureSet(&[_]Feature{
2153 .armv6k,2022 .v6k,
2154 .slowfpvmlx,2023 .slowfpvmlx,
2155 .vfp2,2024 .vfp2,
2156 }),2025 }),
2157 };2026 };
2158 pub const mpcorenovfp = Cpu{2027 pub const mpcorenovfp = CpuModel{
2159 .name = "mpcorenovfp",2028 .name = "mpcorenovfp",
2160 .llvm_name = "mpcorenovfp",2029 .llvm_name = "mpcorenovfp",
2161 .features = featureSet(&[_]Feature{2030 .features = featureSet(&[_]Feature{
2162 .armv6k,2031 .v6k,
2163 }),2032 }),
2164 };2033 };
2165 pub const sc000 = Cpu{2034 pub const sc000 = CpuModel{
2166 .name = "sc000",2035 .name = "sc000",
2167 .llvm_name = "sc000",2036 .llvm_name = "sc000",
2168 .features = featureSet(&[_]Feature{2037 .features = featureSet(&[_]Feature{
2169 .armv6_m,2038 .v6m,
2170 }),2039 }),
2171 };2040 };
2172 pub const sc300 = Cpu{2041 pub const sc300 = CpuModel{
2173 .name = "sc300",2042 .name = "sc300",
2174 .llvm_name = "sc300",2043 .llvm_name = "sc300",
2175 .features = featureSet(&[_]Feature{2044 .features = featureSet(&[_]Feature{
2176 .armv7_m,2045 .v7m,
2177 .m3,2046 .m3,
2178 .no_branch_predictor,2047 .no_branch_predictor,
2179 .use_aa,2048 .use_aa,
2180 .use_misched,2049 .use_misched,
2181 }),2050 }),
2182 };2051 };
2183 pub const strongarm = Cpu{2052 pub const strongarm = CpuModel{
2184 .name = "strongarm",2053 .name = "strongarm",
2185 .llvm_name = "strongarm",2054 .llvm_name = "strongarm",
2186 .features = featureSet(&[_]Feature{2055 .features = featureSet(&[_]Feature{
2187 .armv4,2056 .v4,
2188 }),2057 }),
2189 };2058 };
2190 pub const strongarm110 = Cpu{2059 pub const strongarm110 = CpuModel{
2191 .name = "strongarm110",2060 .name = "strongarm110",
2192 .llvm_name = "strongarm110",2061 .llvm_name = "strongarm110",
2193 .features = featureSet(&[_]Feature{2062 .features = featureSet(&[_]Feature{
2194 .armv4,2063 .v4,
2195 }),2064 }),
2196 };2065 };
2197 pub const strongarm1100 = Cpu{2066 pub const strongarm1100 = CpuModel{
2198 .name = "strongarm1100",2067 .name = "strongarm1100",
2199 .llvm_name = "strongarm1100",2068 .llvm_name = "strongarm1100",
2200 .features = featureSet(&[_]Feature{2069 .features = featureSet(&[_]Feature{
2201 .armv4,2070 .v4,
2202 }),2071 }),
2203 };2072 };
2204 pub const strongarm1110 = Cpu{2073 pub const strongarm1110 = CpuModel{
2205 .name = "strongarm1110",2074 .name = "strongarm1110",
2206 .llvm_name = "strongarm1110",2075 .llvm_name = "strongarm1110",
2207 .features = featureSet(&[_]Feature{2076 .features = featureSet(&[_]Feature{
2208 .armv4,2077 .v4,
2209 }),2078 }),
2210 };2079 };
2211 pub const swift = Cpu{2080 pub const swift = CpuModel{
2212 .name = "swift",2081 .name = "swift",
2213 .llvm_name = "swift",2082 .llvm_name = "swift",
2214 .features = featureSet(&[_]Feature{2083 .features = featureSet(&[_]Feature{
2215 .armv7_a,2084 .v7a,
2216 .avoid_movs_shop,2085 .avoid_movs_shop,
2217 .avoid_partial_cpsr,2086 .avoid_partial_cpsr,
2218 .disable_postra_scheduler,2087 .disable_postra_scheduler,
...@@ -2235,11 +2104,11 @@ pub const cpu = struct {...@@ -2235,11 +2104,11 @@ pub const cpu = struct {
2235 .wide_stride_vfp,2104 .wide_stride_vfp,
2236 }),2105 }),
2237 };2106 };
2238 pub const xscale = Cpu{2107 pub const xscale = CpuModel{
2239 .name = "xscale",2108 .name = "xscale",
2240 .llvm_name = "xscale",2109 .llvm_name = "xscale",
2241 .features = featureSet(&[_]Feature{2110 .features = featureSet(&[_]Feature{
2242 .armv5te,2111 .v5te,
2243 }),2112 }),
2244 };2113 };
2245};2114};
...@@ -2247,7 +2116,7 @@ pub const cpu = struct {...@@ -2247,7 +2116,7 @@ pub const cpu = struct {
2247/// All arm CPUs, sorted alphabetically by name.2116/// All arm CPUs, sorted alphabetically by name.
2248/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage12117/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2249/// compiler has inefficient memory and CPU usage, affecting build times.2118/// compiler has inefficient memory and CPU usage, affecting build times.
2250pub const all_cpus = &[_]*const Cpu{2119pub const all_cpus = &[_]*const CpuModel{
2251 &cpu.arm1020e,2120 &cpu.arm1020e,
2252 &cpu.arm1020t,2121 &cpu.arm1020t,
2253 &cpu.arm1022e,2122 &cpu.arm1022e,
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+152-247
...@@ -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,130 @@ fn cmdTargets(zig_triple: [*:0]const u8) !void {...@@ -647,208 +647,130 @@ 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.UnexpectedExtraField => return .SemanticAnalyzeFail,
765 };665 };
766 return .None;666 return .None;
767}667}
768668
769fn stage2ParseCpuFeatures(669fn stage2TargetParse(
670 stage1_target: *Stage2Target,
770 zig_triple_oz: ?[*:0]const u8,671 zig_triple_oz: ?[*:0]const u8,
771 cpu_name_oz: ?[*:0]const u8,672 mcpu_oz: ?[*:0]const u8,
772 cpu_features_oz: ?[*:0]const u8,673) !void {
773) !*Stage2CpuFeatures {674 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);675 const zig_triple = mem.toSliceConst(u8, zig_triple_z);
775 const target = try Target.parse(mem.toSliceConst(u8, zig_triple_z));676 const mcpu = if (mcpu_oz) |mcpu_z| mem.toSliceConst(u8, mcpu_z) else "baseline";
776 const arch = target.Cross.arch;677 var diags: std.Target.ParseOptions.Diagnostics = .{};
777678 break :blk Target.parse(.{
778 const cpu = if (cpu_name_oz) |cpu_name_z| blk: {679 .arch_os_abi = zig_triple,
779 const cpu_name = mem.toSliceConst(u8, cpu_name_z);680 .cpu_features = mcpu,
780 break :blk arch.parseCpu(cpu_name) catch |err| switch (err) {681 .diagnostics = &diags,
682 }) catch |err| switch (err) {
781 error.UnknownCpu => {683 error.UnknownCpu => {
782 std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{684 std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{
783 cpu_name,685 diags.cpu_name.?,
784 @tagName(arch),686 @tagName(diags.arch.?),
785 });687 });
786 for (arch.allCpus()) |cpu| {688 for (diags.arch.?.allCpuModels()) |cpu| {
787 std.debug.warn(" {}\n", .{cpu.name});689 std.debug.warn(" {}\n", .{cpu.name});
788 }690 }
789 process.exit(1);691 process.exit(1);
790 },692 },
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 => {693 error.UnknownCpuFeature => {
799 std.debug.warn(694 std.debug.warn(
800 \\Unknown CPU features specified.695 \\Unknown CPU feature: '{}'
801 \\Available CPU features for architecture '{}':696 \\Available CPU features for architecture '{}':
802 \\697 \\
803 , .{@tagName(arch)});698 , .{
804 for (arch.allFeaturesList()) |feature| {699 diags.unknown_feature_name,
805 std.debug.warn(" {}\n", .{feature.name});700 @tagName(diags.arch.?),
701 });
702 for (diags.arch.?.allFeaturesList()) |feature| {
703 std.debug.warn(" {}: {}\n", .{ feature.name, feature.description });
806 }704 }
807 process.exit(1);705 process.exit(1);
808 },706 },
809 else => |e| return e,707 else => |e| return e,
810 };708 };
811 } else cpu.features;709 } else Target.Native;
812710
813 if (arch.subArchFeature()) |index| {711 try stage1_target.fromTarget(target);
814 set.addFeature(index);712}
815 }
816 set.populateDependencies(arch.allFeaturesList());
817713
818 return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, .{714fn initStage1TargetCpuFeatures(stage1_target: *Stage2Target, cpu: Target.Cpu) !void {
819 .cpu = cpu,715 const allocator = std.heap.c_allocator;
820 .features = set,716 const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{
717 cpu.model.name,
718 cpu.features.asBytes(),
821 });719 });
822}720 errdefer allocator.free(cache_hash);
721
722 const generic_arch_name = cpu.arch.genericName();
723 var builtin_str_buffer = try std.Buffer.allocPrint(allocator,
724 \\Cpu{{
725 \\ .arch = .{},
726 \\ .model = &Target.{}.cpu.{},
727 \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{
728 \\
729 , .{
730 @tagName(cpu.arch),
731 generic_arch_name,
732 cpu.model.name,
733 generic_arch_name,
734 generic_arch_name,
735 });
736 defer builtin_str_buffer.deinit();
823737
824// ABI warning738 var llvm_features_buffer = try std.Buffer.initSize(allocator, 0);
825export fn stage2_cpu_features_get_cache_hash(739 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}
833740
834// ABI warning741 for (cpu.arch.allFeaturesList()) |feature, index_usize| {
835export fn stage2_cpu_features_get_builtin_str(742 const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize);
836 cpu_features: *const Stage2CpuFeatures,743 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}
843744
844// ABI warning745 if (feature.llvm_name) |llvm_name| {
845export fn stage2_cpu_features_get_llvm_cpu(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 {746 const plus_or_minus = "-+"[@boolToInt(is_enabled)];
846 return if (cpu_features.cpu_features.cpu.llvm_name) |s| s.ptr else null;747 try llvm_features_buffer.appendByte(plus_or_minus);
847}748 try llvm_features_buffer.append(llvm_name);
749 try llvm_features_buffer.append(",");
750 }
848751
849// ABI warning752 if (is_enabled) {
850export fn stage2_cpu_features_get_llvm_features(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 {753 // TODO some kind of "zig identifier escape" function rather than
851 return cpu_features.llvm_features_str;754 // unconditionally using @"" syntax
755 try builtin_str_buffer.append(" .@\"");
756 try builtin_str_buffer.append(feature.name);
757 try builtin_str_buffer.append("\",\n");
758 }
759 }
760
761 try builtin_str_buffer.append(
762 \\ }),
763 \\};
764 \\
765 );
766
767 assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ","));
768 llvm_features_buffer.shrink(llvm_features_buffer.len() - 1);
769
770 stage1_target.llvm_cpu_name = if (cpu.model.llvm_name) |s| s.ptr else null;
771 stage1_target.llvm_cpu_features = llvm_features_buffer.toOwnedSlice().ptr;
772 stage1_target.builtin_str = builtin_str_buffer.toOwnedSlice().ptr;
773 stage1_target.cache_hash = cache_hash.ptr;
852}774}
853775
854// ABI warning776// ABI warning
...@@ -1016,13 +938,61 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file:...@@ -1016,13 +938,61 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file:
1016// ABI warning938// ABI warning
1017const Stage2Target = extern struct {939const Stage2Target = extern struct {
1018 arch: c_int,940 arch: c_int,
1019 sub_arch: c_int,
1020 vendor: c_int,941 vendor: c_int,
1021 os: c_int,942
1022 abi: c_int,943 abi: c_int,
1023 glibc_version: ?*Stage2GLibCVersion, // null means default944 os: c_int,
1024 cpu_features: *Stage2CpuFeatures,945
1025 is_native: bool,946 is_native: bool,
947
948 glibc_version: ?*Stage2GLibCVersion, // null means default
949
950 llvm_cpu_name: ?[*:0]const u8,
951 llvm_cpu_features: ?[*:0]const u8,
952 builtin_str: ?[*:0]const u8,
953 cache_hash: ?[*:0]const u8,
954
955 fn toTarget(in_target: Stage2Target) Target {
956 if (in_target.is_native) return .Native;
957
958 const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch
959 const in_os = in_target.os;
960 const in_abi = in_target.abi;
961
962 return .{
963 .Cross = .{
964 .cpu = Target.Cpu.baseline(enumInt(Target.Cpu.Arch, in_arch)),
965 .os = enumInt(Target.Os, in_os),
966 .abi = enumInt(Target.Abi, in_abi),
967 },
968 };
969 }
970
971 fn fromTarget(self: *Stage2Target, target: Target) !void {
972 const cpu = switch (target) {
973 .Native => blk: {
974 // TODO self-host CPU model and feature detection instead of relying on LLVM
975 const llvm = @import("llvm.zig");
976 const llvm_cpu_name = llvm.GetHostCPUName();
977 const llvm_cpu_features = llvm.GetNativeFeatures();
978 break :blk try detectNativeCpuWithLLVM(target.getArch(), llvm_cpu_name, llvm_cpu_features);
979 },
980 .Cross => target.getCpu(),
981 };
982 self.* = .{
983 .arch = @enumToInt(target.getArch()) + 1, // skip over ZigLLVM_UnknownArch
984 .vendor = 0,
985 .os = @enumToInt(target.getOs()),
986 .abi = @enumToInt(target.getAbi()),
987 .llvm_cpu_name = null,
988 .llvm_cpu_features = null,
989 .builtin_str = null,
990 .cache_hash = null,
991 .is_native = target == .Native,
992 .glibc_version = null,
993 };
994 try initStage1TargetCpuFeatures(self, cpu);
995 }
1026};996};
1027997
1028// ABI warning998// ABI warning
...@@ -1034,72 +1004,7 @@ const Stage2GLibCVersion = extern struct {...@@ -1034,72 +1004,7 @@ const Stage2GLibCVersion = extern struct {
10341004
1035// ABI warning1005// ABI warning
1036export fn stage2_detect_dynamic_linker(in_target: *const Stage2Target, out_ptr: *[*:0]u8, out_len: *usize) Error {1006export 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_UnknownArch1007 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(1008 const result = @import("introspect.zig").detectDynamicLinker(
1104 std.heap.c_allocator,1009 std.heap.c_allocator,
1105 target,1010 target,
src/codegen.cpp+21-49
...@@ -8504,25 +8504,9 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {...@@ -8504,25 +8504,9 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
8504 for (uint32_t arch_i = 0; arch_i < field_count; arch_i += 1) {8504 for (uint32_t arch_i = 0; arch_i < field_count; arch_i += 1) {
8505 ZigLLVM_ArchType arch = target_arch_enum(arch_i);8505 ZigLLVM_ArchType arch = target_arch_enum(arch_i);
8506 const char *arch_name = target_arch_name(arch);8506 const char *arch_name = target_arch_name(arch);
8507 SubArchList sub_arch_list = target_subarch_list(arch);8507 if (arch == g->zig_target->arch) {
8508 if (sub_arch_list == SubArchListNone) {8508 g->target_arch_index = arch_i;
8509 if (arch == g->zig_target->arch) {8509 cur_arch = arch_name;
8510 g->target_arch_index = arch_i;
8511 cur_arch = buf_ptr(buf_sprintf("Arch.%s", arch_name));
8512 }
8513 } else {
8514 const char *sub_arch_list_name = target_subarch_list_name(sub_arch_list);
8515 if (arch == g->zig_target->arch) {
8516 size_t sub_count = target_subarch_count(sub_arch_list);
8517 for (size_t sub_i = 0; sub_i < sub_count; sub_i += 1) {
8518 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
8519 if (sub == g->zig_target->sub_arch) {
8520 g->target_sub_arch_index = sub_i;
8521 cur_arch = buf_ptr(buf_sprintf("Arch{ .%s = Arch.%s.%s }",
8522 arch_name, sub_arch_list_name, target_subarch_name(sub)));
8523 }
8524 }
8525 }
8526 }8510 }
8527 }8511 }
8528 }8512 }
...@@ -8621,17 +8605,14 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {...@@ -8621,17 +8605,14 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
8621 buf_appendf(contents, "pub const is_test = %s;\n", bool_to_str(g->is_test_build));8605 buf_appendf(contents, "pub const is_test = %s;\n", bool_to_str(g->is_test_build));
8622 buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded));8606 buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded));
8623 buf_appendf(contents, "pub const os = Os.%s;\n", cur_os);8607 buf_appendf(contents, "pub const os = Os.%s;\n", cur_os);
8624 buf_appendf(contents, "pub const arch = %s;\n", cur_arch);8608 buf_appendf(contents, "pub const arch = Arch.%s;\n", cur_arch);
8625 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);8609 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);
8626 {8610 {
8627 buf_append_str(contents, "pub const cpu_features: CpuFeatures = ");8611 buf_append_str(contents, "pub const cpu: Cpu = ");
8628 if (g->zig_target->cpu_features != nullptr) {8612 if (g->zig_target->builtin_str != nullptr) {
8629 const char *ptr;8613 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 {8614 } else {
8634 buf_append_str(contents, "arch.getBaselineCpuFeatures();\n");8615 buf_append_str(contents, "Target.Cpu.baseline(arch);\n");
8635 }8616 }
8636 }8617 }
8637 if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) {8618 if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) {
...@@ -8730,15 +8711,11 @@ static Error define_builtin_compile_vars(CodeGen *g) {...@@ -8730,15 +8711,11 @@ static Error define_builtin_compile_vars(CodeGen *g) {
8730 cache_int(&cache_hash, g->code_model);8711 cache_int(&cache_hash, g->code_model);
8731 cache_int(&cache_hash, g->zig_target->is_native);8712 cache_int(&cache_hash, g->zig_target->is_native);
8732 cache_int(&cache_hash, g->zig_target->arch);8713 cache_int(&cache_hash, g->zig_target->arch);
8733 cache_int(&cache_hash, g->zig_target->sub_arch);
8734 cache_int(&cache_hash, g->zig_target->vendor);8714 cache_int(&cache_hash, g->zig_target->vendor);
8735 cache_int(&cache_hash, g->zig_target->os);8715 cache_int(&cache_hash, g->zig_target->os);
8736 cache_int(&cache_hash, g->zig_target->abi);8716 cache_int(&cache_hash, g->zig_target->abi);
8737 if (g->zig_target->cpu_features != nullptr) {8717 if (g->zig_target->cache_hash != nullptr) {
8738 const char *ptr;8718 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 }8719 }
8743 if (g->zig_target->glibc_version != nullptr) {8720 if (g->zig_target->glibc_version != nullptr) {
8744 cache_int(&cache_hash, g->zig_target->glibc_version->major);8721 cache_int(&cache_hash, g->zig_target->glibc_version->major);
...@@ -8873,9 +8850,11 @@ static void init(CodeGen *g) {...@@ -8873,9 +8850,11 @@ static void init(CodeGen *g) {
8873 }8850 }
88748851
8875 // Override CPU and features if defined by user.8852 // Override CPU and features if defined by user.
8876 if (g->zig_target->cpu_features != nullptr) {8853 if (g->zig_target->llvm_cpu_name != nullptr) {
8877 target_specific_cpu_args = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features);8854 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);8855 }
8856 if (g->zig_target->llvm_cpu_features != nullptr) {
8857 target_specific_features = g->zig_target->llvm_cpu_features;
8879 }8858 }
8880 if (g->verbose_llvm_cpu_features) {8859 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));8860 fprintf(stderr, "name=%s triple=%s\n", buf_ptr(g->root_out_name), buf_ptr(&g->llvm_triple_str));
...@@ -9190,19 +9169,17 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa...@@ -9190,19 +9169,17 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa
9190 args.append("-target");9169 args.append("-target");
9191 args.append(buf_ptr(&g->llvm_triple_str));9170 args.append(buf_ptr(&g->llvm_triple_str));
91929171
9193 const char *llvm_cpu = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features);9172 if (g->zig_target->llvm_cpu_name != nullptr) {
9194 if (llvm_cpu != nullptr) {
9195 args.append("-Xclang");9173 args.append("-Xclang");
9196 args.append("-target-cpu");9174 args.append("-target-cpu");
9197 args.append("-Xclang");9175 args.append("-Xclang");
9198 args.append(llvm_cpu);9176 args.append(g->zig_target->llvm_cpu_name);
9199 }9177 }
9200 const char *llvm_target_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features);9178 if (g->zig_target->llvm_cpu_features != nullptr) {
9201 if (llvm_target_features != nullptr) {
9202 args.append("-Xclang");9179 args.append("-Xclang");
9203 args.append("-target-feature");9180 args.append("-target-feature");
9204 args.append("-Xclang");9181 args.append("-Xclang");
9205 args.append(llvm_target_features);9182 args.append(g->zig_target->llvm_cpu_features);
9206 }9183 }
9207 }9184 }
92089185
...@@ -9638,7 +9615,6 @@ Error create_c_object_cache(CodeGen *g, CacheHash **out_cache_hash, bool verbose...@@ -9638,7 +9615,6 @@ Error create_c_object_cache(CodeGen *g, CacheHash **out_cache_hash, bool verbose
9638 cache_list_of_str(cache_hash, g->libc_include_dir_list, g->libc_include_dir_len);9615 cache_list_of_str(cache_hash, g->libc_include_dir_list, g->libc_include_dir_len);
9639 cache_int(cache_hash, g->zig_target->is_native);9616 cache_int(cache_hash, g->zig_target->is_native);
9640 cache_int(cache_hash, g->zig_target->arch);9617 cache_int(cache_hash, g->zig_target->arch);
9641 cache_int(cache_hash, g->zig_target->sub_arch);
9642 cache_int(cache_hash, g->zig_target->vendor);9618 cache_int(cache_hash, g->zig_target->vendor);
9643 cache_int(cache_hash, g->zig_target->os);9619 cache_int(cache_hash, g->zig_target->os);
9644 cache_int(cache_hash, g->zig_target->abi);9620 cache_int(cache_hash, g->zig_target->abi);
...@@ -10402,15 +10378,11 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {...@@ -10402,15 +10378,11 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {
10402 cache_int(ch, g->out_type);10378 cache_int(ch, g->out_type);
10403 cache_bool(ch, g->zig_target->is_native);10379 cache_bool(ch, g->zig_target->is_native);
10404 cache_int(ch, g->zig_target->arch);10380 cache_int(ch, g->zig_target->arch);
10405 cache_int(ch, g->zig_target->sub_arch);
10406 cache_int(ch, g->zig_target->vendor);10381 cache_int(ch, g->zig_target->vendor);
10407 cache_int(ch, g->zig_target->os);10382 cache_int(ch, g->zig_target->os);
10408 cache_int(ch, g->zig_target->abi);10383 cache_int(ch, g->zig_target->abi);
10409 if (g->zig_target->cpu_features != nullptr) {10384 if (g->zig_target->cache_hash != nullptr) {
10410 const char *ptr;10385 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 }10386 }
10415 if (g->zig_target->glibc_version != nullptr) {10387 if (g->zig_target->glibc_version != nullptr) {
10416 cache_int(ch, g->zig_target->glibc_version->major);10388 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/glibc.cpp+2-4
...@@ -116,10 +116,8 @@ Error glibc_load_metadata(ZigGLibCAbi **out_result, Buf *zig_lib_dir, bool verbo...@@ -116,10 +116,8 @@ Error glibc_load_metadata(ZigGLibCAbi **out_result, Buf *zig_lib_dir, bool verbo
116 assert(opt_abi.is_some);116 assert(opt_abi.is_some);
117117
118118
119 err = target_parse_archsub(&target->arch, &target->sub_arch,119 err = target_parse_arch(&target->arch, (char*)opt_arch.value.ptr, opt_arch.value.len);
120 (char*)opt_arch.value.ptr, opt_arch.value.len);120 assert(err == ErrorNone);
121 // there's no sub arch so we might get an error, but the arch is still populated
122 assert(err == ErrorNone || err == ErrorUnknownArchitecture);
123121
124 target->os = OsLinux;122 target->os = OsLinux;
125123
src/main.cpp+29-54
...@@ -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,10 +454,8 @@ static int main0(int argc, char **argv) {...@@ -447,10 +454,8 @@ 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;
453 bool baseline_cpu = false;
454459
455 ZigList<const char *> llvm_argv = {0};460 ZigList<const char *> llvm_argv = {0};
456 llvm_argv.append("zig (LLVM option parsing)");461 llvm_argv.append("zig (LLVM option parsing)");
...@@ -717,8 +722,8 @@ static int main0(int argc, char **argv) {...@@ -717,8 +722,8 @@ static int main0(int argc, char **argv) {
717 emit_llvm_ir = true;722 emit_llvm_ir = true;
718 } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) {723 } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) {
719 emit_llvm_ir = false;724 emit_llvm_ir = false;
720 } else if (strcmp(arg, "-mcpu=baseline") == 0) {725 } else if (str_starts_with(arg, "-mcpu=")) {
721 baseline_cpu = true;726 mcpu = arg + strlen("-mcpu=");
722 } else if (i + 1 >= argc) {727 } else if (i + 1 >= argc) {
723 fprintf(stderr, "Expected another argument after %s\n", arg);728 fprintf(stderr, "Expected another argument after %s\n", arg);
724 return print_error_usage(arg0);729 return print_error_usage(arg0);
...@@ -895,10 +900,8 @@ static int main0(int argc, char **argv) {...@@ -895,10 +900,8 @@ static int main0(int argc, char **argv) {
895 , argv[i]);900 , argv[i]);
896 return EXIT_FAILURE;901 return EXIT_FAILURE;
897 }902 }
898 } else if (strcmp(arg, "-target-cpu") == 0) {903 } else if (strcmp(arg, "-mcpu") == 0) {
899 cpu = argv[i];904 mcpu = argv[i];
900 } else if (strcmp(arg, "-target-feature") == 0) {
901 features = argv[i];
902 } else {905 } else {
903 fprintf(stderr, "Invalid argument: %s\n", arg);906 fprintf(stderr, "Invalid argument: %s\n", arg);
904 return print_error_usage(arg0);907 return print_error_usage(arg0);
...@@ -974,58 +977,30 @@ static int main0(int argc, char **argv) {...@@ -974,58 +977,30 @@ static int main0(int argc, char **argv) {
974 init_all_targets();977 init_all_targets();
975978
976 ZigTarget target;979 ZigTarget target;
977 if (target_string == nullptr) {980 if ((err = target_parse_triple(&target, target_string, mcpu))) {
978 get_native_target(&target);981 fprintf(stderr, "invalid target: %s\n"
982 "See `%s targets` to display valid targets.\n", err_str(err), arg0);
983 return print_error_usage(arg0);
984 }
985 if (target_is_glibc(&target)) {
986 target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>();
987
979 if (target_glibc != nullptr) {988 if (target_glibc != nullptr) {
980 fprintf(stderr, "-target-glibc provided but no -target parameter\n");989 if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) {
981 return print_error_usage(arg0);990 fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err));
982 }
983 if (baseline_cpu) {
984 target.is_native = false;
985 }
986 } else {
987 if ((err = target_parse_triple(&target, target_string))) {
988 if (err == ErrorUnknownArchitecture && target.arch != ZigLLVM_UnknownArch) {
989 fprintf(stderr, "'%s' requires a sub-architecture. Try one of these:\n",
990 target_arch_name(target.arch));
991 SubArchList sub_arch_list = target_subarch_list(target.arch);
992 size_t subarch_count = target_subarch_count(sub_arch_list);
993 for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) {
994 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
995 fprintf(stderr, " %s%s\n", target_arch_name(target.arch), target_subarch_name(sub));
996 }
997 return print_error_usage(arg0);
998 } else {
999 fprintf(stderr, "invalid target: %s\n", err_str(err));
1000 return print_error_usage(arg0);991 return print_error_usage(arg0);
1001 }992 }
993 } else {
994 target_init_default_glibc_version(&target);
1002 }995 }
1003 if (target_is_glibc(&target)) {996 } else if (target_glibc != nullptr) {
1004 target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>();997 fprintf(stderr, "'%s' is not a glibc-compatible target", target_string);
1005998 return print_error_usage(arg0);
1006 if (target_glibc != nullptr) {
1007 if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) {
1008 fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err));
1009 return print_error_usage(arg0);
1010 }
1011 } else {
1012 target_init_default_glibc_version(&target);
1013 }
1014 } else if (target_glibc != nullptr) {
1015 fprintf(stderr, "'%s' is not a glibc-compatible target", target_string);
1016 return print_error_usage(arg0);
1017 }
1018 }999 }
10191000
1020 Buf zig_triple_buf = BUF_INIT;1001 Buf zig_triple_buf = BUF_INIT;
1021 target_triple_zig(&zig_triple_buf, &target);1002 target_triple_zig(&zig_triple_buf, &target);
10221003
1023 const char *stage2_triple_arg = target.is_native ? nullptr : buf_ptr(&zig_triple_buf);
1024 if ((err = stage2_cpu_features_parse(&target.cpu_features, stage2_triple_arg, cpu, features))) {
1025 fprintf(stderr, "unable to initialize CPU features: %s\n", err_str(err));
1026 return main_exit(root_progress_node, EXIT_FAILURE);
1027 }
1028
1029 // If both output_dir and enable_cache are provided, and doing build-lib, we1004 // If both output_dir and enable_cache are provided, and doing build-lib, we
1030 // will just do a file copy at the end. This helps when bootstrapping zig from zig01005 // will just do a file copy at the end. This helps when bootstrapping zig from zig0
1031 // because we want to pass something like this:1006 // because we want to pass something like this:
src/stage2.cpp+59-44
...@@ -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,68 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {}...@@ -90,54 +91,68 @@ 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 if (mcpu == nullptr) {
107 result->builtin_str = "arch.getBaselineCpuFeatures();\n";101 target->llvm_cpu_name = ZigLLVMGetHostCPUName();
108 result->cache_hash = "native\n\n";102 target->llvm_cpu_features = ZigLLVMGetNativeFeatures();
109 *out = result;103 target->builtin_str = "Target.Cpu.baseline(arch);\n";
110 return ErrorNone;104 target->cache_hash = "native\n\n";
111 }105 } else if (strcmp(mcpu, "baseline") == 0) {
112 if (cpu_name == nullptr && cpu_features == nullptr) {106 target->is_native = false;
113 Stage2CpuFeatures *result = heap::c_allocator.create<Stage2CpuFeatures>();107 target->llvm_cpu_name = "";
114 result->builtin_str = "arch.getBaselineCpuFeatures();\n";108 target->llvm_cpu_features = "";
115 result->cache_hash = "\n\n";109 target->builtin_str = "Target.Cpu.baseline(arch);\n";
116 *out = result;110 target->cache_hash = "baseline\n\n";
117 return ErrorNone;111 } else {
112 const char *msg = "stage0 can't handle CPU/features in the target";
113 stage2_panic(msg, strlen(msg));
114 }
115 } else {
116 // first initialize all to zero
117 *target = {};
118
119 SplitIterator it = memSplit(str(zig_triple), str("-"));
120
121 Optional<Slice<uint8_t>> opt_archsub = SplitIterator_next(&it);
122 Optional<Slice<uint8_t>> opt_os = SplitIterator_next(&it);
123 Optional<Slice<uint8_t>> opt_abi = SplitIterator_next(&it);
124
125 if (!opt_archsub.is_some)
126 return ErrorMissingArchitecture;
127
128 if ((err = target_parse_arch(&target->arch, (char*)opt_archsub.value.ptr, opt_archsub.value.len))) {
129 return err;
130 }
131
132 if (!opt_os.is_some)
133 return ErrorMissingOperatingSystem;
134
135 if ((err = target_parse_os(&target->os, (char*)opt_os.value.ptr, opt_os.value.len))) {
136 return err;
137 }
138
139 if (opt_abi.is_some) {
140 if ((err = target_parse_abi(&target->abi, (char*)opt_abi.value.ptr, opt_abi.value.len))) {
141 return err;
142 }
143 } else {
144 target->abi = target_default_abi(target->arch, target->os);
145 }
146
147 if (mcpu != nullptr && strcmp(mcpu, "baseline") != 0) {
148 const char *msg = "stage0 can't handle CPU/features in the target";
149 stage2_panic(msg, strlen(msg));
150 }
151 target->builtin_str = "Target.Cpu.baseline(arch);\n";
152 target->cache_hash = "\n\n";
118 }153 }
119154
120 const char *msg = "stage0 called stage2_cpu_features_parse with non-null cpu name or features";155 return ErrorNone;
121 stage2_panic(msg, strlen(msg));
122}
123
124void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features,
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}156}
142157
143int stage2_cmd_targets(const char *zig_triple) {158int stage2_cmd_targets(const char *zig_triple) {
src/stage2.h+14-26
...@@ -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,32 @@ struct ZigGLibCVersion {...@@ -296,22 +274,32 @@ 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;
303 enum ZigLLVM_VendorType vendor;282 enum ZigLLVM_VendorType vendor;
304 Os os;283
305 enum ZigLLVM_EnvironmentType abi;284 enum ZigLLVM_EnvironmentType abi;
306 struct ZigGLibCVersion *glibc_version; // null means default285 Os os;
307 struct Stage2CpuFeatures *cpu_features;286
308 bool is_native;287 bool is_native;
288
289 struct ZigGLibCVersion *glibc_version; // null means default
290
291 const char *llvm_cpu_name;
292 const char *llvm_cpu_features;
293 const char *builtin_str;
294 const char *cache_hash;
309};295};
310296
311// ABI warning297// ABI warning
312ZIG_EXTERN_C enum Error stage2_detect_dynamic_linker(const struct ZigTarget *target,298ZIG_EXTERN_C enum Error stage2_detect_dynamic_linker(const struct ZigTarget *target,
313 char **out_ptr, size_t *out_len);299 char **out_ptr, size_t *out_len);
314300
301// ABI warning
302ZIG_EXTERN_C enum Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, const char *mcpu);
315303
316304
317// ABI warning305// ABI warning
src/target.cpp+9-308
...@@ -15,60 +15,6 @@...@@ -15,60 +15,6 @@
1515
16#include <stdio.h>16#include <stdio.h>
1717
18static const SubArchList subarch_list_list[] = {
19 SubArchListNone,
20 SubArchListArm32,
21 SubArchListArm64,
22 SubArchListKalimba,
23 SubArchListMips,
24};
25
26static const ZigLLVM_SubArchType subarch_list_arm32[] = {
27 ZigLLVM_ARMSubArch_v8_5a,
28 ZigLLVM_ARMSubArch_v8_4a,
29 ZigLLVM_ARMSubArch_v8_3a,
30 ZigLLVM_ARMSubArch_v8_2a,
31 ZigLLVM_ARMSubArch_v8_1a,
32 ZigLLVM_ARMSubArch_v8,
33 ZigLLVM_ARMSubArch_v8r,
34 ZigLLVM_ARMSubArch_v8m_baseline,
35 ZigLLVM_ARMSubArch_v8m_mainline,
36 ZigLLVM_ARMSubArch_v8_1m_mainline,
37 ZigLLVM_ARMSubArch_v7,
38 ZigLLVM_ARMSubArch_v7em,
39 ZigLLVM_ARMSubArch_v7m,
40 ZigLLVM_ARMSubArch_v7s,
41 ZigLLVM_ARMSubArch_v7k,
42 ZigLLVM_ARMSubArch_v7ve,
43 ZigLLVM_ARMSubArch_v6,
44 ZigLLVM_ARMSubArch_v6m,
45 ZigLLVM_ARMSubArch_v6k,
46 ZigLLVM_ARMSubArch_v6t2,
47 ZigLLVM_ARMSubArch_v5,
48 ZigLLVM_ARMSubArch_v5te,
49 ZigLLVM_ARMSubArch_v4t,
50
51};
52
53static const ZigLLVM_SubArchType subarch_list_arm64[] = {
54 ZigLLVM_ARMSubArch_v8_5a,
55 ZigLLVM_ARMSubArch_v8_4a,
56 ZigLLVM_ARMSubArch_v8_3a,
57 ZigLLVM_ARMSubArch_v8_2a,
58 ZigLLVM_ARMSubArch_v8_1a,
59 ZigLLVM_ARMSubArch_v8,
60};
61
62static const ZigLLVM_SubArchType subarch_list_kalimba[] = {
63 ZigLLVM_KalimbaSubArch_v5,
64 ZigLLVM_KalimbaSubArch_v4,
65 ZigLLVM_KalimbaSubArch_v3,
66};
67
68static const ZigLLVM_SubArchType subarch_list_mips[] = {
69 ZigLLVM_MipsSubArch_r6,
70};
71
72static const ZigLLVM_ArchType arch_list[] = {18static const ZigLLVM_ArchType arch_list[] = {
73 ZigLLVM_arm, // ARM (little endian): arm, armv.*, xscale19 ZigLLVM_arm, // ARM (little endian): arm, armv.*, xscale
74 ZigLLVM_armeb, // ARM (big endian): armeb20 ZigLLVM_armeb, // ARM (big endian): armeb
...@@ -509,7 +455,6 @@ void get_native_target(ZigTarget *target) {...@@ -509,7 +455,6 @@ void get_native_target(ZigTarget *target) {
509 ZigLLVM_ObjectFormatType oformat; // ignored; based on arch/os455 ZigLLVM_ObjectFormatType oformat; // ignored; based on arch/os
510 ZigLLVMGetNativeTarget(456 ZigLLVMGetNativeTarget(
511 &target->arch,457 &target->arch,
512 &target->sub_arch,
513 &target->vendor,458 &target->vendor,
514 &os_type,459 &os_type,
515 &target->abi,460 &target->abi,
...@@ -535,223 +480,18 @@ void target_init_default_glibc_version(ZigTarget *target) {...@@ -535,223 +480,18 @@ void target_init_default_glibc_version(ZigTarget *target) {
535 *target->glibc_version = {2, 17, 0};480 *target->glibc_version = {2, 17, 0};
536}481}
537482
538Error target_parse_archsub(ZigLLVM_ArchType *out_arch, ZigLLVM_SubArchType *out_sub,483Error target_parse_arch(ZigLLVM_ArchType *out_arch, const char *arch_ptr, size_t arch_len) {
539 const char *archsub_ptr, size_t archsub_len)
540{
541 *out_arch = ZigLLVM_UnknownArch;484 *out_arch = ZigLLVM_UnknownArch;
542 *out_sub = ZigLLVM_NoSubArch;
543 for (size_t arch_i = 0; arch_i < array_length(arch_list); arch_i += 1) {485 for (size_t arch_i = 0; arch_i < array_length(arch_list); arch_i += 1) {
544 ZigLLVM_ArchType arch = arch_list[arch_i];486 ZigLLVM_ArchType arch = arch_list[arch_i];
545 SubArchList sub_arch_list = target_subarch_list(arch);487 if (mem_eql_str(arch_ptr, arch_len, target_arch_name(arch))) {
546 size_t subarch_count = target_subarch_count(sub_arch_list);
547 if (mem_eql_str(archsub_ptr, archsub_len, target_arch_name(arch))) {
548 *out_arch = arch;488 *out_arch = arch;
549 if (subarch_count == 0) {489 return ErrorNone;
550 return ErrorNone;
551 }
552 }
553 for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) {
554 ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
555 char arch_name[64];
556 int n = sprintf(arch_name, "%s%s", target_arch_name(arch), target_subarch_name(sub));
557 if (mem_eql_mem(arch_name, n, archsub_ptr, archsub_len)) {
558 *out_arch = arch;
559 *out_sub = sub;
560 return ErrorNone;
561 }
562 }490 }
563 }491 }
564 return ErrorUnknownArchitecture;492 return ErrorUnknownArchitecture;
565}493}
566494
567SubArchList target_subarch_list(ZigLLVM_ArchType arch) {
568 switch (arch) {
569 case ZigLLVM_UnknownArch:
570 zig_unreachable();
571 case ZigLLVM_arm:
572 case ZigLLVM_armeb:
573 case ZigLLVM_thumb:
574 case ZigLLVM_thumbeb:
575 return SubArchListArm32;
576
577 case ZigLLVM_aarch64:
578 case ZigLLVM_aarch64_be:
579 case ZigLLVM_aarch64_32:
580 return SubArchListArm64;
581
582 case ZigLLVM_kalimba:
583 return SubArchListKalimba;
584
585 case ZigLLVM_arc:
586 case ZigLLVM_avr:
587 case ZigLLVM_bpfel:
588 case ZigLLVM_bpfeb:
589 case ZigLLVM_hexagon:
590 case ZigLLVM_mips:
591 case ZigLLVM_mipsel:
592 case ZigLLVM_mips64:
593 case ZigLLVM_mips64el:
594 case ZigLLVM_msp430:
595 case ZigLLVM_ppc:
596 case ZigLLVM_ppc64:
597 case ZigLLVM_ppc64le:
598 case ZigLLVM_r600:
599 case ZigLLVM_amdgcn:
600 case ZigLLVM_riscv32:
601 case ZigLLVM_riscv64:
602 case ZigLLVM_sparc:
603 case ZigLLVM_sparcv9:
604 case ZigLLVM_sparcel:
605 case ZigLLVM_systemz:
606 case ZigLLVM_tce:
607 case ZigLLVM_tcele:
608 case ZigLLVM_x86:
609 case ZigLLVM_x86_64:
610 case ZigLLVM_xcore:
611 case ZigLLVM_nvptx:
612 case ZigLLVM_nvptx64:
613 case ZigLLVM_le32:
614 case ZigLLVM_le64:
615 case ZigLLVM_amdil:
616 case ZigLLVM_amdil64:
617 case ZigLLVM_hsail:
618 case ZigLLVM_hsail64:
619 case ZigLLVM_spir:
620 case ZigLLVM_spir64:
621 case ZigLLVM_shave:
622 case ZigLLVM_lanai:
623 case ZigLLVM_wasm32:
624 case ZigLLVM_wasm64:
625 case ZigLLVM_renderscript32:
626 case ZigLLVM_renderscript64:
627 return SubArchListNone;
628 }
629 zig_unreachable();
630}
631
632size_t target_subarch_count(SubArchList sub_arch_list) {
633 switch (sub_arch_list) {
634 case SubArchListNone:
635 return 0;
636 case SubArchListArm32:
637 return array_length(subarch_list_arm32);
638 case SubArchListArm64:
639 return array_length(subarch_list_arm64);
640 case SubArchListKalimba:
641 return array_length(subarch_list_kalimba);
642 case SubArchListMips:
643 return array_length(subarch_list_mips);
644 }
645 zig_unreachable();
646}
647
648ZigLLVM_SubArchType target_subarch_enum(SubArchList sub_arch_list, size_t i) {
649 switch (sub_arch_list) {
650 case SubArchListNone:
651 zig_unreachable();
652 case SubArchListArm32:
653 assert(i < array_length(subarch_list_arm32));
654 return subarch_list_arm32[i];
655 case SubArchListArm64:
656 assert(i < array_length(subarch_list_arm64));
657 return subarch_list_arm64[i];
658 case SubArchListKalimba:
659 assert(i < array_length(subarch_list_kalimba));
660 return subarch_list_kalimba[i];
661 case SubArchListMips:
662 assert(i < array_length(subarch_list_mips));
663 return subarch_list_mips[i];
664 }
665 zig_unreachable();
666}
667
668const char *target_subarch_name(ZigLLVM_SubArchType subarch) {
669 switch (subarch) {
670 case ZigLLVM_NoSubArch:
671 return "";
672 case ZigLLVM_ARMSubArch_v8_5a:
673 return "v8_5a";
674 case ZigLLVM_ARMSubArch_v8_4a:
675 return "v8_4a";
676 case ZigLLVM_ARMSubArch_v8_3a:
677 return "v8_3a";
678 case ZigLLVM_ARMSubArch_v8_2a:
679 return "v8_2a";
680 case ZigLLVM_ARMSubArch_v8_1a:
681 return "v8_1a";
682 case ZigLLVM_ARMSubArch_v8:
683 return "v8a";
684 case ZigLLVM_ARMSubArch_v8r:
685 return "v8r";
686 case ZigLLVM_ARMSubArch_v8m_baseline:
687 return "v8m_baseline";
688 case ZigLLVM_ARMSubArch_v8m_mainline:
689 return "v8m_mainline";
690 case ZigLLVM_ARMSubArch_v8_1m_mainline:
691 return "v8_1m_mainline";
692 case ZigLLVM_ARMSubArch_v7:
693 return "v7a";
694 case ZigLLVM_ARMSubArch_v7em:
695 return "v7em";
696 case ZigLLVM_ARMSubArch_v7m:
697 return "v7m";
698 case ZigLLVM_ARMSubArch_v7s:
699 return "v7s";
700 case ZigLLVM_ARMSubArch_v7k:
701 return "v7k";
702 case ZigLLVM_ARMSubArch_v7ve:
703 return "v7ve";
704 case ZigLLVM_ARMSubArch_v6:
705 return "v6";
706 case ZigLLVM_ARMSubArch_v6m:
707 return "v6m";
708 case ZigLLVM_ARMSubArch_v6k:
709 return "v6k";
710 case ZigLLVM_ARMSubArch_v6t2:
711 return "v6t2";
712 case ZigLLVM_ARMSubArch_v5:
713 return "v5";
714 case ZigLLVM_ARMSubArch_v5te:
715 return "v5te";
716 case ZigLLVM_ARMSubArch_v4t:
717 return "v4t";
718 case ZigLLVM_KalimbaSubArch_v3:
719 return "v3";
720 case ZigLLVM_KalimbaSubArch_v4:
721 return "v4";
722 case ZigLLVM_KalimbaSubArch_v5:
723 return "v5";
724 case ZigLLVM_MipsSubArch_r6:
725 return "r6";
726 }
727 zig_unreachable();
728}
729
730size_t target_subarch_list_count(void) {
731 return array_length(subarch_list_list);
732}
733
734SubArchList target_subarch_list_enum(size_t index) {
735 assert(index < array_length(subarch_list_list));
736 return subarch_list_list[index];
737}
738
739const char *target_subarch_list_name(SubArchList sub_arch_list) {
740 switch (sub_arch_list) {
741 case SubArchListNone:
742 return "None";
743 case SubArchListArm32:
744 return "Arm32";
745 case SubArchListArm64:
746 return "Arm64";
747 case SubArchListKalimba:
748 return "Kalimba";
749 case SubArchListMips:
750 return "Mips";
751 }
752 zig_unreachable();
753}
754
755Error target_parse_os(Os *out_os, const char *os_ptr, size_t os_len) {495Error target_parse_os(Os *out_os, const char *os_ptr, size_t os_len) {
756 for (size_t i = 0; i < array_length(os_list); i += 1) {496 for (size_t i = 0; i < array_length(os_list); i += 1) {
757 Os os = os_list[i];497 Os os = os_list[i];
...@@ -776,42 +516,8 @@ Error target_parse_abi(ZigLLVM_EnvironmentType *out_abi, const char *abi_ptr, si...@@ -776,42 +516,8 @@ Error target_parse_abi(ZigLLVM_EnvironmentType *out_abi, const char *abi_ptr, si
776 return ErrorUnknownABI;516 return ErrorUnknownABI;
777}517}
778518
779Error target_parse_triple(ZigTarget *target, const char *triple) {519Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu) {
780 Error err;520 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}521}
816522
817const char *target_arch_name(ZigLLVM_ArchType arch) {523const char *target_arch_name(ZigLLVM_ArchType arch) {
...@@ -828,18 +534,16 @@ void init_all_targets(void) {...@@ -828,18 +534,16 @@ void init_all_targets(void) {
828534
829void target_triple_zig(Buf *triple, const ZigTarget *target) {535void target_triple_zig(Buf *triple, const ZigTarget *target) {
830 buf_resize(triple, 0);536 buf_resize(triple, 0);
831 buf_appendf(triple, "%s%s-%s-%s",537 buf_appendf(triple, "%s-%s-%s",
832 target_arch_name(target->arch),538 target_arch_name(target->arch),
833 target_subarch_name(target->sub_arch),
834 target_os_name(target->os),539 target_os_name(target->os),
835 target_abi_name(target->abi));540 target_abi_name(target->abi));
836}541}
837542
838void target_triple_llvm(Buf *triple, const ZigTarget *target) {543void target_triple_llvm(Buf *triple, const ZigTarget *target) {
839 buf_resize(triple, 0);544 buf_resize(triple, 0);
840 buf_appendf(triple, "%s%s-%s-%s-%s",545 buf_appendf(triple, "%s-%s-%s-%s",
841 ZigLLVMGetArchTypeName(target->arch),546 ZigLLVMGetArchTypeName(target->arch),
842 ZigLLVMGetSubArchTypeName(target->sub_arch),
843 ZigLLVMGetVendorTypeName(target->vendor),547 ZigLLVMGetVendorTypeName(target->vendor),
844 ZigLLVMGetOSTypeName(get_llvm_os_type(target->os)),548 ZigLLVMGetOSTypeName(get_llvm_os_type(target->os)),
845 ZigLLVMGetEnvironmentTypeName(target->abi));549 ZigLLVMGetEnvironmentTypeName(target->abi));
...@@ -1216,10 +920,8 @@ bool target_can_exec(const ZigTarget *host_target, const ZigTarget *guest_target...@@ -1216,10 +920,8 @@ bool target_can_exec(const ZigTarget *host_target, const ZigTarget *guest_target
1216 return true;920 return true;
1217 }921 }
1218922
1219 if (guest_target->os == host_target->os && guest_target->arch == host_target->arch &&923 if (guest_target->os == host_target->os && guest_target->arch == host_target->arch) {
1220 guest_target->sub_arch == host_target->sub_arch)924 // OS and arch match
1221 {
1222 // OS, arch, and sub-arch match
1223 return true;925 return true;
1224 }926 }
1225927
...@@ -1641,7 +1343,6 @@ void target_libc_enum(size_t index, ZigTarget *out_target) {...@@ -1641,7 +1343,6 @@ void target_libc_enum(size_t index, ZigTarget *out_target) {
1641 out_target->arch = libcs_available[index].arch;1343 out_target->arch = libcs_available[index].arch;
1642 out_target->os = libcs_available[index].os;1344 out_target->os = libcs_available[index].os;
1643 out_target->abi = libcs_available[index].abi;1345 out_target->abi = libcs_available[index].abi;
1644 out_target->sub_arch = ZigLLVM_NoSubArch;
1645 out_target->vendor = ZigLLVM_UnknownVendor;1346 out_target->vendor = ZigLLVM_UnknownVendor;
1646 out_target->is_native = false;1347 out_target->is_native = false;
1647}1348}
src/target.hpp+2-21
...@@ -12,15 +12,6 @@...@@ -12,15 +12,6 @@
1212
13struct Buf;13struct Buf;
1414
15// Synchronize with target.cpp::subarch_list_list
16enum SubArchList {
17 SubArchListNone,
18 SubArchListArm32,
19 SubArchListArm64,
20 SubArchListKalimba,
21 SubArchListMips,
22};
23
24enum TargetSubsystem {15enum TargetSubsystem {
25 TargetSubsystemConsole,16 TargetSubsystemConsole,
26 TargetSubsystemWindows,17 TargetSubsystemWindows,
...@@ -50,9 +41,8 @@ enum CIntType {...@@ -50,9 +41,8 @@ enum CIntType {
50 CIntTypeCount,41 CIntTypeCount,
51};42};
5243
53Error target_parse_triple(ZigTarget *target, const char *triple);44Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu);
54Error target_parse_archsub(ZigLLVM_ArchType *arch, ZigLLVM_SubArchType *sub,45Error target_parse_arch(ZigLLVM_ArchType *arch, const char *arch_ptr, size_t arch_len);
55 const char *archsub_ptr, size_t archsub_len);
56Error target_parse_os(Os *os, const char *os_ptr, size_t os_len);46Error target_parse_os(Os *os, const char *os_ptr, size_t os_len);
57Error target_parse_abi(ZigLLVM_EnvironmentType *abi, const char *abi_ptr, size_t abi_len);47Error target_parse_abi(ZigLLVM_EnvironmentType *abi, const char *abi_ptr, size_t abi_len);
5848
...@@ -63,15 +53,6 @@ size_t target_arch_count(void);...@@ -63,15 +53,6 @@ size_t target_arch_count(void);
63ZigLLVM_ArchType target_arch_enum(size_t index);53ZigLLVM_ArchType target_arch_enum(size_t index);
64const char *target_arch_name(ZigLLVM_ArchType arch);54const char *target_arch_name(ZigLLVM_ArchType arch);
6555
66SubArchList target_subarch_list(ZigLLVM_ArchType arch);
67size_t target_subarch_count(SubArchList sub_arch_list);
68ZigLLVM_SubArchType target_subarch_enum(SubArchList subarch_list, size_t index);
69const char *target_subarch_name(ZigLLVM_SubArchType subarch);
70
71size_t target_subarch_list_count(void);
72SubArchList target_subarch_list_enum(size_t index);
73const char *target_subarch_list_name(SubArchList sub_arch_list);
74
75const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch);56const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch);
7657
77size_t target_vendor_count(void);58size_t target_vendor_count(void);
src/zig_llvm.cpp+1-93
...@@ -806,7 +806,7 @@ const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType env_type) {...@@ -806,7 +806,7 @@ const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType env_type) {
806 return (const char*)Triple::getEnvironmentTypeName((Triple::EnvironmentType)env_type).bytes_begin();806 return (const char*)Triple::getEnvironmentTypeName((Triple::EnvironmentType)env_type).bytes_begin();
807}807}
808808
809void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *sub_arch_type,809void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type,
810 ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type,810 ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type,
811 ZigLLVM_ObjectFormatType *oformat)811 ZigLLVM_ObjectFormatType *oformat)
812{812{
...@@ -814,7 +814,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su...@@ -814,7 +814,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
814 Triple triple(Triple::normalize(native_triple));814 Triple triple(Triple::normalize(native_triple));
815815
816 *arch_type = (ZigLLVM_ArchType)triple.getArch();816 *arch_type = (ZigLLVM_ArchType)triple.getArch();
817 *sub_arch_type = (ZigLLVM_SubArchType)triple.getSubArch();
818 *vendor_type = (ZigLLVM_VendorType)triple.getVendor();817 *vendor_type = (ZigLLVM_VendorType)triple.getVendor();
819 *os_type = (ZigLLVM_OSType)triple.getOS();818 *os_type = (ZigLLVM_OSType)triple.getOS();
820 *environ_type = (ZigLLVM_EnvironmentType)triple.getEnvironment();819 *environ_type = (ZigLLVM_EnvironmentType)triple.getEnvironment();
...@@ -823,68 +822,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su...@@ -823,68 +822,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
823 free(native_triple);822 free(native_triple);
824}823}
825824
826const char *ZigLLVMGetSubArchTypeName(ZigLLVM_SubArchType sub_arch) {
827 switch (sub_arch) {
828 case ZigLLVM_NoSubArch:
829 return "";
830 case ZigLLVM_ARMSubArch_v8_5a:
831 return "v8.5a";
832 case ZigLLVM_ARMSubArch_v8_4a:
833 return "v8.4a";
834 case ZigLLVM_ARMSubArch_v8_3a:
835 return "v8.3a";
836 case ZigLLVM_ARMSubArch_v8_2a:
837 return "v8.2a";
838 case ZigLLVM_ARMSubArch_v8_1a:
839 return "v8.1a";
840 case ZigLLVM_ARMSubArch_v8:
841 return "v8a";
842 case ZigLLVM_ARMSubArch_v8r:
843 return "v8r";
844 case ZigLLVM_ARMSubArch_v8m_baseline:
845 return "v8m.base";
846 case ZigLLVM_ARMSubArch_v8m_mainline:
847 return "v8m.main";
848 case ZigLLVM_ARMSubArch_v8_1m_mainline:
849 return "v8.1m.main";
850 case ZigLLVM_ARMSubArch_v7:
851 return "v7a";
852 case ZigLLVM_ARMSubArch_v7em:
853 return "v7em";
854 case ZigLLVM_ARMSubArch_v7m:
855 return "v7m";
856 case ZigLLVM_ARMSubArch_v7s:
857 return "v7s";
858 case ZigLLVM_ARMSubArch_v7k:
859 return "v7k";
860 case ZigLLVM_ARMSubArch_v7ve:
861 return "v7ve";
862 case ZigLLVM_ARMSubArch_v6:
863 return "v6";
864 case ZigLLVM_ARMSubArch_v6m:
865 return "v6m";
866 case ZigLLVM_ARMSubArch_v6k:
867 return "v6k";
868 case ZigLLVM_ARMSubArch_v6t2:
869 return "v6t2";
870 case ZigLLVM_ARMSubArch_v5:
871 return "v5";
872 case ZigLLVM_ARMSubArch_v5te:
873 return "v5te";
874 case ZigLLVM_ARMSubArch_v4t:
875 return "v4t";
876 case ZigLLVM_KalimbaSubArch_v3:
877 return "v3";
878 case ZigLLVM_KalimbaSubArch_v4:
879 return "v4";
880 case ZigLLVM_KalimbaSubArch_v5:
881 return "v5";
882 case ZigLLVM_MipsSubArch_r6:
883 return "r6";
884 }
885 abort();
886}
887
888void ZigLLVMAddModuleDebugInfoFlag(LLVMModuleRef module) {825void ZigLLVMAddModuleDebugInfoFlag(LLVMModuleRef module) {
889 unwrap(module)->addModuleFlag(Module::Warning, "Debug Info Version", DEBUG_METADATA_VERSION);826 unwrap(module)->addModuleFlag(Module::Warning, "Debug Info Version", DEBUG_METADATA_VERSION);
890 unwrap(module)->addModuleFlag(Module::Warning, "Dwarf Version", 4);827 unwrap(module)->addModuleFlag(Module::Warning, "Dwarf Version", 4);
...@@ -1218,35 +1155,6 @@ static_assert((Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32...@@ -1218,35 +1155,6 @@ static_assert((Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32
1218static_assert((Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64, "");1155static_assert((Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64, "");
1219static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");1156static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");
12201157
1221static_assert((Triple::SubArchType)ZigLLVM_NoSubArch == Triple::NoSubArch, "");
1222static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_4a == Triple::ARMSubArch_v8_4a, "");
1223static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_3a == Triple::ARMSubArch_v8_3a, "");
1224static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_2a == Triple::ARMSubArch_v8_2a, "");
1225static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_1a == Triple::ARMSubArch_v8_1a, "");
1226static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8 == Triple::ARMSubArch_v8, "");
1227static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8r == Triple::ARMSubArch_v8r, "");
1228static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8m_baseline == Triple::ARMSubArch_v8m_baseline, "");
1229static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8m_mainline == Triple::ARMSubArch_v8m_mainline, "");
1230static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_1m_mainline == Triple::ARMSubArch_v8_1m_mainline, "");
1231static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7 == Triple::ARMSubArch_v7, "");
1232static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7em == Triple::ARMSubArch_v7em, "");
1233static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7m == Triple::ARMSubArch_v7m, "");
1234static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7s == Triple::ARMSubArch_v7s, "");
1235static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7k == Triple::ARMSubArch_v7k, "");
1236static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7ve == Triple::ARMSubArch_v7ve, "");
1237static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6 == Triple::ARMSubArch_v6, "");
1238static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6m == Triple::ARMSubArch_v6m, "");
1239static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6k == Triple::ARMSubArch_v6k, "");
1240static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6t2 == Triple::ARMSubArch_v6t2, "");
1241static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v5 == Triple::ARMSubArch_v5, "");
1242static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v5te == Triple::ARMSubArch_v5te, "");
1243static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v4t == Triple::ARMSubArch_v4t, "");
1244static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v3 == Triple::KalimbaSubArch_v3, "");
1245static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v4 == Triple::KalimbaSubArch_v4, "");
1246static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v5 == Triple::KalimbaSubArch_v5, "");
1247static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v5 == Triple::KalimbaSubArch_v5, "");
1248static_assert((Triple::SubArchType)ZigLLVM_MipsSubArch_r6 == Triple::MipsSubArch_r6, "");
1249
1250static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor, "");1158static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor, "");
1251static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");1159static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");
1252static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");1160static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");
src/zig_llvm.h+1-37
...@@ -324,41 +324,6 @@ enum ZigLLVM_ArchType {...@@ -324,41 +324,6 @@ enum ZigLLVM_ArchType {
324 ZigLLVM_LastArchType = ZigLLVM_renderscript64324 ZigLLVM_LastArchType = ZigLLVM_renderscript64
325};325};
326326
327// synchronize with lists in target.cpp
328enum ZigLLVM_SubArchType {
329 ZigLLVM_NoSubArch,
330
331 ZigLLVM_ARMSubArch_v8_5a,
332 ZigLLVM_ARMSubArch_v8_4a,
333 ZigLLVM_ARMSubArch_v8_3a,
334 ZigLLVM_ARMSubArch_v8_2a,
335 ZigLLVM_ARMSubArch_v8_1a,
336 ZigLLVM_ARMSubArch_v8,
337 ZigLLVM_ARMSubArch_v8r,
338 ZigLLVM_ARMSubArch_v8m_baseline,
339 ZigLLVM_ARMSubArch_v8m_mainline,
340 ZigLLVM_ARMSubArch_v8_1m_mainline,
341 ZigLLVM_ARMSubArch_v7,
342 ZigLLVM_ARMSubArch_v7em,
343 ZigLLVM_ARMSubArch_v7m,
344 ZigLLVM_ARMSubArch_v7s,
345 ZigLLVM_ARMSubArch_v7k,
346 ZigLLVM_ARMSubArch_v7ve,
347 ZigLLVM_ARMSubArch_v6,
348 ZigLLVM_ARMSubArch_v6m,
349 ZigLLVM_ARMSubArch_v6k,
350 ZigLLVM_ARMSubArch_v6t2,
351 ZigLLVM_ARMSubArch_v5,
352 ZigLLVM_ARMSubArch_v5te,
353 ZigLLVM_ARMSubArch_v4t,
354
355 ZigLLVM_KalimbaSubArch_v3,
356 ZigLLVM_KalimbaSubArch_v4,
357 ZigLLVM_KalimbaSubArch_v5,
358
359 ZigLLVM_MipsSubArch_r6,
360};
361
362enum ZigLLVM_VendorType {327enum ZigLLVM_VendorType {
363 ZigLLVM_UnknownVendor,328 ZigLLVM_UnknownVendor,
364329
...@@ -518,7 +483,6 @@ LLVMValueRef ZigLLVMBuildAtomicRMW(LLVMBuilderRef B, enum ZigLLVM_AtomicRMWBinOp...@@ -518,7 +483,6 @@ LLVMValueRef ZigLLVMBuildAtomicRMW(LLVMBuilderRef B, enum ZigLLVM_AtomicRMWBinOp
518#define ZigLLVM_DIFlags_AllCallsDescribed (1U << 29)483#define ZigLLVM_DIFlags_AllCallsDescribed (1U << 29)
519484
520ZIG_EXTERN_C const char *ZigLLVMGetArchTypeName(enum ZigLLVM_ArchType arch);485ZIG_EXTERN_C const char *ZigLLVMGetArchTypeName(enum ZigLLVM_ArchType arch);
521ZIG_EXTERN_C const char *ZigLLVMGetSubArchTypeName(enum ZigLLVM_SubArchType sub_arch);
522ZIG_EXTERN_C const char *ZigLLVMGetVendorTypeName(enum ZigLLVM_VendorType vendor);486ZIG_EXTERN_C const char *ZigLLVMGetVendorTypeName(enum ZigLLVM_VendorType vendor);
523ZIG_EXTERN_C const char *ZigLLVMGetOSTypeName(enum ZigLLVM_OSType os);487ZIG_EXTERN_C const char *ZigLLVMGetOSTypeName(enum ZigLLVM_OSType os);
524ZIG_EXTERN_C const char *ZigLLVMGetEnvironmentTypeName(enum ZigLLVM_EnvironmentType abi);488ZIG_EXTERN_C const char *ZigLLVMGetEnvironmentTypeName(enum ZigLLVM_EnvironmentType abi);
...@@ -532,7 +496,7 @@ ZIG_EXTERN_C bool ZigLLVMWriteArchive(const char *archive_name, const char **fil...@@ -532,7 +496,7 @@ ZIG_EXTERN_C bool ZigLLVMWriteArchive(const char *archive_name, const char **fil
532bool ZigLLVMWriteImportLibrary(const char *def_path, const enum ZigLLVM_ArchType arch,496bool ZigLLVMWriteImportLibrary(const char *def_path, const enum ZigLLVM_ArchType arch,
533 const char *output_lib_path, const bool kill_at);497 const char *output_lib_path, const bool kill_at);
534498
535ZIG_EXTERN_C void ZigLLVMGetNativeTarget(enum ZigLLVM_ArchType *arch_type, enum ZigLLVM_SubArchType *sub_arch_type,499ZIG_EXTERN_C void ZigLLVMGetNativeTarget(enum ZigLLVM_ArchType *arch_type,
536 enum ZigLLVM_VendorType *vendor_type, enum ZigLLVM_OSType *os_type, enum ZigLLVM_EnvironmentType *environ_type,500 enum ZigLLVM_VendorType *vendor_type, enum ZigLLVM_OSType *os_type, enum ZigLLVM_EnvironmentType *environ_type,
537 enum ZigLLVM_ObjectFormatType *oformat);501 enum ZigLLVM_ObjectFormatType *oformat);
538502
test/compile_errors.zig+2-4
...@@ -362,8 +362,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -362,8 +362,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
362 });362 });
363 tc.target = Target{363 tc.target = Target{
364 .Cross = .{364 .Cross = .{
365 .arch = .wasm32,365 .cpu = Target.Cpu.baseline(.wasm32),
366 .cpu_features = Target.Arch.wasm32.getBaselineCpuFeatures(),
367 .os = .wasi,366 .os = .wasi,
368 .abi = .none,367 .abi = .none,
369 },368 },
...@@ -764,8 +763,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -764,8 +763,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
764 });763 });
765 tc.target = Target{764 tc.target = Target{
766 .Cross = .{765 .Cross = .{
767 .arch = .x86_64,766 .cpu = Target.Cpu.baseline(.x86_64),
768 .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(),
769 .os = .linux,767 .os = .linux,
770 .abi = .gnu,768 .abi = .gnu,
771 },769 },
test/tests.zig+28-55
...@@ -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_features = "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_features = "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_features = "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 },
...@@ -476,7 +449,7 @@ pub fn addPkgTests(...@@ -476,7 +449,7 @@ pub fn addPkgTests(
476 const ArchTag = @TagType(builtin.Arch);449 const ArchTag = @TagType(builtin.Arch);
477 if (test_target.disable_native and450 if (test_target.disable_native and
478 test_target.target.getOs() == builtin.os and451 test_target.target.getOs() == builtin.os and
479 @as(ArchTag, test_target.target.getArch()) == @as(ArchTag, builtin.arch))452 test_target.target.getArch() == builtin.arch)
480 {453 {
481 continue;454 continue;
482 }455 }
test/translate_c.zig+9-18
...@@ -1095,10 +1095,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -1095,10 +1095,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
10951095
1096 cases.addWithTarget("Calling convention", tests.Target{1096 cases.addWithTarget("Calling convention", tests.Target{
1097 .Cross = .{1097 .Cross = .{
1098 .cpu = Target.Cpu.baseline(.i386),
1098 .os = .linux,1099 .os = .linux,
1099 .arch = .i386,
1100 .abi = .none,1100 .abi = .none,
1101 .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(),
1102 },1101 },
1103 },1102 },
1104 \\void __attribute__((fastcall)) foo1(float *a);1103 \\void __attribute__((fastcall)) foo1(float *a);
...@@ -1114,14 +1113,10 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -1114,14 +1113,10 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
1114 \\pub fn foo5(a: [*c]f32) callconv(.Thiscall) void;1113 \\pub fn foo5(a: [*c]f32) callconv(.Thiscall) void;
1115 });1114 });
11161115
1117 cases.addWithTarget("Calling convention", tests.Target{1116 cases.addWithTarget("Calling convention", Target.parse(.{
1118 .Cross = .{1117 .arch_os_abi = "arm-linux-none",
1119 .os = .linux,1118 .cpu_features = "generic+v8_5a",
1120 .arch = .{ .arm = .v8_5a },1119 }) catch unreachable,
1121 .abi = .none,
1122 .cpu_features = (Target.Arch{ .arm = .v8_5a }).getBaselineCpuFeatures(),
1123 },
1124 },
1125 \\void __attribute__((pcs("aapcs"))) foo1(float *a);1120 \\void __attribute__((pcs("aapcs"))) foo1(float *a);
1126 \\void __attribute__((pcs("aapcs-vfp"))) foo2(float *a);1121 \\void __attribute__((pcs("aapcs-vfp"))) foo2(float *a);
1127 , &[_][]const u8{1122 , &[_][]const u8{
...@@ -1129,14 +1124,10 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -1129,14 +1124,10 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
1129 \\pub fn foo2(a: [*c]f32) callconv(.AAPCSVFP) void;1124 \\pub fn foo2(a: [*c]f32) callconv(.AAPCSVFP) void;
1130 });1125 });
11311126
1132 cases.addWithTarget("Calling convention", tests.Target{1127 cases.addWithTarget("Calling convention", Target.parse(.{
1133 .Cross = .{1128 .arch_os_abi = "aarch64-linux-none",
1134 .os = .linux,1129 .cpu_features = "generic+v8_5a",
1135 .arch = .{ .aarch64 = .v8_5a },1130 }) catch unreachable,
1136 .abi = .none,
1137 .cpu_features = (Target.Arch{ .aarch64 = .v8_5a }).getBaselineCpuFeatures(),
1138 },
1139 },
1140 \\void __attribute__((aarch64_vector_pcs)) foo1(float *a);1131 \\void __attribute__((aarch64_vector_pcs)) foo1(float *a);
1141 , &[_][]const u8{1132 , &[_][]const u8{
1142 \\pub fn foo1(a: [*c]f32) callconv(.Vectorcall) void;1133 \\pub fn foo1(a: [*c]f32) callconv(.Vectorcall) void;