lazily compute the full cpu features dependencies

This commit is contained in:
Andrew Kelley 2020-01-21 20:11:36 -05:00
parent 92559cd02c
commit 68b6867e76
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
17 changed files with 1459 additions and 1519 deletions

View File

@ -304,12 +304,12 @@ pub const Target = union(enum) {
if (mem.eql(u8, feature_name, feature.name)) {
switch (op) {
.add => {
baseline_set.addFeature(index, all_features);
whitelist_set.addFeature(index, all_features);
baseline_set.addFeature(index);
whitelist_set.addFeature(index);
},
.sub => {
baseline_set.removeFeature(index, all_features);
whitelist_set.removeFeature(index, all_features);
baseline_set.removeFeature(index);
whitelist_set.removeFeature(index);
},
}
break;
@ -580,12 +580,8 @@ pub const Target = union(enum) {
/// Human-friendly UTF-8 text.
description: []const u8,
/// `Set` of all features this depends on, and this feature itself.
/// Can be "or"ed with another set to remove this feature and all
/// its dependencies.
/// Has a default value of `undefined` because the canonical
/// structures are populated via comptime logic.
dependencies: Set = undefined,
/// Sparse `Set` of features this depends on.
dependencies: Set,
/// A bit set of all the features.
pub const Set = struct {
@ -598,6 +594,9 @@ pub const Target = union(enum) {
pub const ShiftInt = std.math.Log2Int(usize);
pub const empty = Set{ .ints = [1]usize{0} ** usize_count };
pub fn empty_workaround() Set {
return Set{ .ints = [1]usize{0} ** usize_count };
}
pub fn isEnabled(set: Set, arch_feature_index: Index) bool {
const usize_index = arch_feature_index / @bitSizeOf(usize);
@ -605,60 +604,28 @@ pub const Target = union(enum) {
return (set.ints[usize_index] & (@as(usize, 1) << bit_index)) != 0;
}
/// Adds the specified feature and all its dependencies to the set. O(1).
pub fn addFeature(
set: *Set,
arch_feature_index: Index,
all_features_list: []const Cpu.Feature,
) void {
set.ints = @as(@Vector(usize_count, usize), set.ints) |
@as(@Vector(usize_count, usize), all_features_list[arch_feature_index].dependencies.ints);
}
/// Removes the specified feature (TODO and all its dependents) from the set. O(1).
/// TODO improve this function to actually handle dependants rather than just calling
/// `removeSparseFeature`.
pub fn removeFeature(
set: *Set,
arch_feature_index: Index,
all_features_list: []const Cpu.Feature,
) void {
set.removeSparseFeature(arch_feature_index);
}
/// Adds the specified feature but not its dependencies.
pub fn addSparseFeature(set: *Set, arch_feature_index: Index) void {
pub fn addFeature(set: *Set, arch_feature_index: Index) void {
const usize_index = arch_feature_index / @bitSizeOf(usize);
const bit_index = @intCast(ShiftInt, arch_feature_index % @bitSizeOf(usize));
set.ints[usize_index] |= @as(usize, 1) << bit_index;
}
/// Removes the specified feature but not its dependents.
pub fn removeSparseFeature(set: *Set, arch_feature_index: Index) void {
pub fn removeFeature(set: *Set, arch_feature_index: Index) void {
const usize_index = arch_feature_index / @bitSizeOf(usize);
const bit_index = @intCast(ShiftInt, arch_feature_index % @bitSizeOf(usize));
set.ints[usize_index] &= ~(@as(usize, 1) << bit_index);
}
pub fn initAsDependencies(
set: *Set,
arch_feature_index: Index,
all_features_list: []const Cpu.Feature,
) void {
// fast-case to help reduce how much comptime code must execute
const no_deps = for (set.ints) |elem| {
if (elem != 0) break false;
} else true;
// add itself to its own dependencies for easy "or"ing later
set.addSparseFeature(arch_feature_index);
if (no_deps) return;
pub fn populateDependencies(set: *Set, all_features_list: []const Cpu.Feature) void {
var old = set.ints;
while (true) {
for (all_features_list) |feature, index| {
const casted_index = @intCast(Index, index);
if (set.isEnabled(casted_index)) {
set.addFeature(casted_index, all_features_list);
for (all_features_list) |feature, index_usize| {
const index = @intCast(Index, index_usize);
if (set.isEnabled(index)) {
set.ints = @as(@Vector(usize_count, usize), set.ints) |
@as(@Vector(usize_count, usize), feature.dependencies.ints);
}
}
const nothing_changed = mem.eql(usize, &old, &set.ints);
@ -674,21 +641,11 @@ pub const Target = union(enum) {
pub fn feature_set_fns(comptime F: type) type {
return struct {
/// Populates a set with the list of features and all their dependencies included.
pub fn featureSet(all_features_list: []const Feature, features: []const F) Set {
var x: Set = Set.empty;
for (features) |feature| {
x.addFeature(@enumToInt(feature), all_features_list);
}
@compileLog(Set.empty);
return x;
}
/// Populates only the feature bits specified.
pub fn sparseFeatureSet(features: []const F) Set {
var x = Set.empty;
pub fn featureSet(features: []const F) Set {
var x = Set.empty_workaround(); // TODO remove empty_workaround
for (features) |feature| {
x.addSparseFeature(@enumToInt(feature));
x.addFeature(@enumToInt(feature));
}
return x;
}

File diff suppressed because it is too large Load Diff

View File

@ -114,186 +114,185 @@ pub const Feature = enum {
pub usingnamespace Cpu.Feature.feature_set_fns(Feature);
pub const all_features = blk: {
@setEvalBranchQuota(10000);
const len = @typeInfo(Feature).Enum.fields.len;
std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count);
var result: [len]Cpu.Feature = undefined;
result[@enumToInt(Feature.@"16_bit_insts")] = .{
.llvm_name = "16-bit-insts",
.description = "Has i16/f16 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.DumpCode)] = .{
.llvm_name = "DumpCode",
.description = "Dump MachineInstrs in the CodeEmitter",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.add_no_carry_insts)] = .{
.llvm_name = "add-no-carry-insts",
.description = "Have VALU add/sub instructions without carry out",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.aperture_regs)] = .{
.llvm_name = "aperture-regs",
.description = "Has Memory Aperture Base and Size Registers",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.auto_waitcnt_before_barrier)] = .{
.llvm_name = "auto-waitcnt-before-barrier",
.description = "Hardware automatically inserts waitcnt before barrier",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ci_insts)] = .{
.llvm_name = "ci-insts",
.description = "Additional instructions for CI+",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.code_object_v3)] = .{
.llvm_name = "code-object-v3",
.description = "Generate code object version 3",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.cumode)] = .{
.llvm_name = "cumode",
.description = "Enable CU wavefront execution mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dl_insts)] = .{
.llvm_name = "dl-insts",
.description = "Has v_fmac_f32 and v_xnor_b32 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dot1_insts)] = .{
.llvm_name = "dot1-insts",
.description = "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dot3_insts)] = .{
.llvm_name = "dot3-insts",
.description = "Has v_dot8c_i32_i4 instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dot4_insts)] = .{
.llvm_name = "dot4-insts",
.description = "Has v_dot2c_i32_i16 instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dot5_insts)] = .{
.llvm_name = "dot5-insts",
.description = "Has v_dot2c_f32_f16 instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dot6_insts)] = .{
.llvm_name = "dot6-insts",
.description = "Has v_dot4c_i32_i8 instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dpp)] = .{
.llvm_name = "dpp",
.description = "Support DPP (Data Parallel Primitives) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dpp8)] = .{
.llvm_name = "dpp8",
.description = "Support DPP8 (Data Parallel Primitives) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dumpcode)] = .{
.llvm_name = "dumpcode",
.description = "Dump MachineInstrs in the CodeEmitter",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.enable_ds128)] = .{
.llvm_name = "enable-ds128",
.description = "Use ds_read|write_b128",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.enable_prt_strict_null)] = .{
.llvm_name = "enable-prt-strict-null",
.description = "Enable zeroing of result registers for sparse texture fetches",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fast_fmaf)] = .{
.llvm_name = "fast-fmaf",
.description = "Assuming f32 fma is at least as fast as mul + add",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_address_space)] = .{
.llvm_name = "flat-address-space",
.description = "Support flat address space",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_for_global)] = .{
.llvm_name = "flat-for-global",
.description = "Force to generate flat instruction for global",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_global_insts)] = .{
.llvm_name = "flat-global-insts",
.description = "Have global_* flat memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_inst_offsets)] = .{
.llvm_name = "flat-inst-offsets",
.description = "Flat instructions have immediate offset addressing mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_scratch_insts)] = .{
.llvm_name = "flat-scratch-insts",
.description = "Have scratch_* flat memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.flat_segment_offset_bug)] = .{
.llvm_name = "flat-segment-offset-bug",
.description = "GFX10 bug, inst_offset ignored in flat segment",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fmaf)] = .{
.llvm_name = "fmaf",
.description = "Enable single precision FMA (not as fast as mul+add, but fused)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp_exceptions)] = .{
.llvm_name = "fp-exceptions",
.description = "Enable floating point exceptions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp16_denormals)] = .{
.llvm_name = "fp16-denormals",
.description = "Enable half precision denormal handling",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fp64_fp16_denormals,
}),
};
result[@enumToInt(Feature.fp32_denormals)] = .{
.llvm_name = "fp32-denormals",
.description = "Enable single precision denormal handling",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp64)] = .{
.llvm_name = "fp64",
.description = "Enable double precision operations",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp64_denormals)] = .{
.llvm_name = "fp64-denormals",
.description = "Enable double and half precision denormal handling",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fp64,
.fp64_fp16_denormals,
}),
@ -301,19 +300,19 @@ pub const all_features = blk: {
result[@enumToInt(Feature.fp64_fp16_denormals)] = .{
.llvm_name = "fp64-fp16-denormals",
.description = "Enable double and half precision denormal handling",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fp64,
}),
};
result[@enumToInt(Feature.gcn3_encoding)] = .{
.llvm_name = "gcn3-encoding",
.description = "Encoding format for VI",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.gfx10)] = .{
.llvm_name = "gfx10",
.description = "GFX10 GPU generation",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.@"16_bit_insts",
.add_no_carry_insts,
.aperture_regs,
@ -353,22 +352,22 @@ pub const all_features = blk: {
result[@enumToInt(Feature.gfx10_insts)] = .{
.llvm_name = "gfx10-insts",
.description = "Additional instructions for GFX10+",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{
.llvm_name = "gfx7-gfx8-gfx9-insts",
.description = "Instructions shared in GFX7, GFX8, GFX9",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.gfx8_insts)] = .{
.llvm_name = "gfx8-insts",
.description = "Additional instructions for GFX8+",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.gfx9)] = .{
.llvm_name = "gfx9",
.description = "GFX9 GPU generation",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.@"16_bit_insts",
.add_no_carry_insts,
.aperture_regs,
@ -404,212 +403,212 @@ pub const all_features = blk: {
result[@enumToInt(Feature.gfx9_insts)] = .{
.llvm_name = "gfx9-insts",
.description = "Additional instructions for GFX9+",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.half_rate_64_ops)] = .{
.llvm_name = "half-rate-64-ops",
.description = "Most fp64 instructions are half rate instead of quarter",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{
.llvm_name = "inst-fwd-prefetch-bug",
.description = "S_INST_PREFETCH instruction causes shader to hang",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.int_clamp_insts)] = .{
.llvm_name = "int-clamp-insts",
.description = "Support clamp for integer destination",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.inv_2pi_inline_imm)] = .{
.llvm_name = "inv-2pi-inline-imm",
.description = "Has 1 / (2 * pi) as inline immediate",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.lds_misaligned_bug)] = .{
.llvm_name = "lds-misaligned-bug",
.description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ldsbankcount16)] = .{
.llvm_name = "ldsbankcount16",
.description = "The number of LDS banks per compute unit.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ldsbankcount32)] = .{
.llvm_name = "ldsbankcount32",
.description = "The number of LDS banks per compute unit.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.load_store_opt)] = .{
.llvm_name = "load-store-opt",
.description = "Enable SI load/store optimizer pass",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.localmemorysize0)] = .{
.llvm_name = "localmemorysize0",
.description = "The size of local memory in bytes",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.localmemorysize32768)] = .{
.llvm_name = "localmemorysize32768",
.description = "The size of local memory in bytes",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.localmemorysize65536)] = .{
.llvm_name = "localmemorysize65536",
.description = "The size of local memory in bytes",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mai_insts)] = .{
.llvm_name = "mai-insts",
.description = "Has mAI instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.max_private_element_size_16)] = .{
.llvm_name = "max-private-element-size-16",
.description = "Maximum private access size may be 16",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.max_private_element_size_4)] = .{
.llvm_name = "max-private-element-size-4",
.description = "Maximum private access size may be 4",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.max_private_element_size_8)] = .{
.llvm_name = "max-private-element-size-8",
.description = "Maximum private access size may be 8",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mimg_r128)] = .{
.llvm_name = "mimg-r128",
.description = "Support 128-bit texture resources",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.movrel)] = .{
.llvm_name = "movrel",
.description = "Has v_movrel*_b32 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_data_dep_hazard)] = .{
.llvm_name = "no-data-dep-hazard",
.description = "Does not need SW waitstates",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_sdst_cmpx)] = .{
.llvm_name = "no-sdst-cmpx",
.description = "V_CMPX does not write VCC/SGPR in addition to EXEC",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_sram_ecc_support)] = .{
.llvm_name = "no-sram-ecc-support",
.description = "Hardware does not support SRAM ECC",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_xnack_support)] = .{
.llvm_name = "no-xnack-support",
.description = "Hardware does not support XNACK",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nsa_encoding)] = .{
.llvm_name = "nsa-encoding",
.description = "Support NSA encoding for image instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.offset_3f_bug)] = .{
.llvm_name = "offset-3f-bug",
.description = "Branch offset of 3f hardware bug",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.pk_fmac_f16_inst)] = .{
.llvm_name = "pk-fmac-f16-inst",
.description = "Has v_pk_fmac_f16 instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.promote_alloca)] = .{
.llvm_name = "promote-alloca",
.description = "Enable promote alloca pass",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.r128_a16)] = .{
.llvm_name = "r128-a16",
.description = "Support 16 bit coordindates/gradients/lod/clamp/mip types on gfx9",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.register_banking)] = .{
.llvm_name = "register-banking",
.description = "Has register banking",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.s_memrealtime)] = .{
.llvm_name = "s-memrealtime",
.description = "Has s_memrealtime instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.scalar_atomics)] = .{
.llvm_name = "scalar-atomics",
.description = "Has atomic scalar memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.scalar_flat_scratch_insts)] = .{
.llvm_name = "scalar-flat-scratch-insts",
.description = "Have s_scratch_* flat memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.scalar_stores)] = .{
.llvm_name = "scalar-stores",
.description = "Has store scalar memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa)] = .{
.llvm_name = "sdwa",
.description = "Support SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa_mav)] = .{
.llvm_name = "sdwa-mav",
.description = "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa_omod)] = .{
.llvm_name = "sdwa-omod",
.description = "Support OMod with SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa_out_mods_vopc)] = .{
.llvm_name = "sdwa-out-mods-vopc",
.description = "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa_scalar)] = .{
.llvm_name = "sdwa-scalar",
.description = "Support scalar register with SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sdwa_sdst)] = .{
.llvm_name = "sdwa-sdst",
.description = "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sea_islands)] = .{
.llvm_name = "sea-islands",
.description = "SEA_ISLANDS GPU generation",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.ci_insts,
.flat_address_space,
.fp64,
@ -625,22 +624,22 @@ pub const all_features = blk: {
result[@enumToInt(Feature.sgpr_init_bug)] = .{
.llvm_name = "sgpr-init-bug",
.description = "VI SGPR initialization bug requiring a fixed SGPR allocation size",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.si_scheduler)] = .{
.llvm_name = "si-scheduler",
.description = "Enable SI Machine Scheduler",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.smem_to_vector_write_hazard)] = .{
.llvm_name = "smem-to-vector-write-hazard",
.description = "s_load_dword followed by v_cmp page faults",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.southern_islands)] = .{
.llvm_name = "southern-islands",
.description = "SOUTHERN_ISLANDS GPU generation",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fp64,
.ldsbankcount32,
.localmemorysize32768,
@ -655,62 +654,62 @@ pub const all_features = blk: {
result[@enumToInt(Feature.sram_ecc)] = .{
.llvm_name = "sram-ecc",
.description = "Enable SRAM ECC",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.trap_handler)] = .{
.llvm_name = "trap-handler",
.description = "Trap handler support",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.trig_reduced_range)] = .{
.llvm_name = "trig-reduced-range",
.description = "Requires use of fract on arguments to trig instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.unaligned_buffer_access)] = .{
.llvm_name = "unaligned-buffer-access",
.description = "Support unaligned global loads and stores",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.unaligned_scratch_access)] = .{
.llvm_name = "unaligned-scratch-access",
.description = "Support unaligned scratch loads and stores",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.unpacked_d16_vmem)] = .{
.llvm_name = "unpacked-d16-vmem",
.description = "Has unpacked d16 vmem instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.unsafe_ds_offset_folding)] = .{
.llvm_name = "unsafe-ds-offset-folding",
.description = "Force using DS instruction immediate offsets on SI",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vcmpx_exec_war_hazard)] = .{
.llvm_name = "vcmpx-exec-war-hazard",
.description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vcmpx_permlane_hazard)] = .{
.llvm_name = "vcmpx-permlane-hazard",
.description = "TODO: describe me",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vgpr_index_mode)] = .{
.llvm_name = "vgpr-index-mode",
.description = "Has VGPR mode register indexing",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.volcanic_islands)] = .{
.llvm_name = "volcanic-islands",
.description = "VOLCANIC_ISLANDS GPU generation",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.@"16_bit_insts",
.ci_insts,
.dpp,
@ -738,43 +737,42 @@ pub const all_features = blk: {
result[@enumToInt(Feature.vop3_literal)] = .{
.llvm_name = "vop3-literal",
.description = "Can use one literal in VOP3",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vop3p)] = .{
.llvm_name = "vop3p",
.description = "Has VOP3P packed instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vscnt)] = .{
.llvm_name = "vscnt",
.description = "Has separate store vscnt counter",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.wavefrontsize16)] = .{
.llvm_name = "wavefrontsize16",
.description = "The number of threads per wavefront",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.wavefrontsize32)] = .{
.llvm_name = "wavefrontsize32",
.description = "The number of threads per wavefront",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.wavefrontsize64)] = .{
.llvm_name = "wavefrontsize64",
.description = "The number of threads per wavefront",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.xnack)] = .{
.llvm_name = "xnack",
.description = "Enable XNACK support",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -783,7 +781,7 @@ pub const cpu = struct {
pub const bonaire = Cpu{
.name = "bonaire",
.llvm_name = "bonaire",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -793,7 +791,7 @@ pub const cpu = struct {
pub const carrizo = Cpu{
.name = "carrizo",
.llvm_name = "carrizo",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -806,7 +804,7 @@ pub const cpu = struct {
pub const fiji = Cpu{
.name = "fiji",
.llvm_name = "fiji",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -817,14 +815,14 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.wavefrontsize64,
}),
};
pub const generic_hsa = Cpu{
.name = "generic_hsa",
.llvm_name = "generic-hsa",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.flat_address_space,
.wavefrontsize64,
}),
@ -832,7 +830,7 @@ pub const cpu = struct {
pub const gfx1010 = Cpu{
.name = "gfx1010",
.llvm_name = "gfx1010",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.dl_insts,
.flat_segment_offset_bug,
@ -858,7 +856,7 @@ pub const cpu = struct {
pub const gfx1011 = Cpu{
.name = "gfx1011",
.llvm_name = "gfx1011",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.dl_insts,
.dot1_insts,
@ -887,7 +885,7 @@ pub const cpu = struct {
pub const gfx1012 = Cpu{
.name = "gfx1012",
.llvm_name = "gfx1012",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.dl_insts,
.dot1_insts,
@ -917,7 +915,7 @@ pub const cpu = struct {
pub const gfx600 = Cpu{
.name = "gfx600",
.llvm_name = "gfx600",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -929,7 +927,7 @@ pub const cpu = struct {
pub const gfx601 = Cpu{
.name = "gfx601",
.llvm_name = "gfx601",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -939,7 +937,7 @@ pub const cpu = struct {
pub const gfx700 = Cpu{
.name = "gfx700",
.llvm_name = "gfx700",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -949,7 +947,7 @@ pub const cpu = struct {
pub const gfx701 = Cpu{
.name = "gfx701",
.llvm_name = "gfx701",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -961,7 +959,7 @@ pub const cpu = struct {
pub const gfx702 = Cpu{
.name = "gfx702",
.llvm_name = "gfx702",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.ldsbankcount16,
@ -972,7 +970,7 @@ pub const cpu = struct {
pub const gfx703 = Cpu{
.name = "gfx703",
.llvm_name = "gfx703",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount16,
.no_xnack_support,
@ -982,7 +980,7 @@ pub const cpu = struct {
pub const gfx704 = Cpu{
.name = "gfx704",
.llvm_name = "gfx704",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -992,7 +990,7 @@ pub const cpu = struct {
pub const gfx801 = Cpu{
.name = "gfx801",
.llvm_name = "gfx801",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -1005,7 +1003,7 @@ pub const cpu = struct {
pub const gfx802 = Cpu{
.name = "gfx802",
.llvm_name = "gfx802",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1017,7 +1015,7 @@ pub const cpu = struct {
pub const gfx803 = Cpu{
.name = "gfx803",
.llvm_name = "gfx803",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1028,7 +1026,7 @@ pub const cpu = struct {
pub const gfx810 = Cpu{
.name = "gfx810",
.llvm_name = "gfx810",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount16,
.volcanic_islands,
@ -1038,7 +1036,7 @@ pub const cpu = struct {
pub const gfx900 = Cpu{
.name = "gfx900",
.llvm_name = "gfx900",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.gfx9,
.ldsbankcount32,
@ -1050,7 +1048,7 @@ pub const cpu = struct {
pub const gfx902 = Cpu{
.name = "gfx902",
.llvm_name = "gfx902",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.gfx9,
.ldsbankcount32,
@ -1062,7 +1060,7 @@ pub const cpu = struct {
pub const gfx904 = Cpu{
.name = "gfx904",
.llvm_name = "gfx904",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fma_mix_insts,
.gfx9,
@ -1074,7 +1072,7 @@ pub const cpu = struct {
pub const gfx906 = Cpu{
.name = "gfx906",
.llvm_name = "gfx906",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.dl_insts,
.dot1_insts,
@ -1089,7 +1087,7 @@ pub const cpu = struct {
pub const gfx908 = Cpu{
.name = "gfx908",
.llvm_name = "gfx908",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.atomic_fadd_insts,
.code_object_v3,
.dl_insts,
@ -1111,7 +1109,7 @@ pub const cpu = struct {
pub const gfx909 = Cpu{
.name = "gfx909",
.llvm_name = "gfx909",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.gfx9,
.ldsbankcount32,
@ -1122,7 +1120,7 @@ pub const cpu = struct {
pub const hainan = Cpu{
.name = "hainan",
.llvm_name = "hainan",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1132,7 +1130,7 @@ pub const cpu = struct {
pub const hawaii = Cpu{
.name = "hawaii",
.llvm_name = "hawaii",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -1144,7 +1142,7 @@ pub const cpu = struct {
pub const iceland = Cpu{
.name = "iceland",
.llvm_name = "iceland",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1156,7 +1154,7 @@ pub const cpu = struct {
pub const kabini = Cpu{
.name = "kabini",
.llvm_name = "kabini",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount16,
.no_xnack_support,
@ -1166,7 +1164,7 @@ pub const cpu = struct {
pub const kaveri = Cpu{
.name = "kaveri",
.llvm_name = "kaveri",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1176,7 +1174,7 @@ pub const cpu = struct {
pub const mullins = Cpu{
.name = "mullins",
.llvm_name = "mullins",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount16,
.no_xnack_support,
@ -1186,7 +1184,7 @@ pub const cpu = struct {
pub const oland = Cpu{
.name = "oland",
.llvm_name = "oland",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1196,7 +1194,7 @@ pub const cpu = struct {
pub const pitcairn = Cpu{
.name = "pitcairn",
.llvm_name = "pitcairn",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1206,7 +1204,7 @@ pub const cpu = struct {
pub const polaris10 = Cpu{
.name = "polaris10",
.llvm_name = "polaris10",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1217,7 +1215,7 @@ pub const cpu = struct {
pub const polaris11 = Cpu{
.name = "polaris11",
.llvm_name = "polaris11",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1228,7 +1226,7 @@ pub const cpu = struct {
pub const stoney = Cpu{
.name = "stoney",
.llvm_name = "stoney",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount16,
.volcanic_islands,
@ -1238,7 +1236,7 @@ pub const cpu = struct {
pub const tahiti = Cpu{
.name = "tahiti",
.llvm_name = "tahiti",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.fast_fmaf,
.half_rate_64_ops,
@ -1250,7 +1248,7 @@ pub const cpu = struct {
pub const tonga = Cpu{
.name = "tonga",
.llvm_name = "tonga",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,
@ -1262,7 +1260,7 @@ pub const cpu = struct {
pub const verde = Cpu{
.name = "verde",
.llvm_name = "verde",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.code_object_v3,
.ldsbankcount32,
.no_xnack_support,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -16,23 +16,22 @@ pub const all_features = blk: {
result[@enumToInt(Feature.alu32)] = .{
.llvm_name = "alu32",
.description = "Enable ALU32 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dummy)] = .{
.llvm_name = "dummy",
.description = "unused feature",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dwarfris)] = .{
.llvm_name = "dwarfris",
.description = "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -41,27 +40,27 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const probe = Cpu{
.name = "probe",
.llvm_name = "probe",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const v1 = Cpu{
.name = "v1",
.llvm_name = "v1",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const v2 = Cpu{
.name = "v2",
.llvm_name = "v2",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const v3 = Cpu{
.name = "v3",
.llvm_name = "v3",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
};

View File

@ -37,38 +37,38 @@ pub const all_features = blk: {
result[@enumToInt(Feature.duplex)] = .{
.llvm_name = "duplex",
.description = "Enable generation of duplex instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hvx)] = .{
.llvm_name = "hvx",
.description = "Hexagon HVX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hvx_length128b)] = .{
.llvm_name = "hvx-length128b",
.description = "Hexagon HVX 128B instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
}),
};
result[@enumToInt(Feature.hvx_length64b)] = .{
.llvm_name = "hvx-length64b",
.description = "Hexagon HVX 64B instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
}),
};
result[@enumToInt(Feature.hvxv60)] = .{
.llvm_name = "hvxv60",
.description = "Hexagon HVX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
}),
};
result[@enumToInt(Feature.hvxv62)] = .{
.llvm_name = "hvxv62",
.description = "Hexagon HVX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
.hvxv60,
}),
@ -76,7 +76,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.hvxv65)] = .{
.llvm_name = "hvxv65",
.description = "Hexagon HVX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
.hvxv60,
.hvxv62,
@ -85,7 +85,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.hvxv66)] = .{
.llvm_name = "hvxv66",
.description = "Hexagon HVX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hvx,
.hvxv60,
.hvxv62,
@ -96,92 +96,91 @@ pub const all_features = blk: {
result[@enumToInt(Feature.long_calls)] = .{
.llvm_name = "long-calls",
.description = "Use constant-extended calls",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mem_noshuf)] = .{
.llvm_name = "mem_noshuf",
.description = "Supports mem_noshuf feature",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.memops)] = .{
.llvm_name = "memops",
.description = "Use memop instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.noreturn_stack_elim)] = .{
.llvm_name = "noreturn-stack-elim",
.description = "Eliminate stack allocation in a noreturn function when possible",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nvj)] = .{
.llvm_name = "nvj",
.description = "Support for new-value jumps",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.packets,
}),
};
result[@enumToInt(Feature.nvs)] = .{
.llvm_name = "nvs",
.description = "Support for new-value stores",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.packets,
}),
};
result[@enumToInt(Feature.packets)] = .{
.llvm_name = "packets",
.description = "Support for instruction packets",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.reserved_r19)] = .{
.llvm_name = "reserved-r19",
.description = "Reserve register R19",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.small_data)] = .{
.llvm_name = "small-data",
.description = "Allow GP-relative addressing of global variables",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v5)] = .{
.llvm_name = "v5",
.description = "Enable Hexagon V5 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v55)] = .{
.llvm_name = "v55",
.description = "Enable Hexagon V55 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v60)] = .{
.llvm_name = "v60",
.description = "Enable Hexagon V60 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v62)] = .{
.llvm_name = "v62",
.description = "Enable Hexagon V62 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v65)] = .{
.llvm_name = "v65",
.description = "Enable Hexagon V65 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v66)] = .{
.llvm_name = "v66",
.description = "Enable Hexagon V66 architecture",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.zreg)] = .{
.llvm_name = "zreg",
.description = "Hexagon ZReg extension instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -190,7 +189,7 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.memops,
.nvj,
@ -205,7 +204,7 @@ pub const cpu = struct {
pub const hexagonv5 = Cpu{
.name = "hexagonv5",
.llvm_name = "hexagonv5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.memops,
.nvj,
@ -218,7 +217,7 @@ pub const cpu = struct {
pub const hexagonv55 = Cpu{
.name = "hexagonv55",
.llvm_name = "hexagonv55",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.memops,
.nvj,
@ -232,7 +231,7 @@ pub const cpu = struct {
pub const hexagonv60 = Cpu{
.name = "hexagonv60",
.llvm_name = "hexagonv60",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.memops,
.nvj,
@ -247,7 +246,7 @@ pub const cpu = struct {
pub const hexagonv62 = Cpu{
.name = "hexagonv62",
.llvm_name = "hexagonv62",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.memops,
.nvj,
@ -263,7 +262,7 @@ pub const cpu = struct {
pub const hexagonv65 = Cpu{
.name = "hexagonv65",
.llvm_name = "hexagonv65",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.mem_noshuf,
.memops,
@ -281,7 +280,7 @@ pub const cpu = struct {
pub const hexagonv66 = Cpu{
.name = "hexagonv66",
.llvm_name = "hexagonv66",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.duplex,
.mem_noshuf,
.memops,

View File

@ -62,36 +62,36 @@ pub const all_features = blk: {
result[@enumToInt(Feature.abs2008)] = .{
.llvm_name = "abs2008",
.description = "Disable IEEE 754-2008 abs.fmt mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.cnmips)] = .{
.llvm_name = "cnmips",
.description = "Octeon cnMIPS Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips64r2,
}),
};
result[@enumToInt(Feature.crc)] = .{
.llvm_name = "crc",
.description = "Mips R6 CRC ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dsp)] = .{
.llvm_name = "dsp",
.description = "Mips DSP ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dspr2)] = .{
.llvm_name = "dspr2",
.description = "Mips DSP-R2 ASE",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.dsp,
}),
};
result[@enumToInt(Feature.dspr3)] = .{
.llvm_name = "dspr3",
.description = "Mips DSP-R3 ASE",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.dsp,
.dspr2,
}),
@ -99,59 +99,59 @@ pub const all_features = blk: {
result[@enumToInt(Feature.eva)] = .{
.llvm_name = "eva",
.description = "Mips EVA ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp64)] = .{
.llvm_name = "fp64",
.description = "Support 64-bit FP registers",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fpxx)] = .{
.llvm_name = "fpxx",
.description = "Support for FPXX",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ginv)] = .{
.llvm_name = "ginv",
.description = "Mips Global Invalidate ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.gp64)] = .{
.llvm_name = "gp64",
.description = "General Purpose Registers are 64-bit wide",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.long_calls)] = .{
.llvm_name = "long-calls",
.description = "Disable use of the jal instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.micromips)] = .{
.llvm_name = "micromips",
.description = "microMips mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips1)] = .{
.llvm_name = "mips1",
.description = "Mips I ISA Support [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips16)] = .{
.llvm_name = "mips16",
.description = "Mips16 mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips2)] = .{
.llvm_name = "mips2",
.description = "Mips II ISA Support [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips1,
}),
};
result[@enumToInt(Feature.mips3)] = .{
.llvm_name = "mips3",
.description = "MIPS III ISA Support [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fp64,
.gp64,
.mips2,
@ -162,7 +162,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips32)] = .{
.llvm_name = "mips32",
.description = "Mips32 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips2,
.mips3_32,
.mips4_32,
@ -171,7 +171,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips32r2)] = .{
.llvm_name = "mips32r2",
.description = "Mips32r2 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32,
.mips3_32r2,
.mips4_32r2,
@ -181,21 +181,21 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips32r3)] = .{
.llvm_name = "mips32r3",
.description = "Mips32r3 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r2,
}),
};
result[@enumToInt(Feature.mips32r5)] = .{
.llvm_name = "mips32r5",
.description = "Mips32r5 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r3,
}),
};
result[@enumToInt(Feature.mips32r6)] = .{
.llvm_name = "mips32r6",
.description = "Mips32r6 ISA Support [experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.abs2008,
.fp64,
.mips32r5,
@ -205,17 +205,17 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips3_32)] = .{
.llvm_name = "mips3_32",
.description = "Subset of MIPS-III that is also in MIPS32 [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips3_32r2)] = .{
.llvm_name = "mips3_32r2",
.description = "Subset of MIPS-III that is also in MIPS32r2 [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips4)] = .{
.llvm_name = "mips4",
.description = "MIPS IV ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips3,
.mips4_32,
.mips4_32r2,
@ -224,17 +224,17 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips4_32)] = .{
.llvm_name = "mips4_32",
.description = "Subset of MIPS-IV that is also in MIPS32 [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips4_32r2)] = .{
.llvm_name = "mips4_32r2",
.description = "Subset of MIPS-IV that is also in MIPS32r2 [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips5)] = .{
.llvm_name = "mips5",
.description = "MIPS V ISA Support [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips4,
.mips5_32r2,
}),
@ -242,12 +242,12 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips5_32r2)] = .{
.llvm_name = "mips5_32r2",
.description = "Subset of MIPS-V that is also in MIPS32r2 [highly experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mips64)] = .{
.llvm_name = "mips64",
.description = "Mips64 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32,
.mips5,
}),
@ -255,7 +255,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips64r2)] = .{
.llvm_name = "mips64r2",
.description = "Mips64r2 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r2,
.mips64,
}),
@ -263,7 +263,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips64r3)] = .{
.llvm_name = "mips64r3",
.description = "Mips64r3 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r3,
.mips64r2,
}),
@ -271,7 +271,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips64r5)] = .{
.llvm_name = "mips64r5",
.description = "Mips64r5 ISA Support",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r5,
.mips64r3,
}),
@ -279,7 +279,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.mips64r6)] = .{
.llvm_name = "mips64r6",
.description = "Mips64r6 ISA Support [experimental]",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.abs2008,
.mips32r6,
.mips64r5,
@ -289,85 +289,84 @@ pub const all_features = blk: {
result[@enumToInt(Feature.msa)] = .{
.llvm_name = "msa",
.description = "Mips MSA ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mt)] = .{
.llvm_name = "mt",
.description = "Mips MT ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nan2008)] = .{
.llvm_name = "nan2008",
.description = "IEEE 754-2008 NaN encoding",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.noabicalls)] = .{
.llvm_name = "noabicalls",
.description = "Disable SVR4-style position-independent code",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nomadd4)] = .{
.llvm_name = "nomadd4",
.description = "Disable 4-operand madd.fmt and related instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nooddspreg)] = .{
.llvm_name = "nooddspreg",
.description = "Disable odd numbered single-precision registers",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.p5600)] = .{
.llvm_name = "p5600",
.description = "The P5600 Processor",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.mips32r5,
}),
};
result[@enumToInt(Feature.ptr64)] = .{
.llvm_name = "ptr64",
.description = "Pointers are 64-bit wide",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.single_float)] = .{
.llvm_name = "single-float",
.description = "Only supports single precision float",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.soft_float)] = .{
.llvm_name = "soft-float",
.description = "Does not support floating point instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sym32)] = .{
.llvm_name = "sym32",
.description = "Symbols are 32 bit on Mips64",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.use_indirect_jump_hazard)] = .{
.llvm_name = "use-indirect-jump-hazard",
.description = "Use indirect jump guards to prevent certain speculation based attacks",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.use_tcc_in_div)] = .{
.llvm_name = "use-tcc-in-div",
.description = "Force the assembler to use trapping",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vfpu)] = .{
.llvm_name = "vfpu",
.description = "Enable vector FPU instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.virt)] = .{
.llvm_name = "virt",
.description = "Mips Virtualization ASE",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -376,112 +375,112 @@ pub const cpu = struct {
pub const mips1 = Cpu{
.name = "mips1",
.llvm_name = "mips1",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips1,
}),
};
pub const mips2 = Cpu{
.name = "mips2",
.llvm_name = "mips2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips2,
}),
};
pub const mips3 = Cpu{
.name = "mips3",
.llvm_name = "mips3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips3,
}),
};
pub const mips32 = Cpu{
.name = "mips32",
.llvm_name = "mips32",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips32,
}),
};
pub const mips32r2 = Cpu{
.name = "mips32r2",
.llvm_name = "mips32r2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips32r2,
}),
};
pub const mips32r3 = Cpu{
.name = "mips32r3",
.llvm_name = "mips32r3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips32r3,
}),
};
pub const mips32r5 = Cpu{
.name = "mips32r5",
.llvm_name = "mips32r5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips32r5,
}),
};
pub const mips32r6 = Cpu{
.name = "mips32r6",
.llvm_name = "mips32r6",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips32r6,
}),
};
pub const mips4 = Cpu{
.name = "mips4",
.llvm_name = "mips4",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips4,
}),
};
pub const mips5 = Cpu{
.name = "mips5",
.llvm_name = "mips5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips5,
}),
};
pub const mips64 = Cpu{
.name = "mips64",
.llvm_name = "mips64",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips64,
}),
};
pub const mips64r2 = Cpu{
.name = "mips64r2",
.llvm_name = "mips64r2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips64r2,
}),
};
pub const mips64r3 = Cpu{
.name = "mips64r3",
.llvm_name = "mips64r3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips64r3,
}),
};
pub const mips64r5 = Cpu{
.name = "mips64r5",
.llvm_name = "mips64r5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips64r5,
}),
};
pub const mips64r6 = Cpu{
.name = "mips64r6",
.llvm_name = "mips64r6",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.mips64r6,
}),
};
pub const octeon = Cpu{
.name = "octeon",
.llvm_name = "octeon",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.cnmips,
.mips64r2,
}),
@ -489,7 +488,7 @@ pub const cpu = struct {
pub const p5600 = Cpu{
.name = "p5600",
.llvm_name = "p5600",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.p5600,
}),
};

