From 5bc4690d85bfaade48393c182b2b3aa207ebebc7 Mon Sep 17 00:00:00 2001 From: Layne Gustafson Date: Tue, 17 Dec 2019 09:45:30 -0500 Subject: Make targets cmd able to list CPUs and features --- src/userland.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/userland.cpp') diff --git a/src/userland.cpp b/src/userland.cpp index 263ef0cbc3..87ef99c03a 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -88,3 +88,6 @@ void stage2_progress_end(Stage2ProgressNode *node) {} void stage2_progress_complete_one(Stage2ProgressNode *node) {} void stage2_progress_disable_tty(Stage2Progress *progress) {} void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){} + +void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} +void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} -- cgit v1.2.3 From bd6ef21f8556b3872c5780eee70621e6c66a0aa4 Mon Sep 17 00:00:00 2001 From: Layne Gustafson Date: Fri, 20 Dec 2019 21:46:42 -0500 Subject: Add cpu/feature specification to cmndline --- src-self-hosted/stage1.zig | 95 ++++++++++++++++++++++++++++++++++++++++++++-- src/all_types.hpp | 3 ++ src/codegen.cpp | 9 +++++ src/main.cpp | 16 ++++++++ src/userland.cpp | 1 + src/userland.h | 3 ++ 6 files changed, 123 insertions(+), 4 deletions(-) (limited to 'src/userland.cpp') diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 1544fcbc8f..8734b37a02 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -531,12 +531,12 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz // ABI warning export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_subfeatures: bool) void { - print_features_for_arch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { + printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); }; } -fn print_features_for_arch(arch_name: []const u8, show_subfeatures: bool) !void { +fn printFeaturesForArch(arch_name: []const u8, show_subfeatures: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { @@ -575,12 +575,12 @@ fn print_features_for_arch(arch_name: []const u8, show_subfeatures: bool) !void // ABI warning export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_subfeatures: bool) void { - print_cpus_for_arch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { + printCpusForArch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); }; } -fn print_cpus_for_arch(arch_name: []const u8, show_subfeatures: bool) !void { +fn printCpusForArch(arch_name: []const u8, show_subfeatures: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { @@ -618,3 +618,90 @@ fn print_cpus_for_arch(arch_name: []const u8, show_subfeatures: bool) !void { } // use target_arch_name(ZigLLVM_ArchType) to get name from main.cpp 'target'. +// ABI warning +export fn stage2_validate_cpu_and_features( + arch_name: [*:0]const u8, + cpu: ?[*:0]const u8, + features: ?[*:0]const u8, +) bool { + const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_name)) catch { + std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{ arch_name }); + return false; + }; + + const res = validateCpuAndFeatures( + arch, + if (cpu) |def_cpu| std.mem.toSliceConst(u8, def_cpu) else "", + if (features) |def_features| std.mem.toSliceConst(u8, def_features) else ""); + + switch (res) { + .Ok => return true, + .InvalidCpu => |invalid_cpu| { + std.debug.warn("Invalid CPU '{}'\n", .{ invalid_cpu }); + return false; + }, + .InvalidFeaturesString => { + std.debug.warn("Invalid features string\n", .{}); + std.debug.warn("Must have format \"+yes_feature,-no_feature\"\n", .{}); + return false; + }, + .InvalidFeature => |invalid_feature| { + std.debug.warn("Invalid feature '{}'\n", .{ invalid_feature }); + return false; + } + } +} + +const ValidateCpuAndFeaturesResult = union(enum) { + Ok, + InvalidCpu: []const u8, + InvalidFeaturesString, + InvalidFeature: []const u8, +}; + +fn validateCpuAndFeatures(arch: @TagType(std.Target.Arch), cpu: []const u8, features: []const u8) ValidateCpuAndFeaturesResult { + + const known_cpus = std.target.getCpusForArch(arch); + const known_features = std.target.getFeaturesForArch(arch); + + if (cpu.len > 0) { + var found_cpu = false; + for (known_cpus) |known_cpu| { + if (std.mem.eql(u8, cpu, known_cpu.name)) { + found_cpu = true; + break; + } + } + + if (!found_cpu) { + return .{ .InvalidCpu = cpu }; + } + } + + if (features.len > 0) { + var start: usize = 0; + while (start < features.len) { + const next_comma_pos = std.mem.indexOfScalar(u8, features[start..], ',') orelse features.len - start; + var feature = features[start..start+next_comma_pos]; + + if (feature.len < 2) return .{ .InvalidFeaturesString = {} }; + + if (feature[0] != '+' and feature[0] != '-') return .{ .InvalidFeaturesString = {} }; + feature = feature[1..]; + + var found_feature = false; + for (known_features) |known_feature| { + if (std.mem.eql(u8, feature, known_feature.name)) { + found_feature = true; + break; + } + } + + if (!found_feature) return .{ .InvalidFeature = feature }; + + start += next_comma_pos + 1; + } + } + + return .{ .Ok = {} }; +} diff --git a/src/all_types.hpp b/src/all_types.hpp index df52c29a4e..af4914e29e 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2215,6 +2215,9 @@ struct CodeGen { const char **clang_argv; size_t clang_argv_len; + + const char *llvm_cpu; + const char *llvm_features; }; struct ZigVar { diff --git a/src/codegen.cpp b/src/codegen.cpp index 3d4d2a8c31..43fc002a12 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8800,6 +8800,15 @@ static void init(CodeGen *g) { target_specific_features = ""; } + // Override CPU and features if non-null. + if (g->llvm_cpu != nullptr) { + target_specific_cpu_args = g->llvm_cpu; + } + + if (g->llvm_features != nullptr) { + target_specific_features = g->llvm_features; + } + g->target_machine = ZigLLVMCreateTargetMachine(target_ref, buf_ptr(&g->llvm_triple_str), target_specific_cpu_args, target_specific_features, opt_level, reloc_mode, LLVMCodeModelDefault, g->function_sections); diff --git a/src/main.cpp b/src/main.cpp index ee2faa9a78..f061b13414 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,6 +100,8 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " --override-lib-dir [arg] override path to Zig lib directory\n" " -ffunction-sections places each function in a separate section\n" " -D[macro]=[value] define C [macro] to [value] (1 if [value] omitted)\n" + " --cpu [cpu] compile for [cpu] on the current target\n" + " --features [feature_str] compile with features in [feature_str] on the current target\n" "\n" "Link Options:\n" " --bundle-compiler-rt for static libraries, include compiler-rt symbols\n" @@ -533,6 +535,8 @@ int main(int argc, char **argv) { WantStackCheck want_stack_check = WantStackCheckAuto; WantCSanitize want_sanitize_c = WantCSanitizeAuto; bool function_sections = false; + const char *cpu = ""; + const char *features = ""; const char *targets_list_features_arch = nullptr; const char *targets_list_cpus_arch = nullptr; @@ -951,6 +955,10 @@ int main(int argc, char **argv) { targets_list_features_arch = argv[i]; } else if (strcmp(arg, "--list-cpus") == 0) { targets_list_cpus_arch = argv[i]; + } else if (strcmp(arg, "--cpu") == 0) { + cpu = argv[i]; + } else if (strcmp(arg, "--features") == 0) { + features = argv[i]; }else { fprintf(stderr, "Invalid argument: %s\n", arg); return print_error_usage(arg0); @@ -1248,6 +1256,7 @@ int main(int argc, char **argv) { g->system_linker_hack = system_linker_hack; g->function_sections = function_sections; + for (size_t i = 0; i < lib_dirs.length; i += 1) { codegen_add_lib_dir(g, lib_dirs.at(i)); } @@ -1269,6 +1278,13 @@ int main(int argc, char **argv) { codegen_add_rpath(g, rpath_list.at(i)); } + if (!stage2_validate_cpu_and_features(target_arch_name(target.arch), cpu, features)) { + return 1; + } + + g->llvm_cpu = cpu; + g->llvm_features = features; + codegen_set_rdynamic(g, rdynamic); if (mmacosx_version_min && mios_version_min) { fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n"); diff --git a/src/userland.cpp b/src/userland.cpp index 87ef99c03a..e0c8b33fa2 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -91,3 +91,4 @@ void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_coun void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} +bool stage2_validate_cpu_and_features(const char *arch_name, const char *cpu, const char *features) { return true; } diff --git a/src/userland.h b/src/userland.h index c85684cb36..9d3e9623fb 100644 --- a/src/userland.h +++ b/src/userland.h @@ -180,4 +180,7 @@ ZIG_EXTERN_C void stage2_list_features_for_arch(const char *arch_name_ptr, size_ // ABI warning ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures); +// ABI warning +ZIG_EXTERN_C bool stage2_validate_cpu_and_features(const char *arch_name, const char *cpu, const char *features); + #endif -- cgit v1.2.3 From c61856ebcf54a55f1c17a5fd6a3b3300115b2c65 Mon Sep 17 00:00:00 2001 From: Layne Gustafson Date: Wed, 8 Jan 2020 20:27:36 -0500 Subject: Add TargetDetails abstraction --- lib/std/build.zig | 42 ++++----- lib/std/target.zig | 6 ++ src-self-hosted/stage1.zig | 215 +++++++++++++++++++++++++++++---------------- src/all_types.hpp | 3 +- src/codegen.cpp | 23 ++--- src/main.cpp | 25 ++++-- src/userland.cpp | 16 +++- src/userland.h | 17 +++- 8 files changed, 223 insertions(+), 124 deletions(-) (limited to 'src/userland.cpp') diff --git a/lib/std/build.zig b/lib/std/build.zig index 65c5a6f064..72fb173ac9 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1199,8 +1199,7 @@ pub const LibExeObjStep = struct { subsystem: ?builtin.SubSystem = null, - cpu: ?[]const u8 = null, - features: ?[]const u8 = null, + target_details: ?std.target.TargetDetails = null, const LinkObject = union(enum) { StaticPath: []const u8, @@ -1387,21 +1386,8 @@ pub const LibExeObjStep = struct { self.computeOutFileNames(); } - pub fn setCpu(self: *LibExeObjStep, cpu: *const std.target.Cpu) void { - self.cpu = cpu.name; - } - - pub fn setFeatures(self: *LibExeObjStep, features: []*const std.target.Feature) void { - var features_str_buffer = std.Buffer.init(self.builder.allocator, "") catch unreachable; - defer features_str_buffer.deinit(); - - for (features) |feature| { - features_str_buffer.append("+") catch unreachable; - features_str_buffer.append(feature.name) catch unreachable; - features_str_buffer.append(",") catch unreachable; - } - - self.features = features_str_buffer.toOwnedSlice(); + pub fn setTargetDetails(self: *LibExeObjStep, target_details: std.target.TargetDetails) void { + self.target_details = target_details; } pub fn setTargetGLibC(self: *LibExeObjStep, major: u32, minor: u32, patch: u32) void { @@ -1994,14 +1980,20 @@ pub const LibExeObjStep = struct { }, } - if (self.cpu) |cpu| { - try zig_args.append("--cpu"); - try zig_args.append(cpu); - } - - if (self.features) |features| { - try zig_args.append("--features"); - try zig_args.append(features); + if (self.target_details) |td| { + switch (td) { + .cpu => |cpu| { + try zig_args.append("--cpu"); + try zig_args.append(cpu.name); + }, + .features => |features| { + try zig_args.append("--features"); + for (features) |feature| { + try zig_args.append(feature.name); + try zig_args.append(","); + } + }, + } } if (self.target_glibc) |ver| { diff --git a/lib/std/target.zig b/lib/std/target.zig index 8a86af6733..9bb4936f11 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -860,6 +860,7 @@ pub const x86 = @import("target/x86.zig"); pub const Feature = struct { name: []const u8, + llvm_name: []const u8, description: []const u8, dependencies: []*const Feature, @@ -872,6 +873,11 @@ pub const Cpu = struct { dependencies: []*const Feature, }; +pub const TargetDetails = union(enum) { + cpu: *const Cpu, + features: []*const Feature, +}; + pub fn getFeaturesForArch(arch: @TagType(Target.Arch)) []*const Feature { return switch (arch) { .arm, .armeb, .thumb, .thumbeb => arm.features, diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 8734b37a02..4fdfb05df8 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -530,13 +530,13 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz } // ABI warning -export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_subfeatures: bool) void { - printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { +export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { + printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); }; } -fn printFeaturesForArch(arch_name: []const u8, show_subfeatures: bool) !void { +fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { @@ -565,22 +565,22 @@ fn printFeaturesForArch(arch_name: []const u8, show_subfeatures: bool) !void { try stdout_stream.print(" - {}\n", .{ feature.description }); - if (show_subfeatures and feature.subfeatures.len > 0) { - for (feature.subfeatures) |subfeature| { - try stdout_stream.print(" {}\n", .{ subfeature.name }); + if (show_dependencies and feature.dependencies.len > 0) { + for (feature.dependencies) |dependency| { + try stdout_stream.print(" {}\n", .{ dependency.name }); } } } } // ABI warning -export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_subfeatures: bool) void { - printCpusForArch(arch_name_ptr[0..arch_name_len], show_subfeatures) catch |err| { +export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { + printCpusForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); }; } -fn printCpusForArch(arch_name: []const u8, show_subfeatures: bool) !void { +fn printCpusForArch(arch_name: []const u8, show_dependencies: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { @@ -609,99 +609,158 @@ fn printCpusForArch(arch_name: []const u8, show_subfeatures: bool) !void { try stdout_stream.write("\n"); - if (show_subfeatures and cpu.subfeatures.len > 0) { - for (cpu.subfeatures) |subfeature| { - try stdout_stream.print(" {}\n", .{ subfeature.name }); + if (show_dependencies and cpu.dependencies.len > 0) { + for (cpu.dependencies) |dependency| { + try stdout_stream.print(" {}\n", .{ dependency.name }); } } } } -// use target_arch_name(ZigLLVM_ArchType) to get name from main.cpp 'target'. +const Stage2TargetDetails = struct { + allocator: *std.mem.Allocator, + target_details: std.target.TargetDetails, + + llvm_cpu_str: [:0]const u8, + llvm_features_str: [:0]const u8, +}; + // ABI warning -export fn stage2_validate_cpu_and_features( - arch_name: [*:0]const u8, - cpu: ?[*:0]const u8, - features: ?[*:0]const u8, -) bool { - const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_name)) catch { - std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{ arch_name }); - return false; +export fn stage2_target_details_parse_cpu(arch_str: ?[*:0]const u8, cpu_str: ?[*:0]const u8) ?*Stage2TargetDetails { + if (cpu_str == null) return null; + if (arch_str == null) return null; + + const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch { + return null; + }; + return parseCpu(arch, std.mem.toSliceConst(u8, cpu_str.?)) catch |err| { + switch (err) { + error.OutOfMemory => @panic("out of memory"), + else => return null, + } + }; +} + +// ABI warning +export fn stage2_target_details_parse_features(arch_str: ?[*:0]const u8, features_str: ?[*:0]const u8) ?*Stage2TargetDetails { + if (features_str == null) return null; + if (arch_str == null) return null; + + const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch return null; + return parseFeatures(arch, std.mem.toSliceConst(u8, features_str.?)) catch |err| { + switch (err) { + error.OutOfMemory => @panic("out of memory"), + else => return null, + } }; +} - const res = validateCpuAndFeatures( - arch, - if (cpu) |def_cpu| std.mem.toSliceConst(u8, def_cpu) else "", - if (features) |def_features| std.mem.toSliceConst(u8, def_features) else ""); +fn parseCpu(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDetails { + const cpus = std.target.getCpusForArch(arch); - switch (res) { - .Ok => return true, - .InvalidCpu => |invalid_cpu| { - std.debug.warn("Invalid CPU '{}'\n", .{ invalid_cpu }); - return false; - }, - .InvalidFeaturesString => { - std.debug.warn("Invalid features string\n", .{}); - std.debug.warn("Must have format \"+yes_feature,-no_feature\"\n", .{}); - return false; - }, - .InvalidFeature => |invalid_feature| { - std.debug.warn("Invalid feature '{}'\n", .{ invalid_feature }); - return false; + for (cpus) |cpu| { + if (std.mem.eql(u8, str, cpu.name)) { + const allocator = std.heap.c_allocator; + + const ptr = try allocator.create(Stage2TargetDetails); + ptr.* = .{ + .allocator = allocator, + .target_details = .{ + .cpu = cpu, + }, + .llvm_cpu_str = cpu.name, + .llvm_features_str = "", + }; + + return ptr; } } -} -const ValidateCpuAndFeaturesResult = union(enum) { - Ok, - InvalidCpu: []const u8, - InvalidFeaturesString, - InvalidFeature: []const u8, -}; + return error.InvalidCpu; +} -fn validateCpuAndFeatures(arch: @TagType(std.Target.Arch), cpu: []const u8, features: []const u8) ValidateCpuAndFeaturesResult { +fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDetails { + const allocator = std.heap.c_allocator; - const known_cpus = std.target.getCpusForArch(arch); const known_features = std.target.getFeaturesForArch(arch); - - if (cpu.len > 0) { - var found_cpu = false; - for (known_cpus) |known_cpu| { - if (std.mem.eql(u8, cpu, known_cpu.name)) { - found_cpu = true; + + var features = std.ArrayList(*const std.target.Feature).init(allocator); + defer features.deinit(); + + var start: usize = 0; + while (start < str.len) { + const next_comma_pos = std.mem.indexOfScalar(u8, str[start..], ',') orelse str.len - start; + const feature_str = std.mem.trim(u8, str[start..start+next_comma_pos], " "); + + start += next_comma_pos + 1; + + if (feature_str.len == 0) continue; + + var feature: ?*const std.target.Feature = null; + for (known_features) |known_feature| { + if (std.mem.eql(u8, feature_str, known_feature.name)) { + feature = known_feature; break; } } - if (!found_cpu) { - return .{ .InvalidCpu = cpu }; + if (feature) |f| { + features.append(f) catch @panic("out of memory"); + } else { + return error.InvalidFeature; } } + + const features_slice = features.toOwnedSlice(); - if (features.len > 0) { - var start: usize = 0; - while (start < features.len) { - const next_comma_pos = std.mem.indexOfScalar(u8, features[start..], ',') orelse features.len - start; - var feature = features[start..start+next_comma_pos]; - - if (feature.len < 2) return .{ .InvalidFeaturesString = {} }; - - if (feature[0] != '+' and feature[0] != '-') return .{ .InvalidFeaturesString = {} }; - feature = feature[1..]; - - var found_feature = false; - for (known_features) |known_feature| { - if (std.mem.eql(u8, feature, known_feature.name)) { - found_feature = true; - break; - } - } + var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); + defer llvm_features_buffer.deinit(); - if (!found_feature) return .{ .InvalidFeature = feature }; + for (features_slice) |feature| { + try llvm_features_buffer.append("+"); + try llvm_features_buffer.append(feature.llvm_name); + try llvm_features_buffer.append(","); + } - start += next_comma_pos + 1; - } + const ptr = try allocator.create(Stage2TargetDetails); + ptr.* = Stage2TargetDetails{ + .allocator = allocator, + .target_details = std.target.TargetDetails{ + .features = features_slice, + }, + .llvm_cpu_str = "", + .llvm_features_str = llvm_features_buffer.toOwnedSlice(), + }; + + return ptr; +} + +// ABI warning +export fn stage2_target_details_get_cache_str(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { + if (target_details) |td| { + return @as([*:0]const u8, switch (td.target_details) { + .cpu => td.llvm_cpu_str, + .features => td.llvm_features_str, + }); + } + + return @as([*:0]const u8, ""); +} + +// ABI warning +export fn stage2_target_details_get_llvm_cpu(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { + if (target_details) |td| { + return @as([*:0]const u8, td.llvm_cpu_str); + } + + return @as([*:0]const u8, ""); +} + +// ABI warning +export fn stage2_target_details_get_llvm_features(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { + if (target_details) |td| { + return @as([*:0]const u8, td.llvm_features_str); } - return .{ .Ok = {} }; + return @as([*:0]const u8, ""); } diff --git a/src/all_types.hpp b/src/all_types.hpp index af4914e29e..d81e401232 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2216,8 +2216,7 @@ struct CodeGen { const char **clang_argv; size_t clang_argv_len; - const char *llvm_cpu; - const char *llvm_features; + Stage2TargetDetails *target_details; }; struct ZigVar { diff --git a/src/codegen.cpp b/src/codegen.cpp index 798f406c8e..760284a2e2 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8655,8 +8655,10 @@ static Error define_builtin_compile_vars(CodeGen *g) { cache_bool(&cache_hash, g->valgrind_support); cache_bool(&cache_hash, g->link_eh_frame_hdr); cache_int(&cache_hash, detect_subsystem(g)); - if (g->llvm_cpu) cache_str(&cache_hash, g->llvm_cpu); - if (g->llvm_features) cache_str(&cache_hash, g->llvm_features); + + if (g->target_details) { + cache_str(&cache_hash, stage2_target_details_get_cache_str(g->target_details)); + } Buf digest = BUF_INIT; buf_resize(&digest, 0); @@ -8802,15 +8804,12 @@ static void init(CodeGen *g) { target_specific_features = ""; } - // Override CPU and features if non-null. - if (g->llvm_cpu != nullptr) { - target_specific_cpu_args = g->llvm_cpu; + // Override CPU and features if defined by user. + if (g->target_details) { + target_specific_cpu_args = stage2_target_details_get_llvm_cpu(g->target_details); + target_specific_features = stage2_target_details_get_llvm_features(g->target_details); } - if (g->llvm_features != nullptr) { - target_specific_features = g->llvm_features; - } - g->target_machine = ZigLLVMCreateTargetMachine(target_ref, buf_ptr(&g->llvm_triple_str), target_specific_cpu_args, target_specific_features, opt_level, reloc_mode, LLVMCodeModelDefault, g->function_sections); @@ -10390,8 +10389,10 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { } cache_buf_opt(ch, g->dynamic_linker_path); cache_buf_opt(ch, g->version_script_path); - if (g->llvm_cpu) cache_str(ch, g->llvm_cpu); - if (g->llvm_features) cache_str(ch, g->llvm_features); + + if (g->target_details) { + cache_str(ch, stage2_target_details_get_cache_str(g->target_details)); + } // gen_c_objects appends objects to g->link_objects which we want to include in the hash gen_c_objects(g); diff --git a/src/main.cpp b/src/main.cpp index 32efb9f020..da8b354796 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -535,8 +535,8 @@ int main(int argc, char **argv) { WantStackCheck want_stack_check = WantStackCheckAuto; WantCSanitize want_sanitize_c = WantCSanitizeAuto; bool function_sections = false; - const char *cpu = ""; - const char *features = ""; + const char *cpu = nullptr; + const char *features = nullptr; const char *targets_list_features_arch = nullptr; const char *targets_list_cpus_arch = nullptr; @@ -1278,12 +1278,25 @@ int main(int argc, char **argv) { codegen_add_rpath(g, rpath_list.at(i)); } - if (!stage2_validate_cpu_and_features(target_arch_name(target.arch), cpu, features)) { - return 1; + Stage2TargetDetails *target_details = nullptr; + if (cpu && features) { + fprintf(stderr, "--cpu and --features options not allowed together\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } else if (cpu) { + target_details = stage2_target_details_parse_cpu(target_arch_name(target.arch), cpu); + if (!target_details) { + fprintf(stderr, "invalid --cpu value\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } else if (features) { + target_details = stage2_target_details_parse_features(target_arch_name(target.arch), features); + if (!target_details) { + fprintf(stderr, "invalid --features value\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } } - g->llvm_cpu = cpu; - g->llvm_features = features; + g->target_details = target_details; codegen_set_rdynamic(g, rdynamic); if (mmacosx_version_min && mios_version_min) { diff --git a/src/userland.cpp b/src/userland.cpp index e0c8b33fa2..468017cb51 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -91,4 +91,18 @@ void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_coun void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} -bool stage2_validate_cpu_and_features(const char *arch_name, const char *cpu, const char *features) { return true; } +Stage2TargetDetails *stage2_target_details_parse_cpu(const char *arch, const char *str) { + return nullptr; +} +Stage2TargetDetails *stage2_target_details_parse_features(const char *arch, const char *str) { + return nullptr; +} +const char *stage2_target_details_get_cache_str(const Stage2TargetDetails *target_details) { + return ""; +} +const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDetails *target_details) { + return ""; +} +const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details) { + return ""; +} diff --git a/src/userland.h b/src/userland.h index 9d3e9623fb..11801e1038 100644 --- a/src/userland.h +++ b/src/userland.h @@ -181,6 +181,21 @@ ZIG_EXTERN_C void stage2_list_features_for_arch(const char *arch_name_ptr, size_ ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures); // ABI warning -ZIG_EXTERN_C bool stage2_validate_cpu_and_features(const char *arch_name, const char *cpu, const char *features); +struct Stage2TargetDetails; + +// ABI warning +ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_parse_cpu(const char *arch, const char *str); + +// ABI warning +ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_parse_features(const char *arch, const char *str); + +// ABI warning +ZIG_EXTERN_C const char *stage2_target_details_get_cache_str(const Stage2TargetDetails *target_details); + +// ABI warning +ZIG_EXTERN_C const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDetails *target_details); + +// ABI warning +ZIG_EXTERN_C const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details); #endif -- cgit v1.2.3 From 03dd376b55a57cbc10269f771f72ced1eaa7aabb Mon Sep 17 00:00:00 2001 From: Layne Gustafson Date: Wed, 8 Jan 2020 21:35:26 -0500 Subject: Add builtin.zig support --- lib/std/build.zig | 10 +- lib/std/target/aarch64.zig | 648 ++++----- lib/std/target/amdgpu.zig | 1068 +++++++-------- lib/std/target/arm.zig | 844 ++++++------ lib/std/target/avr.zig | 3182 ++++++++++++++++++++++---------------------- lib/std/target/hexagon.zig | 8 +- lib/std/target/mips.zig | 226 ++-- lib/std/target/powerpc.zig | 42 +- lib/std/target/riscv.zig | 8 +- lib/std/target/sparc.zig | 18 +- lib/std/target/systemz.zig | 68 +- lib/std/target/wasm.zig | 16 +- lib/std/target/x86.zig | 136 +- src-self-hosted/stage1.zig | 36 + src/codegen.cpp | 8 + src/main.cpp | 37 +- src/userland.cpp | 3 + src/userland.h | 3 + 18 files changed, 3209 insertions(+), 3152 deletions(-) (limited to 'src/userland.cpp') diff --git a/lib/std/build.zig b/lib/std/build.zig index 72fb173ac9..72d26ff047 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1988,10 +1988,16 @@ pub const LibExeObjStep = struct { }, .features => |features| { try zig_args.append("--features"); + + var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0); + defer feature_str_buffer.deinit(); + for (features) |feature| { - try zig_args.append(feature.name); - try zig_args.append(","); + try feature_str_buffer.append(feature.name); + try feature_str_buffer.append(","); } + + try zig_args.append(feature_str_buffer.toOwnedSlice()); }, } } diff --git a/lib/std/target/aarch64.zig b/lib/std/target/aarch64.zig index 404a55e7a5..c3c530fb6f 100644 --- a/lib/std/target/aarch64.zig +++ b/lib/std/target/aarch64.zig @@ -19,7 +19,7 @@ pub const feature_am = Feature{ }; pub const feature_aggressiveFma = Feature{ - .name = "aggressive-fma", + .name = "aggressiveFma", .llvm_name = "aggressive-fma", .description = "Enable Aggressive FMA for floating-point.", .dependencies = &[_]*const Feature { @@ -35,7 +35,7 @@ pub const feature_altnzcv = Feature{ }; pub const feature_alternateSextloadCvtF32Pattern = Feature{ - .name = "alternate-sextload-cvt-f32-pattern", + .name = "alternateSextloadCvtF32Pattern", .llvm_name = "alternate-sextload-cvt-f32-pattern", .description = "Use alternative pattern for sextload convert to f32", .dependencies = &[_]*const Feature { @@ -43,7 +43,7 @@ pub const feature_alternateSextloadCvtF32Pattern = Feature{ }; pub const feature_arithBccFusion = Feature{ - .name = "arith-bcc-fusion", + .name = "arithBccFusion", .llvm_name = "arith-bcc-fusion", .description = "CPU fuses arithmetic+bcc operations", .dependencies = &[_]*const Feature { @@ -51,7 +51,7 @@ pub const feature_arithBccFusion = Feature{ }; pub const feature_arithCbzFusion = Feature{ - .name = "arith-cbz-fusion", + .name = "arithCbzFusion", .llvm_name = "arith-cbz-fusion", .description = "CPU fuses arithmetic + cbz/cbnz operations", .dependencies = &[_]*const Feature { @@ -59,7 +59,7 @@ pub const feature_arithCbzFusion = Feature{ }; pub const feature_balanceFpOps = Feature{ - .name = "balance-fp-ops", + .name = "balanceFpOps", .llvm_name = "balance-fp-ops", .description = "balance mix of odd and even D-registers for fp multiply(-accumulate) ops", .dependencies = &[_]*const Feature { @@ -107,7 +107,7 @@ pub const feature_ccdp = Feature{ }; pub const feature_callSavedX8 = Feature{ - .name = "call-saved-x8", + .name = "callSavedX8", .llvm_name = "call-saved-x8", .description = "Make X8 callee saved.", .dependencies = &[_]*const Feature { @@ -115,7 +115,7 @@ pub const feature_callSavedX8 = Feature{ }; pub const feature_callSavedX9 = Feature{ - .name = "call-saved-x9", + .name = "callSavedX9", .llvm_name = "call-saved-x9", .description = "Make X9 callee saved.", .dependencies = &[_]*const Feature { @@ -123,7 +123,7 @@ pub const feature_callSavedX9 = Feature{ }; pub const feature_callSavedX10 = Feature{ - .name = "call-saved-x10", + .name = "callSavedX10", .llvm_name = "call-saved-x10", .description = "Make X10 callee saved.", .dependencies = &[_]*const Feature { @@ -131,7 +131,7 @@ pub const feature_callSavedX10 = Feature{ }; pub const feature_callSavedX11 = Feature{ - .name = "call-saved-x11", + .name = "callSavedX11", .llvm_name = "call-saved-x11", .description = "Make X11 callee saved.", .dependencies = &[_]*const Feature { @@ -139,7 +139,7 @@ pub const feature_callSavedX11 = Feature{ }; pub const feature_callSavedX12 = Feature{ - .name = "call-saved-x12", + .name = "callSavedX12", .llvm_name = "call-saved-x12", .description = "Make X12 callee saved.", .dependencies = &[_]*const Feature { @@ -147,7 +147,7 @@ pub const feature_callSavedX12 = Feature{ }; pub const feature_callSavedX13 = Feature{ - .name = "call-saved-x13", + .name = "callSavedX13", .llvm_name = "call-saved-x13", .description = "Make X13 callee saved.", .dependencies = &[_]*const Feature { @@ -155,7 +155,7 @@ pub const feature_callSavedX13 = Feature{ }; pub const feature_callSavedX14 = Feature{ - .name = "call-saved-x14", + .name = "callSavedX14", .llvm_name = "call-saved-x14", .description = "Make X14 callee saved.", .dependencies = &[_]*const Feature { @@ -163,7 +163,7 @@ pub const feature_callSavedX14 = Feature{ }; pub const feature_callSavedX15 = Feature{ - .name = "call-saved-x15", + .name = "callSavedX15", .llvm_name = "call-saved-x15", .description = "Make X15 callee saved.", .dependencies = &[_]*const Feature { @@ -171,7 +171,7 @@ pub const feature_callSavedX15 = Feature{ }; pub const feature_callSavedX18 = Feature{ - .name = "call-saved-x18", + .name = "callSavedX18", .llvm_name = "call-saved-x18", .description = "Make X18 callee saved.", .dependencies = &[_]*const Feature { @@ -197,7 +197,7 @@ pub const feature_crypto = Feature{ }; pub const feature_customCheapAsMove = Feature{ - .name = "custom-cheap-as-move", + .name = "customCheapAsMove", .llvm_name = "custom-cheap-as-move", .description = "Use custom handling of cheap instructions", .dependencies = &[_]*const Feature { @@ -213,7 +213,7 @@ pub const feature_dit = Feature{ }; pub const feature_disableLatencySchedHeuristic = Feature{ - .name = "disable-latency-sched-heuristic", + .name = "disableLatencySchedHeuristic", .llvm_name = "disable-latency-sched-heuristic", .description = "Disable latency scheduling heuristic", .dependencies = &[_]*const Feature { @@ -238,7 +238,7 @@ pub const feature_ete = Feature{ }; pub const feature_exynosCheapAsMove = Feature{ - .name = "exynos-cheap-as-move", + .name = "exynosCheapAsMove", .llvm_name = "exynos-cheap-as-move", .description = "Use Exynos specific handling of cheap instructions", .dependencies = &[_]*const Feature { @@ -264,7 +264,7 @@ pub const feature_fp16fml = Feature{ }; pub const feature_fpArmv8 = Feature{ - .name = "fp-armv8", + .name = "fpArmv8", .llvm_name = "fp-armv8", .description = "Enable ARMv8 FP", .dependencies = &[_]*const Feature { @@ -280,7 +280,7 @@ pub const feature_fptoint = Feature{ }; pub const feature_force32bitJumpTables = Feature{ - .name = "force-32bit-jump-tables", + .name = "force32bitJumpTables", .llvm_name = "force-32bit-jump-tables", .description = "Force jump table entries to be 32-bits wide except at MinSize", .dependencies = &[_]*const Feature { @@ -297,7 +297,7 @@ pub const feature_fullfp16 = Feature{ }; pub const feature_fuseAes = Feature{ - .name = "fuse-aes", + .name = "fuseAes", .llvm_name = "fuse-aes", .description = "CPU fuses AES crypto operations", .dependencies = &[_]*const Feature { @@ -305,7 +305,7 @@ pub const feature_fuseAes = Feature{ }; pub const feature_fuseAddress = Feature{ - .name = "fuse-address", + .name = "fuseAddress", .llvm_name = "fuse-address", .description = "CPU fuses address generation and memory operations", .dependencies = &[_]*const Feature { @@ -313,7 +313,7 @@ pub const feature_fuseAddress = Feature{ }; pub const feature_fuseArithLogic = Feature{ - .name = "fuse-arith-logic", + .name = "fuseArithLogic", .llvm_name = "fuse-arith-logic", .description = "CPU fuses arithmetic and logic operations", .dependencies = &[_]*const Feature { @@ -321,7 +321,7 @@ pub const feature_fuseArithLogic = Feature{ }; pub const feature_fuseCsel = Feature{ - .name = "fuse-csel", + .name = "fuseCsel", .llvm_name = "fuse-csel", .description = "CPU fuses conditional select operations", .dependencies = &[_]*const Feature { @@ -329,7 +329,7 @@ pub const feature_fuseCsel = Feature{ }; pub const feature_fuseCryptoEor = Feature{ - .name = "fuse-crypto-eor", + .name = "fuseCryptoEor", .llvm_name = "fuse-crypto-eor", .description = "CPU fuses AES/PMULL and EOR operations", .dependencies = &[_]*const Feature { @@ -337,7 +337,7 @@ pub const feature_fuseCryptoEor = Feature{ }; pub const feature_fuseLiterals = Feature{ - .name = "fuse-literals", + .name = "fuseLiterals", .llvm_name = "fuse-literals", .description = "CPU fuses literal generation operations", .dependencies = &[_]*const Feature { @@ -370,7 +370,7 @@ pub const feature_lse = Feature{ }; pub const feature_lslFast = Feature{ - .name = "lsl-fast", + .name = "lslFast", .llvm_name = "lsl-fast", .description = "CPU has a fastpath logical shift of up to 3 places", .dependencies = &[_]*const Feature { @@ -411,7 +411,7 @@ pub const feature_nv = Feature{ }; pub const feature_noNegImmediates = Feature{ - .name = "no-neg-immediates", + .name = "noNegImmediates", .llvm_name = "no-neg-immediates", .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", .dependencies = &[_]*const Feature { @@ -435,7 +435,7 @@ pub const feature_pan = Feature{ }; pub const feature_panRwv = Feature{ - .name = "pan-rwv", + .name = "panRwv", .llvm_name = "pan-rwv", .description = "Enable v8.2 PAN s1e1R and s1e1W Variants", .dependencies = &[_]*const Feature { @@ -452,7 +452,7 @@ pub const feature_perfmon = Feature{ }; pub const feature_usePostraScheduler = Feature{ - .name = "use-postra-scheduler", + .name = "usePostraScheduler", .llvm_name = "use-postra-scheduler", .description = "Schedule again after register allocation", .dependencies = &[_]*const Feature { @@ -468,7 +468,7 @@ pub const feature_predres = Feature{ }; pub const feature_predictableSelectExpensive = Feature{ - .name = "predictable-select-expensive", + .name = "predictableSelectExpensive", .llvm_name = "predictable-select-expensive", .description = "Prefer likely predicted branches over selects", .dependencies = &[_]*const Feature { @@ -509,7 +509,7 @@ pub const feature_rcpc = Feature{ }; pub const feature_rcpcImmo = Feature{ - .name = "rcpc-immo", + .name = "rcpcImmo", .llvm_name = "rcpc-immo", .description = "Enable v8.4-A RCPC instructions with Immediate Offsets", .dependencies = &[_]*const Feature { @@ -534,7 +534,7 @@ pub const feature_rand = Feature{ }; pub const feature_reserveX1 = Feature{ - .name = "reserve-x1", + .name = "reserveX1", .llvm_name = "reserve-x1", .description = "Reserve X1, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -542,7 +542,7 @@ pub const feature_reserveX1 = Feature{ }; pub const feature_reserveX2 = Feature{ - .name = "reserve-x2", + .name = "reserveX2", .llvm_name = "reserve-x2", .description = "Reserve X2, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -550,7 +550,7 @@ pub const feature_reserveX2 = Feature{ }; pub const feature_reserveX3 = Feature{ - .name = "reserve-x3", + .name = "reserveX3", .llvm_name = "reserve-x3", .description = "Reserve X3, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -558,7 +558,7 @@ pub const feature_reserveX3 = Feature{ }; pub const feature_reserveX4 = Feature{ - .name = "reserve-x4", + .name = "reserveX4", .llvm_name = "reserve-x4", .description = "Reserve X4, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -566,7 +566,7 @@ pub const feature_reserveX4 = Feature{ }; pub const feature_reserveX5 = Feature{ - .name = "reserve-x5", + .name = "reserveX5", .llvm_name = "reserve-x5", .description = "Reserve X5, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -574,7 +574,7 @@ pub const feature_reserveX5 = Feature{ }; pub const feature_reserveX6 = Feature{ - .name = "reserve-x6", + .name = "reserveX6", .llvm_name = "reserve-x6", .description = "Reserve X6, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -582,7 +582,7 @@ pub const feature_reserveX6 = Feature{ }; pub const feature_reserveX7 = Feature{ - .name = "reserve-x7", + .name = "reserveX7", .llvm_name = "reserve-x7", .description = "Reserve X7, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -590,7 +590,7 @@ pub const feature_reserveX7 = Feature{ }; pub const feature_reserveX9 = Feature{ - .name = "reserve-x9", + .name = "reserveX9", .llvm_name = "reserve-x9", .description = "Reserve X9, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -598,7 +598,7 @@ pub const feature_reserveX9 = Feature{ }; pub const feature_reserveX10 = Feature{ - .name = "reserve-x10", + .name = "reserveX10", .llvm_name = "reserve-x10", .description = "Reserve X10, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -606,7 +606,7 @@ pub const feature_reserveX10 = Feature{ }; pub const feature_reserveX11 = Feature{ - .name = "reserve-x11", + .name = "reserveX11", .llvm_name = "reserve-x11", .description = "Reserve X11, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -614,7 +614,7 @@ pub const feature_reserveX11 = Feature{ }; pub const feature_reserveX12 = Feature{ - .name = "reserve-x12", + .name = "reserveX12", .llvm_name = "reserve-x12", .description = "Reserve X12, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -622,7 +622,7 @@ pub const feature_reserveX12 = Feature{ }; pub const feature_reserveX13 = Feature{ - .name = "reserve-x13", + .name = "reserveX13", .llvm_name = "reserve-x13", .description = "Reserve X13, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -630,7 +630,7 @@ pub const feature_reserveX13 = Feature{ }; pub const feature_reserveX14 = Feature{ - .name = "reserve-x14", + .name = "reserveX14", .llvm_name = "reserve-x14", .description = "Reserve X14, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -638,7 +638,7 @@ pub const feature_reserveX14 = Feature{ }; pub const feature_reserveX15 = Feature{ - .name = "reserve-x15", + .name = "reserveX15", .llvm_name = "reserve-x15", .description = "Reserve X15, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -646,7 +646,7 @@ pub const feature_reserveX15 = Feature{ }; pub const feature_reserveX18 = Feature{ - .name = "reserve-x18", + .name = "reserveX18", .llvm_name = "reserve-x18", .description = "Reserve X18, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -654,7 +654,7 @@ pub const feature_reserveX18 = Feature{ }; pub const feature_reserveX20 = Feature{ - .name = "reserve-x20", + .name = "reserveX20", .llvm_name = "reserve-x20", .description = "Reserve X20, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -662,7 +662,7 @@ pub const feature_reserveX20 = Feature{ }; pub const feature_reserveX21 = Feature{ - .name = "reserve-x21", + .name = "reserveX21", .llvm_name = "reserve-x21", .description = "Reserve X21, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -670,7 +670,7 @@ pub const feature_reserveX21 = Feature{ }; pub const feature_reserveX22 = Feature{ - .name = "reserve-x22", + .name = "reserveX22", .llvm_name = "reserve-x22", .description = "Reserve X22, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -678,7 +678,7 @@ pub const feature_reserveX22 = Feature{ }; pub const feature_reserveX23 = Feature{ - .name = "reserve-x23", + .name = "reserveX23", .llvm_name = "reserve-x23", .description = "Reserve X23, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -686,7 +686,7 @@ pub const feature_reserveX23 = Feature{ }; pub const feature_reserveX24 = Feature{ - .name = "reserve-x24", + .name = "reserveX24", .llvm_name = "reserve-x24", .description = "Reserve X24, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -694,7 +694,7 @@ pub const feature_reserveX24 = Feature{ }; pub const feature_reserveX25 = Feature{ - .name = "reserve-x25", + .name = "reserveX25", .llvm_name = "reserve-x25", .description = "Reserve X25, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -702,7 +702,7 @@ pub const feature_reserveX25 = Feature{ }; pub const feature_reserveX26 = Feature{ - .name = "reserve-x26", + .name = "reserveX26", .llvm_name = "reserve-x26", .description = "Reserve X26, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -710,7 +710,7 @@ pub const feature_reserveX26 = Feature{ }; pub const feature_reserveX27 = Feature{ - .name = "reserve-x27", + .name = "reserveX27", .llvm_name = "reserve-x27", .description = "Reserve X27, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -718,7 +718,7 @@ pub const feature_reserveX27 = Feature{ }; pub const feature_reserveX28 = Feature{ - .name = "reserve-x28", + .name = "reserveX28", .llvm_name = "reserve-x28", .description = "Reserve X28, making it unavailable as a GPR", .dependencies = &[_]*const Feature { @@ -802,7 +802,7 @@ pub const feature_sve2 = Feature{ }; pub const feature_sve2Aes = Feature{ - .name = "sve2-aes", + .name = "sve2Aes", .llvm_name = "sve2-aes", .description = "Enable AES SVE2 instructions", .dependencies = &[_]*const Feature { @@ -812,7 +812,7 @@ pub const feature_sve2Aes = Feature{ }; pub const feature_sve2Bitperm = Feature{ - .name = "sve2-bitperm", + .name = "sve2Bitperm", .llvm_name = "sve2-bitperm", .description = "Enable bit permutation SVE2 instructions", .dependencies = &[_]*const Feature { @@ -821,7 +821,7 @@ pub const feature_sve2Bitperm = Feature{ }; pub const feature_sve2Sha3 = Feature{ - .name = "sve2-sha3", + .name = "sve2Sha3", .llvm_name = "sve2-sha3", .description = "Enable SHA3 SVE2 instructions", .dependencies = &[_]*const Feature { @@ -831,7 +831,7 @@ pub const feature_sve2Sha3 = Feature{ }; pub const feature_sve2Sm4 = Feature{ - .name = "sve2-sm4", + .name = "sve2Sm4", .llvm_name = "sve2-sm4", .description = "Enable SM4 SVE2 instructions", .dependencies = &[_]*const Feature { @@ -841,7 +841,7 @@ pub const feature_sve2Sm4 = Feature{ }; pub const feature_slowMisaligned128store = Feature{ - .name = "slow-misaligned-128store", + .name = "slowMisaligned128store", .llvm_name = "slow-misaligned-128store", .description = "Misaligned 128 bit stores are slow", .dependencies = &[_]*const Feature { @@ -849,7 +849,7 @@ pub const feature_slowMisaligned128store = Feature{ }; pub const feature_slowPaired128 = Feature{ - .name = "slow-paired-128", + .name = "slowPaired128", .llvm_name = "slow-paired-128", .description = "Paired 128 bit loads and stores are slow", .dependencies = &[_]*const Feature { @@ -857,7 +857,7 @@ pub const feature_slowPaired128 = Feature{ }; pub const feature_slowStrqroStore = Feature{ - .name = "slow-strqro-store", + .name = "slowStrqroStore", .llvm_name = "slow-strqro-store", .description = "STR of Q register with register offset is slow", .dependencies = &[_]*const Feature { @@ -873,7 +873,7 @@ pub const feature_specrestrict = Feature{ }; pub const feature_strictAlign = Feature{ - .name = "strict-align", + .name = "strictAlign", .llvm_name = "strict-align", .description = "Disallow all unaligned memory access", .dependencies = &[_]*const Feature { @@ -881,7 +881,7 @@ pub const feature_strictAlign = Feature{ }; pub const feature_tlbRmi = Feature{ - .name = "tlb-rmi", + .name = "tlbRmi", .llvm_name = "tlb-rmi", .description = "Enable v8.4-A TLB Range and Maintenance Instructions", .dependencies = &[_]*const Feature { @@ -897,7 +897,7 @@ pub const feature_tme = Feature{ }; pub const feature_tracev84 = Feature{ - .name = "tracev8.4", + .name = "tracev84", .llvm_name = "tracev8.4", .description = "Enable v8.4-A Trace extension", .dependencies = &[_]*const Feature { @@ -913,7 +913,7 @@ pub const feature_trbe = Feature{ }; pub const feature_taggedGlobals = Feature{ - .name = "tagged-globals", + .name = "taggedGlobals", .llvm_name = "tagged-globals", .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits", .dependencies = &[_]*const Feature { @@ -921,7 +921,7 @@ pub const feature_taggedGlobals = Feature{ }; pub const feature_useAa = Feature{ - .name = "use-aa", + .name = "useAa", .llvm_name = "use-aa", .description = "Use alias analysis during codegen", .dependencies = &[_]*const Feature { @@ -929,7 +929,7 @@ pub const feature_useAa = Feature{ }; pub const feature_tpidrEl1 = Feature{ - .name = "tpidr-el1", + .name = "tpidrEl1", .llvm_name = "tpidr-el1", .description = "Permit use of TPIDR_EL1 for the TLS base", .dependencies = &[_]*const Feature { @@ -937,7 +937,7 @@ pub const feature_tpidrEl1 = Feature{ }; pub const feature_tpidrEl2 = Feature{ - .name = "tpidr-el2", + .name = "tpidrEl2", .llvm_name = "tpidr-el2", .description = "Permit use of TPIDR_EL2 for the TLS base", .dependencies = &[_]*const Feature { @@ -945,7 +945,7 @@ pub const feature_tpidrEl2 = Feature{ }; pub const feature_tpidrEl3 = Feature{ - .name = "tpidr-el3", + .name = "tpidrEl3", .llvm_name = "tpidr-el3", .description = "Permit use of TPIDR_EL3 for the TLS base", .dependencies = &[_]*const Feature { @@ -953,7 +953,7 @@ pub const feature_tpidrEl3 = Feature{ }; pub const feature_useReciprocalSquareRoot = Feature{ - .name = "use-reciprocal-square-root", + .name = "useReciprocalSquareRoot", .llvm_name = "use-reciprocal-square-root", .description = "Use the reciprocal square root approximation", .dependencies = &[_]*const Feature { @@ -981,13 +981,13 @@ pub const feature_zcz = Feature{ .llvm_name = "zcz", .description = "Has zero-cycle zeroing instructions", .dependencies = &[_]*const Feature { - &feature_zczGp, &feature_zczFp, + &feature_zczGp, }, }; pub const feature_zczFp = Feature{ - .name = "zcz-fp", + .name = "zczFp", .llvm_name = "zcz-fp", .description = "Has zero-cycle zeroing instructions for FP registers", .dependencies = &[_]*const Feature { @@ -995,7 +995,7 @@ pub const feature_zczFp = Feature{ }; pub const feature_zczFpWorkaround = Feature{ - .name = "zcz-fp-workaround", + .name = "zczFpWorkaround", .llvm_name = "zcz-fp-workaround", .description = "The zero-cycle floating-point zeroing instruction has a bug", .dependencies = &[_]*const Feature { @@ -1003,7 +1003,7 @@ pub const feature_zczFpWorkaround = Feature{ }; pub const feature_zczGp = Feature{ - .name = "zcz-gp", + .name = "zczGp", .llvm_name = "zcz-gp", .description = "Has zero-cycle zeroing instructions for generic registers", .dependencies = &[_]*const Feature { @@ -1137,206 +1137,206 @@ pub const features = &[_]*const Feature { }; pub const cpu_appleLatest = Cpu{ - .name = "apple-latest", + .name = "appleLatest", .llvm_name = "apple-latest", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_zczFpWorkaround, - &feature_perfmon, - &feature_arithCbzFusion, + &feature_fpArmv8, &feature_alternateSextloadCvtF32Pattern, - &feature_fuseCryptoEor, - &feature_disableLatencySchedHeuristic, - &feature_zcm, + &feature_arithBccFusion, &feature_zczFp, &feature_zczGp, - &feature_fpArmv8, - &feature_arithBccFusion, + &feature_zcm, + &feature_fuseAes, + &feature_disableLatencySchedHeuristic, + &feature_fuseCryptoEor, + &feature_perfmon, + &feature_zczFpWorkaround, + &feature_arithCbzFusion, }, }; pub const cpu_cortexA35 = Cpu{ - .name = "cortex-a35", + .name = "cortexA35", .llvm_name = "cortex-a35", .dependencies = &[_]*const Feature { &feature_fpArmv8, - &feature_perfmon, &feature_crc, + &feature_perfmon, }, }; pub const cpu_cortexA53 = Cpu{ - .name = "cortex-a53", + .name = "cortexA53", .llvm_name = "cortex-a53", .dependencies = &[_]*const Feature { - &feature_fuseAes, + &feature_fpArmv8, &feature_balanceFpOps, - &feature_perfmon, + &feature_usePostraScheduler, &feature_crc, &feature_customCheapAsMove, - &feature_fpArmv8, - &feature_usePostraScheduler, &feature_useAa, + &feature_fuseAes, + &feature_perfmon, }, }; pub const cpu_cortexA55 = Cpu{ - .name = "cortex-a55", + .name = "cortexA55", .llvm_name = "cortex-a55", .dependencies = &[_]*const Feature { - &feature_fuseAes, &feature_fpArmv8, - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_perfmon, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_fuseAes, + &feature_ras, + &feature_perfmon, + &feature_ccpp, }, }; pub const cpu_cortexA57 = Cpu{ - .name = "cortex-a57", + .name = "cortexA57", .llvm_name = "cortex-a57", .dependencies = &[_]*const Feature { - &feature_fuseAes, + &feature_fpArmv8, &feature_balanceFpOps, - &feature_perfmon, - &feature_crc, &feature_fuseLiterals, - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_fpArmv8, &feature_usePostraScheduler, + &feature_crc, + &feature_customCheapAsMove, + &feature_fuseAes, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; pub const cpu_cortexA65 = Cpu{ - .name = "cortex-a65", + .name = "cortexA65", .llvm_name = "cortex-a65", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, + &feature_fpArmv8, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; pub const cpu_cortexA65ae = Cpu{ - .name = "cortex-a65ae", + .name = "cortexA65ae", .llvm_name = "cortex-a65ae", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, + &feature_fpArmv8, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; pub const cpu_cortexA72 = Cpu{ - .name = "cortex-a72", + .name = "cortexA72", .llvm_name = "cortex-a72", .dependencies = &[_]*const Feature { &feature_fpArmv8, - &feature_fuseAes, - &feature_perfmon, &feature_crc, + &feature_perfmon, + &feature_fuseAes, }, }; pub const cpu_cortexA73 = Cpu{ - .name = "cortex-a73", + .name = "cortexA73", .llvm_name = "cortex-a73", .dependencies = &[_]*const Feature { &feature_fpArmv8, - &feature_fuseAes, - &feature_perfmon, &feature_crc, + &feature_perfmon, + &feature_fuseAes, }, }; pub const cpu_cortexA75 = Cpu{ - .name = "cortex-a75", + .name = "cortexA75", .llvm_name = "cortex-a75", .dependencies = &[_]*const Feature { - &feature_fuseAes, &feature_fpArmv8, - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_perfmon, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_fuseAes, + &feature_ras, + &feature_perfmon, + &feature_ccpp, }, }; pub const cpu_cortexA76 = Cpu{ - .name = "cortex-a76", + .name = "cortexA76", .llvm_name = "cortex-a76", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, + &feature_fpArmv8, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; pub const cpu_cortexA76ae = Cpu{ - .name = "cortex-a76ae", + .name = "cortexA76ae", .llvm_name = "cortex-a76ae", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, + &feature_fpArmv8, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; @@ -1344,137 +1344,137 @@ pub const cpu_cyclone = Cpu{ .name = "cyclone", .llvm_name = "cyclone", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_zczFpWorkaround, - &feature_perfmon, - &feature_arithCbzFusion, + &feature_fpArmv8, &feature_alternateSextloadCvtF32Pattern, - &feature_fuseCryptoEor, - &feature_disableLatencySchedHeuristic, - &feature_zcm, + &feature_arithBccFusion, &feature_zczFp, &feature_zczGp, - &feature_fpArmv8, - &feature_arithBccFusion, + &feature_zcm, + &feature_fuseAes, + &feature_disableLatencySchedHeuristic, + &feature_fuseCryptoEor, + &feature_perfmon, + &feature_zczFpWorkaround, + &feature_arithCbzFusion, }, }; pub const cpu_exynosM1 = Cpu{ - .name = "exynos-m1", + .name = "exynosM1", .llvm_name = "exynos-m1", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_force32bitJumpTables, - &feature_perfmon, - &feature_crc, + &feature_fpArmv8, + &feature_slowMisaligned128store, + &feature_usePostraScheduler, &feature_useReciprocalSquareRoot, - &feature_slowPaired128, + &feature_crc, &feature_zczFp, - &feature_slowMisaligned128store, &feature_customCheapAsMove, - &feature_fpArmv8, - &feature_usePostraScheduler, + &feature_force32bitJumpTables, + &feature_fuseAes, + &feature_slowPaired128, + &feature_perfmon, }, }; pub const cpu_exynosM2 = Cpu{ - .name = "exynos-m2", + .name = "exynosM2", .llvm_name = "exynos-m2", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_force32bitJumpTables, - &feature_perfmon, + &feature_fpArmv8, + &feature_slowMisaligned128store, + &feature_usePostraScheduler, &feature_crc, - &feature_slowPaired128, &feature_zczFp, - &feature_slowMisaligned128store, &feature_customCheapAsMove, - &feature_fpArmv8, - &feature_usePostraScheduler, + &feature_force32bitJumpTables, + &feature_fuseAes, + &feature_slowPaired128, + &feature_perfmon, }, }; pub const cpu_exynosM3 = Cpu{ - .name = "exynos-m3", + .name = "exynosM3", .llvm_name = "exynos-m3", .dependencies = &[_]*const Feature { - &feature_fuseAes, + &feature_fpArmv8, + &feature_fuseAddress, + &feature_fuseLiterals, + &feature_usePostraScheduler, + &feature_crc, &feature_lslFast, + &feature_customCheapAsMove, + &feature_zczFp, &feature_force32bitJumpTables, - &feature_perfmon, - &feature_crc, - &feature_fuseLiterals, &feature_fuseCsel, - &feature_zczFp, + &feature_fuseAes, + &feature_perfmon, &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_fpArmv8, - &feature_usePostraScheduler, - &feature_fuseAddress, }, }; pub const cpu_exynosM4 = Cpu{ - .name = "exynos-m4", + .name = "exynosM4", .llvm_name = "exynos-m4", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_lslFast, - &feature_force32bitJumpTables, + &feature_pan, + &feature_fuseAddress, + &feature_usePostraScheduler, &feature_crc, - &feature_rdm, - &feature_fpArmv8, - &feature_lse, - &feature_vh, - &feature_arithCbzFusion, - &feature_fuseLiterals, - &feature_ccpp, + &feature_customCheapAsMove, + &feature_force32bitJumpTables, + &feature_uaops, &feature_lor, &feature_arithBccFusion, - &feature_ras, + &feature_arithCbzFusion, &feature_dotprod, - &feature_fuseCsel, - &feature_zczFp, - &feature_uaops, + &feature_fuseArithLogic, &feature_zczGp, + &feature_rdm, + &feature_fuseCsel, &feature_perfmon, - &feature_usePostraScheduler, - &feature_fuseAddress, - &feature_fuseArithLogic, - &feature_customCheapAsMove, - &feature_pan, + &feature_fpArmv8, + &feature_vh, + &feature_fuseLiterals, + &feature_lse, + &feature_zczFp, + &feature_lslFast, + &feature_fuseAes, + &feature_ras, + &feature_ccpp, }, }; pub const cpu_exynosM5 = Cpu{ - .name = "exynos-m5", + .name = "exynosM5", .llvm_name = "exynos-m5", .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_lslFast, - &feature_force32bitJumpTables, + &feature_pan, + &feature_fuseAddress, + &feature_usePostraScheduler, &feature_crc, - &feature_rdm, - &feature_fpArmv8, - &feature_lse, - &feature_vh, - &feature_arithCbzFusion, - &feature_fuseLiterals, - &feature_ccpp, + &feature_customCheapAsMove, + &feature_force32bitJumpTables, + &feature_uaops, &feature_lor, &feature_arithBccFusion, - &feature_ras, + &feature_arithCbzFusion, &feature_dotprod, - &feature_fuseCsel, - &feature_zczFp, - &feature_uaops, + &feature_fuseArithLogic, &feature_zczGp, + &feature_rdm, + &feature_fuseCsel, &feature_perfmon, - &feature_usePostraScheduler, - &feature_fuseAddress, - &feature_fuseArithLogic, - &feature_customCheapAsMove, - &feature_pan, + &feature_fpArmv8, + &feature_vh, + &feature_fuseLiterals, + &feature_lse, + &feature_zczFp, + &feature_lslFast, + &feature_fuseAes, + &feature_ras, + &feature_ccpp, }, }; @@ -1482,17 +1482,17 @@ pub const cpu_falkor = Cpu{ .name = "falkor", .llvm_name = "falkor", .dependencies = &[_]*const Feature { - &feature_lslFast, - &feature_perfmon, + &feature_fpArmv8, + &feature_usePostraScheduler, &feature_crc, + &feature_lslFast, + &feature_customCheapAsMove, &feature_slowStrqroStore, - &feature_rdm, &feature_zczFp, - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, + &feature_rdm, &feature_zczGp, - &feature_fpArmv8, - &feature_usePostraScheduler, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; @@ -1514,56 +1514,56 @@ pub const cpu_kryo = Cpu{ .name = "kryo", .llvm_name = "kryo", .dependencies = &[_]*const Feature { - &feature_lslFast, - &feature_perfmon, + &feature_fpArmv8, + &feature_usePostraScheduler, &feature_crc, - &feature_zczFp, - &feature_predictableSelectExpensive, + &feature_lslFast, &feature_customCheapAsMove, + &feature_zczFp, &feature_zczGp, - &feature_fpArmv8, - &feature_usePostraScheduler, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; pub const cpu_neoverseE1 = Cpu{ - .name = "neoverse-e1", + .name = "neoverseE1", .llvm_name = "neoverse-e1", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, - &feature_vh, - &feature_crc, + &feature_fpArmv8, &feature_pan, - &feature_ccpp, - &feature_rdm, + &feature_vh, + &feature_dotprod, &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, &feature_lse, + &feature_crc, + &feature_uaops, + &feature_rdm, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; pub const cpu_neoverseN1 = Cpu{ - .name = "neoverse-n1", + .name = "neoverseN1", .llvm_name = "neoverse-n1", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_dotprod, + &feature_fpArmv8, + &feature_pan, &feature_vh, + &feature_dotprod, + &feature_rcpc, + &feature_lse, &feature_crc, - &feature_pan, - &feature_ccpp, + &feature_uaops, &feature_rdm, &feature_spe, - &feature_rcpc, - &feature_uaops, - &feature_ssbs, - &feature_fpArmv8, - &feature_lse, &feature_lor, + &feature_ras, + &feature_ssbs, + &feature_ccpp, }, }; @@ -1571,36 +1571,36 @@ pub const cpu_saphira = Cpu{ .name = "saphira", .llvm_name = "saphira", .dependencies = &[_]*const Feature { - &feature_lslFast, - &feature_crc, - &feature_rdm, &feature_am, - &feature_mpam, - &feature_fmi, - &feature_fpArmv8, - &feature_lse, - &feature_dit, - &feature_vh, - &feature_ccpp, + &feature_pan, + &feature_usePostraScheduler, + &feature_tracev84, + &feature_rcpc, &feature_sel2, - &feature_lor, - &feature_nv, - &feature_ras, + &feature_crc, + &feature_customCheapAsMove, &feature_tlbRmi, + &feature_uaops, + &feature_lor, &feature_dotprod, + &feature_zczGp, + &feature_rdm, + &feature_pa, + &feature_perfmon, + &feature_fpArmv8, + &feature_vh, + &feature_lse, &feature_zczFp, &feature_spe, - &feature_rcpc, &feature_predictableSelectExpensive, - &feature_uaops, - &feature_zczGp, - &feature_perfmon, - &feature_usePostraScheduler, - &feature_pa, + &feature_fmi, + &feature_lslFast, + &feature_mpam, + &feature_dit, + &feature_nv, &feature_ccidx, - &feature_customCheapAsMove, - &feature_pan, - &feature_tracev84, + &feature_ras, + &feature_ccpp, }, }; @@ -1608,11 +1608,11 @@ pub const cpu_thunderx = Cpu{ .name = "thunderx", .llvm_name = "thunderx", .dependencies = &[_]*const Feature { - &feature_perfmon, - &feature_crc, - &feature_predictableSelectExpensive, &feature_fpArmv8, &feature_usePostraScheduler, + &feature_crc, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; @@ -1620,17 +1620,17 @@ pub const cpu_thunderx2t99 = Cpu{ .name = "thunderx2t99", .llvm_name = "thunderx2t99", .dependencies = &[_]*const Feature { - &feature_aggressiveFma, + &feature_fpArmv8, + &feature_pan, &feature_vh, + &feature_usePostraScheduler, &feature_crc, - &feature_pan, - &feature_rdm, - &feature_predictableSelectExpensive, - &feature_fpArmv8, &feature_lse, + &feature_rdm, &feature_lor, - &feature_usePostraScheduler, &feature_arithBccFusion, + &feature_predictableSelectExpensive, + &feature_aggressiveFma, }, }; @@ -1638,11 +1638,11 @@ pub const cpu_thunderxt81 = Cpu{ .name = "thunderxt81", .llvm_name = "thunderxt81", .dependencies = &[_]*const Feature { - &feature_perfmon, - &feature_crc, - &feature_predictableSelectExpensive, &feature_fpArmv8, &feature_usePostraScheduler, + &feature_crc, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; @@ -1650,11 +1650,11 @@ pub const cpu_thunderxt83 = Cpu{ .name = "thunderxt83", .llvm_name = "thunderxt83", .dependencies = &[_]*const Feature { - &feature_perfmon, - &feature_crc, - &feature_predictableSelectExpensive, &feature_fpArmv8, &feature_usePostraScheduler, + &feature_crc, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; @@ -1662,11 +1662,11 @@ pub const cpu_thunderxt88 = Cpu{ .name = "thunderxt88", .llvm_name = "thunderxt88", .dependencies = &[_]*const Feature { - &feature_perfmon, - &feature_crc, - &feature_predictableSelectExpensive, &feature_fpArmv8, &feature_usePostraScheduler, + &feature_crc, + &feature_perfmon, + &feature_predictableSelectExpensive, }, }; @@ -1674,22 +1674,22 @@ pub const cpu_tsv110 = Cpu{ .name = "tsv110", .llvm_name = "tsv110", .dependencies = &[_]*const Feature { - &feature_fuseAes, &feature_fpArmv8, - &feature_ras, - &feature_dotprod, + &feature_pan, &feature_vh, + &feature_usePostraScheduler, + &feature_dotprod, + &feature_lse, &feature_crc, - &feature_pan, - &feature_ccpp, + &feature_customCheapAsMove, + &feature_uaops, &feature_rdm, &feature_spe, - &feature_uaops, - &feature_customCheapAsMove, - &feature_perfmon, - &feature_lse, &feature_lor, - &feature_usePostraScheduler, + &feature_fuseAes, + &feature_ras, + &feature_perfmon, + &feature_ccpp, }, }; diff --git a/lib/std/target/amdgpu.zig b/lib/std/target/amdgpu.zig index 3d4b4950ca..f1954628c5 100644 --- a/lib/std/target/amdgpu.zig +++ b/lib/std/target/amdgpu.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_BitInsts16 = Feature{ - .name = "16-bit-insts", + .name = "BitInsts16", .llvm_name = "16-bit-insts", .description = "Has i16/f16 instructions", .dependencies = &[_]*const Feature { @@ -10,7 +10,7 @@ pub const feature_BitInsts16 = Feature{ }; pub const feature_addNoCarryInsts = Feature{ - .name = "add-no-carry-insts", + .name = "addNoCarryInsts", .llvm_name = "add-no-carry-insts", .description = "Have VALU add/sub instructions without carry out", .dependencies = &[_]*const Feature { @@ -18,7 +18,7 @@ pub const feature_addNoCarryInsts = Feature{ }; pub const feature_apertureRegs = Feature{ - .name = "aperture-regs", + .name = "apertureRegs", .llvm_name = "aperture-regs", .description = "Has Memory Aperture Base and Size Registers", .dependencies = &[_]*const Feature { @@ -26,7 +26,7 @@ pub const feature_apertureRegs = Feature{ }; pub const feature_atomicFaddInsts = Feature{ - .name = "atomic-fadd-insts", + .name = "atomicFaddInsts", .llvm_name = "atomic-fadd-insts", .description = "Has buffer_atomic_add_f32, buffer_atomic_pk_add_f16, global_atomic_add_f32, global_atomic_pk_add_f16 instructions", .dependencies = &[_]*const Feature { @@ -34,7 +34,7 @@ pub const feature_atomicFaddInsts = Feature{ }; pub const feature_autoWaitcntBeforeBarrier = Feature{ - .name = "auto-waitcnt-before-barrier", + .name = "autoWaitcntBeforeBarrier", .llvm_name = "auto-waitcnt-before-barrier", .description = "Hardware automatically inserts waitcnt before barrier", .dependencies = &[_]*const Feature { @@ -42,7 +42,7 @@ pub const feature_autoWaitcntBeforeBarrier = Feature{ }; pub const feature_ciInsts = Feature{ - .name = "ci-insts", + .name = "ciInsts", .llvm_name = "ci-insts", .description = "Additional instructions for CI+", .dependencies = &[_]*const Feature { @@ -50,7 +50,7 @@ pub const feature_ciInsts = Feature{ }; pub const feature_codeObjectV3 = Feature{ - .name = "code-object-v3", + .name = "codeObjectV3", .llvm_name = "code-object-v3", .description = "Generate code object version 3", .dependencies = &[_]*const Feature { @@ -66,7 +66,7 @@ pub const feature_cumode = Feature{ }; pub const feature_dlInsts = Feature{ - .name = "dl-insts", + .name = "dlInsts", .llvm_name = "dl-insts", .description = "Has v_fmac_f32 and v_xnor_b32 instructions", .dependencies = &[_]*const Feature { @@ -90,7 +90,7 @@ pub const feature_dpp8 = Feature{ }; pub const feature_noSramEccSupport = Feature{ - .name = "no-sram-ecc-support", + .name = "noSramEccSupport", .llvm_name = "no-sram-ecc-support", .description = "Hardware does not support SRAM ECC", .dependencies = &[_]*const Feature { @@ -98,7 +98,7 @@ pub const feature_noSramEccSupport = Feature{ }; pub const feature_noXnackSupport = Feature{ - .name = "no-xnack-support", + .name = "noXnackSupport", .llvm_name = "no-xnack-support", .description = "Hardware does not support XNACK", .dependencies = &[_]*const Feature { @@ -106,7 +106,7 @@ pub const feature_noXnackSupport = Feature{ }; pub const feature_dot1Insts = Feature{ - .name = "dot1-insts", + .name = "dot1Insts", .llvm_name = "dot1-insts", .description = "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions", .dependencies = &[_]*const Feature { @@ -114,7 +114,7 @@ pub const feature_dot1Insts = Feature{ }; pub const feature_dot2Insts = Feature{ - .name = "dot2-insts", + .name = "dot2Insts", .llvm_name = "dot2-insts", .description = "Has v_dot2_f32_f16, v_dot2_i32_i16, v_dot2_u32_u16, v_dot4_u32_u8, v_dot8_u32_u4 instructions", .dependencies = &[_]*const Feature { @@ -122,7 +122,7 @@ pub const feature_dot2Insts = Feature{ }; pub const feature_dot3Insts = Feature{ - .name = "dot3-insts", + .name = "dot3Insts", .llvm_name = "dot3-insts", .description = "Has v_dot8c_i32_i4 instruction", .dependencies = &[_]*const Feature { @@ -130,7 +130,7 @@ pub const feature_dot3Insts = Feature{ }; pub const feature_dot4Insts = Feature{ - .name = "dot4-insts", + .name = "dot4Insts", .llvm_name = "dot4-insts", .description = "Has v_dot2c_i32_i16 instruction", .dependencies = &[_]*const Feature { @@ -138,7 +138,7 @@ pub const feature_dot4Insts = Feature{ }; pub const feature_dot5Insts = Feature{ - .name = "dot5-insts", + .name = "dot5Insts", .llvm_name = "dot5-insts", .description = "Has v_dot2c_f32_f16 instruction", .dependencies = &[_]*const Feature { @@ -146,7 +146,7 @@ pub const feature_dot5Insts = Feature{ }; pub const feature_dot6Insts = Feature{ - .name = "dot6-insts", + .name = "dot6Insts", .llvm_name = "dot6-insts", .description = "Has v_dot4c_i32_i8 instruction", .dependencies = &[_]*const Feature { @@ -170,7 +170,7 @@ pub const feature_dumpcode = Feature{ }; pub const feature_enableDs128 = Feature{ - .name = "enable-ds128", + .name = "enableDs128", .llvm_name = "enable-ds128", .description = "Use ds_{read|write}_b128", .dependencies = &[_]*const Feature { @@ -178,7 +178,7 @@ pub const feature_enableDs128 = Feature{ }; pub const feature_loadStoreOpt = Feature{ - .name = "load-store-opt", + .name = "loadStoreOpt", .llvm_name = "load-store-opt", .description = "Enable SI load/store optimizer pass", .dependencies = &[_]*const Feature { @@ -186,7 +186,7 @@ pub const feature_loadStoreOpt = Feature{ }; pub const feature_enablePrtStrictNull = Feature{ - .name = "enable-prt-strict-null", + .name = "enablePrtStrictNull", .llvm_name = "enable-prt-strict-null", .description = "Enable zeroing of result registers for sparse texture fetches", .dependencies = &[_]*const Feature { @@ -194,7 +194,7 @@ pub const feature_enablePrtStrictNull = Feature{ }; pub const feature_siScheduler = Feature{ - .name = "si-scheduler", + .name = "siScheduler", .llvm_name = "si-scheduler", .description = "Enable SI Machine Scheduler", .dependencies = &[_]*const Feature { @@ -202,7 +202,7 @@ pub const feature_siScheduler = Feature{ }; pub const feature_unsafeDsOffsetFolding = Feature{ - .name = "unsafe-ds-offset-folding", + .name = "unsafeDsOffsetFolding", .llvm_name = "unsafe-ds-offset-folding", .description = "Force using DS instruction immediate offsets on SI", .dependencies = &[_]*const Feature { @@ -218,7 +218,7 @@ pub const feature_fmaf = Feature{ }; pub const feature_fp16Denormals = Feature{ - .name = "fp16-denormals", + .name = "fp16Denormals", .llvm_name = "fp16-denormals", .description = "Enable half precision denormal handling", .dependencies = &[_]*const Feature { @@ -227,7 +227,7 @@ pub const feature_fp16Denormals = Feature{ }; pub const feature_fp32Denormals = Feature{ - .name = "fp32-denormals", + .name = "fp32Denormals", .llvm_name = "fp32-denormals", .description = "Enable single precision denormal handling", .dependencies = &[_]*const Feature { @@ -243,7 +243,7 @@ pub const feature_fp64 = Feature{ }; pub const feature_fp64Denormals = Feature{ - .name = "fp64-denormals", + .name = "fp64Denormals", .llvm_name = "fp64-denormals", .description = "Enable double and half precision denormal handling", .dependencies = &[_]*const Feature { @@ -252,7 +252,7 @@ pub const feature_fp64Denormals = Feature{ }; pub const feature_fp64Fp16Denormals = Feature{ - .name = "fp64-fp16-denormals", + .name = "fp64Fp16Denormals", .llvm_name = "fp64-fp16-denormals", .description = "Enable double and half precision denormal handling", .dependencies = &[_]*const Feature { @@ -261,7 +261,7 @@ pub const feature_fp64Fp16Denormals = Feature{ }; pub const feature_fpExceptions = Feature{ - .name = "fp-exceptions", + .name = "fpExceptions", .llvm_name = "fp-exceptions", .description = "Enable floating point exceptions", .dependencies = &[_]*const Feature { @@ -269,7 +269,7 @@ pub const feature_fpExceptions = Feature{ }; pub const feature_fastFmaf = Feature{ - .name = "fast-fmaf", + .name = "fastFmaf", .llvm_name = "fast-fmaf", .description = "Assuming f32 fma is at least as fast as mul + add", .dependencies = &[_]*const Feature { @@ -277,7 +277,7 @@ pub const feature_fastFmaf = Feature{ }; pub const feature_flatAddressSpace = Feature{ - .name = "flat-address-space", + .name = "flatAddressSpace", .llvm_name = "flat-address-space", .description = "Support flat address space", .dependencies = &[_]*const Feature { @@ -285,7 +285,7 @@ pub const feature_flatAddressSpace = Feature{ }; pub const feature_flatForGlobal = Feature{ - .name = "flat-for-global", + .name = "flatForGlobal", .llvm_name = "flat-for-global", .description = "Force to generate flat instruction for global", .dependencies = &[_]*const Feature { @@ -293,7 +293,7 @@ pub const feature_flatForGlobal = Feature{ }; pub const feature_flatGlobalInsts = Feature{ - .name = "flat-global-insts", + .name = "flatGlobalInsts", .llvm_name = "flat-global-insts", .description = "Have global_* flat memory instructions", .dependencies = &[_]*const Feature { @@ -301,7 +301,7 @@ pub const feature_flatGlobalInsts = Feature{ }; pub const feature_flatInstOffsets = Feature{ - .name = "flat-inst-offsets", + .name = "flatInstOffsets", .llvm_name = "flat-inst-offsets", .description = "Flat instructions have immediate offset addressing mode", .dependencies = &[_]*const Feature { @@ -309,7 +309,7 @@ pub const feature_flatInstOffsets = Feature{ }; pub const feature_flatScratchInsts = Feature{ - .name = "flat-scratch-insts", + .name = "flatScratchInsts", .llvm_name = "flat-scratch-insts", .description = "Have scratch_* flat memory instructions", .dependencies = &[_]*const Feature { @@ -317,7 +317,7 @@ pub const feature_flatScratchInsts = Feature{ }; pub const feature_flatSegmentOffsetBug = Feature{ - .name = "flat-segment-offset-bug", + .name = "flatSegmentOffsetBug", .llvm_name = "flat-segment-offset-bug", .description = "GFX10 bug, inst_offset ignored in flat segment", .dependencies = &[_]*const Feature { @@ -325,7 +325,7 @@ pub const feature_flatSegmentOffsetBug = Feature{ }; pub const feature_fmaMixInsts = Feature{ - .name = "fma-mix-insts", + .name = "fmaMixInsts", .llvm_name = "fma-mix-insts", .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions", .dependencies = &[_]*const Feature { @@ -333,7 +333,7 @@ pub const feature_fmaMixInsts = Feature{ }; pub const feature_gcn3Encoding = Feature{ - .name = "gcn3-encoding", + .name = "gcn3Encoding", .llvm_name = "gcn3-encoding", .description = "Encoding format for VI", .dependencies = &[_]*const Feature { @@ -341,7 +341,7 @@ pub const feature_gcn3Encoding = Feature{ }; pub const feature_gfx7Gfx8Gfx9Insts = Feature{ - .name = "gfx7-gfx8-gfx9-insts", + .name = "gfx7Gfx8Gfx9Insts", .llvm_name = "gfx7-gfx8-gfx9-insts", .description = "Instructions shared in GFX7, GFX8, GFX9", .dependencies = &[_]*const Feature { @@ -349,7 +349,7 @@ pub const feature_gfx7Gfx8Gfx9Insts = Feature{ }; pub const feature_gfx8Insts = Feature{ - .name = "gfx8-insts", + .name = "gfx8Insts", .llvm_name = "gfx8-insts", .description = "Additional instructions for GFX8+", .dependencies = &[_]*const Feature { @@ -357,7 +357,7 @@ pub const feature_gfx8Insts = Feature{ }; pub const feature_gfx9Insts = Feature{ - .name = "gfx9-insts", + .name = "gfx9Insts", .llvm_name = "gfx9-insts", .description = "Additional instructions for GFX9+", .dependencies = &[_]*const Feature { @@ -365,7 +365,7 @@ pub const feature_gfx9Insts = Feature{ }; pub const feature_gfx10Insts = Feature{ - .name = "gfx10-insts", + .name = "gfx10Insts", .llvm_name = "gfx10-insts", .description = "Additional instructions for GFX10+", .dependencies = &[_]*const Feature { @@ -373,7 +373,7 @@ pub const feature_gfx10Insts = Feature{ }; pub const feature_instFwdPrefetchBug = Feature{ - .name = "inst-fwd-prefetch-bug", + .name = "instFwdPrefetchBug", .llvm_name = "inst-fwd-prefetch-bug", .description = "S_INST_PREFETCH instruction causes shader to hang", .dependencies = &[_]*const Feature { @@ -381,7 +381,7 @@ pub const feature_instFwdPrefetchBug = Feature{ }; pub const feature_intClampInsts = Feature{ - .name = "int-clamp-insts", + .name = "intClampInsts", .llvm_name = "int-clamp-insts", .description = "Support clamp for integer destination", .dependencies = &[_]*const Feature { @@ -389,7 +389,7 @@ pub const feature_intClampInsts = Feature{ }; pub const feature_inv2piInlineImm = Feature{ - .name = "inv-2pi-inline-imm", + .name = "inv2piInlineImm", .llvm_name = "inv-2pi-inline-imm", .description = "Has 1 / (2 * pi) as inline immediate", .dependencies = &[_]*const Feature { @@ -413,7 +413,7 @@ pub const feature_ldsbankcount32 = Feature{ }; pub const feature_ldsBranchVmemWarHazard = Feature{ - .name = "lds-branch-vmem-war-hazard", + .name = "ldsBranchVmemWarHazard", .llvm_name = "lds-branch-vmem-war-hazard", .description = "Switching between LDS and VMEM-tex not waiting VM_VSRC=0", .dependencies = &[_]*const Feature { @@ -421,7 +421,7 @@ pub const feature_ldsBranchVmemWarHazard = Feature{ }; pub const feature_ldsMisalignedBug = Feature{ - .name = "lds-misaligned-bug", + .name = "ldsMisalignedBug", .llvm_name = "lds-misaligned-bug", .description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode", .dependencies = &[_]*const Feature { @@ -453,7 +453,7 @@ pub const feature_localmemorysize65536 = Feature{ }; pub const feature_maiInsts = Feature{ - .name = "mai-insts", + .name = "maiInsts", .llvm_name = "mai-insts", .description = "Has mAI instructions", .dependencies = &[_]*const Feature { @@ -461,7 +461,7 @@ pub const feature_maiInsts = Feature{ }; pub const feature_mfmaInlineLiteralBug = Feature{ - .name = "mfma-inline-literal-bug", + .name = "mfmaInlineLiteralBug", .llvm_name = "mfma-inline-literal-bug", .description = "MFMA cannot use inline literal as SrcC", .dependencies = &[_]*const Feature { @@ -469,7 +469,7 @@ pub const feature_mfmaInlineLiteralBug = Feature{ }; pub const feature_mimgR128 = Feature{ - .name = "mimg-r128", + .name = "mimgR128", .llvm_name = "mimg-r128", .description = "Support 128-bit texture resources", .dependencies = &[_]*const Feature { @@ -477,7 +477,7 @@ pub const feature_mimgR128 = Feature{ }; pub const feature_madMixInsts = Feature{ - .name = "mad-mix-insts", + .name = "madMixInsts", .llvm_name = "mad-mix-insts", .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions", .dependencies = &[_]*const Feature { @@ -485,7 +485,7 @@ pub const feature_madMixInsts = Feature{ }; pub const feature_maxPrivateElementSize4 = Feature{ - .name = "max-private-element-size-4", + .name = "maxPrivateElementSize4", .llvm_name = "max-private-element-size-4", .description = "Maximum private access size may be 4", .dependencies = &[_]*const Feature { @@ -493,7 +493,7 @@ pub const feature_maxPrivateElementSize4 = Feature{ }; pub const feature_maxPrivateElementSize8 = Feature{ - .name = "max-private-element-size-8", + .name = "maxPrivateElementSize8", .llvm_name = "max-private-element-size-8", .description = "Maximum private access size may be 8", .dependencies = &[_]*const Feature { @@ -501,7 +501,7 @@ pub const feature_maxPrivateElementSize8 = Feature{ }; pub const feature_maxPrivateElementSize16 = Feature{ - .name = "max-private-element-size-16", + .name = "maxPrivateElementSize16", .llvm_name = "max-private-element-size-16", .description = "Maximum private access size may be 16", .dependencies = &[_]*const Feature { @@ -517,7 +517,7 @@ pub const feature_movrel = Feature{ }; pub const feature_nsaEncoding = Feature{ - .name = "nsa-encoding", + .name = "nsaEncoding", .llvm_name = "nsa-encoding", .description = "Support NSA encoding for image instructions", .dependencies = &[_]*const Feature { @@ -525,7 +525,7 @@ pub const feature_nsaEncoding = Feature{ }; pub const feature_nsaToVmemBug = Feature{ - .name = "nsa-to-vmem-bug", + .name = "nsaToVmemBug", .llvm_name = "nsa-to-vmem-bug", .description = "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero", .dependencies = &[_]*const Feature { @@ -533,7 +533,7 @@ pub const feature_nsaToVmemBug = Feature{ }; pub const feature_noDataDepHazard = Feature{ - .name = "no-data-dep-hazard", + .name = "noDataDepHazard", .llvm_name = "no-data-dep-hazard", .description = "Does not need SW waitstates", .dependencies = &[_]*const Feature { @@ -541,7 +541,7 @@ pub const feature_noDataDepHazard = Feature{ }; pub const feature_noSdstCmpx = Feature{ - .name = "no-sdst-cmpx", + .name = "noSdstCmpx", .llvm_name = "no-sdst-cmpx", .description = "V_CMPX does not write VCC/SGPR in addition to EXEC", .dependencies = &[_]*const Feature { @@ -549,7 +549,7 @@ pub const feature_noSdstCmpx = Feature{ }; pub const feature_offset3fBug = Feature{ - .name = "offset-3f-bug", + .name = "offset3fBug", .llvm_name = "offset-3f-bug", .description = "Branch offset of 3f hardware bug", .dependencies = &[_]*const Feature { @@ -557,7 +557,7 @@ pub const feature_offset3fBug = Feature{ }; pub const feature_pkFmacF16Inst = Feature{ - .name = "pk-fmac-f16-inst", + .name = "pkFmacF16Inst", .llvm_name = "pk-fmac-f16-inst", .description = "Has v_pk_fmac_f16 instruction", .dependencies = &[_]*const Feature { @@ -565,7 +565,7 @@ pub const feature_pkFmacF16Inst = Feature{ }; pub const feature_promoteAlloca = Feature{ - .name = "promote-alloca", + .name = "promoteAlloca", .llvm_name = "promote-alloca", .description = "Enable promote alloca pass", .dependencies = &[_]*const Feature { @@ -573,7 +573,7 @@ pub const feature_promoteAlloca = Feature{ }; pub const feature_r128A16 = Feature{ - .name = "r128-a16", + .name = "r128A16", .llvm_name = "r128-a16", .description = "Support 16 bit coordindates/gradients/lod/clamp/mip types on gfx9", .dependencies = &[_]*const Feature { @@ -581,7 +581,7 @@ pub const feature_r128A16 = Feature{ }; pub const feature_registerBanking = Feature{ - .name = "register-banking", + .name = "registerBanking", .llvm_name = "register-banking", .description = "Has register banking", .dependencies = &[_]*const Feature { @@ -597,7 +597,7 @@ pub const feature_sdwa = Feature{ }; pub const feature_sdwaMav = Feature{ - .name = "sdwa-mav", + .name = "sdwaMav", .llvm_name = "sdwa-mav", .description = "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension", .dependencies = &[_]*const Feature { @@ -605,7 +605,7 @@ pub const feature_sdwaMav = Feature{ }; pub const feature_sdwaOmod = Feature{ - .name = "sdwa-omod", + .name = "sdwaOmod", .llvm_name = "sdwa-omod", .description = "Support OMod with SDWA (Sub-DWORD Addressing) extension", .dependencies = &[_]*const Feature { @@ -613,7 +613,7 @@ pub const feature_sdwaOmod = Feature{ }; pub const feature_sdwaOutModsVopc = Feature{ - .name = "sdwa-out-mods-vopc", + .name = "sdwaOutModsVopc", .llvm_name = "sdwa-out-mods-vopc", .description = "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension", .dependencies = &[_]*const Feature { @@ -621,7 +621,7 @@ pub const feature_sdwaOutModsVopc = Feature{ }; pub const feature_sdwaScalar = Feature{ - .name = "sdwa-scalar", + .name = "sdwaScalar", .llvm_name = "sdwa-scalar", .description = "Support scalar register with SDWA (Sub-DWORD Addressing) extension", .dependencies = &[_]*const Feature { @@ -629,7 +629,7 @@ pub const feature_sdwaScalar = Feature{ }; pub const feature_sdwaSdst = Feature{ - .name = "sdwa-sdst", + .name = "sdwaSdst", .llvm_name = "sdwa-sdst", .description = "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension", .dependencies = &[_]*const Feature { @@ -637,7 +637,7 @@ pub const feature_sdwaSdst = Feature{ }; pub const feature_sgprInitBug = Feature{ - .name = "sgpr-init-bug", + .name = "sgprInitBug", .llvm_name = "sgpr-init-bug", .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size", .dependencies = &[_]*const Feature { @@ -645,7 +645,7 @@ pub const feature_sgprInitBug = Feature{ }; pub const feature_smemToVectorWriteHazard = Feature{ - .name = "smem-to-vector-write-hazard", + .name = "smemToVectorWriteHazard", .llvm_name = "smem-to-vector-write-hazard", .description = "s_load_dword followed by v_cmp page faults", .dependencies = &[_]*const Feature { @@ -653,7 +653,7 @@ pub const feature_smemToVectorWriteHazard = Feature{ }; pub const feature_sMemrealtime = Feature{ - .name = "s-memrealtime", + .name = "sMemrealtime", .llvm_name = "s-memrealtime", .description = "Has s_memrealtime instruction", .dependencies = &[_]*const Feature { @@ -661,7 +661,7 @@ pub const feature_sMemrealtime = Feature{ }; pub const feature_sramEcc = Feature{ - .name = "sram-ecc", + .name = "sramEcc", .llvm_name = "sram-ecc", .description = "Enable SRAM ECC", .dependencies = &[_]*const Feature { @@ -669,7 +669,7 @@ pub const feature_sramEcc = Feature{ }; pub const feature_scalarAtomics = Feature{ - .name = "scalar-atomics", + .name = "scalarAtomics", .llvm_name = "scalar-atomics", .description = "Has atomic scalar memory instructions", .dependencies = &[_]*const Feature { @@ -677,7 +677,7 @@ pub const feature_scalarAtomics = Feature{ }; pub const feature_scalarFlatScratchInsts = Feature{ - .name = "scalar-flat-scratch-insts", + .name = "scalarFlatScratchInsts", .llvm_name = "scalar-flat-scratch-insts", .description = "Have s_scratch_* flat memory instructions", .dependencies = &[_]*const Feature { @@ -685,7 +685,7 @@ pub const feature_scalarFlatScratchInsts = Feature{ }; pub const feature_scalarStores = Feature{ - .name = "scalar-stores", + .name = "scalarStores", .llvm_name = "scalar-stores", .description = "Has store scalar memory instructions", .dependencies = &[_]*const Feature { @@ -693,7 +693,7 @@ pub const feature_scalarStores = Feature{ }; pub const feature_trapHandler = Feature{ - .name = "trap-handler", + .name = "trapHandler", .llvm_name = "trap-handler", .description = "Trap handler support", .dependencies = &[_]*const Feature { @@ -701,7 +701,7 @@ pub const feature_trapHandler = Feature{ }; pub const feature_trigReducedRange = Feature{ - .name = "trig-reduced-range", + .name = "trigReducedRange", .llvm_name = "trig-reduced-range", .description = "Requires use of fract on arguments to trig instructions", .dependencies = &[_]*const Feature { @@ -709,7 +709,7 @@ pub const feature_trigReducedRange = Feature{ }; pub const feature_unalignedBufferAccess = Feature{ - .name = "unaligned-buffer-access", + .name = "unalignedBufferAccess", .llvm_name = "unaligned-buffer-access", .description = "Support unaligned global loads and stores", .dependencies = &[_]*const Feature { @@ -717,7 +717,7 @@ pub const feature_unalignedBufferAccess = Feature{ }; pub const feature_unalignedScratchAccess = Feature{ - .name = "unaligned-scratch-access", + .name = "unalignedScratchAccess", .llvm_name = "unaligned-scratch-access", .description = "Support unaligned scratch loads and stores", .dependencies = &[_]*const Feature { @@ -725,7 +725,7 @@ pub const feature_unalignedScratchAccess = Feature{ }; pub const feature_unpackedD16Vmem = Feature{ - .name = "unpacked-d16-vmem", + .name = "unpackedD16Vmem", .llvm_name = "unpacked-d16-vmem", .description = "Has unpacked d16 vmem instructions", .dependencies = &[_]*const Feature { @@ -733,7 +733,7 @@ pub const feature_unpackedD16Vmem = Feature{ }; pub const feature_vgprIndexMode = Feature{ - .name = "vgpr-index-mode", + .name = "vgprIndexMode", .llvm_name = "vgpr-index-mode", .description = "Has VGPR mode register indexing", .dependencies = &[_]*const Feature { @@ -741,7 +741,7 @@ pub const feature_vgprIndexMode = Feature{ }; pub const feature_vmemToScalarWriteHazard = Feature{ - .name = "vmem-to-scalar-write-hazard", + .name = "vmemToScalarWriteHazard", .llvm_name = "vmem-to-scalar-write-hazard", .description = "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution.", .dependencies = &[_]*const Feature { @@ -749,7 +749,7 @@ pub const feature_vmemToScalarWriteHazard = Feature{ }; pub const feature_vop3Literal = Feature{ - .name = "vop3-literal", + .name = "vop3Literal", .llvm_name = "vop3-literal", .description = "Can use one literal in VOP3", .dependencies = &[_]*const Feature { @@ -765,7 +765,7 @@ pub const feature_vop3p = Feature{ }; pub const feature_vcmpxExecWarHazard = Feature{ - .name = "vcmpx-exec-war-hazard", + .name = "vcmpxExecWarHazard", .llvm_name = "vcmpx-exec-war-hazard", .description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)", .dependencies = &[_]*const Feature { @@ -773,7 +773,7 @@ pub const feature_vcmpxExecWarHazard = Feature{ }; pub const feature_vcmpxPermlaneHazard = Feature{ - .name = "vcmpx-permlane-hazard", + .name = "vcmpxPermlaneHazard", .llvm_name = "vcmpx-permlane-hazard", .description = "TODO: describe me", .dependencies = &[_]*const Feature { @@ -821,7 +821,7 @@ pub const feature_xnack = Feature{ }; pub const feature_halfRate64Ops = Feature{ - .name = "half-rate-64-ops", + .name = "halfRate64Ops", .llvm_name = "half-rate-64-ops", .description = "Most fp64 instructions are half rate instead of quarter", .dependencies = &[_]*const Feature { @@ -942,15 +942,15 @@ pub const cpu_bonaire = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -962,28 +962,28 @@ pub const cpu_carrizo = Cpu{ &feature_fastFmaf, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, &feature_xnack, &feature_halfRate64Ops, }, @@ -997,28 +997,28 @@ pub const cpu_fiji = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -1031,7 +1031,7 @@ pub const cpu_generic = Cpu{ }; pub const cpu_genericHsa = Cpu{ - .name = "generic-hsa", + .name = "genericHsa", .llvm_name = "generic-hsa", .dependencies = &[_]*const Feature { &feature_flatAddressSpace, @@ -1047,40 +1047,40 @@ pub const cpu_gfx1010 = Cpu{ &feature_dlInsts, &feature_noXnackSupport, &feature_flatSegmentOffsetBug, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_gfx9Insts, - &feature_fastFmaf, - &feature_flatScratchInsts, - &feature_mimgR128, - &feature_noSdstCmpx, - &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_registerBanking, - &feature_movrel, - &feature_gfx8Insts, - &feature_sdwa, - &feature_noDataDepHazard, + &feature_vop3Literal, + &feature_apertureRegs, &feature_flatGlobalInsts, &feature_gfx10Insts, - &feature_localmemorysize65536, &feature_BitInsts16, - &feature_addNoCarryInsts, &feature_pkFmacF16Inst, + &feature_vop3p, + &feature_flatAddressSpace, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_dpp8, + &feature_flatScratchInsts, &feature_flatInstOffsets, + &feature_mimgR128, + &feature_sdwa, &feature_fmaMixInsts, - &feature_sdwaScalar, - &feature_inv2piInlineImm, + &feature_sMemrealtime, &feature_vscnt, - &feature_apertureRegs, - &feature_dpp8, - &feature_noSramEccSupport, + &feature_fastFmaf, + &feature_registerBanking, + &feature_gfx9Insts, + &feature_sdwaSdst, + &feature_noSdstCmpx, &feature_fp64, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaScalar, + &feature_sdwaOmod, + &feature_noDataDepHazard, &feature_ciInsts, - &feature_vop3Literal, + &feature_addNoCarryInsts, &feature_instFwdPrefetchBug, &feature_ldsbankcount32, &feature_ldsBranchVmemWarHazard, @@ -1111,40 +1111,40 @@ pub const cpu_gfx1011 = Cpu{ &feature_dot5Insts, &feature_dot6Insts, &feature_flatSegmentOffsetBug, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_gfx9Insts, - &feature_fastFmaf, - &feature_flatScratchInsts, - &feature_mimgR128, - &feature_noSdstCmpx, - &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_registerBanking, - &feature_movrel, - &feature_gfx8Insts, - &feature_sdwa, - &feature_noDataDepHazard, + &feature_vop3Literal, + &feature_apertureRegs, &feature_flatGlobalInsts, &feature_gfx10Insts, - &feature_localmemorysize65536, &feature_BitInsts16, - &feature_addNoCarryInsts, &feature_pkFmacF16Inst, + &feature_vop3p, + &feature_flatAddressSpace, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_dpp8, + &feature_flatScratchInsts, &feature_flatInstOffsets, + &feature_mimgR128, + &feature_sdwa, &feature_fmaMixInsts, - &feature_sdwaScalar, - &feature_inv2piInlineImm, + &feature_sMemrealtime, &feature_vscnt, - &feature_apertureRegs, - &feature_dpp8, - &feature_noSramEccSupport, + &feature_fastFmaf, + &feature_registerBanking, + &feature_gfx9Insts, + &feature_sdwaSdst, + &feature_noSdstCmpx, &feature_fp64, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaScalar, + &feature_sdwaOmod, + &feature_noDataDepHazard, &feature_ciInsts, - &feature_vop3Literal, + &feature_addNoCarryInsts, &feature_instFwdPrefetchBug, &feature_ldsbankcount32, &feature_ldsBranchVmemWarHazard, @@ -1174,40 +1174,40 @@ pub const cpu_gfx1012 = Cpu{ &feature_dot5Insts, &feature_dot6Insts, &feature_flatSegmentOffsetBug, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_gfx9Insts, - &feature_fastFmaf, - &feature_flatScratchInsts, - &feature_mimgR128, - &feature_noSdstCmpx, - &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_registerBanking, - &feature_movrel, - &feature_gfx8Insts, - &feature_sdwa, - &feature_noDataDepHazard, + &feature_vop3Literal, + &feature_apertureRegs, &feature_flatGlobalInsts, &feature_gfx10Insts, - &feature_localmemorysize65536, &feature_BitInsts16, - &feature_addNoCarryInsts, &feature_pkFmacF16Inst, + &feature_vop3p, + &feature_flatAddressSpace, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_dpp8, + &feature_flatScratchInsts, &feature_flatInstOffsets, + &feature_mimgR128, + &feature_sdwa, &feature_fmaMixInsts, - &feature_sdwaScalar, - &feature_inv2piInlineImm, + &feature_sMemrealtime, &feature_vscnt, - &feature_apertureRegs, - &feature_dpp8, - &feature_noSramEccSupport, + &feature_fastFmaf, + &feature_registerBanking, + &feature_gfx9Insts, + &feature_sdwaSdst, + &feature_noSdstCmpx, &feature_fp64, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaScalar, + &feature_sdwaOmod, + &feature_noDataDepHazard, &feature_ciInsts, - &feature_vop3Literal, + &feature_addNoCarryInsts, &feature_instFwdPrefetchBug, &feature_ldsbankcount32, &feature_ldsBranchVmemWarHazard, @@ -1236,11 +1236,11 @@ pub const cpu_gfx600 = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, &feature_halfRate64Ops, }, }; @@ -1254,11 +1254,11 @@ pub const cpu_gfx601 = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, }, }; @@ -1270,15 +1270,15 @@ pub const cpu_gfx700 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1291,15 +1291,15 @@ pub const cpu_gfx701 = Cpu{ &feature_fastFmaf, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, &feature_halfRate64Ops, }, }; @@ -1313,15 +1313,15 @@ pub const cpu_gfx702 = Cpu{ &feature_fastFmaf, &feature_ldsbankcount16, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1333,15 +1333,15 @@ pub const cpu_gfx703 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount16, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1353,15 +1353,15 @@ pub const cpu_gfx704 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1373,28 +1373,28 @@ pub const cpu_gfx801 = Cpu{ &feature_fastFmaf, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, &feature_xnack, &feature_halfRate64Ops, }, @@ -1409,28 +1409,28 @@ pub const cpu_gfx802 = Cpu{ &feature_ldsbankcount32, &feature_sgprInitBug, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -1442,28 +1442,28 @@ pub const cpu_gfx803 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -1473,28 +1473,28 @@ pub const cpu_gfx810 = Cpu{ .dependencies = &[_]*const Feature { &feature_codeObjectV3, &feature_ldsbankcount16, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, &feature_xnack, }, }; @@ -1506,36 +1506,36 @@ pub const cpu_gfx900 = Cpu{ &feature_codeObjectV3, &feature_noSramEccSupport, &feature_noXnackSupport, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, - &feature_fastFmaf, - &feature_wavefrontsize64, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, + &feature_sMemrealtime, + &feature_fastFmaf, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, &feature_madMixInsts, }, @@ -1547,36 +1547,36 @@ pub const cpu_gfx902 = Cpu{ .dependencies = &[_]*const Feature { &feature_codeObjectV3, &feature_noSramEccSupport, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, - &feature_fastFmaf, - &feature_wavefrontsize64, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, + &feature_sMemrealtime, + &feature_fastFmaf, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, &feature_madMixInsts, &feature_xnack, @@ -1591,36 +1591,36 @@ pub const cpu_gfx904 = Cpu{ &feature_noSramEccSupport, &feature_noXnackSupport, &feature_fmaMixInsts, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, - &feature_fastFmaf, - &feature_wavefrontsize64, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, + &feature_sMemrealtime, + &feature_fastFmaf, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, }, }; @@ -1635,36 +1635,36 @@ pub const cpu_gfx906 = Cpu{ &feature_dot1Insts, &feature_dot2Insts, &feature_fmaMixInsts, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, - &feature_fastFmaf, - &feature_wavefrontsize64, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, + &feature_sMemrealtime, + &feature_fastFmaf, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, &feature_halfRate64Ops, }, @@ -1684,36 +1684,36 @@ pub const cpu_gfx908 = Cpu{ &feature_dot5Insts, &feature_dot6Insts, &feature_fmaMixInsts, - &feature_sdwaOmod, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, - &feature_fastFmaf, - &feature_wavefrontsize64, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, + &feature_sMemrealtime, + &feature_fastFmaf, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, &feature_maiInsts, &feature_mfmaInlineLiteralBug, @@ -1728,36 +1728,36 @@ pub const cpu_gfx909 = Cpu{ .llvm_name = "gfx909", .dependencies = &[_]*const Feature { &feature_codeObjectV3, - &feature_sdwaOmod, + &feature_apertureRegs, + &feature_flatGlobalInsts, + &feature_BitInsts16, + &feature_vop3p, + &feature_flatAddressSpace, + &feature_dpp, + &feature_inv2piInlineImm, + &feature_sdwa, + &feature_flatScratchInsts, + &feature_flatInstOffsets, + &feature_scalarFlatScratchInsts, &feature_sMemrealtime, - &feature_scalarStores, - &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_gfx9Insts, - &feature_r128A16, &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_flatScratchInsts, + &feature_gfx9Insts, &feature_sdwaSdst, - &feature_vop3p, - &feature_intClampInsts, - &feature_dpp, - &feature_scalarAtomics, - &feature_gcn3Encoding, - &feature_gfx8Insts, + &feature_vgprIndexMode, + &feature_fp64, &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwa, - &feature_flatGlobalInsts, + &feature_gfx8Insts, &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_flatInstOffsets, + &feature_intClampInsts, &feature_sdwaScalar, - &feature_inv2piInlineImm, - &feature_apertureRegs, - &feature_fp64, + &feature_sdwaOmod, + &feature_scalarAtomics, + &feature_r128A16, + &feature_wavefrontsize64, &feature_ciInsts, - &feature_scalarFlatScratchInsts, + &feature_scalarStores, + &feature_gcn3Encoding, + &feature_addNoCarryInsts, &feature_ldsbankcount32, &feature_madMixInsts, &feature_xnack, @@ -1773,11 +1773,11 @@ pub const cpu_hainan = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, }, }; @@ -1790,15 +1790,15 @@ pub const cpu_hawaii = Cpu{ &feature_fastFmaf, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, &feature_halfRate64Ops, }, }; @@ -1812,28 +1812,28 @@ pub const cpu_iceland = Cpu{ &feature_ldsbankcount32, &feature_sgprInitBug, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -1845,15 +1845,15 @@ pub const cpu_kabini = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount16, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1865,15 +1865,15 @@ pub const cpu_kaveri = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1885,15 +1885,15 @@ pub const cpu_mullins = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount16, &feature_movrel, - &feature_flatAddressSpace, &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, &feature_wavefrontsize64, + &feature_ciInsts, + &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, &feature_mimgR128, &feature_noSramEccSupport, + &feature_flatAddressSpace, &feature_localmemorysize65536, - &feature_fp64, - &feature_ciInsts, }, }; @@ -1906,11 +1906,11 @@ pub const cpu_oland = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, }, }; @@ -1923,11 +1923,11 @@ pub const cpu_pitcairn = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, }, }; @@ -1939,28 +1939,28 @@ pub const cpu_polaris10 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -1972,28 +1972,28 @@ pub const cpu_polaris11 = Cpu{ &feature_noXnackSupport, &feature_ldsbankcount32, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -2003,28 +2003,28 @@ pub const cpu_stoney = Cpu{ .dependencies = &[_]*const Feature { &feature_codeObjectV3, &feature_ldsbankcount16, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, &feature_xnack, }, }; @@ -2039,11 +2039,11 @@ pub const cpu_tahiti = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, &feature_halfRate64Ops, }, }; @@ -2057,28 +2057,28 @@ pub const cpu_tonga = Cpu{ &feature_ldsbankcount32, &feature_sgprInitBug, &feature_unpackedD16Vmem, - &feature_sMemrealtime, - &feature_scalarStores, + &feature_BitInsts16, &feature_flatAddressSpace, - &feature_vgprIndexMode, - &feature_wavefrontsize64, - &feature_mimgR128, - &feature_intClampInsts, &feature_dpp, - &feature_movrel, - &feature_gcn3Encoding, - &feature_gfx8Insts, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_sdwaMav, &feature_sdwa, - &feature_localmemorysize65536, - &feature_BitInsts16, - &feature_sdwaOutModsVopc, + &feature_mimgR128, &feature_inv2piInlineImm, - &feature_noSramEccSupport, + &feature_sdwaOutModsVopc, + &feature_sMemrealtime, + &feature_trigReducedRange, + &feature_vgprIndexMode, &feature_fp64, + &feature_gfx7Gfx8Gfx9Insts, + &feature_noSramEccSupport, + &feature_gfx8Insts, + &feature_localmemorysize65536, + &feature_movrel, + &feature_intClampInsts, + &feature_sdwaMav, + &feature_wavefrontsize64, &feature_ciInsts, + &feature_scalarStores, + &feature_gcn3Encoding, }, }; @@ -2091,11 +2091,11 @@ pub const cpu_verde = Cpu{ &feature_ldsbankcount32, &feature_movrel, &feature_trigReducedRange, - &feature_mimgR128, - &feature_localmemorysize32768, &feature_wavefrontsize64, - &feature_noSramEccSupport, + &feature_localmemorysize32768, &feature_fp64, + &feature_noSramEccSupport, + &feature_mimgR128, }, }; diff --git a/lib/std/target/arm.zig b/lib/std/target/arm.zig index 6152346468..9861a1ff56 100644 --- a/lib/std/target/arm.zig +++ b/lib/std/target/arm.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_msecext8 = Feature{ - .name = "8msecext", + .name = "msecext8", .llvm_name = "8msecext", .description = "Enable support for ARMv8-M Security Extensions", .dependencies = &[_]*const Feature { @@ -28,7 +28,7 @@ pub const feature_aes = Feature{ }; pub const feature_acquireRelease = Feature{ - .name = "acquire-release", + .name = "acquireRelease", .llvm_name = "acquire-release", .description = "Has v8 acquire/release (lda/ldaex etc) instructions", .dependencies = &[_]*const Feature { @@ -36,7 +36,7 @@ pub const feature_acquireRelease = Feature{ }; pub const feature_avoidMovsShop = Feature{ - .name = "avoid-movs-shop", + .name = "avoidMovsShop", .llvm_name = "avoid-movs-shop", .description = "Avoid movs instructions with shifter operand", .dependencies = &[_]*const Feature { @@ -44,7 +44,7 @@ pub const feature_avoidMovsShop = Feature{ }; pub const feature_avoidPartialCpsr = Feature{ - .name = "avoid-partial-cpsr", + .name = "avoidPartialCpsr", .llvm_name = "avoid-partial-cpsr", .description = "Avoid CPSR partial update for OOO execution", .dependencies = &[_]*const Feature { @@ -60,7 +60,7 @@ pub const feature_crc = Feature{ }; pub const feature_cheapPredicableCpsr = Feature{ - .name = "cheap-predicable-cpsr", + .name = "cheapPredicableCpsr", .llvm_name = "cheap-predicable-cpsr", .description = "Disable +1 predication cost for instructions updating CPSR", .dependencies = &[_]*const Feature { @@ -68,7 +68,7 @@ pub const feature_cheapPredicableCpsr = Feature{ }; pub const feature_vldnAlign = Feature{ - .name = "vldn-align", + .name = "vldnAlign", .llvm_name = "vldn-align", .description = "Check for VLDn unaligned access", .dependencies = &[_]*const Feature { @@ -118,7 +118,7 @@ pub const feature_dsp = Feature{ }; pub const feature_dontWidenVmovs = Feature{ - .name = "dont-widen-vmovs", + .name = "dontWidenVmovs", .llvm_name = "dont-widen-vmovs", .description = "Don't widen VMOVS to VMOVD", .dependencies = &[_]*const Feature { @@ -136,7 +136,7 @@ pub const feature_dotprod = Feature{ }; pub const feature_executeOnly = Feature{ - .name = "execute-only", + .name = "executeOnly", .llvm_name = "execute-only", .description = "Enable the generation of execute only code.", .dependencies = &[_]*const Feature { @@ -144,7 +144,7 @@ pub const feature_executeOnly = Feature{ }; pub const feature_expandFpMlx = Feature{ - .name = "expand-fp-mlx", + .name = "expandFpMlx", .llvm_name = "expand-fp-mlx", .description = "Expand VFP/NEON MLA/MLS instructions", .dependencies = &[_]*const Feature { @@ -164,8 +164,8 @@ pub const feature_fp16fml = Feature{ .llvm_name = "fp16fml", .description = "Enable full half-precision floating point fml instructions", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; @@ -187,44 +187,44 @@ pub const feature_fpao = Feature{ }; pub const feature_fpArmv8 = Feature{ - .name = "fp-armv8", + .name = "fpArmv8", .llvm_name = "fp-armv8", .description = "Enable ARMv8 FP", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_d32, &feature_fpregs, + &feature_fp16, }, }; pub const feature_fpArmv8d16 = Feature{ - .name = "fp-armv8d16", + .name = "fpArmv8d16", .llvm_name = "fp-armv8d16", .description = "Enable ARMv8 FP with only 16 d-registers", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; pub const feature_fpArmv8d16sp = Feature{ - .name = "fp-armv8d16sp", + .name = "fpArmv8d16sp", .llvm_name = "fp-armv8d16sp", .description = "Enable ARMv8 FP with only 16 d-registers and no double precision", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; pub const feature_fpArmv8sp = Feature{ - .name = "fp-armv8sp", + .name = "fpArmv8sp", .llvm_name = "fp-armv8sp", .description = "Enable ARMv8 FP with no double precision", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_d32, &feature_fpregs, + &feature_fp16, }, }; @@ -259,13 +259,13 @@ pub const feature_fullfp16 = Feature{ .llvm_name = "fullfp16", .description = "Enable full half-precision floating point", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; pub const feature_fuseAes = Feature{ - .name = "fuse-aes", + .name = "fuseAes", .llvm_name = "fuse-aes", .description = "CPU fuses AES crypto operations", .dependencies = &[_]*const Feature { @@ -273,7 +273,7 @@ pub const feature_fuseAes = Feature{ }; pub const feature_fuseLiterals = Feature{ - .name = "fuse-literals", + .name = "fuseLiterals", .llvm_name = "fuse-literals", .description = "CPU fuses literal generation operations", .dependencies = &[_]*const Feature { @@ -281,7 +281,7 @@ pub const feature_fuseLiterals = Feature{ }; pub const feature_hwdivArm = Feature{ - .name = "hwdiv-arm", + .name = "hwdivArm", .llvm_name = "hwdiv-arm", .description = "Enable divide instructions in ARM mode", .dependencies = &[_]*const Feature { @@ -297,7 +297,7 @@ pub const feature_hwdiv = Feature{ }; pub const feature_noBranchPredictor = Feature{ - .name = "no-branch-predictor", + .name = "noBranchPredictor", .llvm_name = "no-branch-predictor", .description = "Has no branch predictor", .dependencies = &[_]*const Feature { @@ -305,7 +305,7 @@ pub const feature_noBranchPredictor = Feature{ }; pub const feature_retAddrStack = Feature{ - .name = "ret-addr-stack", + .name = "retAddrStack", .llvm_name = "ret-addr-stack", .description = "Has return address stack", .dependencies = &[_]*const Feature { @@ -321,7 +321,7 @@ pub const feature_slowfpvmlx = Feature{ }; pub const feature_vmlxHazards = Feature{ - .name = "vmlx-hazards", + .name = "vmlxHazards", .llvm_name = "vmlx-hazards", .description = "Has VMLx hazards", .dependencies = &[_]*const Feature { @@ -337,7 +337,7 @@ pub const feature_lob = Feature{ }; pub const feature_longCalls = Feature{ - .name = "long-calls", + .name = "longCalls", .llvm_name = "long-calls", .description = "Generate calls via indirect call instructions", .dependencies = &[_]*const Feature { @@ -385,7 +385,7 @@ pub const feature_mve4beat = Feature{ }; pub const feature_muxedUnits = Feature{ - .name = "muxed-units", + .name = "muxedUnits", .llvm_name = "muxed-units", .description = "Has muxed AGU and NEON/FPU", .dependencies = &[_]*const Feature { @@ -411,7 +411,7 @@ pub const feature_neonfp = Feature{ }; pub const feature_neonFpmovs = Feature{ - .name = "neon-fpmovs", + .name = "neonFpmovs", .llvm_name = "neon-fpmovs", .description = "Convert VMOVSR, VMOVRS, VMOVS to NEON", .dependencies = &[_]*const Feature { @@ -419,7 +419,7 @@ pub const feature_neonFpmovs = Feature{ }; pub const feature_naclTrap = Feature{ - .name = "nacl-trap", + .name = "naclTrap", .llvm_name = "nacl-trap", .description = "NaCl trap", .dependencies = &[_]*const Feature { @@ -435,7 +435,7 @@ pub const feature_noarm = Feature{ }; pub const feature_noMovt = Feature{ - .name = "no-movt", + .name = "noMovt", .llvm_name = "no-movt", .description = "Don't use movt/movw pairs for 32-bit imms", .dependencies = &[_]*const Feature { @@ -443,7 +443,7 @@ pub const feature_noMovt = Feature{ }; pub const feature_noNegImmediates = Feature{ - .name = "no-neg-immediates", + .name = "noNegImmediates", .llvm_name = "no-neg-immediates", .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", .dependencies = &[_]*const Feature { @@ -451,7 +451,7 @@ pub const feature_noNegImmediates = Feature{ }; pub const feature_disablePostraScheduler = Feature{ - .name = "disable-postra-scheduler", + .name = "disablePostraScheduler", .llvm_name = "disable-postra-scheduler", .description = "Don't schedule again after register allocation", .dependencies = &[_]*const Feature { @@ -459,7 +459,7 @@ pub const feature_disablePostraScheduler = Feature{ }; pub const feature_nonpipelinedVfp = Feature{ - .name = "nonpipelined-vfp", + .name = "nonpipelinedVfp", .llvm_name = "nonpipelined-vfp", .description = "VFP instructions are not pipelined", .dependencies = &[_]*const Feature { @@ -475,7 +475,7 @@ pub const feature_perfmon = Feature{ }; pub const feature_bit32 = Feature{ - .name = "32bit", + .name = "bit32", .llvm_name = "32bit", .description = "Prefer 32-bit Thumb instrs", .dependencies = &[_]*const Feature { @@ -483,7 +483,7 @@ pub const feature_bit32 = Feature{ }; pub const feature_preferIshst = Feature{ - .name = "prefer-ishst", + .name = "preferIshst", .llvm_name = "prefer-ishst", .description = "Prefer ISHST barriers", .dependencies = &[_]*const Feature { @@ -491,7 +491,7 @@ pub const feature_preferIshst = Feature{ }; pub const feature_loopAlign = Feature{ - .name = "loop-align", + .name = "loopAlign", .llvm_name = "loop-align", .description = "Prefer 32-bit alignment for loops", .dependencies = &[_]*const Feature { @@ -499,7 +499,7 @@ pub const feature_loopAlign = Feature{ }; pub const feature_preferVmovsr = Feature{ - .name = "prefer-vmovsr", + .name = "preferVmovsr", .llvm_name = "prefer-vmovsr", .description = "Prefer VMOVSR", .dependencies = &[_]*const Feature { @@ -507,7 +507,7 @@ pub const feature_preferVmovsr = Feature{ }; pub const feature_profUnpr = Feature{ - .name = "prof-unpr", + .name = "profUnpr", .llvm_name = "prof-unpr", .description = "Is profitable to unpredicate", .dependencies = &[_]*const Feature { @@ -531,7 +531,7 @@ pub const feature_rclass = Feature{ }; pub const feature_readTpHard = Feature{ - .name = "read-tp-hard", + .name = "readTpHard", .llvm_name = "read-tp-hard", .description = "Reading thread pointer from register", .dependencies = &[_]*const Feature { @@ -539,7 +539,7 @@ pub const feature_readTpHard = Feature{ }; pub const feature_reserveR9 = Feature{ - .name = "reserve-r9", + .name = "reserveR9", .llvm_name = "reserve-r9", .description = "Reserve R9, making it unavailable as GPR", .dependencies = &[_]*const Feature { @@ -565,7 +565,7 @@ pub const feature_sha2 = Feature{ }; pub const feature_slowFpBrcc = Feature{ - .name = "slow-fp-brcc", + .name = "slowFpBrcc", .llvm_name = "slow-fp-brcc", .description = "FP compare + branch is slow", .dependencies = &[_]*const Feature { @@ -573,7 +573,7 @@ pub const feature_slowFpBrcc = Feature{ }; pub const feature_slowLoadDSubreg = Feature{ - .name = "slow-load-D-subreg", + .name = "slowLoadDSubreg", .llvm_name = "slow-load-D-subreg", .description = "Loading into D subregs is slow", .dependencies = &[_]*const Feature { @@ -581,7 +581,7 @@ pub const feature_slowLoadDSubreg = Feature{ }; pub const feature_slowOddReg = Feature{ - .name = "slow-odd-reg", + .name = "slowOddReg", .llvm_name = "slow-odd-reg", .description = "VLDM/VSTM starting with an odd register is slow", .dependencies = &[_]*const Feature { @@ -589,7 +589,7 @@ pub const feature_slowOddReg = Feature{ }; pub const feature_slowVdup32 = Feature{ - .name = "slow-vdup32", + .name = "slowVdup32", .llvm_name = "slow-vdup32", .description = "Has slow VDUP32 - prefer VMOV", .dependencies = &[_]*const Feature { @@ -597,7 +597,7 @@ pub const feature_slowVdup32 = Feature{ }; pub const feature_slowVgetlni32 = Feature{ - .name = "slow-vgetlni32", + .name = "slowVgetlni32", .llvm_name = "slow-vgetlni32", .description = "Has slow VGETLNi32 - prefer VMOV", .dependencies = &[_]*const Feature { @@ -605,7 +605,7 @@ pub const feature_slowVgetlni32 = Feature{ }; pub const feature_splatVfpNeon = Feature{ - .name = "splat-vfp-neon", + .name = "splatVfpNeon", .llvm_name = "splat-vfp-neon", .description = "Splat register from VFP to NEON", .dependencies = &[_]*const Feature { @@ -614,7 +614,7 @@ pub const feature_splatVfpNeon = Feature{ }; pub const feature_strictAlign = Feature{ - .name = "strict-align", + .name = "strictAlign", .llvm_name = "strict-align", .description = "Disallow all unaligned memory access", .dependencies = &[_]*const Feature { @@ -638,7 +638,7 @@ pub const feature_trustzone = Feature{ }; pub const feature_useAa = Feature{ - .name = "use-aa", + .name = "useAa", .llvm_name = "use-aa", .description = "Use alias analysis during codegen", .dependencies = &[_]*const Feature { @@ -646,7 +646,7 @@ pub const feature_useAa = Feature{ }; pub const feature_useMisched = Feature{ - .name = "use-misched", + .name = "useMisched", .llvm_name = "use-misched", .description = "Use the MachineScheduler", .dependencies = &[_]*const Feature { @@ -654,7 +654,7 @@ pub const feature_useMisched = Feature{ }; pub const feature_wideStrideVfp = Feature{ - .name = "wide-stride-vfp", + .name = "wideStrideVfp", .llvm_name = "wide-stride-vfp", .description = "Use a wide stride when allocating VFP registers", .dependencies = &[_]*const Feature { @@ -730,9 +730,9 @@ pub const feature_vfp4 = Feature{ .llvm_name = "vfp4", .description = "Enable VFP4 instructions", .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_d32, &feature_fpregs, + &feature_d32, + &feature_fp16, }, }; @@ -741,8 +741,8 @@ pub const feature_vfp4d16 = Feature{ .llvm_name = "vfp4d16", .description = "Enable VFP4 instructions with only 16 d-registers", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; @@ -751,8 +751,8 @@ pub const feature_vfp4d16sp = Feature{ .llvm_name = "vfp4d16sp", .description = "Enable VFP4 instructions with only 16 d-registers and no double precision", .dependencies = &[_]*const Feature { - &feature_fp16, &feature_fpregs, + &feature_fp16, }, }; @@ -761,14 +761,14 @@ pub const feature_vfp4sp = Feature{ .llvm_name = "vfp4sp", .description = "Enable VFP4 instructions with no double precision", .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_d32, &feature_fpregs, + &feature_d32, + &feature_fp16, }, }; pub const feature_vmlxForwarding = Feature{ - .name = "vmlx-forwarding", + .name = "vmlxForwarding", .llvm_name = "vmlx-forwarding", .description = "Has multiplier accumulator forwarding", .dependencies = &[_]*const Feature { @@ -925,7 +925,7 @@ pub const cpu_arm10tdmi = Cpu{ }; pub const cpu_arm1136jS = Cpu{ - .name = "arm1136j-s", + .name = "arm1136jS", .llvm_name = "arm1136j-s", .dependencies = &[_]*const Feature { &feature_dsp, @@ -933,7 +933,7 @@ pub const cpu_arm1136jS = Cpu{ }; pub const cpu_arm1136jfS = Cpu{ - .name = "arm1136jf-s", + .name = "arm1136jfS", .llvm_name = "arm1136jf-s", .dependencies = &[_]*const Feature { &feature_dsp, @@ -944,20 +944,20 @@ pub const cpu_arm1136jfS = Cpu{ }; pub const cpu_arm1156t2S = Cpu{ - .name = "arm1156t2-s", + .name = "arm1156t2S", .llvm_name = "arm1156t2-s", .dependencies = &[_]*const Feature { - &feature_dsp, &feature_thumb2, + &feature_dsp, }, }; pub const cpu_arm1156t2fS = Cpu{ - .name = "arm1156t2f-s", + .name = "arm1156t2fS", .llvm_name = "arm1156t2f-s", .dependencies = &[_]*const Feature { - &feature_dsp, &feature_thumb2, + &feature_dsp, &feature_slowfpvmlx, &feature_fpregs, &feature_vfp2, @@ -965,7 +965,7 @@ pub const cpu_arm1156t2fS = Cpu{ }; pub const cpu_arm1176jS = Cpu{ - .name = "arm1176j-s", + .name = "arm1176jS", .llvm_name = "arm1176j-s", .dependencies = &[_]*const Feature { &feature_trustzone, @@ -973,7 +973,7 @@ pub const cpu_arm1176jS = Cpu{ }; pub const cpu_arm1176jzS = Cpu{ - .name = "arm1176jz-s", + .name = "arm1176jzS", .llvm_name = "arm1176jz-s", .dependencies = &[_]*const Feature { &feature_trustzone, @@ -981,7 +981,7 @@ pub const cpu_arm1176jzS = Cpu{ }; pub const cpu_arm1176jzfS = Cpu{ - .name = "arm1176jzf-s", + .name = "arm1176jzfS", .llvm_name = "arm1176jzf-s", .dependencies = &[_]*const Feature { &feature_trustzone, @@ -1013,7 +1013,7 @@ pub const cpu_arm7tdmi = Cpu{ }; pub const cpu_arm7tdmiS = Cpu{ - .name = "arm7tdmi-s", + .name = "arm7tdmiS", .llvm_name = "arm7tdmi-s", .dependencies = &[_]*const Feature { }, @@ -1062,7 +1062,7 @@ pub const cpu_arm922t = Cpu{ }; pub const cpu_arm926ejS = Cpu{ - .name = "arm926ej-s", + .name = "arm926ejS", .llvm_name = "arm926ej-s", .dependencies = &[_]*const Feature { }, @@ -1076,21 +1076,21 @@ pub const cpu_arm940t = Cpu{ }; pub const cpu_arm946eS = Cpu{ - .name = "arm946e-s", + .name = "arm946eS", .llvm_name = "arm946e-s", .dependencies = &[_]*const Feature { }, }; pub const cpu_arm966eS = Cpu{ - .name = "arm966e-s", + .name = "arm966eS", .llvm_name = "arm966e-s", .dependencies = &[_]*const Feature { }, }; pub const cpu_arm968eS = Cpu{ - .name = "arm968e-s", + .name = "arm968eS", .llvm_name = "arm968e-s", .dependencies = &[_]*const Feature { }, @@ -1111,17 +1111,17 @@ pub const cpu_arm9tdmi = Cpu{ }; pub const cpu_cortexA12 = Cpu{ - .name = "cortex-a12", + .name = "cortexA12", .llvm_name = "cortex-a12", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidPartialCpsr, &feature_retAddrStack, &feature_mp, @@ -1136,17 +1136,17 @@ pub const cpu_cortexA12 = Cpu{ }; pub const cpu_cortexA15 = Cpu{ - .name = "cortex-a15", + .name = "cortexA15", .llvm_name = "cortex-a15", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidPartialCpsr, &feature_vldnAlign, &feature_dontWidenVmovs, @@ -1164,17 +1164,17 @@ pub const cpu_cortexA15 = Cpu{ }; pub const cpu_cortexA17 = Cpu{ - .name = "cortex-a17", + .name = "cortexA17", .llvm_name = "cortex-a17", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidPartialCpsr, &feature_retAddrStack, &feature_mp, @@ -1189,63 +1189,63 @@ pub const cpu_cortexA17 = Cpu{ }; pub const cpu_cortexA32 = Cpu{ - .name = "cortex-a32", + .name = "cortexA32", .llvm_name = "cortex-a32", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, }, }; pub const cpu_cortexA35 = Cpu{ - .name = "cortex-a35", + .name = "cortexA35", .llvm_name = "cortex-a35", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, }, }; pub const cpu_cortexA5 = Cpu{ - .name = "cortex-a5", + .name = "cortexA5", .llvm_name = "cortex-a5", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_retAddrStack, &feature_slowfpvmlx, &feature_mp, @@ -1258,72 +1258,72 @@ pub const cpu_cortexA5 = Cpu{ }; pub const cpu_cortexA53 = Cpu{ - .name = "cortex-a53", + .name = "cortexA53", .llvm_name = "cortex-a53", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, &feature_fpao, }, }; pub const cpu_cortexA55 = Cpu{ - .name = "cortex-a55", + .name = "cortexA55", .llvm_name = "cortex-a55", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_dotprod, }, }; pub const cpu_cortexA57 = Cpu{ - .name = "cortex-a57", + .name = "cortexA57", .llvm_name = "cortex-a57", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_avoidPartialCpsr, &feature_cheapPredicableCpsr, &feature_crypto, @@ -1332,17 +1332,17 @@ pub const cpu_cortexA57 = Cpu{ }; pub const cpu_cortexA7 = Cpu{ - .name = "cortex-a7", + .name = "cortexA7", .llvm_name = "cortex-a7", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_retAddrStack, &feature_slowfpvmlx, &feature_vmlxHazards, @@ -1359,95 +1359,95 @@ pub const cpu_cortexA7 = Cpu{ }; pub const cpu_cortexA72 = Cpu{ - .name = "cortex-a72", + .name = "cortexA72", .llvm_name = "cortex-a72", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, }, }; pub const cpu_cortexA73 = Cpu{ - .name = "cortex-a73", + .name = "cortexA73", .llvm_name = "cortex-a73", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, }, }; pub const cpu_cortexA75 = Cpu{ - .name = "cortex-a75", + .name = "cortexA75", .llvm_name = "cortex-a75", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_dotprod, }, }; pub const cpu_cortexA76 = Cpu{ - .name = "cortex-a76", + .name = "cortexA76", .llvm_name = "cortex-a76", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, &feature_dotprod, &feature_fullfp16, @@ -1455,25 +1455,25 @@ pub const cpu_cortexA76 = Cpu{ }; pub const cpu_cortexA76ae = Cpu{ - .name = "cortex-a76ae", + .name = "cortexA76ae", .llvm_name = "cortex-a76ae", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_acquireRelease, - &feature_mp, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_crc, - &feature_fp16, - &feature_hwdiv, + &feature_ras, + &feature_v7clrex, &feature_hwdivArm, - &feature_thumb2, + &feature_acquireRelease, &feature_aclass, + &feature_perfmon, + &feature_crc, + &feature_mp, + &feature_hwdiv, + &feature_d32, + &feature_fp16, + &feature_db, &feature_crypto, &feature_dotprod, &feature_fullfp16, @@ -1481,17 +1481,17 @@ pub const cpu_cortexA76ae = Cpu{ }; pub const cpu_cortexA8 = Cpu{ - .name = "cortex-a8", + .name = "cortexA8", .llvm_name = "cortex-a8", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_retAddrStack, &feature_slowfpvmlx, &feature_vmlxHazards, @@ -1503,17 +1503,17 @@ pub const cpu_cortexA8 = Cpu{ }; pub const cpu_cortexA9 = Cpu{ - .name = "cortex-a9", + .name = "cortexA9", .llvm_name = "cortex-a9", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidPartialCpsr, &feature_vldnAlign, &feature_expandFpMlx, @@ -1530,65 +1530,65 @@ pub const cpu_cortexA9 = Cpu{ }; pub const cpu_cortexM0 = Cpu{ - .name = "cortex-m0", + .name = "cortexM0", .llvm_name = "cortex-m0", .dependencies = &[_]*const Feature { - &feature_db, - &feature_strictAlign, &feature_noarm, + &feature_strictAlign, &feature_mclass, + &feature_db, }, }; pub const cpu_cortexM0plus = Cpu{ - .name = "cortex-m0plus", + .name = "cortexM0plus", .llvm_name = "cortex-m0plus", .dependencies = &[_]*const Feature { - &feature_db, - &feature_strictAlign, &feature_noarm, + &feature_strictAlign, &feature_mclass, + &feature_db, }, }; pub const cpu_cortexM1 = Cpu{ - .name = "cortex-m1", + .name = "cortexM1", .llvm_name = "cortex-m1", .dependencies = &[_]*const Feature { - &feature_db, - &feature_strictAlign, &feature_noarm, + &feature_strictAlign, &feature_mclass, + &feature_db, }, }; pub const cpu_cortexM23 = Cpu{ - .name = "cortex-m23", + .name = "cortexM23", .llvm_name = "cortex-m23", .dependencies = &[_]*const Feature { - &feature_db, - &feature_strictAlign, + &feature_noarm, &feature_acquireRelease, &feature_v7clrex, - &feature_noarm, + &feature_strictAlign, &feature_mclass, &feature_hwdiv, &feature_msecext8, + &feature_db, &feature_noMovt, }, }; pub const cpu_cortexM3 = Cpu{ - .name = "cortex-m3", + .name = "cortexM3", .llvm_name = "cortex-m3", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, - &feature_v7clrex, + &feature_thumb2, &feature_noarm, + &feature_v7clrex, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_noBranchPredictor, &feature_loopAlign, &feature_useAa, @@ -1597,21 +1597,21 @@ pub const cpu_cortexM3 = Cpu{ }; pub const cpu_cortexM33 = Cpu{ - .name = "cortex-m33", + .name = "cortexM33", .llvm_name = "cortex-m33", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_noarm, &feature_acquireRelease, &feature_v7clrex, - &feature_noarm, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, &feature_msecext8, + &feature_db, &feature_dsp, - &feature_fp16, &feature_fpregs, + &feature_fp16, &feature_fpArmv8d16sp, &feature_noBranchPredictor, &feature_slowfpvmlx, @@ -1622,21 +1622,21 @@ pub const cpu_cortexM33 = Cpu{ }; pub const cpu_cortexM35p = Cpu{ - .name = "cortex-m35p", + .name = "cortexM35p", .llvm_name = "cortex-m35p", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_noarm, &feature_acquireRelease, &feature_v7clrex, - &feature_noarm, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, &feature_msecext8, + &feature_db, &feature_dsp, - &feature_fp16, &feature_fpregs, + &feature_fp16, &feature_fpArmv8d16sp, &feature_noBranchPredictor, &feature_slowfpvmlx, @@ -1647,73 +1647,73 @@ pub const cpu_cortexM35p = Cpu{ }; pub const cpu_cortexM4 = Cpu{ - .name = "cortex-m4", + .name = "cortexM4", .llvm_name = "cortex-m4", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, - &feature_v7clrex, + &feature_thumb2, &feature_dsp, &feature_noarm, + &feature_v7clrex, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_noBranchPredictor, &feature_slowfpvmlx, &feature_loopAlign, &feature_useAa, &feature_useMisched, - &feature_fp16, &feature_fpregs, + &feature_fp16, &feature_vfp4d16sp, }, }; pub const cpu_cortexM7 = Cpu{ - .name = "cortex-m7", + .name = "cortexM7", .llvm_name = "cortex-m7", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, - &feature_v7clrex, + &feature_thumb2, &feature_dsp, &feature_noarm, + &feature_v7clrex, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, - &feature_fp16, + &feature_db, &feature_fpregs, + &feature_fp16, &feature_fpArmv8d16, }, }; pub const cpu_cortexR4 = Cpu{ - .name = "cortex-r4", + .name = "cortexR4", .llvm_name = "cortex-r4", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_dsp, &feature_rclass, &feature_v7clrex, - &feature_dsp, + &feature_perfmon, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_avoidPartialCpsr, &feature_retAddrStack, }, }; pub const cpu_cortexR4f = Cpu{ - .name = "cortex-r4f", + .name = "cortexR4f", .llvm_name = "cortex-r4f", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_dsp, &feature_rclass, &feature_v7clrex, - &feature_dsp, + &feature_perfmon, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_avoidPartialCpsr, &feature_retAddrStack, &feature_slowfpvmlx, @@ -1724,16 +1724,16 @@ pub const cpu_cortexR4f = Cpu{ }; pub const cpu_cortexR5 = Cpu{ - .name = "cortex-r5", + .name = "cortexR5", .llvm_name = "cortex-r5", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_dsp, &feature_rclass, &feature_v7clrex, - &feature_dsp, + &feature_perfmon, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_avoidPartialCpsr, &feature_hwdivArm, &feature_retAddrStack, @@ -1745,24 +1745,24 @@ pub const cpu_cortexR5 = Cpu{ }; pub const cpu_cortexR52 = Cpu{ - .name = "cortex-r52", + .name = "cortexR52", .llvm_name = "cortex-r52", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_dfb, &feature_rclass, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_dfb, + &feature_db, &feature_fpao, &feature_useAa, &feature_useMisched, @@ -1770,16 +1770,16 @@ pub const cpu_cortexR52 = Cpu{ }; pub const cpu_cortexR7 = Cpu{ - .name = "cortex-r7", + .name = "cortexR7", .llvm_name = "cortex-r7", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_dsp, &feature_rclass, &feature_v7clrex, - &feature_dsp, + &feature_perfmon, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_avoidPartialCpsr, &feature_fp16, &feature_hwdivArm, @@ -1793,16 +1793,16 @@ pub const cpu_cortexR7 = Cpu{ }; pub const cpu_cortexR8 = Cpu{ - .name = "cortex-r8", + .name = "cortexR8", .llvm_name = "cortex-r8", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, + &feature_dsp, &feature_rclass, &feature_v7clrex, - &feature_dsp, + &feature_perfmon, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_avoidPartialCpsr, &feature_fp16, &feature_hwdivArm, @@ -1819,21 +1819,21 @@ pub const cpu_cyclone = Cpu{ .name = "cyclone", .llvm_name = "cyclone", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_avoidMovsShop, &feature_avoidPartialCpsr, &feature_crypto, @@ -1855,183 +1855,183 @@ pub const cpu_ep9312 = Cpu{ }; pub const cpu_exynosM1 = Cpu{ - .name = "exynos-m1", + .name = "exynosM1", .llvm_name = "exynos-m1", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_expandFpMlx, - &feature_fuseLiterals, - &feature_fuseAes, &feature_slowVgetlni32, - &feature_wideStrideVfp, &feature_profUnpr, - &feature_slowVdup32, &feature_slowfpvmlx, - &feature_dontWidenVmovs, + &feature_slowFpBrcc, &feature_useAa, + &feature_dontWidenVmovs, &feature_retAddrStack, + &feature_fuseLiterals, + &feature_wideStrideVfp, &feature_zcz, - &feature_slowFpBrcc, + &feature_fuseAes, + &feature_slowVdup32, }, }; pub const cpu_exynosM2 = Cpu{ - .name = "exynos-m2", + .name = "exynosM2", .llvm_name = "exynos-m2", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_expandFpMlx, - &feature_fuseLiterals, - &feature_fuseAes, &feature_slowVgetlni32, - &feature_wideStrideVfp, &feature_profUnpr, - &feature_slowVdup32, &feature_slowfpvmlx, - &feature_dontWidenVmovs, + &feature_slowFpBrcc, &feature_useAa, + &feature_dontWidenVmovs, &feature_retAddrStack, + &feature_fuseLiterals, + &feature_wideStrideVfp, &feature_zcz, - &feature_slowFpBrcc, + &feature_fuseAes, + &feature_slowVdup32, }, }; pub const cpu_exynosM3 = Cpu{ - .name = "exynos-m3", + .name = "exynosM3", .llvm_name = "exynos-m3", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_expandFpMlx, - &feature_fuseLiterals, - &feature_fuseAes, &feature_slowVgetlni32, - &feature_wideStrideVfp, &feature_profUnpr, - &feature_slowVdup32, &feature_slowfpvmlx, - &feature_dontWidenVmovs, + &feature_slowFpBrcc, &feature_useAa, + &feature_dontWidenVmovs, &feature_retAddrStack, + &feature_fuseLiterals, + &feature_wideStrideVfp, &feature_zcz, - &feature_slowFpBrcc, + &feature_fuseAes, + &feature_slowVdup32, }, }; pub const cpu_exynosM4 = Cpu{ - .name = "exynos-m4", + .name = "exynosM4", .llvm_name = "exynos-m4", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_dotprod, &feature_fullfp16, &feature_expandFpMlx, - &feature_fuseLiterals, - &feature_fuseAes, &feature_slowVgetlni32, - &feature_wideStrideVfp, &feature_profUnpr, - &feature_slowVdup32, &feature_slowfpvmlx, - &feature_dontWidenVmovs, + &feature_slowFpBrcc, &feature_useAa, + &feature_dontWidenVmovs, &feature_retAddrStack, + &feature_fuseLiterals, + &feature_wideStrideVfp, &feature_zcz, - &feature_slowFpBrcc, + &feature_fuseAes, + &feature_slowVdup32, }, }; pub const cpu_exynosM5 = Cpu{ - .name = "exynos-m5", + .name = "exynosM5", .llvm_name = "exynos-m5", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_dotprod, &feature_fullfp16, &feature_expandFpMlx, - &feature_fuseLiterals, - &feature_fuseAes, &feature_slowVgetlni32, - &feature_wideStrideVfp, &feature_profUnpr, - &feature_slowVdup32, &feature_slowfpvmlx, - &feature_dontWidenVmovs, + &feature_slowFpBrcc, &feature_useAa, + &feature_dontWidenVmovs, &feature_retAddrStack, + &feature_fuseLiterals, + &feature_wideStrideVfp, &feature_zcz, - &feature_slowFpBrcc, + &feature_fuseAes, + &feature_slowVdup32, }, }; @@ -2053,14 +2053,14 @@ pub const cpu_krait = Cpu{ .name = "krait", .llvm_name = "krait", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidPartialCpsr, &feature_vldnAlign, &feature_fp16, @@ -2077,21 +2077,21 @@ pub const cpu_kryo = Cpu{ .name = "kryo", .llvm_name = "kryo", .dependencies = &[_]*const Feature { - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, }, }; @@ -2114,25 +2114,25 @@ pub const cpu_mpcorenovfp = Cpu{ }; pub const cpu_neoverseN1 = Cpu{ - .name = "neoverse-n1", + .name = "neoverseN1", .llvm_name = "neoverse-n1", .dependencies = &[_]*const Feature { - &feature_ras, - &feature_db, &feature_trustzone, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, + &feature_dsp, + &feature_ras, + &feature_v7clrex, + &feature_hwdivArm, &feature_acquireRelease, + &feature_aclass, + &feature_perfmon, + &feature_crc, &feature_mp, + &feature_hwdiv, &feature_d32, - &feature_v7clrex, - &feature_dsp, - &feature_crc, &feature_fp16, - &feature_hwdiv, - &feature_hwdivArm, - &feature_thumb2, - &feature_aclass, + &feature_db, &feature_crypto, &feature_dotprod, }, @@ -2142,10 +2142,10 @@ pub const cpu_sc000 = Cpu{ .name = "sc000", .llvm_name = "sc000", .dependencies = &[_]*const Feature { - &feature_db, - &feature_strictAlign, &feature_noarm, + &feature_strictAlign, &feature_mclass, + &feature_db, }, }; @@ -2153,13 +2153,13 @@ pub const cpu_sc300 = Cpu{ .name = "sc300", .llvm_name = "sc300", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, - &feature_v7clrex, + &feature_thumb2, &feature_noarm, + &feature_v7clrex, + &feature_perfmon, &feature_mclass, &feature_hwdiv, - &feature_thumb2, + &feature_db, &feature_noBranchPredictor, &feature_useAa, &feature_useMisched, @@ -2198,14 +2198,14 @@ pub const cpu_swift = Cpu{ .name = "swift", .llvm_name = "swift", .dependencies = &[_]*const Feature { - &feature_db, - &feature_perfmon, + &feature_thumb2, &feature_fpregs, - &feature_d32, - &feature_v7clrex, &feature_dsp, - &feature_thumb2, + &feature_v7clrex, &feature_aclass, + &feature_perfmon, + &feature_d32, + &feature_db, &feature_avoidMovsShop, &feature_avoidPartialCpsr, &feature_hwdivArm, diff --git a/lib/std/target/avr.zig b/lib/std/target/avr.zig index ac5c8f1711..2f5dc00c74 100644 --- a/lib/std/target/avr.zig +++ b/lib/std/target/avr.zig @@ -170,12 +170,12 @@ pub const cpu_at43usb320 = Cpu{ .name = "at43usb320", .llvm_name = "at43usb320", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_elpm, &feature_lpm, + &feature_sram, &feature_addsubiw, + &feature_elpm, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -183,11 +183,11 @@ pub const cpu_at43usb355 = Cpu{ .name = "at43usb355", .llvm_name = "at43usb355", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -195,11 +195,11 @@ pub const cpu_at76c711 = Cpu{ .name = "at76c711", .llvm_name = "at76c711", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -207,8 +207,8 @@ pub const cpu_at86rf401 = Cpu{ .name = "at86rf401", .llvm_name = "at86rf401", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, &feature_lpmx, @@ -220,8 +220,8 @@ pub const cpu_at90c8534 = Cpu{ .name = "at90c8534", .llvm_name = "at90c8534", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -231,18 +231,18 @@ pub const cpu_at90can128 = Cpu{ .name = "at90can128", .llvm_name = "at90can128", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -250,16 +250,16 @@ pub const cpu_at90can32 = Cpu{ .name = "at90can32", .llvm_name = "at90can32", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -267,16 +267,16 @@ pub const cpu_at90can64 = Cpu{ .name = "at90can64", .llvm_name = "at90can64", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -284,15 +284,15 @@ pub const cpu_at90pwm1 = Cpu{ .name = "at90pwm1", .llvm_name = "at90pwm1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -300,16 +300,16 @@ pub const cpu_at90pwm161 = Cpu{ .name = "at90pwm161", .llvm_name = "at90pwm161", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -317,15 +317,15 @@ pub const cpu_at90pwm2 = Cpu{ .name = "at90pwm2", .llvm_name = "at90pwm2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -333,16 +333,16 @@ pub const cpu_at90pwm216 = Cpu{ .name = "at90pwm216", .llvm_name = "at90pwm216", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -350,15 +350,15 @@ pub const cpu_at90pwm2b = Cpu{ .name = "at90pwm2b", .llvm_name = "at90pwm2b", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -366,15 +366,15 @@ pub const cpu_at90pwm3 = Cpu{ .name = "at90pwm3", .llvm_name = "at90pwm3", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -382,16 +382,16 @@ pub const cpu_at90pwm316 = Cpu{ .name = "at90pwm316", .llvm_name = "at90pwm316", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -399,15 +399,15 @@ pub const cpu_at90pwm3b = Cpu{ .name = "at90pwm3b", .llvm_name = "at90pwm3b", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -415,15 +415,15 @@ pub const cpu_at90pwm81 = Cpu{ .name = "at90pwm81", .llvm_name = "at90pwm81", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -438,8 +438,8 @@ pub const cpu_at90s2313 = Cpu{ .name = "at90s2313", .llvm_name = "at90s2313", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -449,8 +449,8 @@ pub const cpu_at90s2323 = Cpu{ .name = "at90s2323", .llvm_name = "at90s2323", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -460,8 +460,8 @@ pub const cpu_at90s2333 = Cpu{ .name = "at90s2333", .llvm_name = "at90s2333", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -471,8 +471,8 @@ pub const cpu_at90s2343 = Cpu{ .name = "at90s2343", .llvm_name = "at90s2343", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -482,8 +482,8 @@ pub const cpu_at90s4414 = Cpu{ .name = "at90s4414", .llvm_name = "at90s4414", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -493,8 +493,8 @@ pub const cpu_at90s4433 = Cpu{ .name = "at90s4433", .llvm_name = "at90s4433", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -504,8 +504,8 @@ pub const cpu_at90s4434 = Cpu{ .name = "at90s4434", .llvm_name = "at90s4434", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -515,8 +515,8 @@ pub const cpu_at90s8515 = Cpu{ .name = "at90s8515", .llvm_name = "at90s8515", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -526,8 +526,8 @@ pub const cpu_at90s8535 = Cpu{ .name = "at90s8535", .llvm_name = "at90s8535", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -537,16 +537,16 @@ pub const cpu_at90scr100 = Cpu{ .name = "at90scr100", .llvm_name = "at90scr100", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -554,18 +554,18 @@ pub const cpu_at90usb1286 = Cpu{ .name = "at90usb1286", .llvm_name = "at90usb1286", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -573,18 +573,18 @@ pub const cpu_at90usb1287 = Cpu{ .name = "at90usb1287", .llvm_name = "at90usb1287", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -592,15 +592,15 @@ pub const cpu_at90usb162 = Cpu{ .name = "at90usb162", .llvm_name = "at90usb162", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -608,33 +608,33 @@ pub const cpu_at90usb646 = Cpu{ .name = "at90usb646", .llvm_name = "at90usb646", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, - }, -}; + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, + }, +}; pub const cpu_at90usb647 = Cpu{ .name = "at90usb647", .llvm_name = "at90usb647", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -642,15 +642,15 @@ pub const cpu_at90usb82 = Cpu{ .name = "at90usb82", .llvm_name = "at90usb82", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -658,11 +658,11 @@ pub const cpu_at94k = Cpu{ .name = "at94k", .llvm_name = "at94k", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, &feature_lpmx, &feature_movw, &feature_mul, @@ -673,14 +673,14 @@ pub const cpu_ata5272 = Cpu{ .name = "ata5272", .llvm_name = "ata5272", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -688,15 +688,15 @@ pub const cpu_ata5505 = Cpu{ .name = "ata5505", .llvm_name = "ata5505", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -704,16 +704,16 @@ pub const cpu_ata5790 = Cpu{ .name = "ata5790", .llvm_name = "ata5790", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -721,16 +721,16 @@ pub const cpu_ata5795 = Cpu{ .name = "ata5795", .llvm_name = "ata5795", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -738,15 +738,15 @@ pub const cpu_ata6285 = Cpu{ .name = "ata6285", .llvm_name = "ata6285", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -754,15 +754,15 @@ pub const cpu_ata6286 = Cpu{ .name = "ata6286", .llvm_name = "ata6286", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -770,15 +770,15 @@ pub const cpu_ata6289 = Cpu{ .name = "ata6289", .llvm_name = "ata6289", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -786,12 +786,12 @@ pub const cpu_atmega103 = Cpu{ .name = "atmega103", .llvm_name = "atmega103", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_elpm, &feature_lpm, + &feature_sram, &feature_addsubiw, + &feature_elpm, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -799,18 +799,18 @@ pub const cpu_atmega128 = Cpu{ .name = "atmega128", .llvm_name = "atmega128", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -818,18 +818,18 @@ pub const cpu_atmega1280 = Cpu{ .name = "atmega1280", .llvm_name = "atmega1280", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -837,18 +837,18 @@ pub const cpu_atmega1281 = Cpu{ .name = "atmega1281", .llvm_name = "atmega1281", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -856,18 +856,18 @@ pub const cpu_atmega1284 = Cpu{ .name = "atmega1284", .llvm_name = "atmega1284", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -875,18 +875,18 @@ pub const cpu_atmega1284p = Cpu{ .name = "atmega1284p", .llvm_name = "atmega1284p", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -894,18 +894,18 @@ pub const cpu_atmega1284rfr2 = Cpu{ .name = "atmega1284rfr2", .llvm_name = "atmega1284rfr2", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -913,18 +913,18 @@ pub const cpu_atmega128a = Cpu{ .name = "atmega128a", .llvm_name = "atmega128a", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -932,18 +932,18 @@ pub const cpu_atmega128rfa1 = Cpu{ .name = "atmega128rfa1", .llvm_name = "atmega128rfa1", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -951,18 +951,18 @@ pub const cpu_atmega128rfr2 = Cpu{ .name = "atmega128rfr2", .llvm_name = "atmega128rfr2", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -970,16 +970,16 @@ pub const cpu_atmega16 = Cpu{ .name = "atmega16", .llvm_name = "atmega16", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -987,11 +987,11 @@ pub const cpu_atmega161 = Cpu{ .name = "atmega161", .llvm_name = "atmega161", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, &feature_lpmx, &feature_movw, &feature_mul, @@ -1003,16 +1003,16 @@ pub const cpu_atmega162 = Cpu{ .name = "atmega162", .llvm_name = "atmega162", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1020,11 +1020,11 @@ pub const cpu_atmega163 = Cpu{ .name = "atmega163", .llvm_name = "atmega163", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, &feature_lpmx, &feature_movw, &feature_mul, @@ -1036,16 +1036,16 @@ pub const cpu_atmega164a = Cpu{ .name = "atmega164a", .llvm_name = "atmega164a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1053,16 +1053,16 @@ pub const cpu_atmega164p = Cpu{ .name = "atmega164p", .llvm_name = "atmega164p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1070,16 +1070,16 @@ pub const cpu_atmega164pa = Cpu{ .name = "atmega164pa", .llvm_name = "atmega164pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1087,16 +1087,16 @@ pub const cpu_atmega165 = Cpu{ .name = "atmega165", .llvm_name = "atmega165", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1104,16 +1104,16 @@ pub const cpu_atmega165a = Cpu{ .name = "atmega165a", .llvm_name = "atmega165a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1121,16 +1121,16 @@ pub const cpu_atmega165p = Cpu{ .name = "atmega165p", .llvm_name = "atmega165p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1138,16 +1138,16 @@ pub const cpu_atmega165pa = Cpu{ .name = "atmega165pa", .llvm_name = "atmega165pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1155,16 +1155,16 @@ pub const cpu_atmega168 = Cpu{ .name = "atmega168", .llvm_name = "atmega168", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1172,16 +1172,16 @@ pub const cpu_atmega168a = Cpu{ .name = "atmega168a", .llvm_name = "atmega168a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1189,16 +1189,16 @@ pub const cpu_atmega168p = Cpu{ .name = "atmega168p", .llvm_name = "atmega168p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1206,16 +1206,16 @@ pub const cpu_atmega168pa = Cpu{ .name = "atmega168pa", .llvm_name = "atmega168pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1223,16 +1223,16 @@ pub const cpu_atmega169 = Cpu{ .name = "atmega169", .llvm_name = "atmega169", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1240,16 +1240,16 @@ pub const cpu_atmega169a = Cpu{ .name = "atmega169a", .llvm_name = "atmega169a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1257,16 +1257,16 @@ pub const cpu_atmega169p = Cpu{ .name = "atmega169p", .llvm_name = "atmega169p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1274,16 +1274,16 @@ pub const cpu_atmega169pa = Cpu{ .name = "atmega169pa", .llvm_name = "atmega169pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1291,33 +1291,33 @@ pub const cpu_atmega16a = Cpu{ .name = "atmega16a", .llvm_name = "atmega16a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, - }, -}; + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, + }, +}; pub const cpu_atmega16hva = Cpu{ .name = "atmega16hva", .llvm_name = "atmega16hva", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1325,16 +1325,16 @@ pub const cpu_atmega16hva2 = Cpu{ .name = "atmega16hva2", .llvm_name = "atmega16hva2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1342,16 +1342,16 @@ pub const cpu_atmega16hvb = Cpu{ .name = "atmega16hvb", .llvm_name = "atmega16hvb", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1359,16 +1359,16 @@ pub const cpu_atmega16hvbrevb = Cpu{ .name = "atmega16hvbrevb", .llvm_name = "atmega16hvbrevb", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1376,16 +1376,16 @@ pub const cpu_atmega16m1 = Cpu{ .name = "atmega16m1", .llvm_name = "atmega16m1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1393,15 +1393,15 @@ pub const cpu_atmega16u2 = Cpu{ .name = "atmega16u2", .llvm_name = "atmega16u2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -1409,16 +1409,16 @@ pub const cpu_atmega16u4 = Cpu{ .name = "atmega16u4", .llvm_name = "atmega16u4", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1426,18 +1426,18 @@ pub const cpu_atmega2560 = Cpu{ .name = "atmega2560", .llvm_name = "atmega2560", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -1445,18 +1445,18 @@ pub const cpu_atmega2561 = Cpu{ .name = "atmega2561", .llvm_name = "atmega2561", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -1464,18 +1464,18 @@ pub const cpu_atmega2564rfr2 = Cpu{ .name = "atmega2564rfr2", .llvm_name = "atmega2564rfr2", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -1483,18 +1483,18 @@ pub const cpu_atmega256rfr2 = Cpu{ .name = "atmega256rfr2", .llvm_name = "atmega256rfr2", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -1502,16 +1502,16 @@ pub const cpu_atmega32 = Cpu{ .name = "atmega32", .llvm_name = "atmega32", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1519,16 +1519,16 @@ pub const cpu_atmega323 = Cpu{ .name = "atmega323", .llvm_name = "atmega323", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1536,16 +1536,16 @@ pub const cpu_atmega324a = Cpu{ .name = "atmega324a", .llvm_name = "atmega324a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1553,16 +1553,16 @@ pub const cpu_atmega324p = Cpu{ .name = "atmega324p", .llvm_name = "atmega324p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1570,16 +1570,16 @@ pub const cpu_atmega324pa = Cpu{ .name = "atmega324pa", .llvm_name = "atmega324pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1587,16 +1587,16 @@ pub const cpu_atmega325 = Cpu{ .name = "atmega325", .llvm_name = "atmega325", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1604,33 +1604,33 @@ pub const cpu_atmega3250 = Cpu{ .name = "atmega3250", .llvm_name = "atmega3250", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, - }, -}; - -pub const cpu_atmega3250a = Cpu{ + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, + }, +}; + +pub const cpu_atmega3250a = Cpu{ .name = "atmega3250a", .llvm_name = "atmega3250a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1638,16 +1638,16 @@ pub const cpu_atmega3250p = Cpu{ .name = "atmega3250p", .llvm_name = "atmega3250p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1655,16 +1655,16 @@ pub const cpu_atmega3250pa = Cpu{ .name = "atmega3250pa", .llvm_name = "atmega3250pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1672,16 +1672,16 @@ pub const cpu_atmega325a = Cpu{ .name = "atmega325a", .llvm_name = "atmega325a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1689,16 +1689,16 @@ pub const cpu_atmega325p = Cpu{ .name = "atmega325p", .llvm_name = "atmega325p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1706,16 +1706,16 @@ pub const cpu_atmega325pa = Cpu{ .name = "atmega325pa", .llvm_name = "atmega325pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1723,16 +1723,16 @@ pub const cpu_atmega328 = Cpu{ .name = "atmega328", .llvm_name = "atmega328", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1740,16 +1740,16 @@ pub const cpu_atmega328p = Cpu{ .name = "atmega328p", .llvm_name = "atmega328p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1757,16 +1757,16 @@ pub const cpu_atmega329 = Cpu{ .name = "atmega329", .llvm_name = "atmega329", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1774,16 +1774,16 @@ pub const cpu_atmega3290 = Cpu{ .name = "atmega3290", .llvm_name = "atmega3290", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1791,16 +1791,16 @@ pub const cpu_atmega3290a = Cpu{ .name = "atmega3290a", .llvm_name = "atmega3290a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1808,16 +1808,16 @@ pub const cpu_atmega3290p = Cpu{ .name = "atmega3290p", .llvm_name = "atmega3290p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1825,16 +1825,16 @@ pub const cpu_atmega3290pa = Cpu{ .name = "atmega3290pa", .llvm_name = "atmega3290pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1842,16 +1842,16 @@ pub const cpu_atmega329a = Cpu{ .name = "atmega329a", .llvm_name = "atmega329a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1859,16 +1859,16 @@ pub const cpu_atmega329p = Cpu{ .name = "atmega329p", .llvm_name = "atmega329p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1876,16 +1876,16 @@ pub const cpu_atmega329pa = Cpu{ .name = "atmega329pa", .llvm_name = "atmega329pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1893,16 +1893,16 @@ pub const cpu_atmega32a = Cpu{ .name = "atmega32a", .llvm_name = "atmega32a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1910,16 +1910,16 @@ pub const cpu_atmega32c1 = Cpu{ .name = "atmega32c1", .llvm_name = "atmega32c1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1927,16 +1927,16 @@ pub const cpu_atmega32hvb = Cpu{ .name = "atmega32hvb", .llvm_name = "atmega32hvb", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1944,16 +1944,16 @@ pub const cpu_atmega32hvbrevb = Cpu{ .name = "atmega32hvbrevb", .llvm_name = "atmega32hvbrevb", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1961,16 +1961,16 @@ pub const cpu_atmega32m1 = Cpu{ .name = "atmega32m1", .llvm_name = "atmega32m1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -1978,15 +1978,15 @@ pub const cpu_atmega32u2 = Cpu{ .name = "atmega32u2", .llvm_name = "atmega32u2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -1994,16 +1994,16 @@ pub const cpu_atmega32u4 = Cpu{ .name = "atmega32u4", .llvm_name = "atmega32u4", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2011,16 +2011,16 @@ pub const cpu_atmega32u6 = Cpu{ .name = "atmega32u6", .llvm_name = "atmega32u6", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2028,16 +2028,16 @@ pub const cpu_atmega406 = Cpu{ .name = "atmega406", .llvm_name = "atmega406", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2045,15 +2045,15 @@ pub const cpu_atmega48 = Cpu{ .name = "atmega48", .llvm_name = "atmega48", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2061,15 +2061,15 @@ pub const cpu_atmega48a = Cpu{ .name = "atmega48a", .llvm_name = "atmega48a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2077,15 +2077,15 @@ pub const cpu_atmega48p = Cpu{ .name = "atmega48p", .llvm_name = "atmega48p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2093,15 +2093,15 @@ pub const cpu_atmega48pa = Cpu{ .name = "atmega48pa", .llvm_name = "atmega48pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2109,16 +2109,16 @@ pub const cpu_atmega64 = Cpu{ .name = "atmega64", .llvm_name = "atmega64", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2126,16 +2126,16 @@ pub const cpu_atmega640 = Cpu{ .name = "atmega640", .llvm_name = "atmega640", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2143,16 +2143,16 @@ pub const cpu_atmega644 = Cpu{ .name = "atmega644", .llvm_name = "atmega644", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2160,16 +2160,16 @@ pub const cpu_atmega644a = Cpu{ .name = "atmega644a", .llvm_name = "atmega644a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2177,16 +2177,16 @@ pub const cpu_atmega644p = Cpu{ .name = "atmega644p", .llvm_name = "atmega644p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2194,16 +2194,16 @@ pub const cpu_atmega644pa = Cpu{ .name = "atmega644pa", .llvm_name = "atmega644pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2211,16 +2211,16 @@ pub const cpu_atmega644rfr2 = Cpu{ .name = "atmega644rfr2", .llvm_name = "atmega644rfr2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2228,16 +2228,16 @@ pub const cpu_atmega645 = Cpu{ .name = "atmega645", .llvm_name = "atmega645", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2245,16 +2245,16 @@ pub const cpu_atmega6450 = Cpu{ .name = "atmega6450", .llvm_name = "atmega6450", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2262,16 +2262,16 @@ pub const cpu_atmega6450a = Cpu{ .name = "atmega6450a", .llvm_name = "atmega6450a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2279,16 +2279,16 @@ pub const cpu_atmega6450p = Cpu{ .name = "atmega6450p", .llvm_name = "atmega6450p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2296,16 +2296,16 @@ pub const cpu_atmega645a = Cpu{ .name = "atmega645a", .llvm_name = "atmega645a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2313,16 +2313,16 @@ pub const cpu_atmega645p = Cpu{ .name = "atmega645p", .llvm_name = "atmega645p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2330,16 +2330,16 @@ pub const cpu_atmega649 = Cpu{ .name = "atmega649", .llvm_name = "atmega649", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2347,16 +2347,16 @@ pub const cpu_atmega6490 = Cpu{ .name = "atmega6490", .llvm_name = "atmega6490", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2364,16 +2364,16 @@ pub const cpu_atmega6490a = Cpu{ .name = "atmega6490a", .llvm_name = "atmega6490a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2381,16 +2381,16 @@ pub const cpu_atmega6490p = Cpu{ .name = "atmega6490p", .llvm_name = "atmega6490p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2398,16 +2398,16 @@ pub const cpu_atmega649a = Cpu{ .name = "atmega649a", .llvm_name = "atmega649a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2415,16 +2415,16 @@ pub const cpu_atmega649p = Cpu{ .name = "atmega649p", .llvm_name = "atmega649p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2432,16 +2432,16 @@ pub const cpu_atmega64a = Cpu{ .name = "atmega64a", .llvm_name = "atmega64a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2449,16 +2449,16 @@ pub const cpu_atmega64c1 = Cpu{ .name = "atmega64c1", .llvm_name = "atmega64c1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2466,16 +2466,16 @@ pub const cpu_atmega64hve = Cpu{ .name = "atmega64hve", .llvm_name = "atmega64hve", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2483,16 +2483,16 @@ pub const cpu_atmega64m1 = Cpu{ .name = "atmega64m1", .llvm_name = "atmega64m1", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2500,16 +2500,16 @@ pub const cpu_atmega64rfr2 = Cpu{ .name = "atmega64rfr2", .llvm_name = "atmega64rfr2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -2517,15 +2517,15 @@ pub const cpu_atmega8 = Cpu{ .name = "atmega8", .llvm_name = "atmega8", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2533,8 +2533,8 @@ pub const cpu_atmega8515 = Cpu{ .name = "atmega8515", .llvm_name = "atmega8515", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, &feature_lpmx, @@ -2548,8 +2548,8 @@ pub const cpu_atmega8535 = Cpu{ .name = "atmega8535", .llvm_name = "atmega8535", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, &feature_lpmx, @@ -2563,15 +2563,15 @@ pub const cpu_atmega88 = Cpu{ .name = "atmega88", .llvm_name = "atmega88", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2579,15 +2579,15 @@ pub const cpu_atmega88a = Cpu{ .name = "atmega88a", .llvm_name = "atmega88a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2595,15 +2595,15 @@ pub const cpu_atmega88p = Cpu{ .name = "atmega88p", .llvm_name = "atmega88p", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2611,15 +2611,15 @@ pub const cpu_atmega88pa = Cpu{ .name = "atmega88pa", .llvm_name = "atmega88pa", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2627,15 +2627,15 @@ pub const cpu_atmega8a = Cpu{ .name = "atmega8a", .llvm_name = "atmega8a", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2643,15 +2643,15 @@ pub const cpu_atmega8hva = Cpu{ .name = "atmega8hva", .llvm_name = "atmega8hva", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -2659,15 +2659,15 @@ pub const cpu_atmega8u2 = Cpu{ .name = "atmega8u2", .llvm_name = "atmega8u2", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -2676,8 +2676,8 @@ pub const cpu_attiny10 = Cpu{ .llvm_name = "attiny10", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2686,8 +2686,8 @@ pub const cpu_attiny102 = Cpu{ .llvm_name = "attiny102", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2696,8 +2696,8 @@ pub const cpu_attiny104 = Cpu{ .llvm_name = "attiny104", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2721,14 +2721,14 @@ pub const cpu_attiny13 = Cpu{ .name = "attiny13", .llvm_name = "attiny13", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2736,14 +2736,14 @@ pub const cpu_attiny13a = Cpu{ .name = "attiny13a", .llvm_name = "attiny13a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2759,15 +2759,15 @@ pub const cpu_attiny1634 = Cpu{ .name = "attiny1634", .llvm_name = "attiny1634", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -2775,15 +2775,15 @@ pub const cpu_attiny167 = Cpu{ .name = "attiny167", .llvm_name = "attiny167", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -2792,8 +2792,8 @@ pub const cpu_attiny20 = Cpu{ .llvm_name = "attiny20", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2801,8 +2801,8 @@ pub const cpu_attiny22 = Cpu{ .name = "attiny22", .llvm_name = "attiny22", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -2812,14 +2812,14 @@ pub const cpu_attiny2313 = Cpu{ .name = "attiny2313", .llvm_name = "attiny2313", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2827,14 +2827,14 @@ pub const cpu_attiny2313a = Cpu{ .name = "attiny2313a", .llvm_name = "attiny2313a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2842,14 +2842,14 @@ pub const cpu_attiny24 = Cpu{ .name = "attiny24", .llvm_name = "attiny24", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2857,14 +2857,14 @@ pub const cpu_attiny24a = Cpu{ .name = "attiny24a", .llvm_name = "attiny24a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2872,14 +2872,14 @@ pub const cpu_attiny25 = Cpu{ .name = "attiny25", .llvm_name = "attiny25", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2887,8 +2887,8 @@ pub const cpu_attiny26 = Cpu{ .name = "attiny26", .llvm_name = "attiny26", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, &feature_lpmx, @@ -2899,14 +2899,14 @@ pub const cpu_attiny261 = Cpu{ .name = "attiny261", .llvm_name = "attiny261", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2914,14 +2914,14 @@ pub const cpu_attiny261a = Cpu{ .name = "attiny261a", .llvm_name = "attiny261a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2938,8 +2938,8 @@ pub const cpu_attiny4 = Cpu{ .llvm_name = "attiny4", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2948,8 +2948,8 @@ pub const cpu_attiny40 = Cpu{ .llvm_name = "attiny40", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -2957,14 +2957,14 @@ pub const cpu_attiny4313 = Cpu{ .name = "attiny4313", .llvm_name = "attiny4313", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2972,14 +2972,14 @@ pub const cpu_attiny43u = Cpu{ .name = "attiny43u", .llvm_name = "attiny43u", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -2987,14 +2987,14 @@ pub const cpu_attiny44 = Cpu{ .name = "attiny44", .llvm_name = "attiny44", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3002,14 +3002,14 @@ pub const cpu_attiny44a = Cpu{ .name = "attiny44a", .llvm_name = "attiny44a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3017,14 +3017,14 @@ pub const cpu_attiny45 = Cpu{ .name = "attiny45", .llvm_name = "attiny45", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3032,14 +3032,14 @@ pub const cpu_attiny461 = Cpu{ .name = "attiny461", .llvm_name = "attiny461", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3047,14 +3047,14 @@ pub const cpu_attiny461a = Cpu{ .name = "attiny461a", .llvm_name = "attiny461a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3062,14 +3062,14 @@ pub const cpu_attiny48 = Cpu{ .name = "attiny48", .llvm_name = "attiny48", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3078,8 +3078,8 @@ pub const cpu_attiny5 = Cpu{ .llvm_name = "attiny5", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -3087,14 +3087,14 @@ pub const cpu_attiny828 = Cpu{ .name = "attiny828", .llvm_name = "attiny828", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3102,14 +3102,14 @@ pub const cpu_attiny84 = Cpu{ .name = "attiny84", .llvm_name = "attiny84", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3117,14 +3117,14 @@ pub const cpu_attiny84a = Cpu{ .name = "attiny84a", .llvm_name = "attiny84a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3132,14 +3132,14 @@ pub const cpu_attiny85 = Cpu{ .name = "attiny85", .llvm_name = "attiny85", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3147,14 +3147,14 @@ pub const cpu_attiny861 = Cpu{ .name = "attiny861", .llvm_name = "attiny861", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3162,14 +3162,14 @@ pub const cpu_attiny861a = Cpu{ .name = "attiny861a", .llvm_name = "attiny861a", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3177,14 +3177,14 @@ pub const cpu_attiny87 = Cpu{ .name = "attiny87", .llvm_name = "attiny87", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3192,14 +3192,14 @@ pub const cpu_attiny88 = Cpu{ .name = "attiny88", .llvm_name = "attiny88", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -3208,8 +3208,8 @@ pub const cpu_attiny9 = Cpu{ .llvm_name = "attiny9", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -3217,21 +3217,21 @@ pub const cpu_atxmega128a1 = Cpu{ .name = "atxmega128a1", .llvm_name = "atxmega128a1", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3239,22 +3239,22 @@ pub const cpu_atxmega128a1u = Cpu{ .name = "atxmega128a1u", .llvm_name = "atxmega128a1u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3262,21 +3262,21 @@ pub const cpu_atxmega128a3 = Cpu{ .name = "atxmega128a3", .llvm_name = "atxmega128a3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3284,22 +3284,22 @@ pub const cpu_atxmega128a3u = Cpu{ .name = "atxmega128a3u", .llvm_name = "atxmega128a3u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3307,22 +3307,22 @@ pub const cpu_atxmega128a4u = Cpu{ .name = "atxmega128a4u", .llvm_name = "atxmega128a4u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3330,22 +3330,22 @@ pub const cpu_atxmega128b1 = Cpu{ .name = "atxmega128b1", .llvm_name = "atxmega128b1", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3353,22 +3353,22 @@ pub const cpu_atxmega128b3 = Cpu{ .name = "atxmega128b3", .llvm_name = "atxmega128b3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3376,22 +3376,22 @@ pub const cpu_atxmega128c3 = Cpu{ .name = "atxmega128c3", .llvm_name = "atxmega128c3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3399,21 +3399,21 @@ pub const cpu_atxmega128d3 = Cpu{ .name = "atxmega128d3", .llvm_name = "atxmega128d3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3421,21 +3421,21 @@ pub const cpu_atxmega128d4 = Cpu{ .name = "atxmega128d4", .llvm_name = "atxmega128d4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3443,21 +3443,21 @@ pub const cpu_atxmega16a4 = Cpu{ .name = "atxmega16a4", .llvm_name = "atxmega16a4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3465,22 +3465,22 @@ pub const cpu_atxmega16a4u = Cpu{ .name = "atxmega16a4u", .llvm_name = "atxmega16a4u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3488,22 +3488,22 @@ pub const cpu_atxmega16c4 = Cpu{ .name = "atxmega16c4", .llvm_name = "atxmega16c4", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3511,21 +3511,21 @@ pub const cpu_atxmega16d4 = Cpu{ .name = "atxmega16d4", .llvm_name = "atxmega16d4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3533,21 +3533,21 @@ pub const cpu_atxmega16e5 = Cpu{ .name = "atxmega16e5", .llvm_name = "atxmega16e5", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3555,21 +3555,21 @@ pub const cpu_atxmega192a3 = Cpu{ .name = "atxmega192a3", .llvm_name = "atxmega192a3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3577,22 +3577,22 @@ pub const cpu_atxmega192a3u = Cpu{ .name = "atxmega192a3u", .llvm_name = "atxmega192a3u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3600,22 +3600,22 @@ pub const cpu_atxmega192c3 = Cpu{ .name = "atxmega192c3", .llvm_name = "atxmega192c3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3623,21 +3623,21 @@ pub const cpu_atxmega192d3 = Cpu{ .name = "atxmega192d3", .llvm_name = "atxmega192d3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3645,21 +3645,21 @@ pub const cpu_atxmega256a3 = Cpu{ .name = "atxmega256a3", .llvm_name = "atxmega256a3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3667,21 +3667,21 @@ pub const cpu_atxmega256a3b = Cpu{ .name = "atxmega256a3b", .llvm_name = "atxmega256a3b", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3689,22 +3689,22 @@ pub const cpu_atxmega256a3bu = Cpu{ .name = "atxmega256a3bu", .llvm_name = "atxmega256a3bu", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3712,22 +3712,22 @@ pub const cpu_atxmega256a3u = Cpu{ .name = "atxmega256a3u", .llvm_name = "atxmega256a3u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3735,22 +3735,22 @@ pub const cpu_atxmega256c3 = Cpu{ .name = "atxmega256c3", .llvm_name = "atxmega256c3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3758,21 +3758,21 @@ pub const cpu_atxmega256d3 = Cpu{ .name = "atxmega256d3", .llvm_name = "atxmega256d3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3780,21 +3780,21 @@ pub const cpu_atxmega32a4 = Cpu{ .name = "atxmega32a4", .llvm_name = "atxmega32a4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3802,22 +3802,22 @@ pub const cpu_atxmega32a4u = Cpu{ .name = "atxmega32a4u", .llvm_name = "atxmega32a4u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3825,22 +3825,22 @@ pub const cpu_atxmega32c4 = Cpu{ .name = "atxmega32c4", .llvm_name = "atxmega32c4", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3848,21 +3848,21 @@ pub const cpu_atxmega32d4 = Cpu{ .name = "atxmega32d4", .llvm_name = "atxmega32d4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3870,21 +3870,21 @@ pub const cpu_atxmega32e5 = Cpu{ .name = "atxmega32e5", .llvm_name = "atxmega32e5", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3892,21 +3892,21 @@ pub const cpu_atxmega32x1 = Cpu{ .name = "atxmega32x1", .llvm_name = "atxmega32x1", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3914,22 +3914,22 @@ pub const cpu_atxmega384c3 = Cpu{ .name = "atxmega384c3", .llvm_name = "atxmega384c3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -3937,21 +3937,21 @@ pub const cpu_atxmega384d3 = Cpu{ .name = "atxmega384d3", .llvm_name = "atxmega384d3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3959,21 +3959,21 @@ pub const cpu_atxmega64a1 = Cpu{ .name = "atxmega64a1", .llvm_name = "atxmega64a1", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -3981,22 +3981,22 @@ pub const cpu_atxmega64a1u = Cpu{ .name = "atxmega64a1u", .llvm_name = "atxmega64a1u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4004,21 +4004,21 @@ pub const cpu_atxmega64a3 = Cpu{ .name = "atxmega64a3", .llvm_name = "atxmega64a3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4026,22 +4026,22 @@ pub const cpu_atxmega64a3u = Cpu{ .name = "atxmega64a3u", .llvm_name = "atxmega64a3u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4049,22 +4049,22 @@ pub const cpu_atxmega64a4u = Cpu{ .name = "atxmega64a4u", .llvm_name = "atxmega64a4u", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4072,22 +4072,22 @@ pub const cpu_atxmega64b1 = Cpu{ .name = "atxmega64b1", .llvm_name = "atxmega64b1", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4095,22 +4095,22 @@ pub const cpu_atxmega64b3 = Cpu{ .name = "atxmega64b3", .llvm_name = "atxmega64b3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4118,22 +4118,22 @@ pub const cpu_atxmega64c3 = Cpu{ .name = "atxmega64c3", .llvm_name = "atxmega64c3", .dependencies = &[_]*const Feature { - &feature_des, + &feature_eijmpcall, + &feature_lpm, &feature_sram, &feature_movw, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_rmw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_rmw, - &feature_ijmpcall, - &feature_eijmpcall, - &feature_break, &feature_elpmx, + &feature_mul, }, }; @@ -4141,21 +4141,21 @@ pub const cpu_atxmega64d3 = Cpu{ .name = "atxmega64d3", .llvm_name = "atxmega64d3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4163,21 +4163,21 @@ pub const cpu_atxmega64d4 = Cpu{ .name = "atxmega64d4", .llvm_name = "atxmega64d4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4185,21 +4185,21 @@ pub const cpu_atxmega8e5 = Cpu{ .name = "atxmega8e5", .llvm_name = "atxmega8e5", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4215,8 +4215,8 @@ pub const cpu_avr2 = Cpu{ .name = "avr2", .llvm_name = "avr2", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, }, @@ -4226,14 +4226,14 @@ pub const cpu_avr25 = Cpu{ .name = "avr25", .llvm_name = "avr25", .dependencies = &[_]*const Feature { - &feature_sram, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, }, }; @@ -4241,11 +4241,11 @@ pub const cpu_avr3 = Cpu{ .name = "avr3", .llvm_name = "avr3", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, + &feature_sram, &feature_addsubiw, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -4253,12 +4253,12 @@ pub const cpu_avr31 = Cpu{ .name = "avr31", .llvm_name = "avr31", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_elpm, &feature_lpm, + &feature_sram, &feature_addsubiw, + &feature_elpm, &feature_ijmpcall, + &feature_jmpcall, }, }; @@ -4266,15 +4266,15 @@ pub const cpu_avr35 = Cpu{ .name = "avr35", .llvm_name = "avr35", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, }, }; @@ -4282,15 +4282,15 @@ pub const cpu_avr4 = Cpu{ .name = "avr4", .llvm_name = "avr4", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_spm, + &feature_mul, }, }; @@ -4298,16 +4298,16 @@ pub const cpu_avr5 = Cpu{ .name = "avr5", .llvm_name = "avr5", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; @@ -4315,18 +4315,18 @@ pub const cpu_avr51 = Cpu{ .name = "avr51", .llvm_name = "avr51", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4334,18 +4334,18 @@ pub const cpu_avr6 = Cpu{ .name = "avr6", .llvm_name = "avr6", .dependencies = &[_]*const Feature { + &feature_lpm, &feature_sram, - &feature_jmpcall, - &feature_mul, + &feature_addsubiw, + &feature_movw, &feature_elpm, - &feature_lpm, + &feature_break, + &feature_ijmpcall, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4354,8 +4354,8 @@ pub const cpu_avrtiny = Cpu{ .llvm_name = "avrtiny", .dependencies = &[_]*const Feature { &feature_sram, - &feature_tinyencoding, &feature_break, + &feature_tinyencoding, }, }; @@ -4363,21 +4363,21 @@ pub const cpu_avrxmega1 = Cpu{ .name = "avrxmega1", .llvm_name = "avrxmega1", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4385,21 +4385,21 @@ pub const cpu_avrxmega2 = Cpu{ .name = "avrxmega2", .llvm_name = "avrxmega2", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4407,21 +4407,21 @@ pub const cpu_avrxmega3 = Cpu{ .name = "avrxmega3", .llvm_name = "avrxmega3", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4429,21 +4429,21 @@ pub const cpu_avrxmega4 = Cpu{ .name = "avrxmega4", .llvm_name = "avrxmega4", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4451,21 +4451,21 @@ pub const cpu_avrxmega5 = Cpu{ .name = "avrxmega5", .llvm_name = "avrxmega5", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4473,21 +4473,21 @@ pub const cpu_avrxmega6 = Cpu{ .name = "avrxmega6", .llvm_name = "avrxmega6", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4495,21 +4495,21 @@ pub const cpu_avrxmega7 = Cpu{ .name = "avrxmega7", .llvm_name = "avrxmega7", .dependencies = &[_]*const Feature { - &feature_des, - &feature_sram, &feature_eijmpcall, - &feature_jmpcall, - &feature_mul, + &feature_lpm, + &feature_sram, + &feature_addsubiw, + &feature_movw, &feature_elpm, + &feature_break, + &feature_ijmpcall, + &feature_des, &feature_spmx, - &feature_lpm, &feature_lpmx, + &feature_jmpcall, &feature_spm, - &feature_addsubiw, - &feature_ijmpcall, &feature_elpmx, - &feature_break, - &feature_movw, + &feature_mul, }, }; @@ -4517,16 +4517,16 @@ pub const cpu_m3000 = Cpu{ .name = "m3000", .llvm_name = "m3000", .dependencies = &[_]*const Feature { - &feature_sram, - &feature_jmpcall, - &feature_mul, &feature_lpm, - &feature_lpmx, - &feature_spm, + &feature_sram, &feature_addsubiw, - &feature_ijmpcall, - &feature_break, &feature_movw, + &feature_break, + &feature_ijmpcall, + &feature_lpmx, + &feature_jmpcall, + &feature_spm, + &feature_mul, }, }; diff --git a/lib/std/target/hexagon.zig b/lib/std/target/hexagon.zig index 7deecaa6c7..54f59d651a 100644 --- a/lib/std/target/hexagon.zig +++ b/lib/std/target/hexagon.zig @@ -10,7 +10,7 @@ pub const feature_duplex = Feature{ }; pub const feature_longCalls = Feature{ - .name = "long-calls", + .name = "longCalls", .llvm_name = "long-calls", .description = "Use constant-extended calls", .dependencies = &[_]*const Feature { @@ -52,7 +52,7 @@ pub const feature_nvs = Feature{ }; pub const feature_noreturnStackElim = Feature{ - .name = "noreturn-stack-elim", + .name = "noreturnStackElim", .llvm_name = "noreturn-stack-elim", .description = "Eliminate stack allocation in a noreturn function when possible", .dependencies = &[_]*const Feature { @@ -68,7 +68,7 @@ pub const feature_packets = Feature{ }; pub const feature_reservedR19 = Feature{ - .name = "reserved-r19", + .name = "reservedR19", .llvm_name = "reserved-r19", .description = "Reserve register R19", .dependencies = &[_]*const Feature { @@ -76,7 +76,7 @@ pub const feature_reservedR19 = Feature{ }; pub const feature_smallData = Feature{ - .name = "small-data", + .name = "smallData", .llvm_name = "small-data", .description = "Allow GP-relative addressing of global variables", .dependencies = &[_]*const Feature { diff --git a/lib/std/target/mips.zig b/lib/std/target/mips.zig index 7b97a84f18..6eab968c23 100644 --- a/lib/std/target/mips.zig +++ b/lib/std/target/mips.zig @@ -22,14 +22,14 @@ pub const feature_cnmips = Feature{ .llvm_name = "cnmips", .description = "Octeon cnMIPS Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -100,7 +100,7 @@ pub const feature_gp64 = Feature{ }; pub const feature_longCalls = Feature{ - .name = "long-calls", + .name = "longCalls", .llvm_name = "long-calls", .description = "Disable use of the jal instruction", .dependencies = &[_]*const Feature { @@ -163,9 +163,9 @@ pub const feature_mips3 = Feature{ .dependencies = &[_]*const Feature { &feature_mips1, &feature_mips3_32r2, - &feature_fp64, - &feature_gp64, &feature_mips3_32, + &feature_gp64, + &feature_fp64, }, }; @@ -192,11 +192,11 @@ pub const feature_mips4 = Feature{ .dependencies = &[_]*const Feature { &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_fp64, + &feature_mips3_32, &feature_gp64, &feature_mips4_32r2, - &feature_mips3_32, + &feature_mips4_32, + &feature_fp64, }, }; @@ -221,14 +221,14 @@ pub const feature_mips5 = Feature{ .llvm_name = "mips5", .description = "MIPS V ISA Support [highly experimental]", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -253,9 +253,9 @@ pub const feature_mips32 = Feature{ .llvm_name = "mips32", .description = "Mips32 ISA Support", .dependencies = &[_]*const Feature { - &feature_mips1, - &feature_mips4_32, &feature_mips3_32, + &feature_mips4_32, + &feature_mips1, }, }; @@ -264,12 +264,12 @@ pub const feature_mips32r2 = Feature{ .llvm_name = "mips32r2", .description = "Mips32r2 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, }, }; @@ -278,12 +278,12 @@ pub const feature_mips32r3 = Feature{ .llvm_name = "mips32r3", .description = "Mips32r3 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, }, }; @@ -292,12 +292,12 @@ pub const feature_mips32r5 = Feature{ .llvm_name = "mips32r5", .description = "Mips32r5 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, }, }; @@ -306,15 +306,15 @@ pub const feature_mips32r6 = Feature{ .llvm_name = "mips32r6", .description = "Mips32r6 ISA Support [experimental]", .dependencies = &[_]*const Feature { - &feature_abs2008, + &feature_nan2008, + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, &feature_mips4_32, - &feature_nan2008, - &feature_mips5_32r2, + &feature_abs2008, &feature_fp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -323,14 +323,14 @@ pub const feature_mips64 = Feature{ .llvm_name = "mips64", .description = "Mips64 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -339,14 +339,14 @@ pub const feature_mips64r2 = Feature{ .llvm_name = "mips64r2", .description = "Mips64r2 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -355,14 +355,14 @@ pub const feature_mips64r3 = Feature{ .llvm_name = "mips64r3", .description = "Mips64r3 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -371,14 +371,14 @@ pub const feature_mips64r5 = Feature{ .llvm_name = "mips64r5", .description = "Mips64r5 ISA Support", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -387,16 +387,16 @@ pub const feature_mips64r6 = Feature{ .llvm_name = "mips64r6", .description = "Mips64r6 ISA Support [experimental]", .dependencies = &[_]*const Feature { - &feature_abs2008, + &feature_nan2008, + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_nan2008, - &feature_mips5_32r2, + &feature_abs2008, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, }, }; @@ -433,7 +433,7 @@ pub const feature_ptr64 = Feature{ }; pub const feature_singleFloat = Feature{ - .name = "single-float", + .name = "singleFloat", .llvm_name = "single-float", .description = "Only supports single precision float", .dependencies = &[_]*const Feature { @@ -441,7 +441,7 @@ pub const feature_singleFloat = Feature{ }; pub const feature_softFloat = Feature{ - .name = "soft-float", + .name = "softFloat", .llvm_name = "soft-float", .description = "Does not support floating point instructions", .dependencies = &[_]*const Feature { @@ -457,7 +457,7 @@ pub const feature_sym32 = Feature{ }; pub const feature_useIndirectJumpHazard = Feature{ - .name = "use-indirect-jump-hazard", + .name = "useIndirectJumpHazard", .llvm_name = "use-indirect-jump-hazard", .description = "Use indirect jump guards to prevent certain speculation based attacks", .dependencies = &[_]*const Feature { @@ -465,7 +465,7 @@ pub const feature_useIndirectJumpHazard = Feature{ }; pub const feature_useTccInDiv = Feature{ - .name = "use-tcc-in-div", + .name = "useTccInDiv", .llvm_name = "use-tcc-in-div", .description = "Force the assembler to use trapping", .dependencies = &[_]*const Feature { @@ -501,12 +501,12 @@ pub const feature_p5600 = Feature{ .llvm_name = "p5600", .description = "The P5600 Processor", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, }, }; @@ -586,9 +586,9 @@ pub const cpu_mips3 = Cpu{ .dependencies = &[_]*const Feature { &feature_mips1, &feature_mips3_32r2, - &feature_fp64, - &feature_gp64, &feature_mips3_32, + &feature_gp64, + &feature_fp64, &feature_mips3, }, }; @@ -597,9 +597,9 @@ pub const cpu_mips32 = Cpu{ .name = "mips32", .llvm_name = "mips32", .dependencies = &[_]*const Feature { - &feature_mips1, - &feature_mips4_32, &feature_mips3_32, + &feature_mips4_32, + &feature_mips1, &feature_mips32, }, }; @@ -608,12 +608,12 @@ pub const cpu_mips32r2 = Cpu{ .name = "mips32r2", .llvm_name = "mips32r2", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, &feature_mips32r2, }, }; @@ -622,12 +622,12 @@ pub const cpu_mips32r3 = Cpu{ .name = "mips32r3", .llvm_name = "mips32r3", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, &feature_mips32r3, }, }; @@ -636,12 +636,12 @@ pub const cpu_mips32r5 = Cpu{ .name = "mips32r5", .llvm_name = "mips32r5", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, &feature_mips32r5, }, }; @@ -650,15 +650,15 @@ pub const cpu_mips32r6 = Cpu{ .name = "mips32r6", .llvm_name = "mips32r6", .dependencies = &[_]*const Feature { - &feature_abs2008, + &feature_nan2008, + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, &feature_mips4_32, - &feature_nan2008, - &feature_mips5_32r2, + &feature_abs2008, &feature_fp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips32r6, }, }; @@ -669,11 +669,11 @@ pub const cpu_mips4 = Cpu{ .dependencies = &[_]*const Feature { &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_fp64, + &feature_mips3_32, &feature_gp64, &feature_mips4_32r2, - &feature_mips3_32, + &feature_mips4_32, + &feature_fp64, &feature_mips4, }, }; @@ -682,14 +682,14 @@ pub const cpu_mips5 = Cpu{ .name = "mips5", .llvm_name = "mips5", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips5, }, }; @@ -698,14 +698,14 @@ pub const cpu_mips64 = Cpu{ .name = "mips64", .llvm_name = "mips64", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips64, }, }; @@ -714,14 +714,14 @@ pub const cpu_mips64r2 = Cpu{ .name = "mips64r2", .llvm_name = "mips64r2", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips64r2, }, }; @@ -730,14 +730,14 @@ pub const cpu_mips64r3 = Cpu{ .name = "mips64r3", .llvm_name = "mips64r3", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips64r3, }, }; @@ -746,14 +746,14 @@ pub const cpu_mips64r5 = Cpu{ .name = "mips64r5", .llvm_name = "mips64r5", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips64r5, }, }; @@ -762,16 +762,16 @@ pub const cpu_mips64r6 = Cpu{ .name = "mips64r6", .llvm_name = "mips64r6", .dependencies = &[_]*const Feature { - &feature_abs2008, + &feature_nan2008, + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_nan2008, - &feature_mips5_32r2, + &feature_abs2008, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_mips64r6, }, }; @@ -780,14 +780,14 @@ pub const cpu_octeon = Cpu{ .name = "octeon", .llvm_name = "octeon", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, + &feature_mips3_32, + &feature_mips4_32r2, + &feature_gp64, &feature_mips4_32, - &feature_mips5_32r2, &feature_fp64, - &feature_gp64, - &feature_mips4_32r2, - &feature_mips3_32, &feature_cnmips, &feature_mips64r2, }, @@ -797,12 +797,12 @@ pub const cpu_p5600 = Cpu{ .name = "p5600", .llvm_name = "p5600", .dependencies = &[_]*const Feature { + &feature_mips5_32r2, &feature_mips1, &feature_mips3_32r2, - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips4_32r2, &feature_mips3_32, + &feature_mips4_32r2, + &feature_mips4_32, &feature_p5600, }, }; diff --git a/lib/std/target/powerpc.zig b/lib/std/target/powerpc.zig index 6ad23e9466..bb68049eca 100644 --- a/lib/std/target/powerpc.zig +++ b/lib/std/target/powerpc.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_bit64 = Feature{ - .name = "64bit", + .name = "bit64", .llvm_name = "64bit", .description = "Enable 64-bit instructions", .dependencies = &[_]*const Feature { @@ -10,7 +10,7 @@ pub const feature_bit64 = Feature{ }; pub const feature_bitregs64 = Feature{ - .name = "64bitregs", + .name = "bitregs64", .llvm_name = "64bitregs", .description = "Enable 64-bit registers usage for ppc32 [beta]", .dependencies = &[_]*const Feature { @@ -60,7 +60,7 @@ pub const feature_crbits = Feature{ }; pub const feature_directMove = Feature{ - .name = "direct-move", + .name = "directMove", .llvm_name = "direct-move", .description = "Enable Power8 direct move instructions", .dependencies = &[_]*const Feature { @@ -183,7 +183,7 @@ pub const feature_htm = Feature{ }; pub const feature_hardFloat = Feature{ - .name = "hard-float", + .name = "hardFloat", .llvm_name = "hard-float", .description = "Enable floating-point instructions", .dependencies = &[_]*const Feature { @@ -199,7 +199,7 @@ pub const feature_icbt = Feature{ }; pub const feature_isaV30Instructions = Feature{ - .name = "isa-v30-instructions", + .name = "isaV30Instructions", .llvm_name = "isa-v30-instructions", .description = "Enable instructions added in ISA 3.0.", .dependencies = &[_]*const Feature { @@ -215,7 +215,7 @@ pub const feature_isel = Feature{ }; pub const feature_invariantFunctionDescriptors = Feature{ - .name = "invariant-function-descriptors", + .name = "invariantFunctionDescriptors", .llvm_name = "invariant-function-descriptors", .description = "Assume function descriptors are invariant", .dependencies = &[_]*const Feature { @@ -265,7 +265,7 @@ pub const feature_msync = Feature{ }; pub const feature_power8Altivec = Feature{ - .name = "power8-altivec", + .name = "power8Altivec", .llvm_name = "power8-altivec", .description = "Enable POWER8 Altivec instructions", .dependencies = &[_]*const Feature { @@ -283,7 +283,7 @@ pub const feature_crypto = Feature{ }; pub const feature_power8Vector = Feature{ - .name = "power8-vector", + .name = "power8Vector", .llvm_name = "power8-vector", .description = "Enable POWER8 vector instructions", .dependencies = &[_]*const Feature { @@ -292,7 +292,7 @@ pub const feature_power8Vector = Feature{ }; pub const feature_power9Altivec = Feature{ - .name = "power9-altivec", + .name = "power9Altivec", .llvm_name = "power9-altivec", .description = "Enable POWER9 Altivec instructions", .dependencies = &[_]*const Feature { @@ -302,7 +302,7 @@ pub const feature_power9Altivec = Feature{ }; pub const feature_power9Vector = Feature{ - .name = "power9-vector", + .name = "power9Vector", .llvm_name = "power9-vector", .description = "Enable POWER9 vector instructions", .dependencies = &[_]*const Feature { @@ -336,7 +336,7 @@ pub const feature_ppc6xx = Feature{ }; pub const feature_ppcPostraSched = Feature{ - .name = "ppc-postra-sched", + .name = "ppcPostraSched", .llvm_name = "ppc-postra-sched", .description = "Use PowerPC post-RA scheduling strategy", .dependencies = &[_]*const Feature { @@ -344,7 +344,7 @@ pub const feature_ppcPostraSched = Feature{ }; pub const feature_ppcPreraSched = Feature{ - .name = "ppc-prera-sched", + .name = "ppcPreraSched", .llvm_name = "ppc-prera-sched", .description = "Use PowerPC pre-RA scheduling strategy", .dependencies = &[_]*const Feature { @@ -352,7 +352,7 @@ pub const feature_ppcPreraSched = Feature{ }; pub const feature_partwordAtomics = Feature{ - .name = "partword-atomics", + .name = "partwordAtomics", .llvm_name = "partword-atomics", .description = "Enable l[bh]arx and st[bh]cx.", .dependencies = &[_]*const Feature { @@ -395,7 +395,7 @@ pub const feature_stfiwx = Feature{ }; pub const feature_securePlt = Feature{ - .name = "secure-plt", + .name = "securePlt", .llvm_name = "secure-plt", .description = "Enable secure plt mode", .dependencies = &[_]*const Feature { @@ -403,7 +403,7 @@ pub const feature_securePlt = Feature{ }; pub const feature_slowPopcntd = Feature{ - .name = "slow-popcntd", + .name = "slowPopcntd", .llvm_name = "slow-popcntd", .description = "Has slow popcnt[dw] instructions", .dependencies = &[_]*const Feature { @@ -411,7 +411,7 @@ pub const feature_slowPopcntd = Feature{ }; pub const feature_twoConstNr = Feature{ - .name = "two-const-nr", + .name = "twoConstNr", .llvm_name = "two-const-nr", .description = "Requires two constant Newton-Raphson computation", .dependencies = &[_]*const Feature { @@ -428,7 +428,7 @@ pub const feature_vsx = Feature{ }; pub const feature_vectorsUseTwoUnits = Feature{ - .name = "vectors-use-two-units", + .name = "vectorsUseTwoUnits", .llvm_name = "vectors-use-two-units", .description = "Vectors use two units", .dependencies = &[_]*const Feature { @@ -546,7 +546,7 @@ pub const cpu_603 = Cpu{ }; pub const cpu_e603 = Cpu{ - .name = "603e", + .name = "e603", .llvm_name = "603e", .dependencies = &[_]*const Feature { &feature_hardFloat, @@ -556,7 +556,7 @@ pub const cpu_e603 = Cpu{ }; pub const cpu_ev603 = Cpu{ - .name = "603ev", + .name = "ev603", .llvm_name = "603ev", .dependencies = &[_]*const Feature { &feature_hardFloat, @@ -576,7 +576,7 @@ pub const cpu_604 = Cpu{ }; pub const cpu_e604 = Cpu{ - .name = "604e", + .name = "e604", .llvm_name = "604e", .dependencies = &[_]*const Feature { &feature_hardFloat, @@ -755,7 +755,7 @@ pub const cpu_g4 = Cpu{ }; pub const cpu_g4Plus = Cpu{ - .name = "g4+", + .name = "g4Plus", .llvm_name = "g4+", .dependencies = &[_]*const Feature { &feature_hardFloat, diff --git a/lib/std/target/riscv.zig b/lib/std/target/riscv.zig index e9b976b004..a3f21adc01 100644 --- a/lib/std/target/riscv.zig +++ b/lib/std/target/riscv.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_bit64 = Feature{ - .name = "64bit", + .name = "bit64", .llvm_name = "64bit", .description = "Implements RV64", .dependencies = &[_]*const Feature { @@ -18,7 +18,7 @@ pub const feature_e = Feature{ }; pub const feature_rvcHints = Feature{ - .name = "rvc-hints", + .name = "rvcHints", .llvm_name = "rvc-hints", .description = "Enable RVC Hint Instructions.", .dependencies = &[_]*const Feature { @@ -87,7 +87,7 @@ pub const features = &[_]*const Feature { }; pub const cpu_genericRv32 = Cpu{ - .name = "generic-rv32", + .name = "genericRv32", .llvm_name = "generic-rv32", .dependencies = &[_]*const Feature { &feature_rvcHints, @@ -95,7 +95,7 @@ pub const cpu_genericRv32 = Cpu{ }; pub const cpu_genericRv64 = Cpu{ - .name = "generic-rv64", + .name = "genericRv64", .llvm_name = "generic-rv64", .dependencies = &[_]*const Feature { &feature_bit64, diff --git a/lib/std/target/sparc.zig b/lib/std/target/sparc.zig index 5bf844b870..7dfaa47df7 100644 --- a/lib/std/target/sparc.zig +++ b/lib/std/target/sparc.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_hardQuadFloat = Feature{ - .name = "hard-quad-float", + .name = "hardQuadFloat", .llvm_name = "hard-quad-float", .description = "Enable quad-word floating point instructions", .dependencies = &[_]*const Feature { @@ -18,7 +18,7 @@ pub const feature_leon = Feature{ }; pub const feature_noFmuls = Feature{ - .name = "no-fmuls", + .name = "noFmuls", .llvm_name = "no-fmuls", .description = "Disable the fmuls instruction.", .dependencies = &[_]*const Feature { @@ -26,7 +26,7 @@ pub const feature_noFmuls = Feature{ }; pub const feature_noFsmuld = Feature{ - .name = "no-fsmuld", + .name = "noFsmuld", .llvm_name = "no-fsmuld", .description = "Disable the fsmuld instruction.", .dependencies = &[_]*const Feature { @@ -42,7 +42,7 @@ pub const feature_leonpwrpsr = Feature{ }; pub const feature_softFloat = Feature{ - .name = "soft-float", + .name = "softFloat", .llvm_name = "soft-float", .description = "Use software emulation for floating point", .dependencies = &[_]*const Feature { @@ -50,7 +50,7 @@ pub const feature_softFloat = Feature{ }; pub const feature_softMulDiv = Feature{ - .name = "soft-mul-div", + .name = "softMulDiv", .llvm_name = "soft-mul-div", .description = "Use software emulation for integer multiply and divide", .dependencies = &[_]*const Feature { @@ -58,7 +58,7 @@ pub const feature_softMulDiv = Feature{ }; pub const feature_deprecatedV8 = Feature{ - .name = "deprecated-v8", + .name = "deprecatedV8", .llvm_name = "deprecated-v8", .description = "Enable deprecated V8 instructions in V9 mode", .dependencies = &[_]*const Feature { @@ -287,7 +287,7 @@ pub const cpu_myriad2 = Cpu{ }; pub const cpu_myriad21 = Cpu{ - .name = "myriad2.1", + .name = "myriad21", .llvm_name = "myriad2.1", .dependencies = &[_]*const Feature { &feature_leon, @@ -295,7 +295,7 @@ pub const cpu_myriad21 = Cpu{ }; pub const cpu_myriad22 = Cpu{ - .name = "myriad2.2", + .name = "myriad22", .llvm_name = "myriad2.2", .dependencies = &[_]*const Feature { &feature_leon, @@ -303,7 +303,7 @@ pub const cpu_myriad22 = Cpu{ }; pub const cpu_myriad23 = Cpu{ - .name = "myriad2.3", + .name = "myriad23", .llvm_name = "myriad2.3", .dependencies = &[_]*const Feature { &feature_leon, diff --git a/lib/std/target/systemz.zig b/lib/std/target/systemz.zig index 56bd80efd1..7966f41915 100644 --- a/lib/std/target/systemz.zig +++ b/lib/std/target/systemz.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_dfpPackedConversion = Feature{ - .name = "dfp-packed-conversion", + .name = "dfpPackedConversion", .llvm_name = "dfp-packed-conversion", .description = "Assume that the DFP packed-conversion facility is installed", .dependencies = &[_]*const Feature { @@ -10,7 +10,7 @@ pub const feature_dfpPackedConversion = Feature{ }; pub const feature_dfpZonedConversion = Feature{ - .name = "dfp-zoned-conversion", + .name = "dfpZonedConversion", .llvm_name = "dfp-zoned-conversion", .description = "Assume that the DFP zoned-conversion facility is installed", .dependencies = &[_]*const Feature { @@ -18,7 +18,7 @@ pub const feature_dfpZonedConversion = Feature{ }; pub const feature_deflateConversion = Feature{ - .name = "deflate-conversion", + .name = "deflateConversion", .llvm_name = "deflate-conversion", .description = "Assume that the deflate-conversion facility is installed", .dependencies = &[_]*const Feature { @@ -26,7 +26,7 @@ pub const feature_deflateConversion = Feature{ }; pub const feature_distinctOps = Feature{ - .name = "distinct-ops", + .name = "distinctOps", .llvm_name = "distinct-ops", .description = "Assume that the distinct-operands facility is installed", .dependencies = &[_]*const Feature { @@ -34,7 +34,7 @@ pub const feature_distinctOps = Feature{ }; pub const feature_enhancedDat2 = Feature{ - .name = "enhanced-dat-2", + .name = "enhancedDat2", .llvm_name = "enhanced-dat-2", .description = "Assume that the enhanced-DAT facility 2 is installed", .dependencies = &[_]*const Feature { @@ -42,7 +42,7 @@ pub const feature_enhancedDat2 = Feature{ }; pub const feature_enhancedSort = Feature{ - .name = "enhanced-sort", + .name = "enhancedSort", .llvm_name = "enhanced-sort", .description = "Assume that the enhanced-sort facility is installed", .dependencies = &[_]*const Feature { @@ -50,7 +50,7 @@ pub const feature_enhancedSort = Feature{ }; pub const feature_executionHint = Feature{ - .name = "execution-hint", + .name = "executionHint", .llvm_name = "execution-hint", .description = "Assume that the execution-hint facility is installed", .dependencies = &[_]*const Feature { @@ -58,7 +58,7 @@ pub const feature_executionHint = Feature{ }; pub const feature_fpExtension = Feature{ - .name = "fp-extension", + .name = "fpExtension", .llvm_name = "fp-extension", .description = "Assume that the floating-point extension facility is installed", .dependencies = &[_]*const Feature { @@ -66,7 +66,7 @@ pub const feature_fpExtension = Feature{ }; pub const feature_fastSerialization = Feature{ - .name = "fast-serialization", + .name = "fastSerialization", .llvm_name = "fast-serialization", .description = "Assume that the fast-serialization facility is installed", .dependencies = &[_]*const Feature { @@ -74,7 +74,7 @@ pub const feature_fastSerialization = Feature{ }; pub const feature_guardedStorage = Feature{ - .name = "guarded-storage", + .name = "guardedStorage", .llvm_name = "guarded-storage", .description = "Assume that the guarded-storage facility is installed", .dependencies = &[_]*const Feature { @@ -82,7 +82,7 @@ pub const feature_guardedStorage = Feature{ }; pub const feature_highWord = Feature{ - .name = "high-word", + .name = "highWord", .llvm_name = "high-word", .description = "Assume that the high-word facility is installed", .dependencies = &[_]*const Feature { @@ -90,7 +90,7 @@ pub const feature_highWord = Feature{ }; pub const feature_insertReferenceBitsMultiple = Feature{ - .name = "insert-reference-bits-multiple", + .name = "insertReferenceBitsMultiple", .llvm_name = "insert-reference-bits-multiple", .description = "Assume that the insert-reference-bits-multiple facility is installed", .dependencies = &[_]*const Feature { @@ -98,7 +98,7 @@ pub const feature_insertReferenceBitsMultiple = Feature{ }; pub const feature_interlockedAccess1 = Feature{ - .name = "interlocked-access1", + .name = "interlockedAccess1", .llvm_name = "interlocked-access1", .description = "Assume that interlocked-access facility 1 is installed", .dependencies = &[_]*const Feature { @@ -106,7 +106,7 @@ pub const feature_interlockedAccess1 = Feature{ }; pub const feature_loadAndTrap = Feature{ - .name = "load-and-trap", + .name = "loadAndTrap", .llvm_name = "load-and-trap", .description = "Assume that the load-and-trap facility is installed", .dependencies = &[_]*const Feature { @@ -114,7 +114,7 @@ pub const feature_loadAndTrap = Feature{ }; pub const feature_loadAndZeroRightmostByte = Feature{ - .name = "load-and-zero-rightmost-byte", + .name = "loadAndZeroRightmostByte", .llvm_name = "load-and-zero-rightmost-byte", .description = "Assume that the load-and-zero-rightmost-byte facility is installed", .dependencies = &[_]*const Feature { @@ -122,7 +122,7 @@ pub const feature_loadAndZeroRightmostByte = Feature{ }; pub const feature_loadStoreOnCond = Feature{ - .name = "load-store-on-cond", + .name = "loadStoreOnCond", .llvm_name = "load-store-on-cond", .description = "Assume that the load/store-on-condition facility is installed", .dependencies = &[_]*const Feature { @@ -130,7 +130,7 @@ pub const feature_loadStoreOnCond = Feature{ }; pub const feature_loadStoreOnCond2 = Feature{ - .name = "load-store-on-cond-2", + .name = "loadStoreOnCond2", .llvm_name = "load-store-on-cond-2", .description = "Assume that the load/store-on-condition facility 2 is installed", .dependencies = &[_]*const Feature { @@ -138,7 +138,7 @@ pub const feature_loadStoreOnCond2 = Feature{ }; pub const feature_messageSecurityAssistExtension3 = Feature{ - .name = "message-security-assist-extension3", + .name = "messageSecurityAssistExtension3", .llvm_name = "message-security-assist-extension3", .description = "Assume that the message-security-assist extension facility 3 is installed", .dependencies = &[_]*const Feature { @@ -146,7 +146,7 @@ pub const feature_messageSecurityAssistExtension3 = Feature{ }; pub const feature_messageSecurityAssistExtension4 = Feature{ - .name = "message-security-assist-extension4", + .name = "messageSecurityAssistExtension4", .llvm_name = "message-security-assist-extension4", .description = "Assume that the message-security-assist extension facility 4 is installed", .dependencies = &[_]*const Feature { @@ -154,7 +154,7 @@ pub const feature_messageSecurityAssistExtension4 = Feature{ }; pub const feature_messageSecurityAssistExtension5 = Feature{ - .name = "message-security-assist-extension5", + .name = "messageSecurityAssistExtension5", .llvm_name = "message-security-assist-extension5", .description = "Assume that the message-security-assist extension facility 5 is installed", .dependencies = &[_]*const Feature { @@ -162,7 +162,7 @@ pub const feature_messageSecurityAssistExtension5 = Feature{ }; pub const feature_messageSecurityAssistExtension7 = Feature{ - .name = "message-security-assist-extension7", + .name = "messageSecurityAssistExtension7", .llvm_name = "message-security-assist-extension7", .description = "Assume that the message-security-assist extension facility 7 is installed", .dependencies = &[_]*const Feature { @@ -170,7 +170,7 @@ pub const feature_messageSecurityAssistExtension7 = Feature{ }; pub const feature_messageSecurityAssistExtension8 = Feature{ - .name = "message-security-assist-extension8", + .name = "messageSecurityAssistExtension8", .llvm_name = "message-security-assist-extension8", .description = "Assume that the message-security-assist extension facility 8 is installed", .dependencies = &[_]*const Feature { @@ -178,7 +178,7 @@ pub const feature_messageSecurityAssistExtension8 = Feature{ }; pub const feature_messageSecurityAssistExtension9 = Feature{ - .name = "message-security-assist-extension9", + .name = "messageSecurityAssistExtension9", .llvm_name = "message-security-assist-extension9", .description = "Assume that the message-security-assist extension facility 9 is installed", .dependencies = &[_]*const Feature { @@ -186,7 +186,7 @@ pub const feature_messageSecurityAssistExtension9 = Feature{ }; pub const feature_miscellaneousExtensions = Feature{ - .name = "miscellaneous-extensions", + .name = "miscellaneousExtensions", .llvm_name = "miscellaneous-extensions", .description = "Assume that the miscellaneous-extensions facility is installed", .dependencies = &[_]*const Feature { @@ -194,7 +194,7 @@ pub const feature_miscellaneousExtensions = Feature{ }; pub const feature_miscellaneousExtensions2 = Feature{ - .name = "miscellaneous-extensions-2", + .name = "miscellaneousExtensions2", .llvm_name = "miscellaneous-extensions-2", .description = "Assume that the miscellaneous-extensions facility 2 is installed", .dependencies = &[_]*const Feature { @@ -202,7 +202,7 @@ pub const feature_miscellaneousExtensions2 = Feature{ }; pub const feature_miscellaneousExtensions3 = Feature{ - .name = "miscellaneous-extensions-3", + .name = "miscellaneousExtensions3", .llvm_name = "miscellaneous-extensions-3", .description = "Assume that the miscellaneous-extensions facility 3 is installed", .dependencies = &[_]*const Feature { @@ -210,7 +210,7 @@ pub const feature_miscellaneousExtensions3 = Feature{ }; pub const feature_populationCount = Feature{ - .name = "population-count", + .name = "populationCount", .llvm_name = "population-count", .description = "Assume that the population-count facility is installed", .dependencies = &[_]*const Feature { @@ -218,7 +218,7 @@ pub const feature_populationCount = Feature{ }; pub const feature_processorAssist = Feature{ - .name = "processor-assist", + .name = "processorAssist", .llvm_name = "processor-assist", .description = "Assume that the processor-assist facility is installed", .dependencies = &[_]*const Feature { @@ -226,7 +226,7 @@ pub const feature_processorAssist = Feature{ }; pub const feature_resetReferenceBitsMultiple = Feature{ - .name = "reset-reference-bits-multiple", + .name = "resetReferenceBitsMultiple", .llvm_name = "reset-reference-bits-multiple", .description = "Assume that the reset-reference-bits-multiple facility is installed", .dependencies = &[_]*const Feature { @@ -234,7 +234,7 @@ pub const feature_resetReferenceBitsMultiple = Feature{ }; pub const feature_transactionalExecution = Feature{ - .name = "transactional-execution", + .name = "transactionalExecution", .llvm_name = "transactional-execution", .description = "Assume that the transactional-execution facility is installed", .dependencies = &[_]*const Feature { @@ -250,7 +250,7 @@ pub const feature_vector = Feature{ }; pub const feature_vectorEnhancements1 = Feature{ - .name = "vector-enhancements-1", + .name = "vectorEnhancements1", .llvm_name = "vector-enhancements-1", .description = "Assume that the vector enhancements facility 1 is installed", .dependencies = &[_]*const Feature { @@ -258,7 +258,7 @@ pub const feature_vectorEnhancements1 = Feature{ }; pub const feature_vectorEnhancements2 = Feature{ - .name = "vector-enhancements-2", + .name = "vectorEnhancements2", .llvm_name = "vector-enhancements-2", .description = "Assume that the vector enhancements facility 2 is installed", .dependencies = &[_]*const Feature { @@ -266,7 +266,7 @@ pub const feature_vectorEnhancements2 = Feature{ }; pub const feature_vectorPackedDecimal = Feature{ - .name = "vector-packed-decimal", + .name = "vectorPackedDecimal", .llvm_name = "vector-packed-decimal", .description = "Assume that the vector packed decimal facility is installed", .dependencies = &[_]*const Feature { @@ -274,7 +274,7 @@ pub const feature_vectorPackedDecimal = Feature{ }; pub const feature_vectorPackedDecimalEnhancement = Feature{ - .name = "vector-packed-decimal-enhancement", + .name = "vectorPackedDecimalEnhancement", .llvm_name = "vector-packed-decimal-enhancement", .description = "Assume that the vector packed decimal enhancement facility is installed", .dependencies = &[_]*const Feature { diff --git a/lib/std/target/wasm.zig b/lib/std/target/wasm.zig index ae3bfe9138..61df1820b5 100644 --- a/lib/std/target/wasm.zig +++ b/lib/std/target/wasm.zig @@ -10,7 +10,7 @@ pub const feature_atomics = Feature{ }; pub const feature_bulkMemory = Feature{ - .name = "bulk-memory", + .name = "bulkMemory", .llvm_name = "bulk-memory", .description = "Enable bulk memory operations", .dependencies = &[_]*const Feature { @@ -18,7 +18,7 @@ pub const feature_bulkMemory = Feature{ }; pub const feature_exceptionHandling = Feature{ - .name = "exception-handling", + .name = "exceptionHandling", .llvm_name = "exception-handling", .description = "Enable Wasm exception handling", .dependencies = &[_]*const Feature { @@ -34,7 +34,7 @@ pub const feature_multivalue = Feature{ }; pub const feature_mutableGlobals = Feature{ - .name = "mutable-globals", + .name = "mutableGlobals", .llvm_name = "mutable-globals", .description = "Enable mutable globals", .dependencies = &[_]*const Feature { @@ -42,7 +42,7 @@ pub const feature_mutableGlobals = Feature{ }; pub const feature_nontrappingFptoint = Feature{ - .name = "nontrapping-fptoint", + .name = "nontrappingFptoint", .llvm_name = "nontrapping-fptoint", .description = "Enable non-trapping float-to-int conversion operators", .dependencies = &[_]*const Feature { @@ -58,7 +58,7 @@ pub const feature_simd128 = Feature{ }; pub const feature_signExt = Feature{ - .name = "sign-ext", + .name = "signExt", .llvm_name = "sign-ext", .description = "Enable sign extension operators", .dependencies = &[_]*const Feature { @@ -66,7 +66,7 @@ pub const feature_signExt = Feature{ }; pub const feature_tailCall = Feature{ - .name = "tail-call", + .name = "tailCall", .llvm_name = "tail-call", .description = "Enable tail call instructions", .dependencies = &[_]*const Feature { @@ -74,7 +74,7 @@ pub const feature_tailCall = Feature{ }; pub const feature_unimplementedSimd128 = Feature{ - .name = "unimplemented-simd128", + .name = "unimplementedSimd128", .llvm_name = "unimplemented-simd128", .description = "Enable 128-bit SIMD not yet implemented in engines", .dependencies = &[_]*const Feature { @@ -96,7 +96,7 @@ pub const features = &[_]*const Feature { }; pub const cpu_bleedingEdge = Cpu{ - .name = "bleeding-edge", + .name = "bleedingEdge", .llvm_name = "bleeding-edge", .dependencies = &[_]*const Feature { &feature_atomics, diff --git a/lib/std/target/x86.zig b/lib/std/target/x86.zig index 29062173ab..f7469ba47f 100644 --- a/lib/std/target/x86.zig +++ b/lib/std/target/x86.zig @@ -2,7 +2,7 @@ const Feature = @import("std").target.Feature; const Cpu = @import("std").target.Cpu; pub const feature_dnow3 = Feature{ - .name = "3dnow", + .name = "dnow3", .llvm_name = "3dnow", .description = "Enable 3DNow! instructions", .dependencies = &[_]*const Feature { @@ -11,7 +11,7 @@ pub const feature_dnow3 = Feature{ }; pub const feature_dnowa3 = Feature{ - .name = "3dnowa", + .name = "dnowa3", .llvm_name = "3dnowa", .description = "Enable 3DNow! Athlon instructions", .dependencies = &[_]*const Feature { @@ -20,7 +20,7 @@ pub const feature_dnowa3 = Feature{ }; pub const feature_bit64 = Feature{ - .name = "64bit", + .name = "bit64", .llvm_name = "64bit", .description = "Support 64-bit instructions", .dependencies = &[_]*const Feature { @@ -274,7 +274,7 @@ pub const feature_fxsr = Feature{ }; pub const feature_fast11bytenop = Feature{ - .name = "fast-11bytenop", + .name = "fast11bytenop", .llvm_name = "fast-11bytenop", .description = "Target can quickly decode up to 11 byte NOPs", .dependencies = &[_]*const Feature { @@ -282,7 +282,7 @@ pub const feature_fast11bytenop = Feature{ }; pub const feature_fast15bytenop = Feature{ - .name = "fast-15bytenop", + .name = "fast15bytenop", .llvm_name = "fast-15bytenop", .description = "Target can quickly decode up to 15 byte NOPs", .dependencies = &[_]*const Feature { @@ -290,7 +290,7 @@ pub const feature_fast15bytenop = Feature{ }; pub const feature_fastBextr = Feature{ - .name = "fast-bextr", + .name = "fastBextr", .llvm_name = "fast-bextr", .description = "Indicates that the BEXTR instruction is implemented as a single uop with good throughput", .dependencies = &[_]*const Feature { @@ -298,7 +298,7 @@ pub const feature_fastBextr = Feature{ }; pub const feature_fastHops = Feature{ - .name = "fast-hops", + .name = "fastHops", .llvm_name = "fast-hops", .description = "Prefer horizontal vector math instructions (haddp, phsub, etc.) over normal vector instructions with shuffles", .dependencies = &[_]*const Feature { @@ -307,7 +307,7 @@ pub const feature_fastHops = Feature{ }; pub const feature_fastLzcnt = Feature{ - .name = "fast-lzcnt", + .name = "fastLzcnt", .llvm_name = "fast-lzcnt", .description = "LZCNT instructions are as fast as most simple integer ops", .dependencies = &[_]*const Feature { @@ -315,7 +315,7 @@ pub const feature_fastLzcnt = Feature{ }; pub const feature_fastPartialYmmOrZmmWrite = Feature{ - .name = "fast-partial-ymm-or-zmm-write", + .name = "fastPartialYmmOrZmmWrite", .llvm_name = "fast-partial-ymm-or-zmm-write", .description = "Partial writes to YMM/ZMM registers are fast", .dependencies = &[_]*const Feature { @@ -323,7 +323,7 @@ pub const feature_fastPartialYmmOrZmmWrite = Feature{ }; pub const feature_fastShldRotate = Feature{ - .name = "fast-shld-rotate", + .name = "fastShldRotate", .llvm_name = "fast-shld-rotate", .description = "SHLD can be used as a faster rotate", .dependencies = &[_]*const Feature { @@ -331,7 +331,7 @@ pub const feature_fastShldRotate = Feature{ }; pub const feature_fastScalarFsqrt = Feature{ - .name = "fast-scalar-fsqrt", + .name = "fastScalarFsqrt", .llvm_name = "fast-scalar-fsqrt", .description = "Scalar SQRT is fast (disable Newton-Raphson)", .dependencies = &[_]*const Feature { @@ -339,7 +339,7 @@ pub const feature_fastScalarFsqrt = Feature{ }; pub const feature_fastScalarShiftMasks = Feature{ - .name = "fast-scalar-shift-masks", + .name = "fastScalarShiftMasks", .llvm_name = "fast-scalar-shift-masks", .description = "Prefer a left/right scalar logical shift pair over a shift+and pair", .dependencies = &[_]*const Feature { @@ -347,7 +347,7 @@ pub const feature_fastScalarShiftMasks = Feature{ }; pub const feature_fastVariableShuffle = Feature{ - .name = "fast-variable-shuffle", + .name = "fastVariableShuffle", .llvm_name = "fast-variable-shuffle", .description = "Shuffles with variable masks are fast", .dependencies = &[_]*const Feature { @@ -355,7 +355,7 @@ pub const feature_fastVariableShuffle = Feature{ }; pub const feature_fastVectorFsqrt = Feature{ - .name = "fast-vector-fsqrt", + .name = "fastVectorFsqrt", .llvm_name = "fast-vector-fsqrt", .description = "Vector SQRT is fast (disable Newton-Raphson)", .dependencies = &[_]*const Feature { @@ -363,7 +363,7 @@ pub const feature_fastVectorFsqrt = Feature{ }; pub const feature_fastVectorShiftMasks = Feature{ - .name = "fast-vector-shift-masks", + .name = "fastVectorShiftMasks", .llvm_name = "fast-vector-shift-masks", .description = "Prefer a left/right vector logical shift pair over a shift+and pair", .dependencies = &[_]*const Feature { @@ -380,7 +380,7 @@ pub const feature_gfni = Feature{ }; pub const feature_fastGather = Feature{ - .name = "fast-gather", + .name = "fastGather", .llvm_name = "fast-gather", .description = "Indicates if gather is reasonably fast", .dependencies = &[_]*const Feature { @@ -413,7 +413,7 @@ pub const feature_sahf = Feature{ }; pub const feature_leaSp = Feature{ - .name = "lea-sp", + .name = "leaSp", .llvm_name = "lea-sp", .description = "Use LEA for adjusting the stack pointer", .dependencies = &[_]*const Feature { @@ -421,7 +421,7 @@ pub const feature_leaSp = Feature{ }; pub const feature_leaUsesAg = Feature{ - .name = "lea-uses-ag", + .name = "leaUsesAg", .llvm_name = "lea-uses-ag", .description = "LEA instruction needs inputs at AG stage", .dependencies = &[_]*const Feature { @@ -445,7 +445,7 @@ pub const feature_lzcnt = Feature{ }; pub const feature_falseDepsLzcntTzcnt = Feature{ - .name = "false-deps-lzcnt-tzcnt", + .name = "falseDepsLzcntTzcnt", .llvm_name = "false-deps-lzcnt-tzcnt", .description = "LZCNT/TZCNT have a false dependency on dest register", .dependencies = &[_]*const Feature { @@ -501,7 +501,7 @@ pub const feature_macrofusion = Feature{ }; pub const feature_mergeToThreewayBranch = Feature{ - .name = "merge-to-threeway-branch", + .name = "mergeToThreewayBranch", .llvm_name = "merge-to-threeway-branch", .description = "Merge branches to a three-way conditional branch", .dependencies = &[_]*const Feature { @@ -559,7 +559,7 @@ pub const feature_popcnt = Feature{ }; pub const feature_falseDepsPopcnt = Feature{ - .name = "false-deps-popcnt", + .name = "falseDepsPopcnt", .llvm_name = "false-deps-popcnt", .description = "POPCNT has a false dependency on dest register", .dependencies = &[_]*const Feature { @@ -591,7 +591,7 @@ pub const feature_ptwrite = Feature{ }; pub const feature_padShortFunctions = Feature{ - .name = "pad-short-functions", + .name = "padShortFunctions", .llvm_name = "pad-short-functions", .description = "Pad short functions", .dependencies = &[_]*const Feature { @@ -599,7 +599,7 @@ pub const feature_padShortFunctions = Feature{ }; pub const feature_prefer128Bit = Feature{ - .name = "prefer-128-bit", + .name = "prefer128Bit", .llvm_name = "prefer-128-bit", .description = "Prefer 128-bit AVX instructions", .dependencies = &[_]*const Feature { @@ -607,7 +607,7 @@ pub const feature_prefer128Bit = Feature{ }; pub const feature_prefer256Bit = Feature{ - .name = "prefer-256-bit", + .name = "prefer256Bit", .llvm_name = "prefer-256-bit", .description = "Prefer 256-bit AVX instructions", .dependencies = &[_]*const Feature { @@ -657,7 +657,7 @@ pub const feature_retpoline = Feature{ }; pub const feature_retpolineExternalThunk = Feature{ - .name = "retpoline-external-thunk", + .name = "retpolineExternalThunk", .llvm_name = "retpoline-external-thunk", .description = "When lowering an indirect call or branch using a `retpoline`, rely on the specified user provided thunk rather than emitting one ourselves. Only has effect when combined with some other retpoline feature", .dependencies = &[_]*const Feature { @@ -666,7 +666,7 @@ pub const feature_retpolineExternalThunk = Feature{ }; pub const feature_retpolineIndirectBranches = Feature{ - .name = "retpoline-indirect-branches", + .name = "retpolineIndirectBranches", .llvm_name = "retpoline-indirect-branches", .description = "Remove speculation of indirect branches from the generated code", .dependencies = &[_]*const Feature { @@ -674,7 +674,7 @@ pub const feature_retpolineIndirectBranches = Feature{ }; pub const feature_retpolineIndirectCalls = Feature{ - .name = "retpoline-indirect-calls", + .name = "retpolineIndirectCalls", .llvm_name = "retpoline-indirect-calls", .description = "Remove speculation of indirect calls from the generated code", .dependencies = &[_]*const Feature { @@ -742,7 +742,7 @@ pub const feature_sse4a = Feature{ }; pub const feature_sse41 = Feature{ - .name = "sse4.1", + .name = "sse41", .llvm_name = "sse4.1", .description = "Enable SSE 4.1 instructions", .dependencies = &[_]*const Feature { @@ -751,7 +751,7 @@ pub const feature_sse41 = Feature{ }; pub const feature_sse42 = Feature{ - .name = "sse4.2", + .name = "sse42", .llvm_name = "sse4.2", .description = "Enable SSE 4.2 instructions", .dependencies = &[_]*const Feature { @@ -760,7 +760,7 @@ pub const feature_sse42 = Feature{ }; pub const feature_sseUnalignedMem = Feature{ - .name = "sse-unaligned-mem", + .name = "sseUnalignedMem", .llvm_name = "sse-unaligned-mem", .description = "Allow unaligned memory operands with SSE instructions", .dependencies = &[_]*const Feature { @@ -777,7 +777,7 @@ pub const feature_ssse3 = Feature{ }; pub const feature_slow3opsLea = Feature{ - .name = "slow-3ops-lea", + .name = "slow3opsLea", .llvm_name = "slow-3ops-lea", .description = "LEA instruction with 3 ops or certain registers is slow", .dependencies = &[_]*const Feature { @@ -785,7 +785,7 @@ pub const feature_slow3opsLea = Feature{ }; pub const feature_idivlToDivb = Feature{ - .name = "idivl-to-divb", + .name = "idivlToDivb", .llvm_name = "idivl-to-divb", .description = "Use 8-bit divide for positive values less than 256", .dependencies = &[_]*const Feature { @@ -793,7 +793,7 @@ pub const feature_idivlToDivb = Feature{ }; pub const feature_idivqToDivl = Feature{ - .name = "idivq-to-divl", + .name = "idivqToDivl", .llvm_name = "idivq-to-divl", .description = "Use 32-bit divide for positive values less than 2^32", .dependencies = &[_]*const Feature { @@ -801,7 +801,7 @@ pub const feature_idivqToDivl = Feature{ }; pub const feature_slowIncdec = Feature{ - .name = "slow-incdec", + .name = "slowIncdec", .llvm_name = "slow-incdec", .description = "INC and DEC instructions are slower than ADD and SUB", .dependencies = &[_]*const Feature { @@ -809,7 +809,7 @@ pub const feature_slowIncdec = Feature{ }; pub const feature_slowLea = Feature{ - .name = "slow-lea", + .name = "slowLea", .llvm_name = "slow-lea", .description = "LEA instruction with certain arguments is slow", .dependencies = &[_]*const Feature { @@ -817,7 +817,7 @@ pub const feature_slowLea = Feature{ }; pub const feature_slowPmaddwd = Feature{ - .name = "slow-pmaddwd", + .name = "slowPmaddwd", .llvm_name = "slow-pmaddwd", .description = "PMADDWD is slower than PMULLD", .dependencies = &[_]*const Feature { @@ -825,7 +825,7 @@ pub const feature_slowPmaddwd = Feature{ }; pub const feature_slowPmulld = Feature{ - .name = "slow-pmulld", + .name = "slowPmulld", .llvm_name = "slow-pmulld", .description = "PMULLD instruction is slow", .dependencies = &[_]*const Feature { @@ -833,7 +833,7 @@ pub const feature_slowPmulld = Feature{ }; pub const feature_slowShld = Feature{ - .name = "slow-shld", + .name = "slowShld", .llvm_name = "slow-shld", .description = "SHLD instruction is slow", .dependencies = &[_]*const Feature { @@ -841,7 +841,7 @@ pub const feature_slowShld = Feature{ }; pub const feature_slowTwoMemOps = Feature{ - .name = "slow-two-mem-ops", + .name = "slowTwoMemOps", .llvm_name = "slow-two-mem-ops", .description = "Two memory operand instructions are slow", .dependencies = &[_]*const Feature { @@ -849,7 +849,7 @@ pub const feature_slowTwoMemOps = Feature{ }; pub const feature_slowUnalignedMem16 = Feature{ - .name = "slow-unaligned-mem-16", + .name = "slowUnalignedMem16", .llvm_name = "slow-unaligned-mem-16", .description = "Slow unaligned 16-byte memory access", .dependencies = &[_]*const Feature { @@ -857,7 +857,7 @@ pub const feature_slowUnalignedMem16 = Feature{ }; pub const feature_slowUnalignedMem32 = Feature{ - .name = "slow-unaligned-mem-32", + .name = "slowUnalignedMem32", .llvm_name = "slow-unaligned-mem-32", .description = "Slow unaligned 32-byte memory access", .dependencies = &[_]*const Feature { @@ -865,7 +865,7 @@ pub const feature_slowUnalignedMem32 = Feature{ }; pub const feature_softFloat = Feature{ - .name = "soft-float", + .name = "softFloat", .llvm_name = "soft-float", .description = "Use software floating point features", .dependencies = &[_]*const Feature { @@ -881,7 +881,7 @@ pub const feature_tbm = Feature{ }; pub const feature_useAa = Feature{ - .name = "use-aa", + .name = "useAa", .llvm_name = "use-aa", .description = "Use alias analysis during codegen", .dependencies = &[_]*const Feature { @@ -1026,7 +1026,7 @@ pub const feature_xsaves = Feature{ }; pub const feature_bitMode16 = Feature{ - .name = "16bit-mode", + .name = "bitMode16", .llvm_name = "16bit-mode", .description = "16-bit mode (i8086)", .dependencies = &[_]*const Feature { @@ -1034,7 +1034,7 @@ pub const feature_bitMode16 = Feature{ }; pub const feature_bitMode32 = Feature{ - .name = "32bit-mode", + .name = "bitMode32", .llvm_name = "32bit-mode", .description = "32-bit mode (80386)", .dependencies = &[_]*const Feature { @@ -1042,7 +1042,7 @@ pub const feature_bitMode32 = Feature{ }; pub const feature_bitMode64 = Feature{ - .name = "64bit-mode", + .name = "bitMode64", .llvm_name = "64bit-mode", .description = "64-bit mode (x86_64)", .dependencies = &[_]*const Feature { @@ -1217,7 +1217,7 @@ pub const cpu_athlon = Cpu{ }; pub const cpu_athlon4 = Cpu{ - .name = "athlon-4", + .name = "athlon4", .llvm_name = "athlon-4", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1234,7 +1234,7 @@ pub const cpu_athlon4 = Cpu{ }; pub const cpu_athlonFx = Cpu{ - .name = "athlon-fx", + .name = "athlonFx", .llvm_name = "athlon-fx", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1254,7 +1254,7 @@ pub const cpu_athlonFx = Cpu{ }; pub const cpu_athlonMp = Cpu{ - .name = "athlon-mp", + .name = "athlonMp", .llvm_name = "athlon-mp", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1271,7 +1271,7 @@ pub const cpu_athlonMp = Cpu{ }; pub const cpu_athlonTbird = Cpu{ - .name = "athlon-tbird", + .name = "athlonTbird", .llvm_name = "athlon-tbird", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1286,7 +1286,7 @@ pub const cpu_athlonTbird = Cpu{ }; pub const cpu_athlonXp = Cpu{ - .name = "athlon-xp", + .name = "athlonXp", .llvm_name = "athlon-xp", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1323,7 +1323,7 @@ pub const cpu_athlon64 = Cpu{ }; pub const cpu_athlon64Sse3 = Cpu{ - .name = "athlon64-sse3", + .name = "athlon64Sse3", .llvm_name = "athlon64-sse3", .dependencies = &[_]*const Feature { &feature_mmx, @@ -1678,7 +1678,7 @@ pub const cpu_c3 = Cpu{ }; pub const cpu_c32 = Cpu{ - .name = "c3-2", + .name = "c32", .llvm_name = "c3-2", .dependencies = &[_]*const Feature { &feature_cmov, @@ -1874,7 +1874,7 @@ pub const cpu_cooperlake = Cpu{ }; pub const cpu_coreAvxI = Cpu{ - .name = "core-avx-i", + .name = "coreAvxI", .llvm_name = "core-avx-i", .dependencies = &[_]*const Feature { &feature_bit64, @@ -1908,7 +1908,7 @@ pub const cpu_coreAvxI = Cpu{ }; pub const cpu_coreAvx2 = Cpu{ - .name = "core-avx2", + .name = "coreAvx2", .llvm_name = "core-avx2", .dependencies = &[_]*const Feature { &feature_bit64, @@ -1991,7 +1991,7 @@ pub const cpu_corei7 = Cpu{ }; pub const cpu_corei7Avx = Cpu{ - .name = "corei7-avx", + .name = "corei7Avx", .llvm_name = "corei7-avx", .dependencies = &[_]*const Feature { &feature_bit64, @@ -2081,7 +2081,7 @@ pub const cpu_goldmont = Cpu{ }; pub const cpu_goldmontPlus = Cpu{ - .name = "goldmont-plus", + .name = "goldmontPlus", .llvm_name = "goldmont-plus", .dependencies = &[_]*const Feature { &feature_bit64, @@ -2202,7 +2202,7 @@ pub const cpu_i686 = Cpu{ }; pub const cpu_icelakeClient = Cpu{ - .name = "icelake-client", + .name = "icelakeClient", .llvm_name = "icelake-client", .dependencies = &[_]*const Feature { &feature_bit64, @@ -2272,7 +2272,7 @@ pub const cpu_icelakeClient = Cpu{ }; pub const cpu_icelakeServer = Cpu{ - .name = "icelake-server", + .name = "icelakeServer", .llvm_name = "icelake-server", .dependencies = &[_]*const Feature { &feature_bit64, @@ -2389,7 +2389,7 @@ pub const cpu_k6 = Cpu{ }; pub const cpu_k62 = Cpu{ - .name = "k6-2", + .name = "k62", .llvm_name = "k6-2", .dependencies = &[_]*const Feature { &feature_mmx, @@ -2401,7 +2401,7 @@ pub const cpu_k62 = Cpu{ }; pub const cpu_k63 = Cpu{ - .name = "k6-3", + .name = "k63", .llvm_name = "k6-3", .dependencies = &[_]*const Feature { &feature_mmx, @@ -2433,7 +2433,7 @@ pub const cpu_k8 = Cpu{ }; pub const cpu_k8Sse3 = Cpu{ - .name = "k8-sse3", + .name = "k8Sse3", .llvm_name = "k8-sse3", .dependencies = &[_]*const Feature { &feature_mmx, @@ -2610,7 +2610,7 @@ pub const cpu_opteron = Cpu{ }; pub const cpu_opteronSse3 = Cpu{ - .name = "opteron-sse3", + .name = "opteronSse3", .llvm_name = "opteron-sse3", .dependencies = &[_]*const Feature { &feature_mmx, @@ -2661,7 +2661,7 @@ pub const cpu_pentium = Cpu{ }; pub const cpu_pentiumM = Cpu{ - .name = "pentium-m", + .name = "pentiumM", .llvm_name = "pentium-m", .dependencies = &[_]*const Feature { &feature_cmov, @@ -2677,7 +2677,7 @@ pub const cpu_pentiumM = Cpu{ }; pub const cpu_pentiumMmx = Cpu{ - .name = "pentium-mmx", + .name = "pentiumMmx", .llvm_name = "pentium-mmx", .dependencies = &[_]*const Feature { &feature_cx8, @@ -2964,7 +2964,7 @@ pub const cpu_skylake = Cpu{ }; pub const cpu_skylakeAvx512 = Cpu{ - .name = "skylake-avx512", + .name = "skylakeAvx512", .llvm_name = "skylake-avx512", .dependencies = &[_]*const Feature { &feature_bit64, @@ -3192,7 +3192,7 @@ pub const cpu_westmere = Cpu{ }; pub const cpu_winchipC6 = Cpu{ - .name = "winchip-c6", + .name = "winchipC6", .llvm_name = "winchip-c6", .dependencies = &[_]*const Feature { &feature_mmx, @@ -3213,7 +3213,7 @@ pub const cpu_winchip2 = Cpu{ }; pub const cpu_x8664 = Cpu{ - .name = "x86-64", + .name = "x8664", .llvm_name = "x86-64", .dependencies = &[_]*const Feature { &feature_bit64, diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 4fdfb05df8..55313d16b2 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -623,6 +623,8 @@ const Stage2TargetDetails = struct { llvm_cpu_str: [:0]const u8, llvm_features_str: [:0]const u8, + + builtin_str: [:0]const u8, }; // ABI warning @@ -662,6 +664,16 @@ fn parseCpu(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDeta if (std.mem.eql(u8, str, cpu.name)) { const allocator = std.heap.c_allocator; + var builtin_str_buffer = try std.Buffer.init( + allocator, + "@import(\"std\").target.TargetDetails{.cpu=&@import(\"std\").target."); + defer builtin_str_buffer.deinit(); + + try builtin_str_buffer.append(@tagName(arch)); + try builtin_str_buffer.append(".cpu_"); + try builtin_str_buffer.append(cpu.name); + try builtin_str_buffer.append("};"); + const ptr = try allocator.create(Stage2TargetDetails); ptr.* = .{ .allocator = allocator, @@ -670,6 +682,7 @@ fn parseCpu(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDeta }, .llvm_cpu_str = cpu.name, .llvm_features_str = "", + .builtin_str = builtin_str_buffer.toOwnedSlice(), }; return ptr; @@ -687,6 +700,11 @@ fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2Targe var features = std.ArrayList(*const std.target.Feature).init(allocator); defer features.deinit(); + var builtin_str_buffer = try std.Buffer.init( + allocator, + "@import(\"std\").target.TargetDetails{.features=&[_]*const @import(\"std\").target.Feature{\n"); + defer builtin_str_buffer.deinit(); + var start: usize = 0; while (start < str.len) { const next_comma_pos = std.mem.indexOfScalar(u8, str[start..], ',') orelse str.len - start; @@ -706,10 +724,18 @@ fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2Targe if (feature) |f| { features.append(f) catch @panic("out of memory"); + + try builtin_str_buffer.append("&@import(\"std\").target."); + try builtin_str_buffer.append(@tagName(arch)); + try builtin_str_buffer.append(".feature_"); + try builtin_str_buffer.append(f.name); + try builtin_str_buffer.append(","); } else { return error.InvalidFeature; } } + + try builtin_str_buffer.append("}};"); const features_slice = features.toOwnedSlice(); @@ -730,6 +756,7 @@ fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2Targe }, .llvm_cpu_str = "", .llvm_features_str = llvm_features_buffer.toOwnedSlice(), + .builtin_str = builtin_str_buffer.toOwnedSlice(), }; return ptr; @@ -764,3 +791,12 @@ export fn stage2_target_details_get_llvm_features(target_details: ?*const Stage2 return @as([*:0]const u8, ""); } + +// ABI warning +export fn stage2_target_details_get_builtin_str(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { + if (target_details) |td| { + return @as([*:0]const u8, td.builtin_str); + } + + return @as([*:0]const u8, ""); +} diff --git a/src/codegen.cpp b/src/codegen.cpp index 760284a2e2..4aa71f32c7 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8607,6 +8607,14 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { "pub var test_functions: []TestFn = undefined; // overwritten later\n" ); } + + buf_appendf(contents, "pub const target_details: ?@import(\"std\").target.TargetDetails = "); + if (g->target_details) { + buf_appendf(contents, "%s", stage2_target_details_get_builtin_str(g->target_details)); + } else { + buf_appendf(contents, "null;"); + } + buf_appendf(contents, "\n"); return contents; } diff --git a/src/main.cpp b/src/main.cpp index da8b354796..f40f62a653 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1074,6 +1074,24 @@ int main(int argc, char **argv) { } } + Stage2TargetDetails *target_details = nullptr; + if (cpu && features) { + fprintf(stderr, "--cpu and --features options not allowed together\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } else if (cpu) { + target_details = stage2_target_details_parse_cpu(target_arch_name(target.arch), cpu); + if (!target_details) { + fprintf(stderr, "invalid --cpu value\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } else if (features) { + target_details = stage2_target_details_parse_features(target_arch_name(target.arch), features); + if (!target_details) { + fprintf(stderr, "invalid --features value\n"); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } + if (output_dir != nullptr && enable_cache == CacheOptOn) { fprintf(stderr, "`--output-dir` is incompatible with --cache on.\n"); return print_error_usage(arg0); @@ -1124,6 +1142,7 @@ int main(int argc, char **argv) { g->want_stack_check = want_stack_check; g->want_sanitize_c = want_sanitize_c; g->want_single_threaded = want_single_threaded; + g->target_details = target_details; Buf *builtin_source = codegen_generate_builtin_source(g); if (fwrite(buf_ptr(builtin_source), 1, buf_len(builtin_source), stdout) != buf_len(builtin_source)) { fprintf(stderr, "unable to write to stdout: %s\n", strerror(ferror(stdout))); @@ -1278,24 +1297,6 @@ int main(int argc, char **argv) { codegen_add_rpath(g, rpath_list.at(i)); } - Stage2TargetDetails *target_details = nullptr; - if (cpu && features) { - fprintf(stderr, "--cpu and --features options not allowed together\n"); - return main_exit(root_progress_node, EXIT_FAILURE); - } else if (cpu) { - target_details = stage2_target_details_parse_cpu(target_arch_name(target.arch), cpu); - if (!target_details) { - fprintf(stderr, "invalid --cpu value\n"); - return main_exit(root_progress_node, EXIT_FAILURE); - } - } else if (features) { - target_details = stage2_target_details_parse_features(target_arch_name(target.arch), features); - if (!target_details) { - fprintf(stderr, "invalid --features value\n"); - return main_exit(root_progress_node, EXIT_FAILURE); - } - } - g->target_details = target_details; codegen_set_rdynamic(g, rdynamic); diff --git a/src/userland.cpp b/src/userland.cpp index 468017cb51..9481a3f0b3 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -106,3 +106,6 @@ const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDetails *target const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details) { return ""; } +const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details) { + return ""; +} diff --git a/src/userland.h b/src/userland.h index 11801e1038..0315ac1117 100644 --- a/src/userland.h +++ b/src/userland.h @@ -198,4 +198,7 @@ ZIG_EXTERN_C const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDe // ABI warning ZIG_EXTERN_C const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details); +// ABI warning +ZIG_EXTERN_C const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details); + #endif -- cgit v1.2.3 From fd17a9962b07147a5b20487ab8e4d9bc0aa946cd Mon Sep 17 00:00:00 2001 From: Layne Gustafson Date: Wed, 8 Jan 2020 22:29:12 -0500 Subject: Add defaut feature support --- src-self-hosted/stage1.zig | 177 ++++++++++++++++++++++++++++++++------------- src/codegen.cpp | 21 +----- src/main.cpp | 6 ++ src/userland.cpp | 3 + src/userland.h | 3 + 5 files changed, 141 insertions(+), 69 deletions(-) (limited to 'src/userland.cpp') diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 55313d16b2..a1c1a2a5d3 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -625,6 +625,63 @@ const Stage2TargetDetails = struct { llvm_features_str: [:0]const u8, builtin_str: [:0]const u8, + + const Self = @This(); + + fn initCpu(allocator: *std.mem.Allocator, arch: @TagType(std.Target.Arch), cpu: *const std.target.Cpu) !Self { + var builtin_str_buffer = try std.Buffer.init( + allocator, + "@import(\"std\").target.TargetDetails{.cpu=&@import(\"std\").target."); + defer builtin_str_buffer.deinit(); + + try builtin_str_buffer.append(@tagName(arch)); + try builtin_str_buffer.append(".cpu_"); + try builtin_str_buffer.append(cpu.name); + try builtin_str_buffer.append("};"); + return Self{ + .allocator = allocator, + .target_details = .{ + .cpu = cpu, + }, + .llvm_cpu_str = cpu.name, + .llvm_features_str = "", + .builtin_str = builtin_str_buffer.toOwnedSlice(), + }; + } + + fn initFeatures(allocator: *std.mem.Allocator, arch: @TagType(std.Target.Arch), features: []*const std.target.Feature) !Self { + var builtin_str_buffer = try std.Buffer.init( + allocator, + "@import(\"std\").target.TargetDetails{.features=&[_]*const @import(\"std\").target.Feature{\n"); + defer builtin_str_buffer.deinit(); + + var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); + defer llvm_features_buffer.deinit(); + + for (features) |feature| { + try llvm_features_buffer.append("+"); + try llvm_features_buffer.append(feature.llvm_name); + try llvm_features_buffer.append(","); + + try builtin_str_buffer.append("&@import(\"std\").target."); + try builtin_str_buffer.append(@tagName(arch)); + try builtin_str_buffer.append(".feature_"); + try builtin_str_buffer.append(feature.name); + try builtin_str_buffer.append(","); + } + + try builtin_str_buffer.append("}};"); + + return Self{ + .allocator = allocator, + .target_details = std.target.TargetDetails{ + .features = features, + }, + .llvm_cpu_str = "", + .llvm_features_str = llvm_features_buffer.toOwnedSlice(), + .builtin_str = builtin_str_buffer.toOwnedSlice(), + }; + } }; // ABI warning @@ -658,32 +715,14 @@ export fn stage2_target_details_parse_features(arch_str: ?[*:0]const u8, feature } fn parseCpu(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDetails { + const allocator = std.heap.c_allocator; + const cpus = std.target.getCpusForArch(arch); for (cpus) |cpu| { if (std.mem.eql(u8, str, cpu.name)) { - const allocator = std.heap.c_allocator; - - var builtin_str_buffer = try std.Buffer.init( - allocator, - "@import(\"std\").target.TargetDetails{.cpu=&@import(\"std\").target."); - defer builtin_str_buffer.deinit(); - - try builtin_str_buffer.append(@tagName(arch)); - try builtin_str_buffer.append(".cpu_"); - try builtin_str_buffer.append(cpu.name); - try builtin_str_buffer.append("};"); - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = .{ - .allocator = allocator, - .target_details = .{ - .cpu = cpu, - }, - .llvm_cpu_str = cpu.name, - .llvm_features_str = "", - .builtin_str = builtin_str_buffer.toOwnedSlice(), - }; + ptr.* = try Stage2TargetDetails.initCpu(std.heap.c_allocator, arch, cpu); return ptr; } @@ -700,11 +739,6 @@ fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2Targe var features = std.ArrayList(*const std.target.Feature).init(allocator); defer features.deinit(); - var builtin_str_buffer = try std.Buffer.init( - allocator, - "@import(\"std\").target.TargetDetails{.features=&[_]*const @import(\"std\").target.Feature{\n"); - defer builtin_str_buffer.deinit(); - var start: usize = 0; while (start < str.len) { const next_comma_pos = std.mem.indexOfScalar(u8, str[start..], ',') orelse str.len - start; @@ -725,39 +759,15 @@ fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2Targe if (feature) |f| { features.append(f) catch @panic("out of memory"); - try builtin_str_buffer.append("&@import(\"std\").target."); - try builtin_str_buffer.append(@tagName(arch)); - try builtin_str_buffer.append(".feature_"); - try builtin_str_buffer.append(f.name); - try builtin_str_buffer.append(","); } else { return error.InvalidFeature; } } - try builtin_str_buffer.append("}};"); - const features_slice = features.toOwnedSlice(); - var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); - defer llvm_features_buffer.deinit(); - - for (features_slice) |feature| { - try llvm_features_buffer.append("+"); - try llvm_features_buffer.append(feature.llvm_name); - try llvm_features_buffer.append(","); - } - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = Stage2TargetDetails{ - .allocator = allocator, - .target_details = std.target.TargetDetails{ - .features = features_slice, - }, - .llvm_cpu_str = "", - .llvm_features_str = llvm_features_buffer.toOwnedSlice(), - .builtin_str = builtin_str_buffer.toOwnedSlice(), - }; + ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, features_slice); return ptr; } @@ -800,3 +810,68 @@ export fn stage2_target_details_get_builtin_str(target_details: ?*const Stage2Ta return @as([*:0]const u8, ""); } + +const riscv_default_features: []*const std.target.Feature = &[_]*const std.target.Feature { + &std.target.riscv.feature_a, + &std.target.riscv.feature_c, + &std.target.riscv.feature_d, + &std.target.riscv.feature_f, + &std.target.riscv.feature_m, + &std.target.riscv.feature_relax, +}; + +const i386_default_features: []*const std.target.Feature = &[_]*const std.target.Feature { + &std.target.x86.feature_cmov, + &std.target.x86.feature_cx8, + &std.target.x86.feature_fxsr, + &std.target.x86.feature_mmx, + &std.target.x86.feature_nopl, + &std.target.x86.feature_sse, + &std.target.x86.feature_sse2, + &std.target.x86.feature_slowUnalignedMem16, + &std.target.x86.feature_x87, +}; + +// Same as above but without sse. +const i386_default_features_freestanding: []*const std.target.Feature = &[_]*const std.target.Feature { + &std.target.x86.feature_cmov, + &std.target.x86.feature_cx8, + &std.target.x86.feature_fxsr, + &std.target.x86.feature_mmx, + &std.target.x86.feature_nopl, + &std.target.x86.feature_slowUnalignedMem16, + &std.target.x86.feature_x87, +}; + +// ABI warning +export fn stage2_target_details_get_default(arch_str: ?[*:0]const u8, os_str: ?[*:0]const u8) ?*Stage2TargetDetails { + if (arch_str == null) return null; + if (os_str == null) return null; + + const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch return null; + const os = Target.parseOs(std.mem.toSliceConst(u8, os_str.?)) catch return null; + + return createDefaultTargetDetails(arch, os) catch return null; +} + +fn createDefaultTargetDetails(arch: @TagType(std.Target.Arch), os: std.Target.Os) !?*Stage2TargetDetails { + const allocator = std.heap.c_allocator; + + return switch (arch) { + .riscv32, .riscv64 => blk: { + const ptr = try allocator.create(Stage2TargetDetails); + ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, riscv_default_features); + break :blk ptr; + }, + .i386 => blk: { + const ptr = try allocator.create(Stage2TargetDetails); + const features = switch (os) { + .freestanding => i386_default_features_freestanding, + else => i386_default_features, + }; + ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, features); + break :blk ptr; + }, + else => null, + }; +} diff --git a/src/codegen.cpp b/src/codegen.cpp index 4aa71f32c7..d0749c9432 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8781,8 +8781,9 @@ static void init(CodeGen *g) { reloc_mode = LLVMRelocStatic; } - const char *target_specific_cpu_args; - const char *target_specific_features; + const char *target_specific_cpu_args = ""; + const char *target_specific_features = ""; + if (g->zig_target->is_native) { // LLVM creates invalid binaries on Windows sometimes. // See https://github.com/ziglang/zig/issues/508 @@ -8794,22 +8795,6 @@ static void init(CodeGen *g) { target_specific_cpu_args = ZigLLVMGetHostCPUName(); target_specific_features = ZigLLVMGetNativeFeatures(); } - } else if (target_is_riscv(g->zig_target)) { - // TODO https://github.com/ziglang/zig/issues/2883 - // Be aware of https://github.com/ziglang/zig/issues/3275 - target_specific_cpu_args = ""; - target_specific_features = riscv_default_features; - } else if (g->zig_target->arch == ZigLLVM_x86) { - // This is because we're really targeting i686 rather than i386. - // It's pretty much impossible to use many of the language features - // such as fp16 if you stick use the x87 only. This is also what clang - // uses as base cpu. - // TODO https://github.com/ziglang/zig/issues/2883 - target_specific_cpu_args = "pentium4"; - target_specific_features = (g->zig_target->os == OsFreestanding) ? "-sse": ""; - } else { - target_specific_cpu_args = ""; - target_specific_features = ""; } // Override CPU and features if defined by user. diff --git a/src/main.cpp b/src/main.cpp index f40f62a653..441bc2afb0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1090,6 +1090,12 @@ int main(int argc, char **argv) { fprintf(stderr, "invalid --features value\n"); return main_exit(root_progress_node, EXIT_FAILURE); } + } else { + // If no details are specified and we are not native, load + // cross-compilation default features. + if (!target.is_native) { + target_details = stage2_target_details_get_default(target_arch_name(target.arch), target_os_name(target.os)); + } } if (output_dir != nullptr && enable_cache == CacheOptOn) { diff --git a/src/userland.cpp b/src/userland.cpp index 9481a3f0b3..0e173d7e76 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -109,3 +109,6 @@ const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *t const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details) { return ""; } +Stage2TargetDetails *stage2_target_details_get_default(const char *arch, const char *os) { + return nullptr; +} diff --git a/src/userland.h b/src/userland.h index 0315ac1117..f954efd3fe 100644 --- a/src/userland.h +++ b/src/userland.h @@ -201,4 +201,7 @@ ZIG_EXTERN_C const char *stage2_target_details_get_llvm_features(const Stage2Tar // ABI warning ZIG_EXTERN_C const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details); +// ABI warning +ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_get_default(const char *arch, const char *os); + #endif -- cgit v1.2.3 From a867b43366c7fb132ec44a03f9b40ead888900fb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 19 Jan 2020 02:40:35 -0500 Subject: progress towards merging see BRANCH_TODO file --- BRANCH_TODO | 55 + lib/std/buffer.zig | 4 +- lib/std/build.zig | 49 +- lib/std/builtin.zig | 6 + lib/std/fmt.zig | 5 + lib/std/meta.zig | 18 + lib/std/os/linux/tls.zig | 2 +- lib/std/std.zig | 1 - lib/std/target.zig | 324 +++-- lib/std/target/aarch64.zig | 3129 +++++++++++++++++++++----------------------- src-self-hosted/stage1.zig | 387 +++--- src/all_types.hpp | 2 - src/codegen.cpp | 56 +- src/main.cpp | 24 +- src/target.hpp | 1 + src/userland.cpp | 50 +- src/userland.h | 18 +- 17 files changed, 2088 insertions(+), 2043 deletions(-) create mode 100644 BRANCH_TODO (limited to 'src/userland.cpp') diff --git a/BRANCH_TODO b/BRANCH_TODO new file mode 100644 index 0000000000..ad1ad76d21 --- /dev/null +++ b/BRANCH_TODO @@ -0,0 +1,55 @@ +Finish these thigns before merging teh branch + + * need to populate builtin.zig cpu_features, undefined is incorrect. I guess for zig0 it will be always baseline + * need to populate std.Target.current.cpu_features even for native target + + * finish refactoring target/arch/* + * `zig builtin` integration + * move target details to better location + * +foo,-bar vs foo,bar + * baseline features + + +const riscv32_default_features: []*const std.target.Feature = &[_]*const std.target.Feature{ + &std.target.riscv.feature_a, + &std.target.riscv.feature_c, + &std.target.riscv.feature_d, + &std.target.riscv.feature_f, + &std.target.riscv.feature_m, + &std.target.riscv.feature_relax, +}; + +const riscv64_default_features: []*const std.target.Feature = &[_]*const std.target.Feature{ + &std.target.riscv.feature_bit64, + &std.target.riscv.feature_a, + &std.target.riscv.feature_c, + &std.target.riscv.feature_d, + &std.target.riscv.feature_f, + &std.target.riscv.feature_m, + &std.target.riscv.feature_relax, +}; + +const i386_default_features: []*const std.target.Feature = &[_]*const std.target.Feature{ + &std.target.x86.feature_cmov, + &std.target.x86.feature_cx8, + &std.target.x86.feature_fxsr, + &std.target.x86.feature_mmx, + &std.target.x86.feature_nopl, + &std.target.x86.feature_sse, + &std.target.x86.feature_sse2, + &std.target.x86.feature_slowUnalignedMem16, + &std.target.x86.feature_x87, +}; + +// Same as above but without sse. +const i386_default_features_freestanding: []*const std.target.Feature = &[_]*const std.target.Feature{ + &std.target.x86.feature_cmov, + &std.target.x86.feature_cx8, + &std.target.x86.feature_fxsr, + &std.target.x86.feature_mmx, + &std.target.x86.feature_nopl, + &std.target.x86.feature_slowUnalignedMem16, + &std.target.x86.feature_x87, +}; + + diff --git a/lib/std/buffer.zig b/lib/std/buffer.zig index 6313d693b7..21f73112fa 100644 --- a/lib/std/buffer.zig +++ b/lib/std/buffer.zig @@ -57,11 +57,11 @@ pub const Buffer = struct { /// The caller owns the returned memory. The Buffer becomes null and /// is safe to `deinit`. - pub fn toOwnedSlice(self: *Buffer) []u8 { + pub fn toOwnedSlice(self: *Buffer) [:0]u8 { const allocator = self.list.allocator; const result = allocator.shrink(self.list.items, self.len()); self.* = initNull(allocator); - return result; + return result[0 .. result.len - 1 :0]; } pub fn allocPrint(allocator: *Allocator, comptime format: []const u8, args: var) !Buffer { diff --git a/lib/std/build.zig b/lib/std/build.zig index 72d26ff047..1eabfb1559 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1199,8 +1199,6 @@ pub const LibExeObjStep = struct { subsystem: ?builtin.SubSystem = null, - target_details: ?std.target.TargetDetails = null, - const LinkObject = union(enum) { StaticPath: []const u8, OtherStep: *LibExeObjStep, @@ -1386,10 +1384,6 @@ pub const LibExeObjStep = struct { self.computeOutFileNames(); } - pub fn setTargetDetails(self: *LibExeObjStep, target_details: std.target.TargetDetails) void { - self.target_details = target_details; - } - pub fn setTargetGLibC(self: *LibExeObjStep, major: u32, minor: u32, patch: u32) void { self.target_glibc = Version{ .major = major, @@ -1974,32 +1968,31 @@ pub const LibExeObjStep = struct { switch (self.target) { .Native => {}, - .Cross => { + .Cross => |cross| { try zig_args.append("-target"); try zig_args.append(self.target.zigTriple(builder.allocator) catch unreachable); - }, - } - if (self.target_details) |td| { - switch (td) { - .cpu => |cpu| { - try zig_args.append("--cpu"); - try zig_args.append(cpu.name); - }, - .features => |features| { - try zig_args.append("--features"); - - var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0); - defer feature_str_buffer.deinit(); - - for (features) |feature| { - try feature_str_buffer.append(feature.name); - try feature_str_buffer.append(","); - } + switch (cross.cpu_features) { + .baseline => {}, + .cpu => |cpu| { + try zig_args.append("-target-cpu"); + try zig_args.append(cpu.name); + }, + .features => |features| { + try zig_args.append("-target-cpu-features"); + + var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0); + for (self.target.getArch().allFeaturesList()) |feature, i| { + if (Target.Cpu.Feature.isEnabled(features, @intCast(u7, i))) { + try feature_str_buffer.append(feature.name); + try feature_str_buffer.append(","); + } + } - try zig_args.append(feature_str_buffer.toOwnedSlice()); - }, - } + try zig_args.append(feature_str_buffer.toSlice()); + }, + } + }, } if (self.target_glibc) |ver| { diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 55f044094e..712d98b25c 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -15,6 +15,12 @@ pub const ObjectFormat = std.Target.ObjectFormat; /// Deprecated: use `std.Target.SubSystem`. pub const SubSystem = std.Target.SubSystem; +/// Deprecated: use `std.Target.Cross.CpuFeatures`. +pub const CpuFeatures = std.Target.Cross.CpuFeatures; + +/// Deprecated: use `std.Target.Cpu`. +pub const Cpu = std.Target.Cpu; + /// `explicit_subsystem` is missing when the subsystem is automatically detected, /// so Zig standard library has the subsystem detection logic here. This should generally be /// used rather than `explicit_subsystem`. diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 548ef8ccce..adbf409baa 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -1138,6 +1138,11 @@ fn countSize(size: *usize, bytes: []const u8) (error{}!void) { size.* += bytes.len; } +pub fn allocPrint0(allocator: *mem.Allocator, comptime fmt: []const u8, args: var) AllocPrintError![:0]u8 { + const result = try allocPrint(allocator, fmt ++ "\x00", args); + return result[0 .. result.len - 1 :0]; +} + test "bufPrintInt" { var buffer: [100]u8 = undefined; const buf = buffer[0..]; diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 5e5850e393..5cb9c6589c 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -556,3 +556,21 @@ pub fn refAllDecls(comptime T: type) void { if (!builtin.is_test) return; _ = declarations(T); } + +/// Returns a slice of pointers to public declarations of a namespace. +pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const Decl { + const S = struct { + fn declNameLessThan(lhs: *const Decl, rhs: *const Decl) bool { + return mem.lessThan(u8, lhs.name, rhs.name); + } + }; + comptime { + const decls = declarations(Namespace); + var array: [decls.len]*const Decl = undefined; + for (decls) |decl, i| { + array[i] = &@field(Namespace, decl.name); + } + std.sort.sort(*const Decl, &array, S.declNameLessThan); + return &array; + } +} diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig index efb1e5fe04..5dbdafb60a 100644 --- a/lib/std/os/linux/tls.zig +++ b/lib/std/os/linux/tls.zig @@ -211,7 +211,7 @@ pub fn initTLS() ?*elf.Phdr { if (tls_phdr) |phdr| { // If the cpu is arm-based, check if it supports the TLS register - if (builtin.arch == builtin.Arch.arm and at_hwcap & std.os.linux.HWCAP_TLS == 0) { + if (builtin.arch == .arm and at_hwcap & std.os.linux.HWCAP_TLS == 0) { // If the CPU does not support TLS via a coprocessor register, // a kernel helper function can be used instead on certain linux kernels. // See linux/arch/arm/include/asm/tls.h and musl/src/thread/arm/__set_thread_area.c. diff --git a/lib/std/std.zig b/lib/std/std.zig index f268bfe848..dd4d968efb 100644 --- a/lib/std/std.zig +++ b/lib/std/std.zig @@ -60,7 +60,6 @@ pub const rand = @import("rand.zig"); pub const rb = @import("rb.zig"); pub const sort = @import("sort.zig"); pub const ascii = @import("ascii.zig"); -pub const target = @import("target.zig"); pub const testing = @import("testing.zig"); pub const time = @import("time.zig"); pub const unicode = @import("unicode.zig"); diff --git a/lib/std/target.zig b/lib/std/target.zig index 7069f9e833..263167d738 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -101,6 +101,22 @@ pub const Target = union(enum) { renderscript32, renderscript64, + pub const aarch64 = @import("target/aarch64.zig"); + pub const amdgpu = @import("target/amdgpu.zig"); + pub const arm = @import("target/arm.zig"); + pub const avr = @import("target/avr.zig"); + pub const bpf = @import("target/bpf.zig"); + pub const hexagon = @import("target/hexagon.zig"); + pub const mips = @import("target/mips.zig"); + pub const msp430 = @import("target/msp430.zig"); + pub const nvptx = @import("target/nvptx.zig"); + pub const powerpc = @import("target/powerpc.zig"); + pub const riscv = @import("target/riscv.zig"); + pub const sparc = @import("target/sparc.zig"); + pub const systemz = @import("target/systemz.zig"); + pub const wasm = @import("target/wasm.zig"); + pub const x86 = @import("target/x86.zig"); + pub const Arm32 = enum { v8_5a, v8_4a, @@ -184,6 +200,71 @@ pub const Target = union(enum) { }; } + 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; + } + + /// This parsing function supports 2 syntaxes. + /// * Comma-separated list of features, with + or - in front of each feature. This + /// form represents a deviation from baseline. + /// * Comma-separated list of features, with no + or - in front of each feature. This + /// form represents an exclusive list of enabled features; no other features besides + /// the ones listed, and their dependencies, will be enabled. + /// Extra commas are ignored. + pub fn parseCpuFeatureSet(arch: Arch, features_text: []const u8) !Cpu.Feature.Set { + // Here we compute both and choose the correct result at the end, based + // on whether or not we saw + and - signs. + var set: @Vector(2, Cpu.Feature.Set) = [2]Cpu.Feature.Set{ 0, arch.baselineFeatures() }; + var mode: enum { + unknown, + baseline, + whitelist, + } = .unknown; + + var it = mem.tokenize(features_text, ","); + while (it.next()) |item_text| { + const feature_name = blk: { + if (mem.startsWith(u8, item_text, "+")) { + switch (mode) { + .unknown, .baseline => mode = .baseline, + .whitelist => return error.InvalidCpuFeatures, + } + break :blk item_text[1..]; + } else if (mem.startsWith(u8, item_text, "-")) { + switch (mode) { + .unknown, .baseline => mode = .baseline, + .whitelist => return error.InvalidCpuFeatures, + } + break :blk item_text[1..]; + } else { + switch (mode) { + .unknown, .whitelist => mode = .whitelist, + .baseline => return error.InvalidCpuFeatures, + } + break :blk item_text; + } + }; + for (arch.allFeaturesList()) |feature, index| { + if (mem.eql(u8, feature_name, feature.name)) { + set |= @splat(2, 1 << index); + break; + } + } else { + return error.UnknownCpuFeature; + } + } + + return switch (mode) { + .unknown, .whitelist => set[0], + .baseline => set[1], + }; + } + pub fn toElfMachine(arch: Arch) std.elf.EM { return switch (arch) { .avr => ._AVR, @@ -296,6 +377,98 @@ pub const Target = union(enum) { => .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 *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]*const 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 baselineFeatures(arch: Arch) Cpu.Feature.Set { + return switch (arch) { + .arm, .armeb, .thumb, .thumbeb => arm.baseline_features, + .aarch64, .aarch64_be, .aarch64_32 => aarch64.cpu.generic.features, + .avr => avr.baseline_features, + .bpfel, .bpfeb => bpf.baseline_features, + .hexagon => hexagon.baseline_features, + .mips, .mipsel, .mips64, .mips64el => mips.baseline_features, + .msp430 => msp430.baseline_features, + .powerpc, .powerpc64, .powerpc64le => powerpc.baseline_features, + .amdgcn => amdgpu.baseline_features, + .riscv32, .riscv64 => riscv.baseline_features, + .sparc, .sparcv9, .sparcel => sparc.baseline_features, + .s390x => systemz.baseline_features, + .i386, .x86_64 => x86.baseline_features, + .nvptx, .nvptx64 => nvptx.baseline_features, + .wasm32, .wasm64 => wasm.baseline_features, + + else => &[0]*const Cpu.Feature{}, + }; + } + + /// 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 { @@ -323,6 +496,28 @@ pub const Target = union(enum) { macabi, }; + pub const Cpu = struct { + name: []const u8, + llvm_name: ?[:0]const u8, + features: Feature.Set, + + pub const Feature = struct { + /// The bit index into `Set`. + index: u8, + name: []const u8, + llvm_name: ?[:0]const u8, + description: []const u8, + dependencies: Set, + + /// A bit set of all the features. + pub const Set = u128; + + pub fn isEnabled(set: Set, arch_feature_index: u7) bool { + return (set & (@as(Set, 1) << arch_feature_index)) != 0; + } + }; + }; + pub const ObjectFormat = enum { unknown, coff, @@ -346,6 +541,19 @@ pub const Target = union(enum) { arch: Arch, os: Os, abi: Abi, + cpu_features: CpuFeatures = .baseline, + + pub const CpuFeatures = union(enum) { + /// The "default" set of CPU features for cross-compiling. A conservative set + /// of features that is expected to be supported on most available hardware. + baseline, + + /// Target one specific CPU. + cpu: *const Cpu, + + /// Explicitly provide the entire CPU feature set. + features: Cpu.Feature.Set, + }; }; pub const current = Target{ @@ -353,11 +561,20 @@ pub const Target = union(enum) { .arch = builtin.arch, .os = builtin.os, .abi = builtin.abi, + .cpu_features = builtin.cpu_features, }, }; pub const stack_align = 16; + pub fn cpuFeatures(self: Target) []const *const Cpu.Feature { + return switch (self.cpu_features) { + .baseline => self.arch.baselineFeatures(), + .cpu => |cpu| cpu.features, + .features => |features| features, + }; + } + pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 { return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{ @tagName(self.getArch()), @@ -496,7 +713,7 @@ pub const Target = union(enum) { pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch { const info = @typeInfo(Arch); inline for (info.Union.fields) |field| { - if (text.len >= field.name.len and mem.eql(u8, text[0..field.name.len], field.name)) { + if (mem.eql(u8, text, field.name)) { if (field.field_type == void) { return @as(Arch, @field(Arch, field.name)); } else { @@ -514,31 +731,6 @@ pub const Target = union(enum) { return error.UnknownArchitecture; } - pub fn parseArchTag(text: []const u8) ParseArchSubError!@TagType(Arch) { - const info = @typeInfo(Arch); - inline for (info.Union.fields) |field| { - if (text.len >= field.name.len and mem.eql(u8, text[0..field.name.len], field.name)) { - if (text.len == field.name.len) return @as(@TagType(Arch), @field(Arch, field.name)); - - if (field.field_type == void) { - return error.UnknownArchitecture; - } - - 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 @as(@TagType(Arch), @field(Arch, field.name)); - } - } - - return error.UnknownSubArchitecture; - } - } - - return error.UnknownArchitecture; - } - pub fn parseOs(text: []const u8) !Os { const info = @typeInfo(Os); inline for (info.Enum.fields) |field| { @@ -841,83 +1033,3 @@ pub const Target = union(enum) { return .unavailable; } }; - -pub const aarch64 = @import("target/aarch64.zig"); -pub const amdgpu = @import("target/amdgpu.zig"); -pub const arm = @import("target/arm.zig"); -pub const avr = @import("target/avr.zig"); -pub const bpf = @import("target/bpf.zig"); -pub const hexagon = @import("target/hexagon.zig"); -pub const mips = @import("target/mips.zig"); -pub const msp430 = @import("target/msp430.zig"); -pub const nvptx = @import("target/nvptx.zig"); -pub const powerpc = @import("target/powerpc.zig"); -pub const riscv = @import("target/riscv.zig"); -pub const sparc = @import("target/sparc.zig"); -pub const systemz = @import("target/systemz.zig"); -pub const wasm = @import("target/wasm.zig"); -pub const x86 = @import("target/x86.zig"); - -pub const Feature = struct { - name: []const u8, - llvm_name: ?[]const u8, - description: []const u8, - - dependencies: []*const Feature, -}; - -pub const Cpu = struct { - name: []const u8, - llvm_name: ?[]const u8, - - dependencies: []*const Feature, -}; - -pub const TargetDetails = union(enum) { - cpu: *const Cpu, - features: []*const Feature, -}; - -pub fn getFeaturesForArch(arch: @TagType(Target.Arch)) []*const Feature { - return switch (arch) { - .arm, .armeb, .thumb, .thumbeb => arm.features, - .aarch64, .aarch64_be, .aarch64_32 => aarch64.features, - .avr => avr.features, - .bpfel, .bpfeb => bpf.features, - .hexagon => hexagon.features, - .mips, .mipsel, .mips64, .mips64el => mips.features, - .msp430 => msp430.features, - .powerpc, .powerpc64, .powerpc64le => powerpc.features, - .amdgcn => amdgpu.features, - .riscv32, .riscv64 => riscv.features, - .sparc, .sparcv9, .sparcel => sparc.features, - .s390x => systemz.features, - .i386, .x86_64 => x86.features, - .nvptx, .nvptx64 => nvptx.features, - .wasm32, .wasm64 => wasm.features, - - else => &[_]*const Feature{}, - }; -} - -pub fn getCpusForArch(arch: @TagType(Target.Arch)) []*const Cpu { - return switch (arch) { - .arm, .armeb, .thumb, .thumbeb => arm.cpus, - .aarch64, .aarch64_be, .aarch64_32 => aarch64.cpus, - .avr => avr.cpus, - .bpfel, .bpfeb => bpf.cpus, - .hexagon => hexagon.cpus, - .mips, .mipsel, .mips64, .mips64el => mips.cpus, - .msp430 => msp430.cpus, - .powerpc, .powerpc64, .powerpc64le => powerpc.cpus, - .amdgcn => amdgpu.cpus, - .riscv32, .riscv64 => riscv.cpus, - .sparc, .sparcv9, .sparcel => sparc.cpus, - .s390x => systemz.cpus, - .i386, .x86_64 => x86.cpus, - .nvptx, .nvptx64 => nvptx.cpus, - .wasm32, .wasm64 => wasm.cpus, - - else => &[_]*const Cpu{}, - }; -} diff --git a/lib/std/target/aarch64.zig b/lib/std/target/aarch64.zig index 56101f20e7..77d8c986c9 100644 --- a/lib/std/target/aarch64.zig +++ b/lib/std/target/aarch64.zig @@ -1,1603 +1,1528 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_aes = Feature{ - .name = "aes", - .llvm_name = "aes", - .description = "Enable AES support", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_am = Feature{ - .name = "am", - .llvm_name = "am", - .description = "Enable v8.4-A Activity Monitors extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_aggressiveFma = Feature{ - .name = "aggressiveFma", - .llvm_name = "aggressive-fma", - .description = "Enable Aggressive FMA for floating-point.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_altnzcv = Feature{ - .name = "altnzcv", - .llvm_name = "altnzcv", - .description = "Enable alternative NZCV format for floating point comparisons", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_alternateSextloadCvtF32Pattern = Feature{ - .name = "alternateSextloadCvtF32Pattern", - .llvm_name = "alternate-sextload-cvt-f32-pattern", - .description = "Use alternative pattern for sextload convert to f32", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_arithBccFusion = Feature{ - .name = "arithBccFusion", - .llvm_name = "arith-bcc-fusion", - .description = "CPU fuses arithmetic+bcc operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_arithCbzFusion = Feature{ - .name = "arithCbzFusion", - .llvm_name = "arith-cbz-fusion", - .description = "CPU fuses arithmetic + cbz/cbnz operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_balanceFpOps = Feature{ - .name = "balanceFpOps", - .llvm_name = "balance-fp-ops", - .description = "balance mix of odd and even D-registers for fp multiply(-accumulate) ops", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_bti = Feature{ - .name = "bti", - .llvm_name = "bti", - .description = "Enable Branch Target Identification", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ccidx = Feature{ - .name = "ccidx", - .llvm_name = "ccidx", - .description = "Enable v8.3-A Extend of the CCSIDR number of sets", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ccpp = Feature{ - .name = "ccpp", - .llvm_name = "ccpp", - .description = "Enable v8.2 data Cache Clean to Point of Persistence", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_crc = Feature{ - .name = "crc", - .llvm_name = "crc", - .description = "Enable ARMv8 CRC-32 checksum instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ccdp = Feature{ - .name = "ccdp", - .llvm_name = "ccdp", - .description = "Enable v8.5 Cache Clean to Point of Deep Persistence", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX8 = Feature{ - .name = "callSavedX8", - .llvm_name = "call-saved-x8", - .description = "Make X8 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX9 = Feature{ - .name = "callSavedX9", - .llvm_name = "call-saved-x9", - .description = "Make X9 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX10 = Feature{ - .name = "callSavedX10", - .llvm_name = "call-saved-x10", - .description = "Make X10 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX11 = Feature{ - .name = "callSavedX11", - .llvm_name = "call-saved-x11", - .description = "Make X11 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX12 = Feature{ - .name = "callSavedX12", - .llvm_name = "call-saved-x12", - .description = "Make X12 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX13 = Feature{ - .name = "callSavedX13", - .llvm_name = "call-saved-x13", - .description = "Make X13 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX14 = Feature{ - .name = "callSavedX14", - .llvm_name = "call-saved-x14", - .description = "Make X14 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX15 = Feature{ - .name = "callSavedX15", - .llvm_name = "call-saved-x15", - .description = "Make X15 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_callSavedX18 = Feature{ - .name = "callSavedX18", - .llvm_name = "call-saved-x18", - .description = "Make X18 callee saved.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_complxnum = Feature{ - .name = "complxnum", - .llvm_name = "complxnum", - .description = "Enable v8.3-A Floating-point complex number support", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_crypto = Feature{ - .name = "crypto", - .llvm_name = "crypto", - .description = "Enable cryptographic instructions", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_customCheapAsMove = Feature{ - .name = "customCheapAsMove", - .llvm_name = "custom-cheap-as-move", - .description = "Use custom handling of cheap instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dit = Feature{ - .name = "dit", - .llvm_name = "dit", - .description = "Enable v8.4-A Data Independent Timing instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_disableLatencySchedHeuristic = Feature{ - .name = "disableLatencySchedHeuristic", - .llvm_name = "disable-latency-sched-heuristic", - .description = "Disable latency scheduling heuristic", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dotprod = Feature{ - .name = "dotprod", - .llvm_name = "dotprod", - .description = "Enable dot product support", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_exynosCheapAsMove = Feature{ - .name = "exynosCheapAsMove", - .llvm_name = "exynos-cheap-as-move", - .description = "Use Exynos specific handling of cheap instructions", - .dependencies = &[_]*const Feature { - &feature_customCheapAsMove, - }, -}; - -pub const feature_fmi = Feature{ - .name = "fmi", - .llvm_name = "fmi", - .description = "Enable v8.4-A Flag Manipulation Instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp16fml = Feature{ - .name = "fp16fml", - .llvm_name = "fp16fml", - .description = "Enable FP16 FML instructions", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_fpArmv8 = Feature{ - .name = "fpArmv8", - .llvm_name = "fp-armv8", - .description = "Enable ARMv8 FP", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fptoint = Feature{ - .name = "fptoint", - .llvm_name = "fptoint", - .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_force32bitJumpTables = Feature{ - .name = "force32bitJumpTables", - .llvm_name = "force-32bit-jump-tables", - .description = "Force jump table entries to be 32-bits wide except at MinSize", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fullfp16 = Feature{ - .name = "fullfp16", - .llvm_name = "fullfp16", - .description = "Full FP16", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_fuseAes = Feature{ - .name = "fuseAes", - .llvm_name = "fuse-aes", - .description = "CPU fuses AES crypto operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseAddress = Feature{ - .name = "fuseAddress", - .llvm_name = "fuse-address", - .description = "CPU fuses address generation and memory operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseArithLogic = Feature{ - .name = "fuseArithLogic", - .llvm_name = "fuse-arith-logic", - .description = "CPU fuses arithmetic and logic operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseCsel = Feature{ - .name = "fuseCsel", - .llvm_name = "fuse-csel", - .description = "CPU fuses conditional select operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseCryptoEor = Feature{ - .name = "fuseCryptoEor", - .llvm_name = "fuse-crypto-eor", - .description = "CPU fuses AES/PMULL and EOR operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseLiterals = Feature{ - .name = "fuseLiterals", - .llvm_name = "fuse-literals", - .description = "CPU fuses literal generation operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_jsconv = Feature{ - .name = "jsconv", - .llvm_name = "jsconv", - .description = "Enable v8.3-A JavaScript FP conversion enchancement", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_lor = Feature{ - .name = "lor", - .llvm_name = "lor", - .description = "Enables ARM v8.1 Limited Ordering Regions extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lse = Feature{ - .name = "lse", - .llvm_name = "lse", - .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lslFast = Feature{ - .name = "lslFast", - .llvm_name = "lsl-fast", - .description = "CPU has a fastpath logical shift of up to 3 places", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mpam = Feature{ - .name = "mpam", - .llvm_name = "mpam", - .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mte = Feature{ - .name = "mte", - .llvm_name = "mte", - .description = "Enable Memory Tagging Extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_neon = Feature{ - .name = "neon", - .llvm_name = "neon", - .description = "Enable Advanced SIMD instructions", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_nv = Feature{ - .name = "nv", - .llvm_name = "nv", - .description = "Enable v8.4-A Nested Virtualization Enchancement", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noNegImmediates = Feature{ - .name = "noNegImmediates", - .llvm_name = "no-neg-immediates", - .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_pa = Feature{ - .name = "pa", - .llvm_name = "pa", - .description = "Enable v8.3-A Pointer Authentication enchancement", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_pan = Feature{ - .name = "pan", - .llvm_name = "pan", - .description = "Enables ARM v8.1 Privileged Access-Never extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_panRwv = Feature{ - .name = "panRwv", - .llvm_name = "pan-rwv", - .description = "Enable v8.2 PAN s1e1R and s1e1W Variants", - .dependencies = &[_]*const Feature { - &feature_pan, - }, -}; - -pub const feature_perfmon = Feature{ - .name = "perfmon", - .llvm_name = "perfmon", - .description = "Enable ARMv8 PMUv3 Performance Monitors extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_usePostraScheduler = Feature{ - .name = "usePostraScheduler", - .llvm_name = "use-postra-scheduler", - .description = "Schedule again after register allocation", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_predres = Feature{ - .name = "predres", - .llvm_name = "predres", - .description = "Enable v8.5a execution and data prediction invalidation instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_predictableSelectExpensive = Feature{ - .name = "predictableSelectExpensive", - .llvm_name = "predictable-select-expensive", - .description = "Prefer likely predicted branches over selects", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_uaops = Feature{ - .name = "uaops", - .llvm_name = "uaops", - .description = "Enable v8.2 UAO PState", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ras = Feature{ - .name = "ras", - .llvm_name = "ras", - .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_rasv8_4 = Feature{ - .name = "rasv8_4", - .llvm_name = "rasv8_4", - .description = "Enable v8.4-A Reliability, Availability and Serviceability extension", - .dependencies = &[_]*const Feature { - &feature_ras, - }, -}; - -pub const feature_rcpc = Feature{ - .name = "rcpc", - .llvm_name = "rcpc", - .description = "Enable support for RCPC extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_rcpcImmo = Feature{ - .name = "rcpcImmo", - .llvm_name = "rcpc-immo", - .description = "Enable v8.4-A RCPC instructions with Immediate Offsets", - .dependencies = &[_]*const Feature { - &feature_rcpc, - }, -}; - -pub const feature_rdm = Feature{ - .name = "rdm", - .llvm_name = "rdm", - .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_rand = Feature{ - .name = "rand", - .llvm_name = "rand", - .description = "Enable Random Number generation instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX1 = Feature{ - .name = "reserveX1", - .llvm_name = "reserve-x1", - .description = "Reserve X1, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX2 = Feature{ - .name = "reserveX2", - .llvm_name = "reserve-x2", - .description = "Reserve X2, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX3 = Feature{ - .name = "reserveX3", - .llvm_name = "reserve-x3", - .description = "Reserve X3, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX4 = Feature{ - .name = "reserveX4", - .llvm_name = "reserve-x4", - .description = "Reserve X4, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX5 = Feature{ - .name = "reserveX5", - .llvm_name = "reserve-x5", - .description = "Reserve X5, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX6 = Feature{ - .name = "reserveX6", - .llvm_name = "reserve-x6", - .description = "Reserve X6, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX7 = Feature{ - .name = "reserveX7", - .llvm_name = "reserve-x7", - .description = "Reserve X7, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX9 = Feature{ - .name = "reserveX9", - .llvm_name = "reserve-x9", - .description = "Reserve X9, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX10 = Feature{ - .name = "reserveX10", - .llvm_name = "reserve-x10", - .description = "Reserve X10, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX11 = Feature{ - .name = "reserveX11", - .llvm_name = "reserve-x11", - .description = "Reserve X11, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX12 = Feature{ - .name = "reserveX12", - .llvm_name = "reserve-x12", - .description = "Reserve X12, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX13 = Feature{ - .name = "reserveX13", - .llvm_name = "reserve-x13", - .description = "Reserve X13, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX14 = Feature{ - .name = "reserveX14", - .llvm_name = "reserve-x14", - .description = "Reserve X14, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX15 = Feature{ - .name = "reserveX15", - .llvm_name = "reserve-x15", - .description = "Reserve X15, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX18 = Feature{ - .name = "reserveX18", - .llvm_name = "reserve-x18", - .description = "Reserve X18, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX20 = Feature{ - .name = "reserveX20", - .llvm_name = "reserve-x20", - .description = "Reserve X20, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX21 = Feature{ - .name = "reserveX21", - .llvm_name = "reserve-x21", - .description = "Reserve X21, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX22 = Feature{ - .name = "reserveX22", - .llvm_name = "reserve-x22", - .description = "Reserve X22, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX23 = Feature{ - .name = "reserveX23", - .llvm_name = "reserve-x23", - .description = "Reserve X23, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX24 = Feature{ - .name = "reserveX24", - .llvm_name = "reserve-x24", - .description = "Reserve X24, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX25 = Feature{ - .name = "reserveX25", - .llvm_name = "reserve-x25", - .description = "Reserve X25, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX26 = Feature{ - .name = "reserveX26", - .llvm_name = "reserve-x26", - .description = "Reserve X26, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX27 = Feature{ - .name = "reserveX27", - .llvm_name = "reserve-x27", - .description = "Reserve X27, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveX28 = Feature{ - .name = "reserveX28", - .llvm_name = "reserve-x28", - .description = "Reserve X28, making it unavailable as a GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sb = Feature{ - .name = "sb", - .llvm_name = "sb", - .description = "Enable v8.5 Speculation Barrier", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sel2 = Feature{ - .name = "sel2", - .llvm_name = "sel2", - .description = "Enable v8.4-A Secure Exception Level 2 extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sha2 = Feature{ - .name = "sha2", - .llvm_name = "sha2", - .description = "Enable SHA1 and SHA256 support", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_sha3 = Feature{ - .name = "sha3", - .llvm_name = "sha3", - .description = "Enable SHA512 and SHA3 support", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_sm4 = Feature{ - .name = "sm4", - .llvm_name = "sm4", - .description = "Enable SM3 and SM4 support", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - }, -}; - -pub const feature_spe = Feature{ - .name = "spe", - .llvm_name = "spe", - .description = "Enable Statistical Profiling extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ssbs = Feature{ - .name = "ssbs", - .llvm_name = "ssbs", - .description = "Enable Speculative Store Bypass Safe bit", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sve = Feature{ - .name = "sve", - .llvm_name = "sve", - .description = "Enable Scalable Vector Extension (SVE) instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sve2 = Feature{ - .name = "sve2", - .llvm_name = "sve2", - .description = "Enable Scalable Vector Extension 2 (SVE2) instructions", - .dependencies = &[_]*const Feature { - &feature_sve, - }, -}; - -pub const feature_sve2Aes = Feature{ - .name = "sve2Aes", - .llvm_name = "sve2-aes", - .description = "Enable AES SVE2 instructions", - .dependencies = &[_]*const Feature { - &feature_sve, - &feature_fpArmv8, - }, -}; - -pub const feature_sve2Bitperm = Feature{ - .name = "sve2Bitperm", - .llvm_name = "sve2-bitperm", - .description = "Enable bit permutation SVE2 instructions", - .dependencies = &[_]*const Feature { - &feature_sve, - }, -}; - -pub const feature_sve2Sha3 = Feature{ - .name = "sve2Sha3", - .llvm_name = "sve2-sha3", - .description = "Enable SHA3 SVE2 instructions", - .dependencies = &[_]*const Feature { - &feature_sve, - &feature_fpArmv8, - }, -}; - -pub const feature_sve2Sm4 = Feature{ - .name = "sve2Sm4", - .llvm_name = "sve2-sm4", - .description = "Enable SM4 SVE2 instructions", - .dependencies = &[_]*const Feature { - &feature_sve, - &feature_fpArmv8, - }, -}; - -pub const feature_slowMisaligned128store = Feature{ - .name = "slowMisaligned128store", - .llvm_name = "slow-misaligned-128store", - .description = "Misaligned 128 bit stores are slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowPaired128 = Feature{ - .name = "slowPaired128", - .llvm_name = "slow-paired-128", - .description = "Paired 128 bit loads and stores are slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowStrqroStore = Feature{ - .name = "slowStrqroStore", - .llvm_name = "slow-strqro-store", - .description = "STR of Q register with register offset is slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_specrestrict = Feature{ - .name = "specrestrict", - .llvm_name = "specrestrict", - .description = "Enable architectural speculation restriction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_strictAlign = Feature{ - .name = "strictAlign", - .llvm_name = "strict-align", - .description = "Disallow all unaligned memory access", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tlbRmi = Feature{ - .name = "tlbRmi", - .llvm_name = "tlb-rmi", - .description = "Enable v8.4-A TLB Range and Maintenance Instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tracev84 = Feature{ - .name = "tracev84", - .llvm_name = "tracev8.4", - .description = "Enable v8.4-A Trace extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useAa = Feature{ - .name = "useAa", - .llvm_name = "use-aa", - .description = "Use alias analysis during codegen", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tpidrEl1 = Feature{ - .name = "tpidrEl1", - .llvm_name = "tpidr-el1", - .description = "Permit use of TPIDR_EL1 for the TLS base", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tpidrEl2 = Feature{ - .name = "tpidrEl2", - .llvm_name = "tpidr-el2", - .description = "Permit use of TPIDR_EL2 for the TLS base", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tpidrEl3 = Feature{ - .name = "tpidrEl3", - .llvm_name = "tpidr-el3", - .description = "Permit use of TPIDR_EL3 for the TLS base", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useReciprocalSquareRoot = Feature{ - .name = "useReciprocalSquareRoot", - .llvm_name = "use-reciprocal-square-root", - .description = "Use the reciprocal square root approximation", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vh = Feature{ - .name = "vh", - .llvm_name = "vh", - .description = "Enables ARM v8.1 Virtual Host extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_zcm = Feature{ - .name = "zcm", - .llvm_name = "zcm", - .description = "Has zero-cycle register moves", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_zcz = Feature{ - .name = "zcz", - .llvm_name = "zcz", - .description = "Has zero-cycle zeroing instructions", - .dependencies = &[_]*const Feature { - &feature_zczFp, - &feature_zczGp, - }, -}; - -pub const feature_zczFp = Feature{ - .name = "zczFp", - .llvm_name = "zcz-fp", - .description = "Has zero-cycle zeroing instructions for FP registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_zczFpWorkaround = Feature{ - .name = "zczFpWorkaround", - .llvm_name = "zcz-fp-workaround", - .description = "The zero-cycle floating-point zeroing instruction has a bug", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_zczGp = Feature{ - .name = "zczGp", - .llvm_name = "zcz-gp", - .description = "Has zero-cycle zeroing instructions for generic registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_aes, - &feature_am, - &feature_aggressiveFma, - &feature_altnzcv, - &feature_alternateSextloadCvtF32Pattern, - &feature_arithBccFusion, - &feature_arithCbzFusion, - &feature_balanceFpOps, - &feature_bti, - &feature_ccidx, - &feature_ccpp, - &feature_crc, - &feature_ccdp, - &feature_callSavedX8, - &feature_callSavedX9, - &feature_callSavedX10, - &feature_callSavedX11, - &feature_callSavedX12, - &feature_callSavedX13, - &feature_callSavedX14, - &feature_callSavedX15, - &feature_callSavedX18, - &feature_complxnum, - &feature_crypto, - &feature_customCheapAsMove, - &feature_dit, - &feature_disableLatencySchedHeuristic, - &feature_dotprod, - &feature_exynosCheapAsMove, - &feature_fmi, - &feature_fp16fml, - &feature_fpArmv8, - &feature_fptoint, - &feature_force32bitJumpTables, - &feature_fullfp16, - &feature_fuseAes, - &feature_fuseAddress, - &feature_fuseArithLogic, - &feature_fuseCsel, - &feature_fuseCryptoEor, - &feature_fuseLiterals, - &feature_jsconv, - &feature_lor, - &feature_lse, - &feature_lslFast, - &feature_mpam, - &feature_mte, - &feature_neon, - &feature_nv, - &feature_noNegImmediates, - &feature_pa, - &feature_pan, - &feature_panRwv, - &feature_perfmon, - &feature_usePostraScheduler, - &feature_predres, - &feature_predictableSelectExpensive, - &feature_uaops, - &feature_ras, - &feature_rasv8_4, - &feature_rcpc, - &feature_rcpcImmo, - &feature_rdm, - &feature_rand, - &feature_reserveX1, - &feature_reserveX2, - &feature_reserveX3, - &feature_reserveX4, - &feature_reserveX5, - &feature_reserveX6, - &feature_reserveX7, - &feature_reserveX9, - &feature_reserveX10, - &feature_reserveX11, - &feature_reserveX12, - &feature_reserveX13, - &feature_reserveX14, - &feature_reserveX15, - &feature_reserveX18, - &feature_reserveX20, - &feature_reserveX21, - &feature_reserveX22, - &feature_reserveX23, - &feature_reserveX24, - &feature_reserveX25, - &feature_reserveX26, - &feature_reserveX27, - &feature_reserveX28, - &feature_sb, - &feature_sel2, - &feature_sha2, - &feature_sha3, - &feature_sm4, - &feature_spe, - &feature_ssbs, - &feature_sve, - &feature_sve2, - &feature_sve2Aes, - &feature_sve2Bitperm, - &feature_sve2Sha3, - &feature_sve2Sm4, - &feature_slowMisaligned128store, - &feature_slowPaired128, - &feature_slowStrqroStore, - &feature_specrestrict, - &feature_strictAlign, - &feature_tlbRmi, - &feature_tracev84, - &feature_useAa, - &feature_tpidrEl1, - &feature_tpidrEl2, - &feature_tpidrEl3, - &feature_useReciprocalSquareRoot, - &feature_vh, - &feature_zcm, - &feature_zcz, - &feature_zczFp, - &feature_zczFpWorkaround, - &feature_zczGp, -}; - -pub const cpu_appleLatest = Cpu{ - .name = "appleLatest", - .llvm_name = "apple-latest", - .dependencies = &[_]*const Feature { - &feature_arithCbzFusion, - &feature_zczFpWorkaround, - &feature_alternateSextloadCvtF32Pattern, - &feature_fuseCryptoEor, - &feature_zcm, - &feature_zczGp, - &feature_perfmon, - &feature_disableLatencySchedHeuristic, - &feature_fpArmv8, - &feature_zczFp, - &feature_arithBccFusion, - &feature_fuseAes, - }, -}; - -pub const cpu_cortexA35 = Cpu{ - .name = "cortexA35", - .llvm_name = "cortex-a35", - .dependencies = &[_]*const Feature { - &feature_perfmon, - &feature_fpArmv8, - &feature_crc, - }, -}; - -pub const cpu_cortexA53 = Cpu{ - .name = "cortexA53", - .llvm_name = "cortex-a53", - .dependencies = &[_]*const Feature { - &feature_customCheapAsMove, - &feature_crc, - &feature_perfmon, - &feature_useAa, - &feature_fpArmv8, - &feature_fuseAes, - &feature_balanceFpOps, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_cortexA55 = Cpu{ - .name = "cortexA55", - .llvm_name = "cortex-a55", - .dependencies = &[_]*const Feature { - &feature_ccpp, - &feature_rcpc, - &feature_uaops, - &feature_rdm, - &feature_ras, - &feature_lse, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_vh, - &feature_fuseAes, - &feature_lor, - &feature_dotprod, - &feature_pan, - }, -}; - -pub const cpu_cortexA57 = Cpu{ - .name = "cortexA57", - .llvm_name = "cortex-a57", - .dependencies = &[_]*const Feature { - &feature_fuseLiterals, - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_fuseAes, - &feature_balanceFpOps, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_cortexA72 = Cpu{ - .name = "cortexA72", - .llvm_name = "cortex-a72", - .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_fpArmv8, - &feature_perfmon, - &feature_crc, - }, -}; - -pub const cpu_cortexA73 = Cpu{ - .name = "cortexA73", - .llvm_name = "cortex-a73", - .dependencies = &[_]*const Feature { - &feature_fuseAes, - &feature_fpArmv8, - &feature_perfmon, - &feature_crc, - }, -}; - -pub const cpu_cortexA75 = Cpu{ - .name = "cortexA75", - .llvm_name = "cortex-a75", - .dependencies = &[_]*const Feature { - &feature_ccpp, - &feature_rcpc, - &feature_uaops, - &feature_rdm, - &feature_ras, - &feature_lse, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_vh, - &feature_fuseAes, - &feature_lor, - &feature_dotprod, - &feature_pan, - }, -}; - -pub const cpu_cortexA76 = Cpu{ - .name = "cortexA76", - .llvm_name = "cortex-a76", - .dependencies = &[_]*const Feature { - &feature_ccpp, - &feature_rcpc, - &feature_uaops, - &feature_rdm, - &feature_ras, - &feature_lse, - &feature_crc, - &feature_fpArmv8, - &feature_vh, - &feature_lor, - &feature_ssbs, - &feature_dotprod, - &feature_pan, - }, -}; - -pub const cpu_cortexA76ae = Cpu{ - .name = "cortexA76ae", - .llvm_name = "cortex-a76ae", - .dependencies = &[_]*const Feature { - &feature_ccpp, - &feature_rcpc, - &feature_uaops, - &feature_rdm, - &feature_ras, - &feature_lse, - &feature_crc, - &feature_fpArmv8, - &feature_vh, - &feature_lor, - &feature_ssbs, - &feature_dotprod, - &feature_pan, - }, -}; - -pub const cpu_cyclone = Cpu{ - .name = "cyclone", - .llvm_name = "cyclone", - .dependencies = &[_]*const Feature { - &feature_arithCbzFusion, - &feature_zczFpWorkaround, - &feature_alternateSextloadCvtF32Pattern, - &feature_fuseCryptoEor, - &feature_zcm, - &feature_zczGp, - &feature_perfmon, - &feature_disableLatencySchedHeuristic, - &feature_fpArmv8, - &feature_zczFp, - &feature_arithBccFusion, - &feature_fuseAes, - }, -}; - -pub const cpu_exynosM1 = Cpu{ - .name = "exynosM1", - .llvm_name = "exynos-m1", - .dependencies = &[_]*const Feature { - &feature_customCheapAsMove, - &feature_crc, - &feature_force32bitJumpTables, - &feature_perfmon, - &feature_slowMisaligned128store, - &feature_useReciprocalSquareRoot, - &feature_fpArmv8, - &feature_zczFp, - &feature_fuseAes, - &feature_slowPaired128, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_exynosM2 = Cpu{ - .name = "exynosM2", - .llvm_name = "exynos-m2", - .dependencies = &[_]*const Feature { - &feature_customCheapAsMove, - &feature_crc, - &feature_force32bitJumpTables, - &feature_perfmon, - &feature_slowMisaligned128store, - &feature_fpArmv8, - &feature_zczFp, - &feature_fuseAes, - &feature_slowPaired128, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_exynosM3 = Cpu{ - .name = "exynosM3", - .llvm_name = "exynos-m3", - .dependencies = &[_]*const Feature { - &feature_fuseLiterals, - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_crc, - &feature_force32bitJumpTables, - &feature_fuseAddress, - &feature_fuseCsel, - &feature_perfmon, - &feature_fpArmv8, - &feature_zczFp, - &feature_fuseAes, - &feature_lslFast, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_exynosM4 = Cpu{ - .name = "exynosM4", - .llvm_name = "exynos-m4", - .dependencies = &[_]*const Feature { - &feature_arithCbzFusion, - &feature_customCheapAsMove, - &feature_lse, - &feature_zczFp, - &feature_lslFast, - &feature_lor, - &feature_fuseLiterals, - &feature_ccpp, - &feature_ras, - &feature_fpArmv8, - &feature_fuseAes, - &feature_pan, - &feature_fuseArithLogic, - &feature_crc, - &feature_force32bitJumpTables, - &feature_fuseAddress, - &feature_fuseCsel, - &feature_arithBccFusion, - &feature_uaops, - &feature_rdm, - &feature_zczGp, - &feature_perfmon, - &feature_vh, - &feature_usePostraScheduler, - &feature_dotprod, - }, -}; - -pub const cpu_exynosM5 = Cpu{ - .name = "exynosM5", - .llvm_name = "exynos-m5", - .dependencies = &[_]*const Feature { - &feature_arithCbzFusion, - &feature_customCheapAsMove, - &feature_lse, - &feature_zczFp, - &feature_lslFast, - &feature_lor, - &feature_fuseLiterals, - &feature_ccpp, - &feature_ras, - &feature_fpArmv8, - &feature_fuseAes, - &feature_pan, - &feature_fuseArithLogic, - &feature_crc, - &feature_force32bitJumpTables, - &feature_fuseAddress, - &feature_fuseCsel, - &feature_arithBccFusion, - &feature_uaops, - &feature_rdm, - &feature_zczGp, - &feature_perfmon, - &feature_vh, - &feature_usePostraScheduler, - &feature_dotprod, - }, -}; - -pub const cpu_falkor = Cpu{ - .name = "falkor", - .llvm_name = "falkor", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_rdm, - &feature_slowStrqroStore, - &feature_zczGp, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_zczFp, - &feature_lslFast, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - &feature_fpArmv8, - &feature_fuseAes, - &feature_neon, - &feature_perfmon, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_kryo = Cpu{ - .name = "kryo", - .llvm_name = "kryo", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_zczGp, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_zczFp, - &feature_lslFast, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_saphira = Cpu{ - .name = "saphira", - .llvm_name = "saphira", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_customCheapAsMove, - &feature_fmi, - &feature_lse, - &feature_zczFp, - &feature_lslFast, - &feature_lor, - &feature_dit, - &feature_pa, - &feature_ccpp, - &feature_sel2, - &feature_ras, - &feature_fpArmv8, - &feature_ccidx, - &feature_pan, - &feature_rcpc, - &feature_crc, - &feature_tracev84, - &feature_mpam, - &feature_am, - &feature_nv, - &feature_tlbRmi, - &feature_uaops, - &feature_rdm, - &feature_zczGp, - &feature_perfmon, - &feature_vh, - &feature_usePostraScheduler, - &feature_dotprod, - &feature_spe, - }, -}; - -pub const cpu_thunderx = Cpu{ - .name = "thunderx", - .llvm_name = "thunderx", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_thunderx2t99 = Cpu{ - .name = "thunderx2t99", - .llvm_name = "thunderx2t99", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_aggressiveFma, - &feature_rdm, - &feature_lse, - &feature_crc, - &feature_fpArmv8, - &feature_vh, - &feature_arithBccFusion, - &feature_lor, - &feature_usePostraScheduler, - &feature_pan, - }, -}; - -pub const cpu_thunderxt81 = Cpu{ - .name = "thunderxt81", - .llvm_name = "thunderxt81", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_thunderxt83 = Cpu{ - .name = "thunderxt83", - .llvm_name = "thunderxt83", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_thunderxt88 = Cpu{ - .name = "thunderxt88", - .llvm_name = "thunderxt88", - .dependencies = &[_]*const Feature { - &feature_predictableSelectExpensive, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_usePostraScheduler, - }, -}; - -pub const cpu_tsv110 = Cpu{ - .name = "tsv110", - .llvm_name = "tsv110", - .dependencies = &[_]*const Feature { - &feature_ccpp, - &feature_customCheapAsMove, - &feature_uaops, - &feature_rdm, - &feature_ras, - &feature_lse, - &feature_crc, - &feature_perfmon, - &feature_fpArmv8, - &feature_vh, - &feature_fuseAes, - &feature_lor, - &feature_usePostraScheduler, - &feature_dotprod, - &feature_pan, - &feature_spe, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_appleLatest, - &cpu_cortexA35, - &cpu_cortexA53, - &cpu_cortexA55, - &cpu_cortexA57, - &cpu_cortexA72, - &cpu_cortexA73, - &cpu_cortexA75, - &cpu_cortexA76, - &cpu_cortexA76ae, - &cpu_cyclone, - &cpu_exynosM1, - &cpu_exynosM2, - &cpu_exynosM3, - &cpu_exynosM4, - &cpu_exynosM5, - &cpu_falkor, - &cpu_generic, - &cpu_kryo, - &cpu_saphira, - &cpu_thunderx, - &cpu_thunderx2t99, - &cpu_thunderxt81, - &cpu_thunderxt83, - &cpu_thunderxt88, - &cpu_tsv110, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + aes, + am, + aggressive_fma, + altnzcv, + alternate_sextload_cvt_f32_pattern, + arith_bcc_fusion, + arith_cbz_fusion, + balance_fp_ops, + bti, + ccidx, + ccpp, + crc, + ccdp, + call_saved_x8, + call_saved_x9, + call_saved_x10, + call_saved_x11, + call_saved_x12, + call_saved_x13, + call_saved_x14, + call_saved_x15, + call_saved_x18, + complxnum, + crypto, + custom_cheap_as_move, + dit, + disable_latency_sched_heuristic, + dotprod, + exynos_cheap_as_move, + fmi, + fp16fml, + fp_armv8, + fptoint, + force_32bit_jump_tables, + fullfp16, + fuse_aes, + fuse_address, + fuse_arith_logic, + fuse_csel, + fuse_crypto_eor, + fuse_literals, + jsconv, + lor, + lse, + lsl_fast, + mpam, + mte, + neon, + nv, + no_neg_immediates, + pa, + pan, + pan_rwv, + perfmon, + use_postra_scheduler, + predres, + predictable_select_expensive, + uaops, + ras, + rasv8_4, + rcpc, + rcpc_immo, + rdm, + rand, + reserve_x1, + reserve_x2, + reserve_x3, + reserve_x4, + reserve_x5, + reserve_x6, + reserve_x7, + reserve_x9, + reserve_x10, + reserve_x11, + reserve_x12, + reserve_x13, + reserve_x14, + reserve_x15, + reserve_x18, + reserve_x20, + reserve_x21, + reserve_x22, + reserve_x23, + reserve_x24, + reserve_x25, + reserve_x26, + reserve_x27, + reserve_x28, + sb, + sel2, + sha2, + sha3, + sm4, + spe, + ssbs, + sve, + sve2, + sve2_aes, + sve2_bitperm, + sve2_sha3, + sve2_sm4, + slow_misaligned_128store, + slow_paired_128, + slow_strqro_store, + specrestrict, + strict_align, + tlb_rmi, + tracev84, + use_aa, + tpidr_el1, + tpidr_el2, + tpidr_el3, + use_reciprocal_square_root, + vh, + zcm, + zcz, + zcz_fp, + zcz_fp_workaround, + zcz_gp, +}; + +pub fn featureSet(features: []const Feature) Cpu.Feature.Set { + var x: Cpu.Feature.Set = 0; + for (features) |feature| { + x |= 1 << @enumToInt(feature); + } + return x; +} + +pub fn featureSetHas(set: Feature.Set, feature: Feature) bool { + return (set & (1 << @enumToInt(feature))) != 0; +} + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.aes)] = .{ + .index = @enumToInt(Feature.aes), + .name = @tagName(Feature.aes), + .llvm_name = "aes", + .description = "Enable AES support", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.am)] = .{ + .index = @enumToInt(Feature.am), + .name = @tagName(Feature.am), + .llvm_name = "am", + .description = "Enable v8.4-A Activity Monitors extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.aggressive_fma)] = .{ + .index = @enumToInt(Feature.aggressive_fma), + .name = @tagName(Feature.aggressive_fma), + .llvm_name = "aggressive-fma", + .description = "Enable Aggressive FMA for floating-point.", + .dependencies = 0, + }; + result[@enumToInt(Feature.altnzcv)] = .{ + .index = @enumToInt(Feature.altnzcv), + .name = @tagName(Feature.altnzcv), + .llvm_name = "altnzcv", + .description = "Enable alternative NZCV format for floating point comparisons", + .dependencies = 0, + }; + result[@enumToInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{ + .index = @enumToInt(Feature.alternate_sextload_cvt_f32_pattern), + .name = @tagName(Feature.alternate_sextload_cvt_f32_pattern), + .llvm_name = "alternate-sextload-cvt-f32-pattern", + .description = "Use alternative pattern for sextload convert to f32", + .dependencies = 0, + }; + result[@enumToInt(Feature.arith_bcc_fusion)] = .{ + .index = @enumToInt(Feature.arith_bcc_fusion), + .name = @tagName(Feature.arith_bcc_fusion), + .llvm_name = "arith-bcc-fusion", + .description = "CPU fuses arithmetic+bcc operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.arith_cbz_fusion)] = .{ + .index = @enumToInt(Feature.arith_cbz_fusion), + .name = @tagName(Feature.arith_cbz_fusion), + .llvm_name = "arith-cbz-fusion", + .description = "CPU fuses arithmetic + cbz/cbnz operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.balance_fp_ops)] = .{ + .index = @enumToInt(Feature.balance_fp_ops), + .name = @tagName(Feature.balance_fp_ops), + .llvm_name = "balance-fp-ops", + .description = "balance mix of odd and even D-registers for fp multiply(-accumulate) ops", + .dependencies = 0, + }; + result[@enumToInt(Feature.bti)] = .{ + .index = @enumToInt(Feature.bti), + .name = @tagName(Feature.bti), + .llvm_name = "bti", + .description = "Enable Branch Target Identification", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccidx)] = .{ + .index = @enumToInt(Feature.ccidx), + .name = @tagName(Feature.ccidx), + .llvm_name = "ccidx", + .description = "Enable v8.3-A Extend of the CCSIDR number of sets", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccpp)] = .{ + .index = @enumToInt(Feature.ccpp), + .name = @tagName(Feature.ccpp), + .llvm_name = "ccpp", + .description = "Enable v8.2 data Cache Clean to Point of Persistence", + .dependencies = 0, + }; + result[@enumToInt(Feature.crc)] = .{ + .index = @enumToInt(Feature.crc), + .name = @tagName(Feature.crc), + .llvm_name = "crc", + .description = "Enable ARMv8 CRC-32 checksum instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccdp)] = .{ + .index = @enumToInt(Feature.ccdp), + .name = @tagName(Feature.ccdp), + .llvm_name = "ccdp", + .description = "Enable v8.5 Cache Clean to Point of Deep Persistence", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x8)] = .{ + .index = @enumToInt(Feature.call_saved_x8), + .name = @tagName(Feature.call_saved_x8), + .llvm_name = "call-saved-x8", + .description = "Make X8 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x9)] = .{ + .index = @enumToInt(Feature.call_saved_x9), + .name = @tagName(Feature.call_saved_x9), + .llvm_name = "call-saved-x9", + .description = "Make X9 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x10)] = .{ + .index = @enumToInt(Feature.call_saved_x10), + .name = @tagName(Feature.call_saved_x10), + .llvm_name = "call-saved-x10", + .description = "Make X10 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x11)] = .{ + .index = @enumToInt(Feature.call_saved_x11), + .name = @tagName(Feature.call_saved_x11), + .llvm_name = "call-saved-x11", + .description = "Make X11 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x12)] = .{ + .index = @enumToInt(Feature.call_saved_x12), + .name = @tagName(Feature.call_saved_x12), + .llvm_name = "call-saved-x12", + .description = "Make X12 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x13)] = .{ + .index = @enumToInt(Feature.call_saved_x13), + .name = @tagName(Feature.call_saved_x13), + .llvm_name = "call-saved-x13", + .description = "Make X13 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x14)] = .{ + .index = @enumToInt(Feature.call_saved_x14), + .name = @tagName(Feature.call_saved_x14), + .llvm_name = "call-saved-x14", + .description = "Make X14 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x15)] = .{ + .index = @enumToInt(Feature.call_saved_x15), + .name = @tagName(Feature.call_saved_x15), + .llvm_name = "call-saved-x15", + .description = "Make X15 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x18)] = .{ + .index = @enumToInt(Feature.call_saved_x18), + .name = @tagName(Feature.call_saved_x18), + .llvm_name = "call-saved-x18", + .description = "Make X18 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.complxnum)] = .{ + .index = @enumToInt(Feature.complxnum), + .name = @tagName(Feature.complxnum), + .llvm_name = "complxnum", + .description = "Enable v8.3-A Floating-point complex number support", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.crypto)] = .{ + .index = @enumToInt(Feature.crypto), + .name = @tagName(Feature.crypto), + .llvm_name = "crypto", + .description = "Enable cryptographic instructions", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.custom_cheap_as_move)] = .{ + .index = @enumToInt(Feature.custom_cheap_as_move), + .name = @tagName(Feature.custom_cheap_as_move), + .llvm_name = "custom-cheap-as-move", + .description = "Use custom handling of cheap instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dit)] = .{ + .index = @enumToInt(Feature.dit), + .name = @tagName(Feature.dit), + .llvm_name = "dit", + .description = "Enable v8.4-A Data Independent Timing instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.disable_latency_sched_heuristic)] = .{ + .index = @enumToInt(Feature.disable_latency_sched_heuristic), + .name = @tagName(Feature.disable_latency_sched_heuristic), + .llvm_name = "disable-latency-sched-heuristic", + .description = "Disable latency scheduling heuristic", + .dependencies = 0, + }; + result[@enumToInt(Feature.dotprod)] = .{ + .index = @enumToInt(Feature.dotprod), + .name = @tagName(Feature.dotprod), + .llvm_name = "dotprod", + .description = "Enable dot product support", + .dependencies = 0, + }; + result[@enumToInt(Feature.exynos_cheap_as_move)] = .{ + .index = @enumToInt(Feature.exynos_cheap_as_move), + .name = @tagName(Feature.exynos_cheap_as_move), + .llvm_name = "exynos-cheap-as-move", + .description = "Use Exynos specific handling of cheap instructions", + .dependencies = featureSet(&[_]Feature{ + .custom_cheap_as_move, + }), + }; + result[@enumToInt(Feature.fmi)] = .{ + .index = @enumToInt(Feature.fmi), + .name = @tagName(Feature.fmi), + .llvm_name = "fmi", + .description = "Enable v8.4-A Flag Manipulation Instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp16fml)] = .{ + .index = @enumToInt(Feature.fp16fml), + .name = @tagName(Feature.fp16fml), + .llvm_name = "fp16fml", + .description = "Enable FP16 FML instructions", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.fp_armv8)] = .{ + .index = @enumToInt(Feature.fp_armv8), + .name = @tagName(Feature.fp_armv8), + .llvm_name = "fp-armv8", + .description = "Enable ARMv8 FP", + .dependencies = 0, + }; + result[@enumToInt(Feature.fptoint)] = .{ + .index = @enumToInt(Feature.fptoint), + .name = @tagName(Feature.fptoint), + .llvm_name = "fptoint", + .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int", + .dependencies = 0, + }; + result[@enumToInt(Feature.force_32bit_jump_tables)] = .{ + .index = @enumToInt(Feature.force_32bit_jump_tables), + .name = @tagName(Feature.force_32bit_jump_tables), + .llvm_name = "force-32bit-jump-tables", + .description = "Force jump table entries to be 32-bits wide except at MinSize", + .dependencies = 0, + }; + result[@enumToInt(Feature.fullfp16)] = .{ + .index = @enumToInt(Feature.fullfp16), + .name = @tagName(Feature.fullfp16), + .llvm_name = "fullfp16", + .description = "Full FP16", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.fuse_aes)] = .{ + .index = @enumToInt(Feature.fuse_aes), + .name = @tagName(Feature.fuse_aes), + .llvm_name = "fuse-aes", + .description = "CPU fuses AES crypto operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_address)] = .{ + .index = @enumToInt(Feature.fuse_address), + .name = @tagName(Feature.fuse_address), + .llvm_name = "fuse-address", + .description = "CPU fuses address generation and memory operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_arith_logic)] = .{ + .index = @enumToInt(Feature.fuse_arith_logic), + .name = @tagName(Feature.fuse_arith_logic), + .llvm_name = "fuse-arith-logic", + .description = "CPU fuses arithmetic and logic operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_csel)] = .{ + .index = @enumToInt(Feature.fuse_csel), + .name = @tagName(Feature.fuse_csel), + .llvm_name = "fuse-csel", + .description = "CPU fuses conditional select operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_crypto_eor)] = .{ + .index = @enumToInt(Feature.fuse_crypto_eor), + .name = @tagName(Feature.fuse_crypto_eor), + .llvm_name = "fuse-crypto-eor", + .description = "CPU fuses AES/PMULL and EOR operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_literals)] = .{ + .index = @enumToInt(Feature.fuse_literals), + .name = @tagName(Feature.fuse_literals), + .llvm_name = "fuse-literals", + .description = "CPU fuses literal generation operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.jsconv)] = .{ + .index = @enumToInt(Feature.jsconv), + .name = @tagName(Feature.jsconv), + .llvm_name = "jsconv", + .description = "Enable v8.3-A JavaScript FP conversion enchancement", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.lor)] = .{ + .index = @enumToInt(Feature.lor), + .name = @tagName(Feature.lor), + .llvm_name = "lor", + .description = "Enables ARM v8.1 Limited Ordering Regions extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.lse)] = .{ + .index = @enumToInt(Feature.lse), + .name = @tagName(Feature.lse), + .llvm_name = "lse", + .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.lsl_fast)] = .{ + .index = @enumToInt(Feature.lsl_fast), + .name = @tagName(Feature.lsl_fast), + .llvm_name = "lsl-fast", + .description = "CPU has a fastpath logical shift of up to 3 places", + .dependencies = 0, + }; + result[@enumToInt(Feature.mpam)] = .{ + .index = @enumToInt(Feature.mpam), + .name = @tagName(Feature.mpam), + .llvm_name = "mpam", + .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.mte)] = .{ + .index = @enumToInt(Feature.mte), + .name = @tagName(Feature.mte), + .llvm_name = "mte", + .description = "Enable Memory Tagging Extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.neon)] = .{ + .index = @enumToInt(Feature.neon), + .name = @tagName(Feature.neon), + .llvm_name = "neon", + .description = "Enable Advanced SIMD instructions", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.nv)] = .{ + .index = @enumToInt(Feature.nv), + .name = @tagName(Feature.nv), + .llvm_name = "nv", + .description = "Enable v8.4-A Nested Virtualization Enchancement", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_neg_immediates)] = .{ + .index = @enumToInt(Feature.no_neg_immediates), + .name = @tagName(Feature.no_neg_immediates), + .llvm_name = "no-neg-immediates", + .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", + .dependencies = 0, + }; + result[@enumToInt(Feature.pa)] = .{ + .index = @enumToInt(Feature.pa), + .name = @tagName(Feature.pa), + .llvm_name = "pa", + .description = "Enable v8.3-A Pointer Authentication enchancement", + .dependencies = 0, + }; + result[@enumToInt(Feature.pan)] = .{ + .index = @enumToInt(Feature.pan), + .name = @tagName(Feature.pan), + .llvm_name = "pan", + .description = "Enables ARM v8.1 Privileged Access-Never extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.pan_rwv)] = .{ + .index = @enumToInt(Feature.pan_rwv), + .name = @tagName(Feature.pan_rwv), + .llvm_name = "pan-rwv", + .description = "Enable v8.2 PAN s1e1R and s1e1W Variants", + .dependencies = featureSet(&[_]Feature{ + .pan, + }), + }; + result[@enumToInt(Feature.perfmon)] = .{ + .index = @enumToInt(Feature.perfmon), + .name = @tagName(Feature.perfmon), + .llvm_name = "perfmon", + .description = "Enable ARMv8 PMUv3 Performance Monitors extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_postra_scheduler)] = .{ + .index = @enumToInt(Feature.use_postra_scheduler), + .name = @tagName(Feature.use_postra_scheduler), + .llvm_name = "use-postra-scheduler", + .description = "Schedule again after register allocation", + .dependencies = 0, + }; + result[@enumToInt(Feature.predres)] = .{ + .index = @enumToInt(Feature.predres), + .name = @tagName(Feature.predres), + .llvm_name = "predres", + .description = "Enable v8.5a execution and data prediction invalidation instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.predictable_select_expensive)] = .{ + .index = @enumToInt(Feature.predictable_select_expensive), + .name = @tagName(Feature.predictable_select_expensive), + .llvm_name = "predictable-select-expensive", + .description = "Prefer likely predicted branches over selects", + .dependencies = 0, + }; + result[@enumToInt(Feature.uaops)] = .{ + .index = @enumToInt(Feature.uaops), + .name = @tagName(Feature.uaops), + .llvm_name = "uaops", + .description = "Enable v8.2 UAO PState", + .dependencies = 0, + }; + result[@enumToInt(Feature.ras)] = .{ + .index = @enumToInt(Feature.ras), + .name = @tagName(Feature.ras), + .llvm_name = "ras", + .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.rasv8_4)] = .{ + .index = @enumToInt(Feature.rasv8_4), + .name = @tagName(Feature.rasv8_4), + .llvm_name = "rasv8_4", + .description = "Enable v8.4-A Reliability, Availability and Serviceability extension", + .dependencies = featureSet(&[_]Feature{ + .ras, + }), + }; + result[@enumToInt(Feature.rcpc)] = .{ + .index = @enumToInt(Feature.rcpc), + .name = @tagName(Feature.rcpc), + .llvm_name = "rcpc", + .description = "Enable support for RCPC extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.rcpc_immo)] = .{ + .index = @enumToInt(Feature.rcpc_immo), + .name = @tagName(Feature.rcpc_immo), + .llvm_name = "rcpc-immo", + .description = "Enable v8.4-A RCPC instructions with Immediate Offsets", + .dependencies = featureSet(&[_]Feature{ + .rcpc, + }), + }; + result[@enumToInt(Feature.rdm)] = .{ + .index = @enumToInt(Feature.rdm), + .name = @tagName(Feature.rdm), + .llvm_name = "rdm", + .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.rand)] = .{ + .index = @enumToInt(Feature.rand), + .name = @tagName(Feature.rand), + .llvm_name = "rand", + .description = "Enable Random Number generation instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x1)] = .{ + .index = @enumToInt(Feature.reserve_x1), + .name = @tagName(Feature.reserve_x1), + .llvm_name = "reserve-x1", + .description = "Reserve X1, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x2)] = .{ + .index = @enumToInt(Feature.reserve_x2), + .name = @tagName(Feature.reserve_x2), + .llvm_name = "reserve-x2", + .description = "Reserve X2, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x3)] = .{ + .index = @enumToInt(Feature.reserve_x3), + .name = @tagName(Feature.reserve_x3), + .llvm_name = "reserve-x3", + .description = "Reserve X3, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x4)] = .{ + .index = @enumToInt(Feature.reserve_x4), + .name = @tagName(Feature.reserve_x4), + .llvm_name = "reserve-x4", + .description = "Reserve X4, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x5)] = .{ + .index = @enumToInt(Feature.reserve_x5), + .name = @tagName(Feature.reserve_x5), + .llvm_name = "reserve-x5", + .description = "Reserve X5, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x6)] = .{ + .index = @enumToInt(Feature.reserve_x6), + .name = @tagName(Feature.reserve_x6), + .llvm_name = "reserve-x6", + .description = "Reserve X6, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x7)] = .{ + .index = @enumToInt(Feature.reserve_x7), + .name = @tagName(Feature.reserve_x7), + .llvm_name = "reserve-x7", + .description = "Reserve X7, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x9)] = .{ + .index = @enumToInt(Feature.reserve_x9), + .name = @tagName(Feature.reserve_x9), + .llvm_name = "reserve-x9", + .description = "Reserve X9, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x10)] = .{ + .index = @enumToInt(Feature.reserve_x10), + .name = @tagName(Feature.reserve_x10), + .llvm_name = "reserve-x10", + .description = "Reserve X10, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x11)] = .{ + .index = @enumToInt(Feature.reserve_x11), + .name = @tagName(Feature.reserve_x11), + .llvm_name = "reserve-x11", + .description = "Reserve X11, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x12)] = .{ + .index = @enumToInt(Feature.reserve_x12), + .name = @tagName(Feature.reserve_x12), + .llvm_name = "reserve-x12", + .description = "Reserve X12, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x13)] = .{ + .index = @enumToInt(Feature.reserve_x13), + .name = @tagName(Feature.reserve_x13), + .llvm_name = "reserve-x13", + .description = "Reserve X13, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x14)] = .{ + .index = @enumToInt(Feature.reserve_x14), + .name = @tagName(Feature.reserve_x14), + .llvm_name = "reserve-x14", + .description = "Reserve X14, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x15)] = .{ + .index = @enumToInt(Feature.reserve_x15), + .name = @tagName(Feature.reserve_x15), + .llvm_name = "reserve-x15", + .description = "Reserve X15, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x18)] = .{ + .index = @enumToInt(Feature.reserve_x18), + .name = @tagName(Feature.reserve_x18), + .llvm_name = "reserve-x18", + .description = "Reserve X18, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x20)] = .{ + .index = @enumToInt(Feature.reserve_x20), + .name = @tagName(Feature.reserve_x20), + .llvm_name = "reserve-x20", + .description = "Reserve X20, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x21)] = .{ + .index = @enumToInt(Feature.reserve_x21), + .name = @tagName(Feature.reserve_x21), + .llvm_name = "reserve-x21", + .description = "Reserve X21, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x22)] = .{ + .index = @enumToInt(Feature.reserve_x22), + .name = @tagName(Feature.reserve_x22), + .llvm_name = "reserve-x22", + .description = "Reserve X22, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x23)] = .{ + .index = @enumToInt(Feature.reserve_x23), + .name = @tagName(Feature.reserve_x23), + .llvm_name = "reserve-x23", + .description = "Reserve X23, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x24)] = .{ + .index = @enumToInt(Feature.reserve_x24), + .name = @tagName(Feature.reserve_x24), + .llvm_name = "reserve-x24", + .description = "Reserve X24, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x25)] = .{ + .index = @enumToInt(Feature.reserve_x25), + .name = @tagName(Feature.reserve_x25), + .llvm_name = "reserve-x25", + .description = "Reserve X25, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x26)] = .{ + .index = @enumToInt(Feature.reserve_x26), + .name = @tagName(Feature.reserve_x26), + .llvm_name = "reserve-x26", + .description = "Reserve X26, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x27)] = .{ + .index = @enumToInt(Feature.reserve_x27), + .name = @tagName(Feature.reserve_x27), + .llvm_name = "reserve-x27", + .description = "Reserve X27, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x28)] = .{ + .index = @enumToInt(Feature.reserve_x28), + .name = @tagName(Feature.reserve_x28), + .llvm_name = "reserve-x28", + .description = "Reserve X28, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.sb)] = .{ + .index = @enumToInt(Feature.sb), + .name = @tagName(Feature.sb), + .llvm_name = "sb", + .description = "Enable v8.5 Speculation Barrier", + .dependencies = 0, + }; + result[@enumToInt(Feature.sel2)] = .{ + .index = @enumToInt(Feature.sel2), + .name = @tagName(Feature.sel2), + .llvm_name = "sel2", + .description = "Enable v8.4-A Secure Exception Level 2 extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sha2)] = .{ + .index = @enumToInt(Feature.sha2), + .name = @tagName(Feature.sha2), + .llvm_name = "sha2", + .description = "Enable SHA1 and SHA256 support", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.sha3)] = .{ + .index = @enumToInt(Feature.sha3), + .name = @tagName(Feature.sha3), + .llvm_name = "sha3", + .description = "Enable SHA512 and SHA3 support", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.sm4)] = .{ + .index = @enumToInt(Feature.sm4), + .name = @tagName(Feature.sm4), + .llvm_name = "sm4", + .description = "Enable SM3 and SM4 support", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8, + }), + }; + result[@enumToInt(Feature.spe)] = .{ + .index = @enumToInt(Feature.spe), + .name = @tagName(Feature.spe), + .llvm_name = "spe", + .description = "Enable Statistical Profiling extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.ssbs)] = .{ + .index = @enumToInt(Feature.ssbs), + .name = @tagName(Feature.ssbs), + .llvm_name = "ssbs", + .description = "Enable Speculative Store Bypass Safe bit", + .dependencies = 0, + }; + result[@enumToInt(Feature.sve)] = .{ + .index = @enumToInt(Feature.sve), + .name = @tagName(Feature.sve), + .llvm_name = "sve", + .description = "Enable Scalable Vector Extension (SVE) instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.sve2)] = .{ + .index = @enumToInt(Feature.sve2), + .name = @tagName(Feature.sve2), + .llvm_name = "sve2", + .description = "Enable Scalable Vector Extension 2 (SVE2) instructions", + .dependencies = featureSet(&[_]Feature{ + .sve, + }), + }; + result[@enumToInt(Feature.sve2_aes)] = .{ + .index = @enumToInt(Feature.sve2_aes), + .name = @tagName(Feature.sve2_aes), + .llvm_name = "sve2-aes", + .description = "Enable AES SVE2 instructions", + .dependencies = featureSet(&[_]Feature{ + .sve, + .fp_armv8, + }), + }; + result[@enumToInt(Feature.sve2_bitperm)] = .{ + .index = @enumToInt(Feature.sve2_bitperm), + .name = @tagName(Feature.sve2_bitperm), + .llvm_name = "sve2-bitperm", + .description = "Enable bit permutation SVE2 instructions", + .dependencies = featureSet(&[_]Feature{ + .sve, + }), + }; + result[@enumToInt(Feature.sve2_sha3)] = .{ + .index = @enumToInt(Feature.sve2_sha3), + .name = @tagName(Feature.sve2_sha3), + .llvm_name = "sve2-sha3", + .description = "Enable SHA3 SVE2 instructions", + .dependencies = featureSet(&[_]Feature{ + .sve, + .fp_armv8, + }), + }; + result[@enumToInt(Feature.sve2_sm4)] = .{ + .index = @enumToInt(Feature.sve2_sm4), + .name = @tagName(Feature.sve2_sm4), + .llvm_name = "sve2-sm4", + .description = "Enable SM4 SVE2 instructions", + .dependencies = featureSet(&[_]Feature{ + .sve, + .fp_armv8, + }), + }; + result[@enumToInt(Feature.slow_misaligned_128store)] = .{ + .index = @enumToInt(Feature.slow_misaligned_128store), + .name = @tagName(Feature.slow_misaligned_128store), + .llvm_name = "slow-misaligned-128store", + .description = "Misaligned 128 bit stores are slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_paired_128)] = .{ + .index = @enumToInt(Feature.slow_paired_128), + .name = @tagName(Feature.slow_paired_128), + .llvm_name = "slow-paired-128", + .description = "Paired 128 bit loads and stores are slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_strqro_store)] = .{ + .index = @enumToInt(Feature.slow_strqro_store), + .name = @tagName(Feature.slow_strqro_store), + .llvm_name = "slow-strqro-store", + .description = "STR of Q register with register offset is slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.specrestrict)] = .{ + .index = @enumToInt(Feature.specrestrict), + .name = @tagName(Feature.specrestrict), + .llvm_name = "specrestrict", + .description = "Enable architectural speculation restriction", + .dependencies = 0, + }; + result[@enumToInt(Feature.strict_align)] = .{ + .index = @enumToInt(Feature.strict_align), + .name = @tagName(Feature.strict_align), + .llvm_name = "strict-align", + .description = "Disallow all unaligned memory access", + .dependencies = 0, + }; + result[@enumToInt(Feature.tlb_rmi)] = .{ + .index = @enumToInt(Feature.tlb_rmi), + .name = @tagName(Feature.tlb_rmi), + .llvm_name = "tlb-rmi", + .description = "Enable v8.4-A TLB Range and Maintenance Instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.tracev84)] = .{ + .index = @enumToInt(Feature.tracev84), + .name = @tagName(Feature.tracev84), + .llvm_name = "tracev8.4", + .description = "Enable v8.4-A Trace extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_aa)] = .{ + .index = @enumToInt(Feature.use_aa), + .name = @tagName(Feature.use_aa), + .llvm_name = "use-aa", + .description = "Use alias analysis during codegen", + .dependencies = 0, + }; + result[@enumToInt(Feature.tpidr_el1)] = .{ + .index = @enumToInt(Feature.tpidr_el1), + .name = @tagName(Feature.tpidr_el1), + .llvm_name = "tpidr-el1", + .description = "Permit use of TPIDR_EL1 for the TLS base", + .dependencies = 0, + }; + result[@enumToInt(Feature.tpidr_el2)] = .{ + .index = @enumToInt(Feature.tpidr_el2), + .name = @tagName(Feature.tpidr_el2), + .llvm_name = "tpidr-el2", + .description = "Permit use of TPIDR_EL2 for the TLS base", + .dependencies = 0, + }; + result[@enumToInt(Feature.tpidr_el3)] = .{ + .index = @enumToInt(Feature.tpidr_el3), + .name = @tagName(Feature.tpidr_el3), + .llvm_name = "tpidr-el3", + .description = "Permit use of TPIDR_EL3 for the TLS base", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_reciprocal_square_root)] = .{ + .index = @enumToInt(Feature.use_reciprocal_square_root), + .name = @tagName(Feature.use_reciprocal_square_root), + .llvm_name = "use-reciprocal-square-root", + .description = "Use the reciprocal square root approximation", + .dependencies = 0, + }; + result[@enumToInt(Feature.vh)] = .{ + .index = @enumToInt(Feature.vh), + .name = @tagName(Feature.vh), + .llvm_name = "vh", + .description = "Enables ARM v8.1 Virtual Host extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.zcm)] = .{ + .index = @enumToInt(Feature.zcm), + .name = @tagName(Feature.zcm), + .llvm_name = "zcm", + .description = "Has zero-cycle register moves", + .dependencies = 0, + }; + result[@enumToInt(Feature.zcz)] = .{ + .index = @enumToInt(Feature.zcz), + .name = @tagName(Feature.zcz), + .llvm_name = "zcz", + .description = "Has zero-cycle zeroing instructions", + .dependencies = featureSet(&[_]Feature{ + .zcz_fp, + .zcz_gp, + }), + }; + result[@enumToInt(Feature.zcz_fp)] = .{ + .index = @enumToInt(Feature.zcz_fp), + .name = @tagName(Feature.zcz_fp), + .llvm_name = "zcz-fp", + .description = "Has zero-cycle zeroing instructions for FP registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.zcz_fp_workaround)] = .{ + .index = @enumToInt(Feature.zcz_fp_workaround), + .name = @tagName(Feature.zcz_fp_workaround), + .llvm_name = "zcz-fp-workaround", + .description = "The zero-cycle floating-point zeroing instruction has a bug", + .dependencies = 0, + }; + result[@enumToInt(Feature.zcz_gp)] = .{ + .index = @enumToInt(Feature.zcz_gp), + .name = @tagName(Feature.zcz_gp), + .llvm_name = "zcz-gp", + .description = "Has zero-cycle zeroing instructions for generic registers", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const apple_latest = Cpu{ + .name = "apple_latest", + .llvm_name = "apple-latest", + .features = featureSet(&[_]Feature{ + .arith_cbz_fusion, + .zcz_fp_workaround, + .alternate_sextload_cvt_f32_pattern, + .fuse_crypto_eor, + .zcm, + .zcz_gp, + .perfmon, + .disable_latency_sched_heuristic, + .fp_armv8, + .zcz_fp, + .arith_bcc_fusion, + .fuse_aes, + }), + }; + + pub const cortex_a35 = Cpu{ + .name = "cortex_a35", + .llvm_name = "cortex-a35", + .features = featureSet(&[_]Feature{ + .perfmon, + .fp_armv8, + .crc, + }), + }; + + pub const cortex_a53 = Cpu{ + .name = "cortex_a53", + .llvm_name = "cortex-a53", + .features = featureSet(&[_]Feature{ + .custom_cheap_as_move, + .crc, + .perfmon, + .use_aa, + .fp_armv8, + .fuse_aes, + .balance_fp_ops, + .use_postra_scheduler, + }), + }; + + pub const cortex_a55 = Cpu{ + .name = "cortex_a55", + .llvm_name = "cortex-a55", + .features = featureSet(&[_]Feature{ + .ccpp, + .rcpc, + .uaops, + .rdm, + .ras, + .lse, + .crc, + .perfmon, + .fp_armv8, + .vh, + .fuse_aes, + .lor, + .dotprod, + .pan, + }), + }; + + pub const cortex_a57 = Cpu{ + .name = "cortex_a57", + .llvm_name = "cortex-a57", + .features = featureSet(&[_]Feature{ + .fuse_literals, + .predictable_select_expensive, + .custom_cheap_as_move, + .crc, + .perfmon, + .fp_armv8, + .fuse_aes, + .balance_fp_ops, + .use_postra_scheduler, + }), + }; + + pub const cortex_a72 = Cpu{ + .name = "cortex_a72", + .llvm_name = "cortex-a72", + .features = featureSet(&[_]Feature{ + .fuse_aes, + .fp_armv8, + .perfmon, + .crc, + }), + }; + + pub const cortex_a73 = Cpu{ + .name = "cortex_a73", + .llvm_name = "cortex-a73", + .features = featureSet(&[_]Feature{ + .fuse_aes, + .fp_armv8, + .perfmon, + .crc, + }), + }; + + pub const cortex_a75 = Cpu{ + .name = "cortex_a75", + .llvm_name = "cortex-a75", + .features = featureSet(&[_]Feature{ + .ccpp, + .rcpc, + .uaops, + .rdm, + .ras, + .lse, + .crc, + .perfmon, + .fp_armv8, + .vh, + .fuse_aes, + .lor, + .dotprod, + .pan, + }), + }; + + pub const cortex_a76 = Cpu{ + .name = "cortex_a76", + .llvm_name = "cortex-a76", + .features = featureSet(&[_]Feature{ + .ccpp, + .rcpc, + .uaops, + .rdm, + .ras, + .lse, + .crc, + .fp_armv8, + .vh, + .lor, + .ssbs, + .dotprod, + .pan, + }), + }; + + pub const cortex_a76ae = Cpu{ + .name = "cortex_a76ae", + .llvm_name = "cortex-a76ae", + .features = featureSet(&[_]Feature{ + .ccpp, + .rcpc, + .uaops, + .rdm, + .ras, + .lse, + .crc, + .fp_armv8, + .vh, + .lor, + .ssbs, + .dotprod, + .pan, + }), + }; + + pub const cyclone = Cpu{ + .name = "cyclone", + .llvm_name = "cyclone", + .features = featureSet(&[_]Feature{ + .arith_cbz_fusion, + .zcz_fp_workaround, + .alternate_sextload_cvt_f32_pattern, + .fuse_crypto_eor, + .zcm, + .zcz_gp, + .perfmon, + .disable_latency_sched_heuristic, + .fp_armv8, + .zcz_fp, + .arith_bcc_fusion, + .fuse_aes, + }), + }; + + pub const exynos_m1 = Cpu{ + .name = "exynos_m1", + .llvm_name = "exynos-m1", + .features = featureSet(&[_]Feature{ + .custom_cheap_as_move, + .crc, + .force_32bit_jump_tables, + .perfmon, + .slow_misaligned_128store, + .use_reciprocal_square_root, + .fp_armv8, + .zcz_fp, + .fuse_aes, + .slow_paired_128, + .use_postra_scheduler, + }), + }; + + pub const exynos_m2 = Cpu{ + .name = "exynos_m2", + .llvm_name = "exynos-m2", + .features = featureSet(&[_]Feature{ + .custom_cheap_as_move, + .crc, + .force_32bit_jump_tables, + .perfmon, + .slow_misaligned_128store, + .fp_armv8, + .zcz_fp, + .fuse_aes, + .slow_paired_128, + .use_postra_scheduler, + }), + }; + + pub const exynos_m3 = Cpu{ + .name = "exynos_m3", + .llvm_name = "exynos-m3", + .features = featureSet(&[_]Feature{ + .fuse_literals, + .predictable_select_expensive, + .custom_cheap_as_move, + .crc, + .force_32bit_jump_tables, + .fuse_address, + .fuse_csel, + .perfmon, + .fp_armv8, + .zcz_fp, + .fuse_aes, + .lsl_fast, + .use_postra_scheduler, + }), + }; + + pub const exynos_m4 = Cpu{ + .name = "exynos_m4", + .llvm_name = "exynos-m4", + .features = featureSet(&[_]Feature{ + .arith_cbz_fusion, + .custom_cheap_as_move, + .lse, + .zcz_fp, + .lsl_fast, + .lor, + .fuse_literals, + .ccpp, + .ras, + .fp_armv8, + .fuse_aes, + .pan, + .fuse_arith_logic, + .crc, + .force_32bit_jump_tables, + .fuse_address, + .fuse_csel, + .arith_bcc_fusion, + .uaops, + .rdm, + .zcz_gp, + .perfmon, + .vh, + .use_postra_scheduler, + .dotprod, + }), + }; + + pub const exynos_m5 = Cpu{ + .name = "exynos_m5", + .llvm_name = "exynos-m5", + .features = featureSet(&[_]Feature{ + .arith_cbz_fusion, + .custom_cheap_as_move, + .lse, + .zcz_fp, + .lsl_fast, + .lor, + .fuse_literals, + .ccpp, + .ras, + .fp_armv8, + .fuse_aes, + .pan, + .fuse_arith_logic, + .crc, + .force_32bit_jump_tables, + .fuse_address, + .fuse_csel, + .arith_bcc_fusion, + .uaops, + .rdm, + .zcz_gp, + .perfmon, + .vh, + .use_postra_scheduler, + .dotprod, + }), + }; + + pub const falkor = Cpu{ + .name = "falkor", + .llvm_name = "falkor", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .custom_cheap_as_move, + .rdm, + .slow_strqro_store, + .zcz_gp, + .crc, + .perfmon, + .fp_armv8, + .zcz_fp, + .lsl_fast, + .use_postra_scheduler, + }), + }; + + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = featureSet(&[_]Feature{ + .fp_armv8, + .fuse_aes, + .neon, + .perfmon, + .use_postra_scheduler, + }), + }; + + pub const kryo = Cpu{ + .name = "kryo", + .llvm_name = "kryo", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .custom_cheap_as_move, + .zcz_gp, + .crc, + .perfmon, + .fp_armv8, + .zcz_fp, + .lsl_fast, + .use_postra_scheduler, + }), + }; + + pub const saphira = Cpu{ + .name = "saphira", + .llvm_name = "saphira", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .custom_cheap_as_move, + .fmi, + .lse, + .zcz_fp, + .lsl_fast, + .lor, + .dit, + .pa, + .ccpp, + .sel2, + .ras, + .fp_armv8, + .ccidx, + .pan, + .rcpc, + .crc, + .tracev84, + .mpam, + .am, + .nv, + .tlb_rmi, + .uaops, + .rdm, + .zcz_gp, + .perfmon, + .vh, + .use_postra_scheduler, + .dotprod, + .spe, + }), + }; + + pub const thunderx = Cpu{ + .name = "thunderx", + .llvm_name = "thunderx", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .crc, + .perfmon, + .fp_armv8, + .use_postra_scheduler, + }), + }; + + pub const thunderx2t99 = Cpu{ + .name = "thunderx2t99", + .llvm_name = "thunderx2t99", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .aggressive_fma, + .rdm, + .lse, + .crc, + .fp_armv8, + .vh, + .arith_bcc_fusion, + .lor, + .use_postra_scheduler, + .pan, + }), + }; + + pub const thunderxt81 = Cpu{ + .name = "thunderxt81", + .llvm_name = "thunderxt81", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .crc, + .perfmon, + .fp_armv8, + .use_postra_scheduler, + }), + }; + + pub const thunderxt83 = Cpu{ + .name = "thunderxt83", + .llvm_name = "thunderxt83", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .crc, + .perfmon, + .fp_armv8, + .use_postra_scheduler, + }), + }; + + pub const thunderxt88 = Cpu{ + .name = "thunderxt88", + .llvm_name = "thunderxt88", + .features = featureSet(&[_]Feature{ + .predictable_select_expensive, + .crc, + .perfmon, + .fp_armv8, + .use_postra_scheduler, + }), + }; + + pub const tsv110 = Cpu{ + .name = "tsv110", + .llvm_name = "tsv110", + .features = featureSet(&[_]Feature{ + .ccpp, + .custom_cheap_as_move, + .uaops, + .rdm, + .ras, + .lse, + .crc, + .perfmon, + .fp_armv8, + .vh, + .fuse_aes, + .lor, + .use_postra_scheduler, + .dotprod, + .pan, + .spe, + }), + }; +}; + +/// 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{ + &cpu.apple_latest, + &cpu.cortex_a35, + &cpu.cortex_a53, + &cpu.cortex_a55, + &cpu.cortex_a57, + &cpu.cortex_a72, + &cpu.cortex_a73, + &cpu.cortex_a75, + &cpu.cortex_a76, + &cpu.cortex_a76ae, + &cpu.cyclone, + &cpu.exynos_m1, + &cpu.exynos_m2, + &cpu.exynos_m3, + &cpu.exynos_m4, + &cpu.exynos_m5, + &cpu.falkor, + &cpu.generic, + &cpu.kryo, + &cpu.saphira, + &cpu.thunderx, + &cpu.thunderx2t99, + &cpu.thunderxt81, + &cpu.thunderxt83, + &cpu.thunderxt88, + &cpu.tsv110, }; diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 9b6ae2548b..952c752561 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -81,6 +81,9 @@ const Error = extern enum { OperationAborted, BrokenPipe, NoSpaceLeft, + NotLazy, + IsAsync, + ImportOutsidePkgPath, }; const FILE = std.c.FILE; @@ -150,7 +153,7 @@ fn fmtMain(argc: c_int, argv: [*]const [*:0]const u8) !void { const argc_usize = @intCast(usize, argc); var arg_i: usize = 0; while (arg_i < argc_usize) : (arg_i += 1) { - try args_list.append(std.mem.toSliceConst(u8, argv[arg_i])); + try args_list.append(mem.toSliceConst(u8, argv[arg_i])); } stdout = &std.io.getStdOut().outStream().stream; @@ -532,7 +535,7 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz // ABI warning export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { - std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); + std.debug.warn("Failed to list features: {}\n", .{@errorName(err)}); }; } @@ -540,11 +543,11 @@ fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { - std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{ arch_name }); + std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name}); return; }; - try stdout_stream.print("Available features for {}:\n", .{ @tagName(arch) }); + try stdout_stream.print("Available features for {}:\n", .{@tagName(arch)}); const features = std.target.getFeaturesForArch(arch); @@ -556,18 +559,18 @@ fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void { } for (features) |feature| { - try stdout_stream.print(" {}", .{ feature.name }); - + try stdout_stream.print(" {}", .{feature.name}); + var i: usize = 0; while (i < longest_len - feature.name.len) : (i += 1) { - try stdout_stream.write(" "); + try stdout_stream.write(" "); } - try stdout_stream.print(" - {}\n", .{ feature.description }); + try stdout_stream.print(" - {}\n", .{feature.description}); if (show_dependencies and feature.dependencies.len > 0) { for (feature.dependencies) |dependency| { - try stdout_stream.print(" {}\n", .{ dependency.name }); + try stdout_stream.print(" {}\n", .{dependency.name}); } } } @@ -576,7 +579,7 @@ fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void { // ABI warning export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { printCpusForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { - std.debug.warn("Failed to list features: {}\n", .{ @errorName(err) }); + std.debug.warn("Failed to list features: {}\n", .{@errorName(err)}); }; } @@ -584,13 +587,13 @@ fn printCpusForArch(arch_name: []const u8, show_dependencies: bool) !void { const stdout_stream = &std.io.getStdOut().outStream().stream; const arch = Target.parseArchTag(arch_name) catch { - std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{ arch_name }); + std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name}); return; }; const cpus = std.target.getCpusForArch(arch); - try stdout_stream.print("Available cpus for {}:\n", .{ @tagName(arch) }); + try stdout_stream.print("Available cpus for {}:\n", .{@tagName(arch)}); var longest_len: usize = 0; for (cpus) |cpu| { @@ -600,78 +603,97 @@ fn printCpusForArch(arch_name: []const u8, show_dependencies: bool) !void { } for (cpus) |cpu| { - try stdout_stream.print(" {}", .{ cpu.name }); - + try stdout_stream.print(" {}", .{cpu.name}); + var i: usize = 0; while (i < longest_len - cpu.name.len) : (i += 1) { - try stdout_stream.write(" "); + try stdout_stream.write(" "); } try stdout_stream.write("\n"); if (show_dependencies and cpu.dependencies.len > 0) { for (cpu.dependencies) |dependency| { - try stdout_stream.print(" {}\n", .{ dependency.name }); + try stdout_stream.print(" {}\n", .{dependency.name}); } } } } -const null_terminated_empty_string = (&[_]u8 { 0 })[0..0 :0]; - -fn toNullTerminatedStringAlloc(allocator: *std.mem.Allocator, str: []const u8) ![:0]const u8 { - var buffer = try std.Buffer.init(allocator, str); - - const len = buffer.len(); - - // Don't deinit since we steal all the buffer's memory here. - return buffer.list.toOwnedSlice()[0..len :0]; -} +const Stage2CpuFeatures = struct { + allocator: *mem.Allocator, + cpu_features: Target.CpuFeatures, -const Stage2TargetDetails = struct { - allocator: *std.mem.Allocator, - target_details: std.target.TargetDetails, - - llvm_cpu_str: [:0]const u8, - llvm_features_str: [:0]const u8, + llvm_cpu_name: ?[:0]const u8, + llvm_features_str: ?[:0]const u8, builtin_str: [:0]const u8, + cache_hash: [:0]const u8, const Self = @This(); - fn initCpu(allocator: *std.mem.Allocator, arch: @TagType(std.Target.Arch), cpu: *const std.target.Cpu) !Self { - var builtin_str_buffer = try std.Buffer.init( - allocator, - "@import(\"std\").target.TargetDetails{.cpu=&@import(\"std\").target."); + fn initBaseline(allocator: *mem.Allocator) !Self { + const builtin_str = try std.fmt.allocPrint0(allocator, "CpuFeatures.baseline;\n"); + errdefer allocator.free(builtin_str); + + const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n"); + errdefer allocator.free(cache_hash); + + return Self{ + .allocator = allocator, + .cpu_features = .{ .cpu = cpu }, + .llvm_cpu_name = null, + .llvm_features_str = null, + .builtin_str = builtin_str, + .cache_hash = cache_hash, + }; + } - try builtin_str_buffer.append(@tagName(arch)); - try builtin_str_buffer.append(".cpu_"); - try builtin_str_buffer.append(cpu.name); - try builtin_str_buffer.append("};"); + fn initCpu(allocator: *mem.Allocator, arch: Target.Arch, cpu: *const Target.Cpu) !Self { + const builtin_str = try std.fmt.allocPrint0( + allocator, + "CpuFeatures{{ .cpu = &Arch.{}.cpu.{} }};\n", + arch.genericName(), + cpu.name, + ); + errdefer allocator.free(builtin_str); - const cpu_string = cpu.llvm_name orelse ""; + const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", cpu.name, cpu.features); + errdefer allocator.free(cache_hash); return Self{ .allocator = allocator, - .target_details = .{ - .cpu = cpu, - }, - .llvm_cpu_str = try toNullTerminatedStringAlloc(allocator, cpu_string), - .llvm_features_str = null_terminated_empty_string, - .builtin_str = builtin_str_buffer.toSliceConst(), + .cpu_features = .{ .cpu = cpu }, + .llvm_cpu_name = cpu.llvm_name, + .llvm_features_str = null, + .builtin_str = builtin_str, + .cache_hash = cache_hash, }; } - fn initFeatures(allocator: *std.mem.Allocator, arch: @TagType(std.Target.Arch), features: []*const std.target.Feature) !Self { - var builtin_str_buffer = try std.Buffer.init( - allocator, - "@import(\"std\").target.TargetDetails{.features=&[_]*const @import(\"std\").target.Feature{\n"); + fn initFeatures( + allocator: *mem.Allocator, + arch: Target.Arch, + features: Target.Cpu.Feature.Set, + ) !Self { + const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", features); + errdefer allocator.free(cache_hash); + + const generic_arch_name = arch.genericName(); + var builtin_str_buffer = try std.Buffer.allocPrint( + allocator, + "CpuFeatures{{ .features = Arch.{}.featureSet(&[_]Arch.{}.Feature{{\n", + generic_arch_name, + generic_arch_name, + ); + defer builtin_str_buffer.deinit(); var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); + defer llvm_features_buffer.deinit(); // First, disable all features. // This way, we only get the ones the user requests. - for (std.target.getFeaturesForArch(arch)) |feature| { + for (arch.allFeatures()) |feature| { if (feature.llvm_name) |llvm_name| { try llvm_features_buffer.append("-"); try llvm_features_buffer.append(llvm_name); @@ -684,232 +706,117 @@ const Stage2TargetDetails = struct { try llvm_features_buffer.append("+"); try llvm_features_buffer.append(llvm_name); try llvm_features_buffer.append(","); - - try builtin_str_buffer.append("&@import(\"std\").target."); - try builtin_str_buffer.append(@tagName(arch)); - try builtin_str_buffer.append(".feature_"); - try builtin_str_buffer.append(feature.name); - try builtin_str_buffer.append(","); } + + try builtin_str_buffer.append(" ."); + try builtin_str_buffer.append(feature.name); + try builtin_str_buffer.append(",\n"); } - try builtin_str_buffer.append("}};"); + if (mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")) { + llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); + } + + try builtin_str_buffer.append("})};\n"); return Self{ .allocator = allocator, - .target_details = std.target.TargetDetails{ - .features = features, - }, - .llvm_cpu_str = null_terminated_empty_string, - .llvm_features_str = llvm_features_buffer.toSliceConst(), - .builtin_str = builtin_str_buffer.toSliceConst(), + .cpu_features = .{ .features = features }, + .llvm_cpu_name = null, + .llvm_features_str = llvm_features_buffer.toOwnedSlice(), + .builtin_str = builtin_str_buffer.toOwnedSlice(), + .cache_hash = cache_hash, }; } -}; -// ABI warning -export fn stage2_target_details_parse_cpu(arch_str: ?[*:0]const u8, cpu_str: ?[*:0]const u8) ?*Stage2TargetDetails { - if (cpu_str == null) return null; - if (arch_str == null) return null; - - const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch { - return null; - }; - return parseCpu(arch, std.mem.toSliceConst(u8, cpu_str.?)) catch |err| { - switch (err) { - error.OutOfMemory => @panic("out of memory"), - else => return null, - } - }; -} + fn deinit(self: *Self) void { + self.allocator.free(self.cache_hash); + self.allocator.free(self.builtin_str); + if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str); + self.* = undefined; + } +}; // ABI warning -export fn stage2_target_details_parse_features(arch_str: ?[*:0]const u8, features_str: ?[*:0]const u8) ?*Stage2TargetDetails { - if (features_str == null) return null; - if (arch_str == null) return null; - - const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch return null; - return parseFeatures(arch, std.mem.toSliceConst(u8, features_str.?)) catch |err| { - switch (err) { - error.OutOfMemory => @panic("out of memory"), - else => return null, - } +export fn stage2_cpu_features_parse_cpu(arch_name: [*:0]const u8, cpu_name: [*:0]const u8) *Stage2CpuFeatures { + return parseCpu(arch_name, cpu_name) catch |err| switch (err) { + error.OutOfMemory => @panic("out of memory"), }; } -fn parseCpu(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDetails { - const allocator = std.heap.c_allocator; +fn parseCpu(arch_name: [*:0]const u8, cpu_name: [*:0]const u8) !*Stage2CpuFeatures { + const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); + const cpu = try arch.parseCpu(mem.toSliceConst(u8, cpu_name)); - const cpus = std.target.getCpusForArch(arch); - - for (cpus) |cpu| { - if (std.mem.eql(u8, str, cpu.name)) { - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = try Stage2TargetDetails.initCpu(std.heap.c_allocator, arch, cpu); + const ptr = try allocator.create(Stage2CpuFeatures); + errdefer std.heap.c_allocator.destroy(ptr); - return ptr; - } - } + ptr.* = try Stage2CpuFeatures.initCpu(std.heap.c_allocator, arch, cpu); + errdefer ptr.deinit(); - return error.InvalidCpu; + return ptr; } -fn parseFeatures(arch: @TagType(std.Target.Arch), str: []const u8) !*Stage2TargetDetails { - const allocator = std.heap.c_allocator; - - const known_features = std.target.getFeaturesForArch(arch); - - var features = std.ArrayList(*const std.target.Feature).init(allocator); - defer features.deinit(); - - var start: usize = 0; - while (start < str.len) { - const next_comma_pos = std.mem.indexOfScalar(u8, str[start..], ',') orelse str.len - start; - const feature_str = std.mem.trim(u8, str[start..start+next_comma_pos], " "); - - start += next_comma_pos + 1; - - if (feature_str.len == 0) continue; - - var feature: ?*const std.target.Feature = null; - for (known_features) |known_feature| { - if (std.mem.eql(u8, feature_str, known_feature.name)) { - feature = known_feature; - break; - } - } - - if (feature) |f| { - features.append(f) catch @panic("out of memory"); +// ABI warning +export fn stage2_cpu_features_parse_features( + arch_name: [*:0]const u8, + features_text: [*:0]const u8, +) *Stage2CpuFeatures { + return parseFeatures(arch_name, features_text) catch |err| switch (err) { + error.OutOfMemory => @panic("out of memory"), + }; +} - } else { - return error.InvalidFeature; - } - } +fn parseFeatures(arch_name: [*:0]const u8, features_text: [*:0]const u8) !*Stage2CpuFeatures { + const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); + const set = try arch.parseCpuFeatureSet(mem.toSliceConst(u8, features_text)); - const features_slice = features.toOwnedSlice(); + const ptr = try std.heap.c_allocator.create(Stage2CpuFeatures); + errdefer std.heap.c_allocator.destroy(ptr); - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, features_slice); + ptr.* = try Stage2CpuFeatures.initFeatures(std.heap.c_allocator, arch, set); + errdefer ptr.deinit(); return ptr; } // ABI warning -export fn stage2_target_details_get_cache_str(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { - if (target_details) |td| { - return @as([*:0]const u8, switch (td.target_details) { - .cpu => td.llvm_cpu_str, - .features => td.llvm_features_str, - }); - } - - return @as([*:0]const u8, null_terminated_empty_string); -} +export fn stage2_cpu_features_baseline() *Stage2CpuFeatures { + const ptr = try std.heap.c_allocator.create(Stage2CpuFeatures); + errdefer std.heap.c_allocator.destroy(ptr); -// ABI warning -export fn stage2_target_details_get_llvm_cpu(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { - if (target_details) |td| { - return @as([*:0]const u8, td.llvm_cpu_str); - } + ptr.* = try Stage2CpuFeatures.initBaseline(std.heap.c_allocator); + errdefer ptr.deinit(); - return @as([*:0]const u8, null_terminated_empty_string); + return ptr; } // ABI warning -export fn stage2_target_details_get_llvm_features(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { - if (target_details) |td| { - return @as([*:0]const u8, td.llvm_features_str); - } - - return @as([*:0]const u8, null_terminated_empty_string); +export fn stage2_cpu_features_get_cache_hash( + cpu_features: *const Stage2CpuFeatures, + ptr: *[*:0]const u8, + len: *usize, +) void { + ptr.* = cpu_features.cache_hash.ptr; + len.* = cpu_features.cache_hash.len; } // ABI warning -export fn stage2_target_details_get_builtin_str(target_details: ?*const Stage2TargetDetails) [*:0]const u8 { - if (target_details) |td| { - return @as([*:0]const u8, td.builtin_str); - } - - return @as([*:0]const u8, null_terminated_empty_string); +export fn stage2_cpu_features_get_builtin_str( + cpu_features: *const Stage2CpuFeatures, + ptr: *[*:0]const u8, + len: *usize, +) void { + ptr.* = cpu_features.builtin_str.ptr; + len.* = cpu_features.builtin_str.len; } -const riscv32_default_features: []*const std.target.Feature = &[_]*const std.target.Feature { - &std.target.riscv.feature_a, - &std.target.riscv.feature_c, - &std.target.riscv.feature_d, - &std.target.riscv.feature_f, - &std.target.riscv.feature_m, - &std.target.riscv.feature_relax, -}; - -const riscv64_default_features: []*const std.target.Feature = &[_]*const std.target.Feature { - &std.target.riscv.feature_bit64, - &std.target.riscv.feature_a, - &std.target.riscv.feature_c, - &std.target.riscv.feature_d, - &std.target.riscv.feature_f, - &std.target.riscv.feature_m, - &std.target.riscv.feature_relax, -}; - -const i386_default_features: []*const std.target.Feature = &[_]*const std.target.Feature { - &std.target.x86.feature_cmov, - &std.target.x86.feature_cx8, - &std.target.x86.feature_fxsr, - &std.target.x86.feature_mmx, - &std.target.x86.feature_nopl, - &std.target.x86.feature_sse, - &std.target.x86.feature_sse2, - &std.target.x86.feature_slowUnalignedMem16, - &std.target.x86.feature_x87, -}; - -// Same as above but without sse. -const i386_default_features_freestanding: []*const std.target.Feature = &[_]*const std.target.Feature { - &std.target.x86.feature_cmov, - &std.target.x86.feature_cx8, - &std.target.x86.feature_fxsr, - &std.target.x86.feature_mmx, - &std.target.x86.feature_nopl, - &std.target.x86.feature_slowUnalignedMem16, - &std.target.x86.feature_x87, -}; - // ABI warning -export fn stage2_target_details_get_default(arch_str: ?[*:0]const u8, os_str: ?[*:0]const u8) ?*Stage2TargetDetails { - if (arch_str == null) return null; - if (os_str == null) return null; - - const arch = Target.parseArchTag(std.mem.toSliceConst(u8, arch_str.?)) catch return null; - const os = Target.parseOs(std.mem.toSliceConst(u8, os_str.?)) catch return null; - - return createDefaultTargetDetails(arch, os) catch return null; +export fn stage2_cpu_features_get_llvm_cpu(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 { + return cpu_features.llvm_cpu_name; } -fn createDefaultTargetDetails(arch: @TagType(std.Target.Arch), os: std.Target.Os) !?*Stage2TargetDetails { - const allocator = std.heap.c_allocator; - - return switch (arch) { - .riscv32 => blk: { - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, riscv32_default_features); - break :blk ptr; - }, - .riscv64 => blk: { - const ptr = try allocator.create(Stage2TargetDetails); - ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, riscv64_default_features); - break :blk ptr; - }, - .i386 => blk: { - const ptr = try allocator.create(Stage2TargetDetails); - const features = switch (os) { - .freestanding => i386_default_features_freestanding, - else => i386_default_features, - }; - ptr.* = try Stage2TargetDetails.initFeatures(allocator, arch, features); - break :blk ptr; - }, - else => null, - }; +// ABI warning +export fn stage2_cpu_features_get_llvm_features(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 { + return cpu_features.llvm_features_str; } diff --git a/src/all_types.hpp b/src/all_types.hpp index d81e401232..df52c29a4e 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2215,8 +2215,6 @@ struct CodeGen { const char **clang_argv; size_t clang_argv_len; - - Stage2TargetDetails *target_details; }; struct ZigVar { diff --git a/src/codegen.cpp b/src/codegen.cpp index b2cae32fa6..9cbd5fc6ab 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8573,6 +8573,17 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { buf_appendf(contents, "pub const os = Os.%s;\n", cur_os); buf_appendf(contents, "pub const arch = %s;\n", cur_arch); buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi); + { + buf_append_str(contents, "pub const cpu_features: CpuFeatures = "); + if (g->zig_target->cpu_features != nullptr) { + const char *ptr; + size_t len; + stage2_cpu_features_get_builtin_str(g->zig_target->cpu_features, &ptr, &len); + buf_append_mem(contents, ptr, len); + } else { + buf_append_str(contents, ".baseline;\n"); + } + } if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) { buf_appendf(contents, "pub const glibc_version: ?Version = Version{.major = %d, .minor = %d, .patch = %d};\n", @@ -8602,14 +8613,6 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { "pub var test_functions: []TestFn = undefined; // overwritten later\n" ); } - - buf_appendf(contents, "pub const target_details: ?@import(\"std\").target.TargetDetails = "); - if (g->target_details) { - buf_appendf(contents, "%s", stage2_target_details_get_builtin_str(g->target_details)); - } else { - buf_appendf(contents, "null;"); - } - buf_appendf(contents, "\n"); return contents; } @@ -8648,6 +8651,12 @@ static Error define_builtin_compile_vars(CodeGen *g) { cache_int(&cache_hash, g->zig_target->vendor); cache_int(&cache_hash, g->zig_target->os); cache_int(&cache_hash, g->zig_target->abi); + if (g->zig_target->cpu_features != nullptr) { + const char *ptr; + size_t len; + stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len); + cache_str(&cache_hash, ptr); + } if (g->zig_target->glibc_version != nullptr) { cache_int(&cache_hash, g->zig_target->glibc_version->major); cache_int(&cache_hash, g->zig_target->glibc_version->minor); @@ -8659,10 +8668,6 @@ static Error define_builtin_compile_vars(CodeGen *g) { cache_bool(&cache_hash, g->link_eh_frame_hdr); cache_int(&cache_hash, detect_subsystem(g)); - if (g->target_details) { - cache_str(&cache_hash, stage2_target_details_get_cache_str(g->target_details)); - } - Buf digest = BUF_INIT; buf_resize(&digest, 0); if ((err = cache_hit(&cache_hash, &digest))) { @@ -8793,9 +8798,9 @@ static void init(CodeGen *g) { } // Override CPU and features if defined by user. - if (g->target_details) { - target_specific_cpu_args = stage2_target_details_get_llvm_cpu(g->target_details); - target_specific_features = stage2_target_details_get_llvm_features(g->target_details); + if (g->zig_target->cpu_features != nullptr) { + target_specific_cpu_args = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features); + target_specific_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features); } g->target_machine = ZigLLVMCreateTargetMachine(target_ref, buf_ptr(&g->llvm_triple_str), @@ -9123,15 +9128,19 @@ void add_cc_args(CodeGen *g, ZigList &args, const char *out_dep_pa args.append("-target"); args.append(buf_ptr(&g->llvm_triple_str)); - if (g->target_details) { + const char *llvm_cpu = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features); + if (llvm_cpu != nullptr) { args.append("-Xclang"); args.append("-target-cpu"); args.append("-Xclang"); - args.append(stage2_target_details_get_llvm_cpu(g->target_details)); + args.append(llvm_cpu); + } + const char *llvm_target_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features); + if (llvm_target_features != nullptr) { args.append("-Xclang"); args.append("-target-feature"); args.append("-Xclang"); - args.append(stage2_target_details_get_llvm_features(g->target_details)); + args.append(llvm_target_features); } } @@ -10328,6 +10337,12 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { cache_int(ch, g->zig_target->vendor); cache_int(ch, g->zig_target->os); cache_int(ch, g->zig_target->abi); + if (g->zig_target->cpu_features != nullptr) { + const char *ptr; + size_t len; + stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len); + cache_str(ch, ptr); + } if (g->zig_target->glibc_version != nullptr) { cache_int(ch, g->zig_target->glibc_version->major); cache_int(ch, g->zig_target->glibc_version->minor); @@ -10375,10 +10390,6 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { cache_buf_opt(ch, g->dynamic_linker_path); cache_buf_opt(ch, g->version_script_path); - if (g->target_details) { - cache_str(ch, stage2_target_details_get_cache_str(g->target_details)); - } - // gen_c_objects appends objects to g->link_objects which we want to include in the hash gen_c_objects(g); cache_list_of_file(ch, g->link_objects.items, g->link_objects.length); @@ -10661,7 +10672,6 @@ CodeGen *create_child_codegen(CodeGen *parent_gen, Buf *root_src_path, OutType o CodeGen *child_gen = codegen_create(nullptr, root_src_path, parent_gen->zig_target, out_type, parent_gen->build_mode, parent_gen->zig_lib_dir, libc, get_global_cache_dir(), false, child_progress_node); - child_gen->target_details = parent_gen->target_details; child_gen->root_out_name = buf_create_from_str(name); child_gen->disable_gen_h = true; child_gen->want_stack_check = WantStackCheckDisabled; diff --git a/src/main.cpp b/src/main.cpp index 441bc2afb0..42a3438def 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -955,9 +955,9 @@ int main(int argc, char **argv) { targets_list_features_arch = argv[i]; } else if (strcmp(arg, "--list-cpus") == 0) { targets_list_cpus_arch = argv[i]; - } else if (strcmp(arg, "--cpu") == 0) { + } else if (strcmp(arg, "-target-cpu") == 0) { cpu = argv[i]; - } else if (strcmp(arg, "--features") == 0) { + } else if (strcmp(arg, "-target-feature") == 0) { features = argv[i]; }else { fprintf(stderr, "Invalid argument: %s\n", arg); @@ -1074,27 +1074,26 @@ int main(int argc, char **argv) { } } - Stage2TargetDetails *target_details = nullptr; if (cpu && features) { - fprintf(stderr, "--cpu and --features options not allowed together\n"); + fprintf(stderr, "-target-cpu and -target-feature options not allowed together\n"); return main_exit(root_progress_node, EXIT_FAILURE); } else if (cpu) { - target_details = stage2_target_details_parse_cpu(target_arch_name(target.arch), cpu); - if (!target_details) { - fprintf(stderr, "invalid --cpu value\n"); + target.cpu_features = stage2_cpu_features_parse_cpu(target_arch_name(target.arch), cpu); + if (!target.cpu_features) { + fprintf(stderr, "invalid -target-cpu value\n"); return main_exit(root_progress_node, EXIT_FAILURE); } } else if (features) { - target_details = stage2_target_details_parse_features(target_arch_name(target.arch), features); - if (!target_details) { - fprintf(stderr, "invalid --features value\n"); + target.cpu_features = stage2_cpu_features_parse_features(target_arch_name(target.arch), features); + if (!target.cpu_features) { + fprintf(stderr, "invalid -target-feature value\n"); return main_exit(root_progress_node, EXIT_FAILURE); } } else { // If no details are specified and we are not native, load // cross-compilation default features. if (!target.is_native) { - target_details = stage2_target_details_get_default(target_arch_name(target.arch), target_os_name(target.os)); + target.cpu_features = stage2_cpu_features_baseline(); } } @@ -1148,7 +1147,6 @@ int main(int argc, char **argv) { g->want_stack_check = want_stack_check; g->want_sanitize_c = want_sanitize_c; g->want_single_threaded = want_single_threaded; - g->target_details = target_details; Buf *builtin_source = codegen_generate_builtin_source(g); if (fwrite(buf_ptr(builtin_source), 1, buf_len(builtin_source), stdout) != buf_len(builtin_source)) { fprintf(stderr, "unable to write to stdout: %s\n", strerror(ferror(stdout))); @@ -1303,8 +1301,6 @@ int main(int argc, char **argv) { codegen_add_rpath(g, rpath_list.at(i)); } - g->target_details = target_details; - codegen_set_rdynamic(g, rdynamic); if (mmacosx_version_min && mios_version_min) { fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n"); diff --git a/src/target.hpp b/src/target.hpp index 50611bc853..3e984e1269 100644 --- a/src/target.hpp +++ b/src/target.hpp @@ -91,6 +91,7 @@ struct ZigTarget { Os os; ZigLLVM_EnvironmentType abi; ZigGLibCVersion *glibc_version; // null means default + Stage2CpuFeatures *cpu_features; bool is_native; }; diff --git a/src/userland.cpp b/src/userland.cpp index 0e173d7e76..89ddecbedb 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -89,26 +89,44 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {} void stage2_progress_disable_tty(Stage2Progress *progress) {} void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){} -void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} -void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) {} -Stage2TargetDetails *stage2_target_details_parse_cpu(const char *arch, const char *str) { - return nullptr; +void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) { + const char *msg = "stage0 called stage2_list_features_for_arch"; + stage2_panic(msg, strlen(msg)); } -Stage2TargetDetails *stage2_target_details_parse_features(const char *arch, const char *str) { - return nullptr; + +void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) { + const char *msg = "stage0 called stage2_list_cpus_for_arch"; + stage2_panic(msg, strlen(msg)); } -const char *stage2_target_details_get_cache_str(const Stage2TargetDetails *target_details) { - return ""; +Stage2CpuFeatures *stage2_cpu_features_parse_cpu(const char *arch, const char *str) { + const char *msg = "stage0 called stage2_cpu_features_parse_cpu"; + stage2_panic(msg, strlen(msg)); } -const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDetails *target_details) { - return ""; +Stage2CpuFeatures *stage2_cpu_features_parse_features(const char *arch, const char *str) { + const char *msg = "stage0 called stage2_cpu_features_parse_features"; + stage2_panic(msg, strlen(msg)); } -const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details) { - return ""; +Stage2CpuFeatures *stage2_cpu_features_baseline(void) { + const char *msg = "stage0 called stage2_cpu_features_baseline"; + stage2_panic(msg, strlen(msg)); } -const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details) { - return ""; +void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, + const char **ptr, size_t *len) +{ + const char *msg = "stage0 called stage2_cpu_features_get_cache_hash"; + stage2_panic(msg, strlen(msg)); } -Stage2TargetDetails *stage2_target_details_get_default(const char *arch, const char *os) { - return nullptr; +const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features) { + const char *msg = "stage0 called stage2_cpu_features_get_llvm_cpu"; + stage2_panic(msg, strlen(msg)); +} +const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features) { + const char *msg = "stage0 called stage2_cpu_features_get_llvm_features"; + stage2_panic(msg, strlen(msg)); +} +void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, + const char **ptr, size_t *len) +{ + const char *msg = "stage0 called stage2_cpu_features_get_builtin_str"; + stage2_panic(msg, strlen(msg)); } diff --git a/src/userland.h b/src/userland.h index f954efd3fe..9afa048299 100644 --- a/src/userland.h +++ b/src/userland.h @@ -181,27 +181,29 @@ ZIG_EXTERN_C void stage2_list_features_for_arch(const char *arch_name_ptr, size_ ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures); // ABI warning -struct Stage2TargetDetails; +struct Stage2CpuFeatures; // ABI warning -ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_parse_cpu(const char *arch, const char *str); +ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_parse_cpu(const char *arch, const char *cpu_name); // ABI warning -ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_parse_features(const char *arch, const char *str); +ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_parse_features(const char *arch, const char *features); // ABI warning -ZIG_EXTERN_C const char *stage2_target_details_get_cache_str(const Stage2TargetDetails *target_details); +ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_baseline(void); // ABI warning -ZIG_EXTERN_C const char *stage2_target_details_get_llvm_cpu(const Stage2TargetDetails *target_details); +ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features); // ABI warning -ZIG_EXTERN_C const char *stage2_target_details_get_llvm_features(const Stage2TargetDetails *target_details); +ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features); // ABI warning -ZIG_EXTERN_C const char *stage2_target_details_get_builtin_str(const Stage2TargetDetails *target_details); +ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, + const char **ptr, size_t *len); // ABI warning -ZIG_EXTERN_C Stage2TargetDetails *stage2_target_details_get_default(const char *arch, const char *os); +ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, + const char **ptr, size_t *len); #endif -- cgit v1.2.3 From a313f153841df8caa3af8fc80966c8f61a856f51 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 19 Jan 2020 13:52:29 -0500 Subject: figure out zig0/stage1 and scanning for native CPU --- src-self-hosted/stage1.zig | 146 ++++++++++++++++++++++++++++++++------------- src/main.cpp | 32 ++++++---- src/userland.cpp | 46 ++++++++++---- src/userland.h | 20 ++++--- 4 files changed, 172 insertions(+), 72 deletions(-) (limited to 'src/userland.cpp') diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 952c752561..f0593f8fce 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -632,24 +632,77 @@ const Stage2CpuFeatures = struct { const Self = @This(); - fn initBaseline(allocator: *mem.Allocator) !Self { - const builtin_str = try std.fmt.allocPrint0(allocator, "CpuFeatures.baseline;\n"); + fn createBaseline(allocator: *mem.Allocator) !*Self { + const self = try allocator.create(Self); + errdefer allocator.destroy(self); + + const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n"); errdefer allocator.free(builtin_str); const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n"); errdefer allocator.free(cache_hash); - return Self{ + self.* = Self{ .allocator = allocator, - .cpu_features = .{ .cpu = cpu }, + .cpu_features = .baseline, .llvm_cpu_name = null, .llvm_features_str = null, .builtin_str = builtin_str, .cache_hash = cache_hash, }; + return self; + } + + fn createFromLLVM( + allocator: *mem.Allocator, + arch: [*:0]const u8, + llvm_cpu_name_z: [*:0]const u8, + llvm_cpu_features: [*:0]const u8, + ) !*Self { + const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); + const llvm_cpu_name = mem.toSliceConst(u8, llvm_cpu_name_z); + + for (arch.allCpus()) |cpu| { + const this_llvm_name = cpu.llvm_name orelse continue; + if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { + return createFromCpu(allocator, arch, cpu); + } + } + + var set = arch.baselineFeatures(); + var it = mem.tokenize(mem.toSliceConst(u8, llvm_cpu_features), ","); + while (it.next()) |decorated_llvm_feat| { + var op: enum { + add, + sub, + } = undefined; + var llvm_feat: []const u8 = undefined; + if (mem.startsWith(u8, decorated_llvm_feat, "+")) { + op = .add; + llvm_feat = decorated_llvm_feat[1..]; + } else if (mem.startsWith(u8, decorated_llvm_feat, "-")) { + op = .sub; + llvm_feat = decorated_llvm_feat[1..]; + } else { + return error.InvalidLlvmCpuFeaturesFormat; + } + for (arch.allFeaturesList()) |feature, index| { + if (mem.eql(u8, feature_name, feature.name)) { + switch (op) { + .add => set |= 1 << index, + .sub => set &= ~@as(Target.Cpu.Feature.Set, 1 << index), + } + break; + } + } + } + return createFromCpuFeatures(allocator, arch, set); } - fn initCpu(allocator: *mem.Allocator, arch: Target.Arch, cpu: *const Target.Cpu) !Self { + fn createFromCpu(allocator: *mem.Allocator, arch: Target.Arch, cpu: *const Target.Cpu) !*Self { + const self = try allocator.create(Self); + errdefer allocator.destroy(self); + const builtin_str = try std.fmt.allocPrint0( allocator, "CpuFeatures{{ .cpu = &Arch.{}.cpu.{} }};\n", @@ -661,7 +714,7 @@ const Stage2CpuFeatures = struct { const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", cpu.name, cpu.features); errdefer allocator.free(cache_hash); - return Self{ + self.* = Self{ .allocator = allocator, .cpu_features = .{ .cpu = cpu }, .llvm_cpu_name = cpu.llvm_name, @@ -669,13 +722,17 @@ const Stage2CpuFeatures = struct { .builtin_str = builtin_str, .cache_hash = cache_hash, }; + return self; } - fn initFeatures( + fn createFromCpuFeatures( allocator: *mem.Allocator, arch: Target.Arch, features: Target.Cpu.Feature.Set, - ) !Self { + ) !*Self { + const self = try allocator.create(Self); + errdefer allocator.destroy(self); + const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", features); errdefer allocator.free(cache_hash); @@ -719,7 +776,7 @@ const Stage2CpuFeatures = struct { try builtin_str_buffer.append("})};\n"); - return Self{ + self.* = Self{ .allocator = allocator, .cpu_features = .{ .features = features }, .llvm_cpu_name = null, @@ -727,68 +784,77 @@ const Stage2CpuFeatures = struct { .builtin_str = builtin_str_buffer.toOwnedSlice(), .cache_hash = cache_hash, }; + return self; } - fn deinit(self: *Self) void { + fn destroy(self: *Self) void { self.allocator.free(self.cache_hash); self.allocator.free(self.builtin_str); if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str); - self.* = undefined; + self.allocator.destroy(self); } }; // ABI warning -export fn stage2_cpu_features_parse_cpu(arch_name: [*:0]const u8, cpu_name: [*:0]const u8) *Stage2CpuFeatures { - return parseCpu(arch_name, cpu_name) catch |err| switch (err) { - error.OutOfMemory => @panic("out of memory"), +export fn stage2_cpu_features_parse_cpu( + result: **Stage2CpuFeatures, + arch_name: [*:0]const u8, + cpu_name: [*:0]const u8, +) Error { + result.* = parseCpu(arch_name, cpu_name) catch |err| switch (err) { + error.OutOfMemory => return .OutOfMemory, }; + return .None; } fn parseCpu(arch_name: [*:0]const u8, cpu_name: [*:0]const u8) !*Stage2CpuFeatures { const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); const cpu = try arch.parseCpu(mem.toSliceConst(u8, cpu_name)); - - const ptr = try allocator.create(Stage2CpuFeatures); - errdefer std.heap.c_allocator.destroy(ptr); - - ptr.* = try Stage2CpuFeatures.initCpu(std.heap.c_allocator, arch, cpu); - errdefer ptr.deinit(); - - return ptr; + return Stage2CpuFeatures.createFromCpu(std.heap.c_allocator, arch, cpu); } // ABI warning export fn stage2_cpu_features_parse_features( + result: **Stage2CpuFeatures, arch_name: [*:0]const u8, features_text: [*:0]const u8, -) *Stage2CpuFeatures { - return parseFeatures(arch_name, features_text) catch |err| switch (err) { - error.OutOfMemory => @panic("out of memory"), +) Error { + result.* = parseFeatures(arch_name, features_text) catch |err| switch (err) { + error.OutOfMemory => return .OutOfMemory, }; + return .None; } fn parseFeatures(arch_name: [*:0]const u8, features_text: [*:0]const u8) !*Stage2CpuFeatures { const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); const set = try arch.parseCpuFeatureSet(mem.toSliceConst(u8, features_text)); - - const ptr = try std.heap.c_allocator.create(Stage2CpuFeatures); - errdefer std.heap.c_allocator.destroy(ptr); - - ptr.* = try Stage2CpuFeatures.initFeatures(std.heap.c_allocator, arch, set); - errdefer ptr.deinit(); - - return ptr; + return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, set); } // ABI warning -export fn stage2_cpu_features_baseline() *Stage2CpuFeatures { - const ptr = try std.heap.c_allocator.create(Stage2CpuFeatures); - errdefer std.heap.c_allocator.destroy(ptr); - - ptr.* = try Stage2CpuFeatures.initBaseline(std.heap.c_allocator); - errdefer ptr.deinit(); +export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures) Error { + result.* = Stage2CpuFeatures.createBaseline(std.heap.c_allocator) catch |err| switch (err) { + error.OutOfMemory => return .OutOfMemory, + }; + return .None; +} - return ptr; +// ABI warning +export fn stage2_cpu_features_llvm( + result: **Stage2CpuFeatures, + arch_name: [*:0]const u8, + llvm_cpu_name: [*:0]const u8, + llvm_cpu_features: [*:0]const u8, +) Error { + result.* = Stage2CpuFeatures.createFromLLVM( + std.heap.c_allocator, + arch_name, + llvm_cpu_name, + llvm_cpu_features, + ) catch |err| switch (err) { + error.OutOfMemory => return .OutOfMemory, + }; + return .None; } // ABI warning diff --git a/src/main.cpp b/src/main.cpp index 42a3438def..d5804e795c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,8 +100,8 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " --override-lib-dir [arg] override path to Zig lib directory\n" " -ffunction-sections places each function in a separate section\n" " -D[macro]=[value] define C [macro] to [value] (1 if [value] omitted)\n" - " --cpu [cpu] compile for [cpu] on the current target\n" - " --features [feature_str] compile with features in [feature_str] on the current target\n" + " -target-cpu [cpu] target one specific CPU by name\n" + " -target-feature [features] specify the set of CPU features to target\n" "\n" "Link Options:\n" " --bundle-compiler-rt for static libraries, include compiler-rt symbols\n" @@ -1078,22 +1078,30 @@ int main(int argc, char **argv) { fprintf(stderr, "-target-cpu and -target-feature options not allowed together\n"); return main_exit(root_progress_node, EXIT_FAILURE); } else if (cpu) { - target.cpu_features = stage2_cpu_features_parse_cpu(target_arch_name(target.arch), cpu); - if (!target.cpu_features) { - fprintf(stderr, "invalid -target-cpu value\n"); + if ((err = stage2_cpu_features_parse_cpu(&target.cpu_features, target_arch_name(target.arch), cpu))) { + fprintf(stderr, "-target-cpu error: %s\n", err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); } } else if (features) { - target.cpu_features = stage2_cpu_features_parse_features(target_arch_name(target.arch), features); - if (!target.cpu_features) { - fprintf(stderr, "invalid -target-feature value\n"); + if ((err = stage2_cpu_features_parse_features(&target.cpu_features, target_arch_name(target.arch), + features))) + { + fprintf(stderr, "-target-feature error: %s\n", err_str(err)); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } else if (target.is_native) { + const char *cpu_name = ZigLLVMGetHostCPUName(); + const char *cpu_features = ZigLLVMGetNativeFeatures(); + if ((err = stage2_cpu_features_llvm(&target.cpu_features, target_arch_name(target.arch), + cpu_name, cpu_features))) + { + fprintf(stderr, "unable to determine native CPU features: %s\n", err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); } } else { - // If no details are specified and we are not native, load - // cross-compilation default features. - if (!target.is_native) { - target.cpu_features = stage2_cpu_features_baseline(); + if ((err = stage2_cpu_features_baseline(&target.cpu_features))) { + fprintf(stderr, "unable to determine baseline CPU features: %s\n", err_str(err)); + return main_exit(root_progress_node, EXIT_FAILURE); } } diff --git a/src/userland.cpp b/src/userland.cpp index 89ddecbedb..93944f0089 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -98,35 +98,55 @@ void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, const char *msg = "stage0 called stage2_list_cpus_for_arch"; stage2_panic(msg, strlen(msg)); } -Stage2CpuFeatures *stage2_cpu_features_parse_cpu(const char *arch, const char *str) { + +struct Stage2CpuFeatures { + const char *llvm_cpu_name; + const char *llvm_cpu_features; + const char *builtin_str; + const char *cache_hash; +}; + +Error stage2_cpu_features_parse_cpu(Stage2CpuFeatures **out, const char *arch, const char *str) { const char *msg = "stage0 called stage2_cpu_features_parse_cpu"; stage2_panic(msg, strlen(msg)); } -Stage2CpuFeatures *stage2_cpu_features_parse_features(const char *arch, const char *str) { +Error stage2_cpu_features_parse_features(Stage2CpuFeatures **out, const char *arch, const char *str) { const char *msg = "stage0 called stage2_cpu_features_parse_features"; stage2_panic(msg, strlen(msg)); } -Stage2CpuFeatures *stage2_cpu_features_baseline(void) { - const char *msg = "stage0 called stage2_cpu_features_baseline"; - stage2_panic(msg, strlen(msg)); +Error stage2_cpu_features_baseline(Stage2CpuFeatures **out) { + Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); + result->builtin_str = ".baseline;\n"; + result->cache_hash = "\n\n"; + *out = result; + return ErrorNone; +} +Error stage2_cpu_features_llvm(Stage2CpuFeatures **out, const char *arch, + const char *llvm_cpu_name, const char *llvm_features) +{ + Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); + result->llvm_cpu_name = llvm_cpu_name; + result->llvm_cpu_features = llvm_features; + result->builtin_str = ".baseline;\n"; + result->cache_hash = "native\n\n"; + *out = result; + return ErrorNone; } void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len) { - const char *msg = "stage0 called stage2_cpu_features_get_cache_hash"; - stage2_panic(msg, strlen(msg)); + *ptr = cpu_features->cache_hash; + *len = strlen(cpu_features->cache_hash); } const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features) { - const char *msg = "stage0 called stage2_cpu_features_get_llvm_cpu"; - stage2_panic(msg, strlen(msg)); + return cpu_features->llvm_cpu_name; } const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features) { - const char *msg = "stage0 called stage2_cpu_features_get_llvm_features"; - stage2_panic(msg, strlen(msg)); + return cpu_features->llvm_cpu_features; } void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len) { - const char *msg = "stage0 called stage2_cpu_features_get_builtin_str"; - stage2_panic(msg, strlen(msg)); + *ptr = cpu_features->builtin_str; + *len = strlen(cpu_features->builtin_str); } diff --git a/src/userland.h b/src/userland.h index 9afa048299..1fd40039a6 100644 --- a/src/userland.h +++ b/src/userland.h @@ -184,26 +184,32 @@ ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t ar struct Stage2CpuFeatures; // ABI warning -ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_parse_cpu(const char *arch, const char *cpu_name); +ZIG_EXTERN_C Error stage2_cpu_features_parse_cpu(struct Stage2CpuFeatures **result, + const char *arch, const char *cpu_name); // ABI warning -ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_parse_features(const char *arch, const char *features); +ZIG_EXTERN_C Error stage2_cpu_features_parse_features(struct Stage2CpuFeatures **result, + const char *arch, const char *features); // ABI warning -ZIG_EXTERN_C Stage2CpuFeatures *stage2_cpu_features_baseline(void); +ZIG_EXTERN_C Error stage2_cpu_features_baseline(struct Stage2CpuFeatures **result); // ABI warning -ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features); +ZIG_EXTERN_C Error stage2_cpu_features_llvm(struct Stage2CpuFeatures **result, + const char *arch, const char *llvm_cpu_name, const char *llvm_features); // ABI warning -ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features); +ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const struct Stage2CpuFeatures *cpu_features); // ABI warning -ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, +ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_features(const struct Stage2CpuFeatures *cpu_features); + +// ABI warning +ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len); // ABI warning -ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, +ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len); #endif -- cgit v1.2.3 From 8f29d1407350190e1e641ca55f870f00b53d0246 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 20 Jan 2020 01:42:31 -0500 Subject: stage1 is building. `zig targets` now self-hosted --- BRANCH_TODO | 2 + lib/std/builtin.zig | 3 + lib/std/target.zig | 62 +++---- lib/std/target/x86.zig | 392 ++++++++++++++++++++++----------------------- src-self-hosted/main.zig | 2 +- src-self-hosted/stage1.zig | 164 +++++++------------ src/error.cpp | 5 + src/main.cpp | 113 +------------ src/userland.cpp | 15 +- src/userland.h | 15 +- 10 files changed, 307 insertions(+), 466 deletions(-) (limited to 'src/userland.cpp') diff --git a/BRANCH_TODO b/BRANCH_TODO index 50efbe89f6..4dfc95f706 100644 --- a/BRANCH_TODO +++ b/BRANCH_TODO @@ -1,5 +1,7 @@ Finish these thigns before merging teh branch + * it gets the wrong answers with `-target-feature -sse,-avx` + * finish refactoring target/arch/* * `zig builtin` integration * move target details to better location diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 712d98b25c..b5c137c2e1 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -1,5 +1,8 @@ pub usingnamespace @import("builtin"); +/// Deprecated: use `std.Target.Os`. +pub const Target = std.Target; + /// Deprecated: use `std.Target.Os`. pub const Os = std.Target.Os; diff --git a/lib/std/target.zig b/lib/std/target.zig index 350387bd8a..2f3e740c90 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -49,6 +49,22 @@ pub const Target = union(enum) { other, }; + pub const aarch64 = @import("target/aarch64.zig"); + pub const amdgpu = @import("target/amdgpu.zig"); + pub const arm = @import("target/arm.zig"); + pub const avr = @import("target/avr.zig"); + pub const bpf = @import("target/bpf.zig"); + pub const hexagon = @import("target/hexagon.zig"); + pub const mips = @import("target/mips.zig"); + pub const msp430 = @import("target/msp430.zig"); + pub const nvptx = @import("target/nvptx.zig"); + pub const powerpc = @import("target/powerpc.zig"); + pub const riscv = @import("target/riscv.zig"); + pub const sparc = @import("target/sparc.zig"); + pub const systemz = @import("target/systemz.zig"); + pub const wasm = @import("target/wasm.zig"); + pub const x86 = @import("target/x86.zig"); + pub const Arch = union(enum) { arm: Arm32, armeb: Arm32, @@ -101,22 +117,6 @@ pub const Target = union(enum) { renderscript32, renderscript64, - pub const aarch64 = @import("target/aarch64.zig"); - pub const amdgpu = @import("target/amdgpu.zig"); - pub const arm = @import("target/arm.zig"); - pub const avr = @import("target/avr.zig"); - pub const bpf = @import("target/bpf.zig"); - pub const hexagon = @import("target/hexagon.zig"); - pub const mips = @import("target/mips.zig"); - pub const msp430 = @import("target/msp430.zig"); - pub const nvptx = @import("target/nvptx.zig"); - pub const powerpc = @import("target/powerpc.zig"); - pub const riscv = @import("target/riscv.zig"); - pub const sparc = @import("target/sparc.zig"); - pub const systemz = @import("target/systemz.zig"); - pub const wasm = @import("target/wasm.zig"); - pub const x86 = @import("target/x86.zig"); - pub const Arm32 = enum { v8_5a, v8_4a, @@ -251,7 +251,7 @@ pub const Target = union(enum) { }; for (arch.allFeaturesList()) |feature, index| { if (mem.eql(u8, feature_name, feature.name)) { - set |= @splat(2, 1 << index); + set |= @splat(2, @as(Cpu.Feature.Set, 1) << @intCast(u7, index)); break; } } else { @@ -440,7 +440,7 @@ pub const Target = union(enum) { // TODO .sparc, .sparcv9, .sparcel => sparc.baseline_features, // TODO .s390x => systemz.baseline_features, .i386 => x86.cpu.pentium4.features, - .x86_64 => x86.cpu.x8664.features, + .x86_64 => x86.cpu.x86_64.features, // TODO .nvptx, .nvptx64 => nvptx.baseline_features, // TODO .wasm32, .wasm64 => wasm.baseline_features, @@ -451,21 +451,21 @@ pub const Target = union(enum) { /// 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, + // TODO .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, + // TODO .avr => avr.all_cpus, + // TODO .bpfel, .bpfeb => bpf.all_cpus, + // TODO .hexagon => hexagon.all_cpus, + // TODO .mips, .mipsel, .mips64, .mips64el => mips.all_cpus, + // TODO .msp430 => msp430.all_cpus, + // TODO .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus, + // TODO .amdgcn => amdgpu.all_cpus, + // TODO .riscv32, .riscv64 => riscv.all_cpus, + // TODO .sparc, .sparcv9, .sparcel => sparc.all_cpus, + // TODO .s390x => systemz.all_cpus, .i386, .x86_64 => x86.all_cpus, - .nvptx, .nvptx64 => nvptx.all_cpus, - .wasm32, .wasm64 => wasm.all_cpus, + // TODO .nvptx, .nvptx64 => nvptx.all_cpus, + // TODO .wasm32, .wasm64 => wasm.all_cpus, else => &[0]*const Cpu{}, }; diff --git a/lib/std/target/x86.zig b/lib/std/target/x86.zig index 021c940dbd..50b332f5e1 100644 --- a/lib/std/target/x86.zig +++ b/lib/std/target/x86.zig @@ -1213,10 +1213,10 @@ pub const cpu = struct { pub const amdfam10 = Cpu{ .name = "amdfam10", .llvm_name = "amdfam10", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .cx16, @@ -1236,9 +1236,9 @@ pub const cpu = struct { pub const athlon = Cpu{ .name = "athlon", .llvm_name = "athlon", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cmov, .cx8, .nopl, @@ -1251,9 +1251,9 @@ pub const cpu = struct { pub const athlon4 = Cpu{ .name = "athlon_4", .llvm_name = "athlon-4", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cmov, .cx8, .fxsr, @@ -1268,10 +1268,10 @@ pub const cpu = struct { pub const athlon_fx = Cpu{ .name = "athlon_fx", .llvm_name = "athlon-fx", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .fxsr, @@ -1288,9 +1288,9 @@ pub const cpu = struct { pub const athlon_mp = Cpu{ .name = "athlon_mp", .llvm_name = "athlon-mp", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cmov, .cx8, .fxsr, @@ -1305,9 +1305,9 @@ pub const cpu = struct { pub const athlon_tbird = Cpu{ .name = "athlon_tbird", .llvm_name = "athlon-tbird", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cmov, .cx8, .nopl, @@ -1320,9 +1320,9 @@ pub const cpu = struct { pub const athlon_xp = Cpu{ .name = "athlon_xp", .llvm_name = "athlon-xp", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cmov, .cx8, .fxsr, @@ -1337,10 +1337,10 @@ pub const cpu = struct { pub const athlon64 = Cpu{ .name = "athlon64", .llvm_name = "athlon64", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .fxsr, @@ -1357,10 +1357,10 @@ pub const cpu = struct { pub const athlon64_sse3 = Cpu{ .name = "athlon64_sse3", .llvm_name = "athlon64-sse3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .cx16, @@ -1378,8 +1378,8 @@ pub const cpu = struct { pub const atom = Cpu{ .name = "atom", .llvm_name = "atom", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -1404,10 +1404,10 @@ pub const cpu = struct { pub const barcelona = Cpu{ .name = "barcelona", .llvm_name = "barcelona", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .cx16, @@ -1427,8 +1427,8 @@ pub const cpu = struct { pub const bdver1 = Cpu{ .name = "bdver1", .llvm_name = "bdver1", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .branchfusion, @@ -1436,7 +1436,7 @@ pub const cpu = struct { .cx8, .cx16, .fxsr, - .fast11bytenop, + .fast_11bytenop, .fast_scalar_shift_masks, .sahf, .lwp, @@ -1456,8 +1456,8 @@ pub const cpu = struct { pub const bdver2 = Cpu{ .name = "bdver2", .llvm_name = "bdver2", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .bmi, @@ -1468,7 +1468,7 @@ pub const cpu = struct { .f16c, .fma, .fxsr, - .fast11bytenop, + .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, .sahf, @@ -1490,8 +1490,8 @@ pub const cpu = struct { pub const bdver3 = Cpu{ .name = "bdver3", .llvm_name = "bdver3", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .bmi, @@ -1503,7 +1503,7 @@ pub const cpu = struct { .fma, .fsgsbase, .fxsr, - .fast11bytenop, + .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, .sahf, @@ -1526,8 +1526,8 @@ pub const cpu = struct { pub const bdver4 = Cpu{ .name = "bdver4", .llvm_name = "bdver4", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .avx2, @@ -1541,7 +1541,7 @@ pub const cpu = struct { .fma, .fsgsbase, .fxsr, - .fast11bytenop, + .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, .sahf, @@ -1565,8 +1565,8 @@ pub const cpu = struct { pub const bonnell = Cpu{ .name = "bonnell", .llvm_name = "bonnell", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -1591,8 +1591,8 @@ pub const cpu = struct { pub const broadwell = Cpu{ .name = "broadwell", .llvm_name = "broadwell", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .avx, @@ -1625,7 +1625,7 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .x87, @@ -1637,13 +1637,13 @@ pub const cpu = struct { pub const btver1 = Cpu{ .name = "btver1", .llvm_name = "btver1", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, .fxsr, - .fast15bytenop, + .fast_15bytenop, .fast_scalar_shift_masks, .fast_vector_shift_masks, .sahf, @@ -1663,8 +1663,8 @@ pub const cpu = struct { pub const btver2 = Cpu{ .name = "btver2", .llvm_name = "btver2", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .avx, @@ -1674,7 +1674,7 @@ pub const cpu = struct { .cx16, .f16c, .fxsr, - .fast15bytenop, + .fast_15bytenop, .fast_bextr, .fast_hops, .fast_lzcnt, @@ -1701,9 +1701,9 @@ pub const cpu = struct { pub const c3 = Cpu{ .name = "c3", .llvm_name = "c3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnow3, + .@"3dnow", .slow_unaligned_mem_16, .x87, }), @@ -1712,7 +1712,7 @@ pub const cpu = struct { pub const c32 = Cpu{ .name = "c3_2", .llvm_name = "c3-2", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -1726,8 +1726,8 @@ pub const cpu = struct { pub const cannonlake = Cpu{ .name = "cannonlake", .llvm_name = "cannonlake", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -1771,7 +1771,7 @@ pub const cpu = struct { .rdseed, .sgx, .sha, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .avx512vbmi, @@ -1787,8 +1787,8 @@ pub const cpu = struct { pub const cascadelake = Cpu{ .name = "cascadelake", .llvm_name = "cascadelake", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -1831,7 +1831,7 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .avx512vl, @@ -1847,8 +1847,8 @@ pub const cpu = struct { pub const cooperlake = Cpu{ .name = "cooperlake", .llvm_name = "cooperlake", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -1892,7 +1892,7 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .avx512vl, @@ -1908,8 +1908,8 @@ pub const cpu = struct { pub const core_avx_i = Cpu{ .name = "core_avx_i", .llvm_name = "core-avx-i", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .cmov, @@ -1929,7 +1929,7 @@ pub const cpu = struct { .popcnt, .false_deps_popcnt, .rdrnd, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .slow_unaligned_mem_32, @@ -1942,8 +1942,8 @@ pub const cpu = struct { pub const core_avx2 = Cpu{ .name = "core_avx2", .llvm_name = "core-avx2", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .avx2, @@ -1973,7 +1973,7 @@ pub const cpu = struct { .popcnt, .false_deps_popcnt, .rdrnd, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .x87, @@ -1985,8 +1985,8 @@ pub const cpu = struct { pub const core2 = Cpu{ .name = "core2", .llvm_name = "core2", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2005,8 +2005,8 @@ pub const cpu = struct { pub const corei7 = Cpu{ .name = "corei7", .llvm_name = "corei7", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2017,7 +2017,7 @@ pub const cpu = struct { .nopl, .popcnt, .sse, - .sse42, + .sse4_2, .x87, }), }; @@ -2025,8 +2025,8 @@ pub const cpu = struct { pub const corei7_avx = Cpu{ .name = "corei7_avx", .llvm_name = "corei7-avx", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .cmov, @@ -2043,7 +2043,7 @@ pub const cpu = struct { .pclmul, .popcnt, .false_deps_popcnt, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .slow_unaligned_mem_32, @@ -2056,7 +2056,7 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cx8, .slow_unaligned_mem_16, .x87, @@ -2066,9 +2066,9 @@ pub const cpu = struct { pub const geode = Cpu{ .name = "geode", .llvm_name = "geode", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, + .@"3dnowa", .cx8, .slow_unaligned_mem_16, .x87, @@ -2078,8 +2078,8 @@ pub const cpu = struct { pub const goldmont = Cpu{ .name = "goldmont", .llvm_name = "goldmont", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .clflushopt, @@ -2100,10 +2100,10 @@ pub const cpu = struct { .rdrnd, .rdseed, .sha, - .sse42, + .sse4_2, .ssse3, .slow_incdec, - .slowLea, + .slow_lea, .slow_two_mem_ops, .x87, .xsave, @@ -2116,8 +2116,8 @@ pub const cpu = struct { pub const goldmont_plus = Cpu{ .name = "goldmont_plus", .llvm_name = "goldmont-plus", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .clflushopt, @@ -2140,10 +2140,10 @@ pub const cpu = struct { .rdseed, .sgx, .sha, - .sse42, + .sse4_2, .ssse3, .slow_incdec, - .slowLea, + .slow_lea, .slow_two_mem_ops, .x87, .xsave, @@ -2156,8 +2156,8 @@ pub const cpu = struct { pub const haswell = Cpu{ .name = "haswell", .llvm_name = "haswell", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .avx2, @@ -2187,7 +2187,7 @@ pub const cpu = struct { .popcnt, .false_deps_popcnt, .rdrnd, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .x87, @@ -2196,38 +2196,38 @@ pub const cpu = struct { }), }; - pub const i386 = Cpu{ - .name = "i386", + pub const _i386 = Cpu{ + .name = "_i386", .llvm_name = "i386", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .slow_unaligned_mem_16, .x87, }), }; - pub const i486 = Cpu{ - .name = "i486", + pub const _i486 = Cpu{ + .name = "_i486", .llvm_name = "i486", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .slow_unaligned_mem_16, .x87, }), }; - pub const i586 = Cpu{ - .name = "i586", + pub const _i586 = Cpu{ + .name = "_i586", .llvm_name = "i586", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cx8, .slow_unaligned_mem_16, .x87, }), }; - pub const i686 = Cpu{ - .name = "i686", + pub const _i686 = Cpu{ + .name = "_i686", .llvm_name = "i686", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .slow_unaligned_mem_16, @@ -2238,8 +2238,8 @@ pub const cpu = struct { pub const icelake_client = Cpu{ .name = "icelake_client", .llvm_name = "icelake-client", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2287,7 +2287,7 @@ pub const cpu = struct { .rdseed, .sgx, .sha, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .vaes, @@ -2308,8 +2308,8 @@ pub const cpu = struct { pub const icelake_server = Cpu{ .name = "icelake_server", .llvm_name = "icelake-server", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2358,7 +2358,7 @@ pub const cpu = struct { .rdseed, .sgx, .sha, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .vaes, @@ -2380,8 +2380,8 @@ pub const cpu = struct { pub const ivybridge = Cpu{ .name = "ivybridge", .llvm_name = "ivybridge", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .cmov, @@ -2401,7 +2401,7 @@ pub const cpu = struct { .popcnt, .false_deps_popcnt, .rdrnd, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .slow_unaligned_mem_32, @@ -2414,7 +2414,7 @@ pub const cpu = struct { pub const k6 = Cpu{ .name = "k6", .llvm_name = "k6", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cx8, .mmx, .slow_unaligned_mem_16, @@ -2425,9 +2425,9 @@ pub const cpu = struct { pub const k62 = Cpu{ .name = "k6_2", .llvm_name = "k6-2", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnow3, + .@"3dnow", .cx8, .slow_unaligned_mem_16, .x87, @@ -2437,9 +2437,9 @@ pub const cpu = struct { pub const k63 = Cpu{ .name = "k6_3", .llvm_name = "k6-3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnow3, + .@"3dnow", .cx8, .slow_unaligned_mem_16, .x87, @@ -2449,10 +2449,10 @@ pub const cpu = struct { pub const k8 = Cpu{ .name = "k8", .llvm_name = "k8", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .fxsr, @@ -2469,10 +2469,10 @@ pub const cpu = struct { pub const k8_sse3 = Cpu{ .name = "k8_sse3", .llvm_name = "k8-sse3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .cx16, @@ -2490,8 +2490,8 @@ pub const cpu = struct { pub const knl = Cpu{ .name = "knl", .llvm_name = "knl", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2535,8 +2535,8 @@ pub const cpu = struct { pub const knm = Cpu{ .name = "knm", .llvm_name = "knm", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2581,14 +2581,14 @@ pub const cpu = struct { pub const lakemont = Cpu{ .name = "lakemont", .llvm_name = "lakemont", - .dependencies = 0, + .features = 0, }; pub const nehalem = Cpu{ .name = "nehalem", .llvm_name = "nehalem", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2599,7 +2599,7 @@ pub const cpu = struct { .nopl, .popcnt, .sse, - .sse42, + .sse4_2, .x87, }), }; @@ -2607,8 +2607,8 @@ pub const cpu = struct { pub const nocona = Cpu{ .name = "nocona", .llvm_name = "nocona", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2625,10 +2625,10 @@ pub const cpu = struct { pub const opteron = Cpu{ .name = "opteron", .llvm_name = "opteron", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .fxsr, @@ -2645,10 +2645,10 @@ pub const cpu = struct { pub const opteron_sse3 = Cpu{ .name = "opteron_sse3", .llvm_name = "opteron-sse3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnowa3, - .bit64, + .@"3dnowa", + .@"64bit", .cmov, .cx8, .cx16, @@ -2666,8 +2666,8 @@ pub const cpu = struct { pub const penryn = Cpu{ .name = "penryn", .llvm_name = "penryn", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2677,7 +2677,7 @@ pub const cpu = struct { .macrofusion, .nopl, .sse, - .sse41, + .sse4_1, .slow_unaligned_mem_16, .x87, }), @@ -2686,7 +2686,7 @@ pub const cpu = struct { pub const pentium = Cpu{ .name = "pentium", .llvm_name = "pentium", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cx8, .slow_unaligned_mem_16, .x87, @@ -2696,7 +2696,7 @@ pub const cpu = struct { pub const pentium_m = Cpu{ .name = "pentium_m", .llvm_name = "pentium-m", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2712,7 +2712,7 @@ pub const cpu = struct { pub const pentium_mmx = Cpu{ .name = "pentium_mmx", .llvm_name = "pentium-mmx", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cx8, .mmx, .slow_unaligned_mem_16, @@ -2723,7 +2723,7 @@ pub const cpu = struct { pub const pentium2 = Cpu{ .name = "pentium2", .llvm_name = "pentium2", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2737,7 +2737,7 @@ pub const cpu = struct { pub const pentium3 = Cpu{ .name = "pentium3", .llvm_name = "pentium3", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2752,7 +2752,7 @@ pub const cpu = struct { pub const pentium3m = Cpu{ .name = "pentium3m", .llvm_name = "pentium3m", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2767,7 +2767,7 @@ pub const cpu = struct { pub const pentium4 = Cpu{ .name = "pentium4", .llvm_name = "pentium4", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2783,7 +2783,7 @@ pub const cpu = struct { pub const pentium4m = Cpu{ .name = "pentium4m", .llvm_name = "pentium4m", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2799,7 +2799,7 @@ pub const cpu = struct { pub const pentiumpro = Cpu{ .name = "pentiumpro", .llvm_name = "pentiumpro", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .nopl, @@ -2811,7 +2811,7 @@ pub const cpu = struct { pub const prescott = Cpu{ .name = "prescott", .llvm_name = "prescott", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -2827,8 +2827,8 @@ pub const cpu = struct { pub const sandybridge = Cpu{ .name = "sandybridge", .llvm_name = "sandybridge", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .avx, .cmov, @@ -2845,7 +2845,7 @@ pub const cpu = struct { .pclmul, .popcnt, .false_deps_popcnt, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .slow_unaligned_mem_32, @@ -2858,8 +2858,8 @@ pub const cpu = struct { pub const silvermont = Cpu{ .name = "silvermont", .llvm_name = "silvermont", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -2874,12 +2874,12 @@ pub const cpu = struct { .false_deps_popcnt, .prfchw, .rdrnd, - .sse42, + .sse4_2, .ssse3, .idivq_to_divl, .slow_incdec, - .slowLea, - .slowPmulld, + .slow_lea, + .slow_pmulld, .slow_two_mem_ops, .x87, }), @@ -2888,8 +2888,8 @@ pub const cpu = struct { pub const skx = Cpu{ .name = "skx", .llvm_name = "skx", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2932,7 +2932,7 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .avx512vl, @@ -2947,8 +2947,8 @@ pub const cpu = struct { pub const skylake = Cpu{ .name = "skylake", .llvm_name = "skylake", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -2986,7 +2986,7 @@ pub const cpu = struct { .rdrnd, .rdseed, .sgx, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .x87, @@ -3000,8 +3000,8 @@ pub const cpu = struct { pub const skylake_avx512 = Cpu{ .name = "skylake_avx512", .llvm_name = "skylake-avx512", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -3044,7 +3044,7 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, - .sse42, + .sse4_2, .slow_3ops_lea, .idivq_to_divl, .avx512vl, @@ -3059,8 +3059,8 @@ pub const cpu = struct { pub const slm = Cpu{ .name = "slm", .llvm_name = "slm", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -3075,12 +3075,12 @@ pub const cpu = struct { .false_deps_popcnt, .prfchw, .rdrnd, - .sse42, + .sse4_2, .ssse3, .idivq_to_divl, .slow_incdec, - .slowLea, - .slowPmulld, + .slow_lea, + .slow_pmulld, .slow_two_mem_ops, .x87, }), @@ -3089,8 +3089,8 @@ pub const cpu = struct { pub const tremont = Cpu{ .name = "tremont", .llvm_name = "tremont", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .sse, .aes, .cldemote, @@ -3117,10 +3117,10 @@ pub const cpu = struct { .rdseed, .sgx, .sha, - .sse42, + .sse4_2, .ssse3, .slow_incdec, - .slowLea, + .slow_lea, .slow_two_mem_ops, .waitpkg, .x87, @@ -3134,8 +3134,8 @@ pub const cpu = struct { pub const westmere = Cpu{ .name = "westmere", .llvm_name = "westmere", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .cx16, @@ -3147,7 +3147,7 @@ pub const cpu = struct { .sse, .pclmul, .popcnt, - .sse42, + .sse4_2, .x87, }), }; @@ -3155,7 +3155,7 @@ pub const cpu = struct { pub const winchip_c6 = Cpu{ .name = "winchip_c6", .llvm_name = "winchip-c6", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, .slow_unaligned_mem_16, .x87, @@ -3165,9 +3165,9 @@ pub const cpu = struct { pub const winchip2 = Cpu{ .name = "winchip2", .llvm_name = "winchip2", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .mmx, - .dnow3, + .@"3dnow", .slow_unaligned_mem_16, .x87, }), @@ -3176,8 +3176,8 @@ pub const cpu = struct { pub const x86_64 = Cpu{ .name = "x86_64", .llvm_name = "x86-64", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .cmov, .cx8, .fxsr, @@ -3195,7 +3195,7 @@ pub const cpu = struct { pub const yonah = Cpu{ .name = "yonah", .llvm_name = "yonah", - .dependencies = featureSet(&[_]Feature{ + .features = featureSet(&[_]Feature{ .cmov, .cx8, .fxsr, @@ -3211,8 +3211,8 @@ pub const cpu = struct { pub const znver1 = Cpu{ .name = "znver1", .llvm_name = "znver1", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -3229,7 +3229,7 @@ pub const cpu = struct { .fma, .fsgsbase, .fxsr, - .fast15bytenop, + .fast_15bytenop, .fast_bextr, .fast_lzcnt, .fast_scalar_shift_masks, @@ -3258,8 +3258,8 @@ pub const cpu = struct { pub const znver2 = Cpu{ .name = "znver2", .llvm_name = "znver2", - .dependencies = featureSet(&[_]Feature{ - .bit64, + .features = featureSet(&[_]Feature{ + .@"64bit", .adx, .sse, .aes, @@ -3277,7 +3277,7 @@ pub const cpu = struct { .fma, .fsgsbase, .fxsr, - .fast15bytenop, + .fast_15bytenop, .fast_bextr, .fast_lzcnt, .fast_scalar_shift_masks, @@ -3341,10 +3341,10 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.goldmont, &cpu.goldmont_plus, &cpu.haswell, - &cpu.i386, - &cpu.i486, - &cpu.i586, - &cpu.i686, + &cpu._i386, + &cpu._i486, + &cpu._i586, + &cpu._i686, &cpu.icelake_client, &cpu.icelake_server, &cpu.ivybridge, diff --git a/src-self-hosted/main.zig b/src-self-hosted/main.zig index af3fd3a015..e3faf853ea 100644 --- a/src-self-hosted/main.zig +++ b/src-self-hosted/main.zig @@ -791,7 +791,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro // cmd:targets ///////////////////////////////////////////////////////////////////////////////////// -fn cmdTargets(allocator: *Allocator, args: []const []const u8) !void { +pub fn cmdTargets(allocator: *Allocator, args: []const []const u8) !void { try stdout.write("Architectures:\n"); { comptime var i: usize = 0; diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 85a6951827..9ce4746950 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -84,6 +84,11 @@ const Error = extern enum { NotLazy, IsAsync, ImportOutsidePkgPath, + UnknownCpu, + UnknownSubArchitecture, + UnknownCpuFeature, + InvalidCpuFeatures, + InvalidLlvmCpuFeaturesFormat, }; const FILE = std.c.FILE; @@ -533,99 +538,20 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz } // ABI warning -export fn stage2_list_features_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { - printFeaturesForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { - std.debug.warn("Failed to list features: {}\n", .{@errorName(err)}); +export fn stage2_cmd_targets() c_int { + self_hosted_main.cmdTargets(std.heap.c_allocator, &[0][]u8{}) catch |err| { + std.debug.warn("unable to list targets: {}\n", .{@errorName(err)}); + return -1; }; -} - -fn printFeaturesForArch(arch_name: []const u8, show_dependencies: bool) !void { - const stdout_stream = &std.io.getStdOut().outStream().stream; - - const arch = Target.parseArchSub(arch_name) catch { - std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name}); - return; - }; - - try stdout_stream.print("Available features for {}:\n", .{@tagName(arch)}); - - const features = arch.allFeaturesList(); - - var longest_len: usize = 0; - for (features) |feature| { - if (feature.name.len > longest_len) { - longest_len = feature.name.len; - } - } - - for (features) |feature| { - try stdout_stream.print(" {}", .{feature.name}); - - var i: usize = 0; - while (i < longest_len - feature.name.len) : (i += 1) { - try stdout_stream.write(" "); - } - - try stdout_stream.print(" - {}\n", .{feature.description}); - - if (show_dependencies and feature.dependencies != 0) { - for (feature.dependencies) |dependency| { - try stdout_stream.print(" {}\n", .{dependency.name}); - } - } - } -} - -// ABI warning -export fn stage2_list_cpus_for_arch(arch_name_ptr: [*]const u8, arch_name_len: usize, show_dependencies: bool) void { - printCpusForArch(arch_name_ptr[0..arch_name_len], show_dependencies) catch |err| { - std.debug.warn("Failed to list features: {}\n", .{@errorName(err)}); - }; -} - -fn printCpusForArch(arch_name: []const u8, show_dependencies: bool) !void { - const stdout_stream = &std.io.getStdOut().outStream().stream; - - const arch = Target.parseArchTag(arch_name) catch { - std.debug.warn("Failed to parse arch '{}'\nInvoke 'zig targets' for a list of valid architectures\n", .{arch_name}); - return; - }; - - const cpus = std.target.getCpusForArch(arch); - - try stdout_stream.print("Available cpus for {}:\n", .{@tagName(arch)}); - - var longest_len: usize = 0; - for (cpus) |cpu| { - if (cpu.name.len > longest_len) { - longest_len = cpu.name.len; - } - } - - for (cpus) |cpu| { - try stdout_stream.print(" {}", .{cpu.name}); - - var i: usize = 0; - while (i < longest_len - cpu.name.len) : (i += 1) { - try stdout_stream.write(" "); - } - - try stdout_stream.write("\n"); - - if (show_dependencies and cpu.dependencies.len > 0) { - for (cpu.dependencies) |dependency| { - try stdout_stream.print(" {}\n", .{dependency.name}); - } - } - } + return 0; } const Stage2CpuFeatures = struct { allocator: *mem.Allocator, cpu_features: Target.Cross.CpuFeatures, - llvm_cpu_name: ?[:0]const u8, - llvm_features_str: ?[:0]const u8, + llvm_cpu_name: ?[*:0]const u8, + llvm_features_str: ?[*:0]const u8, builtin_str: [:0]const u8, cache_hash: [:0]const u8, @@ -636,10 +562,10 @@ const Stage2CpuFeatures = struct { const self = try allocator.create(Self); errdefer allocator.destroy(self); - const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n"); + const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n", .{}); errdefer allocator.free(builtin_str); - const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n"); + const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n", .{}); errdefer allocator.free(cache_hash); self.* = Self{ @@ -655,7 +581,7 @@ const Stage2CpuFeatures = struct { fn createFromLLVM( allocator: *mem.Allocator, - arch: [*:0]const u8, + arch_name: [*:0]const u8, llvm_cpu_name_z: [*:0]const u8, llvm_cpu_features: [*:0]const u8, ) !*Self { @@ -687,10 +613,11 @@ const Stage2CpuFeatures = struct { return error.InvalidLlvmCpuFeaturesFormat; } for (arch.allFeaturesList()) |feature, index| { - if (mem.eql(u8, feature_name, feature.name)) { + const this_llvm_name = feature.llvm_name orelse continue; + if (mem.eql(u8, llvm_feat, this_llvm_name)) { switch (op) { - .add => set |= 1 << index, - .sub => set &= ~@as(Target.Cpu.Feature.Set, 1 << index), + .add => set |= @as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index), + .sub => set &= ~@as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index), } break; } @@ -703,21 +630,19 @@ const Stage2CpuFeatures = struct { const self = try allocator.create(Self); errdefer allocator.destroy(self); - const builtin_str = try std.fmt.allocPrint0( - allocator, - "CpuFeatures{{ .cpu = &Arch.{}.cpu.{} }};\n", + const builtin_str = try std.fmt.allocPrint0(allocator, "CpuFeatures{{ .cpu = &Target.{}.cpu.{} }};\n", .{ arch.genericName(), cpu.name, - ); + }); errdefer allocator.free(builtin_str); - const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", cpu.name, cpu.features); + const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{x}", .{ cpu.name, cpu.features }); errdefer allocator.free(cache_hash); self.* = Self{ .allocator = allocator, .cpu_features = .{ .cpu = cpu }, - .llvm_cpu_name = cpu.llvm_name, + .llvm_cpu_name = if (cpu.llvm_name) |n| n.ptr else null, .llvm_features_str = null, .builtin_str = builtin_str, .cache_hash = cache_hash, @@ -728,20 +653,22 @@ const Stage2CpuFeatures = struct { fn createFromCpuFeatures( allocator: *mem.Allocator, arch: Target.Arch, - features: Target.Cpu.Feature.Set, + feature_set: Target.Cpu.Feature.Set, ) !*Self { const self = try allocator.create(Self); errdefer allocator.destroy(self); - const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", features); + const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", .{feature_set}); errdefer allocator.free(cache_hash); const generic_arch_name = arch.genericName(); var builtin_str_buffer = try std.Buffer.allocPrint( allocator, - "CpuFeatures{{ .features = Arch.{}.featureSet(&[_]Arch.{}.Feature{{\n", - generic_arch_name, - generic_arch_name, + \\CpuFeatures{{ + \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ + \\ + , + .{ generic_arch_name, generic_arch_name }, ); defer builtin_str_buffer.deinit(); @@ -750,7 +677,8 @@ const Stage2CpuFeatures = struct { // First, disable all features. // This way, we only get the ones the user requests. - for (arch.allFeatures()) |feature| { + const all_features = arch.allFeaturesList(); + for (all_features) |feature| { if (feature.llvm_name) |llvm_name| { try llvm_features_buffer.append("-"); try llvm_features_buffer.append(llvm_name); @@ -758,14 +686,16 @@ const Stage2CpuFeatures = struct { } } - for (features) |feature| { + for (all_features) |feature, index| { + if (!Target.Cpu.Feature.isEnabled(feature_set, @intCast(u7, index))) continue; + if (feature.llvm_name) |llvm_name| { try llvm_features_buffer.append("+"); try llvm_features_buffer.append(llvm_name); try llvm_features_buffer.append(","); } - try builtin_str_buffer.append(" ."); + try builtin_str_buffer.append(" ."); try builtin_str_buffer.append(feature.name); try builtin_str_buffer.append(",\n"); } @@ -774,13 +704,17 @@ const Stage2CpuFeatures = struct { llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); } - try builtin_str_buffer.append("})};\n"); + try builtin_str_buffer.append( + \\ }), + \\}; + \\ + ); self.* = Self{ .allocator = allocator, - .cpu_features = .{ .features = features }, + .cpu_features = .{ .features = feature_set }, .llvm_cpu_name = null, - .llvm_features_str = llvm_features_buffer.toOwnedSlice(), + .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr, .builtin_str = builtin_str_buffer.toOwnedSlice(), .cache_hash = cache_hash, }; @@ -790,7 +724,7 @@ const Stage2CpuFeatures = struct { fn destroy(self: *Self) void { self.allocator.free(self.cache_hash); self.allocator.free(self.builtin_str); - if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str); + // TODO if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str); self.allocator.destroy(self); } }; @@ -803,6 +737,9 @@ export fn stage2_cpu_features_parse_cpu( ) Error { result.* = parseCpu(arch_name, cpu_name) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, + error.UnknownCpu => return .UnknownCpu, + error.UnknownArchitecture => return .UnknownArchitecture, + error.UnknownSubArchitecture => return .UnknownSubArchitecture, }; return .None; } @@ -821,6 +758,10 @@ export fn stage2_cpu_features_parse_features( ) Error { result.* = parseFeatures(arch_name, features_text) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, + error.UnknownCpuFeature => return .UnknownCpuFeature, + error.InvalidCpuFeatures => return .InvalidCpuFeatures, + error.UnknownArchitecture => return .UnknownArchitecture, + error.UnknownSubArchitecture => return .UnknownSubArchitecture, }; return .None; } @@ -853,6 +794,9 @@ export fn stage2_cpu_features_llvm( llvm_cpu_features, ) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, + error.UnknownArchitecture => return .UnknownArchitecture, + error.UnknownSubArchitecture => return .UnknownSubArchitecture, + error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat, }; return .None; } diff --git a/src/error.cpp b/src/error.cpp index 9fc0383b1b..6c6abfcd22 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -58,6 +58,11 @@ const char *err_str(Error err) { case ErrorNotLazy: return "not lazy"; case ErrorIsAsync: return "is async"; case ErrorImportOutsidePkgPath: return "import of file outside package path"; + case ErrorUnknownCpu: return "unknown CPU"; + case ErrorUnknownSubArchitecture: return "unknown sub-architecture"; + case ErrorUnknownCpuFeature: return "unknown CPU feature"; + case ErrorInvalidCpuFeatures: return "invalid CPU features"; + case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format"; } return "(invalid error)"; } diff --git a/src/main.cpp b/src/main.cpp index d5804e795c..8e331461f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -131,11 +131,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " --test-name-prefix [text] add prefix to all tests\n" " --test-cmd [arg] specify test execution command one arg at a time\n" " --test-cmd-bin appends test binary path to test cmd args\n" - "\n" - "Targets Options:\n" - " --list-features [arch] list available features for the given architecture\n" - " --list-cpus [arch] list available cpus for the given architecture\n" - " --show-dependencies list feature dependencies for each entry from --list-{features,cpus}\n" , arg0); return return_code; } @@ -160,88 +155,6 @@ static int print_libc_usage(const char *arg0, FILE *file, int return_code) { return return_code; } -static bool arch_available_in_llvm(ZigLLVM_ArchType arch) { - LLVMTargetRef target_ref; - char *err_msg = nullptr; - char triple_string[128]; - sprintf(triple_string, "%s-unknown-unknown-unknown", ZigLLVMGetArchTypeName(arch)); - return !LLVMGetTargetFromTriple(triple_string, &target_ref, &err_msg); -} - -static int print_target_list(FILE *f) { - ZigTarget native; - get_native_target(&native); - - fprintf(f, "Architectures:\n"); - size_t arch_count = target_arch_count(); - for (size_t arch_i = 0; arch_i < arch_count; arch_i += 1) { - ZigLLVM_ArchType arch = target_arch_enum(arch_i); - if (!arch_available_in_llvm(arch)) - continue; - const char *arch_name = target_arch_name(arch); - SubArchList sub_arch_list = target_subarch_list(arch); - size_t sub_count = target_subarch_count(sub_arch_list); - const char *arch_native_str = (native.arch == arch) ? " (native)" : ""; - fprintf(f, " %s%s\n", arch_name, arch_native_str); - for (size_t sub_i = 0; sub_i < sub_count; sub_i += 1) { - ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i); - const char *sub_name = target_subarch_name(sub); - const char *sub_native_str = (native.arch == arch && native.sub_arch == sub) ? " (native)" : ""; - fprintf(f, " %s%s\n", sub_name, sub_native_str); - } - } - - fprintf(f, "\nOperating Systems:\n"); - size_t os_count = target_os_count(); - for (size_t i = 0; i < os_count; i += 1) { - Os os_type = target_os_enum(i); - const char *native_str = (native.os == os_type) ? " (native)" : ""; - fprintf(f, " %s%s\n", target_os_name(os_type), native_str); - } - - fprintf(f, "\nC ABIs:\n"); - size_t abi_count = target_abi_count(); - for (size_t i = 0; i < abi_count; i += 1) { - ZigLLVM_EnvironmentType abi = target_abi_enum(i); - const char *native_str = (native.abi == abi) ? " (native)" : ""; - fprintf(f, " %s%s\n", target_abi_name(abi), native_str); - } - - fprintf(f, "\nAvailable libcs:\n"); - size_t libc_count = target_libc_count(); - for (size_t i = 0; i < libc_count; i += 1) { - ZigTarget libc_target; - target_libc_enum(i, &libc_target); - bool is_native = native.arch == libc_target.arch && - native.os == libc_target.os && - native.abi == libc_target.abi; - const char *native_str = is_native ? " (native)" : ""; - fprintf(f, " %s-%s-%s%s\n", target_arch_name(libc_target.arch), - target_os_name(libc_target.os), target_abi_name(libc_target.abi), native_str); - } - - fprintf(f, "\nAvailable glibc versions:\n"); - ZigGLibCAbi *glibc_abi; - Error err; - if ((err = glibc_load_metadata(&glibc_abi, get_zig_lib_dir(), true))) { - return EXIT_FAILURE; - } - for (size_t i = 0; i < glibc_abi->all_versions.length; i += 1) { - ZigGLibCVersion *this_ver = &glibc_abi->all_versions.at(i); - bool is_native = native.glibc_version != nullptr && - native.glibc_version->major == this_ver->major && - native.glibc_version->minor == this_ver->minor && - native.glibc_version->patch == this_ver->patch; - const char *native_str = is_native ? " (native)" : ""; - if (this_ver->patch == 0) { - fprintf(f, " %d.%d%s\n", this_ver->major, this_ver->minor, native_str); - } else { - fprintf(f, " %d.%d.%d%s\n", this_ver->major, this_ver->minor, this_ver->patch, native_str); - } - } - return EXIT_SUCCESS; -} - enum Cmd { CmdNone, CmdBuild, @@ -538,10 +451,6 @@ int main(int argc, char **argv) { const char *cpu = nullptr; const char *features = nullptr; - const char *targets_list_features_arch = nullptr; - const char *targets_list_cpus_arch = nullptr; - bool targets_show_dependencies = false; - ZigList llvm_argv = {0}; llvm_argv.append("zig (LLVM option parsing)"); @@ -792,8 +701,6 @@ int main(int argc, char **argv) { cur_pkg = cur_pkg->parent; } else if (strcmp(arg, "-ffunction-sections") == 0) { function_sections = true; - } else if (strcmp(arg, "--show-dependencies") == 0) { - targets_show_dependencies = true; } else if (i + 1 >= argc) { fprintf(stderr, "Expected another argument after %s\n", arg); return print_error_usage(arg0); @@ -951,10 +858,6 @@ int main(int argc, char **argv) { , argv[i]); return EXIT_FAILURE; } - } else if (strcmp(arg, "--list-features") == 0) { - targets_list_features_arch = argv[i]; - } else if (strcmp(arg, "--list-cpus") == 0) { - targets_list_cpus_arch = argv[i]; } else if (strcmp(arg, "-target-cpu") == 0) { cpu = argv[i]; } else if (strcmp(arg, "-target-feature") == 0) { @@ -1468,21 +1371,7 @@ int main(int argc, char **argv) { return main_exit(root_progress_node, EXIT_SUCCESS); } case CmdTargets: - if (targets_list_features_arch != nullptr) { - stage2_list_features_for_arch( - targets_list_features_arch, - strlen(targets_list_features_arch), - targets_show_dependencies); - return 0; - } else if (targets_list_cpus_arch != nullptr) { - stage2_list_cpus_for_arch( - targets_list_cpus_arch, - strlen(targets_list_cpus_arch), - targets_show_dependencies); - return 0; - } else { - return print_target_list(stdout); - } + return stage2_cmd_targets(); case CmdNone: return print_full_usage(arg0, stderr, EXIT_FAILURE); } diff --git a/src/userland.cpp b/src/userland.cpp index 93944f0089..22d2daa8e4 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -89,16 +89,6 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {} void stage2_progress_disable_tty(Stage2Progress *progress) {} void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){} -void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) { - const char *msg = "stage0 called stage2_list_features_for_arch"; - stage2_panic(msg, strlen(msg)); -} - -void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures) { - const char *msg = "stage0 called stage2_list_cpus_for_arch"; - stage2_panic(msg, strlen(msg)); -} - struct Stage2CpuFeatures { const char *llvm_cpu_name; const char *llvm_cpu_features; @@ -150,3 +140,8 @@ void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, *ptr = cpu_features->builtin_str; *len = strlen(cpu_features->builtin_str); } + +int stage2_cmd_targets(void) { + const char *msg = "stage0 called stage2_cmd_targets"; + stage2_panic(msg, strlen(msg)); +} diff --git a/src/userland.h b/src/userland.h index 1fd40039a6..052321a718 100644 --- a/src/userland.h +++ b/src/userland.h @@ -78,6 +78,11 @@ enum Error { ErrorNotLazy, ErrorIsAsync, ErrorImportOutsidePkgPath, + ErrorUnknownCpu, + ErrorUnknownSubArchitecture, + ErrorUnknownCpuFeature, + ErrorInvalidCpuFeatures, + ErrorInvalidLlvmCpuFeaturesFormat, }; // ABI warning @@ -174,12 +179,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node); ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items); -// ABI warning -ZIG_EXTERN_C void stage2_list_features_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures); - -// ABI warning -ZIG_EXTERN_C void stage2_list_cpus_for_arch(const char *arch_name_ptr, size_t arch_name_len, bool show_subfeatures); - // ABI warning struct Stage2CpuFeatures; @@ -212,4 +211,8 @@ ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeat ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len); +// ABI warning +ZIG_EXTERN_C int stage2_cmd_targets(void); + + #endif -- cgit v1.2.3 From e640d015351c3d3bf7c41020ff2a87f38f853140 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 21 Jan 2020 00:34:54 -0500 Subject: fixups to arch data, support any number of cpu features --- lib/std/build.zig | 2 +- lib/std/target.zig | 91 ++++++++++++++------- lib/std/target/aarch64.zig | 200 ++++++++++++++++++++++----------------------- lib/std/target/amdgpu.zig | 200 ++++++++++++++++++++++----------------------- lib/std/target/arm.zig | 196 ++++++++++++++++++++++---------------------- lib/std/target/avr.zig | 64 ++++++++------- lib/std/target/bpf.zig | 18 ++-- lib/std/target/hexagon.zig | 34 ++++---- lib/std/target/mips.zig | 64 +++++++-------- lib/std/target/msp430.zig | 14 ++-- lib/std/target/nvptx.zig | 52 ++++++------ lib/std/target/powerpc.zig | 88 ++++++++++---------- lib/std/target/riscv.zig | 18 ++-- lib/std/target/sparc.zig | 58 ++++++------- lib/std/target/systemz.zig | 78 +++++++++--------- lib/std/target/wasm.zig | 24 +++--- lib/std/target/x86.zig | 174 +++++++++++++++++++-------------------- src-self-hosted/stage1.zig | 77 ++++++++++++----- src/error.cpp | 1 + src/main.cpp | 13 +-- src/userland.cpp | 6 +- src/userland.h | 7 +- 22 files changed, 777 insertions(+), 702 deletions(-) (limited to 'src/userland.cpp') diff --git a/lib/std/build.zig b/lib/std/build.zig index 1eabfb1559..32a9e549de 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1983,7 +1983,7 @@ pub const LibExeObjStep = struct { var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0); for (self.target.getArch().allFeaturesList()) |feature, i| { - if (Target.Cpu.Feature.isEnabled(features, @intCast(u7, i))) { + if (features.isEnabled(@intCast(u8, i))) { try feature_str_buffer.append(feature.name); try feature_str_buffer.append(","); } diff --git a/lib/std/target.zig b/lib/std/target.zig index 9b83384723..716be8905c 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -219,7 +219,8 @@ pub const Target = union(enum) { pub fn parseCpuFeatureSet(arch: Arch, features_text: []const u8) !Cpu.Feature.Set { // Here we compute both and choose the correct result at the end, based // on whether or not we saw + and - signs. - var set: @Vector(2, Cpu.Feature.Set) = [2]Cpu.Feature.Set{ 0, arch.baselineFeatures() }; + var whitelist_set = Cpu.Feature.Set.empty(); + var baseline_set = arch.baselineFeatures(); var mode: enum { unknown, baseline, @@ -257,10 +258,15 @@ pub const Target = union(enum) { } for (arch.allFeaturesList()) |feature, index| { if (mem.eql(u8, feature_name, feature.name)) { - const one_bit = @as(Cpu.Feature.Set, 1) << @intCast(u7, index); switch (op) { - .add => set |= @splat(2, one_bit), - .sub => set &= @splat(2, ~one_bit), + .add => { + baseline_set.addFeature(@intCast(u8, index)); + whitelist_set.addFeature(@intCast(u8, index)); + }, + .sub => { + baseline_set.removeFeature(@intCast(u8, index)); + whitelist_set.removeFeature(@intCast(u8, index)); + }, } break; } @@ -270,8 +276,8 @@ pub const Target = union(enum) { } return switch (mode) { - .unknown, .whitelist => set[0], - .baseline => set[1], + .unknown, .whitelist => whitelist_set, + .baseline => baseline_set, }; } @@ -413,21 +419,21 @@ pub const Target = union(enum) { /// 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, + .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, + .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, + .nvptx, .nvptx64 => &nvptx.all_features, + .wasm32, .wasm64 => &wasm.all_features, else => &[0]Cpu.Feature{}, }; @@ -439,10 +445,11 @@ pub const Target = union(enum) { return switch (arch) { .arm, .armeb, .thumb, .thumbeb => arm.cpu.generic.features, .aarch64, .aarch64_be, .aarch64_32 => aarch64.cpu.generic.features, - .avr => avr.cpu.generic.features, + .avr => avr.baseline_features, .bpfel, .bpfeb => bpf.cpu.generic.features, .hexagon => hexagon.cpu.generic.features, - .mips, .mipsel, .mips64, .mips64el => mips.cpu.generic.features, + .mips, .mipsel => mips.cpu.mips32.features, + .mips64, .mips64el => mips.cpu.mips64.features, .msp430 => msp430.cpu.generic.features, .powerpc, .powerpc64, .powerpc64le => powerpc.cpu.generic.features, .amdgcn => amdgpu.cpu.generic.features, @@ -452,10 +459,10 @@ pub const Target = union(enum) { .s390x => systemz.cpu.generic.features, .i386 => x86.cpu.pentium4.features, .x86_64 => x86.cpu.x86_64.features, - .nvptx, .nvptx64 => nvptx.cpu.generic.features, + .nvptx, .nvptx64 => nvptx.cpu.sm_20.features, .wasm32, .wasm64 => wasm.cpu.generic.features, - else => 0, + else => Cpu.Feature.Set.empty(), }; } @@ -522,24 +529,46 @@ pub const Target = union(enum) { dependencies: Set, /// A bit set of all the features. - pub const Set = u128; + pub const Set = struct { + bytes: [bit_count / 8]u8, - pub fn isEnabled(set: Set, arch_feature_index: u7) bool { - return (set & (@as(Set, 1) << arch_feature_index)) != 0; - } + pub const bit_count = 22 * 8; + + pub fn empty() Set { + return .{ .bytes = [1]u8{0} ** 22 }; + } + + pub fn isEnabled(set: Set, arch_feature_index: u8) bool { + const byte_index = arch_feature_index / 8; + const bit_index = @intCast(u3, arch_feature_index % 8); + return (set.bytes[byte_index] & (@as(u8, 1) << bit_index)) != 0; + } + + pub fn addFeature(set: *Set, arch_feature_index: u8) void { + const byte_index = arch_feature_index / 8; + const bit_index = @intCast(u3, arch_feature_index % 8); + set.bytes[byte_index] |= @as(u8, 1) << bit_index; + } + + pub fn removeFeature(set: *Set, arch_feature_index: u8) void { + const byte_index = arch_feature_index / 8; + const bit_index = @intCast(u3, arch_feature_index % 8); + set.bytes[byte_index] &= ~(@as(u8, 1) << bit_index); + } + }; pub fn feature_set_fns(comptime F: type) type { return struct { pub fn featureSet(features: []const F) Set { - var x: Set = 0; + var x = Set.empty(); for (features) |feature| { - x |= @as(Set, 1) << @enumToInt(feature); + x.addFeature(@enumToInt(feature)); } return x; } pub fn featureSetHas(set: Set, feature: F) bool { - return (set & (@as(Set, 1) << @enumToInt(feature))) != 0; + return set.isEnabled(@enumToInt(feature)); } }; } @@ -748,7 +777,7 @@ pub const Target = union(enum) { pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch { const info = @typeInfo(Arch); inline for (info.Union.fields) |field| { - if (mem.eql(u8, text, field.name)) { + if (mem.startsWith(u8, text, field.name)) { if (field.field_type == void) { return @as(Arch, @field(Arch, field.name)); } else { diff --git a/lib/std/target/aarch64.zig b/lib/std/target/aarch64.zig index 4d547b74c1..980465bb20 100644 --- a/lib/std/target/aarch64.zig +++ b/lib/std/target/aarch64.zig @@ -154,7 +154,7 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.a35)] = .{ .index = @enumToInt(Feature.a35), @@ -298,140 +298,140 @@ pub const all_features = blk: { .name = @tagName(Feature.aggressive_fma), .llvm_name = "aggressive-fma", .description = "Enable Aggressive FMA for floating-point.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{ .index = @enumToInt(Feature.alternate_sextload_cvt_f32_pattern), .name = @tagName(Feature.alternate_sextload_cvt_f32_pattern), .llvm_name = "alternate-sextload-cvt-f32-pattern", .description = "Use alternative pattern for sextload convert to f32", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.altnzcv)] = .{ .index = @enumToInt(Feature.altnzcv), .name = @tagName(Feature.altnzcv), .llvm_name = "altnzcv", .description = "Enable alternative NZCV format for floating point comparisons", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.am)] = .{ .index = @enumToInt(Feature.am), .name = @tagName(Feature.am), .llvm_name = "am", .description = "Enable v8.4-A Activity Monitors extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.arith_bcc_fusion)] = .{ .index = @enumToInt(Feature.arith_bcc_fusion), .name = @tagName(Feature.arith_bcc_fusion), .llvm_name = "arith-bcc-fusion", .description = "CPU fuses arithmetic+bcc operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.arith_cbz_fusion)] = .{ .index = @enumToInt(Feature.arith_cbz_fusion), .name = @tagName(Feature.arith_cbz_fusion), .llvm_name = "arith-cbz-fusion", .description = "CPU fuses arithmetic + cbz/cbnz operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.balance_fp_ops)] = .{ .index = @enumToInt(Feature.balance_fp_ops), .name = @tagName(Feature.balance_fp_ops), .llvm_name = "balance-fp-ops", .description = "balance mix of odd and even D-registers for fp multiply(-accumulate) ops", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.bti)] = .{ .index = @enumToInt(Feature.bti), .name = @tagName(Feature.bti), .llvm_name = "bti", .description = "Enable Branch Target Identification", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x10)] = .{ .index = @enumToInt(Feature.call_saved_x10), .name = @tagName(Feature.call_saved_x10), .llvm_name = "call-saved-x10", .description = "Make X10 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x11)] = .{ .index = @enumToInt(Feature.call_saved_x11), .name = @tagName(Feature.call_saved_x11), .llvm_name = "call-saved-x11", .description = "Make X11 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x12)] = .{ .index = @enumToInt(Feature.call_saved_x12), .name = @tagName(Feature.call_saved_x12), .llvm_name = "call-saved-x12", .description = "Make X12 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x13)] = .{ .index = @enumToInt(Feature.call_saved_x13), .name = @tagName(Feature.call_saved_x13), .llvm_name = "call-saved-x13", .description = "Make X13 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x14)] = .{ .index = @enumToInt(Feature.call_saved_x14), .name = @tagName(Feature.call_saved_x14), .llvm_name = "call-saved-x14", .description = "Make X14 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x15)] = .{ .index = @enumToInt(Feature.call_saved_x15), .name = @tagName(Feature.call_saved_x15), .llvm_name = "call-saved-x15", .description = "Make X15 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x18)] = .{ .index = @enumToInt(Feature.call_saved_x18), .name = @tagName(Feature.call_saved_x18), .llvm_name = "call-saved-x18", .description = "Make X18 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x8)] = .{ .index = @enumToInt(Feature.call_saved_x8), .name = @tagName(Feature.call_saved_x8), .llvm_name = "call-saved-x8", .description = "Make X8 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.call_saved_x9)] = .{ .index = @enumToInt(Feature.call_saved_x9), .name = @tagName(Feature.call_saved_x9), .llvm_name = "call-saved-x9", .description = "Make X9 callee saved.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ccdp)] = .{ .index = @enumToInt(Feature.ccdp), .name = @tagName(Feature.ccdp), .llvm_name = "ccdp", .description = "Enable v8.5 Cache Clean to Point of Deep Persistence", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ccidx)] = .{ .index = @enumToInt(Feature.ccidx), .name = @tagName(Feature.ccidx), .llvm_name = "ccidx", .description = "Enable v8.3-A Extend of the CCSIDR number of sets", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ccpp)] = .{ .index = @enumToInt(Feature.ccpp), .name = @tagName(Feature.ccpp), .llvm_name = "ccpp", .description = "Enable v8.2 data Cache Clean to Point of Persistence", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.complxnum)] = .{ .index = @enumToInt(Feature.complxnum), @@ -447,7 +447,7 @@ pub const all_features = blk: { .name = @tagName(Feature.crc), .llvm_name = "crc", .description = "Enable ARMv8 CRC-32 checksum instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.crypto)] = .{ .index = @enumToInt(Feature.crypto), @@ -465,7 +465,7 @@ pub const all_features = blk: { .name = @tagName(Feature.custom_cheap_as_move), .llvm_name = "custom-cheap-as-move", .description = "Use custom handling of cheap instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cyclone)] = .{ .index = @enumToInt(Feature.cyclone), @@ -493,21 +493,21 @@ pub const all_features = blk: { .name = @tagName(Feature.disable_latency_sched_heuristic), .llvm_name = "disable-latency-sched-heuristic", .description = "Disable latency scheduling heuristic", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dit)] = .{ .index = @enumToInt(Feature.dit), .name = @tagName(Feature.dit), .llvm_name = "dit", .description = "Enable v8.4-A Data Independent Timing instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dotprod)] = .{ .index = @enumToInt(Feature.dotprod), .name = @tagName(Feature.dotprod), .llvm_name = "dotprod", .description = "Enable dot product support", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.exynos_cheap_as_move)] = .{ .index = @enumToInt(Feature.exynos_cheap_as_move), @@ -626,21 +626,21 @@ pub const all_features = blk: { .name = @tagName(Feature.fmi), .llvm_name = "fmi", .description = "Enable v8.4-A Flag Manipulation Instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.force_32bit_jump_tables)] = .{ .index = @enumToInt(Feature.force_32bit_jump_tables), .name = @tagName(Feature.force_32bit_jump_tables), .llvm_name = "force-32bit-jump-tables", .description = "Force jump table entries to be 32-bits wide except at MinSize", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp_armv8)] = .{ .index = @enumToInt(Feature.fp_armv8), .name = @tagName(Feature.fp_armv8), .llvm_name = "fp-armv8", .description = "Enable ARMv8 FP", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp16fml)] = .{ .index = @enumToInt(Feature.fp16fml), @@ -656,7 +656,7 @@ pub const all_features = blk: { .name = @tagName(Feature.fptoint), .llvm_name = "fptoint", .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fullfp16)] = .{ .index = @enumToInt(Feature.fullfp16), @@ -672,42 +672,42 @@ pub const all_features = blk: { .name = @tagName(Feature.fuse_address), .llvm_name = "fuse-address", .description = "CPU fuses address generation and memory operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_aes)] = .{ .index = @enumToInt(Feature.fuse_aes), .name = @tagName(Feature.fuse_aes), .llvm_name = "fuse-aes", .description = "CPU fuses AES crypto operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_arith_logic)] = .{ .index = @enumToInt(Feature.fuse_arith_logic), .name = @tagName(Feature.fuse_arith_logic), .llvm_name = "fuse-arith-logic", .description = "CPU fuses arithmetic and logic operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_crypto_eor)] = .{ .index = @enumToInt(Feature.fuse_crypto_eor), .name = @tagName(Feature.fuse_crypto_eor), .llvm_name = "fuse-crypto-eor", .description = "CPU fuses AES/PMULL and EOR operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_csel)] = .{ .index = @enumToInt(Feature.fuse_csel), .name = @tagName(Feature.fuse_csel), .llvm_name = "fuse-csel", .description = "CPU fuses conditional select operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_literals)] = .{ .index = @enumToInt(Feature.fuse_literals), .name = @tagName(Feature.fuse_literals), .llvm_name = "fuse-literals", .description = "CPU fuses literal generation operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.jsconv)] = .{ .index = @enumToInt(Feature.jsconv), @@ -741,35 +741,35 @@ pub const all_features = blk: { .name = @tagName(Feature.lor), .llvm_name = "lor", .description = "Enables ARM v8.1 Limited Ordering Regions extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lse)] = .{ .index = @enumToInt(Feature.lse), .name = @tagName(Feature.lse), .llvm_name = "lse", .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lsl_fast)] = .{ .index = @enumToInt(Feature.lsl_fast), .name = @tagName(Feature.lsl_fast), .llvm_name = "lsl-fast", .description = "CPU has a fastpath logical shift of up to 3 places", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mpam)] = .{ .index = @enumToInt(Feature.mpam), .name = @tagName(Feature.mpam), .llvm_name = "mpam", .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mte)] = .{ .index = @enumToInt(Feature.mte), .name = @tagName(Feature.mte), .llvm_name = "mte", .description = "Enable Memory Tagging Extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.neon)] = .{ .index = @enumToInt(Feature.neon), @@ -785,28 +785,28 @@ pub const all_features = blk: { .name = @tagName(Feature.no_neg_immediates), .llvm_name = "no-neg-immediates", .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nv)] = .{ .index = @enumToInt(Feature.nv), .name = @tagName(Feature.nv), .llvm_name = "nv", .description = "Enable v8.4-A Nested Virtualization Enchancement", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pa)] = .{ .index = @enumToInt(Feature.pa), .name = @tagName(Feature.pa), .llvm_name = "pa", .description = "Enable v8.3-A Pointer Authentication enchancement", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pan)] = .{ .index = @enumToInt(Feature.pan), .name = @tagName(Feature.pan), .llvm_name = "pan", .description = "Enables ARM v8.1 Privileged Access-Never extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pan_rwv)] = .{ .index = @enumToInt(Feature.pan_rwv), @@ -822,35 +822,35 @@ pub const all_features = blk: { .name = @tagName(Feature.perfmon), .llvm_name = "perfmon", .description = "Enable ARMv8 PMUv3 Performance Monitors extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.predictable_select_expensive)] = .{ .index = @enumToInt(Feature.predictable_select_expensive), .name = @tagName(Feature.predictable_select_expensive), .llvm_name = "predictable-select-expensive", .description = "Prefer likely predicted branches over selects", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.predres)] = .{ .index = @enumToInt(Feature.predres), .name = @tagName(Feature.predres), .llvm_name = "predres", .description = "Enable v8.5a execution and data prediction invalidation instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rand)] = .{ .index = @enumToInt(Feature.rand), .name = @tagName(Feature.rand), .llvm_name = "rand", .description = "Enable Random Number generation instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ras)] = .{ .index = @enumToInt(Feature.ras), .name = @tagName(Feature.ras), .llvm_name = "ras", .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rasv8_4)] = .{ .index = @enumToInt(Feature.rasv8_4), @@ -866,7 +866,7 @@ pub const all_features = blk: { .name = @tagName(Feature.rcpc), .llvm_name = "rcpc", .description = "Enable support for RCPC extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rcpc_immo)] = .{ .index = @enumToInt(Feature.rcpc_immo), @@ -882,175 +882,175 @@ pub const all_features = blk: { .name = @tagName(Feature.rdm), .llvm_name = "rdm", .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x1)] = .{ .index = @enumToInt(Feature.reserve_x1), .name = @tagName(Feature.reserve_x1), .llvm_name = "reserve-x1", .description = "Reserve X1, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x10)] = .{ .index = @enumToInt(Feature.reserve_x10), .name = @tagName(Feature.reserve_x10), .llvm_name = "reserve-x10", .description = "Reserve X10, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x11)] = .{ .index = @enumToInt(Feature.reserve_x11), .name = @tagName(Feature.reserve_x11), .llvm_name = "reserve-x11", .description = "Reserve X11, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x12)] = .{ .index = @enumToInt(Feature.reserve_x12), .name = @tagName(Feature.reserve_x12), .llvm_name = "reserve-x12", .description = "Reserve X12, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x13)] = .{ .index = @enumToInt(Feature.reserve_x13), .name = @tagName(Feature.reserve_x13), .llvm_name = "reserve-x13", .description = "Reserve X13, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x14)] = .{ .index = @enumToInt(Feature.reserve_x14), .name = @tagName(Feature.reserve_x14), .llvm_name = "reserve-x14", .description = "Reserve X14, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x15)] = .{ .index = @enumToInt(Feature.reserve_x15), .name = @tagName(Feature.reserve_x15), .llvm_name = "reserve-x15", .description = "Reserve X15, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x18)] = .{ .index = @enumToInt(Feature.reserve_x18), .name = @tagName(Feature.reserve_x18), .llvm_name = "reserve-x18", .description = "Reserve X18, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x2)] = .{ .index = @enumToInt(Feature.reserve_x2), .name = @tagName(Feature.reserve_x2), .llvm_name = "reserve-x2", .description = "Reserve X2, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x20)] = .{ .index = @enumToInt(Feature.reserve_x20), .name = @tagName(Feature.reserve_x20), .llvm_name = "reserve-x20", .description = "Reserve X20, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x21)] = .{ .index = @enumToInt(Feature.reserve_x21), .name = @tagName(Feature.reserve_x21), .llvm_name = "reserve-x21", .description = "Reserve X21, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x22)] = .{ .index = @enumToInt(Feature.reserve_x22), .name = @tagName(Feature.reserve_x22), .llvm_name = "reserve-x22", .description = "Reserve X22, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x23)] = .{ .index = @enumToInt(Feature.reserve_x23), .name = @tagName(Feature.reserve_x23), .llvm_name = "reserve-x23", .description = "Reserve X23, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x24)] = .{ .index = @enumToInt(Feature.reserve_x24), .name = @tagName(Feature.reserve_x24), .llvm_name = "reserve-x24", .description = "Reserve X24, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x25)] = .{ .index = @enumToInt(Feature.reserve_x25), .name = @tagName(Feature.reserve_x25), .llvm_name = "reserve-x25", .description = "Reserve X25, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x26)] = .{ .index = @enumToInt(Feature.reserve_x26), .name = @tagName(Feature.reserve_x26), .llvm_name = "reserve-x26", .description = "Reserve X26, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x27)] = .{ .index = @enumToInt(Feature.reserve_x27), .name = @tagName(Feature.reserve_x27), .llvm_name = "reserve-x27", .description = "Reserve X27, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x28)] = .{ .index = @enumToInt(Feature.reserve_x28), .name = @tagName(Feature.reserve_x28), .llvm_name = "reserve-x28", .description = "Reserve X28, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x3)] = .{ .index = @enumToInt(Feature.reserve_x3), .name = @tagName(Feature.reserve_x3), .llvm_name = "reserve-x3", .description = "Reserve X3, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x4)] = .{ .index = @enumToInt(Feature.reserve_x4), .name = @tagName(Feature.reserve_x4), .llvm_name = "reserve-x4", .description = "Reserve X4, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x5)] = .{ .index = @enumToInt(Feature.reserve_x5), .name = @tagName(Feature.reserve_x5), .llvm_name = "reserve-x5", .description = "Reserve X5, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x6)] = .{ .index = @enumToInt(Feature.reserve_x6), .name = @tagName(Feature.reserve_x6), .llvm_name = "reserve-x6", .description = "Reserve X6, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x7)] = .{ .index = @enumToInt(Feature.reserve_x7), .name = @tagName(Feature.reserve_x7), .llvm_name = "reserve-x7", .description = "Reserve X7, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_x9)] = .{ .index = @enumToInt(Feature.reserve_x9), .name = @tagName(Feature.reserve_x9), .llvm_name = "reserve-x9", .description = "Reserve X9, making it unavailable as a GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.saphira)] = .{ .index = @enumToInt(Feature.saphira), @@ -1076,14 +1076,14 @@ pub const all_features = blk: { .name = @tagName(Feature.sb), .llvm_name = "sb", .description = "Enable v8.5 Speculation Barrier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sel2)] = .{ .index = @enumToInt(Feature.sel2), .name = @tagName(Feature.sel2), .llvm_name = "sel2", .description = "Enable v8.4-A Secure Exception Level 2 extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sha2)] = .{ .index = @enumToInt(Feature.sha2), @@ -1109,21 +1109,21 @@ pub const all_features = blk: { .name = @tagName(Feature.slow_misaligned_128store), .llvm_name = "slow-misaligned-128store", .description = "Misaligned 128 bit stores are slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_paired_128)] = .{ .index = @enumToInt(Feature.slow_paired_128), .name = @tagName(Feature.slow_paired_128), .llvm_name = "slow-paired-128", .description = "Paired 128 bit loads and stores are slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_strqro_store)] = .{ .index = @enumToInt(Feature.slow_strqro_store), .name = @tagName(Feature.slow_strqro_store), .llvm_name = "slow-strqro-store", .description = "STR of Q register with register offset is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm4)] = .{ .index = @enumToInt(Feature.sm4), @@ -1139,35 +1139,35 @@ pub const all_features = blk: { .name = @tagName(Feature.spe), .llvm_name = "spe", .description = "Enable Statistical Profiling extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.specrestrict)] = .{ .index = @enumToInt(Feature.specrestrict), .name = @tagName(Feature.specrestrict), .llvm_name = "specrestrict", .description = "Enable architectural speculation restriction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ssbs)] = .{ .index = @enumToInt(Feature.ssbs), .name = @tagName(Feature.ssbs), .llvm_name = "ssbs", .description = "Enable Speculative Store Bypass Safe bit", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.strict_align)] = .{ .index = @enumToInt(Feature.strict_align), .name = @tagName(Feature.strict_align), .llvm_name = "strict-align", .description = "Disallow all unaligned memory access", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sve)] = .{ .index = @enumToInt(Feature.sve), .name = @tagName(Feature.sve), .llvm_name = "sve", .description = "Enable Scalable Vector Extension (SVE) instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sve2)] = .{ .index = @enumToInt(Feature.sve2), @@ -1300,35 +1300,35 @@ pub const all_features = blk: { .name = @tagName(Feature.tlb_rmi), .llvm_name = "tlb-rmi", .description = "Enable v8.4-A TLB Range and Maintenance Instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tpidr_el1)] = .{ .index = @enumToInt(Feature.tpidr_el1), .name = @tagName(Feature.tpidr_el1), .llvm_name = "tpidr-el1", .description = "Permit use of TPIDR_EL1 for the TLS base", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tpidr_el2)] = .{ .index = @enumToInt(Feature.tpidr_el2), .name = @tagName(Feature.tpidr_el2), .llvm_name = "tpidr-el2", .description = "Permit use of TPIDR_EL2 for the TLS base", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tpidr_el3)] = .{ .index = @enumToInt(Feature.tpidr_el3), .name = @tagName(Feature.tpidr_el3), .llvm_name = "tpidr-el3", .description = "Permit use of TPIDR_EL3 for the TLS base", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tracev8_4)] = .{ .index = @enumToInt(Feature.tracev8_4), .name = @tagName(Feature.tracev8_4), .llvm_name = "tracev8.4", .description = "Enable v8.4-A Trace extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tsv110)] = .{ .index = @enumToInt(Feature.tsv110), @@ -1355,28 +1355,28 @@ pub const all_features = blk: { .name = @tagName(Feature.uaops), .llvm_name = "uaops", .description = "Enable v8.2 UAO PState", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_aa)] = .{ .index = @enumToInt(Feature.use_aa), .name = @tagName(Feature.use_aa), .llvm_name = "use-aa", .description = "Use alias analysis during codegen", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_postra_scheduler)] = .{ .index = @enumToInt(Feature.use_postra_scheduler), .name = @tagName(Feature.use_postra_scheduler), .llvm_name = "use-postra-scheduler", .description = "Schedule again after register allocation", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_reciprocal_square_root)] = .{ .index = @enumToInt(Feature.use_reciprocal_square_root), .name = @tagName(Feature.use_reciprocal_square_root), .llvm_name = "use-reciprocal-square-root", .description = "Use the reciprocal square root approximation", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v8_1a)] = .{ .index = @enumToInt(Feature.v8_1a), @@ -1461,14 +1461,14 @@ pub const all_features = blk: { .name = @tagName(Feature.vh), .llvm_name = "vh", .description = "Enables ARM v8.1 Virtual Host extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.zcm)] = .{ .index = @enumToInt(Feature.zcm), .name = @tagName(Feature.zcm), .llvm_name = "zcm", .description = "Has zero-cycle register moves", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.zcz)] = .{ .index = @enumToInt(Feature.zcz), @@ -1485,21 +1485,21 @@ pub const all_features = blk: { .name = @tagName(Feature.zcz_fp), .llvm_name = "zcz-fp", .description = "Has zero-cycle zeroing instructions for FP registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.zcz_fp_workaround)] = .{ .index = @enumToInt(Feature.zcz_fp_workaround), .name = @tagName(Feature.zcz_fp_workaround), .llvm_name = "zcz-fp-workaround", .description = "The zero-cycle floating-point zeroing instruction has a bug", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.zcz_gp)] = .{ .index = @enumToInt(Feature.zcz_gp), .name = @tagName(Feature.zcz_gp), .llvm_name = "zcz-gp", .description = "Has zero-cycle zeroing instructions for generic registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; diff --git a/lib/std/target/amdgpu.zig b/lib/std/target/amdgpu.zig index 6175456a17..b1953ca83e 100644 --- a/lib/std/target/amdgpu.zig +++ b/lib/std/target/amdgpu.zig @@ -115,224 +115,224 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.@"16_bit_insts")] = .{ .index = @enumToInt(Feature.@"16_bit_insts"), .name = @tagName(Feature.@"16_bit_insts"), .llvm_name = "16-bit-insts", .description = "Has i16/f16 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.DumpCode)] = .{ .index = @enumToInt(Feature.DumpCode), .name = @tagName(Feature.DumpCode), .llvm_name = "DumpCode", .description = "Dump MachineInstrs in the CodeEmitter", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.add_no_carry_insts)] = .{ .index = @enumToInt(Feature.add_no_carry_insts), .name = @tagName(Feature.add_no_carry_insts), .llvm_name = "add-no-carry-insts", .description = "Have VALU add/sub instructions without carry out", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.aperture_regs)] = .{ .index = @enumToInt(Feature.aperture_regs), .name = @tagName(Feature.aperture_regs), .llvm_name = "aperture-regs", .description = "Has Memory Aperture Base and Size Registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.atomic_fadd_insts)] = .{ .index = @enumToInt(Feature.atomic_fadd_insts), .name = @tagName(Feature.atomic_fadd_insts), .llvm_name = "atomic-fadd-insts", .description = "Has buffer_atomic_add_f32, buffer_atomic_pk_add_f16, global_atomic_add_f32, global_atomic_pk_add_f16 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.auto_waitcnt_before_barrier)] = .{ .index = @enumToInt(Feature.auto_waitcnt_before_barrier), .name = @tagName(Feature.auto_waitcnt_before_barrier), .llvm_name = "auto-waitcnt-before-barrier", .description = "Hardware automatically inserts waitcnt before barrier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ci_insts)] = .{ .index = @enumToInt(Feature.ci_insts), .name = @tagName(Feature.ci_insts), .llvm_name = "ci-insts", .description = "Additional instructions for CI+", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.code_object_v3)] = .{ .index = @enumToInt(Feature.code_object_v3), .name = @tagName(Feature.code_object_v3), .llvm_name = "code-object-v3", .description = "Generate code object version 3", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cumode)] = .{ .index = @enumToInt(Feature.cumode), .name = @tagName(Feature.cumode), .llvm_name = "cumode", .description = "Enable CU wavefront execution mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dl_insts)] = .{ .index = @enumToInt(Feature.dl_insts), .name = @tagName(Feature.dl_insts), .llvm_name = "dl-insts", .description = "Has v_fmac_f32 and v_xnor_b32 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot1_insts)] = .{ .index = @enumToInt(Feature.dot1_insts), .name = @tagName(Feature.dot1_insts), .llvm_name = "dot1-insts", .description = "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot2_insts)] = .{ .index = @enumToInt(Feature.dot2_insts), .name = @tagName(Feature.dot2_insts), .llvm_name = "dot2-insts", .description = "Has v_dot2_f32_f16, v_dot2_i32_i16, v_dot2_u32_u16, v_dot4_u32_u8, v_dot8_u32_u4 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot3_insts)] = .{ .index = @enumToInt(Feature.dot3_insts), .name = @tagName(Feature.dot3_insts), .llvm_name = "dot3-insts", .description = "Has v_dot8c_i32_i4 instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot4_insts)] = .{ .index = @enumToInt(Feature.dot4_insts), .name = @tagName(Feature.dot4_insts), .llvm_name = "dot4-insts", .description = "Has v_dot2c_i32_i16 instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot5_insts)] = .{ .index = @enumToInt(Feature.dot5_insts), .name = @tagName(Feature.dot5_insts), .llvm_name = "dot5-insts", .description = "Has v_dot2c_f32_f16 instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dot6_insts)] = .{ .index = @enumToInt(Feature.dot6_insts), .name = @tagName(Feature.dot6_insts), .llvm_name = "dot6-insts", .description = "Has v_dot4c_i32_i8 instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dpp)] = .{ .index = @enumToInt(Feature.dpp), .name = @tagName(Feature.dpp), .llvm_name = "dpp", .description = "Support DPP (Data Parallel Primitives) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dpp8)] = .{ .index = @enumToInt(Feature.dpp8), .name = @tagName(Feature.dpp8), .llvm_name = "dpp8", .description = "Support DPP8 (Data Parallel Primitives) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dumpcode)] = .{ .index = @enumToInt(Feature.dumpcode), .name = @tagName(Feature.dumpcode), .llvm_name = "dumpcode", .description = "Dump MachineInstrs in the CodeEmitter", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.enable_ds128)] = .{ .index = @enumToInt(Feature.enable_ds128), .name = @tagName(Feature.enable_ds128), .llvm_name = "enable-ds128", .description = "Use ds_read|write_b128", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.enable_prt_strict_null)] = .{ .index = @enumToInt(Feature.enable_prt_strict_null), .name = @tagName(Feature.enable_prt_strict_null), .llvm_name = "enable-prt-strict-null", .description = "Enable zeroing of result registers for sparse texture fetches", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_fmaf)] = .{ .index = @enumToInt(Feature.fast_fmaf), .name = @tagName(Feature.fast_fmaf), .llvm_name = "fast-fmaf", .description = "Assuming f32 fma is at least as fast as mul + add", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_address_space)] = .{ .index = @enumToInt(Feature.flat_address_space), .name = @tagName(Feature.flat_address_space), .llvm_name = "flat-address-space", .description = "Support flat address space", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_for_global)] = .{ .index = @enumToInt(Feature.flat_for_global), .name = @tagName(Feature.flat_for_global), .llvm_name = "flat-for-global", .description = "Force to generate flat instruction for global", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_global_insts)] = .{ .index = @enumToInt(Feature.flat_global_insts), .name = @tagName(Feature.flat_global_insts), .llvm_name = "flat-global-insts", .description = "Have global_* flat memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_inst_offsets)] = .{ .index = @enumToInt(Feature.flat_inst_offsets), .name = @tagName(Feature.flat_inst_offsets), .llvm_name = "flat-inst-offsets", .description = "Flat instructions have immediate offset addressing mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_scratch_insts)] = .{ .index = @enumToInt(Feature.flat_scratch_insts), .name = @tagName(Feature.flat_scratch_insts), .llvm_name = "flat-scratch-insts", .description = "Have scratch_* flat memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.flat_segment_offset_bug)] = .{ .index = @enumToInt(Feature.flat_segment_offset_bug), .name = @tagName(Feature.flat_segment_offset_bug), .llvm_name = "flat-segment-offset-bug", .description = "GFX10 bug, inst_offset ignored in flat segment", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fma_mix_insts)] = .{ .index = @enumToInt(Feature.fma_mix_insts), .name = @tagName(Feature.fma_mix_insts), .llvm_name = "fma-mix-insts", .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fmaf)] = .{ .index = @enumToInt(Feature.fmaf), .name = @tagName(Feature.fmaf), .llvm_name = "fmaf", .description = "Enable single precision FMA (not as fast as mul+add, but fused)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp_exceptions)] = .{ .index = @enumToInt(Feature.fp_exceptions), .name = @tagName(Feature.fp_exceptions), .llvm_name = "fp-exceptions", .description = "Enable floating point exceptions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp16_denormals)] = .{ .index = @enumToInt(Feature.fp16_denormals), @@ -348,14 +348,14 @@ pub const all_features = blk: { .name = @tagName(Feature.fp32_denormals), .llvm_name = "fp32-denormals", .description = "Enable single precision denormal handling", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp64)] = .{ .index = @enumToInt(Feature.fp64), .name = @tagName(Feature.fp64), .llvm_name = "fp64", .description = "Enable double precision operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp64_denormals)] = .{ .index = @enumToInt(Feature.fp64_denormals), @@ -381,7 +381,7 @@ pub const all_features = blk: { .name = @tagName(Feature.gcn3_encoding), .llvm_name = "gcn3-encoding", .description = "Encoding format for VI", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gfx10)] = .{ .index = @enumToInt(Feature.gfx10), @@ -430,21 +430,21 @@ pub const all_features = blk: { .name = @tagName(Feature.gfx10_insts), .llvm_name = "gfx10-insts", .description = "Additional instructions for GFX10+", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{ .index = @enumToInt(Feature.gfx7_gfx8_gfx9_insts), .name = @tagName(Feature.gfx7_gfx8_gfx9_insts), .llvm_name = "gfx7-gfx8-gfx9-insts", .description = "Instructions shared in GFX7, GFX8, GFX9", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gfx8_insts)] = .{ .index = @enumToInt(Feature.gfx8_insts), .name = @tagName(Feature.gfx8_insts), .llvm_name = "gfx8-insts", .description = "Additional instructions for GFX8+", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gfx9)] = .{ .index = @enumToInt(Feature.gfx9), @@ -489,287 +489,287 @@ pub const all_features = blk: { .name = @tagName(Feature.gfx9_insts), .llvm_name = "gfx9-insts", .description = "Additional instructions for GFX9+", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.half_rate_64_ops)] = .{ .index = @enumToInt(Feature.half_rate_64_ops), .name = @tagName(Feature.half_rate_64_ops), .llvm_name = "half-rate-64-ops", .description = "Most fp64 instructions are half rate instead of quarter", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{ .index = @enumToInt(Feature.inst_fwd_prefetch_bug), .name = @tagName(Feature.inst_fwd_prefetch_bug), .llvm_name = "inst-fwd-prefetch-bug", .description = "S_INST_PREFETCH instruction causes shader to hang", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.int_clamp_insts)] = .{ .index = @enumToInt(Feature.int_clamp_insts), .name = @tagName(Feature.int_clamp_insts), .llvm_name = "int-clamp-insts", .description = "Support clamp for integer destination", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.inv_2pi_inline_imm)] = .{ .index = @enumToInt(Feature.inv_2pi_inline_imm), .name = @tagName(Feature.inv_2pi_inline_imm), .llvm_name = "inv-2pi-inline-imm", .description = "Has 1 / (2 * pi) as inline immediate", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lds_branch_vmem_war_hazard)] = .{ .index = @enumToInt(Feature.lds_branch_vmem_war_hazard), .name = @tagName(Feature.lds_branch_vmem_war_hazard), .llvm_name = "lds-branch-vmem-war-hazard", .description = "Switching between LDS and VMEM-tex not waiting VM_VSRC=0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lds_misaligned_bug)] = .{ .index = @enumToInt(Feature.lds_misaligned_bug), .name = @tagName(Feature.lds_misaligned_bug), .llvm_name = "lds-misaligned-bug", .description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ldsbankcount16)] = .{ .index = @enumToInt(Feature.ldsbankcount16), .name = @tagName(Feature.ldsbankcount16), .llvm_name = "ldsbankcount16", .description = "The number of LDS banks per compute unit.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ldsbankcount32)] = .{ .index = @enumToInt(Feature.ldsbankcount32), .name = @tagName(Feature.ldsbankcount32), .llvm_name = "ldsbankcount32", .description = "The number of LDS banks per compute unit.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.load_store_opt)] = .{ .index = @enumToInt(Feature.load_store_opt), .name = @tagName(Feature.load_store_opt), .llvm_name = "load-store-opt", .description = "Enable SI load/store optimizer pass", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.localmemorysize0)] = .{ .index = @enumToInt(Feature.localmemorysize0), .name = @tagName(Feature.localmemorysize0), .llvm_name = "localmemorysize0", .description = "The size of local memory in bytes", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.localmemorysize32768)] = .{ .index = @enumToInt(Feature.localmemorysize32768), .name = @tagName(Feature.localmemorysize32768), .llvm_name = "localmemorysize32768", .description = "The size of local memory in bytes", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.localmemorysize65536)] = .{ .index = @enumToInt(Feature.localmemorysize65536), .name = @tagName(Feature.localmemorysize65536), .llvm_name = "localmemorysize65536", .description = "The size of local memory in bytes", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mad_mix_insts)] = .{ .index = @enumToInt(Feature.mad_mix_insts), .name = @tagName(Feature.mad_mix_insts), .llvm_name = "mad-mix-insts", .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mai_insts)] = .{ .index = @enumToInt(Feature.mai_insts), .name = @tagName(Feature.mai_insts), .llvm_name = "mai-insts", .description = "Has mAI instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.max_private_element_size_16)] = .{ .index = @enumToInt(Feature.max_private_element_size_16), .name = @tagName(Feature.max_private_element_size_16), .llvm_name = "max-private-element-size-16", .description = "Maximum private access size may be 16", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.max_private_element_size_4)] = .{ .index = @enumToInt(Feature.max_private_element_size_4), .name = @tagName(Feature.max_private_element_size_4), .llvm_name = "max-private-element-size-4", .description = "Maximum private access size may be 4", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.max_private_element_size_8)] = .{ .index = @enumToInt(Feature.max_private_element_size_8), .name = @tagName(Feature.max_private_element_size_8), .llvm_name = "max-private-element-size-8", .description = "Maximum private access size may be 8", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mimg_r128)] = .{ .index = @enumToInt(Feature.mimg_r128), .name = @tagName(Feature.mimg_r128), .llvm_name = "mimg-r128", .description = "Support 128-bit texture resources", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.movrel)] = .{ .index = @enumToInt(Feature.movrel), .name = @tagName(Feature.movrel), .llvm_name = "movrel", .description = "Has v_movrel*_b32 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_data_dep_hazard)] = .{ .index = @enumToInt(Feature.no_data_dep_hazard), .name = @tagName(Feature.no_data_dep_hazard), .llvm_name = "no-data-dep-hazard", .description = "Does not need SW waitstates", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_sdst_cmpx)] = .{ .index = @enumToInt(Feature.no_sdst_cmpx), .name = @tagName(Feature.no_sdst_cmpx), .llvm_name = "no-sdst-cmpx", .description = "V_CMPX does not write VCC/SGPR in addition to EXEC", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_sram_ecc_support)] = .{ .index = @enumToInt(Feature.no_sram_ecc_support), .name = @tagName(Feature.no_sram_ecc_support), .llvm_name = "no-sram-ecc-support", .description = "Hardware does not support SRAM ECC", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_xnack_support)] = .{ .index = @enumToInt(Feature.no_xnack_support), .name = @tagName(Feature.no_xnack_support), .llvm_name = "no-xnack-support", .description = "Hardware does not support XNACK", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nsa_encoding)] = .{ .index = @enumToInt(Feature.nsa_encoding), .name = @tagName(Feature.nsa_encoding), .llvm_name = "nsa-encoding", .description = "Support NSA encoding for image instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nsa_to_vmem_bug)] = .{ .index = @enumToInt(Feature.nsa_to_vmem_bug), .name = @tagName(Feature.nsa_to_vmem_bug), .llvm_name = "nsa-to-vmem-bug", .description = "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.offset_3f_bug)] = .{ .index = @enumToInt(Feature.offset_3f_bug), .name = @tagName(Feature.offset_3f_bug), .llvm_name = "offset-3f-bug", .description = "Branch offset of 3f hardware bug", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pk_fmac_f16_inst)] = .{ .index = @enumToInt(Feature.pk_fmac_f16_inst), .name = @tagName(Feature.pk_fmac_f16_inst), .llvm_name = "pk-fmac-f16-inst", .description = "Has v_pk_fmac_f16 instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.promote_alloca)] = .{ .index = @enumToInt(Feature.promote_alloca), .name = @tagName(Feature.promote_alloca), .llvm_name = "promote-alloca", .description = "Enable promote alloca pass", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.r128_a16)] = .{ .index = @enumToInt(Feature.r128_a16), .name = @tagName(Feature.r128_a16), .llvm_name = "r128-a16", .description = "Support 16 bit coordindates/gradients/lod/clamp/mip types on gfx9", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.register_banking)] = .{ .index = @enumToInt(Feature.register_banking), .name = @tagName(Feature.register_banking), .llvm_name = "register-banking", .description = "Has register banking", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.s_memrealtime)] = .{ .index = @enumToInt(Feature.s_memrealtime), .name = @tagName(Feature.s_memrealtime), .llvm_name = "s-memrealtime", .description = "Has s_memrealtime instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.scalar_atomics)] = .{ .index = @enumToInt(Feature.scalar_atomics), .name = @tagName(Feature.scalar_atomics), .llvm_name = "scalar-atomics", .description = "Has atomic scalar memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.scalar_flat_scratch_insts)] = .{ .index = @enumToInt(Feature.scalar_flat_scratch_insts), .name = @tagName(Feature.scalar_flat_scratch_insts), .llvm_name = "scalar-flat-scratch-insts", .description = "Have s_scratch_* flat memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.scalar_stores)] = .{ .index = @enumToInt(Feature.scalar_stores), .name = @tagName(Feature.scalar_stores), .llvm_name = "scalar-stores", .description = "Has store scalar memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa)] = .{ .index = @enumToInt(Feature.sdwa), .name = @tagName(Feature.sdwa), .llvm_name = "sdwa", .description = "Support SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa_mav)] = .{ .index = @enumToInt(Feature.sdwa_mav), .name = @tagName(Feature.sdwa_mav), .llvm_name = "sdwa-mav", .description = "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa_omod)] = .{ .index = @enumToInt(Feature.sdwa_omod), .name = @tagName(Feature.sdwa_omod), .llvm_name = "sdwa-omod", .description = "Support OMod with SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa_out_mods_vopc)] = .{ .index = @enumToInt(Feature.sdwa_out_mods_vopc), .name = @tagName(Feature.sdwa_out_mods_vopc), .llvm_name = "sdwa-out-mods-vopc", .description = "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa_scalar)] = .{ .index = @enumToInt(Feature.sdwa_scalar), .name = @tagName(Feature.sdwa_scalar), .llvm_name = "sdwa-scalar", .description = "Support scalar register with SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sdwa_sdst)] = .{ .index = @enumToInt(Feature.sdwa_sdst), .name = @tagName(Feature.sdwa_sdst), .llvm_name = "sdwa-sdst", .description = "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sea_islands)] = .{ .index = @enumToInt(Feature.sea_islands), @@ -794,21 +794,21 @@ pub const all_features = blk: { .name = @tagName(Feature.sgpr_init_bug), .llvm_name = "sgpr-init-bug", .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.si_scheduler)] = .{ .index = @enumToInt(Feature.si_scheduler), .name = @tagName(Feature.si_scheduler), .llvm_name = "si-scheduler", .description = "Enable SI Machine Scheduler", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.smem_to_vector_write_hazard)] = .{ .index = @enumToInt(Feature.smem_to_vector_write_hazard), .name = @tagName(Feature.smem_to_vector_write_hazard), .llvm_name = "smem-to-vector-write-hazard", .description = "s_load_dword followed by v_cmp page faults", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.southern_islands)] = .{ .index = @enumToInt(Feature.southern_islands), @@ -832,77 +832,77 @@ pub const all_features = blk: { .name = @tagName(Feature.sram_ecc), .llvm_name = "sram-ecc", .description = "Enable SRAM ECC", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.trap_handler)] = .{ .index = @enumToInt(Feature.trap_handler), .name = @tagName(Feature.trap_handler), .llvm_name = "trap-handler", .description = "Trap handler support", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.trig_reduced_range)] = .{ .index = @enumToInt(Feature.trig_reduced_range), .name = @tagName(Feature.trig_reduced_range), .llvm_name = "trig-reduced-range", .description = "Requires use of fract on arguments to trig instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.unaligned_buffer_access)] = .{ .index = @enumToInt(Feature.unaligned_buffer_access), .name = @tagName(Feature.unaligned_buffer_access), .llvm_name = "unaligned-buffer-access", .description = "Support unaligned global loads and stores", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.unaligned_scratch_access)] = .{ .index = @enumToInt(Feature.unaligned_scratch_access), .name = @tagName(Feature.unaligned_scratch_access), .llvm_name = "unaligned-scratch-access", .description = "Support unaligned scratch loads and stores", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.unpacked_d16_vmem)] = .{ .index = @enumToInt(Feature.unpacked_d16_vmem), .name = @tagName(Feature.unpacked_d16_vmem), .llvm_name = "unpacked-d16-vmem", .description = "Has unpacked d16 vmem instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.unsafe_ds_offset_folding)] = .{ .index = @enumToInt(Feature.unsafe_ds_offset_folding), .name = @tagName(Feature.unsafe_ds_offset_folding), .llvm_name = "unsafe-ds-offset-folding", .description = "Force using DS instruction immediate offsets on SI", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vcmpx_exec_war_hazard)] = .{ .index = @enumToInt(Feature.vcmpx_exec_war_hazard), .name = @tagName(Feature.vcmpx_exec_war_hazard), .llvm_name = "vcmpx-exec-war-hazard", .description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vcmpx_permlane_hazard)] = .{ .index = @enumToInt(Feature.vcmpx_permlane_hazard), .name = @tagName(Feature.vcmpx_permlane_hazard), .llvm_name = "vcmpx-permlane-hazard", .description = "TODO: describe me", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vgpr_index_mode)] = .{ .index = @enumToInt(Feature.vgpr_index_mode), .name = @tagName(Feature.vgpr_index_mode), .llvm_name = "vgpr-index-mode", .description = "Has VGPR mode register indexing", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vmem_to_scalar_write_hazard)] = .{ .index = @enumToInt(Feature.vmem_to_scalar_write_hazard), .name = @tagName(Feature.vmem_to_scalar_write_hazard), .llvm_name = "vmem-to-scalar-write-hazard", .description = "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.volcanic_islands)] = .{ .index = @enumToInt(Feature.volcanic_islands), @@ -939,49 +939,49 @@ pub const all_features = blk: { .name = @tagName(Feature.vop3_literal), .llvm_name = "vop3-literal", .description = "Can use one literal in VOP3", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vop3p)] = .{ .index = @enumToInt(Feature.vop3p), .name = @tagName(Feature.vop3p), .llvm_name = "vop3p", .description = "Has VOP3P packed instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vscnt)] = .{ .index = @enumToInt(Feature.vscnt), .name = @tagName(Feature.vscnt), .llvm_name = "vscnt", .description = "Has separate store vscnt counter", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.wavefrontsize16)] = .{ .index = @enumToInt(Feature.wavefrontsize16), .name = @tagName(Feature.wavefrontsize16), .llvm_name = "wavefrontsize16", .description = "The number of threads per wavefront", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.wavefrontsize32)] = .{ .index = @enumToInt(Feature.wavefrontsize32), .name = @tagName(Feature.wavefrontsize32), .llvm_name = "wavefrontsize32", .description = "The number of threads per wavefront", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.wavefrontsize64)] = .{ .index = @enumToInt(Feature.wavefrontsize64), .name = @tagName(Feature.wavefrontsize64), .llvm_name = "wavefrontsize64", .description = "The number of threads per wavefront", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xnack)] = .{ .index = @enumToInt(Feature.xnack), .name = @tagName(Feature.xnack), .llvm_name = "xnack", .description = "Enable XNACK support", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; diff --git a/lib/std/target/arm.zig b/lib/std/target/arm.zig index de4bd0ed78..744d418d03 100644 --- a/lib/std/target/arm.zig +++ b/lib/std/target/arm.zig @@ -182,147 +182,147 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.@"32bit")] = .{ .index = @enumToInt(Feature.@"32bit"), .name = @tagName(Feature.@"32bit"), .llvm_name = "32bit", .description = "Prefer 32-bit Thumb instrs", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.@"8msecext")] = .{ .index = @enumToInt(Feature.@"8msecext"), .name = @tagName(Feature.@"8msecext"), .llvm_name = "8msecext", .description = "Enable support for ARMv8-M Security Extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a12)] = .{ .index = @enumToInt(Feature.a12), .name = @tagName(Feature.a12), .llvm_name = "a12", .description = "Cortex-A12 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a15)] = .{ .index = @enumToInt(Feature.a15), .name = @tagName(Feature.a15), .llvm_name = "a15", .description = "Cortex-A15 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a17)] = .{ .index = @enumToInt(Feature.a17), .name = @tagName(Feature.a17), .llvm_name = "a17", .description = "Cortex-A17 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a32)] = .{ .index = @enumToInt(Feature.a32), .name = @tagName(Feature.a32), .llvm_name = "a32", .description = "Cortex-A32 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a35)] = .{ .index = @enumToInt(Feature.a35), .name = @tagName(Feature.a35), .llvm_name = "a35", .description = "Cortex-A35 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a5)] = .{ .index = @enumToInt(Feature.a5), .name = @tagName(Feature.a5), .llvm_name = "a5", .description = "Cortex-A5 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a53)] = .{ .index = @enumToInt(Feature.a53), .name = @tagName(Feature.a53), .llvm_name = "a53", .description = "Cortex-A53 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a55)] = .{ .index = @enumToInt(Feature.a55), .name = @tagName(Feature.a55), .llvm_name = "a55", .description = "Cortex-A55 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a57)] = .{ .index = @enumToInt(Feature.a57), .name = @tagName(Feature.a57), .llvm_name = "a57", .description = "Cortex-A57 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a7)] = .{ .index = @enumToInt(Feature.a7), .name = @tagName(Feature.a7), .llvm_name = "a7", .description = "Cortex-A7 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a72)] = .{ .index = @enumToInt(Feature.a72), .name = @tagName(Feature.a72), .llvm_name = "a72", .description = "Cortex-A72 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a73)] = .{ .index = @enumToInt(Feature.a73), .name = @tagName(Feature.a73), .llvm_name = "a73", .description = "Cortex-A73 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a75)] = .{ .index = @enumToInt(Feature.a75), .name = @tagName(Feature.a75), .llvm_name = "a75", .description = "Cortex-A75 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a76)] = .{ .index = @enumToInt(Feature.a76), .name = @tagName(Feature.a76), .llvm_name = "a76", .description = "Cortex-A76 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a8)] = .{ .index = @enumToInt(Feature.a8), .name = @tagName(Feature.a8), .llvm_name = "a8", .description = "Cortex-A8 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a9)] = .{ .index = @enumToInt(Feature.a9), .name = @tagName(Feature.a9), .llvm_name = "a9", .description = "Cortex-A9 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.aclass)] = .{ .index = @enumToInt(Feature.aclass), .name = @tagName(Feature.aclass), .llvm_name = "aclass", .description = "Is application profile ('A' series)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.acquire_release)] = .{ .index = @enumToInt(Feature.acquire_release), .name = @tagName(Feature.acquire_release), .llvm_name = "acquire-release", .description = "Has v8 acquire/release (lda/ldaex etc) instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.aes)] = .{ .index = @enumToInt(Feature.aes), @@ -338,35 +338,35 @@ pub const all_features = blk: { .name = @tagName(Feature.armv2), .llvm_name = "armv2", .description = "ARMv2 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.armv2a)] = .{ .index = @enumToInt(Feature.armv2a), .name = @tagName(Feature.armv2a), .llvm_name = "armv2a", .description = "ARMv2a architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.armv3)] = .{ .index = @enumToInt(Feature.armv3), .name = @tagName(Feature.armv3), .llvm_name = "armv3", .description = "ARMv3 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.armv3m)] = .{ .index = @enumToInt(Feature.armv3m), .name = @tagName(Feature.armv3m), .llvm_name = "armv3m", .description = "ARMv3m architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.armv4)] = .{ .index = @enumToInt(Feature.armv4), .name = @tagName(Feature.armv4), .llvm_name = "armv4", .description = "ARMv4 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.armv4t)] = .{ .index = @enumToInt(Feature.armv4t), @@ -766,28 +766,28 @@ pub const all_features = blk: { .name = @tagName(Feature.avoid_movs_shop), .llvm_name = "avoid-movs-shop", .description = "Avoid movs instructions with shifter operand", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.avoid_partial_cpsr)] = .{ .index = @enumToInt(Feature.avoid_partial_cpsr), .name = @tagName(Feature.avoid_partial_cpsr), .llvm_name = "avoid-partial-cpsr", .description = "Avoid CPSR partial update for OOO execution", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cheap_predicable_cpsr)] = .{ .index = @enumToInt(Feature.cheap_predicable_cpsr), .name = @tagName(Feature.cheap_predicable_cpsr), .llvm_name = "cheap-predicable-cpsr", .description = "Disable +1 predication cost for instructions updating CPSR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.crc)] = .{ .index = @enumToInt(Feature.crc), .name = @tagName(Feature.crc), .llvm_name = "crc", .description = "Enable support for CRC instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.crypto)] = .{ .index = @enumToInt(Feature.crypto), @@ -805,35 +805,35 @@ pub const all_features = blk: { .name = @tagName(Feature.d32), .llvm_name = "d32", .description = "Extend FP to 32 double registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.db)] = .{ .index = @enumToInt(Feature.db), .name = @tagName(Feature.db), .llvm_name = "db", .description = "Has data barrier (dmb/dsb) instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dfb)] = .{ .index = @enumToInt(Feature.dfb), .name = @tagName(Feature.dfb), .llvm_name = "dfb", .description = "Has full data barrier (dfb) instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.disable_postra_scheduler)] = .{ .index = @enumToInt(Feature.disable_postra_scheduler), .name = @tagName(Feature.disable_postra_scheduler), .llvm_name = "disable-postra-scheduler", .description = "Don't schedule again after register allocation", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dont_widen_vmovs)] = .{ .index = @enumToInt(Feature.dont_widen_vmovs), .name = @tagName(Feature.dont_widen_vmovs), .llvm_name = "dont-widen-vmovs", .description = "Don't widen VMOVS to VMOVD", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dotprod)] = .{ .index = @enumToInt(Feature.dotprod), @@ -849,21 +849,21 @@ pub const all_features = blk: { .name = @tagName(Feature.dsp), .llvm_name = "dsp", .description = "Supports DSP instructions in ARM and/or Thumb2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.execute_only)] = .{ .index = @enumToInt(Feature.execute_only), .name = @tagName(Feature.execute_only), .llvm_name = "execute-only", .description = "Enable the generation of execute only code.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.expand_fp_mlx)] = .{ .index = @enumToInt(Feature.expand_fp_mlx), .name = @tagName(Feature.expand_fp_mlx), .llvm_name = "expand-fp-mlx", .description = "Expand VFP/NEON MLA/MLS instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.exynos)] = .{ .index = @enumToInt(Feature.exynos), @@ -937,7 +937,7 @@ pub const all_features = blk: { .name = @tagName(Feature.fp16), .llvm_name = "fp16", .description = "Enable half-precision floating point", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp16fml)] = .{ .index = @enumToInt(Feature.fp16fml), @@ -962,14 +962,14 @@ pub const all_features = blk: { .name = @tagName(Feature.fpao), .llvm_name = "fpao", .description = "Enable fast computation of positive address offsets", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fpregs)] = .{ .index = @enumToInt(Feature.fpregs), .name = @tagName(Feature.fpregs), .llvm_name = "fpregs", .description = "Enable FP registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fpregs16)] = .{ .index = @enumToInt(Feature.fpregs16), @@ -1004,28 +1004,28 @@ pub const all_features = blk: { .name = @tagName(Feature.fuse_aes), .llvm_name = "fuse-aes", .description = "CPU fuses AES crypto operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fuse_literals)] = .{ .index = @enumToInt(Feature.fuse_literals), .name = @tagName(Feature.fuse_literals), .llvm_name = "fuse-literals", .description = "CPU fuses literal generation operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hwdiv)] = .{ .index = @enumToInt(Feature.hwdiv), .name = @tagName(Feature.hwdiv), .llvm_name = "hwdiv", .description = "Enable divide instructions in Thumb", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hwdiv_arm)] = .{ .index = @enumToInt(Feature.hwdiv_arm), .name = @tagName(Feature.hwdiv_arm), .llvm_name = "hwdiv-arm", .description = "Enable divide instructions in ARM mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.iwmmxt)] = .{ .index = @enumToInt(Feature.iwmmxt), @@ -1050,63 +1050,63 @@ pub const all_features = blk: { .name = @tagName(Feature.krait), .llvm_name = "krait", .description = "Qualcomm Krait processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.kryo)] = .{ .index = @enumToInt(Feature.kryo), .name = @tagName(Feature.kryo), .llvm_name = "kryo", .description = "Qualcomm Kryo processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lob)] = .{ .index = @enumToInt(Feature.lob), .name = @tagName(Feature.lob), .llvm_name = "lob", .description = "Enable Low Overhead Branch extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.long_calls)] = .{ .index = @enumToInt(Feature.long_calls), .name = @tagName(Feature.long_calls), .llvm_name = "long-calls", .description = "Generate calls via indirect call instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.loop_align)] = .{ .index = @enumToInt(Feature.loop_align), .name = @tagName(Feature.loop_align), .llvm_name = "loop-align", .description = "Prefer 32-bit alignment for loops", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.m3)] = .{ .index = @enumToInt(Feature.m3), .name = @tagName(Feature.m3), .llvm_name = "m3", .description = "Cortex-M3 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mclass)] = .{ .index = @enumToInt(Feature.mclass), .name = @tagName(Feature.mclass), .llvm_name = "mclass", .description = "Is microcontroller profile ('M' series)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mp)] = .{ .index = @enumToInt(Feature.mp), .name = @tagName(Feature.mp), .llvm_name = "mp", .description = "Supports Multiprocessing extension", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.muxed_units)] = .{ .index = @enumToInt(Feature.muxed_units), .name = @tagName(Feature.muxed_units), .llvm_name = "muxed-units", .description = "Has muxed AGU and NEON/FPU", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mve)] = .{ .index = @enumToInt(Feature.mve), @@ -1136,7 +1136,7 @@ pub const all_features = blk: { .name = @tagName(Feature.nacl_trap), .llvm_name = "nacl-trap", .description = "NaCl trap", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.neon)] = .{ .index = @enumToInt(Feature.neon), @@ -1152,147 +1152,147 @@ pub const all_features = blk: { .name = @tagName(Feature.neon_fpmovs), .llvm_name = "neon-fpmovs", .description = "Convert VMOVSR, VMOVRS, VMOVS to NEON", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.neonfp)] = .{ .index = @enumToInt(Feature.neonfp), .name = @tagName(Feature.neonfp), .llvm_name = "neonfp", .description = "Use NEON for single precision FP", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_branch_predictor)] = .{ .index = @enumToInt(Feature.no_branch_predictor), .name = @tagName(Feature.no_branch_predictor), .llvm_name = "no-branch-predictor", .description = "Has no branch predictor", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_movt)] = .{ .index = @enumToInt(Feature.no_movt), .name = @tagName(Feature.no_movt), .llvm_name = "no-movt", .description = "Don't use movt/movw pairs for 32-bit imms", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_neg_immediates)] = .{ .index = @enumToInt(Feature.no_neg_immediates), .name = @tagName(Feature.no_neg_immediates), .llvm_name = "no-neg-immediates", .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.noarm)] = .{ .index = @enumToInt(Feature.noarm), .name = @tagName(Feature.noarm), .llvm_name = "noarm", .description = "Does not support ARM mode execution", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nonpipelined_vfp)] = .{ .index = @enumToInt(Feature.nonpipelined_vfp), .name = @tagName(Feature.nonpipelined_vfp), .llvm_name = "nonpipelined-vfp", .description = "VFP instructions are not pipelined", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.perfmon)] = .{ .index = @enumToInt(Feature.perfmon), .name = @tagName(Feature.perfmon), .llvm_name = "perfmon", .description = "Enable support for Performance Monitor extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prefer_ishst)] = .{ .index = @enumToInt(Feature.prefer_ishst), .name = @tagName(Feature.prefer_ishst), .llvm_name = "prefer-ishst", .description = "Prefer ISHST barriers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prefer_vmovsr)] = .{ .index = @enumToInt(Feature.prefer_vmovsr), .name = @tagName(Feature.prefer_vmovsr), .llvm_name = "prefer-vmovsr", .description = "Prefer VMOVSR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prof_unpr)] = .{ .index = @enumToInt(Feature.prof_unpr), .name = @tagName(Feature.prof_unpr), .llvm_name = "prof-unpr", .description = "Is profitable to unpredicate", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.r4)] = .{ .index = @enumToInt(Feature.r4), .name = @tagName(Feature.r4), .llvm_name = "r4", .description = "Cortex-R4 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.r5)] = .{ .index = @enumToInt(Feature.r5), .name = @tagName(Feature.r5), .llvm_name = "r5", .description = "Cortex-R5 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.r52)] = .{ .index = @enumToInt(Feature.r52), .name = @tagName(Feature.r52), .llvm_name = "r52", .description = "Cortex-R52 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.r7)] = .{ .index = @enumToInt(Feature.r7), .name = @tagName(Feature.r7), .llvm_name = "r7", .description = "Cortex-R7 ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ras)] = .{ .index = @enumToInt(Feature.ras), .name = @tagName(Feature.ras), .llvm_name = "ras", .description = "Enable Reliability, Availability and Serviceability extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rclass)] = .{ .index = @enumToInt(Feature.rclass), .name = @tagName(Feature.rclass), .llvm_name = "rclass", .description = "Is realtime profile ('R' series)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.read_tp_hard)] = .{ .index = @enumToInt(Feature.read_tp_hard), .name = @tagName(Feature.read_tp_hard), .llvm_name = "read-tp-hard", .description = "Reading thread pointer from register", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserve_r9)] = .{ .index = @enumToInt(Feature.reserve_r9), .name = @tagName(Feature.reserve_r9), .llvm_name = "reserve-r9", .description = "Reserve R9, making it unavailable as GPR", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ret_addr_stack)] = .{ .index = @enumToInt(Feature.ret_addr_stack), .name = @tagName(Feature.ret_addr_stack), .llvm_name = "ret-addr-stack", .description = "Has return address stack", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sb)] = .{ .index = @enumToInt(Feature.sb), .name = @tagName(Feature.sb), .llvm_name = "sb", .description = "Enable v8.5a Speculation Barrier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sha2)] = .{ .index = @enumToInt(Feature.sha2), @@ -1308,49 +1308,49 @@ pub const all_features = blk: { .name = @tagName(Feature.slow_fp_brcc), .llvm_name = "slow-fp-brcc", .description = "FP compare + branch is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_load_D_subreg)] = .{ .index = @enumToInt(Feature.slow_load_D_subreg), .name = @tagName(Feature.slow_load_D_subreg), .llvm_name = "slow-load-D-subreg", .description = "Loading into D subregs is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_odd_reg)] = .{ .index = @enumToInt(Feature.slow_odd_reg), .name = @tagName(Feature.slow_odd_reg), .llvm_name = "slow-odd-reg", .description = "VLDM/VSTM starting with an odd register is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_vdup32)] = .{ .index = @enumToInt(Feature.slow_vdup32), .name = @tagName(Feature.slow_vdup32), .llvm_name = "slow-vdup32", .description = "Has slow VDUP32 - prefer VMOV", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_vgetlni32)] = .{ .index = @enumToInt(Feature.slow_vgetlni32), .name = @tagName(Feature.slow_vgetlni32), .llvm_name = "slow-vgetlni32", .description = "Has slow VGETLNi32 - prefer VMOV", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slowfpvmlx)] = .{ .index = @enumToInt(Feature.slowfpvmlx), .name = @tagName(Feature.slowfpvmlx), .llvm_name = "slowfpvmlx", .description = "Disable VFP / NEON MAC instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.soft_float)] = .{ .index = @enumToInt(Feature.soft_float), .name = @tagName(Feature.soft_float), .llvm_name = "soft-float", .description = "Use software floating point features.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.splat_vfp_neon)] = .{ .index = @enumToInt(Feature.splat_vfp_neon), @@ -1366,56 +1366,56 @@ pub const all_features = blk: { .name = @tagName(Feature.strict_align), .llvm_name = "strict-align", .description = "Disallow all unaligned memory access", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.swift)] = .{ .index = @enumToInt(Feature.swift), .name = @tagName(Feature.swift), .llvm_name = "swift", .description = "Swift ARM processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.thumb_mode)] = .{ .index = @enumToInt(Feature.thumb_mode), .name = @tagName(Feature.thumb_mode), .llvm_name = "thumb-mode", .description = "Thumb mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.thumb2)] = .{ .index = @enumToInt(Feature.thumb2), .name = @tagName(Feature.thumb2), .llvm_name = "thumb2", .description = "Enable Thumb2 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.trustzone)] = .{ .index = @enumToInt(Feature.trustzone), .name = @tagName(Feature.trustzone), .llvm_name = "trustzone", .description = "Enable support for TrustZone security extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_aa)] = .{ .index = @enumToInt(Feature.use_aa), .name = @tagName(Feature.use_aa), .llvm_name = "use-aa", .description = "Use alias analysis during codegen", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_misched)] = .{ .index = @enumToInt(Feature.use_misched), .name = @tagName(Feature.use_misched), .llvm_name = "use-misched", .description = "Use the MachineScheduler", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v4t)] = .{ .index = @enumToInt(Feature.v4t), .name = @tagName(Feature.v4t), .llvm_name = "v4t", .description = "Support ARM v4T instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v5t)] = .{ .index = @enumToInt(Feature.v5t), @@ -1489,7 +1489,7 @@ pub const all_features = blk: { .name = @tagName(Feature.v7clrex), .llvm_name = "v7clrex", .description = "Has v7 clrex instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v8)] = .{ .index = @enumToInt(Feature.v8), @@ -1714,28 +1714,28 @@ pub const all_features = blk: { .name = @tagName(Feature.vldn_align), .llvm_name = "vldn-align", .description = "Check for VLDn unaligned access", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vmlx_forwarding)] = .{ .index = @enumToInt(Feature.vmlx_forwarding), .name = @tagName(Feature.vmlx_forwarding), .llvm_name = "vmlx-forwarding", .description = "Has multiplier accumulator forwarding", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vmlx_hazards)] = .{ .index = @enumToInt(Feature.vmlx_hazards), .name = @tagName(Feature.vmlx_hazards), .llvm_name = "vmlx-hazards", .description = "Has VMLx hazards", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.wide_stride_vfp)] = .{ .index = @enumToInt(Feature.wide_stride_vfp), .name = @tagName(Feature.wide_stride_vfp), .llvm_name = "wide-stride-vfp", .description = "Use a wide stride when allocating VFP registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xscale)] = .{ .index = @enumToInt(Feature.xscale), @@ -1751,7 +1751,7 @@ pub const all_features = blk: { .name = @tagName(Feature.zcz), .llvm_name = "zcz", .description = "Has zero-cycle zeroing instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -2450,7 +2450,7 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const iwmmxt = Cpu{ .name = "iwmmxt", diff --git a/lib/std/target/avr.zig b/lib/std/target/avr.zig index fecb45b69e..ac739edc08 100644 --- a/lib/std/target/avr.zig +++ b/lib/std/target/avr.zig @@ -15,7 +15,7 @@ pub const Feature = enum { avr51, avr6, avrtiny, - break, + @"break", des, eijmpcall, elpm, @@ -41,21 +41,21 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.addsubiw)] = .{ .index = @enumToInt(Feature.addsubiw), .name = @tagName(Feature.addsubiw), .llvm_name = "addsubiw", .description = "Enable 16-bit register-immediate addition and subtraction instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.avr0)] = .{ .index = @enumToInt(Feature.avr0), .name = @tagName(Feature.avr0), .llvm_name = "avr0", .description = "The device is a part of the avr0 family", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.avr1)] = .{ .index = @enumToInt(Feature.avr1), @@ -86,7 +86,7 @@ pub const all_features = blk: { .description = "The device is a part of the avr25 family", .dependencies = featureSet(&[_]Feature{ .avr2, - .break, + .@"break", .lpmx, .movw, .spm, @@ -119,7 +119,7 @@ pub const all_features = blk: { .description = "The device is a part of the avr35 family", .dependencies = featureSet(&[_]Feature{ .avr3, - .break, + .@"break", .lpmx, .movw, .spm, @@ -132,7 +132,7 @@ pub const all_features = blk: { .description = "The device is a part of the avr4 family", .dependencies = featureSet(&[_]Feature{ .avr2, - .break, + .@"break", .lpmx, .movw, .mul, @@ -146,7 +146,7 @@ pub const all_features = blk: { .description = "The device is a part of the avr5 family", .dependencies = featureSet(&[_]Feature{ .avr3, - .break, + .@"break", .lpmx, .movw, .mul, @@ -180,101 +180,101 @@ pub const all_features = blk: { .description = "The device is a part of the avrtiny family", .dependencies = featureSet(&[_]Feature{ .avr0, - .break, + .@"break", .sram, .tinyencoding, }), }; - result[@enumToInt(Feature.break)] = .{ - .index = @enumToInt(Feature.break), - .name = @tagName(Feature.break), + result[@enumToInt(Feature.@"break")] = .{ + .index = @enumToInt(Feature.@"break"), + .name = @tagName(Feature.@"break"), .llvm_name = "break", .description = "The device supports the `BREAK` debugging instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.des)] = .{ .index = @enumToInt(Feature.des), .name = @tagName(Feature.des), .llvm_name = "des", .description = "The device supports the `DES k` encryption instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.eijmpcall)] = .{ .index = @enumToInt(Feature.eijmpcall), .name = @tagName(Feature.eijmpcall), .llvm_name = "eijmpcall", .description = "The device supports the `EIJMP`/`EICALL` instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.elpm)] = .{ .index = @enumToInt(Feature.elpm), .name = @tagName(Feature.elpm), .llvm_name = "elpm", .description = "The device supports the ELPM instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.elpmx)] = .{ .index = @enumToInt(Feature.elpmx), .name = @tagName(Feature.elpmx), .llvm_name = "elpmx", .description = "The device supports the `ELPM Rd, Z[+]` instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ijmpcall)] = .{ .index = @enumToInt(Feature.ijmpcall), .name = @tagName(Feature.ijmpcall), .llvm_name = "ijmpcall", .description = "The device supports `IJMP`/`ICALL`instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.jmpcall)] = .{ .index = @enumToInt(Feature.jmpcall), .name = @tagName(Feature.jmpcall), .llvm_name = "jmpcall", .description = "The device supports the `JMP` and `CALL` instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lpm)] = .{ .index = @enumToInt(Feature.lpm), .name = @tagName(Feature.lpm), .llvm_name = "lpm", .description = "The device supports the `LPM` instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lpmx)] = .{ .index = @enumToInt(Feature.lpmx), .name = @tagName(Feature.lpmx), .llvm_name = "lpmx", .description = "The device supports the `LPM Rd, Z[+]` instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.movw)] = .{ .index = @enumToInt(Feature.movw), .name = @tagName(Feature.movw), .llvm_name = "movw", .description = "The device supports the 16-bit MOVW instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mul)] = .{ .index = @enumToInt(Feature.mul), .name = @tagName(Feature.mul), .llvm_name = "mul", .description = "The device supports the multiplication instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rmw)] = .{ .index = @enumToInt(Feature.rmw), .name = @tagName(Feature.rmw), .llvm_name = "rmw", .description = "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.smallstack)] = .{ .index = @enumToInt(Feature.smallstack), .name = @tagName(Feature.smallstack), .llvm_name = "smallstack", .description = "The device has an 8-bit stack pointer", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.special)] = .{ .index = @enumToInt(Feature.special), @@ -283,7 +283,7 @@ pub const all_features = blk: { .description = "Enable use of the entire instruction set - used for debugging", .dependencies = featureSet(&[_]Feature{ .addsubiw, - .break, + .@"break", .des, .eijmpcall, .elpm, @@ -305,28 +305,28 @@ pub const all_features = blk: { .name = @tagName(Feature.spm), .llvm_name = "spm", .description = "The device supports the `SPM` instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.spmx)] = .{ .index = @enumToInt(Feature.spmx), .name = @tagName(Feature.spmx), .llvm_name = "spmx", .description = "The device supports the `SPM Z+` instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sram)] = .{ .index = @enumToInt(Feature.sram), .name = @tagName(Feature.sram), .llvm_name = "sram", .description = "The device has random access memory", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tinyencoding)] = .{ .index = @enumToInt(Feature.tinyencoding), .name = @tagName(Feature.tinyencoding), .llvm_name = "tinyencoding", .description = "The device has Tiny core specific instruction encodings", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xmega)] = .{ .index = @enumToInt(Feature.xmega), @@ -2439,3 +2439,7 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.avrxmega7, &cpu.m3000, }; + +pub const baseline_features = featureSet(&[_]Feature{ + .avr0, +}); diff --git a/lib/std/target/bpf.zig b/lib/std/target/bpf.zig index bb10a84ff8..73ed463bc5 100644 --- a/lib/std/target/bpf.zig +++ b/lib/std/target/bpf.zig @@ -11,28 +11,28 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.alu32)] = .{ .index = @enumToInt(Feature.alu32), .name = @tagName(Feature.alu32), .llvm_name = "alu32", .description = "Enable ALU32 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dummy)] = .{ .index = @enumToInt(Feature.dummy), .name = @tagName(Feature.dummy), .llvm_name = "dummy", .description = "unused feature", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dwarfris)] = .{ .index = @enumToInt(Feature.dwarfris), .name = @tagName(Feature.dwarfris), .llvm_name = "dwarfris", .description = "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -41,27 +41,27 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const probe = Cpu{ .name = "probe", .llvm_name = "probe", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const v1 = Cpu{ .name = "v1", .llvm_name = "v1", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const v2 = Cpu{ .name = "v2", .llvm_name = "v2", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const v3 = Cpu{ .name = "v3", .llvm_name = "v3", - .features = 0, + .features = featureSet(&[_]Feature{}), }; }; diff --git a/lib/std/target/hexagon.zig b/lib/std/target/hexagon.zig index 441abb9cbd..bea73eb794 100644 --- a/lib/std/target/hexagon.zig +++ b/lib/std/target/hexagon.zig @@ -32,21 +32,21 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.duplex)] = .{ .index = @enumToInt(Feature.duplex), .name = @tagName(Feature.duplex), .llvm_name = "duplex", .description = "Enable generation of duplex instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hvx)] = .{ .index = @enumToInt(Feature.hvx), .name = @tagName(Feature.hvx), .llvm_name = "hvx", .description = "Hexagon HVX instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hvx_length128b)] = .{ .index = @enumToInt(Feature.hvx_length128b), @@ -114,28 +114,28 @@ pub const all_features = blk: { .name = @tagName(Feature.long_calls), .llvm_name = "long-calls", .description = "Use constant-extended calls", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mem_noshuf)] = .{ .index = @enumToInt(Feature.mem_noshuf), .name = @tagName(Feature.mem_noshuf), .llvm_name = "mem_noshuf", .description = "Supports mem_noshuf feature", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.memops)] = .{ .index = @enumToInt(Feature.memops), .name = @tagName(Feature.memops), .llvm_name = "memops", .description = "Use memop instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.noreturn_stack_elim)] = .{ .index = @enumToInt(Feature.noreturn_stack_elim), .name = @tagName(Feature.noreturn_stack_elim), .llvm_name = "noreturn-stack-elim", .description = "Eliminate stack allocation in a noreturn function when possible", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nvj)] = .{ .index = @enumToInt(Feature.nvj), @@ -160,70 +160,70 @@ pub const all_features = blk: { .name = @tagName(Feature.packets), .llvm_name = "packets", .description = "Support for instruction packets", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reserved_r19)] = .{ .index = @enumToInt(Feature.reserved_r19), .name = @tagName(Feature.reserved_r19), .llvm_name = "reserved-r19", .description = "Reserve register R19", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.small_data)] = .{ .index = @enumToInt(Feature.small_data), .name = @tagName(Feature.small_data), .llvm_name = "small-data", .description = "Allow GP-relative addressing of global variables", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v5)] = .{ .index = @enumToInt(Feature.v5), .name = @tagName(Feature.v5), .llvm_name = "v5", .description = "Enable Hexagon V5 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v55)] = .{ .index = @enumToInt(Feature.v55), .name = @tagName(Feature.v55), .llvm_name = "v55", .description = "Enable Hexagon V55 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v60)] = .{ .index = @enumToInt(Feature.v60), .name = @tagName(Feature.v60), .llvm_name = "v60", .description = "Enable Hexagon V60 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v62)] = .{ .index = @enumToInt(Feature.v62), .name = @tagName(Feature.v62), .llvm_name = "v62", .description = "Enable Hexagon V62 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v65)] = .{ .index = @enumToInt(Feature.v65), .name = @tagName(Feature.v65), .llvm_name = "v65", .description = "Enable Hexagon V65 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v66)] = .{ .index = @enumToInt(Feature.v66), .name = @tagName(Feature.v66), .llvm_name = "v66", .description = "Enable Hexagon V66 architecture", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.zreg)] = .{ .index = @enumToInt(Feature.zreg), .name = @tagName(Feature.zreg), .llvm_name = "zreg", .description = "Hexagon ZReg extension instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; diff --git a/lib/std/target/mips.zig b/lib/std/target/mips.zig index d4f9df4fbb..19ea4d7009 100644 --- a/lib/std/target/mips.zig +++ b/lib/std/target/mips.zig @@ -57,14 +57,14 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.abs2008)] = .{ .index = @enumToInt(Feature.abs2008), .name = @tagName(Feature.abs2008), .llvm_name = "abs2008", .description = "Disable IEEE 754-2008 abs.fmt mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cnmips)] = .{ .index = @enumToInt(Feature.cnmips), @@ -80,14 +80,14 @@ pub const all_features = blk: { .name = @tagName(Feature.crc), .llvm_name = "crc", .description = "Mips R6 CRC ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dsp)] = .{ .index = @enumToInt(Feature.dsp), .name = @tagName(Feature.dsp), .llvm_name = "dsp", .description = "Mips DSP ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dspr2)] = .{ .index = @enumToInt(Feature.dspr2), @@ -113,63 +113,63 @@ pub const all_features = blk: { .name = @tagName(Feature.eva), .llvm_name = "eva", .description = "Mips EVA ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp64)] = .{ .index = @enumToInt(Feature.fp64), .name = @tagName(Feature.fp64), .llvm_name = "fp64", .description = "Support 64-bit FP registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fpxx)] = .{ .index = @enumToInt(Feature.fpxx), .name = @tagName(Feature.fpxx), .llvm_name = "fpxx", .description = "Support for FPXX", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ginv)] = .{ .index = @enumToInt(Feature.ginv), .name = @tagName(Feature.ginv), .llvm_name = "ginv", .description = "Mips Global Invalidate ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gp64)] = .{ .index = @enumToInt(Feature.gp64), .name = @tagName(Feature.gp64), .llvm_name = "gp64", .description = "General Purpose Registers are 64-bit wide", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.long_calls)] = .{ .index = @enumToInt(Feature.long_calls), .name = @tagName(Feature.long_calls), .llvm_name = "long-calls", .description = "Disable use of the jal instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.micromips)] = .{ .index = @enumToInt(Feature.micromips), .name = @tagName(Feature.micromips), .llvm_name = "micromips", .description = "microMips mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips1)] = .{ .index = @enumToInt(Feature.mips1), .name = @tagName(Feature.mips1), .llvm_name = "mips1", .description = "Mips I ISA Support [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips16)] = .{ .index = @enumToInt(Feature.mips16), .name = @tagName(Feature.mips16), .llvm_name = "mips16", .description = "Mips16 mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips2)] = .{ .index = @enumToInt(Feature.mips2), @@ -251,14 +251,14 @@ pub const all_features = blk: { .name = @tagName(Feature.mips3_32), .llvm_name = "mips3_32", .description = "Subset of MIPS-III that is also in MIPS32 [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips3_32r2)] = .{ .index = @enumToInt(Feature.mips3_32r2), .name = @tagName(Feature.mips3_32r2), .llvm_name = "mips3_32r2", .description = "Subset of MIPS-III that is also in MIPS32r2 [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips4)] = .{ .index = @enumToInt(Feature.mips4), @@ -276,14 +276,14 @@ pub const all_features = blk: { .name = @tagName(Feature.mips4_32), .llvm_name = "mips4_32", .description = "Subset of MIPS-IV that is also in MIPS32 [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips4_32r2)] = .{ .index = @enumToInt(Feature.mips4_32r2), .name = @tagName(Feature.mips4_32r2), .llvm_name = "mips4_32r2", .description = "Subset of MIPS-IV that is also in MIPS32r2 [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips5)] = .{ .index = @enumToInt(Feature.mips5), @@ -300,7 +300,7 @@ pub const all_features = blk: { .name = @tagName(Feature.mips5_32r2), .llvm_name = "mips5_32r2", .description = "Subset of MIPS-V that is also in MIPS32r2 [highly experimental]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mips64)] = .{ .index = @enumToInt(Feature.mips64), @@ -359,42 +359,42 @@ pub const all_features = blk: { .name = @tagName(Feature.msa), .llvm_name = "msa", .description = "Mips MSA ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mt)] = .{ .index = @enumToInt(Feature.mt), .name = @tagName(Feature.mt), .llvm_name = "mt", .description = "Mips MT ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nan2008)] = .{ .index = @enumToInt(Feature.nan2008), .name = @tagName(Feature.nan2008), .llvm_name = "nan2008", .description = "IEEE 754-2008 NaN encoding", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.noabicalls)] = .{ .index = @enumToInt(Feature.noabicalls), .name = @tagName(Feature.noabicalls), .llvm_name = "noabicalls", .description = "Disable SVR4-style position-independent code", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nomadd4)] = .{ .index = @enumToInt(Feature.nomadd4), .name = @tagName(Feature.nomadd4), .llvm_name = "nomadd4", .description = "Disable 4-operand madd.fmt and related instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nooddspreg)] = .{ .index = @enumToInt(Feature.nooddspreg), .name = @tagName(Feature.nooddspreg), .llvm_name = "nooddspreg", .description = "Disable odd numbered single-precision registers", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.p5600)] = .{ .index = @enumToInt(Feature.p5600), @@ -410,56 +410,56 @@ pub const all_features = blk: { .name = @tagName(Feature.ptr64), .llvm_name = "ptr64", .description = "Pointers are 64-bit wide", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.single_float)] = .{ .index = @enumToInt(Feature.single_float), .name = @tagName(Feature.single_float), .llvm_name = "single-float", .description = "Only supports single precision float", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.soft_float)] = .{ .index = @enumToInt(Feature.soft_float), .name = @tagName(Feature.soft_float), .llvm_name = "soft-float", .description = "Does not support floating point instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sym32)] = .{ .index = @enumToInt(Feature.sym32), .name = @tagName(Feature.sym32), .llvm_name = "sym32", .description = "Symbols are 32 bit on Mips64", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_indirect_jump_hazard)] = .{ .index = @enumToInt(Feature.use_indirect_jump_hazard), .name = @tagName(Feature.use_indirect_jump_hazard), .llvm_name = "use-indirect-jump-hazard", .description = "Use indirect jump guards to prevent certain speculation based attacks", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.use_tcc_in_div)] = .{ .index = @enumToInt(Feature.use_tcc_in_div), .name = @tagName(Feature.use_tcc_in_div), .llvm_name = "use-tcc-in-div", .description = "Force the assembler to use trapping", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vfpu)] = .{ .index = @enumToInt(Feature.vfpu), .name = @tagName(Feature.vfpu), .llvm_name = "vfpu", .description = "Enable vector FPU instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.virt)] = .{ .index = @enumToInt(Feature.virt), .name = @tagName(Feature.virt), .llvm_name = "virt", .description = "Mips Virtualization ASE", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; diff --git a/lib/std/target/msp430.zig b/lib/std/target/msp430.zig index 21d6a8211d..9bc184d4da 100644 --- a/lib/std/target/msp430.zig +++ b/lib/std/target/msp430.zig @@ -12,35 +12,35 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.ext)] = .{ .index = @enumToInt(Feature.ext), .name = @tagName(Feature.ext), .llvm_name = "ext", .description = "Enable MSP430-X extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hwmult16)] = .{ .index = @enumToInt(Feature.hwmult16), .name = @tagName(Feature.hwmult16), .llvm_name = "hwmult16", .description = "Enable 16-bit hardware multiplier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hwmult32)] = .{ .index = @enumToInt(Feature.hwmult32), .name = @tagName(Feature.hwmult32), .llvm_name = "hwmult32", .description = "Enable 32-bit hardware multiplier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hwmultf5)] = .{ .index = @enumToInt(Feature.hwmultf5), .name = @tagName(Feature.hwmultf5), .llvm_name = "hwmultf5", .description = "Enable F5 series hardware multiplier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -49,12 +49,12 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const msp430 = Cpu{ .name = "msp430", .llvm_name = "msp430", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const msp430x = Cpu{ .name = "msp430x", diff --git a/lib/std/target/nvptx.zig b/lib/std/target/nvptx.zig index d277785aff..3cc4f18a14 100644 --- a/lib/std/target/nvptx.zig +++ b/lib/std/target/nvptx.zig @@ -33,182 +33,182 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.ptx32)] = .{ .index = @enumToInt(Feature.ptx32), .name = @tagName(Feature.ptx32), .llvm_name = "ptx32", .description = "Use PTX version 3.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx40)] = .{ .index = @enumToInt(Feature.ptx40), .name = @tagName(Feature.ptx40), .llvm_name = "ptx40", .description = "Use PTX version 4.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx41)] = .{ .index = @enumToInt(Feature.ptx41), .name = @tagName(Feature.ptx41), .llvm_name = "ptx41", .description = "Use PTX version 4.1", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx42)] = .{ .index = @enumToInt(Feature.ptx42), .name = @tagName(Feature.ptx42), .llvm_name = "ptx42", .description = "Use PTX version 4.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx43)] = .{ .index = @enumToInt(Feature.ptx43), .name = @tagName(Feature.ptx43), .llvm_name = "ptx43", .description = "Use PTX version 4.3", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx50)] = .{ .index = @enumToInt(Feature.ptx50), .name = @tagName(Feature.ptx50), .llvm_name = "ptx50", .description = "Use PTX version 5.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx60)] = .{ .index = @enumToInt(Feature.ptx60), .name = @tagName(Feature.ptx60), .llvm_name = "ptx60", .description = "Use PTX version 6.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx61)] = .{ .index = @enumToInt(Feature.ptx61), .name = @tagName(Feature.ptx61), .llvm_name = "ptx61", .description = "Use PTX version 6.1", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx63)] = .{ .index = @enumToInt(Feature.ptx63), .name = @tagName(Feature.ptx63), .llvm_name = "ptx63", .description = "Use PTX version 6.3", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptx64)] = .{ .index = @enumToInt(Feature.ptx64), .name = @tagName(Feature.ptx64), .llvm_name = "ptx64", .description = "Use PTX version 6.4", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_20)] = .{ .index = @enumToInt(Feature.sm_20), .name = @tagName(Feature.sm_20), .llvm_name = "sm_20", .description = "Target SM 2.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_21)] = .{ .index = @enumToInt(Feature.sm_21), .name = @tagName(Feature.sm_21), .llvm_name = "sm_21", .description = "Target SM 2.1", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_30)] = .{ .index = @enumToInt(Feature.sm_30), .name = @tagName(Feature.sm_30), .llvm_name = "sm_30", .description = "Target SM 3.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_32)] = .{ .index = @enumToInt(Feature.sm_32), .name = @tagName(Feature.sm_32), .llvm_name = "sm_32", .description = "Target SM 3.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_35)] = .{ .index = @enumToInt(Feature.sm_35), .name = @tagName(Feature.sm_35), .llvm_name = "sm_35", .description = "Target SM 3.5", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_37)] = .{ .index = @enumToInt(Feature.sm_37), .name = @tagName(Feature.sm_37), .llvm_name = "sm_37", .description = "Target SM 3.7", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_50)] = .{ .index = @enumToInt(Feature.sm_50), .name = @tagName(Feature.sm_50), .llvm_name = "sm_50", .description = "Target SM 5.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_52)] = .{ .index = @enumToInt(Feature.sm_52), .name = @tagName(Feature.sm_52), .llvm_name = "sm_52", .description = "Target SM 5.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_53)] = .{ .index = @enumToInt(Feature.sm_53), .name = @tagName(Feature.sm_53), .llvm_name = "sm_53", .description = "Target SM 5.3", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_60)] = .{ .index = @enumToInt(Feature.sm_60), .name = @tagName(Feature.sm_60), .llvm_name = "sm_60", .description = "Target SM 6.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_61)] = .{ .index = @enumToInt(Feature.sm_61), .name = @tagName(Feature.sm_61), .llvm_name = "sm_61", .description = "Target SM 6.1", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_62)] = .{ .index = @enumToInt(Feature.sm_62), .name = @tagName(Feature.sm_62), .llvm_name = "sm_62", .description = "Target SM 6.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_70)] = .{ .index = @enumToInt(Feature.sm_70), .name = @tagName(Feature.sm_70), .llvm_name = "sm_70", .description = "Target SM 7.0", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_72)] = .{ .index = @enumToInt(Feature.sm_72), .name = @tagName(Feature.sm_72), .llvm_name = "sm_72", .description = "Target SM 7.2", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sm_75)] = .{ .index = @enumToInt(Feature.sm_75), .name = @tagName(Feature.sm_75), .llvm_name = "sm_75", .description = "Target SM 7.5", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; diff --git a/lib/std/target/powerpc.zig b/lib/std/target/powerpc.zig index bac15f231a..3dfc2d7bea 100644 --- a/lib/std/target/powerpc.zig +++ b/lib/std/target/powerpc.zig @@ -59,21 +59,21 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.@"64bit")] = .{ .index = @enumToInt(Feature.@"64bit"), .name = @tagName(Feature.@"64bit"), .llvm_name = "64bit", .description = "Enable 64-bit instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.@"64bitregs")] = .{ .index = @enumToInt(Feature.@"64bitregs"), .name = @tagName(Feature.@"64bitregs"), .llvm_name = "64bitregs", .description = "Enable 64-bit registers usage for ppc32 [beta]", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.altivec)] = .{ .index = @enumToInt(Feature.altivec), @@ -98,21 +98,21 @@ pub const all_features = blk: { .name = @tagName(Feature.bpermd), .llvm_name = "bpermd", .description = "Enable the bpermd instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cmpb)] = .{ .index = @enumToInt(Feature.cmpb), .name = @tagName(Feature.cmpb), .llvm_name = "cmpb", .description = "Enable the cmpb instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.crbits)] = .{ .index = @enumToInt(Feature.crbits), .name = @tagName(Feature.crbits), .llvm_name = "crbits", .description = "Use condition-register bits individually", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.crypto)] = .{ .index = @enumToInt(Feature.crypto), @@ -137,14 +137,14 @@ pub const all_features = blk: { .name = @tagName(Feature.e500), .llvm_name = "e500", .description = "Enable E500/E500mc instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.extdiv)] = .{ .index = @enumToInt(Feature.extdiv), .name = @tagName(Feature.extdiv), .llvm_name = "extdiv", .description = "Enable extended divide instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fcpsgn)] = .{ .index = @enumToInt(Feature.fcpsgn), @@ -241,49 +241,49 @@ pub const all_features = blk: { .name = @tagName(Feature.hard_float), .llvm_name = "hard-float", .description = "Enable floating-point instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.htm)] = .{ .index = @enumToInt(Feature.htm), .name = @tagName(Feature.htm), .llvm_name = "htm", .description = "Enable Hardware Transactional Memory instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.icbt)] = .{ .index = @enumToInt(Feature.icbt), .name = @tagName(Feature.icbt), .llvm_name = "icbt", .description = "Enable icbt instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.invariant_function_descriptors)] = .{ .index = @enumToInt(Feature.invariant_function_descriptors), .name = @tagName(Feature.invariant_function_descriptors), .llvm_name = "invariant-function-descriptors", .description = "Assume function descriptors are invariant", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.isa_v30_instructions)] = .{ .index = @enumToInt(Feature.isa_v30_instructions), .name = @tagName(Feature.isa_v30_instructions), .llvm_name = "isa-v30-instructions", .description = "Enable instructions added in ISA 3.0.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.isel)] = .{ .index = @enumToInt(Feature.isel), .name = @tagName(Feature.isel), .llvm_name = "isel", .description = "Enable the isel instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ldbrx)] = .{ .index = @enumToInt(Feature.ldbrx), .name = @tagName(Feature.ldbrx), .llvm_name = "ldbrx", .description = "Enable the ldbrx instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lfiwax)] = .{ .index = @enumToInt(Feature.lfiwax), @@ -299,14 +299,14 @@ pub const all_features = blk: { .name = @tagName(Feature.longcall), .llvm_name = "longcall", .description = "Always use indirect calls", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mfocrf)] = .{ .index = @enumToInt(Feature.mfocrf), .name = @tagName(Feature.mfocrf), .llvm_name = "mfocrf", .description = "Enable the MFOCRF instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.msync)] = .{ .index = @enumToInt(Feature.msync), @@ -322,14 +322,14 @@ pub const all_features = blk: { .name = @tagName(Feature.partword_atomics), .llvm_name = "partword-atomics", .description = "Enable l[bh]arx and st[bh]cx.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.popcntd)] = .{ .index = @enumToInt(Feature.popcntd), .name = @tagName(Feature.popcntd), .llvm_name = "popcntd", .description = "Enable the popcnt[dw] instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.power8_altivec)] = .{ .index = @enumToInt(Feature.power8_altivec), @@ -376,28 +376,28 @@ pub const all_features = blk: { .name = @tagName(Feature.ppc_postra_sched), .llvm_name = "ppc-postra-sched", .description = "Use PowerPC post-RA scheduling strategy", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ppc_prera_sched)] = .{ .index = @enumToInt(Feature.ppc_prera_sched), .name = @tagName(Feature.ppc_prera_sched), .llvm_name = "ppc-prera-sched", .description = "Use PowerPC pre-RA scheduling strategy", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ppc4xx)] = .{ .index = @enumToInt(Feature.ppc4xx), .name = @tagName(Feature.ppc4xx), .llvm_name = "ppc4xx", .description = "Enable PPC 4xx instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ppc6xx)] = .{ .index = @enumToInt(Feature.ppc6xx), .name = @tagName(Feature.ppc6xx), .llvm_name = "ppc6xx", .description = "Enable PPC 6xx instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.qpx)] = .{ .index = @enumToInt(Feature.qpx), @@ -413,21 +413,21 @@ pub const all_features = blk: { .name = @tagName(Feature.recipprec), .llvm_name = "recipprec", .description = "Assume higher precision reciprocal estimates", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.secure_plt)] = .{ .index = @enumToInt(Feature.secure_plt), .name = @tagName(Feature.secure_plt), .llvm_name = "secure-plt", .description = "Enable secure plt mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_popcntd)] = .{ .index = @enumToInt(Feature.slow_popcntd), .name = @tagName(Feature.slow_popcntd), .llvm_name = "slow-popcntd", .description = "Has slow popcnt[dw] instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.spe)] = .{ .index = @enumToInt(Feature.spe), @@ -452,14 +452,14 @@ pub const all_features = blk: { .name = @tagName(Feature.two_const_nr), .llvm_name = "two-const-nr", .description = "Requires two constant Newton-Raphson computation", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vectors_use_two_units)] = .{ .index = @enumToInt(Feature.vectors_use_two_units), .name = @tagName(Feature.vectors_use_two_units), .llvm_name = "vectors-use-two-units", .description = "Vectors use two units", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vsx)] = .{ .index = @enumToInt(Feature.vsx), @@ -475,7 +475,7 @@ pub const all_features = blk: { pub const cpu = struct { pub const @"440" = Cpu{ - .name = "@"440"", + .name = "440", .llvm_name = "440", .features = featureSet(&[_]Feature{ .booke, @@ -487,7 +487,7 @@ pub const cpu = struct { }), }; pub const @"450" = Cpu{ - .name = "@"450"", + .name = "450", .llvm_name = "450", .features = featureSet(&[_]Feature{ .booke, @@ -499,21 +499,21 @@ pub const cpu = struct { }), }; pub const @"601" = Cpu{ - .name = "@"601"", + .name = "601", .llvm_name = "601", .features = featureSet(&[_]Feature{ .fpu, }), }; pub const @"602" = Cpu{ - .name = "@"602"", + .name = "602", .llvm_name = "602", .features = featureSet(&[_]Feature{ .fpu, }), }; pub const @"603" = Cpu{ - .name = "@"603"", + .name = "603", .llvm_name = "603", .features = featureSet(&[_]Feature{ .fres, @@ -521,7 +521,7 @@ pub const cpu = struct { }), }; pub const @"603e" = Cpu{ - .name = "@"603e"", + .name = "603e", .llvm_name = "603e", .features = featureSet(&[_]Feature{ .fres, @@ -529,7 +529,7 @@ pub const cpu = struct { }), }; pub const @"603ev" = Cpu{ - .name = "@"603ev"", + .name = "603ev", .llvm_name = "603ev", .features = featureSet(&[_]Feature{ .fres, @@ -537,7 +537,7 @@ pub const cpu = struct { }), }; pub const @"604" = Cpu{ - .name = "@"604"", + .name = "604", .llvm_name = "604", .features = featureSet(&[_]Feature{ .fres, @@ -545,7 +545,7 @@ pub const cpu = struct { }), }; pub const @"604e" = Cpu{ - .name = "@"604e"", + .name = "604e", .llvm_name = "604e", .features = featureSet(&[_]Feature{ .fres, @@ -553,7 +553,7 @@ pub const cpu = struct { }), }; pub const @"620" = Cpu{ - .name = "@"620"", + .name = "620", .llvm_name = "620", .features = featureSet(&[_]Feature{ .fres, @@ -561,7 +561,7 @@ pub const cpu = struct { }), }; pub const @"7400" = Cpu{ - .name = "@"7400"", + .name = "7400", .llvm_name = "7400", .features = featureSet(&[_]Feature{ .altivec, @@ -570,7 +570,7 @@ pub const cpu = struct { }), }; pub const @"7450" = Cpu{ - .name = "@"7450"", + .name = "7450", .llvm_name = "7450", .features = featureSet(&[_]Feature{ .altivec, @@ -579,7 +579,7 @@ pub const cpu = struct { }), }; pub const @"750" = Cpu{ - .name = "@"750"", + .name = "750", .llvm_name = "750", .features = featureSet(&[_]Feature{ .fres, @@ -587,7 +587,7 @@ pub const cpu = struct { }), }; pub const @"970" = Cpu{ - .name = "@"970"", + .name = "970", .llvm_name = "970", .features = featureSet(&[_]Feature{ .@"64bit", @@ -698,7 +698,7 @@ pub const cpu = struct { .frsqrte, }), }; - pub const g4+ = Cpu{ + pub const @"g4+" = Cpu{ .name = "g4+", .llvm_name = "g4+", .features = featureSet(&[_]Feature{ @@ -1016,7 +1016,7 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.e5500, &cpu.g3, &cpu.g4, - &cpu.g4+, + &cpu.@"g4+", &cpu.g5, &cpu.generic, &cpu.ppc, diff --git a/lib/std/target/riscv.zig b/lib/std/target/riscv.zig index dbe36e0fa1..ee0d6509df 100644 --- a/lib/std/target/riscv.zig +++ b/lib/std/target/riscv.zig @@ -16,28 +16,28 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.@"64bit")] = .{ .index = @enumToInt(Feature.@"64bit"), .name = @tagName(Feature.@"64bit"), .llvm_name = "64bit", .description = "Implements RV64", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.a)] = .{ .index = @enumToInt(Feature.a), .name = @tagName(Feature.a), .llvm_name = "a", .description = "'A' (Atomic Instructions)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.c)] = .{ .index = @enumToInt(Feature.c), .name = @tagName(Feature.c), .llvm_name = "c", .description = "'C' (Compressed Instructions)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.d)] = .{ .index = @enumToInt(Feature.d), @@ -53,28 +53,28 @@ pub const all_features = blk: { .name = @tagName(Feature.e), .llvm_name = "e", .description = "Implements RV32E (provides 16 rather than 32 GPRs)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.f)] = .{ .index = @enumToInt(Feature.f), .name = @tagName(Feature.f), .llvm_name = "f", .description = "'F' (Single-Precision Floating-Point)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.m)] = .{ .index = @enumToInt(Feature.m), .name = @tagName(Feature.m), .llvm_name = "m", .description = "'M' (Integer Multiplication and Division)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.relax)] = .{ .index = @enumToInt(Feature.relax), .name = @tagName(Feature.relax), .llvm_name = "relax", .description = "Enable Linker relaxation.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -83,7 +83,7 @@ pub const cpu = struct { pub const generic_rv32 = Cpu{ .name = "generic_rv32", .llvm_name = "generic-rv32", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const generic_rv64 = Cpu{ .name = "generic_rv64", diff --git a/lib/std/target/sparc.zig b/lib/std/target/sparc.zig index 6b1787f31f..da7649e831 100644 --- a/lib/std/target/sparc.zig +++ b/lib/std/target/sparc.zig @@ -27,140 +27,140 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.deprecated_v8)] = .{ .index = @enumToInt(Feature.deprecated_v8), .name = @tagName(Feature.deprecated_v8), .llvm_name = "deprecated-v8", .description = "Enable deprecated V8 instructions in V9 mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.detectroundchange)] = .{ .index = @enumToInt(Feature.detectroundchange), .name = @tagName(Feature.detectroundchange), .llvm_name = "detectroundchange", .description = "LEON3 erratum detection: Detects any rounding mode change request: use only the round-to-nearest rounding mode", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fixallfdivsqrt)] = .{ .index = @enumToInt(Feature.fixallfdivsqrt), .name = @tagName(Feature.fixallfdivsqrt), .llvm_name = "fixallfdivsqrt", .description = "LEON erratum fix: Fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hard_quad_float)] = .{ .index = @enumToInt(Feature.hard_quad_float), .name = @tagName(Feature.hard_quad_float), .llvm_name = "hard-quad-float", .description = "Enable quad-word floating point instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hasleoncasa)] = .{ .index = @enumToInt(Feature.hasleoncasa), .name = @tagName(Feature.hasleoncasa), .llvm_name = "hasleoncasa", .description = "Enable CASA instruction for LEON3 and LEON4 processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.hasumacsmac)] = .{ .index = @enumToInt(Feature.hasumacsmac), .name = @tagName(Feature.hasumacsmac), .llvm_name = "hasumacsmac", .description = "Enable UMAC and SMAC for LEON3 and LEON4 processors", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.insertnopload)] = .{ .index = @enumToInt(Feature.insertnopload), .name = @tagName(Feature.insertnopload), .llvm_name = "insertnopload", .description = "LEON3 erratum fix: Insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.leon)] = .{ .index = @enumToInt(Feature.leon), .name = @tagName(Feature.leon), .llvm_name = "leon", .description = "Enable LEON extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.leoncyclecounter)] = .{ .index = @enumToInt(Feature.leoncyclecounter), .name = @tagName(Feature.leoncyclecounter), .llvm_name = "leoncyclecounter", .description = "Use the Leon cycle counter register", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.leonpwrpsr)] = .{ .index = @enumToInt(Feature.leonpwrpsr), .name = @tagName(Feature.leonpwrpsr), .llvm_name = "leonpwrpsr", .description = "Enable the PWRPSR instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_fmuls)] = .{ .index = @enumToInt(Feature.no_fmuls), .name = @tagName(Feature.no_fmuls), .llvm_name = "no-fmuls", .description = "Disable the fmuls instruction.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.no_fsmuld)] = .{ .index = @enumToInt(Feature.no_fsmuld), .name = @tagName(Feature.no_fsmuld), .llvm_name = "no-fsmuld", .description = "Disable the fsmuld instruction.", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.popc)] = .{ .index = @enumToInt(Feature.popc), .name = @tagName(Feature.popc), .llvm_name = "popc", .description = "Use the popc (population count) instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.soft_float)] = .{ .index = @enumToInt(Feature.soft_float), .name = @tagName(Feature.soft_float), .llvm_name = "soft-float", .description = "Use software emulation for floating point", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.soft_mul_div)] = .{ .index = @enumToInt(Feature.soft_mul_div), .name = @tagName(Feature.soft_mul_div), .llvm_name = "soft-mul-div", .description = "Use software emulation for integer multiply and divide", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.v9)] = .{ .index = @enumToInt(Feature.v9), .name = @tagName(Feature.v9), .llvm_name = "v9", .description = "Enable SPARC-V9 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vis)] = .{ .index = @enumToInt(Feature.vis), .name = @tagName(Feature.vis), .llvm_name = "vis", .description = "Enable UltraSPARC Visual Instruction Set extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vis2)] = .{ .index = @enumToInt(Feature.vis2), .name = @tagName(Feature.vis2), .llvm_name = "vis2", .description = "Enable Visual Instruction Set extensions II", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vis3)] = .{ .index = @enumToInt(Feature.vis3), .name = @tagName(Feature.vis3), .llvm_name = "vis3", .description = "Enable Visual Instruction Set extensions III", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -185,12 +185,12 @@ pub const cpu = struct { pub const f934 = Cpu{ .name = "f934", .llvm_name = "f934", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const gr712rc = Cpu{ .name = "gr712rc", @@ -214,7 +214,7 @@ pub const cpu = struct { pub const hypersparc = Cpu{ .name = "hypersparc", .llvm_name = "hypersparc", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const leon2 = Cpu{ .name = "leon2", @@ -407,27 +407,27 @@ pub const cpu = struct { pub const sparclet = Cpu{ .name = "sparclet", .llvm_name = "sparclet", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const sparclite = Cpu{ .name = "sparclite", .llvm_name = "sparclite", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const sparclite86x = Cpu{ .name = "sparclite86x", .llvm_name = "sparclite86x", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const supersparc = Cpu{ .name = "supersparc", .llvm_name = "supersparc", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const tsc701 = Cpu{ .name = "tsc701", .llvm_name = "tsc701", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const ultrasparc = Cpu{ .name = "ultrasparc", @@ -470,7 +470,7 @@ pub const cpu = struct { pub const v8 = Cpu{ .name = "v8", .llvm_name = "v8", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const v9 = Cpu{ .name = "v9", diff --git a/lib/std/target/systemz.zig b/lib/std/target/systemz.zig index 3479ebf7b4..aaee832c28 100644 --- a/lib/std/target/systemz.zig +++ b/lib/std/target/systemz.zig @@ -43,252 +43,252 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.deflate_conversion)] = .{ .index = @enumToInt(Feature.deflate_conversion), .name = @tagName(Feature.deflate_conversion), .llvm_name = "deflate-conversion", .description = "Assume that the deflate-conversion facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dfp_packed_conversion)] = .{ .index = @enumToInt(Feature.dfp_packed_conversion), .name = @tagName(Feature.dfp_packed_conversion), .llvm_name = "dfp-packed-conversion", .description = "Assume that the DFP packed-conversion facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.dfp_zoned_conversion)] = .{ .index = @enumToInt(Feature.dfp_zoned_conversion), .name = @tagName(Feature.dfp_zoned_conversion), .llvm_name = "dfp-zoned-conversion", .description = "Assume that the DFP zoned-conversion facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.distinct_ops)] = .{ .index = @enumToInt(Feature.distinct_ops), .name = @tagName(Feature.distinct_ops), .llvm_name = "distinct-ops", .description = "Assume that the distinct-operands facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.enhanced_dat_2)] = .{ .index = @enumToInt(Feature.enhanced_dat_2), .name = @tagName(Feature.enhanced_dat_2), .llvm_name = "enhanced-dat-2", .description = "Assume that the enhanced-DAT facility 2 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.enhanced_sort)] = .{ .index = @enumToInt(Feature.enhanced_sort), .name = @tagName(Feature.enhanced_sort), .llvm_name = "enhanced-sort", .description = "Assume that the enhanced-sort facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.execution_hint)] = .{ .index = @enumToInt(Feature.execution_hint), .name = @tagName(Feature.execution_hint), .llvm_name = "execution-hint", .description = "Assume that the execution-hint facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_serialization)] = .{ .index = @enumToInt(Feature.fast_serialization), .name = @tagName(Feature.fast_serialization), .llvm_name = "fast-serialization", .description = "Assume that the fast-serialization facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fp_extension)] = .{ .index = @enumToInt(Feature.fp_extension), .name = @tagName(Feature.fp_extension), .llvm_name = "fp-extension", .description = "Assume that the floating-point extension facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.guarded_storage)] = .{ .index = @enumToInt(Feature.guarded_storage), .name = @tagName(Feature.guarded_storage), .llvm_name = "guarded-storage", .description = "Assume that the guarded-storage facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.high_word)] = .{ .index = @enumToInt(Feature.high_word), .name = @tagName(Feature.high_word), .llvm_name = "high-word", .description = "Assume that the high-word facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.insert_reference_bits_multiple)] = .{ .index = @enumToInt(Feature.insert_reference_bits_multiple), .name = @tagName(Feature.insert_reference_bits_multiple), .llvm_name = "insert-reference-bits-multiple", .description = "Assume that the insert-reference-bits-multiple facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.interlocked_access1)] = .{ .index = @enumToInt(Feature.interlocked_access1), .name = @tagName(Feature.interlocked_access1), .llvm_name = "interlocked-access1", .description = "Assume that interlocked-access facility 1 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.load_and_trap)] = .{ .index = @enumToInt(Feature.load_and_trap), .name = @tagName(Feature.load_and_trap), .llvm_name = "load-and-trap", .description = "Assume that the load-and-trap facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.load_and_zero_rightmost_byte)] = .{ .index = @enumToInt(Feature.load_and_zero_rightmost_byte), .name = @tagName(Feature.load_and_zero_rightmost_byte), .llvm_name = "load-and-zero-rightmost-byte", .description = "Assume that the load-and-zero-rightmost-byte facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.load_store_on_cond)] = .{ .index = @enumToInt(Feature.load_store_on_cond), .name = @tagName(Feature.load_store_on_cond), .llvm_name = "load-store-on-cond", .description = "Assume that the load/store-on-condition facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.load_store_on_cond_2)] = .{ .index = @enumToInt(Feature.load_store_on_cond_2), .name = @tagName(Feature.load_store_on_cond_2), .llvm_name = "load-store-on-cond-2", .description = "Assume that the load/store-on-condition facility 2 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension3)] = .{ .index = @enumToInt(Feature.message_security_assist_extension3), .name = @tagName(Feature.message_security_assist_extension3), .llvm_name = "message-security-assist-extension3", .description = "Assume that the message-security-assist extension facility 3 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension4)] = .{ .index = @enumToInt(Feature.message_security_assist_extension4), .name = @tagName(Feature.message_security_assist_extension4), .llvm_name = "message-security-assist-extension4", .description = "Assume that the message-security-assist extension facility 4 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension5)] = .{ .index = @enumToInt(Feature.message_security_assist_extension5), .name = @tagName(Feature.message_security_assist_extension5), .llvm_name = "message-security-assist-extension5", .description = "Assume that the message-security-assist extension facility 5 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension7)] = .{ .index = @enumToInt(Feature.message_security_assist_extension7), .name = @tagName(Feature.message_security_assist_extension7), .llvm_name = "message-security-assist-extension7", .description = "Assume that the message-security-assist extension facility 7 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension8)] = .{ .index = @enumToInt(Feature.message_security_assist_extension8), .name = @tagName(Feature.message_security_assist_extension8), .llvm_name = "message-security-assist-extension8", .description = "Assume that the message-security-assist extension facility 8 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.message_security_assist_extension9)] = .{ .index = @enumToInt(Feature.message_security_assist_extension9), .name = @tagName(Feature.message_security_assist_extension9), .llvm_name = "message-security-assist-extension9", .description = "Assume that the message-security-assist extension facility 9 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.miscellaneous_extensions)] = .{ .index = @enumToInt(Feature.miscellaneous_extensions), .name = @tagName(Feature.miscellaneous_extensions), .llvm_name = "miscellaneous-extensions", .description = "Assume that the miscellaneous-extensions facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.miscellaneous_extensions_2)] = .{ .index = @enumToInt(Feature.miscellaneous_extensions_2), .name = @tagName(Feature.miscellaneous_extensions_2), .llvm_name = "miscellaneous-extensions-2", .description = "Assume that the miscellaneous-extensions facility 2 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.miscellaneous_extensions_3)] = .{ .index = @enumToInt(Feature.miscellaneous_extensions_3), .name = @tagName(Feature.miscellaneous_extensions_3), .llvm_name = "miscellaneous-extensions-3", .description = "Assume that the miscellaneous-extensions facility 3 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.population_count)] = .{ .index = @enumToInt(Feature.population_count), .name = @tagName(Feature.population_count), .llvm_name = "population-count", .description = "Assume that the population-count facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.processor_assist)] = .{ .index = @enumToInt(Feature.processor_assist), .name = @tagName(Feature.processor_assist), .llvm_name = "processor-assist", .description = "Assume that the processor-assist facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.reset_reference_bits_multiple)] = .{ .index = @enumToInt(Feature.reset_reference_bits_multiple), .name = @tagName(Feature.reset_reference_bits_multiple), .llvm_name = "reset-reference-bits-multiple", .description = "Assume that the reset-reference-bits-multiple facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.transactional_execution)] = .{ .index = @enumToInt(Feature.transactional_execution), .name = @tagName(Feature.transactional_execution), .llvm_name = "transactional-execution", .description = "Assume that the transactional-execution facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vector)] = .{ .index = @enumToInt(Feature.vector), .name = @tagName(Feature.vector), .llvm_name = "vector", .description = "Assume that the vectory facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vector_enhancements_1)] = .{ .index = @enumToInt(Feature.vector_enhancements_1), .name = @tagName(Feature.vector_enhancements_1), .llvm_name = "vector-enhancements-1", .description = "Assume that the vector enhancements facility 1 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vector_enhancements_2)] = .{ .index = @enumToInt(Feature.vector_enhancements_2), .name = @tagName(Feature.vector_enhancements_2), .llvm_name = "vector-enhancements-2", .description = "Assume that the vector enhancements facility 2 is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vector_packed_decimal)] = .{ .index = @enumToInt(Feature.vector_packed_decimal), .name = @tagName(Feature.vector_packed_decimal), .llvm_name = "vector-packed-decimal", .description = "Assume that the vector packed decimal facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vector_packed_decimal_enhancement)] = .{ .index = @enumToInt(Feature.vector_packed_decimal_enhancement), .name = @tagName(Feature.vector_packed_decimal_enhancement), .llvm_name = "vector-packed-decimal-enhancement", .description = "Assume that the vector packed decimal enhancement facility is installed", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -424,7 +424,7 @@ pub const cpu = struct { pub const arch8 = Cpu{ .name = "arch8", .llvm_name = "arch8", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const arch9 = Cpu{ .name = "arch9", @@ -445,12 +445,12 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const z10 = Cpu{ .name = "z10", .llvm_name = "z10", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const z13 = Cpu{ .name = "z13", diff --git a/lib/std/target/wasm.zig b/lib/std/target/wasm.zig index 8546b067dd..3df17d503b 100644 --- a/lib/std/target/wasm.zig +++ b/lib/std/target/wasm.zig @@ -18,70 +18,70 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.atomics)] = .{ .index = @enumToInt(Feature.atomics), .name = @tagName(Feature.atomics), .llvm_name = "atomics", .description = "Enable Atomics", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.bulk_memory)] = .{ .index = @enumToInt(Feature.bulk_memory), .name = @tagName(Feature.bulk_memory), .llvm_name = "bulk-memory", .description = "Enable bulk memory operations", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.exception_handling)] = .{ .index = @enumToInt(Feature.exception_handling), .name = @tagName(Feature.exception_handling), .llvm_name = "exception-handling", .description = "Enable Wasm exception handling", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.multivalue)] = .{ .index = @enumToInt(Feature.multivalue), .name = @tagName(Feature.multivalue), .llvm_name = "multivalue", .description = "Enable multivalue blocks, instructions, and functions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mutable_globals)] = .{ .index = @enumToInt(Feature.mutable_globals), .name = @tagName(Feature.mutable_globals), .llvm_name = "mutable-globals", .description = "Enable mutable globals", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nontrapping_fptoint)] = .{ .index = @enumToInt(Feature.nontrapping_fptoint), .name = @tagName(Feature.nontrapping_fptoint), .llvm_name = "nontrapping-fptoint", .description = "Enable non-trapping float-to-int conversion operators", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sign_ext)] = .{ .index = @enumToInt(Feature.sign_ext), .name = @tagName(Feature.sign_ext), .llvm_name = "sign-ext", .description = "Enable sign extension operators", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.simd128)] = .{ .index = @enumToInt(Feature.simd128), .name = @tagName(Feature.simd128), .llvm_name = "simd128", .description = "Enable 128-bit SIMD", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.tail_call)] = .{ .index = @enumToInt(Feature.tail_call), .name = @tagName(Feature.tail_call), .llvm_name = "tail-call", .description = "Enable tail call instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.unimplemented_simd128)] = .{ .index = @enumToInt(Feature.unimplemented_simd128), @@ -110,12 +110,12 @@ pub const cpu = struct { pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const mvp = Cpu{ .name = "mvp", .llvm_name = "mvp", - .features = 0, + .features = featureSet(&[_]Feature{}), }; }; diff --git a/lib/std/target/x86.zig b/lib/std/target/x86.zig index 9d3b574401..7f1ec42dab 100644 --- a/lib/std/target/x86.zig +++ b/lib/std/target/x86.zig @@ -132,21 +132,21 @@ pub usingnamespace Cpu.Feature.feature_set_fns(Feature); pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; - std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + std.debug.assert(len <= Cpu.Feature.Set.bit_count); var result: [len]Cpu.Feature = undefined; result[@enumToInt(Feature.@"16bit_mode")] = .{ .index = @enumToInt(Feature.@"16bit_mode"), .name = @tagName(Feature.@"16bit_mode"), .llvm_name = "16bit-mode", .description = "16-bit mode (i8086)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.@"32bit_mode")] = .{ .index = @enumToInt(Feature.@"32bit_mode"), .name = @tagName(Feature.@"32bit_mode"), .llvm_name = "32bit-mode", .description = "32-bit mode (80386)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.@"3dnow")] = .{ .index = @enumToInt(Feature.@"3dnow"), @@ -171,21 +171,21 @@ pub const all_features = blk: { .name = @tagName(Feature.@"64bit"), .llvm_name = "64bit", .description = "Support 64-bit instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.@"64bit_mode")] = .{ .index = @enumToInt(Feature.@"64bit_mode"), .name = @tagName(Feature.@"64bit_mode"), .llvm_name = "64bit-mode", .description = "64-bit mode (x86_64)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.adx)] = .{ .index = @enumToInt(Feature.adx), .name = @tagName(Feature.adx), .llvm_name = "adx", .description = "Support ADX instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.aes)] = .{ .index = @enumToInt(Feature.aes), @@ -356,56 +356,56 @@ pub const all_features = blk: { .name = @tagName(Feature.bmi), .llvm_name = "bmi", .description = "Support BMI instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.bmi2)] = .{ .index = @enumToInt(Feature.bmi2), .name = @tagName(Feature.bmi2), .llvm_name = "bmi2", .description = "Support BMI2 instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.branchfusion)] = .{ .index = @enumToInt(Feature.branchfusion), .name = @tagName(Feature.branchfusion), .llvm_name = "branchfusion", .description = "CMP/TEST can be fused with conditional branches", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cldemote)] = .{ .index = @enumToInt(Feature.cldemote), .name = @tagName(Feature.cldemote), .llvm_name = "cldemote", .description = "Enable Cache Demote", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.clflushopt)] = .{ .index = @enumToInt(Feature.clflushopt), .name = @tagName(Feature.clflushopt), .llvm_name = "clflushopt", .description = "Flush A Cache Line Optimized", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.clwb)] = .{ .index = @enumToInt(Feature.clwb), .name = @tagName(Feature.clwb), .llvm_name = "clwb", .description = "Cache Line Write Back", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.clzero)] = .{ .index = @enumToInt(Feature.clzero), .name = @tagName(Feature.clzero), .llvm_name = "clzero", .description = "Enable Cache Line Zero", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cmov)] = .{ .index = @enumToInt(Feature.cmov), .name = @tagName(Feature.cmov), .llvm_name = "cmov", .description = "Enable conditional move instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.cx16)] = .{ .index = @enumToInt(Feature.cx16), @@ -421,21 +421,21 @@ pub const all_features = blk: { .name = @tagName(Feature.cx8), .llvm_name = "cx8", .description = "Support CMPXCHG8B instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.enqcmd)] = .{ .index = @enumToInt(Feature.enqcmd), .name = @tagName(Feature.enqcmd), .llvm_name = "enqcmd", .description = "Has ENQCMD instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ermsb)] = .{ .index = @enumToInt(Feature.ermsb), .name = @tagName(Feature.ermsb), .llvm_name = "ermsb", .description = "REP MOVS/STOS are fast", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.f16c)] = .{ .index = @enumToInt(Feature.f16c), @@ -451,42 +451,42 @@ pub const all_features = blk: { .name = @tagName(Feature.false_deps_lzcnt_tzcnt), .llvm_name = "false-deps-lzcnt-tzcnt", .description = "LZCNT/TZCNT have a false dependency on dest register", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.false_deps_popcnt)] = .{ .index = @enumToInt(Feature.false_deps_popcnt), .name = @tagName(Feature.false_deps_popcnt), .llvm_name = "false-deps-popcnt", .description = "POPCNT has a false dependency on dest register", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_11bytenop)] = .{ .index = @enumToInt(Feature.fast_11bytenop), .name = @tagName(Feature.fast_11bytenop), .llvm_name = "fast-11bytenop", .description = "Target can quickly decode up to 11 byte NOPs", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_15bytenop)] = .{ .index = @enumToInt(Feature.fast_15bytenop), .name = @tagName(Feature.fast_15bytenop), .llvm_name = "fast-15bytenop", .description = "Target can quickly decode up to 15 byte NOPs", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_bextr)] = .{ .index = @enumToInt(Feature.fast_bextr), .name = @tagName(Feature.fast_bextr), .llvm_name = "fast-bextr", .description = "Indicates that the BEXTR instruction is implemented as a single uop with good throughput", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_gather)] = .{ .index = @enumToInt(Feature.fast_gather), .name = @tagName(Feature.fast_gather), .llvm_name = "fast-gather", .description = "Indicates if gather is reasonably fast", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_hops)] = .{ .index = @enumToInt(Feature.fast_hops), @@ -502,56 +502,56 @@ pub const all_features = blk: { .name = @tagName(Feature.fast_lzcnt), .llvm_name = "fast-lzcnt", .description = "LZCNT instructions are as fast as most simple integer ops", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_partial_ymm_or_zmm_write)] = .{ .index = @enumToInt(Feature.fast_partial_ymm_or_zmm_write), .name = @tagName(Feature.fast_partial_ymm_or_zmm_write), .llvm_name = "fast-partial-ymm-or-zmm-write", .description = "Partial writes to YMM/ZMM registers are fast", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_scalar_fsqrt)] = .{ .index = @enumToInt(Feature.fast_scalar_fsqrt), .name = @tagName(Feature.fast_scalar_fsqrt), .llvm_name = "fast-scalar-fsqrt", .description = "Scalar SQRT is fast (disable Newton-Raphson)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_scalar_shift_masks)] = .{ .index = @enumToInt(Feature.fast_scalar_shift_masks), .name = @tagName(Feature.fast_scalar_shift_masks), .llvm_name = "fast-scalar-shift-masks", .description = "Prefer a left/right scalar logical shift pair over a shift+and pair", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_shld_rotate)] = .{ .index = @enumToInt(Feature.fast_shld_rotate), .name = @tagName(Feature.fast_shld_rotate), .llvm_name = "fast-shld-rotate", .description = "SHLD can be used as a faster rotate", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_variable_shuffle)] = .{ .index = @enumToInt(Feature.fast_variable_shuffle), .name = @tagName(Feature.fast_variable_shuffle), .llvm_name = "fast-variable-shuffle", .description = "Shuffles with variable masks are fast", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_vector_fsqrt)] = .{ .index = @enumToInt(Feature.fast_vector_fsqrt), .name = @tagName(Feature.fast_vector_fsqrt), .llvm_name = "fast-vector-fsqrt", .description = "Vector SQRT is fast (disable Newton-Raphson)", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fast_vector_shift_masks)] = .{ .index = @enumToInt(Feature.fast_vector_shift_masks), .name = @tagName(Feature.fast_vector_shift_masks), .llvm_name = "fast-vector-shift-masks", .description = "Prefer a left/right vector logical shift pair over a shift+and pair", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fma)] = .{ .index = @enumToInt(Feature.fma), @@ -577,14 +577,14 @@ pub const all_features = blk: { .name = @tagName(Feature.fsgsbase), .llvm_name = "fsgsbase", .description = "Support FS/GS Base instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.fxsr)] = .{ .index = @enumToInt(Feature.fxsr), .name = @tagName(Feature.fxsr), .llvm_name = "fxsr", .description = "Support fxsave/fxrestore instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.gfni)] = .{ .index = @enumToInt(Feature.gfni), @@ -600,119 +600,119 @@ pub const all_features = blk: { .name = @tagName(Feature.idivl_to_divb), .llvm_name = "idivl-to-divb", .description = "Use 8-bit divide for positive values less than 256", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.idivq_to_divl)] = .{ .index = @enumToInt(Feature.idivq_to_divl), .name = @tagName(Feature.idivq_to_divl), .llvm_name = "idivq-to-divl", .description = "Use 32-bit divide for positive values less than 2^32", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.invpcid)] = .{ .index = @enumToInt(Feature.invpcid), .name = @tagName(Feature.invpcid), .llvm_name = "invpcid", .description = "Invalidate Process-Context Identifier", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lea_sp)] = .{ .index = @enumToInt(Feature.lea_sp), .name = @tagName(Feature.lea_sp), .llvm_name = "lea-sp", .description = "Use LEA for adjusting the stack pointer", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lea_uses_ag)] = .{ .index = @enumToInt(Feature.lea_uses_ag), .name = @tagName(Feature.lea_uses_ag), .llvm_name = "lea-uses-ag", .description = "LEA instruction needs inputs at AG stage", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lwp)] = .{ .index = @enumToInt(Feature.lwp), .name = @tagName(Feature.lwp), .llvm_name = "lwp", .description = "Enable LWP instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.lzcnt)] = .{ .index = @enumToInt(Feature.lzcnt), .name = @tagName(Feature.lzcnt), .llvm_name = "lzcnt", .description = "Support LZCNT instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.macrofusion)] = .{ .index = @enumToInt(Feature.macrofusion), .name = @tagName(Feature.macrofusion), .llvm_name = "macrofusion", .description = "Various instructions can be fused with conditional branches", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.merge_to_threeway_branch)] = .{ .index = @enumToInt(Feature.merge_to_threeway_branch), .name = @tagName(Feature.merge_to_threeway_branch), .llvm_name = "merge-to-threeway-branch", .description = "Merge branches to a three-way conditional branch", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mmx)] = .{ .index = @enumToInt(Feature.mmx), .name = @tagName(Feature.mmx), .llvm_name = "mmx", .description = "Enable MMX instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.movbe)] = .{ .index = @enumToInt(Feature.movbe), .name = @tagName(Feature.movbe), .llvm_name = "movbe", .description = "Support MOVBE instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.movdir64b)] = .{ .index = @enumToInt(Feature.movdir64b), .name = @tagName(Feature.movdir64b), .llvm_name = "movdir64b", .description = "Support movdir64b instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.movdiri)] = .{ .index = @enumToInt(Feature.movdiri), .name = @tagName(Feature.movdiri), .llvm_name = "movdiri", .description = "Support movdiri instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mpx)] = .{ .index = @enumToInt(Feature.mpx), .name = @tagName(Feature.mpx), .llvm_name = "mpx", .description = "Support MPX instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.mwaitx)] = .{ .index = @enumToInt(Feature.mwaitx), .name = @tagName(Feature.mwaitx), .llvm_name = "mwaitx", .description = "Enable MONITORX/MWAITX timer functionality", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.nopl)] = .{ .index = @enumToInt(Feature.nopl), .name = @tagName(Feature.nopl), .llvm_name = "nopl", .description = "Enable NOPL instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pad_short_functions)] = .{ .index = @enumToInt(Feature.pad_short_functions), .name = @tagName(Feature.pad_short_functions), .llvm_name = "pad-short-functions", .description = "Pad short functions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pclmul)] = .{ .index = @enumToInt(Feature.pclmul), @@ -728,70 +728,70 @@ pub const all_features = blk: { .name = @tagName(Feature.pconfig), .llvm_name = "pconfig", .description = "platform configuration instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.pku)] = .{ .index = @enumToInt(Feature.pku), .name = @tagName(Feature.pku), .llvm_name = "pku", .description = "Enable protection keys", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.popcnt)] = .{ .index = @enumToInt(Feature.popcnt), .name = @tagName(Feature.popcnt), .llvm_name = "popcnt", .description = "Support POPCNT instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prefer_256_bit)] = .{ .index = @enumToInt(Feature.prefer_256_bit), .name = @tagName(Feature.prefer_256_bit), .llvm_name = "prefer-256-bit", .description = "Prefer 256-bit AVX instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prefetchwt1)] = .{ .index = @enumToInt(Feature.prefetchwt1), .name = @tagName(Feature.prefetchwt1), .llvm_name = "prefetchwt1", .description = "Prefetch with Intent to Write and T1 Hint", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.prfchw)] = .{ .index = @enumToInt(Feature.prfchw), .name = @tagName(Feature.prfchw), .llvm_name = "prfchw", .description = "Support PRFCHW instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.ptwrite)] = .{ .index = @enumToInt(Feature.ptwrite), .name = @tagName(Feature.ptwrite), .llvm_name = "ptwrite", .description = "Support ptwrite instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rdpid)] = .{ .index = @enumToInt(Feature.rdpid), .name = @tagName(Feature.rdpid), .llvm_name = "rdpid", .description = "Support RDPID instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rdrnd)] = .{ .index = @enumToInt(Feature.rdrnd), .name = @tagName(Feature.rdrnd), .llvm_name = "rdrnd", .description = "Support RDRAND instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rdseed)] = .{ .index = @enumToInt(Feature.rdseed), .name = @tagName(Feature.rdseed), .llvm_name = "rdseed", .description = "Support RDSEED instruction", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.retpoline)] = .{ .index = @enumToInt(Feature.retpoline), @@ -817,35 +817,35 @@ pub const all_features = blk: { .name = @tagName(Feature.retpoline_indirect_branches), .llvm_name = "retpoline-indirect-branches", .description = "Remove speculation of indirect branches from the generated code", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.retpoline_indirect_calls)] = .{ .index = @enumToInt(Feature.retpoline_indirect_calls), .name = @tagName(Feature.retpoline_indirect_calls), .llvm_name = "retpoline-indirect-calls", .description = "Remove speculation of indirect calls from the generated code", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.rtm)] = .{ .index = @enumToInt(Feature.rtm), .name = @tagName(Feature.rtm), .llvm_name = "rtm", .description = "Support RTM instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sahf)] = .{ .index = @enumToInt(Feature.sahf), .name = @tagName(Feature.sahf), .llvm_name = "sahf", .description = "Support LAHF and SAHF instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sgx)] = .{ .index = @enumToInt(Feature.sgx), .name = @tagName(Feature.sgx), .llvm_name = "sgx", .description = "Enable Software Guard Extensions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sha)] = .{ .index = @enumToInt(Feature.sha), @@ -861,91 +861,91 @@ pub const all_features = blk: { .name = @tagName(Feature.shstk), .llvm_name = "shstk", .description = "Support CET Shadow-Stack instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_3ops_lea)] = .{ .index = @enumToInt(Feature.slow_3ops_lea), .name = @tagName(Feature.slow_3ops_lea), .llvm_name = "slow-3ops-lea", .description = "LEA instruction with 3 ops or certain registers is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_incdec)] = .{ .index = @enumToInt(Feature.slow_incdec), .name = @tagName(Feature.slow_incdec), .llvm_name = "slow-incdec", .description = "INC and DEC instructions are slower than ADD and SUB", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_lea)] = .{ .index = @enumToInt(Feature.slow_lea), .name = @tagName(Feature.slow_lea), .llvm_name = "slow-lea", .description = "LEA instruction with certain arguments is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_pmaddwd)] = .{ .index = @enumToInt(Feature.slow_pmaddwd), .name = @tagName(Feature.slow_pmaddwd), .llvm_name = "slow-pmaddwd", .description = "PMADDWD is slower than PMULLD", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_pmulld)] = .{ .index = @enumToInt(Feature.slow_pmulld), .name = @tagName(Feature.slow_pmulld), .llvm_name = "slow-pmulld", .description = "PMULLD instruction is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_shld)] = .{ .index = @enumToInt(Feature.slow_shld), .name = @tagName(Feature.slow_shld), .llvm_name = "slow-shld", .description = "SHLD instruction is slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_two_mem_ops)] = .{ .index = @enumToInt(Feature.slow_two_mem_ops), .name = @tagName(Feature.slow_two_mem_ops), .llvm_name = "slow-two-mem-ops", .description = "Two memory operand instructions are slow", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_unaligned_mem_16)] = .{ .index = @enumToInt(Feature.slow_unaligned_mem_16), .name = @tagName(Feature.slow_unaligned_mem_16), .llvm_name = "slow-unaligned-mem-16", .description = "Slow unaligned 16-byte memory access", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.slow_unaligned_mem_32)] = .{ .index = @enumToInt(Feature.slow_unaligned_mem_32), .name = @tagName(Feature.slow_unaligned_mem_32), .llvm_name = "slow-unaligned-mem-32", .description = "Slow unaligned 32-byte memory access", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.soft_float)] = .{ .index = @enumToInt(Feature.soft_float), .name = @tagName(Feature.soft_float), .llvm_name = "soft-float", .description = "Use software floating point features", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sse)] = .{ .index = @enumToInt(Feature.sse), .name = @tagName(Feature.sse), .llvm_name = "sse", .description = "Enable SSE instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sse_unaligned_mem)] = .{ .index = @enumToInt(Feature.sse_unaligned_mem), .name = @tagName(Feature.sse_unaligned_mem), .llvm_name = "sse-unaligned-mem", .description = "Allow unaligned memory operands with SSE instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.sse2)] = .{ .index = @enumToInt(Feature.sse2), @@ -1006,7 +1006,7 @@ pub const all_features = blk: { .name = @tagName(Feature.tbm), .llvm_name = "tbm", .description = "Enable TBM instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.vaes)] = .{ .index = @enumToInt(Feature.vaes), @@ -1033,21 +1033,21 @@ pub const all_features = blk: { .name = @tagName(Feature.waitpkg), .llvm_name = "waitpkg", .description = "Wait and pause enhancements", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.wbnoinvd)] = .{ .index = @enumToInt(Feature.wbnoinvd), .name = @tagName(Feature.wbnoinvd), .llvm_name = "wbnoinvd", .description = "Write Back No Invalidate", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.x87)] = .{ .index = @enumToInt(Feature.x87), .name = @tagName(Feature.x87), .llvm_name = "x87", .description = "Enable X87 float instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xop)] = .{ .index = @enumToInt(Feature.xop), @@ -1063,28 +1063,28 @@ pub const all_features = blk: { .name = @tagName(Feature.xsave), .llvm_name = "xsave", .description = "Support xsave instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xsavec)] = .{ .index = @enumToInt(Feature.xsavec), .name = @tagName(Feature.xsavec), .llvm_name = "xsavec", .description = "Support xsavec instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xsaveopt)] = .{ .index = @enumToInt(Feature.xsaveopt), .name = @tagName(Feature.xsaveopt), .llvm_name = "xsaveopt", .description = "Support xsaveopt instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; result[@enumToInt(Feature.xsaves)] = .{ .index = @enumToInt(Feature.xsaves), .name = @tagName(Feature.xsaves), .llvm_name = "xsaves", .description = "Support xsaves instructions", - .dependencies = 0, + .dependencies = featureSet(&[_]Feature{}), }; break :blk result; }; @@ -2365,7 +2365,7 @@ pub const cpu = struct { pub const lakemont = Cpu{ .name = "lakemont", .llvm_name = "lakemont", - .features = 0, + .features = featureSet(&[_]Feature{}), }; pub const nehalem = Cpu{ .name = "nehalem", diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index 307e953321..f533d9b34e 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -64,6 +64,7 @@ const Error = extern enum { CacheUnavailable, PathTooLong, CCompilerCannotFindFile, + NoCCompilerInstalled, ReadingDepFile, InvalidDepFile, MissingArchitecture, @@ -89,6 +90,7 @@ const Error = extern enum { UnknownCpuFeature, InvalidCpuFeatures, InvalidLlvmCpuFeaturesFormat, + UnknownApplicationBinaryInterface, }; const FILE = std.c.FILE; @@ -585,11 +587,12 @@ const Stage2CpuFeatures = struct { fn createFromLLVM( allocator: *mem.Allocator, - arch_name: [*:0]const u8, + zig_triple: [*:0]const u8, llvm_cpu_name_z: [*:0]const u8, llvm_cpu_features: [*:0]const u8, ) !*Self { - const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); + const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); + const arch = target.Cross.arch; const llvm_cpu_name = mem.toSliceConst(u8, llvm_cpu_name_z); for (arch.allCpus()) |cpu| { @@ -620,8 +623,8 @@ const Stage2CpuFeatures = struct { const this_llvm_name = feature.llvm_name orelse continue; if (mem.eql(u8, llvm_feat, this_llvm_name)) { switch (op) { - .add => set |= @as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index), - .sub => set &= ~(@as(Target.Cpu.Feature.Set, 1) << @intCast(u7, index)), + .add => set.addFeature(@intCast(u8, index)), + .sub => set.removeFeature(@intCast(u8, index)), } break; } @@ -691,7 +694,7 @@ const Stage2CpuFeatures = struct { } for (all_features) |feature, index| { - if (!Target.Cpu.Feature.isEnabled(feature_set, @intCast(u7, index))) continue; + if (!feature_set.isEnabled(@intCast(u8, index))) continue; if (feature.llvm_name) |llvm_name| { try llvm_features_buffer.append("+"); @@ -736,43 +739,75 @@ const Stage2CpuFeatures = struct { // ABI warning export fn stage2_cpu_features_parse_cpu( result: **Stage2CpuFeatures, - arch_name: [*:0]const u8, + zig_triple: [*:0]const u8, cpu_name: [*:0]const u8, ) Error { - result.* = parseCpu(arch_name, cpu_name) catch |err| switch (err) { + result.* = parseCpu(zig_triple, cpu_name) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, - error.UnknownCpu => return .UnknownCpu, error.UnknownArchitecture => return .UnknownArchitecture, error.UnknownSubArchitecture => return .UnknownSubArchitecture, + error.UnknownOperatingSystem => return .UnknownOperatingSystem, + error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, + error.MissingOperatingSystem => return .MissingOperatingSystem, + error.MissingArchitecture => return .MissingArchitecture, }; return .None; } -fn parseCpu(arch_name: [*:0]const u8, cpu_name: [*:0]const u8) !*Stage2CpuFeatures { - const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); - const cpu = try arch.parseCpu(mem.toSliceConst(u8, cpu_name)); +fn parseCpu(zig_triple: [*:0]const u8, cpu_name_z: [*:0]const u8) !*Stage2CpuFeatures { + const cpu_name = mem.toSliceConst(u8, cpu_name_z); + const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); + const arch = target.Cross.arch; + const cpu = arch.parseCpu(cpu_name) catch |err| switch (err) { + error.UnknownCpu => { + std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{ + cpu_name, + @tagName(arch), + }); + for (arch.allCpus()) |cpu| { + std.debug.warn(" {}\n", .{cpu.name}); + } + process.exit(1); + }, + else => |e| return e, + }; return Stage2CpuFeatures.createFromCpu(std.heap.c_allocator, arch, cpu); } // ABI warning export fn stage2_cpu_features_parse_features( result: **Stage2CpuFeatures, - arch_name: [*:0]const u8, + zig_triple: [*:0]const u8, features_text: [*:0]const u8, ) Error { - result.* = parseFeatures(arch_name, features_text) catch |err| switch (err) { + result.* = parseFeatures(zig_triple, features_text) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, - error.UnknownCpuFeature => return .UnknownCpuFeature, error.InvalidCpuFeatures => return .InvalidCpuFeatures, error.UnknownArchitecture => return .UnknownArchitecture, error.UnknownSubArchitecture => return .UnknownSubArchitecture, + error.UnknownOperatingSystem => return .UnknownOperatingSystem, + error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, + error.MissingOperatingSystem => return .MissingOperatingSystem, + error.MissingArchitecture => return .MissingArchitecture, }; return .None; } -fn parseFeatures(arch_name: [*:0]const u8, features_text: [*:0]const u8) !*Stage2CpuFeatures { - const arch = try Target.parseArchSub(mem.toSliceConst(u8, arch_name)); - const set = try arch.parseCpuFeatureSet(mem.toSliceConst(u8, features_text)); +fn parseFeatures(zig_triple: [*:0]const u8, features_text: [*:0]const u8) !*Stage2CpuFeatures { + const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); + const arch = target.Cross.arch; + const set = arch.parseCpuFeatureSet(mem.toSliceConst(u8, features_text)) catch |err| switch (err) { + error.UnknownCpuFeature => { + std.debug.warn("Unknown CPU features specified.\nAvailable CPU features for architecture '{}':\n", .{ + @tagName(arch), + }); + for (arch.allFeaturesList()) |feature| { + std.debug.warn(" {}\n", .{feature.name}); + } + process.exit(1); + }, + else => |e| return e, + }; return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, set); } @@ -787,13 +822,13 @@ export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures) Error { // ABI warning export fn stage2_cpu_features_llvm( result: **Stage2CpuFeatures, - arch_name: [*:0]const u8, + zig_triple: [*:0]const u8, llvm_cpu_name: [*:0]const u8, llvm_cpu_features: [*:0]const u8, ) Error { result.* = Stage2CpuFeatures.createFromLLVM( std.heap.c_allocator, - arch_name, + zig_triple, llvm_cpu_name, llvm_cpu_features, ) catch |err| switch (err) { @@ -801,6 +836,10 @@ export fn stage2_cpu_features_llvm( error.UnknownArchitecture => return .UnknownArchitecture, error.UnknownSubArchitecture => return .UnknownSubArchitecture, error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat, + error.UnknownOperatingSystem => return .UnknownOperatingSystem, + error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, + error.MissingOperatingSystem => return .MissingOperatingSystem, + error.MissingArchitecture => return .MissingArchitecture, }; return .None; } diff --git a/src/error.cpp b/src/error.cpp index 6c6abfcd22..5bf1667db9 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -63,6 +63,7 @@ const char *err_str(Error err) { case ErrorUnknownCpuFeature: return "unknown CPU feature"; case ErrorInvalidCpuFeatures: return "invalid CPU features"; case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format"; + case ErrorUnknownApplicationBinaryInterface: return "unknown application binary interface"; } return "(invalid error)"; } diff --git a/src/main.cpp b/src/main.cpp index 8e331461f8..878c15e17c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -977,16 +977,19 @@ int main(int argc, char **argv) { } } + Buf zig_triple_buf = BUF_INIT; + target_triple_zig(&zig_triple_buf, &target); + if (cpu && features) { fprintf(stderr, "-target-cpu and -target-feature options not allowed together\n"); return main_exit(root_progress_node, EXIT_FAILURE); } else if (cpu) { - if ((err = stage2_cpu_features_parse_cpu(&target.cpu_features, target_arch_name(target.arch), cpu))) { + if ((err = stage2_cpu_features_parse_cpu(&target.cpu_features, buf_ptr(&zig_triple_buf), cpu))) { fprintf(stderr, "-target-cpu error: %s\n", err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); } } else if (features) { - if ((err = stage2_cpu_features_parse_features(&target.cpu_features, target_arch_name(target.arch), + if ((err = stage2_cpu_features_parse_features(&target.cpu_features, buf_ptr(&zig_triple_buf), features))) { fprintf(stderr, "-target-feature error: %s\n", err_str(err)); @@ -995,7 +998,7 @@ int main(int argc, char **argv) { } else if (target.is_native) { const char *cpu_name = ZigLLVMGetHostCPUName(); const char *cpu_features = ZigLLVMGetNativeFeatures(); - if ((err = stage2_cpu_features_llvm(&target.cpu_features, target_arch_name(target.arch), + if ((err = stage2_cpu_features_llvm(&target.cpu_features, buf_ptr(&zig_triple_buf), cpu_name, cpu_features))) { fprintf(stderr, "unable to determine native CPU features: %s\n", err_str(err)); @@ -1014,9 +1017,7 @@ int main(int argc, char **argv) { } if (target_requires_pic(&target, have_libc) && want_pic == WantPICDisabled) { - Buf triple_buf = BUF_INIT; - target_triple_zig(&triple_buf, &target); - fprintf(stderr, "`--disable-pic` is incompatible with target '%s'\n", buf_ptr(&triple_buf)); + fprintf(stderr, "`--disable-pic` is incompatible with target '%s'\n", buf_ptr(&zig_triple_buf)); return print_error_usage(arg0); } diff --git a/src/userland.cpp b/src/userland.cpp index 22d2daa8e4..4a658d76c5 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -96,11 +96,11 @@ struct Stage2CpuFeatures { const char *cache_hash; }; -Error stage2_cpu_features_parse_cpu(Stage2CpuFeatures **out, const char *arch, const char *str) { +Error stage2_cpu_features_parse_cpu(Stage2CpuFeatures **out, const char *zig_triple, const char *str) { const char *msg = "stage0 called stage2_cpu_features_parse_cpu"; stage2_panic(msg, strlen(msg)); } -Error stage2_cpu_features_parse_features(Stage2CpuFeatures **out, const char *arch, const char *str) { +Error stage2_cpu_features_parse_features(Stage2CpuFeatures **out, const char *zig_triple, const char *str) { const char *msg = "stage0 called stage2_cpu_features_parse_features"; stage2_panic(msg, strlen(msg)); } @@ -111,7 +111,7 @@ Error stage2_cpu_features_baseline(Stage2CpuFeatures **out) { *out = result; return ErrorNone; } -Error stage2_cpu_features_llvm(Stage2CpuFeatures **out, const char *arch, +Error stage2_cpu_features_llvm(Stage2CpuFeatures **out, const char *zig_triple, const char *llvm_cpu_name, const char *llvm_features) { Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); diff --git a/src/userland.h b/src/userland.h index 052321a718..e84b62aecb 100644 --- a/src/userland.h +++ b/src/userland.h @@ -83,6 +83,7 @@ enum Error { ErrorUnknownCpuFeature, ErrorInvalidCpuFeatures, ErrorInvalidLlvmCpuFeaturesFormat, + ErrorUnknownApplicationBinaryInterface, }; // ABI warning @@ -184,18 +185,18 @@ struct Stage2CpuFeatures; // ABI warning ZIG_EXTERN_C Error stage2_cpu_features_parse_cpu(struct Stage2CpuFeatures **result, - const char *arch, const char *cpu_name); + const char *zig_triple, const char *cpu_name); // ABI warning ZIG_EXTERN_C Error stage2_cpu_features_parse_features(struct Stage2CpuFeatures **result, - const char *arch, const char *features); + const char *zig_triple, const char *features); // ABI warning ZIG_EXTERN_C Error stage2_cpu_features_baseline(struct Stage2CpuFeatures **result); // ABI warning ZIG_EXTERN_C Error stage2_cpu_features_llvm(struct Stage2CpuFeatures **result, - const char *arch, const char *llvm_cpu_name, const char *llvm_features); + const char *zig_triple, const char *llvm_cpu_name, const char *llvm_features); // ABI warning ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const struct Stage2CpuFeatures *cpu_features); -- cgit v1.2.3 From 39759b90fce2fa114f59793958390778275c0477 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 21 Jan 2020 01:22:37 -0500 Subject: make zig targets show native cpu name and features --- lib/std/target.zig | 4 +- src-self-hosted/print_targets.zig | 23 +++++-- src-self-hosted/stage1.zig | 125 ++++++++++++++++++++++++-------------- src/main.cpp | 2 +- src/userland.cpp | 2 +- src/userland.h | 2 +- 6 files changed, 101 insertions(+), 57 deletions(-) (limited to 'src/userland.cpp') diff --git a/lib/std/target.zig b/lib/std/target.zig index 716be8905c..2566a9be37 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -631,9 +631,9 @@ pub const Target = union(enum) { }; } - pub fn cpuFeaturesList(self: Target) []const *const Cpu.Feature { + pub fn cpuFeatureSet(self: Target) Cpu.Feature.Set { return switch (self.getCpuFeatures()) { - .baseline => self.arch.baselineFeatures(), + .baseline => self.getArch().baselineFeatures(), .cpu => |cpu| cpu.features, .features => |features| features, }; diff --git a/src-self-hosted/print_targets.zig b/src-self-hosted/print_targets.zig index 233b6c106d..f2bab35685 100644 --- a/src-self-hosted/print_targets.zig +++ b/src-self-hosted/print_targets.zig @@ -9,6 +9,7 @@ pub fn cmdTargets( allocator: *Allocator, args: []const []const u8, stdout: *io.OutStream(fs.File.WriteError), + native_target: Target, ) !void { const BOS = io.BufferedOutStream(fs.File.WriteError); var bos = BOS.init(stdout); @@ -76,22 +77,34 @@ pub fn cmdTargets( try jws.objectField("native"); try jws.beginObject(); { - const triple = try Target.current.zigTriple(allocator); + const triple = try native_target.zigTriple(allocator); defer allocator.free(triple); try jws.objectField("triple"); try jws.emitString(triple); } try jws.objectField("arch"); - try jws.emitString(@tagName(Target.current.getArch())); + try jws.emitString(@tagName(native_target.getArch())); try jws.objectField("os"); - try jws.emitString(@tagName(Target.current.getOs())); + try jws.emitString(@tagName(native_target.getOs())); try jws.objectField("abi"); - try jws.emitString(@tagName(Target.current.getAbi())); + try jws.emitString(@tagName(native_target.getAbi())); try jws.objectField("cpuName"); - switch (Target.current.getCpuFeatures()) { + switch (native_target.getCpuFeatures()) { .baseline, .features => try jws.emitNull(), .cpu => |cpu| try jws.emitString(cpu.name), } + { + try jws.objectField("cpuFeatures"); + try jws.beginArray(); + const feature_set = native_target.cpuFeatureSet(); + for (native_target.getArch().allFeaturesList()) |feature, i| { + if (feature_set.isEnabled(@intCast(u8, i))) { + try jws.arrayElem(); + try jws.emitString(feature.name); + } + } + try jws.endArray(); + } try jws.endObject(); try jws.endObject(); diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index f533d9b34e..eed5804c0d 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -539,19 +539,82 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz node.context.maybeRefresh(); } +fn cpuFeaturesFromLLVM( + arch: Target.Arch, + llvm_cpu_name_z: ?[*:0]const u8, + llvm_cpu_features_opt: ?[*:0]const u8, +) !Target.CpuFeatures { + if (llvm_cpu_name_z) |cpu_name_z| { + const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z); + + for (arch.allCpus()) |cpu| { + const this_llvm_name = cpu.llvm_name orelse continue; + if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { + return Target.CpuFeatures{ .cpu = cpu }; + } + } + } + + var set = arch.baselineFeatures(); + const llvm_cpu_features = llvm_cpu_features_opt orelse return Target.CpuFeatures{ + .features = set, + }; + + var it = mem.tokenize(mem.toSliceConst(u8, llvm_cpu_features), ","); + while (it.next()) |decorated_llvm_feat| { + var op: enum { + add, + sub, + } = undefined; + var llvm_feat: []const u8 = undefined; + if (mem.startsWith(u8, decorated_llvm_feat, "+")) { + op = .add; + llvm_feat = decorated_llvm_feat[1..]; + } else if (mem.startsWith(u8, decorated_llvm_feat, "-")) { + op = .sub; + llvm_feat = decorated_llvm_feat[1..]; + } else { + return error.InvalidLlvmCpuFeaturesFormat; + } + for (arch.allFeaturesList()) |feature, index| { + const this_llvm_name = feature.llvm_name orelse continue; + if (mem.eql(u8, llvm_feat, this_llvm_name)) { + switch (op) { + .add => set.addFeature(@intCast(u8, index)), + .sub => set.removeFeature(@intCast(u8, index)), + } + break; + } + } + } + return Target.CpuFeatures{ .features = set }; +} + // ABI warning -export fn stage2_cmd_targets() c_int { - @import("print_targets.zig").cmdTargets( - std.heap.c_allocator, - &[0][]u8{}, - &std.io.getStdOut().outStream().stream, - ) catch |err| { +export fn stage2_cmd_targets(zig_triple: [*:0]const u8) c_int { + cmdTargets(zig_triple) catch |err| { std.debug.warn("unable to list targets: {}\n", .{@errorName(err)}); return -1; }; return 0; } +fn cmdTargets(zig_triple: [*:0]const u8) !void { + var target = try Target.parse(mem.toSliceConst(u8, zig_triple)); + target.Cross.cpu_features = blk: { + const llvm = @import("llvm.zig"); + const llvm_cpu_name = llvm.GetHostCPUName(); + const llvm_cpu_features = llvm.GetNativeFeatures(); + break :blk try cpuFeaturesFromLLVM(target.Cross.arch, llvm_cpu_name, llvm_cpu_features); + }; + return @import("print_targets.zig").cmdTargets( + std.heap.c_allocator, + &[0][]u8{}, + &std.io.getStdOut().outStream().stream, + target, + ); +} + const Stage2CpuFeatures = struct { allocator: *mem.Allocator, cpu_features: Target.CpuFeatures, @@ -588,49 +651,17 @@ const Stage2CpuFeatures = struct { fn createFromLLVM( allocator: *mem.Allocator, zig_triple: [*:0]const u8, - llvm_cpu_name_z: [*:0]const u8, - llvm_cpu_features: [*:0]const u8, + llvm_cpu_name_z: ?[*:0]const u8, + llvm_cpu_features: ?[*:0]const u8, ) !*Self { const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); const arch = target.Cross.arch; - const llvm_cpu_name = mem.toSliceConst(u8, llvm_cpu_name_z); - - for (arch.allCpus()) |cpu| { - const this_llvm_name = cpu.llvm_name orelse continue; - if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { - return createFromCpu(allocator, arch, cpu); - } - } - - var set = arch.baselineFeatures(); - var it = mem.tokenize(mem.toSliceConst(u8, llvm_cpu_features), ","); - while (it.next()) |decorated_llvm_feat| { - var op: enum { - add, - sub, - } = undefined; - var llvm_feat: []const u8 = undefined; - if (mem.startsWith(u8, decorated_llvm_feat, "+")) { - op = .add; - llvm_feat = decorated_llvm_feat[1..]; - } else if (mem.startsWith(u8, decorated_llvm_feat, "-")) { - op = .sub; - llvm_feat = decorated_llvm_feat[1..]; - } else { - return error.InvalidLlvmCpuFeaturesFormat; - } - for (arch.allFeaturesList()) |feature, index| { - const this_llvm_name = feature.llvm_name orelse continue; - if (mem.eql(u8, llvm_feat, this_llvm_name)) { - switch (op) { - .add => set.addFeature(@intCast(u8, index)), - .sub => set.removeFeature(@intCast(u8, index)), - } - break; - } - } + const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name_z, llvm_cpu_features); + switch (cpu_features) { + .baseline => return createBaseline(allocator), + .cpu => |cpu| return createFromCpu(allocator, arch, cpu), + .features => |features| return createFromCpuFeatures(allocator, arch, features), } - return createFromCpuFeatures(allocator, arch, set); } fn createFromCpu(allocator: *mem.Allocator, arch: Target.Arch, cpu: *const Target.Cpu) !*Self { @@ -823,8 +854,8 @@ export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures) Error { export fn stage2_cpu_features_llvm( result: **Stage2CpuFeatures, zig_triple: [*:0]const u8, - llvm_cpu_name: [*:0]const u8, - llvm_cpu_features: [*:0]const u8, + llvm_cpu_name: ?[*:0]const u8, + llvm_cpu_features: ?[*:0]const u8, ) Error { result.* = Stage2CpuFeatures.createFromLLVM( std.heap.c_allocator, diff --git a/src/main.cpp b/src/main.cpp index 878c15e17c..813eada261 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1372,7 +1372,7 @@ int main(int argc, char **argv) { return main_exit(root_progress_node, EXIT_SUCCESS); } case CmdTargets: - return stage2_cmd_targets(); + return stage2_cmd_targets(buf_ptr(&zig_triple_buf)); case CmdNone: return print_full_usage(arg0, stderr, EXIT_FAILURE); } diff --git a/src/userland.cpp b/src/userland.cpp index 4a658d76c5..9a923e1b86 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -141,7 +141,7 @@ void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, *len = strlen(cpu_features->builtin_str); } -int stage2_cmd_targets(void) { +int stage2_cmd_targets(const char *zig_triple) { const char *msg = "stage0 called stage2_cmd_targets"; stage2_panic(msg, strlen(msg)); } diff --git a/src/userland.h b/src/userland.h index e84b62aecb..1a07b605e5 100644 --- a/src/userland.h +++ b/src/userland.h @@ -213,7 +213,7 @@ ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatu const char **ptr, size_t *len); // ABI warning -ZIG_EXTERN_C int stage2_cmd_targets(void); +ZIG_EXTERN_C int stage2_cmd_targets(const char *zig_triple); #endif -- cgit v1.2.3 From 1f7babbc80211e12c9a38ff2196d6ff8c5a19302 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 21 Jan 2020 03:01:20 -0500 Subject: properly forward baseline target cpu features to llvm --- src-self-hosted/stage1.zig | 84 +++++++++++++++++++++++++++++----------------- src/codegen.cpp | 2 ++ src/main.cpp | 2 +- src/userland.cpp | 2 +- src/userland.h | 3 +- 5 files changed, 59 insertions(+), 34 deletions(-) (limited to 'src/userland.cpp') diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index eed5804c0d..9cbbf75d84 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -627,7 +627,7 @@ const Stage2CpuFeatures = struct { const Self = @This(); - fn createBaseline(allocator: *mem.Allocator) !*Self { + fn createBaseline(allocator: *mem.Allocator, arch: Target.Arch) !*Self { const self = try allocator.create(Self); errdefer allocator.destroy(self); @@ -641,10 +641,11 @@ const Stage2CpuFeatures = struct { .allocator = allocator, .cpu_features = .baseline, .llvm_cpu_name = null, - .llvm_features_str = null, + .llvm_features_str = try initLLVMFeatures(allocator, arch, arch.baselineFeatures()), .builtin_str = builtin_str, .cache_hash = cache_hash, }; + return self; } @@ -658,7 +659,7 @@ const Stage2CpuFeatures = struct { const arch = target.Cross.arch; const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name_z, llvm_cpu_features); switch (cpu_features) { - .baseline => return createBaseline(allocator), + .baseline => return createBaseline(allocator, arch), .cpu => |cpu| return createFromCpu(allocator, arch, cpu), .features => |features| return createFromCpuFeatures(allocator, arch, features), } @@ -688,31 +689,13 @@ const Stage2CpuFeatures = struct { return self; } - fn createFromCpuFeatures( + fn initLLVMFeatures( allocator: *mem.Allocator, arch: Target.Arch, feature_set: Target.Cpu.Feature.Set, - ) !*Self { - const self = try allocator.create(Self); - errdefer allocator.destroy(self); - - const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", .{feature_set}); - errdefer allocator.free(cache_hash); - - const generic_arch_name = arch.genericName(); - var builtin_str_buffer = try std.Buffer.allocPrint( - allocator, - \\CpuFeatures{{ - \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ - \\ - , - .{ generic_arch_name, generic_arch_name }, - ); - defer builtin_str_buffer.deinit(); - + ) ![*:0]const u8 { var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); defer llvm_features_buffer.deinit(); - // First, disable all features. // This way, we only get the ones the user requests. const all_features = arch.allFeaturesList(); @@ -723,7 +706,6 @@ const Stage2CpuFeatures = struct { try llvm_features_buffer.append(","); } } - for (all_features) |feature, index| { if (!feature_set.isEnabled(@intCast(u8, index))) continue; @@ -732,15 +714,43 @@ const Stage2CpuFeatures = struct { try llvm_features_buffer.append(llvm_name); try llvm_features_buffer.append(","); } - - try builtin_str_buffer.append(" ."); - try builtin_str_buffer.append(feature.name); - try builtin_str_buffer.append(",\n"); } if (mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")) { llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); } + return llvm_features_buffer.toOwnedSlice().ptr; + } + + fn createFromCpuFeatures( + allocator: *mem.Allocator, + arch: Target.Arch, + feature_set: Target.Cpu.Feature.Set, + ) !*Self { + const self = try allocator.create(Self); + errdefer allocator.destroy(self); + + const cache_hash = try std.fmt.allocPrint0(allocator, "\n{x}", .{feature_set}); + errdefer allocator.free(cache_hash); + + const generic_arch_name = arch.genericName(); + var builtin_str_buffer = try std.Buffer.allocPrint( + allocator, + \\CpuFeatures{{ + \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ + \\ + , + .{ generic_arch_name, generic_arch_name }, + ); + defer builtin_str_buffer.deinit(); + + for (arch.allFeaturesList()) |feature, index| { + if (!feature_set.isEnabled(@intCast(u8, index))) continue; + + try builtin_str_buffer.append(" ."); + try builtin_str_buffer.append(feature.name); + try builtin_str_buffer.append(",\n"); + } try builtin_str_buffer.append( \\ }), @@ -752,7 +762,7 @@ const Stage2CpuFeatures = struct { .allocator = allocator, .cpu_features = .{ .features = feature_set }, .llvm_cpu_name = null, - .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr, + .llvm_features_str = try initLLVMFeatures(allocator, arch, feature_set), .builtin_str = builtin_str_buffer.toOwnedSlice(), .cache_hash = cache_hash, }; @@ -843,13 +853,25 @@ fn parseFeatures(zig_triple: [*:0]const u8, features_text: [*:0]const u8) !*Stag } // ABI warning -export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures) Error { - result.* = Stage2CpuFeatures.createBaseline(std.heap.c_allocator) catch |err| switch (err) { +export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures, zig_triple: [*:0]const u8) Error { + result.* = cpuFeaturesBaseline(zig_triple) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, + error.UnknownArchitecture => return .UnknownArchitecture, + error.UnknownSubArchitecture => return .UnknownSubArchitecture, + error.UnknownOperatingSystem => return .UnknownOperatingSystem, + error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, + error.MissingOperatingSystem => return .MissingOperatingSystem, + error.MissingArchitecture => return .MissingArchitecture, }; return .None; } +fn cpuFeaturesBaseline(zig_triple: [*:0]const u8) !*Stage2CpuFeatures { + const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); + const arch = target.Cross.arch; + return Stage2CpuFeatures.createBaseline(std.heap.c_allocator, arch); +} + // ABI warning export fn stage2_cpu_features_llvm( result: **Stage2CpuFeatures, diff --git a/src/codegen.cpp b/src/codegen.cpp index 9cbd5fc6ab..ffdf0e5bb0 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8802,6 +8802,8 @@ static void init(CodeGen *g) { target_specific_cpu_args = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features); target_specific_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features); } + //fprintf(stderr, "name=%s target_specific_cpu_args=%s\n", buf_ptr(g->root_out_name), target_specific_cpu_args); + //fprintf(stderr, "name=%s target_specific_features=%s\n", buf_ptr(g->root_out_name), target_specific_features); g->target_machine = ZigLLVMCreateTargetMachine(target_ref, buf_ptr(&g->llvm_triple_str), target_specific_cpu_args, target_specific_features, opt_level, reloc_mode, diff --git a/src/main.cpp b/src/main.cpp index 813eada261..d12ae850fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1005,7 +1005,7 @@ int main(int argc, char **argv) { return main_exit(root_progress_node, EXIT_FAILURE); } } else { - if ((err = stage2_cpu_features_baseline(&target.cpu_features))) { + if ((err = stage2_cpu_features_baseline(&target.cpu_features, buf_ptr(&zig_triple_buf)))) { fprintf(stderr, "unable to determine baseline CPU features: %s\n", err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); } diff --git a/src/userland.cpp b/src/userland.cpp index 9a923e1b86..64849b65ed 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -104,7 +104,7 @@ Error stage2_cpu_features_parse_features(Stage2CpuFeatures **out, const char *zi const char *msg = "stage0 called stage2_cpu_features_parse_features"; stage2_panic(msg, strlen(msg)); } -Error stage2_cpu_features_baseline(Stage2CpuFeatures **out) { +Error stage2_cpu_features_baseline(Stage2CpuFeatures **out, const char *zig_triple) { Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); result->builtin_str = ".baseline;\n"; result->cache_hash = "\n\n"; diff --git a/src/userland.h b/src/userland.h index 1a07b605e5..01faf0b532 100644 --- a/src/userland.h +++ b/src/userland.h @@ -192,7 +192,8 @@ ZIG_EXTERN_C Error stage2_cpu_features_parse_features(struct Stage2CpuFeatures * const char *zig_triple, const char *features); // ABI warning -ZIG_EXTERN_C Error stage2_cpu_features_baseline(struct Stage2CpuFeatures **result); +ZIG_EXTERN_C Error stage2_cpu_features_baseline(struct Stage2CpuFeatures **result, + const char *zig_triple); // ABI warning ZIG_EXTERN_C Error stage2_cpu_features_llvm(struct Stage2CpuFeatures **result, -- cgit v1.2.3 From 48c7e6c48b81e6e0423b3e4aea238402189eecb7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 22 Jan 2020 17:13:31 -0500 Subject: std.Target.CpuFeatures is now a struct with both CPU and feature set Previously it was a tagged union which was one of: * baseline * a specific CPU * a set of features Now, it's possible to have a CPU but also modify the CPU's feature set on top of that. This is closer to what LLVM does. This is more correct because Zig's notion of CPUs (and LLVM's) is not exact CPU models. For example "skylake" is not one very specific model; there are several different pieces of hardware that match "skylake" that have different feature sets enabled. --- lib/std/build.zig | 52 +++-- lib/std/target.zig | 152 +++++++------- lib/std/target/avr.zig | 4 - lib/std/target/riscv.zig | 49 +++-- src-self-hosted/print_targets.zig | 12 +- src-self-hosted/stage1.zig | 396 +++++++++++++----------------------- src/codegen.cpp | 2 +- src/main.cpp | 33 +-- src/userland.cpp | 49 +++-- src/userland.h | 16 +- test/compile_errors.zig | 11 +- test/tests.zig | 416 ++++++++++++++++++++------------------ test/translate_c.zig | 22 +- 13 files changed, 557 insertions(+), 657 deletions(-) (limited to 'src/userland.cpp') diff --git a/lib/std/build.zig b/lib/std/build.zig index a36818fb29..ac6ca30494 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -484,6 +484,7 @@ pub const Builder = struct { .arch = builtin.arch, .os = builtin.os, .abi = builtin.abi, + .cpu_features = builtin.cpu_features, }, }).linuxTriple(self.allocator); @@ -1375,6 +1376,7 @@ pub const LibExeObjStep = struct { .arch = target_arch, .os = target_os, .abi = target_abi, + .cpu_features = target_arch.getBaselineCpuFeatures(), }, }); } @@ -1972,25 +1974,41 @@ pub const LibExeObjStep = struct { try zig_args.append("-target"); try zig_args.append(self.target.zigTriple(builder.allocator) catch unreachable); - switch (cross.cpu_features) { - .baseline => {}, - .cpu => |cpu| { + const all_features = self.target.getArch().allFeaturesList(); + var populated_cpu_features = cross.cpu_features.cpu.features; + populated_cpu_features.populateDependencies(all_features); + + if (populated_cpu_features.eql(cross.cpu_features.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(cpu.name); - }, - .features => |features| { - try zig_args.append("-target-cpu-features"); - - var feature_str_buffer = try std.Buffer.initSize(builder.allocator, 0); - for (self.target.getArch().allFeaturesList()) |feature, i| { - if (features.isEnabled(@intCast(Target.Cpu.Feature.Set.Index, i))) { - try feature_str_buffer.append(feature.name); - try feature_str_buffer.append(","); - } + try zig_args.append(cross.cpu_features.cpu.name); + } + } else { + try zig_args.append("-target-cpu"); + try zig_args.append(cross.cpu_features.cpu.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); + 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(','); + } 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 zig_args.append(feature_str_buffer.toSlice()); - }, + } + 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()); } }, } diff --git a/lib/std/target.zig b/lib/std/target.zig index e72a1a8452..f23fc78df2 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -172,6 +172,15 @@ pub const Target = union(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) ?u8 { return switch (arch) { .arm, .armeb, .thumb, .thumbeb => |arm32| switch (arm32) { @@ -251,24 +260,12 @@ pub const Target = union(enum) { return error.UnknownCpu; } - /// This parsing function supports 2 syntaxes. - /// * Comma-separated list of features, with + or - in front of each feature. This - /// form represents a deviation from baseline. - /// * Comma-separated list of features, with no + or - in front of each feature. This - /// form represents an exclusive list of enabled features; no other features besides - /// the ones listed, and their dependencies, will be enabled. + /// 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, features_text: []const u8) !Cpu.Feature.Set { - // Here we compute both and choose the correct result at the end, based - // on whether or not we saw + and - signs. - var whitelist_set = Cpu.Feature.Set.empty; - var baseline_set = arch.baselineFeatures(); - var mode: enum { - unknown, - baseline, - whitelist, - } = .unknown; - + 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; @@ -277,40 +274,20 @@ pub const Target = union(enum) { sub, } = undefined; if (mem.startsWith(u8, item_text, "+")) { - switch (mode) { - .unknown, .baseline => mode = .baseline, - .whitelist => return error.InvalidCpuFeatures, - } op = .add; feature_name = item_text[1..]; } else if (mem.startsWith(u8, item_text, "-")) { - switch (mode) { - .unknown, .baseline => mode = .baseline, - .whitelist => return error.InvalidCpuFeatures, - } op = .sub; feature_name = item_text[1..]; } else { - switch (mode) { - .unknown, .whitelist => mode = .whitelist, - .baseline => return error.InvalidCpuFeatures, - } - op = .add; - feature_name = item_text; + return error.InvalidCpuFeatures; } - const all_features = arch.allFeaturesList(); 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 => { - baseline_set.addFeature(index); - whitelist_set.addFeature(index); - }, - .sub => { - baseline_set.removeFeature(index); - whitelist_set.removeFeature(index); - }, + .add => set.addFeature(index), + .sub => set.removeFeature(index), } break; } @@ -319,10 +296,8 @@ pub const Target = union(enum) { } } - return switch (mode) { - .unknown, .whitelist => whitelist_set, - .baseline => baseline_set, - }; + set.populateDependencies(all_features); + return set; } pub fn toElfMachine(arch: Arch) std.elf.EM { @@ -485,29 +460,37 @@ pub const Target = union(enum) { /// 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 baselineFeatures(arch: Arch) Cpu.Feature.Set { - return switch (arch) { - .arm, .armeb, .thumb, .thumbeb => arm.cpu.generic.features, - .aarch64, .aarch64_be, .aarch64_32 => aarch64.cpu.generic.features, - .avr => avr.baseline_features, - .bpfel, .bpfeb => bpf.cpu.generic.features, - .hexagon => hexagon.cpu.generic.features, - .mips, .mipsel => mips.cpu.mips32.features, - .mips64, .mips64el => mips.cpu.mips64.features, - .msp430 => msp430.cpu.generic.features, - .powerpc, .powerpc64, .powerpc64le => powerpc.cpu.generic.features, - .amdgcn => amdgpu.cpu.generic.features, - .riscv32 => riscv.baseline_32_features, - .riscv64 => riscv.baseline_64_features, - .sparc, .sparcv9, .sparcel => sparc.cpu.generic.features, - .s390x => systemz.cpu.generic.features, - .i386 => x86.cpu.pentium4.features, - .x86_64 => x86.cpu.x86_64.features, - .nvptx, .nvptx64 => nvptx.cpu.sm_20.features, - .wasm32, .wasm64 => wasm.cpu.generic.features, - - else => Cpu.Feature.Set.empty, + 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. @@ -685,19 +668,28 @@ pub const Target = union(enum) { arch: Arch, os: Os, abi: Abi, - cpu_features: CpuFeatures = .baseline, + cpu_features: CpuFeatures, }; - pub const CpuFeatures = union(enum) { - /// The "default" set of CPU features for cross-compiling. A conservative set - /// of features that is expected to be supported on most available hardware. - baseline, - - /// Target one specific CPU. + pub const CpuFeatures = struct { + /// The CPU to target. It has a set of features + /// which are overridden with the `features` field. cpu: *const Cpu, /// Explicitly provide the entire CPU feature set. features: Cpu.Feature.Set, + + pub fn initFromCpu(arch: Arch, cpu: *const Cpu) CpuFeatures { + var features = cpu.features; + if (arch.subArchFeature()) |sub_arch_index| { + features.addFeature(sub_arch_index); + } + features.populateDependencies(arch.allFeaturesList()); + return CpuFeatures{ + .cpu = cpu, + .features = features, + }; + } }; pub const current = Target{ @@ -718,14 +710,6 @@ pub const Target = union(enum) { }; } - pub fn cpuFeatureSet(self: Target) Cpu.Feature.Set { - return switch (self.getCpuFeatures()) { - .baseline => self.getArch().baselineFeatures(), - .cpu => |cpu| cpu.features, - .features => |features| features, - }; - } - pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 { return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{ @tagName(self.getArch()), @@ -791,14 +775,18 @@ 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); var cross = Cross{ - .arch = try parseArchSub(arch_name), + .arch = arch, + .cpu_features = arch.getBaselineCpuFeatures(), .os = try parseOs(os_name), .abi = undefined, }; diff --git a/lib/std/target/avr.zig b/lib/std/target/avr.zig index 8eb6df98f3..3902a3860f 100644 --- a/lib/std/target/avr.zig +++ b/lib/std/target/avr.zig @@ -2378,7 +2378,3 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.avrxmega7, &cpu.m3000, }; - -pub const baseline_features = featureSet(&[_]Feature{ - .avr0, -}); diff --git a/lib/std/target/riscv.zig b/lib/std/target/riscv.zig index e0671ad91b..315329306e 100644 --- a/lib/std/target/riscv.zig +++ b/lib/std/target/riscv.zig @@ -69,11 +69,39 @@ pub const all_features = blk: { }; pub const cpu = struct { + pub const baseline_rv32 = Cpu{ + .name = "baseline_rv32", + .llvm_name = "generic-rv32", + .features = featureSet(&[_]Feature{ + .a, + .c, + .d, + .f, + .m, + .relax, + }), + }; + + pub const baseline_rv64 = Cpu{ + .name = "baseline_rv64", + .llvm_name = "generic-rv64", + .features = featureSet(&[_]Feature{ + .@"64bit", + .a, + .c, + .d, + .f, + .m, + .relax, + }), + }; + pub const generic_rv32 = Cpu{ .name = "generic_rv32", .llvm_name = "generic-rv32", .features = featureSet(&[_]Feature{}), }; + pub const generic_rv64 = Cpu{ .name = "generic_rv64", .llvm_name = "generic-rv64", @@ -87,25 +115,8 @@ pub const cpu = struct { /// 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{ + &cpu.baseline_rv32, + &cpu.baseline_rv64, &cpu.generic_rv32, &cpu.generic_rv64, }; - -pub const baseline_32_features = featureSet(&[_]Feature{ - .a, - .c, - .d, - .f, - .m, - .relax, -}); - -pub const baseline_64_features = featureSet(&[_]Feature{ - .@"64bit", - .a, - .c, - .d, - .f, - .m, - .relax, -}); diff --git a/src-self-hosted/print_targets.zig b/src-self-hosted/print_targets.zig index a7013e8cd9..79041da431 100644 --- a/src-self-hosted/print_targets.zig +++ b/src-self-hosted/print_targets.zig @@ -227,16 +227,14 @@ pub fn cmdTargets( try jws.objectField("abi"); try jws.emitString(@tagName(native_target.getAbi())); try jws.objectField("cpuName"); - switch (native_target.getCpuFeatures()) { - .baseline, .features => try jws.emitNull(), - .cpu => |cpu| try jws.emitString(cpu.name), - } + const cpu_features = native_target.getCpuFeatures(); + try jws.emitString(cpu_features.cpu.name); { try jws.objectField("cpuFeatures"); try jws.beginArray(); - const feature_set = native_target.cpuFeatureSet(); - for (native_target.getArch().allFeaturesList()) |feature, i| { - if (feature_set.isEnabled(@intCast(u8, i))) { + for (native_target.getArch().allFeaturesList()) |feature, i_usize| { + const index = @intCast(Target.Cpu.Feature.Set.Index, i_usize); + if (cpu_features.features.isEnabled(index)) { try jws.arrayElem(); try jws.emitString(feature.name); } diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage1.zig index e80b6ba123..a6a3bc013c 100644 --- a/src-self-hosted/stage1.zig +++ b/src-self-hosted/stage1.zig @@ -540,74 +540,66 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz node.context.maybeRefresh(); } -/// I have observed the CPU name reported by LLVM being incorrect. On -/// the SourceHut build services, LLVM 9.0 reports the CPU as "athlon-xp", -/// which is a 32-bit CPU, even though the system is 64-bit and the reported -/// CPU features include, among other things, +64bit. -/// So the strategy taken here is that we observe both reported CPU, and the -/// reported CPU features. The features are trusted more; but if the features -/// match exactly the features of the reported CPU, then we trust the reported CPU. fn cpuFeaturesFromLLVM( arch: Target.Arch, llvm_cpu_name_z: ?[*:0]const u8, llvm_cpu_features_opt: ?[*:0]const u8, ) !Target.CpuFeatures { - var set = arch.baselineFeatures(); - const llvm_cpu_features = llvm_cpu_features_opt orelse return Target.CpuFeatures{ - .features = set, - }; + var result = arch.getBaselineCpuFeatures(); - const all_features = arch.allFeaturesList(); + if (llvm_cpu_name_z) |cpu_name_z| { + const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z); - var it = mem.tokenize(mem.toSliceConst(u8, llvm_cpu_features), ","); - while (it.next()) |decorated_llvm_feat| { - var op: enum { - add, - sub, - } = undefined; - var llvm_feat: []const u8 = undefined; - if (mem.startsWith(u8, decorated_llvm_feat, "+")) { - op = .add; - llvm_feat = decorated_llvm_feat[1..]; - } else if (mem.startsWith(u8, decorated_llvm_feat, "-")) { - op = .sub; - llvm_feat = decorated_llvm_feat[1..]; - } else { - return error.InvalidLlvmCpuFeaturesFormat; - } - for (all_features) |feature, index| { - const this_llvm_name = feature.llvm_name orelse continue; - if (mem.eql(u8, llvm_feat, this_llvm_name)) { - switch (op) { - .add => set.addFeature(@intCast(u8, index)), - .sub => set.removeFeature(@intCast(u8, index)), - } + for (arch.allCpus()) |cpu| { + const this_llvm_name = cpu.llvm_name orelse continue; + if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { + // Here we use the non-dependencies-populated set, + // so that subtracting features later in this function + // affect the prepopulated set. + result = Target.CpuFeatures{ + .cpu = cpu, + .features = cpu.features, + }; break; } } } - if (llvm_cpu_name_z) |cpu_name_z| { - const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z); + const all_features = arch.allFeaturesList(); - for (arch.allCpus()) |cpu| { - const this_llvm_name = cpu.llvm_name orelse continue; - if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { - // Only trust the CPU if the reported features exactly match. - var populated_reported_features = set; - populated_reported_features.populateDependencies(all_features); - var populated_cpu_features = cpu.features; - populated_cpu_features.populateDependencies(all_features); - if (populated_reported_features.eql(populated_cpu_features)) { - return Target.CpuFeatures{ .cpu = cpu }; - } else { - return Target.CpuFeatures{ .features = set }; + if (llvm_cpu_features_opt) |llvm_cpu_features| { + var it = mem.tokenize(mem.toSliceConst(u8, llvm_cpu_features), ","); + while (it.next()) |decorated_llvm_feat| { + var op: enum { + add, + sub, + } = undefined; + var llvm_feat: []const u8 = undefined; + if (mem.startsWith(u8, decorated_llvm_feat, "+")) { + op = .add; + llvm_feat = decorated_llvm_feat[1..]; + } else if (mem.startsWith(u8, decorated_llvm_feat, "-")) { + op = .sub; + llvm_feat = decorated_llvm_feat[1..]; + } else { + return error.InvalidLlvmCpuFeaturesFormat; + } + for (all_features) |feature, index_usize| { + const this_llvm_name = feature.llvm_name orelse continue; + if (mem.eql(u8, llvm_feat, this_llvm_name)) { + const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize); + switch (op) { + .add => result.features.addFeature(index), + .sub => result.features.removeFeature(index), + } + break; } } } } - return Target.CpuFeatures{ .features = set }; + result.features.populateDependencies(all_features); + return result; } // ABI warning @@ -639,7 +631,6 @@ const Stage2CpuFeatures = struct { allocator: *mem.Allocator, cpu_features: Target.CpuFeatures, - llvm_cpu_name: ?[*:0]const u8, llvm_features_str: ?[*:0]const u8, builtin_str: [:0]const u8, @@ -647,125 +638,64 @@ const Stage2CpuFeatures = struct { const Self = @This(); - fn createBaseline(allocator: *mem.Allocator, arch: Target.Arch) !*Self { - const self = try allocator.create(Self); - errdefer allocator.destroy(self); - - const builtin_str = try std.fmt.allocPrint0(allocator, ".baseline;\n", .{}); - errdefer allocator.free(builtin_str); - - const cache_hash = try std.fmt.allocPrint0(allocator, "\n\n", .{}); - errdefer allocator.free(cache_hash); - - self.* = Self{ - .allocator = allocator, - .cpu_features = .baseline, - .llvm_cpu_name = null, - .llvm_features_str = try initLLVMFeatures(allocator, arch, arch.baselineFeatures()), - .builtin_str = builtin_str, - .cache_hash = cache_hash, - }; - - return self; - } - - fn createFromLLVM( - allocator: *mem.Allocator, - zig_triple: [*:0]const u8, - llvm_cpu_name_z: ?[*:0]const u8, - llvm_cpu_features: ?[*:0]const u8, - ) !*Self { - const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); - const arch = target.Cross.arch; - const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name_z, llvm_cpu_features); - switch (cpu_features) { - .baseline => return createBaseline(allocator, arch), - .cpu => |cpu| return createFromCpu(allocator, arch, cpu), - .features => |features| return createFromCpuFeatures(allocator, arch, features), - } - } - - fn createFromCpu(allocator: *mem.Allocator, arch: Target.Arch, cpu: *const Target.Cpu) !*Self { - const self = try allocator.create(Self); - errdefer allocator.destroy(self); - - const builtin_str = try std.fmt.allocPrint0(allocator, "CpuFeatures{{ .cpu = &Target.{}.cpu.{} }};\n", .{ - arch.genericName(), - cpu.name, - }); - errdefer allocator.free(builtin_str); - - const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{ cpu.name, cpu.features.asBytes() }); - errdefer allocator.free(cache_hash); - - self.* = Self{ - .allocator = allocator, - .cpu_features = .{ .cpu = cpu }, - .llvm_cpu_name = if (cpu.llvm_name) |n| n.ptr else null, - .llvm_features_str = null, - .builtin_str = builtin_str, - .cache_hash = cache_hash, - }; - return self; - } - - fn initLLVMFeatures( - allocator: *mem.Allocator, - arch: Target.Arch, - feature_set: Target.Cpu.Feature.Set, - ) ![*:0]const u8 { - var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); - defer llvm_features_buffer.deinit(); - - const all_features = arch.allFeaturesList(); - var populated_feature_set = feature_set; - if (arch.subArchFeature()) |sub_arch_index| { - populated_feature_set.addFeature(sub_arch_index); - } - populated_feature_set.populateDependencies(all_features); - for (all_features) |feature, index| { - const llvm_name = feature.llvm_name orelse continue; - const plus_or_minus = "-+"[@boolToInt(populated_feature_set.isEnabled(@intCast(u8, index)))]; - try llvm_features_buffer.appendByte(plus_or_minus); - try llvm_features_buffer.append(llvm_name); - try llvm_features_buffer.append(","); - } - assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")); - llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); - - return llvm_features_buffer.toOwnedSlice().ptr; + fn createFromNative(allocator: *mem.Allocator) !*Self { + const arch = Target.current.getArch(); + const llvm = @import("llvm.zig"); + const llvm_cpu_name = llvm.GetHostCPUName(); + const llvm_cpu_features = llvm.GetNativeFeatures(); + const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name, llvm_cpu_features); + return createFromCpuFeatures(allocator, arch, cpu_features); } fn createFromCpuFeatures( allocator: *mem.Allocator, arch: Target.Arch, - feature_set: Target.Cpu.Feature.Set, + cpu_features: Target.CpuFeatures, ) !*Self { const self = try allocator.create(Self); errdefer allocator.destroy(self); - const cache_hash = try std.fmt.allocPrint0(allocator, "\n{}", .{feature_set.asBytes()}); + const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{ + cpu_features.cpu.name, + cpu_features.features.asBytes(), + }); errdefer allocator.free(cache_hash); const generic_arch_name = arch.genericName(); - var builtin_str_buffer = try std.Buffer.allocPrint( - allocator, + var builtin_str_buffer = try std.Buffer.allocPrint(allocator, \\CpuFeatures{{ + \\ .cpu = &Target.{}.cpu.{}, \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ \\ - , - .{ generic_arch_name, generic_arch_name }, - ); + , .{ + generic_arch_name, + cpu_features.cpu.name, + generic_arch_name, + generic_arch_name, + }); defer builtin_str_buffer.deinit(); - for (arch.allFeaturesList()) |feature, index| { - if (!feature_set.isEnabled(@intCast(u8, index))) continue; + var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); + defer llvm_features_buffer.deinit(); + + for (arch.allFeaturesList()) |feature, index_usize| { + const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize); + const is_enabled = cpu_features.features.isEnabled(index); + + if (feature.llvm_name) |llvm_name| { + const plus_or_minus = "-+"[@boolToInt(is_enabled)]; + try llvm_features_buffer.appendByte(plus_or_minus); + try llvm_features_buffer.append(llvm_name); + try llvm_features_buffer.append(","); + } - // TODO some kind of "zig identifier escape" function rather than - // unconditionally using @"" syntax - try builtin_str_buffer.append(" .@\""); - try builtin_str_buffer.append(feature.name); - try builtin_str_buffer.append("\",\n"); + if (is_enabled) { + // TODO some kind of "zig identifier escape" function rather than + // unconditionally using @"" syntax + try builtin_str_buffer.append(" .@\""); + try builtin_str_buffer.append(feature.name); + try builtin_str_buffer.append("\",\n"); + } } try builtin_str_buffer.append( @@ -774,11 +704,13 @@ const Stage2CpuFeatures = struct { \\ ); + assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")); + llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); + self.* = Self{ .allocator = allocator, - .cpu_features = .{ .features = feature_set }, - .llvm_cpu_name = null, - .llvm_features_str = try initLLVMFeatures(allocator, arch, feature_set), + .cpu_features = cpu_features, + .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr, .builtin_str = builtin_str_buffer.toOwnedSlice(), .cache_hash = cache_hash, }; @@ -794,12 +726,13 @@ const Stage2CpuFeatures = struct { }; // ABI warning -export fn stage2_cpu_features_parse_cpu( +export fn stage2_cpu_features_parse( result: **Stage2CpuFeatures, - zig_triple: [*:0]const u8, - cpu_name: [*:0]const u8, + zig_triple: ?[*:0]const u8, + cpu_name: ?[*:0]const u8, + cpu_features: ?[*:0]const u8, ) Error { - result.* = parseCpu(zig_triple, cpu_name) catch |err| switch (err) { + result.* = stage2ParseCpuFeatures(zig_triple, cpu_name, cpu_features) catch |err| switch (err) { error.OutOfMemory => return .OutOfMemory, error.UnknownArchitecture => return .UnknownArchitecture, error.UnknownSubArchitecture => return .UnknownSubArchitecture, @@ -807,110 +740,61 @@ export fn stage2_cpu_features_parse_cpu( error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, error.MissingOperatingSystem => return .MissingOperatingSystem, error.MissingArchitecture => return .MissingArchitecture, - }; - return .None; -} - -fn parseCpu(zig_triple: [*:0]const u8, cpu_name_z: [*:0]const u8) !*Stage2CpuFeatures { - const cpu_name = mem.toSliceConst(u8, cpu_name_z); - const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); - const arch = target.Cross.arch; - const cpu = arch.parseCpu(cpu_name) catch |err| switch (err) { - error.UnknownCpu => { - std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{ - cpu_name, - @tagName(arch), - }); - for (arch.allCpus()) |cpu| { - std.debug.warn(" {}\n", .{cpu.name}); - } - process.exit(1); - }, - else => |e| return e, - }; - return Stage2CpuFeatures.createFromCpu(std.heap.c_allocator, arch, cpu); -} - -// ABI warning -export fn stage2_cpu_features_parse_features( - result: **Stage2CpuFeatures, - zig_triple: [*:0]const u8, - features_text: [*:0]const u8, -) Error { - result.* = parseFeatures(zig_triple, features_text) catch |err| switch (err) { - error.OutOfMemory => return .OutOfMemory, + error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat, error.InvalidCpuFeatures => return .InvalidCpuFeatures, - error.UnknownArchitecture => return .UnknownArchitecture, - error.UnknownSubArchitecture => return .UnknownSubArchitecture, - error.UnknownOperatingSystem => return .UnknownOperatingSystem, - error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, - error.MissingOperatingSystem => return .MissingOperatingSystem, - error.MissingArchitecture => return .MissingArchitecture, }; return .None; } -fn parseFeatures(zig_triple: [*:0]const u8, features_text: [*:0]const u8) !*Stage2CpuFeatures { - const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); +fn stage2ParseCpuFeatures( + zig_triple_oz: ?[*:0]const u8, + cpu_name_oz: ?[*:0]const u8, + cpu_features_oz: ?[*:0]const u8, +) !*Stage2CpuFeatures { + const zig_triple_z = zig_triple_oz orelse return Stage2CpuFeatures.createFromNative(std.heap.c_allocator); + const target = try Target.parse(mem.toSliceConst(u8, zig_triple_z)); const arch = target.Cross.arch; - const set = arch.parseCpuFeatureSet(mem.toSliceConst(u8, features_text)) catch |err| switch (err) { - error.UnknownCpuFeature => { - std.debug.warn("Unknown CPU features specified.\nAvailable CPU features for architecture '{}':\n", .{ - @tagName(arch), - }); - for (arch.allFeaturesList()) |feature| { - std.debug.warn(" {}\n", .{feature.name}); - } - process.exit(1); - }, - else => |e| return e, - }; - return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, set); -} -// ABI warning -export fn stage2_cpu_features_baseline(result: **Stage2CpuFeatures, zig_triple: [*:0]const u8) Error { - result.* = cpuFeaturesBaseline(zig_triple) catch |err| switch (err) { - error.OutOfMemory => return .OutOfMemory, - error.UnknownArchitecture => return .UnknownArchitecture, - error.UnknownSubArchitecture => return .UnknownSubArchitecture, - error.UnknownOperatingSystem => return .UnknownOperatingSystem, - error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, - error.MissingOperatingSystem => return .MissingOperatingSystem, - error.MissingArchitecture => return .MissingArchitecture, - }; - return .None; -} - -fn cpuFeaturesBaseline(zig_triple: [*:0]const u8) !*Stage2CpuFeatures { - const target = try Target.parse(mem.toSliceConst(u8, zig_triple)); - const arch = target.Cross.arch; - return Stage2CpuFeatures.createBaseline(std.heap.c_allocator, arch); -} + const cpu = if (cpu_name_oz) |cpu_name_z| blk: { + const cpu_name = mem.toSliceConst(u8, cpu_name_z); + break :blk arch.parseCpu(cpu_name) catch |err| switch (err) { + error.UnknownCpu => { + std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{ + cpu_name, + @tagName(arch), + }); + for (arch.allCpus()) |cpu| { + std.debug.warn(" {}\n", .{cpu.name}); + } + process.exit(1); + }, + else => |e| return e, + }; + } else target.Cross.cpu_features.cpu; + + var set = if (cpu_features_oz) |cpu_features_z| blk: { + const cpu_features = mem.toSliceConst(u8, cpu_features_z); + break :blk arch.parseCpuFeatureSet(cpu, cpu_features) catch |err| switch (err) { + error.UnknownCpuFeature => { + std.debug.warn( + \\Unknown CPU features specified. + \\Available CPU features for architecture '{}': + \\ + , .{@tagName(arch)}); + for (arch.allFeaturesList()) |feature| { + std.debug.warn(" {}\n", .{feature.name}); + } + process.exit(1); + }, + else => |e| return e, + }; + } else cpu.features; -// ABI warning -export fn stage2_cpu_features_llvm( - result: **Stage2CpuFeatures, - zig_triple: [*:0]const u8, - llvm_cpu_name: ?[*:0]const u8, - llvm_cpu_features: ?[*:0]const u8, -) Error { - result.* = Stage2CpuFeatures.createFromLLVM( - std.heap.c_allocator, - zig_triple, - llvm_cpu_name, - llvm_cpu_features, - ) catch |err| switch (err) { - error.OutOfMemory => return .OutOfMemory, - error.UnknownArchitecture => return .UnknownArchitecture, - error.UnknownSubArchitecture => return .UnknownSubArchitecture, - error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat, - error.UnknownOperatingSystem => return .UnknownOperatingSystem, - error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, - error.MissingOperatingSystem => return .MissingOperatingSystem, - error.MissingArchitecture => return .MissingArchitecture, - }; - return .None; + set.populateDependencies(arch.allFeaturesList()); + return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, .{ + .cpu = cpu, + .features = set, + }); } // ABI warning @@ -935,7 +819,7 @@ export fn stage2_cpu_features_get_builtin_str( // ABI warning export fn stage2_cpu_features_get_llvm_cpu(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 { - return cpu_features.llvm_cpu_name; + return if (cpu_features.cpu_features.cpu.llvm_name) |s| s.ptr else null; } // ABI warning diff --git a/src/codegen.cpp b/src/codegen.cpp index bb14d39a91..6fffcc6fdf 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8581,7 +8581,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { stage2_cpu_features_get_builtin_str(g->zig_target->cpu_features, &ptr, &len); buf_append_mem(contents, ptr, len); } else { - buf_append_str(contents, ".baseline;\n"); + buf_append_str(contents, "arch.getBaselineCpuFeatures();\n"); } } if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) { diff --git a/src/main.cpp b/src/main.cpp index bc181f3d5d..512b7a9b0c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -866,7 +866,7 @@ int main(int argc, char **argv) { cpu = argv[i]; } else if (strcmp(arg, "-target-feature") == 0) { features = argv[i]; - }else { + } else { fprintf(stderr, "Invalid argument: %s\n", arg); return print_error_usage(arg0); } @@ -984,35 +984,10 @@ int main(int argc, char **argv) { Buf zig_triple_buf = BUF_INIT; target_triple_zig(&zig_triple_buf, &target); - if (cpu && features) { - fprintf(stderr, "-target-cpu and -target-feature options not allowed together\n"); + const char *stage2_triple_arg = target.is_native ? nullptr : buf_ptr(&zig_triple_buf); + if ((err = stage2_cpu_features_parse(&target.cpu_features, stage2_triple_arg, cpu, features))) { + fprintf(stderr, "unable to initialize CPU features: %s\n", err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); - } else if (cpu) { - if ((err = stage2_cpu_features_parse_cpu(&target.cpu_features, buf_ptr(&zig_triple_buf), cpu))) { - fprintf(stderr, "-target-cpu error: %s\n", err_str(err)); - return main_exit(root_progress_node, EXIT_FAILURE); - } - } else if (features) { - if ((err = stage2_cpu_features_parse_features(&target.cpu_features, buf_ptr(&zig_triple_buf), - features))) - { - fprintf(stderr, "-target-feature error: %s\n", err_str(err)); - return main_exit(root_progress_node, EXIT_FAILURE); - } - } else if (target.is_native) { - const char *cpu_name = ZigLLVMGetHostCPUName(); - const char *cpu_features = ZigLLVMGetNativeFeatures(); - if ((err = stage2_cpu_features_llvm(&target.cpu_features, buf_ptr(&zig_triple_buf), - cpu_name, cpu_features))) - { - fprintf(stderr, "unable to determine native CPU features: %s\n", err_str(err)); - return main_exit(root_progress_node, EXIT_FAILURE); - } - } else { - if ((err = stage2_cpu_features_baseline(&target.cpu_features, buf_ptr(&zig_triple_buf)))) { - fprintf(stderr, "unable to determine baseline CPU features: %s\n", err_str(err)); - return main_exit(root_progress_node, EXIT_FAILURE); - } } if (output_dir != nullptr && enable_cache == CacheOptOn) { diff --git a/src/userland.cpp b/src/userland.cpp index 64849b65ed..8524be5739 100644 --- a/src/userland.cpp +++ b/src/userland.cpp @@ -2,7 +2,8 @@ // src-self-hosted/stage1.zig #include "userland.h" -#include "ast_render.hpp" +#include "util.hpp" +#include "zig_llvm.h" #include #include #include @@ -96,32 +97,30 @@ struct Stage2CpuFeatures { const char *cache_hash; }; -Error stage2_cpu_features_parse_cpu(Stage2CpuFeatures **out, const char *zig_triple, const char *str) { - const char *msg = "stage0 called stage2_cpu_features_parse_cpu"; - stage2_panic(msg, strlen(msg)); -} -Error stage2_cpu_features_parse_features(Stage2CpuFeatures **out, const char *zig_triple, const char *str) { - const char *msg = "stage0 called stage2_cpu_features_parse_features"; - stage2_panic(msg, strlen(msg)); -} -Error stage2_cpu_features_baseline(Stage2CpuFeatures **out, const char *zig_triple) { - Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); - result->builtin_str = ".baseline;\n"; - result->cache_hash = "\n\n"; - *out = result; - return ErrorNone; -} -Error stage2_cpu_features_llvm(Stage2CpuFeatures **out, const char *zig_triple, - const char *llvm_cpu_name, const char *llvm_features) +Error stage2_cpu_features_parse(struct Stage2CpuFeatures **out, const char *zig_triple, + const char *cpu_name, const char *cpu_features) { - Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); - result->llvm_cpu_name = llvm_cpu_name; - result->llvm_cpu_features = llvm_features; - result->builtin_str = ".baseline;\n"; - result->cache_hash = "native\n\n"; - *out = result; - return ErrorNone; + if (zig_triple == nullptr) { + Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); + result->llvm_cpu_name = ZigLLVMGetHostCPUName(); + result->llvm_cpu_features = ZigLLVMGetNativeFeatures(); + result->builtin_str = "arch.getBaselineCpuFeatures();\n"; + result->cache_hash = "native\n\n"; + *out = result; + return ErrorNone; + } + if (cpu_name == nullptr && cpu_features == nullptr) { + Stage2CpuFeatures *result = allocate(1, "Stage2CpuFeatures"); + result->builtin_str = "arch.getBaselineCpuFeatures();\n"; + result->cache_hash = "\n\n"; + *out = result; + return ErrorNone; + } + + const char *msg = "stage0 called stage2_cpu_features_parse with non-null cpu name or features"; + stage2_panic(msg, strlen(msg)); } + void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, const char **ptr, size_t *len) { diff --git a/src/userland.h b/src/userland.h index 01faf0b532..6b16d2338e 100644 --- a/src/userland.h +++ b/src/userland.h @@ -184,20 +184,8 @@ ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node, struct Stage2CpuFeatures; // ABI warning -ZIG_EXTERN_C Error stage2_cpu_features_parse_cpu(struct Stage2CpuFeatures **result, - const char *zig_triple, const char *cpu_name); - -// ABI warning -ZIG_EXTERN_C Error stage2_cpu_features_parse_features(struct Stage2CpuFeatures **result, - const char *zig_triple, const char *features); - -// ABI warning -ZIG_EXTERN_C Error stage2_cpu_features_baseline(struct Stage2CpuFeatures **result, - const char *zig_triple); - -// ABI warning -ZIG_EXTERN_C Error stage2_cpu_features_llvm(struct Stage2CpuFeatures **result, - const char *zig_triple, const char *llvm_cpu_name, const char *llvm_features); +ZIG_EXTERN_C Error stage2_cpu_features_parse(struct Stage2CpuFeatures **result, + const char *zig_triple, const char *cpu_name, const char *cpu_features); // ABI warning ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const struct Stage2CpuFeatures *cpu_features); diff --git a/test/compile_errors.zig b/test/compile_errors.zig index be2a40d74d..a4ed8549a7 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,5 +1,6 @@ const tests = @import("tests.zig"); const builtin = @import("builtin"); +const Target = @import("std").Target; pub fn addCases(cases: *tests.CompileErrorContext) void { cases.addTest("non-exhaustive enums", @@ -272,9 +273,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { , &[_][]const u8{ "tmp.zig:3:5: error: target arch 'wasm32' does not support calling with a new stack", }); - tc.target = tests.Target{ - .Cross = tests.CrossTarget{ + tc.target = Target{ + .Cross = .{ .arch = .wasm32, + .cpu_features = Target.Arch.wasm32.getBaselineCpuFeatures(), .os = .wasi, .abi = .none, }, @@ -673,9 +675,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { , &[_][]const u8{ "tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs", }); - tc.target = tests.Target{ - .Cross = tests.CrossTarget{ + tc.target = Target{ + .Cross = .{ .arch = .x86_64, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), .os = .linux, .abi = .gnu, }, diff --git a/test/tests.zig b/test/tests.zig index 7c97e46e02..1ec25d11ec 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -38,236 +38,260 @@ const TestTarget = struct { disable_native: bool = false, }; -const test_targets = [_]TestTarget{ - TestTarget{}, - TestTarget{ - .link_libc = true, - }, - TestTarget{ - .single_threaded = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .x86_64, - .abi = .none, +const test_targets = blk: { + // getBaselineCpuFeatures calls populateDependencies which has a O(N ^ 2) algorithm + // (where N is roughly 160, which technically makes it O(1), but it adds up to a + // lot of branches) + @setEvalBranchQuota(50000); + break :blk [_]TestTarget{ + TestTarget{}, + TestTarget{ + .link_libc = true, + }, + TestTarget{ + .single_threaded = true, + }, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .x86_64, + .abi = .none, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + }, }, }, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .x86_64, - .abi = .gnu, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .x86_64, + .abi = .gnu, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + }, }, + .link_libc = true, }, - .link_libc = true, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .x86_64, - .abi = .musl, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .x86_64, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + .abi = .musl, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .i386, - .abi = .none, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .i386, + .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), + .abi = .none, + }, }, }, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .i386, - .abi = .musl, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .i386, + .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), + .abi = .musl, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = builtin.Arch{ .aarch64 = builtin.Arch.Arm64.v8_5a }, - .abi = .none, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = Target.Arch{ .aarch64 = .v8_5a }, + .cpu_features = (Target.Arch{ .aarch64 = .v8_5a }).getBaselineCpuFeatures(), + .abi = .none, + }, }, }, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = builtin.Arch{ .aarch64 = builtin.Arch.Arm64.v8_5a }, - .abi = .musl, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = Target.Arch{ .aarch64 = .v8_5a }, + .cpu_features = (Target.Arch{ .aarch64 = .v8_5a }).getBaselineCpuFeatures(), + .abi = .musl, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = builtin.Arch{ .aarch64 = builtin.Arch.Arm64.v8_5a }, - .abi = .gnu, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = Target.Arch{ .aarch64 = .v8_5a }, + .cpu_features = (Target.Arch{ .aarch64 = .v8_5a }).getBaselineCpuFeatures(), + .abi = .gnu, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, - .abi = .none, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = Target.Arch{ .arm = .v8_5a }, + .cpu_features = (Target.Arch{ .arm = .v8_5a }).getBaselineCpuFeatures(), + .abi = .none, + }, }, }, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, - .abi = .musleabihf, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = Target.Arch{ .arm = .v8_5a }, + .cpu_features = (Target.Arch{ .arm = .v8_5a }).getBaselineCpuFeatures(), + .abi = .musleabihf, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - // TODO https://github.com/ziglang/zig/issues/3287 - //TestTarget{ - // .target = Target{ - // .Cross = CrossTarget{ - // .os = .linux, - // .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, - // .abi = .gnueabihf, - // }, - // }, - // .link_libc = true, - //}, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .mipsel, - .abi = .none, + // TODO https://github.com/ziglang/zig/issues/3287 + //TestTarget{ + // .target = Target{ + // .Cross = CrossTarget{ + // .os = .linux, + // .arch = Target.Arch{ .arm = .v8_5a }, + // .cpu_features = (Target.Arch{ .arm = .v8_5a }).getBaselineCpuFeatures(), + // .abi = .gnueabihf, + // }, + // }, + // .link_libc = true, + //}, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .mipsel, + .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(), + .abi = .none, + }, }, }, - }, - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .linux, - .arch = .mipsel, - .abi = .musl, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .linux, + .arch = .mipsel, + .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(), + .abi = .musl, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .macosx, - .arch = .x86_64, - .abi = .gnu, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .macosx, + .arch = .x86_64, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + .abi = .gnu, + }, }, + // TODO https://github.com/ziglang/zig/issues/3295 + .disable_native = true, }, - // TODO https://github.com/ziglang/zig/issues/3295 - .disable_native = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .windows, - .arch = .i386, - .abi = .msvc, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .i386, + .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), + .abi = .msvc, + }, }, }, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .windows, - .arch = .x86_64, - .abi = .msvc, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .x86_64, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + .abi = .msvc, + }, }, }, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .windows, - .arch = .i386, - .abi = .gnu, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .i386, + .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), + .abi = .gnu, + }, }, + .link_libc = true, }, - .link_libc = true, - }, - - TestTarget{ - .target = Target{ - .Cross = CrossTarget{ - .os = .windows, - .arch = .x86_64, - .abi = .gnu, + + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .x86_64, + .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), + .abi = .gnu, + }, }, + .link_libc = true, + }, + + // Do the release tests last because they take a long time + TestTarget{ + .mode = .ReleaseFast, + }, + TestTarget{ + .link_libc = true, + .mode = .ReleaseFast, }, - .link_libc = true, - }, - - // Do the release tests last because they take a long time - TestTarget{ - .mode = .ReleaseFast, - }, - TestTarget{ - .link_libc = true, - .mode = .ReleaseFast, - }, - TestTarget{ - .mode = .ReleaseFast, - .single_threaded = true, - }, - - TestTarget{ - .mode = .ReleaseSafe, - }, - TestTarget{ - .link_libc = true, - .mode = .ReleaseSafe, - }, - TestTarget{ - .mode = .ReleaseSafe, - .single_threaded = true, - }, - - TestTarget{ - .mode = .ReleaseSmall, - }, - TestTarget{ - .link_libc = true, - .mode = .ReleaseSmall, - }, - TestTarget{ - .mode = .ReleaseSmall, - .single_threaded = true, - }, + TestTarget{ + .mode = .ReleaseFast, + .single_threaded = true, + }, + + TestTarget{ + .mode = .ReleaseSafe, + }, + TestTarget{ + .link_libc = true, + .mode = .ReleaseSafe, + }, + TestTarget{ + .mode = .ReleaseSafe, + .single_threaded = true, + }, + + TestTarget{ + .mode = .ReleaseSmall, + }, + TestTarget{ + .link_libc = true, + .mode = .ReleaseSmall, + }, + TestTarget{ + .mode = .ReleaseSmall, + .single_threaded = true, + }, + }; }; const max_stdout_size = 1 * 1024 * 1024; // 1 MB diff --git a/test/translate_c.zig b/test/translate_c.zig index df33d9b145..0870d5bebe 100644 --- a/test/translate_c.zig +++ b/test/translate_c.zig @@ -1,5 +1,6 @@ const tests = @import("tests.zig"); const builtin = @import("builtin"); +const Target = @import("std").Target; pub fn addCases(cases: *tests.TranslateCContext) void { cases.add("empty declaration", @@ -1005,7 +1006,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void { }); cases.addWithTarget("Calling convention", tests.Target{ - .Cross = .{ .os = .linux, .arch = .i386, .abi = .none }, + .Cross = .{ + .os = .linux, + .arch = .i386, + .abi = .none, + .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), + }, }, \\void __attribute__((fastcall)) foo1(float *a); \\void __attribute__((stdcall)) foo2(float *a); @@ -1021,7 +1027,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void { }); cases.addWithTarget("Calling convention", tests.Target{ - .Cross = .{ .os = .linux, .arch = .{ .arm = .v8_5a }, .abi = .none }, + .Cross = .{ + .os = .linux, + .arch = .{ .arm = .v8_5a }, + .abi = .none, + .cpu_features = (Target.Arch{ .arm = .v8_5a }).getBaselineCpuFeatures(), + }, }, \\void __attribute__((pcs("aapcs"))) foo1(float *a); \\void __attribute__((pcs("aapcs-vfp"))) foo2(float *a); @@ -1031,7 +1042,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void { }); cases.addWithTarget("Calling convention", tests.Target{ - .Cross = .{ .os = .linux, .arch = .{ .aarch64 = .v8_5a }, .abi = .none }, + .Cross = .{ + .os = .linux, + .arch = .{ .aarch64 = .v8_5a }, + .abi = .none, + .cpu_features = (Target.Arch{ .aarch64 = .v8_5a }).getBaselineCpuFeatures(), + }, }, \\void __attribute__((aarch64_vector_pcs)) foo1(float *a); , &[_][]const u8{ -- cgit v1.2.3