aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-21 14:19:20 -0500
committerGitHub <noreply@github.com>2020-02-21 14:19:20 -0500
commit10e0b071354d8a1b4ab70041dfdd06a008bd6d3d (patch)
treea705cb0f0e25fceb5263e10fc027011e0ee26f76 /lib/std
parente381a42de9c0f0c5439a926b0ac99026a0373f49 (diff)
parent71573584cdfb1ddb176681fcb7d1544cac7a72ca (diff)
downloadzig-10e0b071354d8a1b4ab70041dfdd06a008bd6d3d.tar.gz
zig-10e0b071354d8a1b4ab70041dfdd06a008bd6d3d.zip
Merge pull request #4509 from ziglang/sub-architecture-annihilation
sub-architecture annihilation
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/build.zig36
-rw-r--r--lib/std/builtin.zig7
-rw-r--r--lib/std/os/linux/tls.zig2
-rw-r--r--lib/std/target.zig1222
-rw-r--r--lib/std/target/aarch64.zig551
-rw-r--r--lib/std/target/amdgpu.zig89
-rw-r--r--lib/std/target/arm.zig1487
-rw-r--r--lib/std/target/avr.zig525
-rw-r--r--lib/std/target/bpf.zig21
-rw-r--r--lib/std/target/hexagon.zig25
-rw-r--r--lib/std/target/mips.zig45
-rw-r--r--lib/std/target/msp430.zig17
-rw-r--r--lib/std/target/nvptx.zig41
-rw-r--r--lib/std/target/powerpc.zig85
-rw-r--r--lib/std/target/riscv.zig19
-rw-r--r--lib/std/target/sparc.zig91
-rw-r--r--lib/std/target/systemz.zig35
-rw-r--r--lib/std/target/wasm.zig17
-rw-r--r--lib/std/target/x86.zig167
19 files changed, 2057 insertions, 2425 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index f6e8474701..43cc4a2150 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1909,43 +1909,33 @@ pub const LibExeObjStep = struct {
try zig_args.append(self.target.zigTriple(builder.allocator) catch unreachable);
const all_features = self.target.getArch().allFeaturesList();
- var populated_cpu_features = cross.cpu_features.cpu.features;
- if (self.target.getArch().subArchFeature()) |sub_arch_index| {
- populated_cpu_features.addFeature(sub_arch_index);
- }
+ var populated_cpu_features = cross.cpu.model.features;
populated_cpu_features.populateDependencies(all_features);
- if (populated_cpu_features.eql(cross.cpu_features.features)) {
+ if (populated_cpu_features.eql(cross.cpu.features)) {
// The CPU name alone is sufficient.
// If it is the baseline CPU, no command line args are required.
- if (cross.cpu_features.cpu != self.target.getArch().getBaselineCpuFeatures().cpu) {
- try zig_args.append("-target-cpu");
- try zig_args.append(cross.cpu_features.cpu.name);
+ if (cross.cpu.model != Target.Cpu.baseline(self.target.getArch()).model) {
+ try zig_args.append("-mcpu");
+ try zig_args.append(cross.cpu.model.name);
}
} else {
- try zig_args.append("-target-cpu");
- try zig_args.append(cross.cpu_features.cpu.name);
+ var mcpu_buffer = try std.Buffer.init(builder.allocator, "-mcpu=");
+ try mcpu_buffer.append(cross.cpu.model.name);
- try zig_args.append("-target-feature");
- var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0);
for (all_features) |feature, i_usize| {
const i = @intCast(Target.Cpu.Feature.Set.Index, i_usize);
const in_cpu_set = populated_cpu_features.isEnabled(i);
- const in_actual_set = cross.cpu_features.features.isEnabled(i);
+ const in_actual_set = cross.cpu.features.isEnabled(i);
if (in_cpu_set and !in_actual_set) {
- try feature_str_buffer.appendByte('-');
- try feature_str_buffer.append(feature.name);
- try feature_str_buffer.appendByte(',');
+ try mcpu_buffer.appendByte('-');
+ try mcpu_buffer.append(feature.name);
} else if (!in_cpu_set and in_actual_set) {
- try feature_str_buffer.appendByte('+');
- try feature_str_buffer.append(feature.name);
- try feature_str_buffer.appendByte(',');
+ try mcpu_buffer.appendByte('+');
+ try mcpu_buffer.append(feature.name);
}
}
- if (mem.endsWith(u8, feature_str_buffer.toSliceConst(), ",")) {
- feature_str_buffer.shrink(feature_str_buffer.len() - 1);
- }
- try zig_args.append(feature_str_buffer.toSliceConst());
+ try zig_args.append(mcpu_buffer.toSliceConst());
}
},
}
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 58a3f1a5bf..5440de4d3b 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -6,8 +6,8 @@ pub const Target = std.Target;
/// Deprecated: use `std.Target.Os`.
pub const Os = std.Target.Os;
-/// Deprecated: use `std.Target.Arch`.
-pub const Arch = std.Target.Arch;
+/// Deprecated: use `std.Target.Cpu.Arch`.
+pub const Arch = std.Target.Cpu.Arch;
/// Deprecated: use `std.Target.Abi`.
pub const Abi = std.Target.Abi;
@@ -18,9 +18,6 @@ pub const ObjectFormat = std.Target.ObjectFormat;
/// Deprecated: use `std.Target.SubSystem`.
pub const SubSystem = std.Target.SubSystem;
-/// Deprecated: use `std.Target.CpuFeatures`.
-pub const CpuFeatures = std.Target.CpuFeatures;
-
/// Deprecated: use `std.Target.Cpu`.
pub const Cpu = std.Target.Cpu;
diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig
index 5dbdafb60a..20c51abdfa 100644
--- a/lib/std/os/linux/tls.zig
+++ b/lib/std/os/linux/tls.zig
@@ -152,7 +152,7 @@ pub fn setThreadPointer(addr: usize) void {
: [addr] "r" (addr)
);
},
- .arm => |arm| {
+ .arm => {
const rc = std.os.linux.syscall1(std.os.linux.SYS_set_tls, addr);
assert(rc == 0);
},
diff --git a/lib/std/target.zig b/lib/std/target.zig
index bc78b2dce5..83d3dafbc2 100644
--- a/lib/std/target.zig
+++ b/lib/std/target.zig
@@ -47,6 +47,16 @@ pub const Target = union(enum) {
emscripten,
uefi,
other,
+
+ pub fn parse(text: []const u8) !Os {
+ const info = @typeInfo(Os);
+ inline for (info.Enum.fields) |field| {
+ if (mem.eql(u8, text, field.name)) {
+ return @field(Os, field.name);
+ }
+ }
+ return error.UnknownOperatingSystem;
+ }
};
pub const aarch64 = @import("target/aarch64.zig");
@@ -65,457 +75,6 @@ pub const Target = union(enum) {
pub const wasm = @import("target/wasm.zig");
pub const x86 = @import("target/x86.zig");
- pub const Arch = union(enum) {
- arm: Arm32,
- armeb: Arm32,
- aarch64: Arm64,
- aarch64_be: Arm64,
- aarch64_32: Arm64,
- arc,
- avr,
- bpfel,
- bpfeb,
- hexagon,
- mips,
- mipsel,
- mips64,
- mips64el,
- msp430,
- powerpc,
- powerpc64,
- powerpc64le,
- r600,
- amdgcn,
- riscv32,
- riscv64,
- sparc,
- sparcv9,
- sparcel,
- s390x,
- tce,
- tcele,
- thumb: Arm32,
- thumbeb: Arm32,
- i386,
- x86_64,
- xcore,
- nvptx,
- nvptx64,
- le32,
- le64,
- amdil,
- amdil64,
- hsail,
- hsail64,
- spir,
- spir64,
- kalimba: Kalimba,
- shave,
- lanai,
- wasm32,
- wasm64,
- renderscript32,
- renderscript64,
-
- pub const Arm32 = enum {
- v8_5a,
- v8_4a,
- v8_3a,
- v8_2a,
- v8_1a,
- v8a,
- v8r,
- v8m_baseline,
- v8m_mainline,
- v8_1m_mainline,
- v7a,
- v7em,
- v7m,
- v7s,
- v7k,
- v7ve,
- v6,
- v6m,
- v6k,
- v6t2,
- v5,
- v5te,
- v4t,
-
- pub fn version(version: Arm32) comptime_int {
- return switch (version) {
- .v8_5a, .v8_4a, .v8_3a, .v8_2a, .v8_1a, .v8a, .v8r, .v8m_baseline, .v8m_mainline, .v8_1m_mainline => 8,
- .v7a, .v7em, .v7m, .v7s, .v7k, .v7ve => 7,
- .v6, .v6m, .v6k, .v6t2 => 6,
- .v5, .v5te => 5,
- .v4t => 4,
- };
- }
- };
- pub const Arm64 = enum {
- v8_5a,
- v8_4a,
- v8_3a,
- v8_2a,
- v8_1a,
- v8a,
- };
- pub const Kalimba = enum {
- v5,
- v4,
- v3,
- };
- pub const Mips = enum {
- r6,
- };
-
- pub fn subArchName(arch: Arch) ?[]const u8 {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => |arm32| @tagName(arm32),
- .aarch64, .aarch64_be, .aarch64_32 => |arm64| @tagName(arm64),
- .kalimba => |kalimba| @tagName(kalimba),
- else => return null,
- };
- }
-
- pub fn subArchFeature(arch: Arch) ?Cpu.Feature.Set.Index {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => |arm32| switch (arm32) {
- .v8_5a => @enumToInt(arm.Feature.armv8_5_a),
- .v8_4a => @enumToInt(arm.Feature.armv8_4_a),
- .v8_3a => @enumToInt(arm.Feature.armv8_3_a),
- .v8_2a => @enumToInt(arm.Feature.armv8_2_a),
- .v8_1a => @enumToInt(arm.Feature.armv8_1_a),
- .v8a => @enumToInt(arm.Feature.armv8_a),
- .v8r => @enumToInt(arm.Feature.armv8_r),
- .v8m_baseline => @enumToInt(arm.Feature.armv8_m_base),
- .v8m_mainline => @enumToInt(arm.Feature.armv8_m_main),
- .v8_1m_mainline => @enumToInt(arm.Feature.armv8_1_m_main),
- .v7a => @enumToInt(arm.Feature.armv7_a),
- .v7em => @enumToInt(arm.Feature.armv7e_m),
- .v7m => @enumToInt(arm.Feature.armv7_m),
- .v7s => @enumToInt(arm.Feature.armv7s),
- .v7k => @enumToInt(arm.Feature.armv7k),
- .v7ve => @enumToInt(arm.Feature.armv7ve),
- .v6 => @enumToInt(arm.Feature.armv6),
- .v6m => @enumToInt(arm.Feature.armv6_m),
- .v6k => @enumToInt(arm.Feature.armv6k),
- .v6t2 => @enumToInt(arm.Feature.armv6t2),
- .v5 => @enumToInt(arm.Feature.armv5t),
- .v5te => @enumToInt(arm.Feature.armv5te),
- .v4t => @enumToInt(arm.Feature.armv4t),
- },
- .aarch64, .aarch64_be, .aarch64_32 => |arm64| switch (arm64) {
- .v8_5a => @enumToInt(aarch64.Feature.v8_5a),
- .v8_4a => @enumToInt(aarch64.Feature.v8_4a),
- .v8_3a => @enumToInt(aarch64.Feature.v8_3a),
- .v8_2a => @enumToInt(aarch64.Feature.v8_2a),
- .v8_1a => @enumToInt(aarch64.Feature.v8_1a),
- .v8a => @enumToInt(aarch64.Feature.v8a),
- },
- else => return null,
- };
- }
-
- pub fn isARM(arch: Arch) bool {
- return switch (arch) {
- .arm, .armeb => true,
- else => false,
- };
- }
-
- pub fn isThumb(arch: Arch) bool {
- return switch (arch) {
- .thumb, .thumbeb => true,
- else => false,
- };
- }
-
- pub fn isWasm(arch: Arch) bool {
- return switch (arch) {
- .wasm32, .wasm64 => true,
- else => false,
- };
- }
-
- pub fn isRISCV(arch: Arch) bool {
- return switch (arch) {
- .riscv32, .riscv64 => true,
- else => false,
- };
- }
-
- pub fn isMIPS(arch: Arch) bool {
- return switch (arch) {
- .mips, .mipsel, .mips64, .mips64el => true,
- else => false,
- };
- }
-
- pub fn parseCpu(arch: Arch, cpu_name: []const u8) !*const Cpu {
- for (arch.allCpus()) |cpu| {
- if (mem.eql(u8, cpu_name, cpu.name)) {
- return cpu;
- }
- }
- return error.UnknownCpu;
- }
-
- /// Comma-separated list of features, with + or - in front of each feature. This
- /// form represents a deviation from baseline CPU, which is provided as a parameter.
- /// Extra commas are ignored.
- pub fn parseCpuFeatureSet(arch: Arch, cpu: *const Cpu, features_text: []const u8) !Cpu.Feature.Set {
- const all_features = arch.allFeaturesList();
- var set = cpu.features;
- var it = mem.tokenize(features_text, ",");
- while (it.next()) |item_text| {
- var feature_name: []const u8 = undefined;
- var op: enum {
- add,
- sub,
- } = undefined;
- if (mem.startsWith(u8, item_text, "+")) {
- op = .add;
- feature_name = item_text[1..];
- } else if (mem.startsWith(u8, item_text, "-")) {
- op = .sub;
- feature_name = item_text[1..];
- } else {
- return error.InvalidCpuFeatures;
- }
- for (all_features) |feature, index_usize| {
- const index = @intCast(Cpu.Feature.Set.Index, index_usize);
- if (mem.eql(u8, feature_name, feature.name)) {
- switch (op) {
- .add => set.addFeature(index),
- .sub => set.removeFeature(index),
- }
- break;
- }
- } else {
- return error.UnknownCpuFeature;
- }
- }
- return set;
- }
-
- pub fn toElfMachine(arch: Arch) std.elf.EM {
- return switch (arch) {
- .avr => ._AVR,
- .msp430 => ._MSP430,
- .arc => ._ARC,
- .arm => ._ARM,
- .armeb => ._ARM,
- .hexagon => ._HEXAGON,
- .le32 => ._NONE,
- .mips => ._MIPS,
- .mipsel => ._MIPS_RS3_LE,
- .powerpc => ._PPC,
- .r600 => ._NONE,
- .riscv32 => ._RISCV,
- .sparc => ._SPARC,
- .sparcel => ._SPARC,
- .tce => ._NONE,
- .tcele => ._NONE,
- .thumb => ._ARM,
- .thumbeb => ._ARM,
- .i386 => ._386,
- .xcore => ._XCORE,
- .nvptx => ._NONE,
- .amdil => ._NONE,
- .hsail => ._NONE,
- .spir => ._NONE,
- .kalimba => ._CSR_KALIMBA,
- .shave => ._NONE,
- .lanai => ._LANAI,
- .wasm32 => ._NONE,
- .renderscript32 => ._NONE,
- .aarch64_32 => ._AARCH64,
- .aarch64 => ._AARCH64,
- .aarch64_be => ._AARCH64,
- .mips64 => ._MIPS,
- .mips64el => ._MIPS_RS3_LE,
- .powerpc64 => ._PPC64,
- .powerpc64le => ._PPC64,
- .riscv64 => ._RISCV,
- .x86_64 => ._X86_64,
- .nvptx64 => ._NONE,
- .le64 => ._NONE,
- .amdil64 => ._NONE,
- .hsail64 => ._NONE,
- .spir64 => ._NONE,
- .wasm64 => ._NONE,
- .renderscript64 => ._NONE,
- .amdgcn => ._NONE,
- .bpfel => ._BPF,
- .bpfeb => ._BPF,
- .sparcv9 => ._SPARCV9,
- .s390x => ._S390,
- };
- }
-
- pub fn endian(arch: Arch) builtin.Endian {
- return switch (arch) {
- .avr,
- .arm,
- .aarch64_32,
- .aarch64,
- .amdgcn,
- .amdil,
- .amdil64,
- .bpfel,
- .hexagon,
- .hsail,
- .hsail64,
- .kalimba,
- .le32,
- .le64,
- .mipsel,
- .mips64el,
- .msp430,
- .nvptx,
- .nvptx64,
- .sparcel,
- .tcele,
- .powerpc64le,
- .r600,
- .riscv32,
- .riscv64,
- .i386,
- .x86_64,
- .wasm32,
- .wasm64,
- .xcore,
- .thumb,
- .spir,
- .spir64,
- .renderscript32,
- .renderscript64,
- .shave,
- => .Little,
-
- .arc,
- .armeb,
- .aarch64_be,
- .bpfeb,
- .mips,
- .mips64,
- .powerpc,
- .powerpc64,
- .thumbeb,
- .sparc,
- .sparcv9,
- .tce,
- .lanai,
- .s390x,
- => .Big,
- };
- }
-
- /// Returns a name that matches the lib/std/target/* directory name.
- pub fn genericName(arch: Arch) []const u8 {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => "arm",
- .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
- .avr => "avr",
- .bpfel, .bpfeb => "bpf",
- .hexagon => "hexagon",
- .mips, .mipsel, .mips64, .mips64el => "mips",
- .msp430 => "msp430",
- .powerpc, .powerpc64, .powerpc64le => "powerpc",
- .amdgcn => "amdgpu",
- .riscv32, .riscv64 => "riscv",
- .sparc, .sparcv9, .sparcel => "sparc",
- .s390x => "systemz",
- .i386, .x86_64 => "x86",
- .nvptx, .nvptx64 => "nvptx",
- .wasm32, .wasm64 => "wasm",
- else => @tagName(arch),
- };
- }
-
- /// All CPU features Zig is aware of, sorted lexicographically by name.
- pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
- .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
- .avr => &avr.all_features,
- .bpfel, .bpfeb => &bpf.all_features,
- .hexagon => &hexagon.all_features,
- .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
- .msp430 => &msp430.all_features,
- .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
- .amdgcn => &amdgpu.all_features,
- .riscv32, .riscv64 => &riscv.all_features,
- .sparc, .sparcv9, .sparcel => &sparc.all_features,
- .s390x => &systemz.all_features,
- .i386, .x86_64 => &x86.all_features,
- .nvptx, .nvptx64 => &nvptx.all_features,
- .wasm32, .wasm64 => &wasm.all_features,
-
- else => &[0]Cpu.Feature{},
- };
- }
-
- /// The "default" set of CPU features for cross-compiling. A conservative set
- /// of features that is expected to be supported on most available hardware.
- pub fn getBaselineCpuFeatures(arch: Arch) CpuFeatures {
- const S = struct {
- const generic_cpu = Cpu{
- .name = "generic",
- .llvm_name = null,
- .features = Cpu.Feature.Set.empty,
- };
- };
- const cpu = switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => &arm.cpu.generic,
- .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic,
- .avr => &avr.cpu.avr1,
- .bpfel, .bpfeb => &bpf.cpu.generic,
- .hexagon => &hexagon.cpu.generic,
- .mips, .mipsel => &mips.cpu.mips32,
- .mips64, .mips64el => &mips.cpu.mips64,
- .msp430 => &msp430.cpu.generic,
- .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic,
- .amdgcn => &amdgpu.cpu.generic,
- .riscv32 => &riscv.cpu.baseline_rv32,
- .riscv64 => &riscv.cpu.baseline_rv64,
- .sparc, .sparcv9, .sparcel => &sparc.cpu.generic,
- .s390x => &systemz.cpu.generic,
- .i386 => &x86.cpu.pentium4,
- .x86_64 => &x86.cpu.x86_64,
- .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
- .wasm32, .wasm64 => &wasm.cpu.generic,
-
- else => &S.generic_cpu,
- };
- return CpuFeatures.initFromCpu(arch, cpu);
- }
-
- /// All CPUs Zig is aware of, sorted lexicographically by name.
- pub fn allCpus(arch: Arch) []const *const Cpu {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
- .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
- .avr => avr.all_cpus,
- .bpfel, .bpfeb => bpf.all_cpus,
- .hexagon => hexagon.all_cpus,
- .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
- .msp430 => msp430.all_cpus,
- .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
- .amdgcn => amdgpu.all_cpus,
- .riscv32, .riscv64 => riscv.all_cpus,
- .sparc, .sparcv9, .sparcel => sparc.all_cpus,
- .s390x => systemz.all_cpus,
- .i386, .x86_64 => x86.all_cpus,
- .nvptx, .nvptx64 => nvptx.all_cpus,
- .wasm32, .wasm64 => wasm.all_cpus,
-
- else => &[0]*const Cpu{},
- };
- }
- };
-
pub const Abi = enum {
none,
gnu,
@@ -539,11 +98,102 @@ pub const Target = union(enum) {
coreclr,
simulator,
macabi,
+
+ pub fn default(arch: Cpu.Arch, target_os: Os) Abi {
+ switch (arch) {
+ .wasm32, .wasm64 => return .musl,
+ else => {},
+ }
+ switch (target_os) {
+ .freestanding,
+ .ananas,
+ .cloudabi,
+ .dragonfly,
+ .lv2,
+ .solaris,
+ .haiku,
+ .minix,
+ .rtems,
+ .nacl,
+ .cnk,
+ .aix,
+ .cuda,
+ .nvcl,
+ .amdhsa,
+ .ps4,
+ .elfiamcu,
+ .mesa3d,
+ .contiki,
+ .amdpal,
+ .hermit,
+ .other,
+ => return .eabi,
+ .openbsd,
+ .macosx,
+ .freebsd,
+ .ios,
+ .tvos,
+ .watchos,
+ .fuchsia,
+ .kfreebsd,
+ .netbsd,
+ .hurd,
+ => return .gnu,
+ .windows,
+ .uefi,
+ => return .msvc,
+ .linux,
+ .wasi,
+ .emscripten,
+ => return .musl,
+ }
+ }
+
+ pub fn parse(text: []const u8) !Abi {
+ const info = @typeInfo(Abi);
+ inline for (info.Enum.fields) |field| {
+ if (mem.eql(u8, text, field.name)) {
+ return @field(Abi, field.name);
+ }
+ }
+ return error.UnknownApplicationBinaryInterface;
+ }
+ };
+
+ pub const ObjectFormat = enum {
+ unknown,
+ coff,
+ elf,
+ macho,
+ wasm,
+ };
+
+ pub const SubSystem = enum {
+ Console,
+ Windows,
+ Posix,
+ Native,
+ EfiApplication,
+ EfiBootServiceDriver,
+ EfiRom,
+ EfiRuntimeDriver,
+ };
+
+ pub const Cross = struct {
+ cpu: Cpu,
+ os: Os,
+ abi: Abi,
};
pub const Cpu = struct {
- name: []const u8,
- llvm_name: ?[:0]const u8,
+ /// Architecture
+ arch: Arch,
+
+ /// The CPU model to target. It has a set of features
+ /// which are overridden with the `features` field.
+ model: *const Model,
+
+ /// An explicit list of the entire CPU feature set. It may differ from the specific CPU model's features.
features: Feature.Set,
pub const Feature = struct {
@@ -569,7 +219,7 @@ pub const Target = union(enum) {
pub const Set = struct {
ints: [usize_count]usize,
- pub const needed_bit_count = 174;
+ pub const needed_bit_count = 154;
pub const byte_count = (needed_bit_count + 7) / 8;
pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize)));
@@ -593,6 +243,12 @@ pub const Target = union(enum) {
set.ints[usize_index] |= @as(usize, 1) << bit_index;
}
+ /// Adds the specified feature set but not its dependencies.
+ pub fn addFeatureSet(set: *Set, other_set: Set) void {
+ set.ints = @as(@Vector(usize_count, usize), set.ints) |
+ @as(@Vector(usize_count, usize), other_set.ints);
+ }
+
/// Removes the specified feature but not its dependents.
pub fn removeFeature(set: *Set, arch_feature_index: Index) void {
const usize_index = arch_feature_index / @bitSizeOf(usize);
@@ -608,8 +264,7 @@ pub const Target = union(enum) {
for (all_features_list) |feature, index_usize| {
const index = @intCast(Index, index_usize);
if (set.isEnabled(index)) {
- set.ints = @as(@Vector(usize_count, usize), set.ints) |
- @as(@Vector(usize_count, usize), feature.dependencies.ints);
+ set.addFeatureSet(feature.dependencies);
}
}
const nothing_changed = mem.eql(usize, &old, &set.ints);
@@ -644,77 +299,360 @@ pub const Target = union(enum) {
};
}
};
- };
- pub const ObjectFormat = enum {
- unknown,
- coff,
- elf,
- macho,
- wasm,
- };
+ pub const Arch = enum {
+ arm,
+ armeb,
+ aarch64,
+ aarch64_be,
+ aarch64_32,
+ arc,
+ avr,
+ bpfel,
+ bpfeb,
+ hexagon,
+ mips,
+ mipsel,
+ mips64,
+ mips64el,
+ msp430,
+ powerpc,
+ powerpc64,
+ powerpc64le,
+ r600,
+ amdgcn,
+ riscv32,
+ riscv64,
+ sparc,
+ sparcv9,
+ sparcel,
+ s390x,
+ tce,
+ tcele,
+ thumb,
+ thumbeb,
+ i386,
+ x86_64,
+ xcore,
+ nvptx,
+ nvptx64,
+ le32,
+ le64,
+ amdil,
+ amdil64,
+ hsail,
+ hsail64,
+ spir,
+ spir64,
+ kalimba,
+ shave,
+ lanai,
+ wasm32,
+ wasm64,
+ renderscript32,
+ renderscript64,
+
+ pub fn isARM(arch: Arch) bool {
+ return switch (arch) {
+ .arm, .armeb => true,
+ else => false,
+ };
+ }
- pub const SubSystem = enum {
- Console,
- Windows,
- Posix,
- Native,
- EfiApplication,
- EfiBootServiceDriver,
- EfiRom,
- EfiRuntimeDriver,
- };
+ pub fn isThumb(arch: Arch) bool {
+ return switch (arch) {
+ .thumb, .thumbeb => true,
+ else => false,
+ };
+ }
- pub const Cross = struct {
- arch: Arch,
- os: Os,
- abi: Abi,
- cpu_features: CpuFeatures,
- };
+ pub fn isWasm(arch: Arch) bool {
+ return switch (arch) {
+ .wasm32, .wasm64 => true,
+ else => false,
+ };
+ }
- pub const CpuFeatures = struct {
- /// The CPU to target. It has a set of features
- /// which are overridden with the `features` field.
- cpu: *const Cpu,
+ pub fn isRISCV(arch: Arch) bool {
+ return switch (arch) {
+ .riscv32, .riscv64 => true,
+ else => false,
+ };
+ }
- /// Explicitly provide the entire CPU feature set.
- features: Cpu.Feature.Set,
+ pub fn isMIPS(arch: Arch) bool {
+ return switch (arch) {
+ .mips, .mipsel, .mips64, .mips64el => true,
+ else => false,
+ };
+ }
- pub fn initFromCpu(arch: Arch, cpu: *const Cpu) CpuFeatures {
- var features = cpu.features;
- if (arch.subArchFeature()) |sub_arch_index| {
- features.addFeature(sub_arch_index);
+ pub fn parseCpuModel(arch: Arch, cpu_name: []const u8) !*const Cpu.Model {
+ for (arch.allCpuModels()) |cpu| {
+ if (mem.eql(u8, cpu_name, cpu.name)) {
+ return cpu;
+ }
+ }
+ return error.UnknownCpu;
+ }
+
+ pub fn toElfMachine(arch: Arch) std.elf.EM {
+ return switch (arch) {
+ .avr => ._AVR,
+ .msp430 => ._MSP430,
+ .arc => ._ARC,
+ .arm => ._ARM,
+ .armeb => ._ARM,
+ .hexagon => ._HEXAGON,
+ .le32 => ._NONE,
+ .mips => ._MIPS,
+ .mipsel => ._MIPS_RS3_LE,
+ .powerpc => ._PPC,
+ .r600 => ._NONE,
+ .riscv32 => ._RISCV,
+ .sparc => ._SPARC,
+ .sparcel => ._SPARC,
+ .tce => ._NONE,
+ .tcele => ._NONE,
+ .thumb => ._ARM,
+ .thumbeb => ._ARM,
+ .i386 => ._386,
+ .xcore => ._XCORE,
+ .nvptx => ._NONE,
+ .amdil => ._NONE,
+ .hsail => ._NONE,
+ .spir => ._NONE,
+ .kalimba => ._CSR_KALIMBA,
+ .shave => ._NONE,
+ .lanai => ._LANAI,
+ .wasm32 => ._NONE,
+ .renderscript32 => ._NONE,
+ .aarch64_32 => ._AARCH64,
+ .aarch64 => ._AARCH64,
+ .aarch64_be => ._AARCH64,
+ .mips64 => ._MIPS,
+ .mips64el => ._MIPS_RS3_LE,
+ .powerpc64 => ._PPC64,
+ .powerpc64le => ._PPC64,
+ .riscv64 => ._RISCV,
+ .x86_64 => ._X86_64,
+ .nvptx64 => ._NONE,
+ .le64 => ._NONE,
+ .amdil64 => ._NONE,
+ .hsail64 => ._NONE,
+ .spir64 => ._NONE,
+ .wasm64 => ._NONE,
+ .renderscript64 => ._NONE,
+ .amdgcn => ._NONE,
+ .bpfel => ._BPF,
+ .bpfeb => ._BPF,
+ .sparcv9 => ._SPARCV9,
+ .s390x => ._S390,
+ };
}
- features.populateDependencies(arch.allFeaturesList());
- return CpuFeatures{
- .cpu = cpu,
- .features = features,
+
+ pub fn endian(arch: Arch) builtin.Endian {
+ return switch (arch) {
+ .avr,
+ .arm,
+ .aarch64_32,
+ .aarch64,
+ .amdgcn,
+ .amdil,
+ .amdil64,
+ .bpfel,
+ .hexagon,
+ .hsail,
+ .hsail64,
+ .kalimba,
+ .le32,
+ .le64,
+ .mipsel,
+ .mips64el,
+ .msp430,
+ .nvptx,
+ .nvptx64,
+ .sparcel,
+ .tcele,
+ .powerpc64le,
+ .r600,
+ .riscv32,
+ .riscv64,
+ .i386,
+ .x86_64,
+ .wasm32,
+ .wasm64,
+ .xcore,
+ .thumb,
+ .spir,
+ .spir64,
+ .renderscript32,
+ .renderscript64,
+ .shave,
+ => .Little,
+
+ .arc,
+ .armeb,
+ .aarch64_be,
+ .bpfeb,
+ .mips,
+ .mips64,
+ .powerpc,
+ .powerpc64,
+ .thumbeb,
+ .sparc,
+ .sparcv9,
+ .tce,
+ .lanai,
+ .s390x,
+ => .Big,
+ };
+ }
+
+ /// Returns a name that matches the lib/std/target/* directory name.
+ pub fn genericName(arch: Arch) []const u8 {
+ return switch (arch) {
+ .arm, .armeb, .thumb, .thumbeb => "arm",
+ .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
+ .avr => "avr",
+ .bpfel, .bpfeb => "bpf",
+ .hexagon => "hexagon",
+ .mips, .mipsel, .mips64, .mips64el => "mips",
+ .msp430 => "msp430",
+ .powerpc, .powerpc64, .powerpc64le => "powerpc",
+ .amdgcn => "amdgpu",
+ .riscv32, .riscv64 => "riscv",
+ .sparc, .sparcv9, .sparcel => "sparc",
+ .s390x => "systemz",
+ .i386, .x86_64 => "x86",
+ .nvptx, .nvptx64 => "nvptx",
+ .wasm32, .wasm64 => "wasm",
+ else => @tagName(arch),
+ };
+ }
+
+ /// All CPU features Zig is aware of, sorted lexicographically by name.
+ pub fn allFeaturesList(arch: Arch) []const Cpu.Feature {
+ return switch (arch) {
+ .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
+ .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
+ .avr => &avr.all_features,
+ .bpfel, .bpfeb => &bpf.all_features,
+ .hexagon => &hexagon.all_features,
+ .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
+ .msp430 => &msp430.all_features,
+ .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
+ .amdgcn => &amdgpu.all_features,
+ .riscv32, .riscv64 => &riscv.all_features,
+ .sparc, .sparcv9, .sparcel => &sparc.all_features,
+ .s390x => &systemz.all_features,
+ .i386, .x86_64 => &x86.all_features,
+ .nvptx, .nvptx64 => &nvptx.all_features,
+ .wasm32, .wasm64 => &wasm.all_features,
+
+ else => &[0]Cpu.Feature{},
+ };
+ }
+
+ /// All processors Zig is aware of, sorted lexicographically by name.
+ pub fn allCpuModels(arch: Arch) []const *const Cpu.Model {
+ return switch (arch) {
+ .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
+ .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
+ .avr => avr.all_cpus,
+ .bpfel, .bpfeb => bpf.all_cpus,
+ .hexagon => hexagon.all_cpus,
+ .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
+ .msp430 => msp430.all_cpus,
+ .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
+ .amdgcn => amdgpu.all_cpus,
+ .riscv32, .riscv64 => riscv.all_cpus,
+ .sparc, .sparcv9, .sparcel => sparc.all_cpus,
+ .s390x => systemz.all_cpus,
+ .i386, .x86_64 => x86.all_cpus,
+ .nvptx, .nvptx64 => nvptx.all_cpus,
+ .wasm32, .wasm64 => wasm.all_cpus,
+
+ else => &[0]*const Model{},
+ };
+ }
+
+ pub fn parse(text: []const u8) !Arch {
+ const info = @typeInfo(Arch);
+ inline for (info.Enum.fields) |field| {
+ if (mem.eql(u8, text, field.name)) {
+ return @as(Arch, @field(Arch, field.name));
+ }
+ }
+ return error.UnknownArchitecture;
+ }
+ };
+
+ pub const Model = struct {
+ name: []const u8,
+ llvm_name: ?[:0]const u8,
+ features: Feature.Set,
+
+ pub fn toCpu(model: *const Model, arch: Arch) Cpu {
+ var features = model.features;
+ features.populateDependencies(arch.allFeaturesList());
+ return .{
+ .arch = arch,
+ .model = model,
+ .features = features,
+ };
+ }
+ };
+
+ /// The "default" set of CPU features for cross-compiling. A conservative set
+ /// of features that is expected to be supported on most available hardware.
+ pub fn baseline(arch: Arch) Cpu {
+ const S = struct {
+ const generic_model = Model{
+ .name = "generic",
+ .llvm_name = null,
+ .features = Cpu.Feature.Set.empty,
+ };
+ };
+ const model = switch (arch) {
+ .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
+ .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic,
+ .avr => &avr.cpu.avr1,
+ .bpfel, .bpfeb => &bpf.cpu.generic,
+ .hexagon => &hexagon.cpu.generic,
+ .mips, .mipsel => &mips.cpu.mips32,
+ .mips64, .mips64el => &mips.cpu.mips64,
+ .msp430 => &msp430.cpu.generic,
+ .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic,
+ .amdgcn => &amdgpu.cpu.generic,
+ .riscv32 => &riscv.cpu.baseline_rv32,
+ .riscv64 => &riscv.cpu.baseline_rv64,
+ .sparc, .sparcv9, .sparcel => &sparc.cpu.generic,
+ .s390x => &systemz.cpu.generic,
+ .i386 => &x86.cpu.pentium4,
+ .x86_64 => &x86.cpu.x86_64,
+ .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
+ .wasm32, .wasm64 => &wasm.cpu.generic,
+
+ else => &S.generic_model,
};
+ return model.toCpu(arch);
}
};
pub const current = Target{
.Cross = Cross{
- .arch = builtin.arch,
+ .cpu = builtin.cpu,
.os = builtin.os,
.abi = builtin.abi,
- .cpu_features = builtin.cpu_features,
},
};
pub const stack_align = 16;
- pub fn getCpuFeatures(self: Target) CpuFeatures {
- return switch (self) {
- .Native => builtin.cpu_features,
- .Cross => |cross| cross.cpu_features,
- };
- }
-
pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 {
- return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{
+ return std.fmt.allocPrint(allocator, "{}-{}-{}", .{
@tagName(self.getArch()),
- Target.archSubArchName(self.getArch()),
@tagName(self.getOs()),
@tagName(self.getAbi()),
});
@@ -776,139 +714,115 @@ pub const Target = union(enum) {
});
}
- /// TODO: Support CPU features here?
- /// https://github.com/ziglang/zig/issues/4261
- pub fn parse(text: []const u8) !Target {
- var it = mem.separate(text, "-");
- const arch_name = it.next() orelse return error.MissingArchitecture;
- const os_name = it.next() orelse return error.MissingOperatingSystem;
- const abi_name = it.next();
- const arch = try parseArchSub(arch_name);
+ pub const ParseOptions = struct {
+ /// This is sometimes called a "triple". It looks roughly like this:
+ /// riscv64-linux-gnu
+ /// The fields are, respectively:
+ /// * CPU Architecture
+ /// * Operating System
+ /// * C ABI (optional)
+ arch_os_abi: []const u8,
- var cross = Cross{
- .arch = arch,
- .cpu_features = arch.getBaselineCpuFeatures(),
- .os = try parseOs(os_name),
- .abi = undefined,
- };
- cross.abi = if (abi_name) |n| try parseAbi(n) else defaultAbi(cross.arch, cross.os);
- return Target{ .Cross = cross };
- }
+ /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"
+ /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features
+ /// to remove from the set.
+ cpu_features: []const u8 = "baseline",
- pub fn defaultAbi(arch: Arch, target_os: Os) Abi {
- switch (arch) {
- .wasm32, .wasm64 => return .musl,
- else => {},
- }
- switch (target_os) {
- .freestanding,
- .ananas,
- .cloudabi,
- .dragonfly,
- .lv2,
- .solaris,
- .haiku,
- .minix,
- .rtems,
- .nacl,
- .cnk,
- .aix,
- .cuda,
- .nvcl,
- .amdhsa,
- .ps4,
- .elfiamcu,
- .mesa3d,
- .contiki,
- .amdpal,
- .hermit,
- .other,
- => return .eabi,
- .openbsd,
- .macosx,
- .freebsd,
- .ios,
- .tvos,
- .watchos,
- .fuchsia,
- .kfreebsd,
- .netbsd,
- .hurd,
- => return .gnu,
- .windows,
- .uefi,
- => return .msvc,
- .linux,
- .wasi,
- .emscripten,
- => return .musl,
- }
- }
+ /// If this is provided, the function will populate some information about parsing failures,
+ /// so that user-friendly error messages can be delivered.
+ diagnostics: ?*Diagnostics = null,
- pub const ParseArchSubError = error{
- UnknownArchitecture,
- UnknownSubArchitecture,
- };
+ pub const Diagnostics = struct {
+ /// If the architecture was determined, this will be populated.
+ arch: ?Cpu.Arch = null,
- pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch {
- const info = @typeInfo(Arch);
- inline for (info.Union.fields) |field| {
- if (mem.startsWith(u8, text, field.name)) {
- if (field.field_type == void) {
- return @as(Arch, @field(Arch, field.name));
- } else {
- const sub_info = @typeInfo(field.field_type);
- inline for (sub_info.Enum.fields) |sub_field| {
- const combined = field.name ++ sub_field.name;
- if (mem.eql(u8, text, combined)) {
- return @unionInit(Arch, field.name, @field(field.field_type, sub_field.name));
- }
- }
- return error.UnknownSubArchitecture;
- }
- }
- }
- return error.UnknownArchitecture;
- }
+ /// If the OS was determined, this will be populated.
+ os: ?Os = null,
- pub fn parseOs(text: []const u8) !Os {
- const info = @typeInfo(Os);
- inline for (info.Enum.fields) |field| {
- if (mem.eql(u8, text, field.name)) {
- return @field(Os, field.name);
- }
- }
- return error.UnknownOperatingSystem;
- }
+ /// If the ABI was determined, this will be populated.
+ abi: ?Abi = null,
- pub fn parseAbi(text: []const u8) !Abi {
- const info = @typeInfo(Abi);
- inline for (info.Enum.fields) |field| {
- if (mem.eql(u8, text, field.name)) {
- return @field(Abi, field.name);
- }
- }
- return error.UnknownApplicationBinaryInterface;
- }
+ /// If the CPU name was determined, this will be populated.
+ cpu_name: ?[]const u8 = null,
- fn archSubArchName(arch: Arch) []const u8 {
- return switch (arch) {
- .arm => |sub| @tagName(sub),
- .armeb => |sub| @tagName(sub),
- .thumb => |sub| @tagName(sub),
- .thumbeb => |sub| @tagName(sub),
- .aarch64 => |sub| @tagName(sub),
- .aarch64_be => |sub| @tagName(sub),
- .kalimba => |sub| @tagName(sub),
- else => "",
+ /// If error.UnknownCpuFeature is returned, this will be populated.
+ unknown_feature_name: ?[]const u8 = null,
};
- }
+ };
- pub fn subArchName(self: Target) []const u8 {
- switch (self) {
- .Native => return archSubArchName(builtin.arch),
- .Cross => |cross| return archSubArchName(cross.arch),
+ pub fn parse(args: ParseOptions) !Target {
+ var dummy_diags: ParseOptions.Diagnostics = undefined;
+ var diags = args.diagnostics orelse &dummy_diags;
+
+ var it = mem.separate(args.arch_os_abi, "-");
+ const arch_name = it.next() orelse return error.MissingArchitecture;
+ const arch = try Cpu.Arch.parse(arch_name);
+ diags.arch = arch;
+
+ const os_name = it.next() orelse return error.MissingOperatingSystem;
+ const os = try Os.parse(os_name);
+ diags.os = os;
+
+ const abi_name = it.next();
+ const abi = if (abi_name) |n| try Abi.parse(n) else Abi.default(arch, os);
+ diags.abi = abi;
+
+ if (it.next() != null) return error.UnexpectedExtraField;
+
+ const all_features = arch.allFeaturesList();
+ var index: usize = 0;
+ while (index < args.cpu_features.len and
+ args.cpu_features[index] != '+' and
+ args.cpu_features[index] != '-')
+ {
+ index += 1;
}
+ const cpu_name = args.cpu_features[0..index];
+ diags.cpu_name = cpu_name;
+
+ const cpu: Cpu = if (mem.eql(u8, cpu_name, "baseline")) Cpu.baseline(arch) else blk: {
+ const cpu_model = try arch.parseCpuModel(cpu_name);
+
+ var set = cpu_model.features;
+ while (index < args.cpu_features.len) {
+ const op = args.cpu_features[index];
+ index += 1;
+ const start = index;
+ while (index < args.cpu_features.len and
+ args.cpu_features[index] != '+' and
+ args.cpu_features[index] != '-')
+ {
+ index += 1;
+ }
+ const feature_name = args.cpu_features[start..index];
+ for (all_features) |feature, feat_index_usize| {
+ const feat_index = @intCast(Cpu.Feature.Set.Index, feat_index_usize);
+ if (mem.eql(u8, feature_name, feature.name)) {
+ switch (op) {
+ '+' => set.addFeature(feat_index),
+ '-' => set.removeFeature(feat_index),
+ else => unreachable,
+ }
+ break;
+ }
+ } else {
+ diags.unknown_feature_name = feature_name;
+ return error.UnknownCpuFeature;
+ }
+ }
+ set.populateDependencies(all_features);
+ break :blk .{
+ .arch = arch,
+ .model = cpu_model,
+ .features = set,
+ };
+ };
+ var cross = Cross{
+ .cpu = cpu,
+ .os = os,
+ .abi = abi,
+ };
+ return Target{ .Cross = cross };
}
pub fn oFileExt(self: Target) []const u8 {
@@ -967,11 +881,15 @@ pub const Target = union(enum) {
};
}
- pub fn getArch(self: Target) Arch {
- switch (self) {
- .Native => return builtin.arch,
- .Cross => |t| return t.arch,
- }
+ pub fn getCpu(self: Target) Cpu {
+ return switch (self) {
+ .Native => builtin.cpu,
+ .Cross => |cross| cross.cpu,
+ };
+ }
+
+ pub fn getArch(self: Target) Cpu.Arch {
+ return self.getCpu().arch;
}
pub fn getAbi(self: Target) Abi {
@@ -1372,14 +1290,32 @@ pub const Target = union(enum) {
}
};
-test "parseCpuFeatureSet" {
- const arch: Target.Arch = .x86_64;
- const baseline = arch.getBaselineCpuFeatures();
- const set = try arch.parseCpuFeatureSet(baseline.cpu, "-sse,-avx,-cx8");
- std.testing.expect(!Target.x86.featureSetHas(set, .sse));
- std.testing.expect(!Target.x86.featureSetHas(set, .avx));
- std.testing.expect(!Target.x86.featureSetHas(set, .cx8));
- // These are expected because they are part of the baseline
- std.testing.expect(Target.x86.featureSetHas(set, .cmov));
- std.testing.expect(Target.x86.featureSetHas(set, .fxsr));
+test "Target.parse" {
+ {
+ const target = (try Target.parse(.{
+ .arch_os_abi = "x86_64-linux-gnu",
+ .cpu_features = "x86_64-sse-sse2-avx-cx8",
+ })).Cross;
+
+ std.testing.expect(target.os == .linux);
+ std.testing.expect(target.abi == .gnu);
+ std.testing.expect(target.cpu.arch == .x86_64);
+ std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .sse));
+ std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .avx));
+ std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .cx8));
+ std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .cmov));
+ std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .fxsr));
+ }
+ {
+ const target = (try Target.parse(.{
+ .arch_os_abi = "arm-linux-musleabihf",
+ .cpu_features = "generic+v8a",
+ })).Cross;
+
+ std.testing.expect(target.os == .linux);
+ std.testing.expect(target.abi == .musleabihf);
+ std.testing.expect(target.cpu.arch == .arm);
+ std.testing.expect(target.cpu.model == &Target.arm.cpu.generic);
+ std.testing.expect(Target.arm.featureSetHas(target.cpu.features, .v8a));
+ }
}
diff --git a/lib/std/target/aarch64.zig b/lib/std/target/aarch64.zig
index d2878e2423..40d3ea96ba 100644
--- a/lib/std/target/aarch64.zig
+++ b/lib/std/target/aarch64.zig
@@ -1,14 +1,8 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
- a35,
- a53,
- a55,
- a57,
- a72,
- a73,
- a75,
a76,
aes,
aggressive_fma,
@@ -40,11 +34,7 @@ pub const Feature = enum {
dit,
dotprod,
exynos_cheap_as_move,
- exynosm1,
- exynosm2,
- exynosm3,
exynosm4,
- falkor,
fmi,
force_32bit_jump_tables,
fp_armv8,
@@ -58,7 +48,6 @@ pub const Feature = enum {
fuse_csel,
fuse_literals,
jsconv,
- kryo,
lor,
lse,
lsl_fast,
@@ -103,7 +92,6 @@ pub const Feature = enum {
reserve_x6,
reserve_x7,
reserve_x9,
- saphira,
sb,
sel2,
sha2,
@@ -122,17 +110,11 @@ pub const Feature = enum {
sve2_bitperm,
sve2_sha3,
sve2_sm4,
- thunderx,
- thunderx2t99,
- thunderxt81,
- thunderxt83,
- thunderxt88,
tlb_rmi,
tpidr_el1,
tpidr_el2,
tpidr_el3,
tracev8_4,
- tsv110,
uaops,
use_aa,
use_postra_scheduler,
@@ -151,120 +133,20 @@ pub const Feature = enum {
zcz_gp,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
@setEvalBranchQuota(2000);
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
- result[@enumToInt(Feature.a35)] = .{
- .llvm_name = "a35",
- .description = "Cortex-A35 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .neon,
- .perfmon,
- }),
- };
- result[@enumToInt(Feature.a53)] = .{
- .llvm_name = "a53",
- .description = "Cortex-A53 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .balance_fp_ops,
- .crc,
- .crypto,
- .custom_cheap_as_move,
- .fp_armv8,
- .fuse_aes,
- .neon,
- .perfmon,
- .use_aa,
- .use_postra_scheduler,
- }),
- };
- result[@enumToInt(Feature.a55)] = .{
- .llvm_name = "a55",
- .description = "Cortex-A55 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .crypto,
- .dotprod,
- .fp_armv8,
- .fullfp16,
- .fuse_aes,
- .neon,
- .perfmon,
- .rcpc,
- .v8_2a,
- }),
- };
- result[@enumToInt(Feature.a57)] = .{
- .llvm_name = "a57",
- .description = "Cortex-A57 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .balance_fp_ops,
- .crc,
- .crypto,
- .custom_cheap_as_move,
- .fp_armv8,
- .fuse_aes,
- .fuse_literals,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- }),
- };
- result[@enumToInt(Feature.a72)] = .{
- .llvm_name = "a72",
- .description = "Cortex-A72 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .fuse_aes,
- .neon,
- .perfmon,
- }),
- };
- result[@enumToInt(Feature.a73)] = .{
- .llvm_name = "a73",
- .description = "Cortex-A73 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .fuse_aes,
- .neon,
- .perfmon,
- }),
- };
- result[@enumToInt(Feature.a75)] = .{
- .llvm_name = "a75",
- .description = "Cortex-A75 ARM processors",
- .dependencies = featureSet(&[_]Feature{
- .crypto,
- .dotprod,
- .fp_armv8,
- .fullfp16,
- .fuse_aes,
- .neon,
- .perfmon,
- .rcpc,
- .v8_2a,
- }),
- };
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.a76)] = .{
.llvm_name = "a76",
.description = "Cortex-A76 ARM processors",
.dependencies = featureSet(&[_]Feature{
.crypto,
.dotprod,
- .fp_armv8,
.fullfp16,
- .neon,
.rcpc,
.ssbs,
.v8_2a,
@@ -412,11 +294,10 @@ pub const all_features = blk: {
.arith_cbz_fusion,
.crypto,
.disable_latency_sched_heuristic,
- .fp_armv8,
.fuse_aes,
.fuse_crypto_eor,
- .neon,
.perfmon,
+ .v8a,
.zcm,
.zcz,
.zcz_fp_workaround,
@@ -444,58 +325,6 @@ pub const all_features = blk: {
.custom_cheap_as_move,
}),
};
- result[@enumToInt(Feature.exynosm1)] = .{
- .llvm_name = "exynosm1",
- .description = "Samsung Exynos-M1 processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .exynos_cheap_as_move,
- .force_32bit_jump_tables,
- .fuse_aes,
- .perfmon,
- .slow_misaligned_128store,
- .slow_paired_128,
- .use_postra_scheduler,
- .use_reciprocal_square_root,
- .zcz_fp,
- }),
- };
- result[@enumToInt(Feature.exynosm2)] = .{
- .llvm_name = "exynosm2",
- .description = "Samsung Exynos-M2 processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .exynos_cheap_as_move,
- .force_32bit_jump_tables,
- .fuse_aes,
- .perfmon,
- .slow_misaligned_128store,
- .slow_paired_128,
- .use_postra_scheduler,
- .zcz_fp,
- }),
- };
- result[@enumToInt(Feature.exynosm3)] = .{
- .llvm_name = "exynosm3",
- .description = "Samsung Exynos-M3 processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .exynos_cheap_as_move,
- .force_32bit_jump_tables,
- .fuse_address,
- .fuse_aes,
- .fuse_csel,
- .fuse_literals,
- .lsl_fast,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- .zcz_fp,
- }),
- };
result[@enumToInt(Feature.exynosm4)] = .{
.llvm_name = "exynosm4",
.description = "Samsung Exynos-M4 processors",
@@ -519,24 +348,6 @@ pub const all_features = blk: {
.zcz,
}),
};
- result[@enumToInt(Feature.falkor)] = .{
- .llvm_name = "falkor",
- .description = "Qualcomm Falkor processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .custom_cheap_as_move,
- .fp_armv8,
- .lsl_fast,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .rdm,
- .slow_strqro_store,
- .use_postra_scheduler,
- .zcz,
- }),
- };
result[@enumToInt(Feature.fmi)] = .{
.llvm_name = "fmi",
.description = "Enable v8.4-A Flag Manipulation Instructions",
@@ -608,22 +419,6 @@ pub const all_features = blk: {
.fp_armv8,
}),
};
- result[@enumToInt(Feature.kryo)] = .{
- .llvm_name = "kryo",
- .description = "Qualcomm Kryo processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .custom_cheap_as_move,
- .fp_armv8,
- .lsl_fast,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- .zcz,
- }),
- };
result[@enumToInt(Feature.lor)] = .{
.llvm_name = "lor",
.description = "Enables ARM v8.1 Limited Ordering Regions extension",
@@ -852,23 +647,6 @@ pub const all_features = blk: {
.description = "Reserve X9, making it unavailable as a GPR",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.saphira)] = .{
- .llvm_name = "saphira",
- .description = "Qualcomm Saphira processors",
- .dependencies = featureSet(&[_]Feature{
- .crypto,
- .custom_cheap_as_move,
- .fp_armv8,
- .lsl_fast,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .spe,
- .use_postra_scheduler,
- .v8_4a,
- .zcz,
- }),
- };
result[@enumToInt(Feature.sb)] = .{
.llvm_name = "sb",
.description = "Enable v8.5 Speculation Barrier",
@@ -979,74 +757,6 @@ pub const all_features = blk: {
.sve2,
}),
};
- result[@enumToInt(Feature.thunderx)] = .{
- .llvm_name = "thunderx",
- .description = "Cavium ThunderX processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- }),
- };
- result[@enumToInt(Feature.thunderx2t99)] = .{
- .llvm_name = "thunderx2t99",
- .description = "Cavium ThunderX2 processors",
- .dependencies = featureSet(&[_]Feature{
- .aggressive_fma,
- .arith_bcc_fusion,
- .crc,
- .crypto,
- .fp_armv8,
- .lse,
- .neon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- .v8_1a,
- }),
- };
- result[@enumToInt(Feature.thunderxt81)] = .{
- .llvm_name = "thunderxt81",
- .description = "Cavium ThunderX processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- }),
- };
- result[@enumToInt(Feature.thunderxt83)] = .{
- .llvm_name = "thunderxt83",
- .description = "Cavium ThunderX processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- }),
- };
- result[@enumToInt(Feature.thunderxt88)] = .{
- .llvm_name = "thunderxt88",
- .description = "Cavium ThunderX processors",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .crypto,
- .fp_armv8,
- .neon,
- .perfmon,
- .predictable_select_expensive,
- .use_postra_scheduler,
- }),
- };
result[@enumToInt(Feature.tlb_rmi)] = .{
.llvm_name = "tlb-rmi",
.description = "Enable v8.4-A TLB Range and Maintenance Instructions",
@@ -1072,24 +782,6 @@ pub const all_features = blk: {
.description = "Enable v8.4-A Trace extension",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.tsv110)] = .{
- .llvm_name = "tsv110",
- .description = "HiSilicon TS-V110 processors",
- .dependencies = featureSet(&[_]Feature{
- .crypto,
- .custom_cheap_as_move,
- .dotprod,
- .fp_armv8,
- .fp16fml,
- .fullfp16,
- .fuse_aes,
- .neon,
- .perfmon,
- .spe,
- .use_postra_scheduler,
- .v8_2a,
- }),
- };
result[@enumToInt(Feature.uaops)] = .{
.llvm_name = "uaops",
.description = "Enable v8.2 UAO PState",
@@ -1229,190 +921,325 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const apple_latest = Cpu{
+ pub const apple_latest = CpuModel{
.name = "apple_latest",
.llvm_name = "apple-latest",
.features = featureSet(&[_]Feature{
.cyclone,
}),
};
- pub const cortex_a35 = Cpu{
+ pub const cortex_a35 = CpuModel{
.name = "cortex_a35",
.llvm_name = "cortex-a35",
.features = featureSet(&[_]Feature{
- .a35,
+ .crc,
+ .crypto,
+ .perfmon,
+ .v8a,
}),
};
- pub const cortex_a53 = Cpu{
+ pub const cortex_a53 = CpuModel{
.name = "cortex_a53",
.llvm_name = "cortex-a53",
.features = featureSet(&[_]Feature{
- .a53,
+ .balance_fp_ops,
+ .crc,
+ .crypto,
+ .custom_cheap_as_move,
+ .fuse_aes,
+ .perfmon,
+ .use_aa,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const cortex_a55 = Cpu{
+ pub const cortex_a55 = CpuModel{
.name = "cortex_a55",
.llvm_name = "cortex-a55",
.features = featureSet(&[_]Feature{
- .a55,
+ .crypto,
+ .dotprod,
+ .fullfp16,
+ .fuse_aes,
+ .perfmon,
+ .rcpc,
+ .v8_2a,
}),
};
- pub const cortex_a57 = Cpu{
+ pub const cortex_a57 = CpuModel{
.name = "cortex_a57",
.llvm_name = "cortex-a57",
.features = featureSet(&[_]Feature{
- .a57,
+ .balance_fp_ops,
+ .crc,
+ .crypto,
+ .custom_cheap_as_move,
+ .fuse_aes,
+ .fuse_literals,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const cortex_a72 = Cpu{
+ pub const cortex_a72 = CpuModel{
.name = "cortex_a72",
.llvm_name = "cortex-a72",
.features = featureSet(&[_]Feature{
- .a72,
+ .crc,
+ .crypto,
+ .fuse_aes,
+ .perfmon,
+ .v8a,
}),
};
- pub const cortex_a73 = Cpu{
+ pub const cortex_a73 = CpuModel{
.name = "cortex_a73",
.llvm_name = "cortex-a73",
.features = featureSet(&[_]Feature{
- .a73,
+ .crc,
+ .crypto,
+ .fuse_aes,
+ .perfmon,
+ .v8a,
}),
};
- pub const cortex_a75 = Cpu{
+ pub const cortex_a75 = CpuModel{
.name = "cortex_a75",
.llvm_name = "cortex-a75",
.features = featureSet(&[_]Feature{
- .a75,
+ .crypto,
+ .dotprod,
+ .fullfp16,
+ .fuse_aes,
+ .perfmon,
+ .rcpc,
+ .v8_2a,
}),
};
- pub const cortex_a76 = Cpu{
+ pub const cortex_a76 = CpuModel{
.name = "cortex_a76",
.llvm_name = "cortex-a76",
.features = featureSet(&[_]Feature{
.a76,
}),
};
- pub const cortex_a76ae = Cpu{
+ pub const cortex_a76ae = CpuModel{
.name = "cortex_a76ae",
.llvm_name = "cortex-a76ae",
.features = featureSet(&[_]Feature{
.a76,
}),
};
- pub const cyclone = Cpu{
+ pub const cyclone = CpuModel{
.name = "cyclone",
.llvm_name = "cyclone",
.features = featureSet(&[_]Feature{
.cyclone,
}),
};
- pub const exynos_m1 = Cpu{
+ pub const exynos_m1 = CpuModel{
.name = "exynos_m1",
.llvm_name = "exynos-m1",
.features = featureSet(&[_]Feature{
- .exynosm1,
+ .crc,
+ .crypto,
+ .exynos_cheap_as_move,
+ .force_32bit_jump_tables,
+ .fuse_aes,
+ .perfmon,
+ .slow_misaligned_128store,
+ .slow_paired_128,
+ .use_postra_scheduler,
+ .use_reciprocal_square_root,
+ .v8a,
+ .zcz_fp,
}),
};
- pub const exynos_m2 = Cpu{
+ pub const exynos_m2 = CpuModel{
.name = "exynos_m2",
.llvm_name = "exynos-m2",
.features = featureSet(&[_]Feature{
- .exynosm2,
+ .crc,
+ .crypto,
+ .exynos_cheap_as_move,
+ .force_32bit_jump_tables,
+ .fuse_aes,
+ .perfmon,
+ .slow_misaligned_128store,
+ .slow_paired_128,
+ .use_postra_scheduler,
+ .v8a,
+ .zcz_fp,
}),
};
- pub const exynos_m3 = Cpu{
+ pub const exynos_m3 = CpuModel{
.name = "exynos_m3",
.llvm_name = "exynos-m3",
.features = featureSet(&[_]Feature{
- .exynosm3,
+ .crc,
+ .crypto,
+ .exynos_cheap_as_move,
+ .force_32bit_jump_tables,
+ .fuse_address,
+ .fuse_aes,
+ .fuse_csel,
+ .fuse_literals,
+ .lsl_fast,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
+ .zcz_fp,
}),
};
- pub const exynos_m4 = Cpu{
+ pub const exynos_m4 = CpuModel{
.name = "exynos_m4",
.llvm_name = "exynos-m4",
.features = featureSet(&[_]Feature{
.exynosm4,
}),
};
- pub const exynos_m5 = Cpu{
+ pub const exynos_m5 = CpuModel{
.name = "exynos_m5",
.llvm_name = "exynos-m5",
.features = featureSet(&[_]Feature{
.exynosm4,
}),
};
- pub const falkor = Cpu{
+ pub const falkor = CpuModel{
.name = "falkor",
.llvm_name = "falkor",
.features = featureSet(&[_]Feature{
- .falkor,
+ .crc,
+ .crypto,
+ .custom_cheap_as_move,
+ .lsl_fast,
+ .perfmon,
+ .predictable_select_expensive,
+ .rdm,
+ .slow_strqro_store,
+ .use_postra_scheduler,
+ .v8a,
+ .zcz,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{
- .fp_armv8,
.fuse_aes,
- .neon,
.perfmon,
.use_postra_scheduler,
+ .v8a,
}),
};
- pub const kryo = Cpu{
+ pub const kryo = CpuModel{
.name = "kryo",
.llvm_name = "kryo",
.features = featureSet(&[_]Feature{
- .kryo,
+ .crc,
+ .crypto,
+ .custom_cheap_as_move,
+ .lsl_fast,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .zcz,
+ .v8a,
}),
};
- pub const saphira = Cpu{
+ pub const saphira = CpuModel{
.name = "saphira",
.llvm_name = "saphira",
.features = featureSet(&[_]Feature{
- .saphira,
+ .crypto,
+ .custom_cheap_as_move,
+ .lsl_fast,
+ .perfmon,
+ .predictable_select_expensive,
+ .spe,
+ .use_postra_scheduler,
+ .v8_4a,
+ .zcz,
}),
};
- pub const thunderx = Cpu{
+ pub const thunderx = CpuModel{
.name = "thunderx",
.llvm_name = "thunderx",
.features = featureSet(&[_]Feature{
- .thunderx,
+ .crc,
+ .crypto,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const thunderx2t99 = Cpu{
+ pub const thunderx2t99 = CpuModel{
.name = "thunderx2t99",
.llvm_name = "thunderx2t99",
.features = featureSet(&[_]Feature{
- .thunderx2t99,
+ .aggressive_fma,
+ .arith_bcc_fusion,
+ .crc,
+ .crypto,
+ .lse,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8_1a,
}),
};
- pub const thunderxt81 = Cpu{
+ pub const thunderxt81 = CpuModel{
.name = "thunderxt81",
.llvm_name = "thunderxt81",
.features = featureSet(&[_]Feature{
- .thunderxt81,
+ .crc,
+ .crypto,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const thunderxt83 = Cpu{
+ pub const thunderxt83 = CpuModel{
.name = "thunderxt83",
.llvm_name = "thunderxt83",
.features = featureSet(&[_]Feature{
- .thunderxt83,
+ .crc,
+ .crypto,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const thunderxt88 = Cpu{
+ pub const thunderxt88 = CpuModel{
.name = "thunderxt88",
.llvm_name = "thunderxt88",
.features = featureSet(&[_]Feature{
- .thunderxt88,
+ .crc,
+ .crypto,
+ .perfmon,
+ .predictable_select_expensive,
+ .use_postra_scheduler,
+ .v8a,
}),
};
- pub const tsv110 = Cpu{
+ pub const tsv110 = CpuModel{
.name = "tsv110",
.llvm_name = "tsv110",
.features = featureSet(&[_]Feature{
- .tsv110,
+ .crypto,
+ .custom_cheap_as_move,
+ .dotprod,
+ .fp16fml,
+ .fullfp16,
+ .fuse_aes,
+ .perfmon,
+ .spe,
+ .use_postra_scheduler,
+ .v8_2a,
}),
};
};
@@ -1420,7 +1247,7 @@ pub const cpu = struct {
/// All aarch64 CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.apple_latest,
&cpu.cortex_a35,
&cpu.cortex_a53,
diff --git a/lib/std/target/amdgpu.zig b/lib/std/target/amdgpu.zig
index 182b9fa453..e524dc12a2 100644
--- a/lib/std/target/amdgpu.zig
+++ b/lib/std/target/amdgpu.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
@"16_bit_insts",
@@ -111,12 +112,12 @@ pub const Feature = enum {
xnack,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.@"16_bit_insts")] = .{
.llvm_name = "16-bit-insts",
.description = "Has i16/f16 instructions",
@@ -778,7 +779,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const bonaire = Cpu{
+ pub const bonaire = CpuModel{
.name = "bonaire",
.llvm_name = "bonaire",
.features = featureSet(&[_]Feature{
@@ -788,7 +789,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const carrizo = Cpu{
+ pub const carrizo = CpuModel{
.name = "carrizo",
.llvm_name = "carrizo",
.features = featureSet(&[_]Feature{
@@ -801,7 +802,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const fiji = Cpu{
+ pub const fiji = CpuModel{
.name = "fiji",
.llvm_name = "fiji",
.features = featureSet(&[_]Feature{
@@ -812,14 +813,14 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{
.wavefrontsize64,
}),
};
- pub const generic_hsa = Cpu{
+ pub const generic_hsa = CpuModel{
.name = "generic_hsa",
.llvm_name = "generic-hsa",
.features = featureSet(&[_]Feature{
@@ -827,7 +828,7 @@ pub const cpu = struct {
.wavefrontsize64,
}),
};
- pub const gfx1010 = Cpu{
+ pub const gfx1010 = CpuModel{
.name = "gfx1010",
.llvm_name = "gfx1010",
.features = featureSet(&[_]Feature{
@@ -853,7 +854,7 @@ pub const cpu = struct {
.wavefrontsize32,
}),
};
- pub const gfx1011 = Cpu{
+ pub const gfx1011 = CpuModel{
.name = "gfx1011",
.llvm_name = "gfx1011",
.features = featureSet(&[_]Feature{
@@ -882,7 +883,7 @@ pub const cpu = struct {
.wavefrontsize32,
}),
};
- pub const gfx1012 = Cpu{
+ pub const gfx1012 = CpuModel{
.name = "gfx1012",
.llvm_name = "gfx1012",
.features = featureSet(&[_]Feature{
@@ -912,7 +913,7 @@ pub const cpu = struct {
.wavefrontsize32,
}),
};
- pub const gfx600 = Cpu{
+ pub const gfx600 = CpuModel{
.name = "gfx600",
.llvm_name = "gfx600",
.features = featureSet(&[_]Feature{
@@ -924,7 +925,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const gfx601 = Cpu{
+ pub const gfx601 = CpuModel{
.name = "gfx601",
.llvm_name = "gfx601",
.features = featureSet(&[_]Feature{
@@ -934,7 +935,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const gfx700 = Cpu{
+ pub const gfx700 = CpuModel{
.name = "gfx700",
.llvm_name = "gfx700",
.features = featureSet(&[_]Feature{
@@ -944,7 +945,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const gfx701 = Cpu{
+ pub const gfx701 = CpuModel{
.name = "gfx701",
.llvm_name = "gfx701",
.features = featureSet(&[_]Feature{
@@ -956,7 +957,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const gfx702 = Cpu{
+ pub const gfx702 = CpuModel{
.name = "gfx702",
.llvm_name = "gfx702",
.features = featureSet(&[_]Feature{
@@ -967,7 +968,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const gfx703 = Cpu{
+ pub const gfx703 = CpuModel{
.name = "gfx703",
.llvm_name = "gfx703",
.features = featureSet(&[_]Feature{
@@ -977,7 +978,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const gfx704 = Cpu{
+ pub const gfx704 = CpuModel{
.name = "gfx704",
.llvm_name = "gfx704",
.features = featureSet(&[_]Feature{
@@ -987,7 +988,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const gfx801 = Cpu{
+ pub const gfx801 = CpuModel{
.name = "gfx801",
.llvm_name = "gfx801",
.features = featureSet(&[_]Feature{
@@ -1000,7 +1001,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const gfx802 = Cpu{
+ pub const gfx802 = CpuModel{
.name = "gfx802",
.llvm_name = "gfx802",
.features = featureSet(&[_]Feature{
@@ -1012,7 +1013,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const gfx803 = Cpu{
+ pub const gfx803 = CpuModel{
.name = "gfx803",
.llvm_name = "gfx803",
.features = featureSet(&[_]Feature{
@@ -1023,7 +1024,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const gfx810 = Cpu{
+ pub const gfx810 = CpuModel{
.name = "gfx810",
.llvm_name = "gfx810",
.features = featureSet(&[_]Feature{
@@ -1033,7 +1034,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const gfx900 = Cpu{
+ pub const gfx900 = CpuModel{
.name = "gfx900",
.llvm_name = "gfx900",
.features = featureSet(&[_]Feature{
@@ -1045,7 +1046,7 @@ pub const cpu = struct {
.no_xnack_support,
}),
};
- pub const gfx902 = Cpu{
+ pub const gfx902 = CpuModel{
.name = "gfx902",
.llvm_name = "gfx902",
.features = featureSet(&[_]Feature{
@@ -1057,7 +1058,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const gfx904 = Cpu{
+ pub const gfx904 = CpuModel{
.name = "gfx904",
.llvm_name = "gfx904",
.features = featureSet(&[_]Feature{
@@ -1069,7 +1070,7 @@ pub const cpu = struct {
.no_xnack_support,
}),
};
- pub const gfx906 = Cpu{
+ pub const gfx906 = CpuModel{
.name = "gfx906",
.llvm_name = "gfx906",
.features = featureSet(&[_]Feature{
@@ -1084,7 +1085,7 @@ pub const cpu = struct {
.no_xnack_support,
}),
};
- pub const gfx908 = Cpu{
+ pub const gfx908 = CpuModel{
.name = "gfx908",
.llvm_name = "gfx908",
.features = featureSet(&[_]Feature{
@@ -1106,7 +1107,7 @@ pub const cpu = struct {
.sram_ecc,
}),
};
- pub const gfx909 = Cpu{
+ pub const gfx909 = CpuModel{
.name = "gfx909",
.llvm_name = "gfx909",
.features = featureSet(&[_]Feature{
@@ -1117,7 +1118,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const hainan = Cpu{
+ pub const hainan = CpuModel{
.name = "hainan",
.llvm_name = "hainan",
.features = featureSet(&[_]Feature{
@@ -1127,7 +1128,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const hawaii = Cpu{
+ pub const hawaii = CpuModel{
.name = "hawaii",
.llvm_name = "hawaii",
.features = featureSet(&[_]Feature{
@@ -1139,7 +1140,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const iceland = Cpu{
+ pub const iceland = CpuModel{
.name = "iceland",
.llvm_name = "iceland",
.features = featureSet(&[_]Feature{
@@ -1151,7 +1152,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const kabini = Cpu{
+ pub const kabini = CpuModel{
.name = "kabini",
.llvm_name = "kabini",
.features = featureSet(&[_]Feature{
@@ -1161,7 +1162,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const kaveri = Cpu{
+ pub const kaveri = CpuModel{
.name = "kaveri",
.llvm_name = "kaveri",
.features = featureSet(&[_]Feature{
@@ -1171,7 +1172,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const mullins = Cpu{
+ pub const mullins = CpuModel{
.name = "mullins",
.llvm_name = "mullins",
.features = featureSet(&[_]Feature{
@@ -1181,7 +1182,7 @@ pub const cpu = struct {
.sea_islands,
}),
};
- pub const oland = Cpu{
+ pub const oland = CpuModel{
.name = "oland",
.llvm_name = "oland",
.features = featureSet(&[_]Feature{
@@ -1191,7 +1192,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const pitcairn = Cpu{
+ pub const pitcairn = CpuModel{
.name = "pitcairn",
.llvm_name = "pitcairn",
.features = featureSet(&[_]Feature{
@@ -1201,7 +1202,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const polaris10 = Cpu{
+ pub const polaris10 = CpuModel{
.name = "polaris10",
.llvm_name = "polaris10",
.features = featureSet(&[_]Feature{
@@ -1212,7 +1213,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const polaris11 = Cpu{
+ pub const polaris11 = CpuModel{
.name = "polaris11",
.llvm_name = "polaris11",
.features = featureSet(&[_]Feature{
@@ -1223,7 +1224,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const stoney = Cpu{
+ pub const stoney = CpuModel{
.name = "stoney",
.llvm_name = "stoney",
.features = featureSet(&[_]Feature{
@@ -1233,7 +1234,7 @@ pub const cpu = struct {
.xnack,
}),
};
- pub const tahiti = Cpu{
+ pub const tahiti = CpuModel{
.name = "tahiti",
.llvm_name = "tahiti",
.features = featureSet(&[_]Feature{
@@ -1245,7 +1246,7 @@ pub const cpu = struct {
.southern_islands,
}),
};
- pub const tonga = Cpu{
+ pub const tonga = CpuModel{
.name = "tonga",
.llvm_name = "tonga",
.features = featureSet(&[_]Feature{
@@ -1257,7 +1258,7 @@ pub const cpu = struct {
.volcanic_islands,
}),
};
- pub const verde = Cpu{
+ pub const verde = CpuModel{
.name = "verde",
.llvm_name = "verde",
.features = featureSet(&[_]Feature{
@@ -1272,7 +1273,7 @@ pub const cpu = struct {
/// All amdgpu CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.bonaire,
&cpu.carrizo,
&cpu.fiji,
diff --git a/lib/std/target/arm.zig b/lib/std/target/arm.zig
index 62a4e1e835..50c1bfed15 100644
--- a/lib/std/target/arm.zig
+++ b/lib/std/target/arm.zig
@@ -1,61 +1,14 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
@"32bit",
@"8msecext",
- a12,
- a15,
- a17,
- a32,
- a35,
- a5,
- a53,
- a55,
- a57,
- a7,
- a72,
- a73,
- a75,
a76,
- a8,
- a9,
aclass,
acquire_release,
aes,
- armv2,
- armv2a,
- armv3,
- armv3m,
- armv4,
- armv4t,
- armv5t,
- armv5te,
- armv5tej,
- armv6,
- armv6_m,
- armv6j,
- armv6k,
- armv6kz,
- armv6s_m,
- armv6t2,
- armv7_a,
- armv7_m,
- armv7_r,
- armv7e_m,
- armv7k,
- armv7s,
- armv7ve,
- armv8_a,
- armv8_m_base,
- armv8_m_main,
- armv8_r,
- armv8_1_a,
- armv8_1_m_main,
- armv8_2_a,
- armv8_3_a,
- armv8_4_a,
- armv8_5_a,
avoid_movs_shop,
avoid_partial_cpsr,
cheap_predicable_cpsr,
@@ -71,13 +24,13 @@ pub const Feature = enum {
execute_only,
expand_fp_mlx,
exynos,
+ fp16,
+ fp16fml,
+ fp64,
fp_armv8,
fp_armv8d16,
fp_armv8d16sp,
fp_armv8sp,
- fp16,
- fp16fml,
- fp64,
fpao,
fpregs,
fpregs16,
@@ -85,12 +38,28 @@ pub const Feature = enum {
fullfp16,
fuse_aes,
fuse_literals,
+ has_v4t,
+ has_v5t,
+ has_v5te,
+ has_v6,
+ has_v6k,
+ has_v6m,
+ has_v6t2,
+ has_v7,
+ has_v7clrex,
+ has_v8_1a,
+ has_v8_1m_main,
+ has_v8_2a,
+ has_v8_3a,
+ has_v8_4a,
+ has_v8_5a,
+ has_v8,
+ has_v8m,
+ has_v8m_main,
hwdiv,
hwdiv_arm,
iwmmxt,
iwmmxt2,
- krait,
- kryo,
lob,
long_calls,
loop_align,
@@ -114,9 +83,6 @@ pub const Feature = enum {
prefer_vmovsr,
prof_unpr,
r4,
- r5,
- r52,
- r7,
ras,
rclass,
read_tp_hard,
@@ -134,29 +100,44 @@ pub const Feature = enum {
splat_vfp_neon,
strict_align,
swift,
- thumb_mode,
thumb2,
+ thumb_mode,
trustzone,
use_aa,
use_misched,
+ v2,
+ v2a,
+ v3,
+ v3m,
+ v4,
v4t,
v5t,
v5te,
+ v5tej,
v6,
+ v6j,
v6k,
+ v6kz,
v6m,
+ v6sm,
v6t2,
- v7,
- v7clrex,
- v8,
+ v7a,
+ v7em,
+ v7k,
+ v7m,
+ v7r,
+ v7s,
+ v7ve,
+ v8a,
+ v8m,
+ v8m_main,
+ v8r,
v8_1a,
v8_1m_main,
v8_2a,
v8_3a,
v8_4a,
v8_5a,
- v8m,
- v8m_main,
vfp2,
vfp2d16,
vfp2d16sp,
@@ -178,13 +159,13 @@ pub const Feature = enum {
zcz,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
@setEvalBranchQuota(10000);
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.@"32bit")] = .{
.llvm_name = "32bit",
.description = "Prefer 32-bit Thumb instrs",
@@ -195,86 +176,11 @@ pub const all_features = blk: {
.description = "Enable support for ARMv8-M Security Extensions",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.a12)] = .{
- .llvm_name = "a12",
- .description = "Cortex-A12 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a15)] = .{
- .llvm_name = "a15",
- .description = "Cortex-A15 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a17)] = .{
- .llvm_name = "a17",
- .description = "Cortex-A17 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a32)] = .{
- .llvm_name = "a32",
- .description = "Cortex-A32 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a35)] = .{
- .llvm_name = "a35",
- .description = "Cortex-A35 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a5)] = .{
- .llvm_name = "a5",
- .description = "Cortex-A5 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a53)] = .{
- .llvm_name = "a53",
- .description = "Cortex-A53 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a55)] = .{
- .llvm_name = "a55",
- .description = "Cortex-A55 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a57)] = .{
- .llvm_name = "a57",
- .description = "Cortex-A57 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a7)] = .{
- .llvm_name = "a7",
- .description = "Cortex-A7 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a72)] = .{
- .llvm_name = "a72",
- .description = "Cortex-A72 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a73)] = .{
- .llvm_name = "a73",
- .description = "Cortex-A73 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a75)] = .{
- .llvm_name = "a75",
- .description = "Cortex-A75 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
result[@enumToInt(Feature.a76)] = .{
.llvm_name = "a76",
.description = "Cortex-A76 ARM processors",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.a8)] = .{
- .llvm_name = "a8",
- .description = "Cortex-A8 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.a9)] = .{
- .llvm_name = "a9",
- .description = "Cortex-A9 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
result[@enumToInt(Feature.aclass)] = .{
.llvm_name = "aclass",
.description = "Is application profile ('A' series)",
@@ -292,368 +198,6 @@ pub const all_features = blk: {
.neon,
}),
};
- result[@enumToInt(Feature.armv2)] = .{
- .llvm_name = "armv2",
- .description = "ARMv2 architecture",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.armv2a)] = .{
- .llvm_name = "armv2a",
- .description = "ARMv2a architecture",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.armv3)] = .{
- .llvm_name = "armv3",
- .description = "ARMv3 architecture",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.armv3m)] = .{
- .llvm_name = "armv3m",
- .description = "ARMv3m architecture",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.armv4)] = .{
- .llvm_name = "armv4",
- .description = "ARMv4 architecture",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.armv4t)] = .{
- .llvm_name = "armv4t",
- .description = "ARMv4t architecture",
- .dependencies = featureSet(&[_]Feature{
- .v4t,
- }),
- };
- result[@enumToInt(Feature.armv5t)] = .{
- .llvm_name = "armv5t",
- .description = "ARMv5t architecture",
- .dependencies = featureSet(&[_]Feature{
- .v5t,
- }),
- };
- result[@enumToInt(Feature.armv5te)] = .{
- .llvm_name = "armv5te",
- .description = "ARMv5te architecture",
- .dependencies = featureSet(&[_]Feature{
- .v5te,
- }),
- };
- result[@enumToInt(Feature.armv5tej)] = .{
- .llvm_name = "armv5tej",
- .description = "ARMv5tej architecture",
- .dependencies = featureSet(&[_]Feature{
- .v5te,
- }),
- };
- result[@enumToInt(Feature.armv6)] = .{
- .llvm_name = "armv6",
- .description = "ARMv6 architecture",
- .dependencies = featureSet(&[_]Feature{
- .dsp,
- .v6,
- }),
- };
- result[@enumToInt(Feature.armv6_m)] = .{
- .llvm_name = "armv6-m",
- .description = "ARMv6m architecture",
- .dependencies = featureSet(&[_]Feature{
- .db,
- .mclass,
- .noarm,
- .strict_align,
- .thumb_mode,
- .v6m,
- }),
- };
- result[@enumToInt(Feature.armv6j)] = .{
- .llvm_name = "armv6j",
- .description = "ARMv7a architecture",
- .dependencies = featureSet(&[_]Feature{
- .armv6,
- }),
- };
- result[@enumToInt(Feature.armv6k)] = .{
- .llvm_name = "armv6k",
- .description = "ARMv6k architecture",
- .dependencies = featureSet(&[_]Feature{
- .v6k,
- }),
- };
- result[@enumToInt(Feature.armv6kz)] = .{
- .llvm_name = "armv6kz",
- .description = "ARMv6kz architecture",
- .dependencies = featureSet(&[_]Feature{
- .trustzone,
- .v6k,
- }),
- };
- result[@enumToInt(Feature.armv6s_m)] = .{
- .llvm_name = "armv6s-m",
- .description = "ARMv6sm architecture",
- .dependencies = featureSet(&[_]Feature{
- .db,
- .mclass,
- .noarm,
- .strict_align,
- .thumb_mode,
- .v6m,
- }),
- };
- result[@enumToInt(Feature.armv6t2)] = .{
- .llvm_name = "armv6t2",
- .description = "ARMv6t2 architecture",
- .dependencies = featureSet(&[_]Feature{
- .dsp,
- .v6t2,
- }),
- };
- result[@enumToInt(Feature.armv7_a)] = .{
- .llvm_name = "armv7-a",
- .description = "ARMv7a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .db,
- .dsp,
- .neon,
- .v7,
- }),
- };
- result[@enumToInt(Feature.armv7_m)] = .{
- .llvm_name = "armv7-m",
- .description = "ARMv7m architecture",
- .dependencies = featureSet(&[_]Feature{
- .db,
- .hwdiv,
- .mclass,
- .noarm,
- .thumb_mode,
- .thumb2,
- .v7,
- }),
- };
- result[@enumToInt(Feature.armv7_r)] = .{
- .llvm_name = "armv7-r",
- .description = "ARMv7r architecture",
- .dependencies = featureSet(&[_]Feature{
- .db,
- .dsp,
- .hwdiv,
- .rclass,
- .v7,
- }),
- };
- result[@enumToInt(Feature.armv7e_m)] = .{
- .llvm_name = "armv7e-m",
- .description = "ARMv7em architecture",
- .dependencies = featureSet(&[_]Feature{
- .db,
- .dsp,
- .hwdiv,
- .mclass,
- .noarm,
- .thumb_mode,
- .thumb2,
- .v7,
- }),
- };
- result[@enumToInt(Feature.armv7k)] = .{
- .llvm_name = "armv7k",
- .description = "ARMv7a architecture",
- .dependencies = featureSet(&[_]Feature{
- .armv7_a,
- }),
- };
- result[@enumToInt(Feature.armv7s)] = .{
- .llvm_name = "armv7s",
- .description = "ARMv7a architecture",
- .dependencies = featureSet(&[_]Feature{
- .armv7_a,
- }),
- };
- result[@enumToInt(Feature.armv7ve)] = .{
- .llvm_name = "armv7ve",
- .description = "ARMv7ve architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .db,
- .dsp,
- .mp,
- .neon,
- .trustzone,
- .v7,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_a)] = .{
- .llvm_name = "armv8-a",
- .description = "ARMv8a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .trustzone,
- .v8,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_m_base)] = .{
- .llvm_name = "armv8-m.base",
- .description = "ARMv8mBaseline architecture",
- .dependencies = featureSet(&[_]Feature{
- .@"8msecext",
- .acquire_release,
- .db,
- .hwdiv,
- .mclass,
- .noarm,
- .strict_align,
- .thumb_mode,
- .v7clrex,
- .v8m,
- }),
- };
- result[@enumToInt(Feature.armv8_m_main)] = .{
- .llvm_name = "armv8-m.main",
- .description = "ARMv8mMainline architecture",
- .dependencies = featureSet(&[_]Feature{
- .@"8msecext",
- .acquire_release,
- .db,
- .hwdiv,
- .mclass,
- .noarm,
- .thumb_mode,
- .v8m_main,
- }),
- };
- result[@enumToInt(Feature.armv8_r)] = .{
- .llvm_name = "armv8-r",
- .description = "ARMv8r architecture",
- .dependencies = featureSet(&[_]Feature{
- .crc,
- .db,
- .dfb,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .rclass,
- .v8,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_1_a)] = .{
- .llvm_name = "armv8.1-a",
- .description = "ARMv81a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .trustzone,
- .v8_1a,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_1_m_main)] = .{
- .llvm_name = "armv8.1-m.main",
- .description = "ARMv81mMainline architecture",
- .dependencies = featureSet(&[_]Feature{
- .@"8msecext",
- .acquire_release,
- .db,
- .hwdiv,
- .lob,
- .mclass,
- .noarm,
- .ras,
- .thumb_mode,
- .v8_1m_main,
- }),
- };
- result[@enumToInt(Feature.armv8_2_a)] = .{
- .llvm_name = "armv8.2-a",
- .description = "ARMv82a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .ras,
- .trustzone,
- .v8_2a,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_3_a)] = .{
- .llvm_name = "armv8.3-a",
- .description = "ARMv83a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .ras,
- .trustzone,
- .v8_3a,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_4_a)] = .{
- .llvm_name = "armv8.4-a",
- .description = "ARMv84a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dotprod,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .ras,
- .trustzone,
- .v8_4a,
- .virtualization,
- }),
- };
- result[@enumToInt(Feature.armv8_5_a)] = .{
- .llvm_name = "armv8.5-a",
- .description = "ARMv85a architecture",
- .dependencies = featureSet(&[_]Feature{
- .aclass,
- .crc,
- .crypto,
- .db,
- .dotprod,
- .dsp,
- .fp_armv8,
- .mp,
- .neon,
- .ras,
- .trustzone,
- .v8_5a,
- .virtualization,
- }),
- };
result[@enumToInt(Feature.avoid_movs_shop)] = .{
.llvm_name = "avoid-movs-shop",
.description = "Avoid movs instructions with shifter operand",
@@ -753,6 +297,25 @@ pub const all_features = blk: {
.zcz,
}),
};
+ result[@enumToInt(Feature.fp16)] = .{
+ .llvm_name = "fp16",
+ .description = "Enable half-precision floating point",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.fp16fml)] = .{
+ .llvm_name = "fp16fml",
+ .description = "Enable full half-precision floating point fml instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .fullfp16,
+ }),
+ };
+ result[@enumToInt(Feature.fp64)] = .{
+ .llvm_name = "fp64",
+ .description = "Floating point unit supports double precision",
+ .dependencies = featureSet(&[_]Feature{
+ .fpregs64,
+ }),
+ };
result[@enumToInt(Feature.fp_armv8)] = .{
.llvm_name = "fp-armv8",
.description = "Enable ARMv8 FP",
@@ -787,25 +350,6 @@ pub const all_features = blk: {
.vfp4sp,
}),
};
- result[@enumToInt(Feature.fp16)] = .{
- .llvm_name = "fp16",
- .description = "Enable half-precision floating point",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.fp16fml)] = .{
- .llvm_name = "fp16fml",
- .description = "Enable full half-precision floating point fml instructions",
- .dependencies = featureSet(&[_]Feature{
- .fullfp16,
- }),
- };
- result[@enumToInt(Feature.fp64)] = .{
- .llvm_name = "fp64",
- .description = "Floating point unit supports double precision",
- .dependencies = featureSet(&[_]Feature{
- .fpregs64,
- }),
- };
result[@enumToInt(Feature.fpao)] = .{
.llvm_name = "fpao",
.description = "Enable fast computation of positive address offsets",
@@ -848,6 +392,135 @@ pub const all_features = blk: {
.description = "CPU fuses literal generation operations",
.dependencies = featureSet(&[_]Feature{}),
};
+ result[@enumToInt(Feature.has_v4t)] = .{
+ .llvm_name = "v4t",
+ .description = "Support ARM v4T instructions",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.has_v5t)] = .{
+ .llvm_name = "v5t",
+ .description = "Support ARM v5T instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v4t,
+ }),
+ };
+ result[@enumToInt(Feature.has_v5te)] = .{
+ .llvm_name = "v5te",
+ .description = "Support ARM v5TE, v5TEj, and v5TExp instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v5t,
+ }),
+ };
+ result[@enumToInt(Feature.has_v6)] = .{
+ .llvm_name = "v6",
+ .description = "Support ARM v6 instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v5te,
+ }),
+ };
+ result[@enumToInt(Feature.has_v6k)] = .{
+ .llvm_name = "v6k",
+ .description = "Support ARM v6k instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v6,
+ }),
+ };
+ result[@enumToInt(Feature.has_v6m)] = .{
+ .llvm_name = "v6m",
+ .description = "Support ARM v6M instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v6,
+ }),
+ };
+ result[@enumToInt(Feature.has_v6t2)] = .{
+ .llvm_name = "v6t2",
+ .description = "Support ARM v6t2 instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .thumb2,
+ .has_v6k,
+ .has_v8m,
+ }),
+ };
+ result[@enumToInt(Feature.has_v7)] = .{
+ .llvm_name = "v7",
+ .description = "Support ARM v7 instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .perfmon,
+ .has_v6t2,
+ .has_v7clrex,
+ }),
+ };
+ result[@enumToInt(Feature.has_v7clrex)] = .{
+ .llvm_name = "v7clrex",
+ .description = "Has v7 clrex instruction",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.has_v8)] = .{
+ .llvm_name = "v8",
+ .description = "Support ARM v8 instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .acquire_release,
+ .has_v7,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_1a)] = .{
+ .llvm_name = "v8.1a",
+ .description = "Support ARM v8.1a instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v8,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_1m_main)] = .{
+ .llvm_name = "v8.1m.main",
+ .description = "Support ARM v8-1M Mainline instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v8m_main,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_2a)] = .{
+ .llvm_name = "v8.2a",
+ .description = "Support ARM v8.2a instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v8_1a,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_3a)] = .{
+ .llvm_name = "v8.3a",
+ .description = "Support ARM v8.3a instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v8_2a,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_4a)] = .{
+ .llvm_name = "v8.4a",
+ .description = "Support ARM v8.4a instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .dotprod,
+ .has_v8_3a,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8_5a)] = .{
+ .llvm_name = "v8.5a",
+ .description = "Support ARM v8.5a instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .sb,
+ .has_v8_4a,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8m)] = .{
+ .llvm_name = "v8m",
+ .description = "Support ARM v8M Baseline instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v6m,
+ }),
+ };
+ result[@enumToInt(Feature.has_v8m_main)] = .{
+ .llvm_name = "v8m.main",
+ .description = "Support ARM v8M Mainline instructions",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v7,
+ }),
+ };
result[@enumToInt(Feature.hwdiv)] = .{
.llvm_name = "hwdiv",
.description = "Enable divide instructions in Thumb",
@@ -862,26 +535,16 @@ pub const all_features = blk: {
.llvm_name = "iwmmxt",
.description = "ARMv5te architecture",
.dependencies = featureSet(&[_]Feature{
- .armv5te,
+ .has_v5te,
}),
};
result[@enumToInt(Feature.iwmmxt2)] = .{
.llvm_name = "iwmmxt2",
.description = "ARMv5te architecture",
.dependencies = featureSet(&[_]Feature{
- .armv5te,
+ .has_v5te,
}),
};
- result[@enumToInt(Feature.krait)] = .{
- .llvm_name = "krait",
- .description = "Qualcomm Krait processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.kryo)] = .{
- .llvm_name = "kryo",
- .description = "Qualcomm Kryo processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
result[@enumToInt(Feature.lob)] = .{
.llvm_name = "lob",
.description = "Enable Low Overhead Branch extensions",
@@ -924,7 +587,7 @@ pub const all_features = blk: {
.dsp,
.fpregs16,
.fpregs64,
- .v8_1m_main,
+ .has_v8_1m_main,
}),
};
result[@enumToInt(Feature.mve_fp)] = .{
@@ -1008,21 +671,6 @@ pub const all_features = blk: {
.description = "Cortex-R4 ARM processors",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.r5)] = .{
- .llvm_name = "r5",
- .description = "Cortex-R5 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.r52)] = .{
- .llvm_name = "r52",
- .description = "Cortex-R52 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
- result[@enumToInt(Feature.r7)] = .{
- .llvm_name = "r7",
- .description = "Cortex-R7 ARM processors",
- .dependencies = featureSet(&[_]Feature{}),
- };
result[@enumToInt(Feature.ras)] = .{
.llvm_name = "ras",
.description = "Enable Reliability, Availability and Serviceability extensions",
@@ -1112,16 +760,16 @@ pub const all_features = blk: {
.description = "Swift ARM processors",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.thumb_mode)] = .{
- .llvm_name = "thumb-mode",
- .description = "Thumb mode",
- .dependencies = featureSet(&[_]Feature{}),
- };
result[@enumToInt(Feature.thumb2)] = .{
.llvm_name = "thumb2",
.description = "Enable Thumb2 instructions",
.dependencies = featureSet(&[_]Feature{}),
};
+ result[@enumToInt(Feature.thumb_mode)] = .{
+ .llvm_name = "thumb-mode",
+ .description = "Thumb mode",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
result[@enumToInt(Feature.trustzone)] = .{
.llvm_name = "trustzone",
.description = "Enable support for TrustZone security extensions",
@@ -1137,133 +785,366 @@ pub const all_features = blk: {
.description = "Use the MachineScheduler",
.dependencies = featureSet(&[_]Feature{}),
};
- result[@enumToInt(Feature.v4t)] = .{
- .llvm_name = "v4t",
- .description = "Support ARM v4T instructions",
+ result[@enumToInt(Feature.v2)] = .{
+ .llvm_name = "armv2",
+ .description = "ARMv2 architecture",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.v2a)] = .{
+ .llvm_name = "armv2a",
+ .description = "ARMv2a architecture",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.v3)] = .{
+ .llvm_name = "armv3",
+ .description = "ARMv3 architecture",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.v3m)] = .{
+ .llvm_name = "armv3m",
+ .description = "ARMv3m architecture",
+ .dependencies = featureSet(&[_]Feature{}),
+ };
+ result[@enumToInt(Feature.v4)] = .{
+ .llvm_name = "armv4",
+ .description = "ARMv4 architecture",
.dependencies = featureSet(&[_]Feature{}),
};
+ result[@enumToInt(Feature.v4t)] = .{
+ .llvm_name = "armv4t",
+ .description = "ARMv4t architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v4t,
+ }),
+ };
result[@enumToInt(Feature.v5t)] = .{
- .llvm_name = "v5t",
- .description = "Support ARM v5T instructions",
+ .llvm_name = "armv5t",
+ .description = "ARMv5t architecture",
.dependencies = featureSet(&[_]Feature{
- .v4t,
+ .has_v5t,
}),
};
result[@enumToInt(Feature.v5te)] = .{
- .llvm_name = "v5te",
- .description = "Support ARM v5TE, v5TEj, and v5TExp instructions",
+ .llvm_name = "armv5te",
+ .description = "ARMv5te architecture",
.dependencies = featureSet(&[_]Feature{
- .v5t,
+ .has_v5te,
}),
};
- result[@enumToInt(Feature.v6)] = .{
- .llvm_name = "v6",
- .description = "Support ARM v6 instructions",
+ result[@enumToInt(Feature.v5tej)] = .{
+ .llvm_name = "armv5tej",
+ .description = "ARMv5tej architecture",
.dependencies = featureSet(&[_]Feature{
- .v5te,
+ .has_v5te,
}),
};
- result[@enumToInt(Feature.v6k)] = .{
- .llvm_name = "v6k",
- .description = "Support ARM v6k instructions",
+ result[@enumToInt(Feature.v6)] = .{
+ .llvm_name = "armv6",
+ .description = "ARMv6 architecture",
.dependencies = featureSet(&[_]Feature{
- .v6,
+ .dsp,
+ .has_v6,
}),
};
result[@enumToInt(Feature.v6m)] = .{
- .llvm_name = "v6m",
- .description = "Support ARM v6M instructions",
+ .llvm_name = "armv6-m",
+ .description = "ARMv6m architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .db,
+ .mclass,
+ .noarm,
+ .strict_align,
+ .thumb_mode,
+ .has_v6m,
+ }),
+ };
+ result[@enumToInt(Feature.v6j)] = .{
+ .llvm_name = "armv6j",
+ .description = "ARMv7a architecture",
.dependencies = featureSet(&[_]Feature{
.v6,
}),
};
+ result[@enumToInt(Feature.v6k)] = .{
+ .llvm_name = "armv6k",
+ .description = "ARMv6k architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .has_v6k,
+ }),
+ };
+ result[@enumToInt(Feature.v6kz)] = .{
+ .llvm_name = "armv6kz",
+ .description = "ARMv6kz architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .trustzone,
+ .has_v6k,
+ }),
+ };
+ result[@enumToInt(Feature.v6sm)] = .{
+ .llvm_name = "armv6s-m",
+ .description = "ARMv6sm architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .db,
+ .mclass,
+ .noarm,
+ .strict_align,
+ .thumb_mode,
+ .has_v6m,
+ }),
+ };
result[@enumToInt(Feature.v6t2)] = .{
- .llvm_name = "v6t2",
- .description = "Support ARM v6t2 instructions",
+ .llvm_name = "armv6t2",
+ .description = "ARMv6t2 architecture",
.dependencies = featureSet(&[_]Feature{
+ .dsp,
+ .has_v6t2,
+ }),
+ };
+ result[@enumToInt(Feature.v7a)] = .{
+ .llvm_name = "armv7-a",
+ .description = "ARMv7a architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .aclass,
+ .db,
+ .dsp,
+ .neon,
+ .has_v7,
+ }),
+ };
+ result[@enumToInt(Feature.v7m)] = .{
+ .llvm_name = "armv7-m",
+ .description = "ARMv7m architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .db,
+ .hwdiv,
+ .mclass,
+ .noarm,
+ .thumb_mode,
.thumb2,
- .v6k,
- .v8m,
+ .has_v7,
}),
};
- result[@enumToInt(Feature.v7)] = .{
- .llvm_name = "v7",
- .description = "Support ARM v7 instructions",
+ result[@enumToInt(Feature.v7r)] = .{
+ .llvm_name = "armv7-r",
+ .description = "ARMv7r architecture",
.dependencies = featureSet(&[_]Feature{
- .perfmon,
- .v6t2,
- .v7clrex,
+ .db,
+ .dsp,
+ .hwdiv,
+ .rclass,
+ .has_v7,
}),
};
- result[@enumToInt(Feature.v7clrex)] = .{
- .llvm_name = "v7clrex",
- .description = "Has v7 clrex instruction",
- .dependencies = featureSet(&[_]Feature{}),
+ result[@enumToInt(Feature.v7em)] = .{
+ .llvm_name = "armv7e-m",
+ .description = "ARMv7em architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .db,
+ .dsp,
+ .hwdiv,
+ .mclass,
+ .noarm,
+ .thumb_mode,
+ .thumb2,
+ .has_v7,
+ }),
};
- result[@enumToInt(Feature.v8)] = .{
- .llvm_name = "v8",
- .description = "Support ARM v8 instructions",
+ result[@enumToInt(Feature.v7k)] = .{
+ .llvm_name = "armv7k",
+ .description = "ARMv7a architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .v7a,
+ }),
+ };
+ result[@enumToInt(Feature.v7s)] = .{
+ .llvm_name = "armv7s",
+ .description = "ARMv7a architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .v7a,
+ }),
+ };
+ result[@enumToInt(Feature.v7ve)] = .{
+ .llvm_name = "armv7ve",
+ .description = "ARMv7ve architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .aclass,
+ .db,
+ .dsp,
+ .mp,
+ .neon,
+ .trustzone,
+ .has_v7,
+ .virtualization,
+ }),
+ };
+ result[@enumToInt(Feature.v8a)] = .{
+ .llvm_name = "armv8-a",
+ .description = "ARMv8a architecture",
.dependencies = featureSet(&[_]Feature{
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .trustzone,
+ .has_v8,
+ .virtualization,
+ }),
+ };
+ result[@enumToInt(Feature.v8m)] = .{
+ .llvm_name = "armv8-m.base",
+ .description = "ARMv8mBaseline architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .@"8msecext",
.acquire_release,
- .v7,
+ .db,
+ .hwdiv,
+ .mclass,
+ .noarm,
+ .strict_align,
+ .thumb_mode,
+ .has_v7clrex,
+ .has_v8m,
+ }),
+ };
+ result[@enumToInt(Feature.v8m_main)] = .{
+ .llvm_name = "armv8-m.main",
+ .description = "ARMv8mMainline architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .@"8msecext",
+ .acquire_release,
+ .db,
+ .hwdiv,
+ .mclass,
+ .noarm,
+ .thumb_mode,
+ .has_v8m_main,
+ }),
+ };
+ result[@enumToInt(Feature.v8r)] = .{
+ .llvm_name = "armv8-r",
+ .description = "ARMv8r architecture",
+ .dependencies = featureSet(&[_]Feature{
+ .crc,
+ .db,
+ .dfb,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .rclass,
+ .has_v8,
+ .virtualization,
}),
};
result[@enumToInt(Feature.v8_1a)] = .{
- .llvm_name = "v8.1a",
- .description = "Support ARM v8.1a instructions",
+ .llvm_name = "armv8.1-a",
+ .description = "ARMv81a architecture",
.dependencies = featureSet(&[_]Feature{
- .v8,
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .trustzone,
+ .has_v8_1a,
+ .virtualization,
}),
};
result[@enumToInt(Feature.v8_1m_main)] = .{
- .llvm_name = "v8.1m.main",
- .description = "Support ARM v8-1M Mainline instructions",
+ .llvm_name = "armv8.1-m.main",
+ .description = "ARMv81mMainline architecture",
.dependencies = featureSet(&[_]Feature{
- .v8m_main,
+ .@"8msecext",
+ .acquire_release,
+ .db,
+ .hwdiv,
+ .lob,
+ .mclass,
+ .noarm,
+ .ras,
+ .thumb_mode,
+ .has_v8_1m_main,
}),
};
result[@enumToInt(Feature.v8_2a)] = .{
- .llvm_name = "v8.2a",
- .description = "Support ARM v8.2a instructions",
+ .llvm_name = "armv8.2-a",
+ .description = "ARMv82a architecture",
.dependencies = featureSet(&[_]Feature{
- .v8_1a,
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .ras,
+ .trustzone,
+ .has_v8_2a,
+ .virtualization,
}),
};
result[@enumToInt(Feature.v8_3a)] = .{
- .llvm_name = "v8.3a",
- .description = "Support ARM v8.3a instructions",
+ .llvm_name = "armv8.3-a",
+ .description = "ARMv83a architecture",
.dependencies = featureSet(&[_]Feature{
- .v8_2a,
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .ras,
+ .trustzone,
+ .has_v8_3a,
+ .virtualization,
}),
};
result[@enumToInt(Feature.v8_4a)] = .{
- .llvm_name = "v8.4a",
- .description = "Support ARM v8.4a instructions",
+ .llvm_name = "armv8.4-a",
+ .description = "ARMv84a architecture",
.dependencies = featureSet(&[_]Feature{
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
.dotprod,
- .v8_3a,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .ras,
+ .trustzone,
+ .has_v8_4a,
+ .virtualization,
}),
};
result[@enumToInt(Feature.v8_5a)] = .{
- .llvm_name = "v8.5a",
- .description = "Support ARM v8.5a instructions",
- .dependencies = featureSet(&[_]Feature{
- .sb,
- .v8_4a,
- }),
- };
- result[@enumToInt(Feature.v8m)] = .{
- .llvm_name = "v8m",
- .description = "Support ARM v8M Baseline instructions",
- .dependencies = featureSet(&[_]Feature{
- .v6m,
- }),
- };
- result[@enumToInt(Feature.v8m_main)] = .{
- .llvm_name = "v8m.main",
- .description = "Support ARM v8M Mainline instructions",
+ .llvm_name = "armv8.5-a",
+ .description = "ARMv85a architecture",
.dependencies = featureSet(&[_]Feature{
- .v7,
+ .aclass,
+ .crc,
+ .crypto,
+ .db,
+ .dotprod,
+ .dsp,
+ .fp_armv8,
+ .mp,
+ .neon,
+ .ras,
+ .trustzone,
+ .has_v8_5a,
+ .virtualization,
}),
};
result[@enumToInt(Feature.vfp2)] = .{
@@ -1398,7 +1279,7 @@ pub const all_features = blk: {
.llvm_name = "xscale",
.description = "ARMv5te architecture",
.dependencies = featureSet(&[_]Feature{
- .armv5te,
+ .has_v5te,
}),
};
result[@enumToInt(Feature.zcz)] = .{
@@ -1415,221 +1296,227 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const arm1020e = Cpu{
+ pub const arm1020e = CpuModel{
.name = "arm1020e",
.llvm_name = "arm1020e",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm1020t = Cpu{
+ pub const arm1020t = CpuModel{
.name = "arm1020t",
.llvm_name = "arm1020t",
.features = featureSet(&[_]Feature{
- .armv5t,
+ .v5t,
}),
};
- pub const arm1022e = Cpu{
+ pub const arm1022e = CpuModel{
.name = "arm1022e",
.llvm_name = "arm1022e",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm10e = Cpu{
+ pub const arm10e = CpuModel{
.name = "arm10e",
.llvm_name = "arm10e",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm10tdmi = Cpu{
+ pub const arm10tdmi = CpuModel{
.name = "arm10tdmi",
.llvm_name = "arm10tdmi",
.features = featureSet(&[_]Feature{
- .armv5t,
+ .v5t,
}),
};
- pub const arm1136j_s = Cpu{
+ pub const arm1136j_s = CpuModel{
.name = "arm1136j_s",
.llvm_name = "arm1136j-s",
.features = featureSet(&[_]Feature{
- .armv6,
+ .v6,
}),
};
- pub const arm1136jf_s = Cpu{
+ pub const arm1136jf_s = CpuModel{
.name = "arm1136jf_s",
.llvm_name = "arm1136jf-s",
.features = featureSet(&[_]Feature{
- .armv6,
+ .v6,
.slowfpvmlx,
.vfp2,
}),
};
- pub const arm1156t2_s = Cpu{
+ pub const arm1156t2_s = CpuModel{
.name = "arm1156t2_s",
.llvm_name = "arm1156t2-s",
.features = featureSet(&[_]Feature{
- .armv6t2,
+ .v6t2,
}),
};
- pub const arm1156t2f_s = Cpu{
+ pub const arm1156t2f_s = CpuModel{
.name = "arm1156t2f_s",
.llvm_name = "arm1156t2f-s",
.features = featureSet(&[_]Feature{
- .armv6t2,
+ .v6t2,
.slowfpvmlx,
.vfp2,
}),
};
- pub const arm1176j_s = Cpu{
+ pub const arm1176j_s = CpuModel{
.name = "arm1176j_s",
.llvm_name = "arm1176j-s",
.features = featureSet(&[_]Feature{
- .armv6kz,
+ .v6kz,
}),
};
- pub const arm1176jz_s = Cpu{
+ pub const arm1176jz_s = CpuModel{
.name = "arm1176jz_s",
.llvm_name = "arm1176jz-s",
.features = featureSet(&[_]Feature{
- .armv6kz,
+ .v6kz,
}),
};
- pub const arm1176jzf_s = Cpu{
+ pub const arm1176jzf_s = CpuModel{
.name = "arm1176jzf_s",
.llvm_name = "arm1176jzf-s",
.features = featureSet(&[_]Feature{
- .armv6kz,
+ .v6kz,
.slowfpvmlx,
.vfp2,
}),
};
- pub const arm710t = Cpu{
+ pub const arm710t = CpuModel{
.name = "arm710t",
.llvm_name = "arm710t",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm720t = Cpu{
+ pub const arm720t = CpuModel{
.name = "arm720t",
.llvm_name = "arm720t",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm7tdmi = Cpu{
+ pub const arm7tdmi = CpuModel{
.name = "arm7tdmi",
.llvm_name = "arm7tdmi",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm7tdmi_s = Cpu{
+ pub const arm7tdmi_s = CpuModel{
.name = "arm7tdmi_s",
.llvm_name = "arm7tdmi-s",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm8 = Cpu{
+ pub const arm8 = CpuModel{
.name = "arm8",
.llvm_name = "arm8",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const arm810 = Cpu{
+ pub const arm810 = CpuModel{
.name = "arm810",
.llvm_name = "arm810",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const arm9 = Cpu{
+ pub const arm9 = CpuModel{
.name = "arm9",
.llvm_name = "arm9",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm920 = Cpu{
+ pub const arm920 = CpuModel{
.name = "arm920",
.llvm_name = "arm920",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm920t = Cpu{
+ pub const arm920t = CpuModel{
.name = "arm920t",
.llvm_name = "arm920t",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm922t = Cpu{
+ pub const arm922t = CpuModel{
.name = "arm922t",
.llvm_name = "arm922t",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm926ej_s = Cpu{
+ pub const arm926ej_s = CpuModel{
.name = "arm926ej_s",
.llvm_name = "arm926ej-s",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm940t = Cpu{
+ pub const arm940t = CpuModel{
.name = "arm940t",
.llvm_name = "arm940t",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const arm946e_s = Cpu{
+ pub const arm946e_s = CpuModel{
.name = "arm946e_s",
.llvm_name = "arm946e-s",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm966e_s = Cpu{
+ pub const arm966e_s = CpuModel{
.name = "arm966e_s",
.llvm_name = "arm966e-s",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm968e_s = Cpu{
+ pub const arm968e_s = CpuModel{
.name = "arm968e_s",
.llvm_name = "arm968e-s",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm9e = Cpu{
+ pub const arm9e = CpuModel{
.name = "arm9e",
.llvm_name = "arm9e",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const arm9tdmi = Cpu{
+ pub const arm9tdmi = CpuModel{
.name = "arm9tdmi",
.llvm_name = "arm9tdmi",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
+ }),
+ };
+ pub const baseline = CpuModel{
+ .name = "baseline",
+ .llvm_name = "generic",
+ .features = featureSet(&[_]Feature{
+ .v6m,
}),
};
- pub const cortex_a12 = Cpu{
+ pub const cortex_a12 = CpuModel{
.name = "cortex_a12",
.llvm_name = "cortex-a12",
.features = featureSet(&[_]Feature{
- .a12,
- .armv7_a,
+ .v7a,
.avoid_partial_cpsr,
.mp,
.ret_addr_stack,
@@ -1639,12 +1526,11 @@ pub const cpu = struct {
.vmlx_forwarding,
}),
};
- pub const cortex_a15 = Cpu{
+ pub const cortex_a15 = CpuModel{
.name = "cortex_a15",
.llvm_name = "cortex-a15",
.features = featureSet(&[_]Feature{
- .a15,
- .armv7_a,
+ .v7a,
.avoid_partial_cpsr,
.dont_widen_vmovs,
.mp,
@@ -1657,12 +1543,11 @@ pub const cpu = struct {
.vldn_align,
}),
};
- pub const cortex_a17 = Cpu{
+ pub const cortex_a17 = CpuModel{
.name = "cortex_a17",
.llvm_name = "cortex-a17",
.features = featureSet(&[_]Feature{
- .a17,
- .armv7_a,
+ .v7a,
.avoid_partial_cpsr,
.mp,
.ret_addr_stack,
@@ -1672,35 +1557,33 @@ pub const cpu = struct {
.vmlx_forwarding,
}),
};
- pub const cortex_a32 = Cpu{
+ pub const cortex_a32 = CpuModel{
.name = "cortex_a32",
.llvm_name = "cortex-a32",
.features = featureSet(&[_]Feature{
- .armv8_a,
.crc,
.crypto,
.hwdiv,
.hwdiv_arm,
+ .v8a,
}),
};
- pub const cortex_a35 = Cpu{
+ pub const cortex_a35 = CpuModel{
.name = "cortex_a35",
.llvm_name = "cortex-a35",
.features = featureSet(&[_]Feature{
- .a35,
- .armv8_a,
.crc,
.crypto,
.hwdiv,
.hwdiv_arm,
+ .v8a,
}),
};
- pub const cortex_a5 = Cpu{
+ pub const cortex_a5 = CpuModel{
.name = "cortex_a5",
.llvm_name = "cortex-a5",
.features = featureSet(&[_]Feature{
- .a5,
- .armv7_a,
+ .v7a,
.mp,
.ret_addr_stack,
.slow_fp_brcc,
@@ -1710,12 +1593,11 @@ pub const cpu = struct {
.vmlx_forwarding,
}),
};
- pub const cortex_a53 = Cpu{
+ pub const cortex_a53 = CpuModel{
.name = "cortex_a53",
.llvm_name = "cortex-a53",
.features = featureSet(&[_]Feature{
- .a53,
- .armv8_a,
+ .v8a,
.crc,
.crypto,
.fpao,
@@ -1723,23 +1605,21 @@ pub const cpu = struct {
.hwdiv_arm,
}),
};
- pub const cortex_a55 = Cpu{
+ pub const cortex_a55 = CpuModel{
.name = "cortex_a55",
.llvm_name = "cortex-a55",
.features = featureSet(&[_]Feature{
- .a55,
- .armv8_2_a,
+ .v8_2a,
.dotprod,
.hwdiv,
.hwdiv_arm,
}),
};
- pub const cortex_a57 = Cpu{
+ pub const cortex_a57 = CpuModel{
.name = "cortex_a57",
.llvm_name = "cortex-a57",
.features = featureSet(&[_]Feature{
- .a57,
- .armv8_a,
+ .v8a,
.avoid_partial_cpsr,
.cheap_predicable_cpsr,
.crc,
@@ -1749,12 +1629,11 @@ pub const cpu = struct {
.hwdiv_arm,
}),
};
- pub const cortex_a7 = Cpu{
+ pub const cortex_a7 = CpuModel{
.name = "cortex_a7",
.llvm_name = "cortex-a7",
.features = featureSet(&[_]Feature{
- .a7,
- .armv7_a,
+ .v7a,
.mp,
.ret_addr_stack,
.slow_fp_brcc,
@@ -1766,47 +1645,44 @@ pub const cpu = struct {
.vmlx_hazards,
}),
};
- pub const cortex_a72 = Cpu{
+ pub const cortex_a72 = CpuModel{
.name = "cortex_a72",
.llvm_name = "cortex-a72",
.features = featureSet(&[_]Feature{
- .a72,
- .armv8_a,
+ .v8a,
.crc,
.crypto,
.hwdiv,
.hwdiv_arm,
}),
};
- pub const cortex_a73 = Cpu{
+ pub const cortex_a73 = CpuModel{
.name = "cortex_a73",
.llvm_name = "cortex-a73",
.features = featureSet(&[_]Feature{
- .a73,
- .armv8_a,
+ .v8a,
.crc,
.crypto,
.hwdiv,
.hwdiv_arm,
}),
};
- pub const cortex_a75 = Cpu{
+ pub const cortex_a75 = CpuModel{
.name = "cortex_a75",
.llvm_name = "cortex-a75",
.features = featureSet(&[_]Feature{
- .a75,
- .armv8_2_a,
+ .v8_2a,
.dotprod,
.hwdiv,
.hwdiv_arm,
}),
};
- pub const cortex_a76 = Cpu{
+ pub const cortex_a76 = CpuModel{
.name = "cortex_a76",
.llvm_name = "cortex-a76",
.features = featureSet(&[_]Feature{
.a76,
- .armv8_2_a,
+ .v8_2a,
.crc,
.crypto,
.dotprod,
@@ -1815,12 +1691,12 @@ pub const cpu = struct {
.hwdiv_arm,
}),
};
- pub const cortex_a76ae = Cpu{
+ pub const cortex_a76ae = CpuModel{
.name = "cortex_a76ae",
.llvm_name = "cortex-a76ae",
.features = featureSet(&[_]Feature{
.a76,
- .armv8_2_a,
+ .v8_2a,
.crc,
.crypto,
.dotprod,
@@ -1829,12 +1705,11 @@ pub const cpu = struct {
.hwdiv_arm,
}),
};
- pub const cortex_a8 = Cpu{
+ pub const cortex_a8 = CpuModel{
.name = "cortex_a8",
.llvm_name = "cortex-a8",
.features = featureSet(&[_]Feature{
- .a8,
- .armv7_a,
+ .v7a,
.nonpipelined_vfp,
.ret_addr_stack,
.slow_fp_brcc,
@@ -1844,12 +1719,11 @@ pub const cpu = struct {
.vmlx_hazards,
}),
};
- pub const cortex_a9 = Cpu{
+ pub const cortex_a9 = CpuModel{
.name = "cortex_a9",
.llvm_name = "cortex-a9",
.features = featureSet(&[_]Feature{
- .a9,
- .armv7_a,
+ .v7a,
.avoid_partial_cpsr,
.expand_fp_mlx,
.fp16,
@@ -1864,40 +1738,40 @@ pub const cpu = struct {
.vmlx_hazards,
}),
};
- pub const cortex_m0 = Cpu{
+ pub const cortex_m0 = CpuModel{
.name = "cortex_m0",
.llvm_name = "cortex-m0",
.features = featureSet(&[_]Feature{
- .armv6_m,
+ .v6m,
}),
};
- pub const cortex_m0plus = Cpu{
+ pub const cortex_m0plus = CpuModel{
.name = "cortex_m0plus",
.llvm_name = "cortex-m0plus",
.features = featureSet(&[_]Feature{
- .armv6_m,
+ .v6m,
}),
};
- pub const cortex_m1 = Cpu{
+ pub const cortex_m1 = CpuModel{
.name = "cortex_m1",
.llvm_name = "cortex-m1",
.features = featureSet(&[_]Feature{
- .armv6_m,
+ .v6m,
}),
};
- pub const cortex_m23 = Cpu{
+ pub const cortex_m23 = CpuModel{
.name = "cortex_m23",
.llvm_name = "cortex-m23",
.features = featureSet(&[_]Feature{
- .armv8_m_base,
+ .v8m,
.no_movt,
}),
};
- pub const cortex_m3 = Cpu{
+ pub const cortex_m3 = CpuModel{
.name = "cortex_m3",
.llvm_name = "cortex-m3",
.features = featureSet(&[_]Feature{
- .armv7_m,
+ .v7m,
.loop_align,
.m3,
.no_branch_predictor,
@@ -1905,11 +1779,11 @@ pub const cpu = struct {
.use_misched,
}),
};
- pub const cortex_m33 = Cpu{
+ pub const cortex_m33 = CpuModel{
.name = "cortex_m33",
.llvm_name = "cortex-m33",
.features = featureSet(&[_]Feature{
- .armv8_m_main,
+ .v8m_main,
.dsp,
.fp_armv8d16sp,
.loop_align,
@@ -1919,11 +1793,11 @@ pub const cpu = struct {
.use_misched,
}),
};
- pub const cortex_m35p = Cpu{
+ pub const cortex_m35p = CpuModel{
.name = "cortex_m35p",
.llvm_name = "cortex-m35p",
.features = featureSet(&[_]Feature{
- .armv8_m_main,
+ .v8m_main,
.dsp,
.fp_armv8d16sp,
.loop_align,
@@ -1933,11 +1807,11 @@ pub const cpu = struct {
.use_misched,
}),
};
- pub const cortex_m4 = Cpu{
+ pub const cortex_m4 = CpuModel{
.name = "cortex_m4",
.llvm_name = "cortex-m4",
.features = featureSet(&[_]Feature{
- .armv7e_m,
+ .v7em,
.loop_align,
.no_branch_predictor,
.slowfpvmlx,
@@ -1946,29 +1820,29 @@ pub const cpu = struct {
.vfp4d16sp,
}),
};
- pub const cortex_m7 = Cpu{
+ pub const cortex_m7 = CpuModel{
.name = "cortex_m7",
.llvm_name = "cortex-m7",
.features = featureSet(&[_]Feature{
- .armv7e_m,
+ .v7em,
.fp_armv8d16,
}),
};
- pub const cortex_r4 = Cpu{
+ pub const cortex_r4 = CpuModel{
.name = "cortex_r4",
.llvm_name = "cortex-r4",
.features = featureSet(&[_]Feature{
- .armv7_r,
+ .v7r,
.avoid_partial_cpsr,
.r4,
.ret_addr_stack,
}),
};
- pub const cortex_r4f = Cpu{
+ pub const cortex_r4f = CpuModel{
.name = "cortex_r4f",
.llvm_name = "cortex-r4f",
.features = featureSet(&[_]Feature{
- .armv7_r,
+ .v7r,
.avoid_partial_cpsr,
.r4,
.ret_addr_stack,
@@ -1977,52 +1851,49 @@ pub const cpu = struct {
.vfp3d16,
}),
};
- pub const cortex_r5 = Cpu{
+ pub const cortex_r5 = CpuModel{
.name = "cortex_r5",
.llvm_name = "cortex-r5",
.features = featureSet(&[_]Feature{
- .armv7_r,
+ .v7r,
.avoid_partial_cpsr,
.hwdiv_arm,
- .r5,
.ret_addr_stack,
.slow_fp_brcc,
.slowfpvmlx,
.vfp3d16,
}),
};
- pub const cortex_r52 = Cpu{
+ pub const cortex_r52 = CpuModel{
.name = "cortex_r52",
.llvm_name = "cortex-r52",
.features = featureSet(&[_]Feature{
- .armv8_r,
+ .v8r,
.fpao,
- .r52,
.use_aa,
.use_misched,
}),
};
- pub const cortex_r7 = Cpu{
+ pub const cortex_r7 = CpuModel{
.name = "cortex_r7",
.llvm_name = "cortex-r7",
.features = featureSet(&[_]Feature{
- .armv7_r,
+ .v7r,
.avoid_partial_cpsr,
.fp16,
.hwdiv_arm,
.mp,
- .r7,
.ret_addr_stack,
.slow_fp_brcc,
.slowfpvmlx,
.vfp3d16,
}),
};
- pub const cortex_r8 = Cpu{
+ pub const cortex_r8 = CpuModel{
.name = "cortex_r8",
.llvm_name = "cortex-r8",
.features = featureSet(&[_]Feature{
- .armv7_r,
+ .v7r,
.avoid_partial_cpsr,
.fp16,
.hwdiv_arm,
@@ -2033,11 +1904,11 @@ pub const cpu = struct {
.vfp3d16,
}),
};
- pub const cyclone = Cpu{
+ pub const cyclone = CpuModel{
.name = "cyclone",
.llvm_name = "cyclone",
.features = featureSet(&[_]Feature{
- .armv8_a,
+ .v8a,
.avoid_movs_shop,
.avoid_partial_cpsr,
.crypto,
@@ -2054,165 +1925,163 @@ pub const cpu = struct {
.zcz,
}),
};
- pub const ep9312 = Cpu{
+ pub const ep9312 = CpuModel{
.name = "ep9312",
.llvm_name = "ep9312",
.features = featureSet(&[_]Feature{
- .armv4t,
+ .v4t,
}),
};
- pub const exynos_m1 = Cpu{
+ pub const exynos_m1 = CpuModel{
.name = "exynos_m1",
.llvm_name = "exynos-m1",
.features = featureSet(&[_]Feature{
- .armv8_a,
+ .v8a,
.exynos,
}),
};
- pub const exynos_m2 = Cpu{
+ pub const exynos_m2 = CpuModel{
.name = "exynos_m2",
.llvm_name = "exynos-m2",
.features = featureSet(&[_]Feature{
- .armv8_a,
+ .v8a,
.exynos,
}),
};
- pub const exynos_m3 = Cpu{
+ pub const exynos_m3 = CpuModel{
.name = "exynos_m3",
.llvm_name = "exynos-m3",
.features = featureSet(&[_]Feature{
- .armv8_a,
+ .v8_2a,
.exynos,
}),
};
- pub const exynos_m4 = Cpu{
+ pub const exynos_m4 = CpuModel{
.name = "exynos_m4",
.llvm_name = "exynos-m4",
.features = featureSet(&[_]Feature{
- .armv8_2_a,
+ .v8_2a,
.dotprod,
.exynos,
.fullfp16,
}),
};
- pub const exynos_m5 = Cpu{
+ pub const exynos_m5 = CpuModel{
.name = "exynos_m5",
.llvm_name = "exynos-m5",
.features = featureSet(&[_]Feature{
- .armv8_2_a,
.dotprod,
.exynos,
.fullfp16,
+ .v8_2a,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const iwmmxt = Cpu{
+ pub const iwmmxt = CpuModel{
.name = "iwmmxt",
.llvm_name = "iwmmxt",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
- pub const krait = Cpu{
+ pub const krait = CpuModel{
.name = "krait",
.llvm_name = "krait",
.features = featureSet(&[_]Feature{
- .armv7_a,
.avoid_partial_cpsr,
.fp16,
.hwdiv,
.hwdiv_arm,
- .krait,
.muxed_units,
.ret_addr_stack,
+ .v7a,
.vfp4,
.vldn_align,
.vmlx_forwarding,
}),
};
- pub const kryo = Cpu{
+ pub const kryo = CpuModel{
.name = "kryo",
.llvm_name = "kryo",
.features = featureSet(&[_]Feature{
- .armv8_a,
.crc,
.crypto,
.hwdiv,
.hwdiv_arm,
- .kryo,
+ .v8a,
}),
};
- pub const mpcore = Cpu{
+ pub const mpcore = CpuModel{
.name = "mpcore",
.llvm_name = "mpcore",
.features = featureSet(&[_]Feature{
- .armv6k,
+ .v6k,
.slowfpvmlx,
.vfp2,
}),
};
- pub const mpcorenovfp = Cpu{
+ pub const mpcorenovfp = CpuModel{
.name = "mpcorenovfp",
.llvm_name = "mpcorenovfp",
.features = featureSet(&[_]Feature{
- .armv6k,
+ .v6k,
}),
};
- pub const sc000 = Cpu{
+ pub const sc000 = CpuModel{
.name = "sc000",
.llvm_name = "sc000",
.features = featureSet(&[_]Feature{
- .armv6_m,
+ .v6m,
}),
};
- pub const sc300 = Cpu{
+ pub const sc300 = CpuModel{
.name = "sc300",
.llvm_name = "sc300",
.features = featureSet(&[_]Feature{
- .armv7_m,
+ .v7m,
.m3,
.no_branch_predictor,
.use_aa,
.use_misched,
}),
};
- pub const strongarm = Cpu{
+ pub const strongarm = CpuModel{
.name = "strongarm",
.llvm_name = "strongarm",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const strongarm110 = Cpu{
+ pub const strongarm110 = CpuModel{
.name = "strongarm110",
.llvm_name = "strongarm110",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const strongarm1100 = Cpu{
+ pub const strongarm1100 = CpuModel{
.name = "strongarm1100",
.llvm_name = "strongarm1100",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const strongarm1110 = Cpu{
+ pub const strongarm1110 = CpuModel{
.name = "strongarm1110",
.llvm_name = "strongarm1110",
.features = featureSet(&[_]Feature{
- .armv4,
+ .v4,
}),
};
- pub const swift = Cpu{
+ pub const swift = CpuModel{
.name = "swift",
.llvm_name = "swift",
.features = featureSet(&[_]Feature{
- .armv7_a,
+ .v7a,
.avoid_movs_shop,
.avoid_partial_cpsr,
.disable_postra_scheduler,
@@ -2235,11 +2104,11 @@ pub const cpu = struct {
.wide_stride_vfp,
}),
};
- pub const xscale = Cpu{
+ pub const xscale = CpuModel{
.name = "xscale",
.llvm_name = "xscale",
.features = featureSet(&[_]Feature{
- .armv5te,
+ .v5te,
}),
};
};
@@ -2247,7 +2116,7 @@ pub const cpu = struct {
/// All arm CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.arm1020e,
&cpu.arm1020t,
&cpu.arm1022e,
diff --git a/lib/std/target/avr.zig b/lib/std/target/avr.zig
index 3902a3860f..4d0da9b2c3 100644
--- a/lib/std/target/avr.zig
+++ b/lib/std/target/avr.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
addsubiw,
@@ -37,12 +38,12 @@ pub const Feature = enum {
xmegau,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.addsubiw)] = .{
.llvm_name = "addsubiw",
.description = "Enable 16-bit register-immediate addition and subtraction instructions",
@@ -293,28 +294,28 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const at43usb320 = Cpu{
+ pub const at43usb320 = CpuModel{
.name = "at43usb320",
.llvm_name = "at43usb320",
.features = featureSet(&[_]Feature{
.avr31,
}),
};
- pub const at43usb355 = Cpu{
+ pub const at43usb355 = CpuModel{
.name = "at43usb355",
.llvm_name = "at43usb355",
.features = featureSet(&[_]Feature{
.avr3,
}),
};
- pub const at76c711 = Cpu{
+ pub const at76c711 = CpuModel{
.name = "at76c711",
.llvm_name = "at76c711",
.features = featureSet(&[_]Feature{
.avr3,
}),
};
- pub const at86rf401 = Cpu{
+ pub const at86rf401 = CpuModel{
.name = "at86rf401",
.llvm_name = "at86rf401",
.features = featureSet(&[_]Feature{
@@ -323,217 +324,217 @@ pub const cpu = struct {
.movw,
}),
};
- pub const at90c8534 = Cpu{
+ pub const at90c8534 = CpuModel{
.name = "at90c8534",
.llvm_name = "at90c8534",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90can128 = Cpu{
+ pub const at90can128 = CpuModel{
.name = "at90can128",
.llvm_name = "at90can128",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const at90can32 = Cpu{
+ pub const at90can32 = CpuModel{
.name = "at90can32",
.llvm_name = "at90can32",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90can64 = Cpu{
+ pub const at90can64 = CpuModel{
.name = "at90can64",
.llvm_name = "at90can64",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90pwm1 = Cpu{
+ pub const at90pwm1 = CpuModel{
.name = "at90pwm1",
.llvm_name = "at90pwm1",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90pwm161 = Cpu{
+ pub const at90pwm161 = CpuModel{
.name = "at90pwm161",
.llvm_name = "at90pwm161",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90pwm2 = Cpu{
+ pub const at90pwm2 = CpuModel{
.name = "at90pwm2",
.llvm_name = "at90pwm2",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90pwm216 = Cpu{
+ pub const at90pwm216 = CpuModel{
.name = "at90pwm216",
.llvm_name = "at90pwm216",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90pwm2b = Cpu{
+ pub const at90pwm2b = CpuModel{
.name = "at90pwm2b",
.llvm_name = "at90pwm2b",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90pwm3 = Cpu{
+ pub const at90pwm3 = CpuModel{
.name = "at90pwm3",
.llvm_name = "at90pwm3",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90pwm316 = Cpu{
+ pub const at90pwm316 = CpuModel{
.name = "at90pwm316",
.llvm_name = "at90pwm316",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90pwm3b = Cpu{
+ pub const at90pwm3b = CpuModel{
.name = "at90pwm3b",
.llvm_name = "at90pwm3b",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90pwm81 = Cpu{
+ pub const at90pwm81 = CpuModel{
.name = "at90pwm81",
.llvm_name = "at90pwm81",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const at90s1200 = Cpu{
+ pub const at90s1200 = CpuModel{
.name = "at90s1200",
.llvm_name = "at90s1200",
.features = featureSet(&[_]Feature{
.avr0,
}),
};
- pub const at90s2313 = Cpu{
+ pub const at90s2313 = CpuModel{
.name = "at90s2313",
.llvm_name = "at90s2313",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s2323 = Cpu{
+ pub const at90s2323 = CpuModel{
.name = "at90s2323",
.llvm_name = "at90s2323",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s2333 = Cpu{
+ pub const at90s2333 = CpuModel{
.name = "at90s2333",
.llvm_name = "at90s2333",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s2343 = Cpu{
+ pub const at90s2343 = CpuModel{
.name = "at90s2343",
.llvm_name = "at90s2343",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s4414 = Cpu{
+ pub const at90s4414 = CpuModel{
.name = "at90s4414",
.llvm_name = "at90s4414",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s4433 = Cpu{
+ pub const at90s4433 = CpuModel{
.name = "at90s4433",
.llvm_name = "at90s4433",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s4434 = Cpu{
+ pub const at90s4434 = CpuModel{
.name = "at90s4434",
.llvm_name = "at90s4434",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s8515 = Cpu{
+ pub const at90s8515 = CpuModel{
.name = "at90s8515",
.llvm_name = "at90s8515",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90s8535 = Cpu{
+ pub const at90s8535 = CpuModel{
.name = "at90s8535",
.llvm_name = "at90s8535",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const at90scr100 = Cpu{
+ pub const at90scr100 = CpuModel{
.name = "at90scr100",
.llvm_name = "at90scr100",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90usb1286 = Cpu{
+ pub const at90usb1286 = CpuModel{
.name = "at90usb1286",
.llvm_name = "at90usb1286",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const at90usb1287 = Cpu{
+ pub const at90usb1287 = CpuModel{
.name = "at90usb1287",
.llvm_name = "at90usb1287",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const at90usb162 = Cpu{
+ pub const at90usb162 = CpuModel{
.name = "at90usb162",
.llvm_name = "at90usb162",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const at90usb646 = Cpu{
+ pub const at90usb646 = CpuModel{
.name = "at90usb646",
.llvm_name = "at90usb646",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90usb647 = Cpu{
+ pub const at90usb647 = CpuModel{
.name = "at90usb647",
.llvm_name = "at90usb647",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const at90usb82 = Cpu{
+ pub const at90usb82 = CpuModel{
.name = "at90usb82",
.llvm_name = "at90usb82",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const at94k = Cpu{
+ pub const at94k = CpuModel{
.name = "at94k",
.llvm_name = "at94k",
.features = featureSet(&[_]Feature{
@@ -543,133 +544,133 @@ pub const cpu = struct {
.mul,
}),
};
- pub const ata5272 = Cpu{
+ pub const ata5272 = CpuModel{
.name = "ata5272",
.llvm_name = "ata5272",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const ata5505 = Cpu{
+ pub const ata5505 = CpuModel{
.name = "ata5505",
.llvm_name = "ata5505",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const ata5790 = Cpu{
+ pub const ata5790 = CpuModel{
.name = "ata5790",
.llvm_name = "ata5790",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const ata5795 = Cpu{
+ pub const ata5795 = CpuModel{
.name = "ata5795",
.llvm_name = "ata5795",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const ata6285 = Cpu{
+ pub const ata6285 = CpuModel{
.name = "ata6285",
.llvm_name = "ata6285",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const ata6286 = Cpu{
+ pub const ata6286 = CpuModel{
.name = "ata6286",
.llvm_name = "ata6286",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const ata6289 = Cpu{
+ pub const ata6289 = CpuModel{
.name = "ata6289",
.llvm_name = "ata6289",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega103 = Cpu{
+ pub const atmega103 = CpuModel{
.name = "atmega103",
.llvm_name = "atmega103",
.features = featureSet(&[_]Feature{
.avr31,
}),
};
- pub const atmega128 = Cpu{
+ pub const atmega128 = CpuModel{
.name = "atmega128",
.llvm_name = "atmega128",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega1280 = Cpu{
+ pub const atmega1280 = CpuModel{
.name = "atmega1280",
.llvm_name = "atmega1280",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega1281 = Cpu{
+ pub const atmega1281 = CpuModel{
.name = "atmega1281",
.llvm_name = "atmega1281",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega1284 = Cpu{
+ pub const atmega1284 = CpuModel{
.name = "atmega1284",
.llvm_name = "atmega1284",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega1284p = Cpu{
+ pub const atmega1284p = CpuModel{
.name = "atmega1284p",
.llvm_name = "atmega1284p",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega1284rfr2 = Cpu{
+ pub const atmega1284rfr2 = CpuModel{
.name = "atmega1284rfr2",
.llvm_name = "atmega1284rfr2",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega128a = Cpu{
+ pub const atmega128a = CpuModel{
.name = "atmega128a",
.llvm_name = "atmega128a",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega128rfa1 = Cpu{
+ pub const atmega128rfa1 = CpuModel{
.name = "atmega128rfa1",
.llvm_name = "atmega128rfa1",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega128rfr2 = Cpu{
+ pub const atmega128rfr2 = CpuModel{
.name = "atmega128rfr2",
.llvm_name = "atmega128rfr2",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const atmega16 = Cpu{
+ pub const atmega16 = CpuModel{
.name = "atmega16",
.llvm_name = "atmega16",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega161 = Cpu{
+ pub const atmega161 = CpuModel{
.name = "atmega161",
.llvm_name = "atmega161",
.features = featureSet(&[_]Feature{
@@ -680,14 +681,14 @@ pub const cpu = struct {
.spm,
}),
};
- pub const atmega162 = Cpu{
+ pub const atmega162 = CpuModel{
.name = "atmega162",
.llvm_name = "atmega162",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega163 = Cpu{
+ pub const atmega163 = CpuModel{
.name = "atmega163",
.llvm_name = "atmega163",
.features = featureSet(&[_]Feature{
@@ -698,623 +699,623 @@ pub const cpu = struct {
.spm,
}),
};
- pub const atmega164a = Cpu{
+ pub const atmega164a = CpuModel{
.name = "atmega164a",
.llvm_name = "atmega164a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega164p = Cpu{
+ pub const atmega164p = CpuModel{
.name = "atmega164p",
.llvm_name = "atmega164p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega164pa = Cpu{
+ pub const atmega164pa = CpuModel{
.name = "atmega164pa",
.llvm_name = "atmega164pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega165 = Cpu{
+ pub const atmega165 = CpuModel{
.name = "atmega165",
.llvm_name = "atmega165",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega165a = Cpu{
+ pub const atmega165a = CpuModel{
.name = "atmega165a",
.llvm_name = "atmega165a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega165p = Cpu{
+ pub const atmega165p = CpuModel{
.name = "atmega165p",
.llvm_name = "atmega165p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega165pa = Cpu{
+ pub const atmega165pa = CpuModel{
.name = "atmega165pa",
.llvm_name = "atmega165pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega168 = Cpu{
+ pub const atmega168 = CpuModel{
.name = "atmega168",
.llvm_name = "atmega168",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega168a = Cpu{
+ pub const atmega168a = CpuModel{
.name = "atmega168a",
.llvm_name = "atmega168a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega168p = Cpu{
+ pub const atmega168p = CpuModel{
.name = "atmega168p",
.llvm_name = "atmega168p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega168pa = Cpu{
+ pub const atmega168pa = CpuModel{
.name = "atmega168pa",
.llvm_name = "atmega168pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega169 = Cpu{
+ pub const atmega169 = CpuModel{
.name = "atmega169",
.llvm_name = "atmega169",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega169a = Cpu{
+ pub const atmega169a = CpuModel{
.name = "atmega169a",
.llvm_name = "atmega169a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega169p = Cpu{
+ pub const atmega169p = CpuModel{
.name = "atmega169p",
.llvm_name = "atmega169p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega169pa = Cpu{
+ pub const atmega169pa = CpuModel{
.name = "atmega169pa",
.llvm_name = "atmega169pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16a = Cpu{
+ pub const atmega16a = CpuModel{
.name = "atmega16a",
.llvm_name = "atmega16a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16hva = Cpu{
+ pub const atmega16hva = CpuModel{
.name = "atmega16hva",
.llvm_name = "atmega16hva",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16hva2 = Cpu{
+ pub const atmega16hva2 = CpuModel{
.name = "atmega16hva2",
.llvm_name = "atmega16hva2",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16hvb = Cpu{
+ pub const atmega16hvb = CpuModel{
.name = "atmega16hvb",
.llvm_name = "atmega16hvb",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16hvbrevb = Cpu{
+ pub const atmega16hvbrevb = CpuModel{
.name = "atmega16hvbrevb",
.llvm_name = "atmega16hvbrevb",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16m1 = Cpu{
+ pub const atmega16m1 = CpuModel{
.name = "atmega16m1",
.llvm_name = "atmega16m1",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega16u2 = Cpu{
+ pub const atmega16u2 = CpuModel{
.name = "atmega16u2",
.llvm_name = "atmega16u2",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const atmega16u4 = Cpu{
+ pub const atmega16u4 = CpuModel{
.name = "atmega16u4",
.llvm_name = "atmega16u4",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega2560 = Cpu{
+ pub const atmega2560 = CpuModel{
.name = "atmega2560",
.llvm_name = "atmega2560",
.features = featureSet(&[_]Feature{
.avr6,
}),
};
- pub const atmega2561 = Cpu{
+ pub const atmega2561 = CpuModel{
.name = "atmega2561",
.llvm_name = "atmega2561",
.features = featureSet(&[_]Feature{
.avr6,
}),
};
- pub const atmega2564rfr2 = Cpu{
+ pub const atmega2564rfr2 = CpuModel{
.name = "atmega2564rfr2",
.llvm_name = "atmega2564rfr2",
.features = featureSet(&[_]Feature{
.avr6,
}),
};
- pub const atmega256rfr2 = Cpu{
+ pub const atmega256rfr2 = CpuModel{
.name = "atmega256rfr2",
.llvm_name = "atmega256rfr2",
.features = featureSet(&[_]Feature{
.avr6,
}),
};
- pub const atmega32 = Cpu{
+ pub const atmega32 = CpuModel{
.name = "atmega32",
.llvm_name = "atmega32",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega323 = Cpu{
+ pub const atmega323 = CpuModel{
.name = "atmega323",
.llvm_name = "atmega323",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega324a = Cpu{
+ pub const atmega324a = CpuModel{
.name = "atmega324a",
.llvm_name = "atmega324a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega324p = Cpu{
+ pub const atmega324p = CpuModel{
.name = "atmega324p",
.llvm_name = "atmega324p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega324pa = Cpu{
+ pub const atmega324pa = CpuModel{
.name = "atmega324pa",
.llvm_name = "atmega324pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega325 = Cpu{
+ pub const atmega325 = CpuModel{
.name = "atmega325",
.llvm_name = "atmega325",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3250 = Cpu{
+ pub const atmega3250 = CpuModel{
.name = "atmega3250",
.llvm_name = "atmega3250",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3250a = Cpu{
+ pub const atmega3250a = CpuModel{
.name = "atmega3250a",
.llvm_name = "atmega3250a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3250p = Cpu{
+ pub const atmega3250p = CpuModel{
.name = "atmega3250p",
.llvm_name = "atmega3250p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3250pa = Cpu{
+ pub const atmega3250pa = CpuModel{
.name = "atmega3250pa",
.llvm_name = "atmega3250pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega325a = Cpu{
+ pub const atmega325a = CpuModel{
.name = "atmega325a",
.llvm_name = "atmega325a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega325p = Cpu{
+ pub const atmega325p = CpuModel{
.name = "atmega325p",
.llvm_name = "atmega325p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega325pa = Cpu{
+ pub const atmega325pa = CpuModel{
.name = "atmega325pa",
.llvm_name = "atmega325pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega328 = Cpu{
+ pub const atmega328 = CpuModel{
.name = "atmega328",
.llvm_name = "atmega328",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega328p = Cpu{
+ pub const atmega328p = CpuModel{
.name = "atmega328p",
.llvm_name = "atmega328p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega329 = Cpu{
+ pub const atmega329 = CpuModel{
.name = "atmega329",
.llvm_name = "atmega329",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3290 = Cpu{
+ pub const atmega3290 = CpuModel{
.name = "atmega3290",
.llvm_name = "atmega3290",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3290a = Cpu{
+ pub const atmega3290a = CpuModel{
.name = "atmega3290a",
.llvm_name = "atmega3290a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3290p = Cpu{
+ pub const atmega3290p = CpuModel{
.name = "atmega3290p",
.llvm_name = "atmega3290p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega3290pa = Cpu{
+ pub const atmega3290pa = CpuModel{
.name = "atmega3290pa",
.llvm_name = "atmega3290pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega329a = Cpu{
+ pub const atmega329a = CpuModel{
.name = "atmega329a",
.llvm_name = "atmega329a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega329p = Cpu{
+ pub const atmega329p = CpuModel{
.name = "atmega329p",
.llvm_name = "atmega329p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega329pa = Cpu{
+ pub const atmega329pa = CpuModel{
.name = "atmega329pa",
.llvm_name = "atmega329pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32a = Cpu{
+ pub const atmega32a = CpuModel{
.name = "atmega32a",
.llvm_name = "atmega32a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32c1 = Cpu{
+ pub const atmega32c1 = CpuModel{
.name = "atmega32c1",
.llvm_name = "atmega32c1",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32hvb = Cpu{
+ pub const atmega32hvb = CpuModel{
.name = "atmega32hvb",
.llvm_name = "atmega32hvb",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32hvbrevb = Cpu{
+ pub const atmega32hvbrevb = CpuModel{
.name = "atmega32hvbrevb",
.llvm_name = "atmega32hvbrevb",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32m1 = Cpu{
+ pub const atmega32m1 = CpuModel{
.name = "atmega32m1",
.llvm_name = "atmega32m1",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32u2 = Cpu{
+ pub const atmega32u2 = CpuModel{
.name = "atmega32u2",
.llvm_name = "atmega32u2",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const atmega32u4 = Cpu{
+ pub const atmega32u4 = CpuModel{
.name = "atmega32u4",
.llvm_name = "atmega32u4",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega32u6 = Cpu{
+ pub const atmega32u6 = CpuModel{
.name = "atmega32u6",
.llvm_name = "atmega32u6",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega406 = Cpu{
+ pub const atmega406 = CpuModel{
.name = "atmega406",
.llvm_name = "atmega406",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega48 = Cpu{
+ pub const atmega48 = CpuModel{
.name = "atmega48",
.llvm_name = "atmega48",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega48a = Cpu{
+ pub const atmega48a = CpuModel{
.name = "atmega48a",
.llvm_name = "atmega48a",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega48p = Cpu{
+ pub const atmega48p = CpuModel{
.name = "atmega48p",
.llvm_name = "atmega48p",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega48pa = Cpu{
+ pub const atmega48pa = CpuModel{
.name = "atmega48pa",
.llvm_name = "atmega48pa",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega64 = Cpu{
+ pub const atmega64 = CpuModel{
.name = "atmega64",
.llvm_name = "atmega64",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega640 = Cpu{
+ pub const atmega640 = CpuModel{
.name = "atmega640",
.llvm_name = "atmega640",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega644 = Cpu{
+ pub const atmega644 = CpuModel{
.name = "atmega644",
.llvm_name = "atmega644",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega644a = Cpu{
+ pub const atmega644a = CpuModel{
.name = "atmega644a",
.llvm_name = "atmega644a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega644p = Cpu{
+ pub const atmega644p = CpuModel{
.name = "atmega644p",
.llvm_name = "atmega644p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega644pa = Cpu{
+ pub const atmega644pa = CpuModel{
.name = "atmega644pa",
.llvm_name = "atmega644pa",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega644rfr2 = Cpu{
+ pub const atmega644rfr2 = CpuModel{
.name = "atmega644rfr2",
.llvm_name = "atmega644rfr2",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega645 = Cpu{
+ pub const atmega645 = CpuModel{
.name = "atmega645",
.llvm_name = "atmega645",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6450 = Cpu{
+ pub const atmega6450 = CpuModel{
.name = "atmega6450",
.llvm_name = "atmega6450",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6450a = Cpu{
+ pub const atmega6450a = CpuModel{
.name = "atmega6450a",
.llvm_name = "atmega6450a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6450p = Cpu{
+ pub const atmega6450p = CpuModel{
.name = "atmega6450p",
.llvm_name = "atmega6450p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega645a = Cpu{
+ pub const atmega645a = CpuModel{
.name = "atmega645a",
.llvm_name = "atmega645a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega645p = Cpu{
+ pub const atmega645p = CpuModel{
.name = "atmega645p",
.llvm_name = "atmega645p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega649 = Cpu{
+ pub const atmega649 = CpuModel{
.name = "atmega649",
.llvm_name = "atmega649",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6490 = Cpu{
+ pub const atmega6490 = CpuModel{
.name = "atmega6490",
.llvm_name = "atmega6490",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6490a = Cpu{
+ pub const atmega6490a = CpuModel{
.name = "atmega6490a",
.llvm_name = "atmega6490a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega6490p = Cpu{
+ pub const atmega6490p = CpuModel{
.name = "atmega6490p",
.llvm_name = "atmega6490p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega649a = Cpu{
+ pub const atmega649a = CpuModel{
.name = "atmega649a",
.llvm_name = "atmega649a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega649p = Cpu{
+ pub const atmega649p = CpuModel{
.name = "atmega649p",
.llvm_name = "atmega649p",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega64a = Cpu{
+ pub const atmega64a = CpuModel{
.name = "atmega64a",
.llvm_name = "atmega64a",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega64c1 = Cpu{
+ pub const atmega64c1 = CpuModel{
.name = "atmega64c1",
.llvm_name = "atmega64c1",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega64hve = Cpu{
+ pub const atmega64hve = CpuModel{
.name = "atmega64hve",
.llvm_name = "atmega64hve",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega64m1 = Cpu{
+ pub const atmega64m1 = CpuModel{
.name = "atmega64m1",
.llvm_name = "atmega64m1",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega64rfr2 = Cpu{
+ pub const atmega64rfr2 = CpuModel{
.name = "atmega64rfr2",
.llvm_name = "atmega64rfr2",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const atmega8 = Cpu{
+ pub const atmega8 = CpuModel{
.name = "atmega8",
.llvm_name = "atmega8",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega8515 = Cpu{
+ pub const atmega8515 = CpuModel{
.name = "atmega8515",
.llvm_name = "atmega8515",
.features = featureSet(&[_]Feature{
@@ -1325,7 +1326,7 @@ pub const cpu = struct {
.spm,
}),
};
- pub const atmega8535 = Cpu{
+ pub const atmega8535 = CpuModel{
.name = "atmega8535",
.llvm_name = "atmega8535",
.features = featureSet(&[_]Feature{
@@ -1336,175 +1337,175 @@ pub const cpu = struct {
.spm,
}),
};
- pub const atmega88 = Cpu{
+ pub const atmega88 = CpuModel{
.name = "atmega88",
.llvm_name = "atmega88",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega88a = Cpu{
+ pub const atmega88a = CpuModel{
.name = "atmega88a",
.llvm_name = "atmega88a",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega88p = Cpu{
+ pub const atmega88p = CpuModel{
.name = "atmega88p",
.llvm_name = "atmega88p",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega88pa = Cpu{
+ pub const atmega88pa = CpuModel{
.name = "atmega88pa",
.llvm_name = "atmega88pa",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega8a = Cpu{
+ pub const atmega8a = CpuModel{
.name = "atmega8a",
.llvm_name = "atmega8a",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega8hva = Cpu{
+ pub const atmega8hva = CpuModel{
.name = "atmega8hva",
.llvm_name = "atmega8hva",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const atmega8u2 = Cpu{
+ pub const atmega8u2 = CpuModel{
.name = "atmega8u2",
.llvm_name = "atmega8u2",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const attiny10 = Cpu{
+ pub const attiny10 = CpuModel{
.name = "attiny10",
.llvm_name = "attiny10",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny102 = Cpu{
+ pub const attiny102 = CpuModel{
.name = "attiny102",
.llvm_name = "attiny102",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny104 = Cpu{
+ pub const attiny104 = CpuModel{
.name = "attiny104",
.llvm_name = "attiny104",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny11 = Cpu{
+ pub const attiny11 = CpuModel{
.name = "attiny11",
.llvm_name = "attiny11",
.features = featureSet(&[_]Feature{
.avr1,
}),
};
- pub const attiny12 = Cpu{
+ pub const attiny12 = CpuModel{
.name = "attiny12",
.llvm_name = "attiny12",
.features = featureSet(&[_]Feature{
.avr1,
}),
};
- pub const attiny13 = Cpu{
+ pub const attiny13 = CpuModel{
.name = "attiny13",
.llvm_name = "attiny13",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny13a = Cpu{
+ pub const attiny13a = CpuModel{
.name = "attiny13a",
.llvm_name = "attiny13a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny15 = Cpu{
+ pub const attiny15 = CpuModel{
.name = "attiny15",
.llvm_name = "attiny15",
.features = featureSet(&[_]Feature{
.avr1,
}),
};
- pub const attiny1634 = Cpu{
+ pub const attiny1634 = CpuModel{
.name = "attiny1634",
.llvm_name = "attiny1634",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const attiny167 = Cpu{
+ pub const attiny167 = CpuModel{
.name = "attiny167",
.llvm_name = "attiny167",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const attiny20 = Cpu{
+ pub const attiny20 = CpuModel{
.name = "attiny20",
.llvm_name = "attiny20",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny22 = Cpu{
+ pub const attiny22 = CpuModel{
.name = "attiny22",
.llvm_name = "attiny22",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const attiny2313 = Cpu{
+ pub const attiny2313 = CpuModel{
.name = "attiny2313",
.llvm_name = "attiny2313",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny2313a = Cpu{
+ pub const attiny2313a = CpuModel{
.name = "attiny2313a",
.llvm_name = "attiny2313a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny24 = Cpu{
+ pub const attiny24 = CpuModel{
.name = "attiny24",
.llvm_name = "attiny24",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny24a = Cpu{
+ pub const attiny24a = CpuModel{
.name = "attiny24a",
.llvm_name = "attiny24a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny25 = Cpu{
+ pub const attiny25 = CpuModel{
.name = "attiny25",
.llvm_name = "attiny25",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny26 = Cpu{
+ pub const attiny26 = CpuModel{
.name = "attiny26",
.llvm_name = "attiny26",
.features = featureSet(&[_]Feature{
@@ -1512,602 +1513,602 @@ pub const cpu = struct {
.lpmx,
}),
};
- pub const attiny261 = Cpu{
+ pub const attiny261 = CpuModel{
.name = "attiny261",
.llvm_name = "attiny261",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny261a = Cpu{
+ pub const attiny261a = CpuModel{
.name = "attiny261a",
.llvm_name = "attiny261a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny28 = Cpu{
+ pub const attiny28 = CpuModel{
.name = "attiny28",
.llvm_name = "attiny28",
.features = featureSet(&[_]Feature{
.avr1,
}),
};
- pub const attiny4 = Cpu{
+ pub const attiny4 = CpuModel{
.name = "attiny4",
.llvm_name = "attiny4",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny40 = Cpu{
+ pub const attiny40 = CpuModel{
.name = "attiny40",
.llvm_name = "attiny40",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny4313 = Cpu{
+ pub const attiny4313 = CpuModel{
.name = "attiny4313",
.llvm_name = "attiny4313",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny43u = Cpu{
+ pub const attiny43u = CpuModel{
.name = "attiny43u",
.llvm_name = "attiny43u",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny44 = Cpu{
+ pub const attiny44 = CpuModel{
.name = "attiny44",
.llvm_name = "attiny44",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny44a = Cpu{
+ pub const attiny44a = CpuModel{
.name = "attiny44a",
.llvm_name = "attiny44a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny45 = Cpu{
+ pub const attiny45 = CpuModel{
.name = "attiny45",
.llvm_name = "attiny45",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny461 = Cpu{
+ pub const attiny461 = CpuModel{
.name = "attiny461",
.llvm_name = "attiny461",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny461a = Cpu{
+ pub const attiny461a = CpuModel{
.name = "attiny461a",
.llvm_name = "attiny461a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny48 = Cpu{
+ pub const attiny48 = CpuModel{
.name = "attiny48",
.llvm_name = "attiny48",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny5 = Cpu{
+ pub const attiny5 = CpuModel{
.name = "attiny5",
.llvm_name = "attiny5",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const attiny828 = Cpu{
+ pub const attiny828 = CpuModel{
.name = "attiny828",
.llvm_name = "attiny828",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny84 = Cpu{
+ pub const attiny84 = CpuModel{
.name = "attiny84",
.llvm_name = "attiny84",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny84a = Cpu{
+ pub const attiny84a = CpuModel{
.name = "attiny84a",
.llvm_name = "attiny84a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny85 = Cpu{
+ pub const attiny85 = CpuModel{
.name = "attiny85",
.llvm_name = "attiny85",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny861 = Cpu{
+ pub const attiny861 = CpuModel{
.name = "attiny861",
.llvm_name = "attiny861",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny861a = Cpu{
+ pub const attiny861a = CpuModel{
.name = "attiny861a",
.llvm_name = "attiny861a",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny87 = Cpu{
+ pub const attiny87 = CpuModel{
.name = "attiny87",
.llvm_name = "attiny87",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny88 = Cpu{
+ pub const attiny88 = CpuModel{
.name = "attiny88",
.llvm_name = "attiny88",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const attiny9 = Cpu{
+ pub const attiny9 = CpuModel{
.name = "attiny9",
.llvm_name = "attiny9",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const atxmega128a1 = Cpu{
+ pub const atxmega128a1 = CpuModel{
.name = "atxmega128a1",
.llvm_name = "atxmega128a1",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega128a1u = Cpu{
+ pub const atxmega128a1u = CpuModel{
.name = "atxmega128a1u",
.llvm_name = "atxmega128a1u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128a3 = Cpu{
+ pub const atxmega128a3 = CpuModel{
.name = "atxmega128a3",
.llvm_name = "atxmega128a3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega128a3u = Cpu{
+ pub const atxmega128a3u = CpuModel{
.name = "atxmega128a3u",
.llvm_name = "atxmega128a3u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128a4u = Cpu{
+ pub const atxmega128a4u = CpuModel{
.name = "atxmega128a4u",
.llvm_name = "atxmega128a4u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128b1 = Cpu{
+ pub const atxmega128b1 = CpuModel{
.name = "atxmega128b1",
.llvm_name = "atxmega128b1",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128b3 = Cpu{
+ pub const atxmega128b3 = CpuModel{
.name = "atxmega128b3",
.llvm_name = "atxmega128b3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128c3 = Cpu{
+ pub const atxmega128c3 = CpuModel{
.name = "atxmega128c3",
.llvm_name = "atxmega128c3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega128d3 = Cpu{
+ pub const atxmega128d3 = CpuModel{
.name = "atxmega128d3",
.llvm_name = "atxmega128d3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega128d4 = Cpu{
+ pub const atxmega128d4 = CpuModel{
.name = "atxmega128d4",
.llvm_name = "atxmega128d4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega16a4 = Cpu{
+ pub const atxmega16a4 = CpuModel{
.name = "atxmega16a4",
.llvm_name = "atxmega16a4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega16a4u = Cpu{
+ pub const atxmega16a4u = CpuModel{
.name = "atxmega16a4u",
.llvm_name = "atxmega16a4u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega16c4 = Cpu{
+ pub const atxmega16c4 = CpuModel{
.name = "atxmega16c4",
.llvm_name = "atxmega16c4",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega16d4 = Cpu{
+ pub const atxmega16d4 = CpuModel{
.name = "atxmega16d4",
.llvm_name = "atxmega16d4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega16e5 = Cpu{
+ pub const atxmega16e5 = CpuModel{
.name = "atxmega16e5",
.llvm_name = "atxmega16e5",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega192a3 = Cpu{
+ pub const atxmega192a3 = CpuModel{
.name = "atxmega192a3",
.llvm_name = "atxmega192a3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega192a3u = Cpu{
+ pub const atxmega192a3u = CpuModel{
.name = "atxmega192a3u",
.llvm_name = "atxmega192a3u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega192c3 = Cpu{
+ pub const atxmega192c3 = CpuModel{
.name = "atxmega192c3",
.llvm_name = "atxmega192c3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega192d3 = Cpu{
+ pub const atxmega192d3 = CpuModel{
.name = "atxmega192d3",
.llvm_name = "atxmega192d3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega256a3 = Cpu{
+ pub const atxmega256a3 = CpuModel{
.name = "atxmega256a3",
.llvm_name = "atxmega256a3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega256a3b = Cpu{
+ pub const atxmega256a3b = CpuModel{
.name = "atxmega256a3b",
.llvm_name = "atxmega256a3b",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega256a3bu = Cpu{
+ pub const atxmega256a3bu = CpuModel{
.name = "atxmega256a3bu",
.llvm_name = "atxmega256a3bu",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega256a3u = Cpu{
+ pub const atxmega256a3u = CpuModel{
.name = "atxmega256a3u",
.llvm_name = "atxmega256a3u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega256c3 = Cpu{
+ pub const atxmega256c3 = CpuModel{
.name = "atxmega256c3",
.llvm_name = "atxmega256c3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega256d3 = Cpu{
+ pub const atxmega256d3 = CpuModel{
.name = "atxmega256d3",
.llvm_name = "atxmega256d3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega32a4 = Cpu{
+ pub const atxmega32a4 = CpuModel{
.name = "atxmega32a4",
.llvm_name = "atxmega32a4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega32a4u = Cpu{
+ pub const atxmega32a4u = CpuModel{
.name = "atxmega32a4u",
.llvm_name = "atxmega32a4u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega32c4 = Cpu{
+ pub const atxmega32c4 = CpuModel{
.name = "atxmega32c4",
.llvm_name = "atxmega32c4",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega32d4 = Cpu{
+ pub const atxmega32d4 = CpuModel{
.name = "atxmega32d4",
.llvm_name = "atxmega32d4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega32e5 = Cpu{
+ pub const atxmega32e5 = CpuModel{
.name = "atxmega32e5",
.llvm_name = "atxmega32e5",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega32x1 = Cpu{
+ pub const atxmega32x1 = CpuModel{
.name = "atxmega32x1",
.llvm_name = "atxmega32x1",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega384c3 = Cpu{
+ pub const atxmega384c3 = CpuModel{
.name = "atxmega384c3",
.llvm_name = "atxmega384c3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega384d3 = Cpu{
+ pub const atxmega384d3 = CpuModel{
.name = "atxmega384d3",
.llvm_name = "atxmega384d3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega64a1 = Cpu{
+ pub const atxmega64a1 = CpuModel{
.name = "atxmega64a1",
.llvm_name = "atxmega64a1",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega64a1u = Cpu{
+ pub const atxmega64a1u = CpuModel{
.name = "atxmega64a1u",
.llvm_name = "atxmega64a1u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64a3 = Cpu{
+ pub const atxmega64a3 = CpuModel{
.name = "atxmega64a3",
.llvm_name = "atxmega64a3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega64a3u = Cpu{
+ pub const atxmega64a3u = CpuModel{
.name = "atxmega64a3u",
.llvm_name = "atxmega64a3u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64a4u = Cpu{
+ pub const atxmega64a4u = CpuModel{
.name = "atxmega64a4u",
.llvm_name = "atxmega64a4u",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64b1 = Cpu{
+ pub const atxmega64b1 = CpuModel{
.name = "atxmega64b1",
.llvm_name = "atxmega64b1",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64b3 = Cpu{
+ pub const atxmega64b3 = CpuModel{
.name = "atxmega64b3",
.llvm_name = "atxmega64b3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64c3 = Cpu{
+ pub const atxmega64c3 = CpuModel{
.name = "atxmega64c3",
.llvm_name = "atxmega64c3",
.features = featureSet(&[_]Feature{
.xmegau,
}),
};
- pub const atxmega64d3 = Cpu{
+ pub const atxmega64d3 = CpuModel{
.name = "atxmega64d3",
.llvm_name = "atxmega64d3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega64d4 = Cpu{
+ pub const atxmega64d4 = CpuModel{
.name = "atxmega64d4",
.llvm_name = "atxmega64d4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const atxmega8e5 = Cpu{
+ pub const atxmega8e5 = CpuModel{
.name = "atxmega8e5",
.llvm_name = "atxmega8e5",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avr1 = Cpu{
+ pub const avr1 = CpuModel{
.name = "avr1",
.llvm_name = "avr1",
.features = featureSet(&[_]Feature{
.avr1,
}),
};
- pub const avr2 = Cpu{
+ pub const avr2 = CpuModel{
.name = "avr2",
.llvm_name = "avr2",
.features = featureSet(&[_]Feature{
.avr2,
}),
};
- pub const avr25 = Cpu{
+ pub const avr25 = CpuModel{
.name = "avr25",
.llvm_name = "avr25",
.features = featureSet(&[_]Feature{
.avr25,
}),
};
- pub const avr3 = Cpu{
+ pub const avr3 = CpuModel{
.name = "avr3",
.llvm_name = "avr3",
.features = featureSet(&[_]Feature{
.avr3,
}),
};
- pub const avr31 = Cpu{
+ pub const avr31 = CpuModel{
.name = "avr31",
.llvm_name = "avr31",
.features = featureSet(&[_]Feature{
.avr31,
}),
};
- pub const avr35 = Cpu{
+ pub const avr35 = CpuModel{
.name = "avr35",
.llvm_name = "avr35",
.features = featureSet(&[_]Feature{
.avr35,
}),
};
- pub const avr4 = Cpu{
+ pub const avr4 = CpuModel{
.name = "avr4",
.llvm_name = "avr4",
.features = featureSet(&[_]Feature{
.avr4,
}),
};
- pub const avr5 = Cpu{
+ pub const avr5 = CpuModel{
.name = "avr5",
.llvm_name = "avr5",
.features = featureSet(&[_]Feature{
.avr5,
}),
};
- pub const avr51 = Cpu{
+ pub const avr51 = CpuModel{
.name = "avr51",
.llvm_name = "avr51",
.features = featureSet(&[_]Feature{
.avr51,
}),
};
- pub const avr6 = Cpu{
+ pub const avr6 = CpuModel{
.name = "avr6",
.llvm_name = "avr6",
.features = featureSet(&[_]Feature{
.avr6,
}),
};
- pub const avrtiny = Cpu{
+ pub const avrtiny = CpuModel{
.name = "avrtiny",
.llvm_name = "avrtiny",
.features = featureSet(&[_]Feature{
.avrtiny,
}),
};
- pub const avrxmega1 = Cpu{
+ pub const avrxmega1 = CpuModel{
.name = "avrxmega1",
.llvm_name = "avrxmega1",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega2 = Cpu{
+ pub const avrxmega2 = CpuModel{
.name = "avrxmega2",
.llvm_name = "avrxmega2",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega3 = Cpu{
+ pub const avrxmega3 = CpuModel{
.name = "avrxmega3",
.llvm_name = "avrxmega3",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega4 = Cpu{
+ pub const avrxmega4 = CpuModel{
.name = "avrxmega4",
.llvm_name = "avrxmega4",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega5 = Cpu{
+ pub const avrxmega5 = CpuModel{
.name = "avrxmega5",
.llvm_name = "avrxmega5",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega6 = Cpu{
+ pub const avrxmega6 = CpuModel{
.name = "avrxmega6",
.llvm_name = "avrxmega6",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const avrxmega7 = Cpu{
+ pub const avrxmega7 = CpuModel{
.name = "avrxmega7",
.llvm_name = "avrxmega7",
.features = featureSet(&[_]Feature{
.xmega,
}),
};
- pub const m3000 = Cpu{
+ pub const m3000 = CpuModel{
.name = "m3000",
.llvm_name = "m3000",
.features = featureSet(&[_]Feature{
@@ -2119,7 +2120,7 @@ pub const cpu = struct {
/// All avr CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.at43usb320,
&cpu.at43usb355,
&cpu.at76c711,
diff --git a/lib/std/target/bpf.zig b/lib/std/target/bpf.zig
index b6179075cc..6b548ac031 100644
--- a/lib/std/target/bpf.zig
+++ b/lib/std/target/bpf.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
alu32,
@@ -7,12 +8,12 @@ pub const Feature = enum {
dwarfris,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.alu32)] = .{
.llvm_name = "alu32",
.description = "Enable ALU32 instructions",
@@ -37,27 +38,27 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const probe = Cpu{
+ pub const probe = CpuModel{
.name = "probe",
.llvm_name = "probe",
.features = featureSet(&[_]Feature{}),
};
- pub const v1 = Cpu{
+ pub const v1 = CpuModel{
.name = "v1",
.llvm_name = "v1",
.features = featureSet(&[_]Feature{}),
};
- pub const v2 = Cpu{
+ pub const v2 = CpuModel{
.name = "v2",
.llvm_name = "v2",
.features = featureSet(&[_]Feature{}),
};
- pub const v3 = Cpu{
+ pub const v3 = CpuModel{
.name = "v3",
.llvm_name = "v3",
.features = featureSet(&[_]Feature{}),
@@ -67,7 +68,7 @@ pub const cpu = struct {
/// All bpf CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.generic,
&cpu.probe,
&cpu.v1,
diff --git a/lib/std/target/hexagon.zig b/lib/std/target/hexagon.zig
index f873237493..b0558908e3 100644
--- a/lib/std/target/hexagon.zig
+++ b/lib/std/target/hexagon.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
duplex,
@@ -28,12 +29,12 @@ pub const Feature = enum {
zreg,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.duplex)] = .{
.llvm_name = "duplex",
.description = "Enable generation of duplex instruction",
@@ -186,7 +187,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{
@@ -201,7 +202,7 @@ pub const cpu = struct {
.v60,
}),
};
- pub const hexagonv5 = Cpu{
+ pub const hexagonv5 = CpuModel{
.name = "hexagonv5",
.llvm_name = "hexagonv5",
.features = featureSet(&[_]Feature{
@@ -214,7 +215,7 @@ pub const cpu = struct {
.v5,
}),
};
- pub const hexagonv55 = Cpu{
+ pub const hexagonv55 = CpuModel{
.name = "hexagonv55",
.llvm_name = "hexagonv55",
.features = featureSet(&[_]Feature{
@@ -228,7 +229,7 @@ pub const cpu = struct {
.v55,
}),
};
- pub const hexagonv60 = Cpu{
+ pub const hexagonv60 = CpuModel{
.name = "hexagonv60",
.llvm_name = "hexagonv60",
.features = featureSet(&[_]Feature{
@@ -243,7 +244,7 @@ pub const cpu = struct {
.v60,
}),
};
- pub const hexagonv62 = Cpu{
+ pub const hexagonv62 = CpuModel{
.name = "hexagonv62",
.llvm_name = "hexagonv62",
.features = featureSet(&[_]Feature{
@@ -259,7 +260,7 @@ pub const cpu = struct {
.v62,
}),
};
- pub const hexagonv65 = Cpu{
+ pub const hexagonv65 = CpuModel{
.name = "hexagonv65",
.llvm_name = "hexagonv65",
.features = featureSet(&[_]Feature{
@@ -277,7 +278,7 @@ pub const cpu = struct {
.v65,
}),
};
- pub const hexagonv66 = Cpu{
+ pub const hexagonv66 = CpuModel{
.name = "hexagonv66",
.llvm_name = "hexagonv66",
.features = featureSet(&[_]Feature{
@@ -301,7 +302,7 @@ pub const cpu = struct {
/// All hexagon CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.generic,
&cpu.hexagonv5,
&cpu.hexagonv55,
diff --git a/lib/std/target/mips.zig b/lib/std/target/mips.zig
index fce7c9ce36..6ea7f665f0 100644
--- a/lib/std/target/mips.zig
+++ b/lib/std/target/mips.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
abs2008,
@@ -53,12 +54,12 @@ pub const Feature = enum {
virt,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.abs2008)] = .{
.llvm_name = "abs2008",
.description = "Disable IEEE 754-2008 abs.fmt mode",
@@ -372,112 +373,112 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const mips1 = Cpu{
+ pub const mips1 = CpuModel{
.name = "mips1",
.llvm_name = "mips1",
.features = featureSet(&[_]Feature{
.mips1,
}),
};
- pub const mips2 = Cpu{
+ pub const mips2 = CpuModel{
.name = "mips2",
.llvm_name = "mips2",
.features = featureSet(&[_]Feature{
.mips2,
}),
};
- pub const mips3 = Cpu{
+ pub const mips3 = CpuModel{
.name = "mips3",
.llvm_name = "mips3",
.features = featureSet(&[_]Feature{
.mips3,
}),
};
- pub const mips32 = Cpu{
+ pub const mips32 = CpuModel{
.name = "mips32",
.llvm_name = "mips32",
.features = featureSet(&[_]Feature{
.mips32,
}),
};
- pub const mips32r2 = Cpu{
+ pub const mips32r2 = CpuModel{
.name = "mips32r2",
.llvm_name = "mips32r2",
.features = featureSet(&[_]Feature{
.mips32r2,
}),
};
- pub const mips32r3 = Cpu{
+ pub const mips32r3 = CpuModel{
.name = "mips32r3",
.llvm_name = "mips32r3",
.features = featureSet(&[_]Feature{
.mips32r3,
}),
};
- pub const mips32r5 = Cpu{
+ pub const mips32r5 = CpuModel{
.name = "mips32r5",
.llvm_name = "mips32r5",
.features = featureSet(&[_]Feature{
.mips32r5,
}),
};
- pub const mips32r6 = Cpu{
+ pub const mips32r6 = CpuModel{
.name = "mips32r6",
.llvm_name = "mips32r6",
.features = featureSet(&[_]Feature{
.mips32r6,
}),
};
- pub const mips4 = Cpu{
+ pub const mips4 = CpuModel{
.name = "mips4",
.llvm_name = "mips4",
.features = featureSet(&[_]Feature{
.mips4,
}),
};
- pub const mips5 = Cpu{
+ pub const mips5 = CpuModel{
.name = "mips5",
.llvm_name = "mips5",
.features = featureSet(&[_]Feature{
.mips5,
}),
};
- pub const mips64 = Cpu{
+ pub const mips64 = CpuModel{
.name = "mips64",
.llvm_name = "mips64",
.features = featureSet(&[_]Feature{
.mips64,
}),
};
- pub const mips64r2 = Cpu{
+ pub const mips64r2 = CpuModel{
.name = "mips64r2",
.llvm_name = "mips64r2",
.features = featureSet(&[_]Feature{
.mips64r2,
}),
};
- pub const mips64r3 = Cpu{
+ pub const mips64r3 = CpuModel{
.name = "mips64r3",
.llvm_name = "mips64r3",
.features = featureSet(&[_]Feature{
.mips64r3,
}),
};
- pub const mips64r5 = Cpu{
+ pub const mips64r5 = CpuModel{
.name = "mips64r5",
.llvm_name = "mips64r5",
.features = featureSet(&[_]Feature{
.mips64r5,
}),
};
- pub const mips64r6 = Cpu{
+ pub const mips64r6 = CpuModel{
.name = "mips64r6",
.llvm_name = "mips64r6",
.features = featureSet(&[_]Feature{
.mips64r6,
}),
};
- pub const octeon = Cpu{
+ pub const octeon = CpuModel{
.name = "octeon",
.llvm_name = "octeon",
.features = featureSet(&[_]Feature{
@@ -485,7 +486,7 @@ pub const cpu = struct {
.mips64r2,
}),
};
- pub const p5600 = Cpu{
+ pub const p5600 = CpuModel{
.name = "p5600",
.llvm_name = "p5600",
.features = featureSet(&[_]Feature{
@@ -497,7 +498,7 @@ pub const cpu = struct {
/// All mips CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.mips1,
&cpu.mips2,
&cpu.mips3,
diff --git a/lib/std/target/msp430.zig b/lib/std/target/msp430.zig
index bc932f2295..e1b858341f 100644
--- a/lib/std/target/msp430.zig
+++ b/lib/std/target/msp430.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
ext,
@@ -8,12 +9,12 @@ pub const Feature = enum {
hwmultf5,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.ext)] = .{
.llvm_name = "ext",
.description = "Enable MSP430-X extensions",
@@ -43,17 +44,17 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const msp430 = Cpu{
+ pub const msp430 = CpuModel{
.name = "msp430",
.llvm_name = "msp430",
.features = featureSet(&[_]Feature{}),
};
- pub const msp430x = Cpu{
+ pub const msp430x = CpuModel{
.name = "msp430x",
.llvm_name = "msp430x",
.features = featureSet(&[_]Feature{
@@ -65,7 +66,7 @@ pub const cpu = struct {
/// All msp430 CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.generic,
&cpu.msp430,
&cpu.msp430x,
diff --git a/lib/std/target/nvptx.zig b/lib/std/target/nvptx.zig
index 1800e320b4..6a79aea1da 100644
--- a/lib/std/target/nvptx.zig
+++ b/lib/std/target/nvptx.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
ptx32,
@@ -29,12 +30,12 @@ pub const Feature = enum {
sm_75,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.ptx32)] = .{
.llvm_name = "ptx32",
.description = "Use PTX version 3.2",
@@ -169,28 +170,28 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const sm_20 = Cpu{
+ pub const sm_20 = CpuModel{
.name = "sm_20",
.llvm_name = "sm_20",
.features = featureSet(&[_]Feature{
.sm_20,
}),
};
- pub const sm_21 = Cpu{
+ pub const sm_21 = CpuModel{
.name = "sm_21",
.llvm_name = "sm_21",
.features = featureSet(&[_]Feature{
.sm_21,
}),
};
- pub const sm_30 = Cpu{
+ pub const sm_30 = CpuModel{
.name = "sm_30",
.llvm_name = "sm_30",
.features = featureSet(&[_]Feature{
.sm_30,
}),
};
- pub const sm_32 = Cpu{
+ pub const sm_32 = CpuModel{
.name = "sm_32",
.llvm_name = "sm_32",
.features = featureSet(&[_]Feature{
@@ -198,14 +199,14 @@ pub const cpu = struct {
.sm_32,
}),
};
- pub const sm_35 = Cpu{
+ pub const sm_35 = CpuModel{
.name = "sm_35",
.llvm_name = "sm_35",
.features = featureSet(&[_]Feature{
.sm_35,
}),
};
- pub const sm_37 = Cpu{
+ pub const sm_37 = CpuModel{
.name = "sm_37",
.llvm_name = "sm_37",
.features = featureSet(&[_]Feature{
@@ -213,7 +214,7 @@ pub const cpu = struct {
.sm_37,
}),
};
- pub const sm_50 = Cpu{
+ pub const sm_50 = CpuModel{
.name = "sm_50",
.llvm_name = "sm_50",
.features = featureSet(&[_]Feature{
@@ -221,7 +222,7 @@ pub const cpu = struct {
.sm_50,
}),
};
- pub const sm_52 = Cpu{
+ pub const sm_52 = CpuModel{
.name = "sm_52",
.llvm_name = "sm_52",
.features = featureSet(&[_]Feature{
@@ -229,7 +230,7 @@ pub const cpu = struct {
.sm_52,
}),
};
- pub const sm_53 = Cpu{
+ pub const sm_53 = CpuModel{
.name = "sm_53",
.llvm_name = "sm_53",
.features = featureSet(&[_]Feature{
@@ -237,7 +238,7 @@ pub const cpu = struct {
.sm_53,
}),
};
- pub const sm_60 = Cpu{
+ pub const sm_60 = CpuModel{
.name = "sm_60",
.llvm_name = "sm_60",
.features = featureSet(&[_]Feature{
@@ -245,7 +246,7 @@ pub const cpu = struct {
.sm_60,
}),
};
- pub const sm_61 = Cpu{
+ pub const sm_61 = CpuModel{
.name = "sm_61",
.llvm_name = "sm_61",
.features = featureSet(&[_]Feature{
@@ -253,7 +254,7 @@ pub const cpu = struct {
.sm_61,
}),
};
- pub const sm_62 = Cpu{
+ pub const sm_62 = CpuModel{
.name = "sm_62",
.llvm_name = "sm_62",
.features = featureSet(&[_]Feature{
@@ -261,7 +262,7 @@ pub const cpu = struct {
.sm_62,
}),
};
- pub const sm_70 = Cpu{
+ pub const sm_70 = CpuModel{
.name = "sm_70",
.llvm_name = "sm_70",
.features = featureSet(&[_]Feature{
@@ -269,7 +270,7 @@ pub const cpu = struct {
.sm_70,
}),
};
- pub const sm_72 = Cpu{
+ pub const sm_72 = CpuModel{
.name = "sm_72",
.llvm_name = "sm_72",
.features = featureSet(&[_]Feature{
@@ -277,7 +278,7 @@ pub const cpu = struct {
.sm_72,
}),
};
- pub const sm_75 = Cpu{
+ pub const sm_75 = CpuModel{
.name = "sm_75",
.llvm_name = "sm_75",
.features = featureSet(&[_]Feature{
@@ -290,7 +291,7 @@ pub const cpu = struct {
/// All nvptx CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.sm_20,
&cpu.sm_21,
&cpu.sm_30,
diff --git a/lib/std/target/powerpc.zig b/lib/std/target/powerpc.zig
index 41321f7b04..ae3371e066 100644
--- a/lib/std/target/powerpc.zig
+++ b/lib/std/target/powerpc.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
@"64bit",
@@ -55,12 +56,12 @@ pub const Feature = enum {
vsx,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.@"64bit")] = .{
.llvm_name = "64bit",
.description = "Enable 64-bit instructions",
@@ -377,7 +378,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const @"440" = Cpu{
+ pub const @"440" = CpuModel{
.name = "440",
.llvm_name = "440",
.features = featureSet(&[_]Feature{
@@ -389,7 +390,7 @@ pub const cpu = struct {
.msync,
}),
};
- pub const @"450" = Cpu{
+ pub const @"450" = CpuModel{
.name = "450",
.llvm_name = "450",
.features = featureSet(&[_]Feature{
@@ -401,21 +402,21 @@ pub const cpu = struct {
.msync,
}),
};
- pub const @"601" = Cpu{
+ pub const @"601" = CpuModel{
.name = "601",
.llvm_name = "601",
.features = featureSet(&[_]Feature{
.fpu,
}),
};
- pub const @"602" = Cpu{
+ pub const @"602" = CpuModel{
.name = "602",
.llvm_name = "602",
.features = featureSet(&[_]Feature{
.fpu,
}),
};
- pub const @"603" = Cpu{
+ pub const @"603" = CpuModel{
.name = "603",
.llvm_name = "603",
.features = featureSet(&[_]Feature{
@@ -423,7 +424,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"603e" = Cpu{
+ pub const @"603e" = CpuModel{
.name = "603e",
.llvm_name = "603e",
.features = featureSet(&[_]Feature{
@@ -431,7 +432,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"603ev" = Cpu{
+ pub const @"603ev" = CpuModel{
.name = "603ev",
.llvm_name = "603ev",
.features = featureSet(&[_]Feature{
@@ -439,7 +440,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"604" = Cpu{
+ pub const @"604" = CpuModel{
.name = "604",
.llvm_name = "604",
.features = featureSet(&[_]Feature{
@@ -447,7 +448,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"604e" = Cpu{
+ pub const @"604e" = CpuModel{
.name = "604e",
.llvm_name = "604e",
.features = featureSet(&[_]Feature{
@@ -455,7 +456,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"620" = Cpu{
+ pub const @"620" = CpuModel{
.name = "620",
.llvm_name = "620",
.features = featureSet(&[_]Feature{
@@ -463,7 +464,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"7400" = Cpu{
+ pub const @"7400" = CpuModel{
.name = "7400",
.llvm_name = "7400",
.features = featureSet(&[_]Feature{
@@ -472,7 +473,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"7450" = Cpu{
+ pub const @"7450" = CpuModel{
.name = "7450",
.llvm_name = "7450",
.features = featureSet(&[_]Feature{
@@ -481,7 +482,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"750" = Cpu{
+ pub const @"750" = CpuModel{
.name = "750",
.llvm_name = "750",
.features = featureSet(&[_]Feature{
@@ -489,7 +490,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"970" = Cpu{
+ pub const @"970" = CpuModel{
.name = "970",
.llvm_name = "970",
.features = featureSet(&[_]Feature{
@@ -502,7 +503,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const a2 = Cpu{
+ pub const a2 = CpuModel{
.name = "a2",
.llvm_name = "a2",
.features = featureSet(&[_]Feature{
@@ -527,7 +528,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const a2q = Cpu{
+ pub const a2q = CpuModel{
.name = "a2q",
.llvm_name = "a2q",
.features = featureSet(&[_]Feature{
@@ -553,7 +554,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const e500 = Cpu{
+ pub const e500 = CpuModel{
.name = "e500",
.llvm_name = "e500",
.features = featureSet(&[_]Feature{
@@ -562,7 +563,7 @@ pub const cpu = struct {
.isel,
}),
};
- pub const e500mc = Cpu{
+ pub const e500mc = CpuModel{
.name = "e500mc",
.llvm_name = "e500mc",
.features = featureSet(&[_]Feature{
@@ -572,7 +573,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const e5500 = Cpu{
+ pub const e5500 = CpuModel{
.name = "e5500",
.llvm_name = "e5500",
.features = featureSet(&[_]Feature{
@@ -584,7 +585,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const g3 = Cpu{
+ pub const g3 = CpuModel{
.name = "g3",
.llvm_name = "g3",
.features = featureSet(&[_]Feature{
@@ -592,7 +593,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const g4 = Cpu{
+ pub const g4 = CpuModel{
.name = "g4",
.llvm_name = "g4",
.features = featureSet(&[_]Feature{
@@ -601,7 +602,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const @"g4+" = Cpu{
+ pub const @"g4+" = CpuModel{
.name = "g4+",
.llvm_name = "g4+",
.features = featureSet(&[_]Feature{
@@ -610,7 +611,7 @@ pub const cpu = struct {
.frsqrte,
}),
};
- pub const g5 = Cpu{
+ pub const g5 = CpuModel{
.name = "g5",
.llvm_name = "g5",
.features = featureSet(&[_]Feature{
@@ -623,28 +624,28 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
- pub const ppc = Cpu{
+ pub const ppc = CpuModel{
.name = "ppc",
.llvm_name = "ppc",
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
- pub const ppc32 = Cpu{
+ pub const ppc32 = CpuModel{
.name = "ppc32",
.llvm_name = "ppc32",
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
- pub const ppc64 = Cpu{
+ pub const ppc64 = CpuModel{
.name = "ppc64",
.llvm_name = "ppc64",
.features = featureSet(&[_]Feature{
@@ -657,7 +658,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const ppc64le = Cpu{
+ pub const ppc64le = CpuModel{
.name = "ppc64le",
.llvm_name = "ppc64le",
.features = featureSet(&[_]Feature{
@@ -692,7 +693,7 @@ pub const cpu = struct {
.vsx,
}),
};
- pub const pwr3 = Cpu{
+ pub const pwr3 = CpuModel{
.name = "pwr3",
.llvm_name = "pwr3",
.features = featureSet(&[_]Feature{
@@ -704,7 +705,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr4 = Cpu{
+ pub const pwr4 = CpuModel{
.name = "pwr4",
.llvm_name = "pwr4",
.features = featureSet(&[_]Feature{
@@ -717,7 +718,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr5 = Cpu{
+ pub const pwr5 = CpuModel{
.name = "pwr5",
.llvm_name = "pwr5",
.features = featureSet(&[_]Feature{
@@ -732,7 +733,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr5x = Cpu{
+ pub const pwr5x = CpuModel{
.name = "pwr5x",
.llvm_name = "pwr5x",
.features = featureSet(&[_]Feature{
@@ -748,7 +749,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr6 = Cpu{
+ pub const pwr6 = CpuModel{
.name = "pwr6",
.llvm_name = "pwr6",
.features = featureSet(&[_]Feature{
@@ -768,7 +769,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr6x = Cpu{
+ pub const pwr6x = CpuModel{
.name = "pwr6x",
.llvm_name = "pwr6x",
.features = featureSet(&[_]Feature{
@@ -788,7 +789,7 @@ pub const cpu = struct {
.stfiwx,
}),
};
- pub const pwr7 = Cpu{
+ pub const pwr7 = CpuModel{
.name = "pwr7",
.llvm_name = "pwr7",
.features = featureSet(&[_]Feature{
@@ -816,7 +817,7 @@ pub const cpu = struct {
.vsx,
}),
};
- pub const pwr8 = Cpu{
+ pub const pwr8 = CpuModel{
.name = "pwr8",
.llvm_name = "pwr8",
.features = featureSet(&[_]Feature{
@@ -851,7 +852,7 @@ pub const cpu = struct {
.vsx,
}),
};
- pub const pwr9 = Cpu{
+ pub const pwr9 = CpuModel{
.name = "pwr9",
.llvm_name = "pwr9",
.features = featureSet(&[_]Feature{
@@ -897,7 +898,7 @@ pub const cpu = struct {
/// All powerpc CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.@"440",
&cpu.@"450",
&cpu.@"601",
diff --git a/lib/std/target/riscv.zig b/lib/std/target/riscv.zig
index ddf1049a20..a799c29df6 100644
--- a/lib/std/target/riscv.zig
+++ b/lib/std/target/riscv.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
@"64bit",
@@ -12,12 +13,12 @@ pub const Feature = enum {
relax,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.@"64bit")] = .{
.llvm_name = "64bit",
.description = "Implements RV64",
@@ -69,7 +70,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const baseline_rv32 = Cpu{
+ pub const baseline_rv32 = CpuModel{
.name = "baseline_rv32",
.llvm_name = "generic-rv32",
.features = featureSet(&[_]Feature{
@@ -81,7 +82,7 @@ pub const cpu = struct {
}),
};
- pub const baseline_rv64 = Cpu{
+ pub const baseline_rv64 = CpuModel{
.name = "baseline_rv64",
.llvm_name = "generic-rv64",
.features = featureSet(&[_]Feature{
@@ -94,13 +95,13 @@ pub const cpu = struct {
}),
};
- pub const generic_rv32 = Cpu{
+ pub const generic_rv32 = CpuModel{
.name = "generic_rv32",
.llvm_name = "generic-rv32",
.features = featureSet(&[_]Feature{}),
};
- pub const generic_rv64 = Cpu{
+ pub const generic_rv64 = CpuModel{
.name = "generic_rv64",
.llvm_name = "generic-rv64",
.features = featureSet(&[_]Feature{
@@ -112,7 +113,7 @@ pub const cpu = struct {
/// All riscv CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.baseline_rv32,
&cpu.baseline_rv64,
&cpu.generic_rv32,
diff --git a/lib/std/target/sparc.zig b/lib/std/target/sparc.zig
index 923cc0732c..3ec6cc7c20 100644
--- a/lib/std/target/sparc.zig
+++ b/lib/std/target/sparc.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
deprecated_v8,
@@ -23,12 +24,12 @@ pub const Feature = enum {
vis3,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.deprecated_v8)] = .{
.llvm_name = "deprecated-v8",
.description = "Enable deprecated V8 instructions in V9 mode",
@@ -133,7 +134,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const at697e = Cpu{
+ pub const at697e = CpuModel{
.name = "at697e",
.llvm_name = "at697e",
.features = featureSet(&[_]Feature{
@@ -141,7 +142,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const at697f = Cpu{
+ pub const at697f = CpuModel{
.name = "at697f",
.llvm_name = "at697f",
.features = featureSet(&[_]Feature{
@@ -149,17 +150,17 @@ pub const cpu = struct {
.leon,
}),
};
- pub const f934 = Cpu{
+ pub const f934 = CpuModel{
.name = "f934",
.llvm_name = "f934",
.features = featureSet(&[_]Feature{}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const gr712rc = Cpu{
+ pub const gr712rc = CpuModel{
.name = "gr712rc",
.llvm_name = "gr712rc",
.features = featureSet(&[_]Feature{
@@ -167,7 +168,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const gr740 = Cpu{
+ pub const gr740 = CpuModel{
.name = "gr740",
.llvm_name = "gr740",
.features = featureSet(&[_]Feature{
@@ -178,19 +179,19 @@ pub const cpu = struct {
.leonpwrpsr,
}),
};
- pub const hypersparc = Cpu{
+ pub const hypersparc = CpuModel{
.name = "hypersparc",
.llvm_name = "hypersparc",
.features = featureSet(&[_]Feature{}),
};
- pub const leon2 = Cpu{
+ pub const leon2 = CpuModel{
.name = "leon2",
.llvm_name = "leon2",
.features = featureSet(&[_]Feature{
.leon,
}),
};
- pub const leon3 = Cpu{
+ pub const leon3 = CpuModel{
.name = "leon3",
.llvm_name = "leon3",
.features = featureSet(&[_]Feature{
@@ -198,7 +199,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const leon4 = Cpu{
+ pub const leon4 = CpuModel{
.name = "leon4",
.llvm_name = "leon4",
.features = featureSet(&[_]Feature{
@@ -207,7 +208,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2080 = Cpu{
+ pub const ma2080 = CpuModel{
.name = "ma2080",
.llvm_name = "ma2080",
.features = featureSet(&[_]Feature{
@@ -215,7 +216,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2085 = Cpu{
+ pub const ma2085 = CpuModel{
.name = "ma2085",
.llvm_name = "ma2085",
.features = featureSet(&[_]Feature{
@@ -223,7 +224,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2100 = Cpu{
+ pub const ma2100 = CpuModel{
.name = "ma2100",
.llvm_name = "ma2100",
.features = featureSet(&[_]Feature{
@@ -231,7 +232,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2150 = Cpu{
+ pub const ma2150 = CpuModel{
.name = "ma2150",
.llvm_name = "ma2150",
.features = featureSet(&[_]Feature{
@@ -239,7 +240,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2155 = Cpu{
+ pub const ma2155 = CpuModel{
.name = "ma2155",
.llvm_name = "ma2155",
.features = featureSet(&[_]Feature{
@@ -247,7 +248,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2450 = Cpu{
+ pub const ma2450 = CpuModel{
.name = "ma2450",
.llvm_name = "ma2450",
.features = featureSet(&[_]Feature{
@@ -255,7 +256,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2455 = Cpu{
+ pub const ma2455 = CpuModel{
.name = "ma2455",
.llvm_name = "ma2455",
.features = featureSet(&[_]Feature{
@@ -263,7 +264,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2480 = Cpu{
+ pub const ma2480 = CpuModel{
.name = "ma2480",
.llvm_name = "ma2480",
.features = featureSet(&[_]Feature{
@@ -271,7 +272,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2485 = Cpu{
+ pub const ma2485 = CpuModel{
.name = "ma2485",
.llvm_name = "ma2485",
.features = featureSet(&[_]Feature{
@@ -279,7 +280,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2x5x = Cpu{
+ pub const ma2x5x = CpuModel{
.name = "ma2x5x",
.llvm_name = "ma2x5x",
.features = featureSet(&[_]Feature{
@@ -287,7 +288,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const ma2x8x = Cpu{
+ pub const ma2x8x = CpuModel{
.name = "ma2x8x",
.llvm_name = "ma2x8x",
.features = featureSet(&[_]Feature{
@@ -295,7 +296,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const myriad2 = Cpu{
+ pub const myriad2 = CpuModel{
.name = "myriad2",
.llvm_name = "myriad2",
.features = featureSet(&[_]Feature{
@@ -303,7 +304,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const myriad2_1 = Cpu{
+ pub const myriad2_1 = CpuModel{
.name = "myriad2_1",
.llvm_name = "myriad2.1",
.features = featureSet(&[_]Feature{
@@ -311,7 +312,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const myriad2_2 = Cpu{
+ pub const myriad2_2 = CpuModel{
.name = "myriad2_2",
.llvm_name = "myriad2.2",
.features = featureSet(&[_]Feature{
@@ -319,7 +320,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const myriad2_3 = Cpu{
+ pub const myriad2_3 = CpuModel{
.name = "myriad2_3",
.llvm_name = "myriad2.3",
.features = featureSet(&[_]Feature{
@@ -327,7 +328,7 @@ pub const cpu = struct {
.leon,
}),
};
- pub const niagara = Cpu{
+ pub const niagara = CpuModel{
.name = "niagara",
.llvm_name = "niagara",
.features = featureSet(&[_]Feature{
@@ -337,7 +338,7 @@ pub const cpu = struct {
.vis2,
}),
};
- pub const niagara2 = Cpu{
+ pub const niagara2 = CpuModel{
.name = "niagara2",
.llvm_name = "niagara2",
.features = featureSet(&[_]Feature{
@@ -348,7 +349,7 @@ pub const cpu = struct {
.vis2,
}),
};
- pub const niagara3 = Cpu{
+ pub const niagara3 = CpuModel{
.name = "niagara3",
.llvm_name = "niagara3",
.features = featureSet(&[_]Feature{
@@ -359,7 +360,7 @@ pub const cpu = struct {
.vis2,
}),
};
- pub const niagara4 = Cpu{
+ pub const niagara4 = CpuModel{
.name = "niagara4",
.llvm_name = "niagara4",
.features = featureSet(&[_]Feature{
@@ -371,32 +372,32 @@ pub const cpu = struct {
.vis3,
}),
};
- pub const sparclet = Cpu{
+ pub const sparclet = CpuModel{
.name = "sparclet",
.llvm_name = "sparclet",
.features = featureSet(&[_]Feature{}),
};
- pub const sparclite = Cpu{
+ pub const sparclite = CpuModel{
.name = "sparclite",
.llvm_name = "sparclite",
.features = featureSet(&[_]Feature{}),
};
- pub const sparclite86x = Cpu{
+ pub const sparclite86x = CpuModel{
.name = "sparclite86x",
.llvm_name = "sparclite86x",
.features = featureSet(&[_]Feature{}),
};
- pub const supersparc = Cpu{
+ pub const supersparc = CpuModel{
.name = "supersparc",
.llvm_name = "supersparc",
.features = featureSet(&[_]Feature{}),
};
- pub const tsc701 = Cpu{
+ pub const tsc701 = CpuModel{
.name = "tsc701",
.llvm_name = "tsc701",
.features = featureSet(&[_]Feature{}),
};
- pub const ultrasparc = Cpu{
+ pub const ultrasparc = CpuModel{
.name = "ultrasparc",
.llvm_name = "ultrasparc",
.features = featureSet(&[_]Feature{
@@ -405,7 +406,7 @@ pub const cpu = struct {
.vis,
}),
};
- pub const ultrasparc3 = Cpu{
+ pub const ultrasparc3 = CpuModel{
.name = "ultrasparc3",
.llvm_name = "ultrasparc3",
.features = featureSet(&[_]Feature{
@@ -415,7 +416,7 @@ pub const cpu = struct {
.vis2,
}),
};
- pub const ut699 = Cpu{
+ pub const ut699 = CpuModel{
.name = "ut699",
.llvm_name = "ut699",
.features = featureSet(&[_]Feature{
@@ -426,7 +427,7 @@ pub const cpu = struct {
.no_fsmuld,
}),
};
- pub const v7 = Cpu{
+ pub const v7 = CpuModel{
.name = "v7",
.llvm_name = "v7",
.features = featureSet(&[_]Feature{
@@ -434,12 +435,12 @@ pub const cpu = struct {
.soft_mul_div,
}),
};
- pub const v8 = Cpu{
+ pub const v8 = CpuModel{
.name = "v8",
.llvm_name = "v8",
.features = featureSet(&[_]Feature{}),
};
- pub const v9 = Cpu{
+ pub const v9 = CpuModel{
.name = "v9",
.llvm_name = "v9",
.features = featureSet(&[_]Feature{
@@ -451,7 +452,7 @@ pub const cpu = struct {
/// All sparc CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.at697e,
&cpu.at697f,
&cpu.f934,
diff --git a/lib/std/target/systemz.zig b/lib/std/target/systemz.zig
index c924af6e70..798ecf5630 100644
--- a/lib/std/target/systemz.zig
+++ b/lib/std/target/systemz.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
deflate_conversion,
@@ -39,12 +40,12 @@ pub const Feature = enum {
vector_packed_decimal_enhancement,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.deflate_conversion)] = .{
.llvm_name = "deflate-conversion",
.description = "Assume that the deflate-conversion facility is installed",
@@ -229,7 +230,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const arch10 = Cpu{
+ pub const arch10 = CpuModel{
.name = "arch10",
.llvm_name = "arch10",
.features = featureSet(&[_]Feature{
@@ -252,7 +253,7 @@ pub const cpu = struct {
.transactional_execution,
}),
};
- pub const arch11 = Cpu{
+ pub const arch11 = CpuModel{
.name = "arch11",
.llvm_name = "arch11",
.features = featureSet(&[_]Feature{
@@ -280,7 +281,7 @@ pub const cpu = struct {
.vector,
}),
};
- pub const arch12 = Cpu{
+ pub const arch12 = CpuModel{
.name = "arch12",
.llvm_name = "arch12",
.features = featureSet(&[_]Feature{
@@ -315,7 +316,7 @@ pub const cpu = struct {
.vector_packed_decimal,
}),
};
- pub const arch13 = Cpu{
+ pub const arch13 = CpuModel{
.name = "arch13",
.llvm_name = "arch13",
.features = featureSet(&[_]Feature{
@@ -356,12 +357,12 @@ pub const cpu = struct {
.vector_packed_decimal_enhancement,
}),
};
- pub const arch8 = Cpu{
+ pub const arch8 = CpuModel{
.name = "arch8",
.llvm_name = "arch8",
.features = featureSet(&[_]Feature{}),
};
- pub const arch9 = Cpu{
+ pub const arch9 = CpuModel{
.name = "arch9",
.llvm_name = "arch9",
.features = featureSet(&[_]Feature{
@@ -377,17 +378,17 @@ pub const cpu = struct {
.reset_reference_bits_multiple,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const z10 = Cpu{
+ pub const z10 = CpuModel{
.name = "z10",
.llvm_name = "z10",
.features = featureSet(&[_]Feature{}),
};
- pub const z13 = Cpu{
+ pub const z13 = CpuModel{
.name = "z13",
.llvm_name = "z13",
.features = featureSet(&[_]Feature{
@@ -415,7 +416,7 @@ pub const cpu = struct {
.vector,
}),
};
- pub const z14 = Cpu{
+ pub const z14 = CpuModel{
.name = "z14",
.llvm_name = "z14",
.features = featureSet(&[_]Feature{
@@ -450,7 +451,7 @@ pub const cpu = struct {
.vector_packed_decimal,
}),
};
- pub const z196 = Cpu{
+ pub const z196 = CpuModel{
.name = "z196",
.llvm_name = "z196",
.features = featureSet(&[_]Feature{
@@ -466,7 +467,7 @@ pub const cpu = struct {
.reset_reference_bits_multiple,
}),
};
- pub const zEC12 = Cpu{
+ pub const zEC12 = CpuModel{
.name = "zEC12",
.llvm_name = "zEC12",
.features = featureSet(&[_]Feature{
@@ -494,7 +495,7 @@ pub const cpu = struct {
/// All systemz CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.arch10,
&cpu.arch11,
&cpu.arch12,
diff --git a/lib/std/target/wasm.zig b/lib/std/target/wasm.zig
index 6d79bbb282..066282f3c6 100644
--- a/lib/std/target/wasm.zig
+++ b/lib/std/target/wasm.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
atomics,
@@ -14,12 +15,12 @@ pub const Feature = enum {
unimplemented_simd128,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.atomics)] = .{
.llvm_name = "atomics",
.description = "Enable Atomics",
@@ -81,7 +82,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const bleeding_edge = Cpu{
+ pub const bleeding_edge = CpuModel{
.name = "bleeding_edge",
.llvm_name = "bleeding-edge",
.features = featureSet(&[_]Feature{
@@ -92,12 +93,12 @@ pub const cpu = struct {
.simd128,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{}),
};
- pub const mvp = Cpu{
+ pub const mvp = CpuModel{
.name = "mvp",
.llvm_name = "mvp",
.features = featureSet(&[_]Feature{}),
@@ -107,7 +108,7 @@ pub const cpu = struct {
/// All wasm CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.bleeding_edge,
&cpu.generic,
&cpu.mvp,
diff --git a/lib/std/target/x86.zig b/lib/std/target/x86.zig
index 3c2e306e79..1e2ac409bd 100644
--- a/lib/std/target/x86.zig
+++ b/lib/std/target/x86.zig
@@ -1,5 +1,6 @@
const std = @import("../std.zig");
-const Cpu = std.Target.Cpu;
+const CpuFeature = std.Target.Cpu.Feature;
+const CpuModel = std.Target.Cpu.Model;
pub const Feature = enum {
@"3dnow",
@@ -125,12 +126,12 @@ pub const Feature = enum {
xsaves,
};
-pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
+pub usingnamespace CpuFeature.feature_set_fns(Feature);
pub const all_features = blk: {
const len = @typeInfo(Feature).Enum.fields.len;
- std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
- var result: [len]Cpu.Feature = undefined;
+ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
+ var result: [len]CpuFeature = undefined;
result[@enumToInt(Feature.@"3dnow")] = .{
.llvm_name = "3dnow",
.description = "Enable 3DNow! instructions",
@@ -829,7 +830,7 @@ pub const all_features = blk: {
};
pub const cpu = struct {
- pub const amdfam10 = Cpu{
+ pub const amdfam10 = CpuModel{
.name = "amdfam10",
.llvm_name = "amdfam10",
.features = featureSet(&[_]Feature{
@@ -849,7 +850,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon = Cpu{
+ pub const athlon = CpuModel{
.name = "athlon",
.llvm_name = "athlon",
.features = featureSet(&[_]Feature{
@@ -862,7 +863,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon_4 = Cpu{
+ pub const athlon_4 = CpuModel{
.name = "athlon_4",
.llvm_name = "athlon-4",
.features = featureSet(&[_]Feature{
@@ -877,7 +878,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon_fx = Cpu{
+ pub const athlon_fx = CpuModel{
.name = "athlon_fx",
.llvm_name = "athlon-fx",
.features = featureSet(&[_]Feature{
@@ -894,7 +895,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon_mp = Cpu{
+ pub const athlon_mp = CpuModel{
.name = "athlon_mp",
.llvm_name = "athlon-mp",
.features = featureSet(&[_]Feature{
@@ -909,7 +910,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon_tbird = Cpu{
+ pub const athlon_tbird = CpuModel{
.name = "athlon_tbird",
.llvm_name = "athlon-tbird",
.features = featureSet(&[_]Feature{
@@ -922,7 +923,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon_xp = Cpu{
+ pub const athlon_xp = CpuModel{
.name = "athlon_xp",
.llvm_name = "athlon-xp",
.features = featureSet(&[_]Feature{
@@ -937,7 +938,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon64 = Cpu{
+ pub const athlon64 = CpuModel{
.name = "athlon64",
.llvm_name = "athlon64",
.features = featureSet(&[_]Feature{
@@ -954,7 +955,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const athlon64_sse3 = Cpu{
+ pub const athlon64_sse3 = CpuModel{
.name = "athlon64_sse3",
.llvm_name = "athlon64-sse3",
.features = featureSet(&[_]Feature{
@@ -972,7 +973,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const atom = Cpu{
+ pub const atom = CpuModel{
.name = "atom",
.llvm_name = "atom",
.features = featureSet(&[_]Feature{
@@ -996,7 +997,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const barcelona = Cpu{
+ pub const barcelona = CpuModel{
.name = "barcelona",
.llvm_name = "barcelona",
.features = featureSet(&[_]Feature{
@@ -1016,7 +1017,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const bdver1 = Cpu{
+ pub const bdver1 = CpuModel{
.name = "bdver1",
.llvm_name = "bdver1",
.features = featureSet(&[_]Feature{
@@ -1043,7 +1044,7 @@ pub const cpu = struct {
.xsave,
}),
};
- pub const bdver2 = Cpu{
+ pub const bdver2 = CpuModel{
.name = "bdver2",
.llvm_name = "bdver2",
.features = featureSet(&[_]Feature{
@@ -1075,7 +1076,7 @@ pub const cpu = struct {
.xsave,
}),
};
- pub const bdver3 = Cpu{
+ pub const bdver3 = CpuModel{
.name = "bdver3",
.llvm_name = "bdver3",
.features = featureSet(&[_]Feature{
@@ -1109,7 +1110,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const bdver4 = Cpu{
+ pub const bdver4 = CpuModel{
.name = "bdver4",
.llvm_name = "bdver4",
.features = featureSet(&[_]Feature{
@@ -1146,7 +1147,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const bonnell = Cpu{
+ pub const bonnell = CpuModel{
.name = "bonnell",
.llvm_name = "bonnell",
.features = featureSet(&[_]Feature{
@@ -1170,7 +1171,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const broadwell = Cpu{
+ pub const broadwell = CpuModel{
.name = "broadwell",
.llvm_name = "broadwell",
.features = featureSet(&[_]Feature{
@@ -1214,7 +1215,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const btver1 = Cpu{
+ pub const btver1 = CpuModel{
.name = "btver1",
.llvm_name = "btver1",
.features = featureSet(&[_]Feature{
@@ -1238,7 +1239,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const btver2 = Cpu{
+ pub const btver2 = CpuModel{
.name = "btver2",
.llvm_name = "btver2",
.features = featureSet(&[_]Feature{
@@ -1274,7 +1275,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const c3 = Cpu{
+ pub const c3 = CpuModel{
.name = "c3",
.llvm_name = "c3",
.features = featureSet(&[_]Feature{
@@ -1283,7 +1284,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const c3_2 = Cpu{
+ pub const c3_2 = CpuModel{
.name = "c3_2",
.llvm_name = "c3-2",
.features = featureSet(&[_]Feature{
@@ -1296,7 +1297,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const cannonlake = Cpu{
+ pub const cannonlake = CpuModel{
.name = "cannonlake",
.llvm_name = "cannonlake",
.features = featureSet(&[_]Feature{
@@ -1355,7 +1356,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const cascadelake = Cpu{
+ pub const cascadelake = CpuModel{
.name = "cascadelake",
.llvm_name = "cascadelake",
.features = featureSet(&[_]Feature{
@@ -1413,7 +1414,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const cooperlake = Cpu{
+ pub const cooperlake = CpuModel{
.name = "cooperlake",
.llvm_name = "cooperlake",
.features = featureSet(&[_]Feature{
@@ -1472,7 +1473,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const core_avx_i = Cpu{
+ pub const core_avx_i = CpuModel{
.name = "core_avx_i",
.llvm_name = "core-avx-i",
.features = featureSet(&[_]Feature{
@@ -1504,7 +1505,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const core_avx2 = Cpu{
+ pub const core_avx2 = CpuModel{
.name = "core_avx2",
.llvm_name = "core-avx2",
.features = featureSet(&[_]Feature{
@@ -1545,7 +1546,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const core2 = Cpu{
+ pub const core2 = CpuModel{
.name = "core2",
.llvm_name = "core2",
.features = featureSet(&[_]Feature{
@@ -1563,7 +1564,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const corei7 = Cpu{
+ pub const corei7 = CpuModel{
.name = "corei7",
.llvm_name = "corei7",
.features = featureSet(&[_]Feature{
@@ -1581,7 +1582,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const corei7_avx = Cpu{
+ pub const corei7_avx = CpuModel{
.name = "corei7_avx",
.llvm_name = "corei7-avx",
.features = featureSet(&[_]Feature{
@@ -1610,7 +1611,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const generic = Cpu{
+ pub const generic = CpuModel{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&[_]Feature{
@@ -1619,7 +1620,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const geode = Cpu{
+ pub const geode = CpuModel{
.name = "geode",
.llvm_name = "geode",
.features = featureSet(&[_]Feature{
@@ -1629,7 +1630,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const goldmont = Cpu{
+ pub const goldmont = CpuModel{
.name = "goldmont",
.llvm_name = "goldmont",
.features = featureSet(&[_]Feature{
@@ -1665,7 +1666,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const goldmont_plus = Cpu{
+ pub const goldmont_plus = CpuModel{
.name = "goldmont_plus",
.llvm_name = "goldmont-plus",
.features = featureSet(&[_]Feature{
@@ -1703,7 +1704,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const haswell = Cpu{
+ pub const haswell = CpuModel{
.name = "haswell",
.llvm_name = "haswell",
.features = featureSet(&[_]Feature{
@@ -1744,7 +1745,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const _i386 = Cpu{
+ pub const _i386 = CpuModel{
.name = "_i386",
.llvm_name = "i386",
.features = featureSet(&[_]Feature{
@@ -1752,7 +1753,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const _i486 = Cpu{
+ pub const _i486 = CpuModel{
.name = "_i486",
.llvm_name = "i486",
.features = featureSet(&[_]Feature{
@@ -1760,7 +1761,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const _i586 = Cpu{
+ pub const _i586 = CpuModel{
.name = "_i586",
.llvm_name = "i586",
.features = featureSet(&[_]Feature{
@@ -1769,7 +1770,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const _i686 = Cpu{
+ pub const _i686 = CpuModel{
.name = "_i686",
.llvm_name = "i686",
.features = featureSet(&[_]Feature{
@@ -1779,7 +1780,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const icelake_client = Cpu{
+ pub const icelake_client = CpuModel{
.name = "icelake_client",
.llvm_name = "icelake-client",
.features = featureSet(&[_]Feature{
@@ -1847,7 +1848,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const icelake_server = Cpu{
+ pub const icelake_server = CpuModel{
.name = "icelake_server",
.llvm_name = "icelake-server",
.features = featureSet(&[_]Feature{
@@ -1917,7 +1918,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const ivybridge = Cpu{
+ pub const ivybridge = CpuModel{
.name = "ivybridge",
.llvm_name = "ivybridge",
.features = featureSet(&[_]Feature{
@@ -1949,7 +1950,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const k6 = Cpu{
+ pub const k6 = CpuModel{
.name = "k6",
.llvm_name = "k6",
.features = featureSet(&[_]Feature{
@@ -1959,7 +1960,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const k6_2 = Cpu{
+ pub const k6_2 = CpuModel{
.name = "k6_2",
.llvm_name = "k6-2",
.features = featureSet(&[_]Feature{
@@ -1969,7 +1970,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const k6_3 = Cpu{
+ pub const k6_3 = CpuModel{
.name = "k6_3",
.llvm_name = "k6-3",
.features = featureSet(&[_]Feature{
@@ -1979,7 +1980,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const k8 = Cpu{
+ pub const k8 = CpuModel{
.name = "k8",
.llvm_name = "k8",
.features = featureSet(&[_]Feature{
@@ -1996,7 +1997,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const k8_sse3 = Cpu{
+ pub const k8_sse3 = CpuModel{
.name = "k8_sse3",
.llvm_name = "k8-sse3",
.features = featureSet(&[_]Feature{
@@ -2014,7 +2015,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const knl = Cpu{
+ pub const knl = CpuModel{
.name = "knl",
.llvm_name = "knl",
.features = featureSet(&[_]Feature{
@@ -2057,7 +2058,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const knm = Cpu{
+ pub const knm = CpuModel{
.name = "knm",
.llvm_name = "knm",
.features = featureSet(&[_]Feature{
@@ -2101,12 +2102,12 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const lakemont = Cpu{
+ pub const lakemont = CpuModel{
.name = "lakemont",
.llvm_name = "lakemont",
.features = featureSet(&[_]Feature{}),
};
- pub const nehalem = Cpu{
+ pub const nehalem = CpuModel{
.name = "nehalem",
.llvm_name = "nehalem",
.features = featureSet(&[_]Feature{
@@ -2124,7 +2125,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const nocona = Cpu{
+ pub const nocona = CpuModel{
.name = "nocona",
.llvm_name = "nocona",
.features = featureSet(&[_]Feature{
@@ -2140,7 +2141,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const opteron = Cpu{
+ pub const opteron = CpuModel{
.name = "opteron",
.llvm_name = "opteron",
.features = featureSet(&[_]Feature{
@@ -2157,7 +2158,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const opteron_sse3 = Cpu{
+ pub const opteron_sse3 = CpuModel{
.name = "opteron_sse3",
.llvm_name = "opteron-sse3",
.features = featureSet(&[_]Feature{
@@ -2175,7 +2176,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const penryn = Cpu{
+ pub const penryn = CpuModel{
.name = "penryn",
.llvm_name = "penryn",
.features = featureSet(&[_]Feature{
@@ -2193,7 +2194,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium = Cpu{
+ pub const pentium = CpuModel{
.name = "pentium",
.llvm_name = "pentium",
.features = featureSet(&[_]Feature{
@@ -2202,7 +2203,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium_m = Cpu{
+ pub const pentium_m = CpuModel{
.name = "pentium_m",
.llvm_name = "pentium-m",
.features = featureSet(&[_]Feature{
@@ -2216,7 +2217,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium_mmx = Cpu{
+ pub const pentium_mmx = CpuModel{
.name = "pentium_mmx",
.llvm_name = "pentium-mmx",
.features = featureSet(&[_]Feature{
@@ -2226,7 +2227,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium2 = Cpu{
+ pub const pentium2 = CpuModel{
.name = "pentium2",
.llvm_name = "pentium2",
.features = featureSet(&[_]Feature{
@@ -2239,7 +2240,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium3 = Cpu{
+ pub const pentium3 = CpuModel{
.name = "pentium3",
.llvm_name = "pentium3",
.features = featureSet(&[_]Feature{
@@ -2253,7 +2254,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium3m = Cpu{
+ pub const pentium3m = CpuModel{
.name = "pentium3m",
.llvm_name = "pentium3m",
.features = featureSet(&[_]Feature{
@@ -2267,7 +2268,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium4 = Cpu{
+ pub const pentium4 = CpuModel{
.name = "pentium4",
.llvm_name = "pentium4",
.features = featureSet(&[_]Feature{
@@ -2281,7 +2282,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentium4m = Cpu{
+ pub const pentium4m = CpuModel{
.name = "pentium4m",
.llvm_name = "pentium4m",
.features = featureSet(&[_]Feature{
@@ -2295,7 +2296,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const pentiumpro = Cpu{
+ pub const pentiumpro = CpuModel{
.name = "pentiumpro",
.llvm_name = "pentiumpro",
.features = featureSet(&[_]Feature{
@@ -2306,7 +2307,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const prescott = Cpu{
+ pub const prescott = CpuModel{
.name = "prescott",
.llvm_name = "prescott",
.features = featureSet(&[_]Feature{
@@ -2320,7 +2321,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const sandybridge = Cpu{
+ pub const sandybridge = CpuModel{
.name = "sandybridge",
.llvm_name = "sandybridge",
.features = featureSet(&[_]Feature{
@@ -2349,7 +2350,7 @@ pub const cpu = struct {
.xsaveopt,
}),
};
- pub const silvermont = Cpu{
+ pub const silvermont = CpuModel{
.name = "silvermont",
.llvm_name = "silvermont",
.features = featureSet(&[_]Feature{
@@ -2377,7 +2378,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const skx = Cpu{
+ pub const skx = CpuModel{
.name = "skx",
.llvm_name = "skx",
.features = featureSet(&[_]Feature{
@@ -2434,7 +2435,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const skylake = Cpu{
+ pub const skylake = CpuModel{
.name = "skylake",
.llvm_name = "skylake",
.features = featureSet(&[_]Feature{
@@ -2485,7 +2486,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const skylake_avx512 = Cpu{
+ pub const skylake_avx512 = CpuModel{
.name = "skylake_avx512",
.llvm_name = "skylake-avx512",
.features = featureSet(&[_]Feature{
@@ -2542,7 +2543,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const slm = Cpu{
+ pub const slm = CpuModel{
.name = "slm",
.llvm_name = "slm",
.features = featureSet(&[_]Feature{
@@ -2570,7 +2571,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const tremont = Cpu{
+ pub const tremont = CpuModel{
.name = "tremont",
.llvm_name = "tremont",
.features = featureSet(&[_]Feature{
@@ -2613,7 +2614,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const westmere = Cpu{
+ pub const westmere = CpuModel{
.name = "westmere",
.llvm_name = "westmere",
.features = featureSet(&[_]Feature{
@@ -2632,7 +2633,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const winchip_c6 = Cpu{
+ pub const winchip_c6 = CpuModel{
.name = "winchip_c6",
.llvm_name = "winchip-c6",
.features = featureSet(&[_]Feature{
@@ -2641,7 +2642,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const winchip2 = Cpu{
+ pub const winchip2 = CpuModel{
.name = "winchip2",
.llvm_name = "winchip2",
.features = featureSet(&[_]Feature{
@@ -2650,7 +2651,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const x86_64 = Cpu{
+ pub const x86_64 = CpuModel{
.name = "x86_64",
.llvm_name = "x86-64",
.features = featureSet(&[_]Feature{
@@ -2667,7 +2668,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const yonah = Cpu{
+ pub const yonah = CpuModel{
.name = "yonah",
.llvm_name = "yonah",
.features = featureSet(&[_]Feature{
@@ -2681,7 +2682,7 @@ pub const cpu = struct {
.x87,
}),
};
- pub const znver1 = Cpu{
+ pub const znver1 = CpuModel{
.name = "znver1",
.llvm_name = "znver1",
.features = featureSet(&[_]Feature{
@@ -2725,7 +2726,7 @@ pub const cpu = struct {
.xsaves,
}),
};
- pub const znver2 = Cpu{
+ pub const znver2 = CpuModel{
.name = "znver2",
.llvm_name = "znver2",
.features = featureSet(&[_]Feature{
@@ -2777,7 +2778,7 @@ pub const cpu = struct {
/// All x86 CPUs, sorted alphabetically by name.
/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
/// compiler has inefficient memory and CPU usage, affecting build times.
-pub const all_cpus = &[_]*const Cpu{
+pub const all_cpus = &[_]*const CpuModel{
&cpu.amdfam10,
&cpu.athlon,
&cpu.athlon_4,