View File

@ -17,28 +17,27 @@ pub const all_features = blk: {
result[@enumToInt(Feature.ext)] = .{
.llvm_name = "ext",
.description = "Enable MSP430-X extensions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hwmult16)] = .{
.llvm_name = "hwmult16",
.description = "Enable 16-bit hardware multiplier",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hwmult32)] = .{
.llvm_name = "hwmult32",
.description = "Enable 32-bit hardware multiplier",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hwmultf5)] = .{
.llvm_name = "hwmultf5",
.description = "Enable F5 series hardware multiplier",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -47,17 +46,17 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const msp430 = Cpu{
.name = "msp430",
.llvm_name = "msp430",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const msp430x = Cpu{
.name = "msp430x",
.llvm_name = "msp430x",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ext,
}),
};

View File

@ -38,133 +38,132 @@ pub const all_features = blk: {
result[@enumToInt(Feature.ptx32)] = .{
.llvm_name = "ptx32",
.description = "Use PTX version 3.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx40)] = .{
.llvm_name = "ptx40",
.description = "Use PTX version 4.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx41)] = .{
.llvm_name = "ptx41",
.description = "Use PTX version 4.1",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx42)] = .{
.llvm_name = "ptx42",
.description = "Use PTX version 4.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx43)] = .{
.llvm_name = "ptx43",
.description = "Use PTX version 4.3",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx50)] = .{
.llvm_name = "ptx50",
.description = "Use PTX version 5.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx60)] = .{
.llvm_name = "ptx60",
.description = "Use PTX version 6.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx61)] = .{
.llvm_name = "ptx61",
.description = "Use PTX version 6.1",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx63)] = .{
.llvm_name = "ptx63",
.description = "Use PTX version 6.3",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ptx64)] = .{
.llvm_name = "ptx64",
.description = "Use PTX version 6.4",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_20)] = .{
.llvm_name = "sm_20",
.description = "Target SM 2.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_21)] = .{
.llvm_name = "sm_21",
.description = "Target SM 2.1",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_30)] = .{
.llvm_name = "sm_30",
.description = "Target SM 3.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_32)] = .{
.llvm_name = "sm_32",
.description = "Target SM 3.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_35)] = .{
.llvm_name = "sm_35",
.description = "Target SM 3.5",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_37)] = .{
.llvm_name = "sm_37",
.description = "Target SM 3.7",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_50)] = .{
.llvm_name = "sm_50",
.description = "Target SM 5.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_52)] = .{
.llvm_name = "sm_52",
.description = "Target SM 5.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_53)] = .{
.llvm_name = "sm_53",
.description = "Target SM 5.3",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_60)] = .{
.llvm_name = "sm_60",
.description = "Target SM 6.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_61)] = .{
.llvm_name = "sm_61",
.description = "Target SM 6.1",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_62)] = .{
.llvm_name = "sm_62",
.description = "Target SM 6.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_70)] = .{
.llvm_name = "sm_70",
.description = "Target SM 7.0",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_72)] = .{
.llvm_name = "sm_72",
.description = "Target SM 7.2",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sm_75)] = .{
.llvm_name = "sm_75",
.description = "Target SM 7.5",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -173,28 +172,28 @@ pub const cpu = struct {
pub const sm_20 = Cpu{
.name = "sm_20",
.llvm_name = "sm_20",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.sm_20,
}),
};
pub const sm_21 = Cpu{
.name = "sm_21",
.llvm_name = "sm_21",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.sm_21,
}),
};
pub const sm_30 = Cpu{
.name = "sm_30",
.llvm_name = "sm_30",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.sm_30,
}),
};
pub const sm_32 = Cpu{
.name = "sm_32",
.llvm_name = "sm_32",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx40,
.sm_32,
}),
@ -202,14 +201,14 @@ pub const cpu = struct {
pub const sm_35 = Cpu{
.name = "sm_35",
.llvm_name = "sm_35",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.sm_35,
}),
};
pub const sm_37 = Cpu{
.name = "sm_37",
.llvm_name = "sm_37",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx41,
.sm_37,
}),
@ -217,7 +216,7 @@ pub const cpu = struct {
pub const sm_50 = Cpu{
.name = "sm_50",
.llvm_name = "sm_50",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx40,
.sm_50,
}),
@ -225,7 +224,7 @@ pub const cpu = struct {
pub const sm_52 = Cpu{
.name = "sm_52",
.llvm_name = "sm_52",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx41,
.sm_52,
}),
@ -233,7 +232,7 @@ pub const cpu = struct {
pub const sm_53 = Cpu{
.name = "sm_53",
.llvm_name = "sm_53",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx42,
.sm_53,
}),
@ -241,7 +240,7 @@ pub const cpu = struct {
pub const sm_60 = Cpu{
.name = "sm_60",
.llvm_name = "sm_60",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx50,
.sm_60,
}),
@ -249,7 +248,7 @@ pub const cpu = struct {
pub const sm_61 = Cpu{
.name = "sm_61",
.llvm_name = "sm_61",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx50,
.sm_61,
}),
@ -257,7 +256,7 @@ pub const cpu = struct {
pub const sm_62 = Cpu{
.name = "sm_62",
.llvm_name = "sm_62",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx50,
.sm_62,
}),
@ -265,7 +264,7 @@ pub const cpu = struct {
pub const sm_70 = Cpu{
.name = "sm_70",
.llvm_name = "sm_70",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx60,
.sm_70,
}),
@ -273,7 +272,7 @@ pub const cpu = struct {
pub const sm_72 = Cpu{
.name = "sm_72",
.llvm_name = "sm_72",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx61,
.sm_72,
}),
@ -281,7 +280,7 @@ pub const cpu = struct {
pub const sm_75 = Cpu{
.name = "sm_75",
.llvm_name = "sm_75",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.ptx63,
.sm_75,
}),

View File

@ -64,216 +64,216 @@ pub const all_features = blk: {
result[@enumToInt(Feature.@"64bit")] = .{
.llvm_name = "64bit",
.description = "Enable 64-bit instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.@"64bitregs")] = .{
.llvm_name = "64bitregs",
.description = "Enable 64-bit registers usage for ppc32 [beta]",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.altivec)] = .{
.llvm_name = "altivec",
.description = "Enable Altivec instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.booke)] = .{
.llvm_name = "booke",
.description = "Enable Book E instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.icbt,
}),
};
result[@enumToInt(Feature.bpermd)] = .{
.llvm_name = "bpermd",
.description = "Enable the bpermd instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.cmpb)] = .{
.llvm_name = "cmpb",
.description = "Enable the cmpb instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.crbits)] = .{
.llvm_name = "crbits",
.description = "Use condition-register bits individually",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.crypto)] = .{
.llvm_name = "crypto",
.description = "Enable POWER8 Crypto instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.power8_altivec,
}),
};
result[@enumToInt(Feature.direct_move)] = .{
.llvm_name = "direct-move",
.description = "Enable Power8 direct move instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.vsx,
}),
};
result[@enumToInt(Feature.e500)] = .{
.llvm_name = "e500",
.description = "Enable E500/E500mc instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.extdiv)] = .{
.llvm_name = "extdiv",
.description = "Enable extended divide instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fcpsgn)] = .{
.llvm_name = "fcpsgn",
.description = "Enable the fcpsgn instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.float128)] = .{
.llvm_name = "float128",
.description = "Enable the __float128 data type for IEEE-754R Binary128.",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.vsx,
}),
};
result[@enumToInt(Feature.fpcvt)] = .{
.llvm_name = "fpcvt",
.description = "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.fprnd)] = .{
.llvm_name = "fprnd",
.description = "Enable the fri[mnpz] instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.fpu)] = .{
.llvm_name = "fpu",
.description = "Enable classic FPU instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hard_float,
}),
};
result[@enumToInt(Feature.fre)] = .{
.llvm_name = "fre",
.description = "Enable the fre instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.fres)] = .{
.llvm_name = "fres",
.description = "Enable the fres instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.frsqrte)] = .{
.llvm_name = "frsqrte",
.description = "Enable the frsqrte instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.frsqrtes)] = .{
.llvm_name = "frsqrtes",
.description = "Enable the frsqrtes instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.fsqrt)] = .{
.llvm_name = "fsqrt",
.description = "Enable the fsqrt instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.hard_float)] = .{
.llvm_name = "hard-float",
.description = "Enable floating-point instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.htm)] = .{
.llvm_name = "htm",
.description = "Enable Hardware Transactional Memory instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.icbt)] = .{
.llvm_name = "icbt",
.description = "Enable icbt instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.invariant_function_descriptors)] = .{
.llvm_name = "invariant-function-descriptors",
.description = "Assume function descriptors are invariant",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.isa_v30_instructions)] = .{
.llvm_name = "isa-v30-instructions",
.description = "Enable instructions added in ISA 3.0.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.isel)] = .{
.llvm_name = "isel",
.description = "Enable the isel instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ldbrx)] = .{
.llvm_name = "ldbrx",
.description = "Enable the ldbrx instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.lfiwax)] = .{
.llvm_name = "lfiwax",
.description = "Enable the lfiwax instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.longcall)] = .{
.llvm_name = "longcall",
.description = "Always use indirect calls",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mfocrf)] = .{
.llvm_name = "mfocrf",
.description = "Enable the MFOCRF instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.msync)] = .{
.llvm_name = "msync",
.description = "Has only the msync instruction instead of sync",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.booke,
}),
};
result[@enumToInt(Feature.partword_atomics)] = .{
.llvm_name = "partword-atomics",
.description = "Enable l[bh]arx and st[bh]cx.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.popcntd)] = .{
.llvm_name = "popcntd",
.description = "Enable the popcnt[dw] instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.power8_altivec)] = .{
.llvm_name = "power8-altivec",
.description = "Enable POWER8 Altivec instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.altivec,
}),
};
result[@enumToInt(Feature.power8_vector)] = .{
.llvm_name = "power8-vector",
.description = "Enable POWER8 vector instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.power8_altivec,
.vsx,
}),
@ -281,7 +281,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.power9_altivec)] = .{
.llvm_name = "power9-altivec",
.description = "Enable POWER9 Altivec instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.isa_v30_instructions,
.power8_altivec,
}),
@ -289,7 +289,7 @@ pub const all_features = blk: {
result[@enumToInt(Feature.power9_vector)] = .{
.llvm_name = "power9-vector",
.description = "Enable POWER9 vector instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.isa_v30_instructions,
.power8_vector,
.power9_altivec,
@ -298,73 +298,73 @@ pub const all_features = blk: {
result[@enumToInt(Feature.ppc_postra_sched)] = .{
.llvm_name = "ppc-postra-sched",
.description = "Use PowerPC post-RA scheduling strategy",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ppc_prera_sched)] = .{
.llvm_name = "ppc-prera-sched",
.description = "Use PowerPC pre-RA scheduling strategy",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ppc4xx)] = .{
.llvm_name = "ppc4xx",
.description = "Enable PPC 4xx instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.ppc6xx)] = .{
.llvm_name = "ppc6xx",
.description = "Enable PPC 6xx instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.qpx)] = .{
.llvm_name = "qpx",
.description = "Enable QPX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.recipprec)] = .{
.llvm_name = "recipprec",
.description = "Assume higher precision reciprocal estimates",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.secure_plt)] = .{
.llvm_name = "secure-plt",
.description = "Enable secure plt mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.slow_popcntd)] = .{
.llvm_name = "slow-popcntd",
.description = "Has slow popcnt[dw] instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.spe)] = .{
.llvm_name = "spe",
.description = "Enable SPE instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.hard_float,
}),
};
result[@enumToInt(Feature.stfiwx)] = .{
.llvm_name = "stfiwx",
.description = "Enable the stfiwx instruction",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.fpu,
}),
};
result[@enumToInt(Feature.two_const_nr)] = .{
.llvm_name = "two-const-nr",
.description = "Requires two constant Newton-Raphson computation",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vectors_use_two_units)] = .{
.llvm_name = "vectors-use-two-units",
.description = "Vectors use two units",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vsx)] = .{
.llvm_name = "vsx",
.description = "Enable VSX instructions",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.altivec,
}),
};
@ -372,7 +372,6 @@ pub const all_features = blk: {
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -381,7 +380,7 @@ pub const cpu = struct {
pub const @"440" = Cpu{
.name = "440",
.llvm_name = "440",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.booke,
.fres,
.frsqrte,
@ -393,7 +392,7 @@ pub const cpu = struct {
pub const @"450" = Cpu{
.name = "450",
.llvm_name = "450",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.booke,
.fres,
.frsqrte,
@ -405,21 +404,21 @@ pub const cpu = struct {
pub const @"601" = Cpu{
.name = "601",
.llvm_name = "601",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fpu,
}),
};
pub const @"602" = Cpu{
.name = "602",
.llvm_name = "602",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fpu,
}),
};
pub const @"603" = Cpu{
.name = "603",
.llvm_name = "603",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -427,7 +426,7 @@ pub const cpu = struct {
pub const @"603e" = Cpu{
.name = "603e",
.llvm_name = "603e",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -435,7 +434,7 @@ pub const cpu = struct {
pub const @"603ev" = Cpu{
.name = "603ev",
.llvm_name = "603ev",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -443,7 +442,7 @@ pub const cpu = struct {
pub const @"604" = Cpu{
.name = "604",
.llvm_name = "604",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -451,7 +450,7 @@ pub const cpu = struct {
pub const @"604e" = Cpu{
.name = "604e",
.llvm_name = "604e",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -459,7 +458,7 @@ pub const cpu = struct {
pub const @"620" = Cpu{
.name = "620",
.llvm_name = "620",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -467,7 +466,7 @@ pub const cpu = struct {
pub const @"7400" = Cpu{
.name = "7400",
.llvm_name = "7400",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.altivec,
.fres,
.frsqrte,
@ -476,7 +475,7 @@ pub const cpu = struct {
pub const @"7450" = Cpu{
.name = "7450",
.llvm_name = "7450",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.altivec,
.fres,
.frsqrte,
@ -485,7 +484,7 @@ pub const cpu = struct {
pub const @"750" = Cpu{
.name = "750",
.llvm_name = "750",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -493,7 +492,7 @@ pub const cpu = struct {
pub const @"970" = Cpu{
.name = "970",
.llvm_name = "970",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fres,
@ -506,7 +505,7 @@ pub const cpu = struct {
pub const a2 = Cpu{
.name = "a2",
.llvm_name = "a2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.booke,
.cmpb,
@ -531,7 +530,7 @@ pub const cpu = struct {
pub const a2q = Cpu{
.name = "a2q",
.llvm_name = "a2q",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.booke,
.cmpb,
@ -557,7 +556,7 @@ pub const cpu = struct {
pub const e500 = Cpu{
.name = "e500",
.llvm_name = "e500",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.booke,
.icbt,
.isel,
@ -566,7 +565,7 @@ pub const cpu = struct {
pub const e500mc = Cpu{
.name = "e500mc",
.llvm_name = "e500mc",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.booke,
.icbt,
.isel,
@ -576,7 +575,7 @@ pub const cpu = struct {
pub const e5500 = Cpu{
.name = "e5500",
.llvm_name = "e5500",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.booke,
.icbt,
@ -588,7 +587,7 @@ pub const cpu = struct {
pub const g3 = Cpu{
.name = "g3",
.llvm_name = "g3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fres,
.frsqrte,
}),
@ -596,7 +595,7 @@ pub const cpu = struct {
pub const g4 = Cpu{
.name = "g4",
.llvm_name = "g4",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.altivec,
.fres,
.frsqrte,
@ -605,7 +604,7 @@ pub const cpu = struct {
pub const @"g4+" = Cpu{
.name = "g4+",
.llvm_name = "g4+",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.altivec,
.fres,
.frsqrte,
@ -614,7 +613,7 @@ pub const cpu = struct {
pub const g5 = Cpu{
.name = "g5",
.llvm_name = "g5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fres,
@ -627,28 +626,28 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
pub const ppc = Cpu{
.name = "ppc",
.llvm_name = "ppc",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
pub const ppc32 = Cpu{
.name = "ppc32",
.llvm_name = "ppc32",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hard_float,
}),
};
pub const ppc64 = Cpu{
.name = "ppc64",
.llvm_name = "ppc64",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fres,
@ -661,7 +660,7 @@ pub const cpu = struct {
pub const ppc64le = Cpu{
.name = "ppc64le",
.llvm_name = "ppc64le",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.bpermd,
@ -696,7 +695,7 @@ pub const cpu = struct {
pub const pwr3 = Cpu{
.name = "pwr3",
.llvm_name = "pwr3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fres,
@ -708,7 +707,7 @@ pub const cpu = struct {
pub const pwr4 = Cpu{
.name = "pwr4",
.llvm_name = "pwr4",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fres,
@ -721,7 +720,7 @@ pub const cpu = struct {
pub const pwr5 = Cpu{
.name = "pwr5",
.llvm_name = "pwr5",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fre,
@ -736,7 +735,7 @@ pub const cpu = struct {
pub const pwr5x = Cpu{
.name = "pwr5x",
.llvm_name = "pwr5x",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.fprnd,
@ -752,7 +751,7 @@ pub const cpu = struct {
pub const pwr6 = Cpu{
.name = "pwr6",
.llvm_name = "pwr6",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.cmpb,
@ -772,7 +771,7 @@ pub const cpu = struct {
pub const pwr6x = Cpu{
.name = "pwr6x",
.llvm_name = "pwr6x",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.cmpb,
@ -792,7 +791,7 @@ pub const cpu = struct {
pub const pwr7 = Cpu{
.name = "pwr7",
.llvm_name = "pwr7",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.bpermd,
@ -820,7 +819,7 @@ pub const cpu = struct {
pub const pwr8 = Cpu{
.name = "pwr8",
.llvm_name = "pwr8",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.bpermd,
@ -855,7 +854,7 @@ pub const cpu = struct {
pub const pwr9 = Cpu{
.name = "pwr9",
.llvm_name = "pwr9",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
.altivec,
.bpermd,

View File

@ -21,50 +21,49 @@ pub const all_features = blk: {
result[@enumToInt(Feature.@"64bit")] = .{
.llvm_name = "64bit",
.description = "Implements RV64",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.a)] = .{
.llvm_name = "a",
.description = "'A' (Atomic Instructions)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.c)] = .{
.llvm_name = "c",
.description = "'C' (Compressed Instructions)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.d)] = .{
.llvm_name = "d",
.description = "'D' (Double-Precision Floating-Point)",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.f,
}),
};
result[@enumToInt(Feature.e)] = .{
.llvm_name = "e",
.description = "Implements RV32E (provides 16 rather than 32 GPRs)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.f)] = .{
.llvm_name = "f",
.description = "'F' (Single-Precision Floating-Point)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.m)] = .{
.llvm_name = "m",
.description = "'M' (Integer Multiplication and Division)",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.relax)] = .{
.llvm_name = "relax",
.description = "Enable Linker relaxation.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -73,12 +72,12 @@ pub const cpu = struct {
pub const generic_rv32 = Cpu{
.name = "generic_rv32",
.llvm_name = "generic-rv32",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const generic_rv64 = Cpu{
.name = "generic_rv64",
.llvm_name = "generic-rv64",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.@"64bit",
}),
};
@ -92,7 +91,7 @@ pub const all_cpus = &[_]*const Cpu{
&cpu.generic_rv64,
};
pub const baseline_32_features = featureSet(&all_features, &[_]Feature{
pub const baseline_32_features = featureSet(&[_]Feature{
.a,
.c,
.d,
@ -101,7 +100,7 @@ pub const baseline_32_features = featureSet(&all_features, &[_]Feature{
.relax,
});
pub const baseline_64_features = featureSet(&all_features, &[_]Feature{
pub const baseline_64_features = featureSet(&[_]Feature{
.@"64bit",
.a,
.c,

View File

@ -32,103 +32,102 @@ pub const all_features = blk: {
result[@enumToInt(Feature.deprecated_v8)] = .{
.llvm_name = "deprecated-v8",
.description = "Enable deprecated V8 instructions in V9 mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.detectroundchange)] = .{
.llvm_name = "detectroundchange",
.description = "LEON3 erratum detection: Detects any rounding mode change request: use only the round-to-nearest rounding mode",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fixallfdivsqrt)] = .{
.llvm_name = "fixallfdivsqrt",
.description = "LEON erratum fix: Fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hard_quad_float)] = .{
.llvm_name = "hard-quad-float",
.description = "Enable quad-word floating point instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hasleoncasa)] = .{
.llvm_name = "hasleoncasa",
.description = "Enable CASA instruction for LEON3 and LEON4 processors",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.hasumacsmac)] = .{
.llvm_name = "hasumacsmac",
.description = "Enable UMAC and SMAC for LEON3 and LEON4 processors",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.leon)] = .{
.llvm_name = "leon",
.description = "Enable LEON extensions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.leoncyclecounter)] = .{
.llvm_name = "leoncyclecounter",
.description = "Use the Leon cycle counter register",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.leonpwrpsr)] = .{
.llvm_name = "leonpwrpsr",
.description = "Enable the PWRPSR instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_fmuls)] = .{
.llvm_name = "no-fmuls",
.description = "Disable the fmuls instruction.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.no_fsmuld)] = .{
.llvm_name = "no-fsmuld",
.description = "Disable the fsmuld instruction.",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.popc)] = .{
.llvm_name = "popc",
.description = "Use the popc (population count) instruction",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.soft_float)] = .{
.llvm_name = "soft-float",
.description = "Use software emulation for floating point",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.soft_mul_div)] = .{
.llvm_name = "soft-mul-div",
.description = "Use software emulation for integer multiply and divide",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.v9)] = .{
.llvm_name = "v9",
.description = "Enable SPARC-V9 instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vis)] = .{
.llvm_name = "vis",
.description = "Enable UltraSPARC Visual Instruction Set extensions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vis2)] = .{
.llvm_name = "vis2",
.description = "Enable Visual Instruction Set extensions II",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vis3)] = .{
.llvm_name = "vis3",
.description = "Enable Visual Instruction Set extensions III",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -137,7 +136,7 @@ pub const cpu = struct {
pub const at697e = Cpu{
.name = "at697e",
.llvm_name = "at697e",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.insertnopload,
.leon,
}),
@ -145,7 +144,7 @@ pub const cpu = struct {
pub const at697f = Cpu{
.name = "at697f",
.llvm_name = "at697f",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.insertnopload,
.leon,
}),
@ -153,17 +152,17 @@ pub const cpu = struct {
pub const f934 = Cpu{
.name = "f934",
.llvm_name = "f934",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const gr712rc = Cpu{
.name = "gr712rc",
.llvm_name = "gr712rc",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -171,7 +170,7 @@ pub const cpu = struct {
pub const gr740 = Cpu{
.name = "gr740",
.llvm_name = "gr740",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.hasumacsmac,
.leon,
@ -182,19 +181,19 @@ pub const cpu = struct {
pub const hypersparc = Cpu{
.name = "hypersparc",
.llvm_name = "hypersparc",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const leon2 = Cpu{
.name = "leon2",
.llvm_name = "leon2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.leon,
}),
};
pub const leon3 = Cpu{
.name = "leon3",
.llvm_name = "leon3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasumacsmac,
.leon,
}),
@ -202,7 +201,7 @@ pub const cpu = struct {
pub const leon4 = Cpu{
.name = "leon4",
.llvm_name = "leon4",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.hasumacsmac,
.leon,
@ -211,7 +210,7 @@ pub const cpu = struct {
pub const ma2080 = Cpu{
.name = "ma2080",
.llvm_name = "ma2080",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -219,7 +218,7 @@ pub const cpu = struct {
pub const ma2085 = Cpu{
.name = "ma2085",
.llvm_name = "ma2085",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -227,7 +226,7 @@ pub const cpu = struct {
pub const ma2100 = Cpu{
.name = "ma2100",
.llvm_name = "ma2100",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -235,7 +234,7 @@ pub const cpu = struct {
pub const ma2150 = Cpu{
.name = "ma2150",
.llvm_name = "ma2150",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -243,7 +242,7 @@ pub const cpu = struct {
pub const ma2155 = Cpu{
.name = "ma2155",
.llvm_name = "ma2155",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -251,7 +250,7 @@ pub const cpu = struct {
pub const ma2450 = Cpu{
.name = "ma2450",
.llvm_name = "ma2450",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -259,7 +258,7 @@ pub const cpu = struct {
pub const ma2455 = Cpu{
.name = "ma2455",
.llvm_name = "ma2455",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -267,7 +266,7 @@ pub const cpu = struct {
pub const ma2480 = Cpu{
.name = "ma2480",
.llvm_name = "ma2480",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -275,7 +274,7 @@ pub const cpu = struct {
pub const ma2485 = Cpu{
.name = "ma2485",
.llvm_name = "ma2485",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -283,7 +282,7 @@ pub const cpu = struct {
pub const ma2x5x = Cpu{
.name = "ma2x5x",
.llvm_name = "ma2x5x",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -291,7 +290,7 @@ pub const cpu = struct {
pub const ma2x8x = Cpu{
.name = "ma2x8x",
.llvm_name = "ma2x8x",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -299,7 +298,7 @@ pub const cpu = struct {
pub const myriad2 = Cpu{
.name = "myriad2",
.llvm_name = "myriad2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -307,7 +306,7 @@ pub const cpu = struct {
pub const myriad2_1 = Cpu{
.name = "myriad2_1",
.llvm_name = "myriad2.1",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -315,7 +314,7 @@ pub const cpu = struct {
pub const myriad2_2 = Cpu{
.name = "myriad2_2",
.llvm_name = "myriad2.2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -323,7 +322,7 @@ pub const cpu = struct {
pub const myriad2_3 = Cpu{
.name = "myriad2_3",
.llvm_name = "myriad2.3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.hasleoncasa,
.leon,
}),
@ -331,7 +330,7 @@ pub const cpu = struct {
pub const niagara = Cpu{
.name = "niagara",
.llvm_name = "niagara",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.v9,
.vis,
@ -341,7 +340,7 @@ pub const cpu = struct {
pub const niagara2 = Cpu{
.name = "niagara2",
.llvm_name = "niagara2",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.popc,
.v9,
@ -352,7 +351,7 @@ pub const cpu = struct {
pub const niagara3 = Cpu{
.name = "niagara3",
.llvm_name = "niagara3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.popc,
.v9,
@ -363,7 +362,7 @@ pub const cpu = struct {
pub const niagara4 = Cpu{
.name = "niagara4",
.llvm_name = "niagara4",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.popc,
.v9,
@ -375,32 +374,32 @@ pub const cpu = struct {
pub const sparclet = Cpu{
.name = "sparclet",
.llvm_name = "sparclet",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const sparclite = Cpu{
.name = "sparclite",
.llvm_name = "sparclite",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const sparclite86x = Cpu{
.name = "sparclite86x",
.llvm_name = "sparclite86x",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const supersparc = Cpu{
.name = "supersparc",
.llvm_name = "supersparc",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const tsc701 = Cpu{
.name = "tsc701",
.llvm_name = "tsc701",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const ultrasparc = Cpu{
.name = "ultrasparc",
.llvm_name = "ultrasparc",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.v9,
.vis,
@ -409,7 +408,7 @@ pub const cpu = struct {
pub const ultrasparc3 = Cpu{
.name = "ultrasparc3",
.llvm_name = "ultrasparc3",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deprecated_v8,
.v9,
.vis,
@ -419,7 +418,7 @@ pub const cpu = struct {
pub const ut699 = Cpu{
.name = "ut699",
.llvm_name = "ut699",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.fixallfdivsqrt,
.insertnopload,
.leon,
@ -430,7 +429,7 @@ pub const cpu = struct {
pub const v7 = Cpu{
.name = "v7",
.llvm_name = "v7",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.no_fsmuld,
.soft_mul_div,
}),
@ -438,12 +437,12 @@ pub const cpu = struct {
pub const v8 = Cpu{
.name = "v8",
.llvm_name = "v8",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const v9 = Cpu{
.name = "v9",
.llvm_name = "v9",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.v9,
}),
};

View File

@ -48,183 +48,182 @@ pub const all_features = blk: {
result[@enumToInt(Feature.deflate_conversion)] = .{
.llvm_name = "deflate-conversion",
.description = "Assume that the deflate-conversion facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dfp_packed_conversion)] = .{
.llvm_name = "dfp-packed-conversion",
.description = "Assume that the DFP packed-conversion facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.dfp_zoned_conversion)] = .{
.llvm_name = "dfp-zoned-conversion",
.description = "Assume that the DFP zoned-conversion facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.distinct_ops)] = .{
.llvm_name = "distinct-ops",
.description = "Assume that the distinct-operands facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.enhanced_dat_2)] = .{
.llvm_name = "enhanced-dat-2",
.description = "Assume that the enhanced-DAT facility 2 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.enhanced_sort)] = .{
.llvm_name = "enhanced-sort",
.description = "Assume that the enhanced-sort facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.execution_hint)] = .{
.llvm_name = "execution-hint",
.description = "Assume that the execution-hint facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fast_serialization)] = .{
.llvm_name = "fast-serialization",
.description = "Assume that the fast-serialization facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.fp_extension)] = .{
.llvm_name = "fp-extension",
.description = "Assume that the floating-point extension facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.guarded_storage)] = .{
.llvm_name = "guarded-storage",
.description = "Assume that the guarded-storage facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.high_word)] = .{
.llvm_name = "high-word",
.description = "Assume that the high-word facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.insert_reference_bits_multiple)] = .{
.llvm_name = "insert-reference-bits-multiple",
.description = "Assume that the insert-reference-bits-multiple facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.interlocked_access1)] = .{
.llvm_name = "interlocked-access1",
.description = "Assume that interlocked-access facility 1 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.load_and_trap)] = .{
.llvm_name = "load-and-trap",
.description = "Assume that the load-and-trap facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.load_store_on_cond)] = .{
.llvm_name = "load-store-on-cond",
.description = "Assume that the load/store-on-condition facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(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 = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension3)] = .{
.llvm_name = "message-security-assist-extension3",
.description = "Assume that the message-security-assist extension facility 3 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension4)] = .{
.llvm_name = "message-security-assist-extension4",
.description = "Assume that the message-security-assist extension facility 4 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension5)] = .{
.llvm_name = "message-security-assist-extension5",
.description = "Assume that the message-security-assist extension facility 5 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension7)] = .{
.llvm_name = "message-security-assist-extension7",
.description = "Assume that the message-security-assist extension facility 7 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension8)] = .{
.llvm_name = "message-security-assist-extension8",
.description = "Assume that the message-security-assist extension facility 8 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.message_security_assist_extension9)] = .{
.llvm_name = "message-security-assist-extension9",
.description = "Assume that the message-security-assist extension facility 9 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.miscellaneous_extensions)] = .{
.llvm_name = "miscellaneous-extensions",
.description = "Assume that the miscellaneous-extensions facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.miscellaneous_extensions_2)] = .{
.llvm_name = "miscellaneous-extensions-2",
.description = "Assume that the miscellaneous-extensions facility 2 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.miscellaneous_extensions_3)] = .{
.llvm_name = "miscellaneous-extensions-3",
.description = "Assume that the miscellaneous-extensions facility 3 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.population_count)] = .{
.llvm_name = "population-count",
.description = "Assume that the population-count facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.processor_assist)] = .{
.llvm_name = "processor-assist",
.description = "Assume that the processor-assist facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.reset_reference_bits_multiple)] = .{
.llvm_name = "reset-reference-bits-multiple",
.description = "Assume that the reset-reference-bits-multiple facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.transactional_execution)] = .{
.llvm_name = "transactional-execution",
.description = "Assume that the transactional-execution facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vector)] = .{
.llvm_name = "vector",
.description = "Assume that the vectory facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vector_enhancements_1)] = .{
.llvm_name = "vector-enhancements-1",
.description = "Assume that the vector enhancements facility 1 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vector_enhancements_2)] = .{
.llvm_name = "vector-enhancements-2",
.description = "Assume that the vector enhancements facility 2 is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vector_packed_decimal)] = .{
.llvm_name = "vector-packed-decimal",
.description = "Assume that the vector packed decimal facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.vector_packed_decimal_enhancement)] = .{
.llvm_name = "vector-packed-decimal-enhancement",
.description = "Assume that the vector packed decimal enhancement facility is installed",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
const ti = @typeInfo(Feature);
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -233,7 +232,7 @@ pub const cpu = struct {
pub const arch10 = Cpu{
.name = "arch10",
.llvm_name = "arch10",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_zoned_conversion,
.distinct_ops,
.enhanced_dat_2,
@ -256,7 +255,7 @@ pub const cpu = struct {
pub const arch11 = Cpu{
.name = "arch11",
.llvm_name = "arch11",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_packed_conversion,
.dfp_zoned_conversion,
.distinct_ops,
@ -284,7 +283,7 @@ pub const cpu = struct {
pub const arch12 = Cpu{
.name = "arch12",
.llvm_name = "arch12",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_packed_conversion,
.dfp_zoned_conversion,
.distinct_ops,
@ -319,7 +318,7 @@ pub const cpu = struct {
pub const arch13 = Cpu{
.name = "arch13",
.llvm_name = "arch13",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.deflate_conversion,
.dfp_packed_conversion,
.dfp_zoned_conversion,
@ -360,12 +359,12 @@ pub const cpu = struct {
pub const arch8 = Cpu{
.name = "arch8",
.llvm_name = "arch8",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const arch9 = Cpu{
.name = "arch9",
.llvm_name = "arch9",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.distinct_ops,
.fast_serialization,
.fp_extension,
@ -381,17 +380,17 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const z10 = Cpu{
.name = "z10",
.llvm_name = "z10",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const z13 = Cpu{
.name = "z13",
.llvm_name = "z13",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_packed_conversion,
.dfp_zoned_conversion,
.distinct_ops,
@ -419,7 +418,7 @@ pub const cpu = struct {
pub const z14 = Cpu{
.name = "z14",
.llvm_name = "z14",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_packed_conversion,
.dfp_zoned_conversion,
.distinct_ops,
@ -454,7 +453,7 @@ pub const cpu = struct {
pub const z196 = Cpu{
.name = "z196",
.llvm_name = "z196",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.distinct_ops,
.fast_serialization,
.fp_extension,
@ -470,7 +469,7 @@ pub const cpu = struct {
pub const zEC12 = Cpu{
.name = "zEC12",
.llvm_name = "zEC12",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.dfp_zoned_conversion,
.distinct_ops,
.enhanced_dat_2,

View File

@ -23,52 +23,52 @@ pub const all_features = blk: {
result[@enumToInt(Feature.atomics)] = .{
.llvm_name = "atomics",
.description = "Enable Atomics",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.bulk_memory)] = .{
.llvm_name = "bulk-memory",
.description = "Enable bulk memory operations",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.exception_handling)] = .{
.llvm_name = "exception-handling",
.description = "Enable Wasm exception handling",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.multivalue)] = .{
.llvm_name = "multivalue",
.description = "Enable multivalue blocks, instructions, and functions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.mutable_globals)] = .{
.llvm_name = "mutable-globals",
.description = "Enable mutable globals",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.nontrapping_fptoint)] = .{
.llvm_name = "nontrapping-fptoint",
.description = "Enable non-trapping float-to-int conversion operators",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.sign_ext)] = .{
.llvm_name = "sign-ext",
.description = "Enable sign extension operators",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.simd128)] = .{
.llvm_name = "simd128",
.description = "Enable 128-bit SIMD",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.tail_call)] = .{
.llvm_name = "tail-call",
.description = "Enable tail call instructions",
.dependencies = sparseFeatureSet(&[_]Feature{}),
.dependencies = featureSet(&[_]Feature{}),
};
result[@enumToInt(Feature.unimplemented_simd128)] = .{
.llvm_name = "unimplemented-simd128",
.description = "Enable 128-bit SIMD not yet implemented in engines",
.dependencies = sparseFeatureSet(&[_]Feature{
.dependencies = featureSet(&[_]Feature{
.simd128,
}),
};
@ -76,7 +76,6 @@ pub const all_features = blk: {
for (result) |*elem, i| {
elem.index = i;
elem.name = ti.Enum.fields[i].name;
elem.dependencies.initAsDependencies(i, &result);
}
break :blk result;
};
@ -85,7 +84,7 @@ pub const cpu = struct {
pub const bleeding_edge = Cpu{
.name = "bleeding_edge",
.llvm_name = "bleeding-edge",
.features = featureSet(&all_features, &[_]Feature{
.features = featureSet(&[_]Feature{
.atomics,
.mutable_globals,
.nontrapping_fptoint,
@ -96,12 +95,12 @@ pub const cpu = struct {
pub const generic = Cpu{
.name = "generic",
.llvm_name = "generic",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
pub const mvp = Cpu{
.name = "mvp",
.llvm_name = "mvp",
.features = featureSet(&all_features, &[_]Feature{}),
.features = featureSet(&[_]Feature{}),
};
};

File diff suppressed because it is too large Load Diff

View File

@ -581,8 +581,8 @@ fn cpuFeaturesFromLLVM(
const this_llvm_name = feature.llvm_name orelse continue;
if (mem.eql(u8, llvm_feat, this_llvm_name)) {
switch (op) {
.add => set.addSparseFeature(@intCast(u8, index)),
.sub => set.removeSparseFeature(@intCast(u8, index)),
.add => set.addFeature(@intCast(u8, index)),
.sub => set.removeFeature(@intCast(u8, index)),
}
break;
}
@ -701,8 +701,9 @@ const Stage2CpuFeatures = struct {
const all_features = arch.allFeaturesList();
var populated_feature_set = feature_set;
if (arch.subArchFeature()) |sub_arch_index| {
populated_feature_set.addFeature(sub_arch_index, all_features);
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)))];