diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-20 22:21:45 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-20 22:21:45 -0500 |
| commit | 6e88883edf8400b835f5d792b8aba54c8d4490f2 (patch) | |
| tree | 92260e9312bf86992782ee8cc5d8c7e24d9589d3 /lib | |
| parent | f3dd9bbdaca5ba3735feb405a890a4646905533a (diff) | |
| download | zig-6e88883edf8400b835f5d792b8aba54c8d4490f2.tar.gz zig-6e88883edf8400b835f5d792b8aba54c8d4490f2.zip | |
import data from llvm 9
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/target/aarch64.zig | 1348 | ||||
| -rw-r--r-- | lib/std/target/amdgpu.zig | 3654 | ||||
| -rw-r--r-- | lib/std/target/arm.zig | 4969 | ||||
| -rw-r--r-- | lib/std/target/avr.zig | 7230 | ||||
| -rw-r--r-- | lib/std/target/bpf.zig | 134 | ||||
| -rw-r--r-- | lib/std/target/hexagon.zig | 537 | ||||
| -rw-r--r-- | lib/std/target/mips.zig | 1428 | ||||
| -rw-r--r-- | lib/std/target/msp430.zig | 126 | ||||
| -rw-r--r-- | lib/std/target/nvptx.zig | 731 | ||||
| -rw-r--r-- | lib/std/target/powerpc.zig | 2148 | ||||
| -rw-r--r-- | lib/std/target/riscv.zig | 183 | ||||
| -rw-r--r-- | lib/std/target/sparc.zig | 1015 | ||||
| -rw-r--r-- | lib/std/target/systemz.zig | 1183 | ||||
| -rw-r--r-- | lib/std/target/wasm.zig | 239 | ||||
| -rw-r--r-- | lib/std/target/x86.zig | 1624 |
15 files changed, 11885 insertions, 14664 deletions
diff --git a/lib/std/target/aarch64.zig b/lib/std/target/aarch64.zig index f0238bf8f4..4d547b74c1 100644 --- a/lib/std/target/aarch64.zig +++ b/lib/std/target/aarch64.zig @@ -2,21 +2,23 @@ const std = @import("../std.zig"); const Cpu = std.Target.Cpu; pub const Feature = enum { + a35, + a53, + a55, + a57, + a72, + a73, + a75, + a76, aes, - am, aggressive_fma, - altnzcv, alternate_sextload_cvt_f32_pattern, + altnzcv, + am, arith_bcc_fusion, arith_cbz_fusion, balance_fp_ops, bti, - ccidx, - ccpp, - crc, - ccdp, - call_saved_x8, - call_saved_x9, call_saved_x10, call_saved_x11, call_saved_x12, @@ -24,56 +26,60 @@ pub const Feature = enum { call_saved_x14, call_saved_x15, call_saved_x18, + call_saved_x8, + call_saved_x9, + ccdp, + ccidx, + ccpp, complxnum, + crc, crypto, custom_cheap_as_move, - dit, + cyclone, disable_latency_sched_heuristic, + dit, dotprod, exynos_cheap_as_move, + exynosm1, + exynosm2, + exynosm3, + exynosm4, + falkor, fmi, - fp16fml, + force_32bit_jump_tables, fp_armv8, + fp16fml, fptoint, - force_32bit_jump_tables, fullfp16, - fuse_aes, fuse_address, + fuse_aes, fuse_arith_logic, - fuse_csel, fuse_crypto_eor, + fuse_csel, fuse_literals, jsconv, + kryo, lor, lse, lsl_fast, mpam, mte, neon, - nv, no_neg_immediates, + nv, pa, pan, pan_rwv, perfmon, - use_postra_scheduler, - predres, predictable_select_expensive, - uaops, + predres, + rand, ras, rasv8_4, rcpc, rcpc_immo, rdm, - rand, reserve_x1, - reserve_x2, - reserve_x3, - reserve_x4, - reserve_x5, - reserve_x6, - reserve_x7, - reserve_x9, reserve_x10, reserve_x11, reserve_x12, @@ -81,6 +87,7 @@ pub const Feature = enum { reserve_x14, reserve_x15, reserve_x18, + reserve_x2, reserve_x20, reserve_x21, reserve_x22, @@ -90,31 +97,51 @@ pub const Feature = enum { reserve_x26, reserve_x27, reserve_x28, + reserve_x3, + reserve_x4, + reserve_x5, + reserve_x6, + reserve_x7, + reserve_x9, + saphira, sb, sel2, sha2, sha3, + slow_misaligned_128store, + slow_paired_128, + slow_strqro_store, sm4, spe, + specrestrict, ssbs, + strict_align, sve, sve2, sve2_aes, sve2_bitperm, sve2_sha3, sve2_sm4, - slow_misaligned_128store, - slow_paired_128, - slow_strqro_store, - specrestrict, - strict_align, + thunderx, + thunderx2t99, + thunderxt81, + thunderxt83, + thunderxt88, tlb_rmi, - tracev84, - use_aa, tpidr_el1, tpidr_el2, tpidr_el3, + tracev8_4, + tsv110, + uaops, + use_aa, + use_postra_scheduler, use_reciprocal_square_root, + v8_1a, + v8_2a, + v8_3a, + v8_4a, + v8_5a, vh, zcm, zcz, @@ -129,22 +156,143 @@ pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.a35)] = .{ + .index = @enumToInt(Feature.a35), + .name = @tagName(Feature.a35), + .llvm_name = "a35", + .description = "Cortex-A35 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .neon, + .perfmon, + }), + }; + result[@enumToInt(Feature.a53)] = .{ + .index = @enumToInt(Feature.a53), + .name = @tagName(Feature.a53), + .llvm_name = "a53", + .description = "Cortex-A53 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .balance_fp_ops, + .crc, + .crypto, + .custom_cheap_as_move, + .fp_armv8, + .fuse_aes, + .neon, + .perfmon, + .use_aa, + .use_postra_scheduler, + }), + }; + result[@enumToInt(Feature.a55)] = .{ + .index = @enumToInt(Feature.a55), + .name = @tagName(Feature.a55), + .llvm_name = "a55", + .description = "Cortex-A55 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crypto, + .dotprod, + .fp_armv8, + .fullfp16, + .fuse_aes, + .neon, + .perfmon, + .rcpc, + .v8_2a, + }), + }; + result[@enumToInt(Feature.a57)] = .{ + .index = @enumToInt(Feature.a57), + .name = @tagName(Feature.a57), + .llvm_name = "a57", + .description = "Cortex-A57 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .balance_fp_ops, + .crc, + .crypto, + .custom_cheap_as_move, + .fp_armv8, + .fuse_aes, + .fuse_literals, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + }), + }; + result[@enumToInt(Feature.a72)] = .{ + .index = @enumToInt(Feature.a72), + .name = @tagName(Feature.a72), + .llvm_name = "a72", + .description = "Cortex-A72 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .fuse_aes, + .neon, + .perfmon, + }), + }; + result[@enumToInt(Feature.a73)] = .{ + .index = @enumToInt(Feature.a73), + .name = @tagName(Feature.a73), + .llvm_name = "a73", + .description = "Cortex-A73 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .fuse_aes, + .neon, + .perfmon, + }), + }; + result[@enumToInt(Feature.a75)] = .{ + .index = @enumToInt(Feature.a75), + .name = @tagName(Feature.a75), + .llvm_name = "a75", + .description = "Cortex-A75 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crypto, + .dotprod, + .fp_armv8, + .fullfp16, + .fuse_aes, + .neon, + .perfmon, + .rcpc, + .v8_2a, + }), + }; + result[@enumToInt(Feature.a76)] = .{ + .index = @enumToInt(Feature.a76), + .name = @tagName(Feature.a76), + .llvm_name = "a76", + .description = "Cortex-A76 ARM processors", + .dependencies = featureSet(&[_]Feature{ + .crypto, + .dotprod, + .fp_armv8, + .fullfp16, + .neon, + .rcpc, + .ssbs, + .v8_2a, + }), + }; result[@enumToInt(Feature.aes)] = .{ .index = @enumToInt(Feature.aes), .name = @tagName(Feature.aes), .llvm_name = "aes", .description = "Enable AES support", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .neon, }), }; - result[@enumToInt(Feature.am)] = .{ - .index = @enumToInt(Feature.am), - .name = @tagName(Feature.am), - .llvm_name = "am", - .description = "Enable v8.4-A Activity Monitors extension", - .dependencies = 0, - }; result[@enumToInt(Feature.aggressive_fma)] = .{ .index = @enumToInt(Feature.aggressive_fma), .name = @tagName(Feature.aggressive_fma), @@ -152,6 +300,13 @@ pub const all_features = blk: { .description = "Enable Aggressive FMA for floating-point.", .dependencies = 0, }; + result[@enumToInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{ + .index = @enumToInt(Feature.alternate_sextload_cvt_f32_pattern), + .name = @tagName(Feature.alternate_sextload_cvt_f32_pattern), + .llvm_name = "alternate-sextload-cvt-f32-pattern", + .description = "Use alternative pattern for sextload convert to f32", + .dependencies = 0, + }; result[@enumToInt(Feature.altnzcv)] = .{ .index = @enumToInt(Feature.altnzcv), .name = @tagName(Feature.altnzcv), @@ -159,11 +314,11 @@ pub const all_features = blk: { .description = "Enable alternative NZCV format for floating point comparisons", .dependencies = 0, }; - result[@enumToInt(Feature.alternate_sextload_cvt_f32_pattern)] = .{ - .index = @enumToInt(Feature.alternate_sextload_cvt_f32_pattern), - .name = @tagName(Feature.alternate_sextload_cvt_f32_pattern), - .llvm_name = "alternate-sextload-cvt-f32-pattern", - .description = "Use alternative pattern for sextload convert to f32", + result[@enumToInt(Feature.am)] = .{ + .index = @enumToInt(Feature.am), + .name = @tagName(Feature.am), + .llvm_name = "am", + .description = "Enable v8.4-A Activity Monitors extension", .dependencies = 0, }; result[@enumToInt(Feature.arith_bcc_fusion)] = .{ @@ -194,48 +349,6 @@ pub const all_features = blk: { .description = "Enable Branch Target Identification", .dependencies = 0, }; - result[@enumToInt(Feature.ccidx)] = .{ - .index = @enumToInt(Feature.ccidx), - .name = @tagName(Feature.ccidx), - .llvm_name = "ccidx", - .description = "Enable v8.3-A Extend of the CCSIDR number of sets", - .dependencies = 0, - }; - result[@enumToInt(Feature.ccpp)] = .{ - .index = @enumToInt(Feature.ccpp), - .name = @tagName(Feature.ccpp), - .llvm_name = "ccpp", - .description = "Enable v8.2 data Cache Clean to Point of Persistence", - .dependencies = 0, - }; - result[@enumToInt(Feature.crc)] = .{ - .index = @enumToInt(Feature.crc), - .name = @tagName(Feature.crc), - .llvm_name = "crc", - .description = "Enable ARMv8 CRC-32 checksum instructions", - .dependencies = 0, - }; - result[@enumToInt(Feature.ccdp)] = .{ - .index = @enumToInt(Feature.ccdp), - .name = @tagName(Feature.ccdp), - .llvm_name = "ccdp", - .description = "Enable v8.5 Cache Clean to Point of Deep Persistence", - .dependencies = 0, - }; - result[@enumToInt(Feature.call_saved_x8)] = .{ - .index = @enumToInt(Feature.call_saved_x8), - .name = @tagName(Feature.call_saved_x8), - .llvm_name = "call-saved-x8", - .description = "Make X8 callee saved.", - .dependencies = 0, - }; - result[@enumToInt(Feature.call_saved_x9)] = .{ - .index = @enumToInt(Feature.call_saved_x9), - .name = @tagName(Feature.call_saved_x9), - .llvm_name = "call-saved-x9", - .description = "Make X9 callee saved.", - .dependencies = 0, - }; result[@enumToInt(Feature.call_saved_x10)] = .{ .index = @enumToInt(Feature.call_saved_x10), .name = @tagName(Feature.call_saved_x10), @@ -285,22 +398,66 @@ pub const all_features = blk: { .description = "Make X18 callee saved.", .dependencies = 0, }; + result[@enumToInt(Feature.call_saved_x8)] = .{ + .index = @enumToInt(Feature.call_saved_x8), + .name = @tagName(Feature.call_saved_x8), + .llvm_name = "call-saved-x8", + .description = "Make X8 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.call_saved_x9)] = .{ + .index = @enumToInt(Feature.call_saved_x9), + .name = @tagName(Feature.call_saved_x9), + .llvm_name = "call-saved-x9", + .description = "Make X9 callee saved.", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccdp)] = .{ + .index = @enumToInt(Feature.ccdp), + .name = @tagName(Feature.ccdp), + .llvm_name = "ccdp", + .description = "Enable v8.5 Cache Clean to Point of Deep Persistence", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccidx)] = .{ + .index = @enumToInt(Feature.ccidx), + .name = @tagName(Feature.ccidx), + .llvm_name = "ccidx", + .description = "Enable v8.3-A Extend of the CCSIDR number of sets", + .dependencies = 0, + }; + result[@enumToInt(Feature.ccpp)] = .{ + .index = @enumToInt(Feature.ccpp), + .name = @tagName(Feature.ccpp), + .llvm_name = "ccpp", + .description = "Enable v8.2 data Cache Clean to Point of Persistence", + .dependencies = 0, + }; result[@enumToInt(Feature.complxnum)] = .{ .index = @enumToInt(Feature.complxnum), .name = @tagName(Feature.complxnum), .llvm_name = "complxnum", .description = "Enable v8.3-A Floating-point complex number support", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .neon, }), }; + result[@enumToInt(Feature.crc)] = .{ + .index = @enumToInt(Feature.crc), + .name = @tagName(Feature.crc), + .llvm_name = "crc", + .description = "Enable ARMv8 CRC-32 checksum instructions", + .dependencies = 0, + }; result[@enumToInt(Feature.crypto)] = .{ .index = @enumToInt(Feature.crypto), .name = @tagName(Feature.crypto), .llvm_name = "crypto", .description = "Enable cryptographic instructions", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .aes, + .neon, + .sha2, }), }; result[@enumToInt(Feature.custom_cheap_as_move)] = .{ @@ -310,12 +467,26 @@ pub const all_features = blk: { .description = "Use custom handling of cheap instructions", .dependencies = 0, }; - result[@enumToInt(Feature.dit)] = .{ - .index = @enumToInt(Feature.dit), - .name = @tagName(Feature.dit), - .llvm_name = "dit", - .description = "Enable v8.4-A Data Independent Timing instructions", - .dependencies = 0, + result[@enumToInt(Feature.cyclone)] = .{ + .index = @enumToInt(Feature.cyclone), + .name = @tagName(Feature.cyclone), + .llvm_name = "cyclone", + .description = "Cyclone", + .dependencies = featureSet(&[_]Feature{ + .alternate_sextload_cvt_f32_pattern, + .arith_bcc_fusion, + .arith_cbz_fusion, + .crypto, + .disable_latency_sched_heuristic, + .fp_armv8, + .fuse_aes, + .fuse_crypto_eor, + .neon, + .perfmon, + .zcm, + .zcz, + .zcz_fp_workaround, + }), }; result[@enumToInt(Feature.disable_latency_sched_heuristic)] = .{ .index = @enumToInt(Feature.disable_latency_sched_heuristic), @@ -324,6 +495,13 @@ pub const all_features = blk: { .description = "Disable latency scheduling heuristic", .dependencies = 0, }; + result[@enumToInt(Feature.dit)] = .{ + .index = @enumToInt(Feature.dit), + .name = @tagName(Feature.dit), + .llvm_name = "dit", + .description = "Enable v8.4-A Data Independent Timing instructions", + .dependencies = 0, + }; result[@enumToInt(Feature.dotprod)] = .{ .index = @enumToInt(Feature.dotprod), .name = @tagName(Feature.dotprod), @@ -340,6 +518,109 @@ pub const all_features = blk: { .custom_cheap_as_move, }), }; + result[@enumToInt(Feature.exynosm1)] = .{ + .index = @enumToInt(Feature.exynosm1), + .name = @tagName(Feature.exynosm1), + .llvm_name = "exynosm1", + .description = "Samsung Exynos-M1 processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .exynos_cheap_as_move, + .force_32bit_jump_tables, + .fuse_aes, + .perfmon, + .slow_misaligned_128store, + .slow_paired_128, + .use_postra_scheduler, + .use_reciprocal_square_root, + .zcz_fp, + }), + }; + result[@enumToInt(Feature.exynosm2)] = .{ + .index = @enumToInt(Feature.exynosm2), + .name = @tagName(Feature.exynosm2), + .llvm_name = "exynosm2", + .description = "Samsung Exynos-M2 processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .exynos_cheap_as_move, + .force_32bit_jump_tables, + .fuse_aes, + .perfmon, + .slow_misaligned_128store, + .slow_paired_128, + .use_postra_scheduler, + .zcz_fp, + }), + }; + result[@enumToInt(Feature.exynosm3)] = .{ + .index = @enumToInt(Feature.exynosm3), + .name = @tagName(Feature.exynosm3), + .llvm_name = "exynosm3", + .description = "Samsung Exynos-M3 processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .exynos_cheap_as_move, + .force_32bit_jump_tables, + .fuse_address, + .fuse_aes, + .fuse_csel, + .fuse_literals, + .lsl_fast, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + .zcz_fp, + }), + }; + result[@enumToInt(Feature.exynosm4)] = .{ + .index = @enumToInt(Feature.exynosm4), + .name = @tagName(Feature.exynosm4), + .llvm_name = "exynosm4", + .description = "Samsung Exynos-M4 processors", + .dependencies = featureSet(&[_]Feature{ + .arith_bcc_fusion, + .arith_cbz_fusion, + .crypto, + .dotprod, + .exynos_cheap_as_move, + .force_32bit_jump_tables, + .fullfp16, + .fuse_address, + .fuse_aes, + .fuse_arith_logic, + .fuse_csel, + .fuse_literals, + .lsl_fast, + .perfmon, + .use_postra_scheduler, + .v8_2a, + .zcz, + }), + }; + result[@enumToInt(Feature.falkor)] = .{ + .index = @enumToInt(Feature.falkor), + .name = @tagName(Feature.falkor), + .llvm_name = "falkor", + .description = "Qualcomm Falkor processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .custom_cheap_as_move, + .fp_armv8, + .lsl_fast, + .neon, + .perfmon, + .predictable_select_expensive, + .rdm, + .slow_strqro_store, + .use_postra_scheduler, + .zcz, + }), + }; result[@enumToInt(Feature.fmi)] = .{ .index = @enumToInt(Feature.fmi), .name = @tagName(Feature.fmi), @@ -347,14 +628,12 @@ pub const all_features = blk: { .description = "Enable v8.4-A Flag Manipulation Instructions", .dependencies = 0, }; - result[@enumToInt(Feature.fp16fml)] = .{ - .index = @enumToInt(Feature.fp16fml), - .name = @tagName(Feature.fp16fml), - .llvm_name = "fp16fml", - .description = "Enable FP16 FML instructions", - .dependencies = featureSet(&[_]Feature{ - .fp_armv8, - }), + result[@enumToInt(Feature.force_32bit_jump_tables)] = .{ + .index = @enumToInt(Feature.force_32bit_jump_tables), + .name = @tagName(Feature.force_32bit_jump_tables), + .llvm_name = "force-32bit-jump-tables", + .description = "Force jump table entries to be 32-bits wide except at MinSize", + .dependencies = 0, }; result[@enumToInt(Feature.fp_armv8)] = .{ .index = @enumToInt(Feature.fp_armv8), @@ -363,6 +642,15 @@ pub const all_features = blk: { .description = "Enable ARMv8 FP", .dependencies = 0, }; + result[@enumToInt(Feature.fp16fml)] = .{ + .index = @enumToInt(Feature.fp16fml), + .name = @tagName(Feature.fp16fml), + .llvm_name = "fp16fml", + .description = "Enable FP16 FML instructions", + .dependencies = featureSet(&[_]Feature{ + .fullfp16, + }), + }; result[@enumToInt(Feature.fptoint)] = .{ .index = @enumToInt(Feature.fptoint), .name = @tagName(Feature.fptoint), @@ -370,13 +658,6 @@ pub const all_features = blk: { .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int", .dependencies = 0, }; - result[@enumToInt(Feature.force_32bit_jump_tables)] = .{ - .index = @enumToInt(Feature.force_32bit_jump_tables), - .name = @tagName(Feature.force_32bit_jump_tables), - .llvm_name = "force-32bit-jump-tables", - .description = "Force jump table entries to be 32-bits wide except at MinSize", - .dependencies = 0, - }; result[@enumToInt(Feature.fullfp16)] = .{ .index = @enumToInt(Feature.fullfp16), .name = @tagName(Feature.fullfp16), @@ -386,13 +667,6 @@ pub const all_features = blk: { .fp_armv8, }), }; - result[@enumToInt(Feature.fuse_aes)] = .{ - .index = @enumToInt(Feature.fuse_aes), - .name = @tagName(Feature.fuse_aes), - .llvm_name = "fuse-aes", - .description = "CPU fuses AES crypto operations", - .dependencies = 0, - }; result[@enumToInt(Feature.fuse_address)] = .{ .index = @enumToInt(Feature.fuse_address), .name = @tagName(Feature.fuse_address), @@ -400,6 +674,13 @@ pub const all_features = blk: { .description = "CPU fuses address generation and memory operations", .dependencies = 0, }; + result[@enumToInt(Feature.fuse_aes)] = .{ + .index = @enumToInt(Feature.fuse_aes), + .name = @tagName(Feature.fuse_aes), + .llvm_name = "fuse-aes", + .description = "CPU fuses AES crypto operations", + .dependencies = 0, + }; result[@enumToInt(Feature.fuse_arith_logic)] = .{ .index = @enumToInt(Feature.fuse_arith_logic), .name = @tagName(Feature.fuse_arith_logic), @@ -407,13 +688,6 @@ pub const all_features = blk: { .description = "CPU fuses arithmetic and logic operations", .dependencies = 0, }; - result[@enumToInt(Feature.fuse_csel)] = .{ - .index = @enumToInt(Feature.fuse_csel), - .name = @tagName(Feature.fuse_csel), - .llvm_name = "fuse-csel", - .description = "CPU fuses conditional select operations", - .dependencies = 0, - }; result[@enumToInt(Feature.fuse_crypto_eor)] = .{ .index = @enumToInt(Feature.fuse_crypto_eor), .name = @tagName(Feature.fuse_crypto_eor), @@ -421,6 +695,13 @@ pub const all_features = blk: { .description = "CPU fuses AES/PMULL and EOR operations", .dependencies = 0, }; + result[@enumToInt(Feature.fuse_csel)] = .{ + .index = @enumToInt(Feature.fuse_csel), + .name = @tagName(Feature.fuse_csel), + .llvm_name = "fuse-csel", + .description = "CPU fuses conditional select operations", + .dependencies = 0, + }; result[@enumToInt(Feature.fuse_literals)] = .{ .index = @enumToInt(Feature.fuse_literals), .name = @tagName(Feature.fuse_literals), @@ -437,6 +718,24 @@ pub const all_features = blk: { .fp_armv8, }), }; + result[@enumToInt(Feature.kryo)] = .{ + .index = @enumToInt(Feature.kryo), + .name = @tagName(Feature.kryo), + .llvm_name = "kryo", + .description = "Qualcomm Kryo processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .custom_cheap_as_move, + .fp_armv8, + .lsl_fast, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + .zcz, + }), + }; result[@enumToInt(Feature.lor)] = .{ .index = @enumToInt(Feature.lor), .name = @tagName(Feature.lor), @@ -481,13 +780,6 @@ pub const all_features = blk: { .fp_armv8, }), }; - result[@enumToInt(Feature.nv)] = .{ - .index = @enumToInt(Feature.nv), - .name = @tagName(Feature.nv), - .llvm_name = "nv", - .description = "Enable v8.4-A Nested Virtualization Enchancement", - .dependencies = 0, - }; result[@enumToInt(Feature.no_neg_immediates)] = .{ .index = @enumToInt(Feature.no_neg_immediates), .name = @tagName(Feature.no_neg_immediates), @@ -495,6 +787,13 @@ pub const all_features = blk: { .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", .dependencies = 0, }; + result[@enumToInt(Feature.nv)] = .{ + .index = @enumToInt(Feature.nv), + .name = @tagName(Feature.nv), + .llvm_name = "nv", + .description = "Enable v8.4-A Nested Virtualization Enchancement", + .dependencies = 0, + }; result[@enumToInt(Feature.pa)] = .{ .index = @enumToInt(Feature.pa), .name = @tagName(Feature.pa), @@ -525,11 +824,11 @@ pub const all_features = blk: { .description = "Enable ARMv8 PMUv3 Performance Monitors extension", .dependencies = 0, }; - result[@enumToInt(Feature.use_postra_scheduler)] = .{ - .index = @enumToInt(Feature.use_postra_scheduler), - .name = @tagName(Feature.use_postra_scheduler), - .llvm_name = "use-postra-scheduler", - .description = "Schedule again after register allocation", + result[@enumToInt(Feature.predictable_select_expensive)] = .{ + .index = @enumToInt(Feature.predictable_select_expensive), + .name = @tagName(Feature.predictable_select_expensive), + .llvm_name = "predictable-select-expensive", + .description = "Prefer likely predicted branches over selects", .dependencies = 0, }; result[@enumToInt(Feature.predres)] = .{ @@ -539,18 +838,11 @@ pub const all_features = blk: { .description = "Enable v8.5a execution and data prediction invalidation instructions", .dependencies = 0, }; - result[@enumToInt(Feature.predictable_select_expensive)] = .{ - .index = @enumToInt(Feature.predictable_select_expensive), - .name = @tagName(Feature.predictable_select_expensive), - .llvm_name = "predictable-select-expensive", - .description = "Prefer likely predicted branches over selects", - .dependencies = 0, - }; - result[@enumToInt(Feature.uaops)] = .{ - .index = @enumToInt(Feature.uaops), - .name = @tagName(Feature.uaops), - .llvm_name = "uaops", - .description = "Enable v8.2 UAO PState", + result[@enumToInt(Feature.rand)] = .{ + .index = @enumToInt(Feature.rand), + .name = @tagName(Feature.rand), + .llvm_name = "rand", + .description = "Enable Random Number generation instructions", .dependencies = 0, }; result[@enumToInt(Feature.ras)] = .{ @@ -592,13 +884,6 @@ pub const all_features = blk: { .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions", .dependencies = 0, }; - result[@enumToInt(Feature.rand)] = .{ - .index = @enumToInt(Feature.rand), - .name = @tagName(Feature.rand), - .llvm_name = "rand", - .description = "Enable Random Number generation instructions", - .dependencies = 0, - }; result[@enumToInt(Feature.reserve_x1)] = .{ .index = @enumToInt(Feature.reserve_x1), .name = @tagName(Feature.reserve_x1), @@ -606,55 +891,6 @@ pub const all_features = blk: { .description = "Reserve X1, making it unavailable as a GPR", .dependencies = 0, }; - result[@enumToInt(Feature.reserve_x2)] = .{ - .index = @enumToInt(Feature.reserve_x2), - .name = @tagName(Feature.reserve_x2), - .llvm_name = "reserve-x2", - .description = "Reserve X2, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x3)] = .{ - .index = @enumToInt(Feature.reserve_x3), - .name = @tagName(Feature.reserve_x3), - .llvm_name = "reserve-x3", - .description = "Reserve X3, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x4)] = .{ - .index = @enumToInt(Feature.reserve_x4), - .name = @tagName(Feature.reserve_x4), - .llvm_name = "reserve-x4", - .description = "Reserve X4, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x5)] = .{ - .index = @enumToInt(Feature.reserve_x5), - .name = @tagName(Feature.reserve_x5), - .llvm_name = "reserve-x5", - .description = "Reserve X5, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x6)] = .{ - .index = @enumToInt(Feature.reserve_x6), - .name = @tagName(Feature.reserve_x6), - .llvm_name = "reserve-x6", - .description = "Reserve X6, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x7)] = .{ - .index = @enumToInt(Feature.reserve_x7), - .name = @tagName(Feature.reserve_x7), - .llvm_name = "reserve-x7", - .description = "Reserve X7, making it unavailable as a GPR", - .dependencies = 0, - }; - result[@enumToInt(Feature.reserve_x9)] = .{ - .index = @enumToInt(Feature.reserve_x9), - .name = @tagName(Feature.reserve_x9), - .llvm_name = "reserve-x9", - .description = "Reserve X9, making it unavailable as a GPR", - .dependencies = 0, - }; result[@enumToInt(Feature.reserve_x10)] = .{ .index = @enumToInt(Feature.reserve_x10), .name = @tagName(Feature.reserve_x10), @@ -704,6 +940,13 @@ pub const all_features = blk: { .description = "Reserve X18, making it unavailable as a GPR", .dependencies = 0, }; + result[@enumToInt(Feature.reserve_x2)] = .{ + .index = @enumToInt(Feature.reserve_x2), + .name = @tagName(Feature.reserve_x2), + .llvm_name = "reserve-x2", + .description = "Reserve X2, making it unavailable as a GPR", + .dependencies = 0, + }; result[@enumToInt(Feature.reserve_x20)] = .{ .index = @enumToInt(Feature.reserve_x20), .name = @tagName(Feature.reserve_x20), @@ -767,6 +1010,67 @@ pub const all_features = blk: { .description = "Reserve X28, making it unavailable as a GPR", .dependencies = 0, }; + result[@enumToInt(Feature.reserve_x3)] = .{ + .index = @enumToInt(Feature.reserve_x3), + .name = @tagName(Feature.reserve_x3), + .llvm_name = "reserve-x3", + .description = "Reserve X3, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x4)] = .{ + .index = @enumToInt(Feature.reserve_x4), + .name = @tagName(Feature.reserve_x4), + .llvm_name = "reserve-x4", + .description = "Reserve X4, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x5)] = .{ + .index = @enumToInt(Feature.reserve_x5), + .name = @tagName(Feature.reserve_x5), + .llvm_name = "reserve-x5", + .description = "Reserve X5, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x6)] = .{ + .index = @enumToInt(Feature.reserve_x6), + .name = @tagName(Feature.reserve_x6), + .llvm_name = "reserve-x6", + .description = "Reserve X6, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x7)] = .{ + .index = @enumToInt(Feature.reserve_x7), + .name = @tagName(Feature.reserve_x7), + .llvm_name = "reserve-x7", + .description = "Reserve X7, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_x9)] = .{ + .index = @enumToInt(Feature.reserve_x9), + .name = @tagName(Feature.reserve_x9), + .llvm_name = "reserve-x9", + .description = "Reserve X9, making it unavailable as a GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.saphira)] = .{ + .index = @enumToInt(Feature.saphira), + .name = @tagName(Feature.saphira), + .llvm_name = "saphira", + .description = "Qualcomm Saphira processors", + .dependencies = featureSet(&[_]Feature{ + .crypto, + .custom_cheap_as_move, + .fp_armv8, + .lsl_fast, + .neon, + .perfmon, + .predictable_select_expensive, + .spe, + .use_postra_scheduler, + .v8_4a, + .zcz, + }), + }; result[@enumToInt(Feature.sb)] = .{ .index = @enumToInt(Feature.sb), .name = @tagName(Feature.sb), @@ -787,7 +1091,7 @@ pub const all_features = blk: { .llvm_name = "sha2", .description = "Enable SHA1 and SHA256 support", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .neon, }), }; result[@enumToInt(Feature.sha3)] = .{ @@ -796,16 +1100,38 @@ pub const all_features = blk: { .llvm_name = "sha3", .description = "Enable SHA512 and SHA3 support", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .neon, + .sha2, }), }; + result[@enumToInt(Feature.slow_misaligned_128store)] = .{ + .index = @enumToInt(Feature.slow_misaligned_128store), + .name = @tagName(Feature.slow_misaligned_128store), + .llvm_name = "slow-misaligned-128store", + .description = "Misaligned 128 bit stores are slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_paired_128)] = .{ + .index = @enumToInt(Feature.slow_paired_128), + .name = @tagName(Feature.slow_paired_128), + .llvm_name = "slow-paired-128", + .description = "Paired 128 bit loads and stores are slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_strqro_store)] = .{ + .index = @enumToInt(Feature.slow_strqro_store), + .name = @tagName(Feature.slow_strqro_store), + .llvm_name = "slow-strqro-store", + .description = "STR of Q register with register offset is slow", + .dependencies = 0, + }; result[@enumToInt(Feature.sm4)] = .{ .index = @enumToInt(Feature.sm4), .name = @tagName(Feature.sm4), .llvm_name = "sm4", .description = "Enable SM3 and SM4 support", .dependencies = featureSet(&[_]Feature{ - .fp_armv8, + .neon, }), }; result[@enumToInt(Feature.spe)] = .{ @@ -815,6 +1141,13 @@ pub const all_features = blk: { .description = "Enable Statistical Profiling extension", .dependencies = 0, }; + result[@enumToInt(Feature.specrestrict)] = .{ + .index = @enumToInt(Feature.specrestrict), + .name = @tagName(Feature.specrestrict), + .llvm_name = "specrestrict", + .description = "Enable architectural speculation restriction", + .dependencies = 0, + }; result[@enumToInt(Feature.ssbs)] = .{ .index = @enumToInt(Feature.ssbs), .name = @tagName(Feature.ssbs), @@ -822,6 +1155,13 @@ pub const all_features = blk: { .description = "Enable Speculative Store Bypass Safe bit", .dependencies = 0, }; + result[@enumToInt(Feature.strict_align)] = .{ + .index = @enumToInt(Feature.strict_align), + .name = @tagName(Feature.strict_align), + .llvm_name = "strict-align", + .description = "Disallow all unaligned memory access", + .dependencies = 0, + }; result[@enumToInt(Feature.sve)] = .{ .index = @enumToInt(Feature.sve), .name = @tagName(Feature.sve), @@ -844,8 +1184,8 @@ pub const all_features = blk: { .llvm_name = "sve2-aes", .description = "Enable AES SVE2 instructions", .dependencies = featureSet(&[_]Feature{ - .sve, - .fp_armv8, + .aes, + .sve2, }), }; result[@enumToInt(Feature.sve2_bitperm)] = .{ @@ -854,7 +1194,7 @@ pub const all_features = blk: { .llvm_name = "sve2-bitperm", .description = "Enable bit permutation SVE2 instructions", .dependencies = featureSet(&[_]Feature{ - .sve, + .sve2, }), }; result[@enumToInt(Feature.sve2_sha3)] = .{ @@ -863,8 +1203,8 @@ pub const all_features = blk: { .llvm_name = "sve2-sha3", .description = "Enable SHA3 SVE2 instructions", .dependencies = featureSet(&[_]Feature{ - .sve, - .fp_armv8, + .sha3, + .sve2, }), }; result[@enumToInt(Feature.sve2_sm4)] = .{ @@ -873,44 +1213,87 @@ pub const all_features = blk: { .llvm_name = "sve2-sm4", .description = "Enable SM4 SVE2 instructions", .dependencies = featureSet(&[_]Feature{ - .sve, - .fp_armv8, + .sm4, + .sve2, }), }; - result[@enumToInt(Feature.slow_misaligned_128store)] = .{ - .index = @enumToInt(Feature.slow_misaligned_128store), - .name = @tagName(Feature.slow_misaligned_128store), - .llvm_name = "slow-misaligned-128store", - .description = "Misaligned 128 bit stores are slow", - .dependencies = 0, + result[@enumToInt(Feature.thunderx)] = .{ + .index = @enumToInt(Feature.thunderx), + .name = @tagName(Feature.thunderx), + .llvm_name = "thunderx", + .description = "Cavium ThunderX processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + }), }; - result[@enumToInt(Feature.slow_paired_128)] = .{ - .index = @enumToInt(Feature.slow_paired_128), - .name = @tagName(Feature.slow_paired_128), - .llvm_name = "slow-paired-128", - .description = "Paired 128 bit loads and stores are slow", - .dependencies = 0, + result[@enumToInt(Feature.thunderx2t99)] = .{ + .index = @enumToInt(Feature.thunderx2t99), + .name = @tagName(Feature.thunderx2t99), + .llvm_name = "thunderx2t99", + .description = "Cavium ThunderX2 processors", + .dependencies = featureSet(&[_]Feature{ + .aggressive_fma, + .arith_bcc_fusion, + .crc, + .crypto, + .fp_armv8, + .lse, + .neon, + .predictable_select_expensive, + .use_postra_scheduler, + .v8_1a, + }), }; - result[@enumToInt(Feature.slow_strqro_store)] = .{ - .index = @enumToInt(Feature.slow_strqro_store), - .name = @tagName(Feature.slow_strqro_store), - .llvm_name = "slow-strqro-store", - .description = "STR of Q register with register offset is slow", - .dependencies = 0, + result[@enumToInt(Feature.thunderxt81)] = .{ + .index = @enumToInt(Feature.thunderxt81), + .name = @tagName(Feature.thunderxt81), + .llvm_name = "thunderxt81", + .description = "Cavium ThunderX processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + }), }; - result[@enumToInt(Feature.specrestrict)] = .{ - .index = @enumToInt(Feature.specrestrict), - .name = @tagName(Feature.specrestrict), - .llvm_name = "specrestrict", - .description = "Enable architectural speculation restriction", - .dependencies = 0, + result[@enumToInt(Feature.thunderxt83)] = .{ + .index = @enumToInt(Feature.thunderxt83), + .name = @tagName(Feature.thunderxt83), + .llvm_name = "thunderxt83", + .description = "Cavium ThunderX processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + }), }; - result[@enumToInt(Feature.strict_align)] = .{ - .index = @enumToInt(Feature.strict_align), - .name = @tagName(Feature.strict_align), - .llvm_name = "strict-align", - .description = "Disallow all unaligned memory access", - .dependencies = 0, + result[@enumToInt(Feature.thunderxt88)] = .{ + .index = @enumToInt(Feature.thunderxt88), + .name = @tagName(Feature.thunderxt88), + .llvm_name = "thunderxt88", + .description = "Cavium ThunderX processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .fp_armv8, + .neon, + .perfmon, + .predictable_select_expensive, + .use_postra_scheduler, + }), }; result[@enumToInt(Feature.tlb_rmi)] = .{ .index = @enumToInt(Feature.tlb_rmi), @@ -919,20 +1302,6 @@ pub const all_features = blk: { .description = "Enable v8.4-A TLB Range and Maintenance Instructions", .dependencies = 0, }; - result[@enumToInt(Feature.tracev84)] = .{ - .index = @enumToInt(Feature.tracev84), - .name = @tagName(Feature.tracev84), - .llvm_name = "tracev8.4", - .description = "Enable v8.4-A Trace extension", - .dependencies = 0, - }; - result[@enumToInt(Feature.use_aa)] = .{ - .index = @enumToInt(Feature.use_aa), - .name = @tagName(Feature.use_aa), - .llvm_name = "use-aa", - .description = "Use alias analysis during codegen", - .dependencies = 0, - }; result[@enumToInt(Feature.tpidr_el1)] = .{ .index = @enumToInt(Feature.tpidr_el1), .name = @tagName(Feature.tpidr_el1), @@ -954,6 +1323,54 @@ pub const all_features = blk: { .description = "Permit use of TPIDR_EL3 for the TLS base", .dependencies = 0, }; + result[@enumToInt(Feature.tracev8_4)] = .{ + .index = @enumToInt(Feature.tracev8_4), + .name = @tagName(Feature.tracev8_4), + .llvm_name = "tracev8.4", + .description = "Enable v8.4-A Trace extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.tsv110)] = .{ + .index = @enumToInt(Feature.tsv110), + .name = @tagName(Feature.tsv110), + .llvm_name = "tsv110", + .description = "HiSilicon TS-V110 processors", + .dependencies = featureSet(&[_]Feature{ + .crypto, + .custom_cheap_as_move, + .dotprod, + .fp_armv8, + .fp16fml, + .fullfp16, + .fuse_aes, + .neon, + .perfmon, + .spe, + .use_postra_scheduler, + .v8_2a, + }), + }; + result[@enumToInt(Feature.uaops)] = .{ + .index = @enumToInt(Feature.uaops), + .name = @tagName(Feature.uaops), + .llvm_name = "uaops", + .description = "Enable v8.2 UAO PState", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_aa)] = .{ + .index = @enumToInt(Feature.use_aa), + .name = @tagName(Feature.use_aa), + .llvm_name = "use-aa", + .description = "Use alias analysis during codegen", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_postra_scheduler)] = .{ + .index = @enumToInt(Feature.use_postra_scheduler), + .name = @tagName(Feature.use_postra_scheduler), + .llvm_name = "use-postra-scheduler", + .description = "Schedule again after register allocation", + .dependencies = 0, + }; result[@enumToInt(Feature.use_reciprocal_square_root)] = .{ .index = @enumToInt(Feature.use_reciprocal_square_root), .name = @tagName(Feature.use_reciprocal_square_root), @@ -961,6 +1378,84 @@ pub const all_features = blk: { .description = "Use the reciprocal square root approximation", .dependencies = 0, }; + result[@enumToInt(Feature.v8_1a)] = .{ + .index = @enumToInt(Feature.v8_1a), + .name = @tagName(Feature.v8_1a), + .llvm_name = "v8.1a", + .description = "Support ARM v8.1a instructions", + .dependencies = featureSet(&[_]Feature{ + .crc, + .lor, + .lse, + .pan, + .rdm, + .vh, + }), + }; + result[@enumToInt(Feature.v8_2a)] = .{ + .index = @enumToInt(Feature.v8_2a), + .name = @tagName(Feature.v8_2a), + .llvm_name = "v8.2a", + .description = "Support ARM v8.2a instructions", + .dependencies = featureSet(&[_]Feature{ + .ccpp, + .pan_rwv, + .ras, + .uaops, + .v8_1a, + }), + }; + result[@enumToInt(Feature.v8_3a)] = .{ + .index = @enumToInt(Feature.v8_3a), + .name = @tagName(Feature.v8_3a), + .llvm_name = "v8.3a", + .description = "Support ARM v8.3a instructions", + .dependencies = featureSet(&[_]Feature{ + .ccidx, + .complxnum, + .jsconv, + .pa, + .rcpc, + .v8_2a, + }), + }; + result[@enumToInt(Feature.v8_4a)] = .{ + .index = @enumToInt(Feature.v8_4a), + .name = @tagName(Feature.v8_4a), + .llvm_name = "v8.4a", + .description = "Support ARM v8.4a instructions", + .dependencies = featureSet(&[_]Feature{ + .am, + .dit, + .dotprod, + .fmi, + .mpam, + .nv, + .rasv8_4, + .rcpc_immo, + .sel2, + .tlb_rmi, + .tracev8_4, + .v8_3a, + }), + }; + result[@enumToInt(Feature.v8_5a)] = .{ + .index = @enumToInt(Feature.v8_5a), + .name = @tagName(Feature.v8_5a), + .llvm_name = "v8.5a", + .description = "Support ARM v8.5a instructions", + .dependencies = featureSet(&[_]Feature{ + .altnzcv, + .bti, + .ccdp, + .fptoint, + .predres, + .sb, + .specrestrict, + .ssbs, + .v8_4a, + }), + }; result[@enumToInt(Feature.vh)] = .{ .index = @enumToInt(Feature.vh), .name = @tagName(Feature.vh), @@ -1014,322 +1509,121 @@ pub const cpu = struct { .name = "apple_latest", .llvm_name = "apple-latest", .features = featureSet(&[_]Feature{ - .arith_cbz_fusion, - .zcz_fp_workaround, - .alternate_sextload_cvt_f32_pattern, - .fuse_crypto_eor, - .zcm, - .zcz_gp, - .perfmon, - .disable_latency_sched_heuristic, - .fp_armv8, - .zcz_fp, - .arith_bcc_fusion, - .fuse_aes, + .cyclone, }), }; - pub const cortex_a35 = Cpu{ .name = "cortex_a35", .llvm_name = "cortex-a35", .features = featureSet(&[_]Feature{ - .perfmon, - .fp_armv8, - .crc, + .a35, }), }; - pub const cortex_a53 = Cpu{ .name = "cortex_a53", .llvm_name = "cortex-a53", .features = featureSet(&[_]Feature{ - .custom_cheap_as_move, - .crc, - .perfmon, - .use_aa, - .fp_armv8, - .fuse_aes, - .balance_fp_ops, - .use_postra_scheduler, + .a53, }), }; - pub const cortex_a55 = Cpu{ .name = "cortex_a55", .llvm_name = "cortex-a55", .features = featureSet(&[_]Feature{ - .ccpp, - .rcpc, - .uaops, - .rdm, - .ras, - .lse, - .crc, - .perfmon, - .fp_armv8, - .vh, - .fuse_aes, - .lor, - .dotprod, - .pan, + .a55, }), }; - pub const cortex_a57 = Cpu{ .name = "cortex_a57", .llvm_name = "cortex-a57", .features = featureSet(&[_]Feature{ - .fuse_literals, - .predictable_select_expensive, - .custom_cheap_as_move, - .crc, - .perfmon, - .fp_armv8, - .fuse_aes, - .balance_fp_ops, - .use_postra_scheduler, + .a57, }), }; - pub const cortex_a72 = Cpu{ .name = "cortex_a72", .llvm_name = "cortex-a72", .features = featureSet(&[_]Feature{ - .fuse_aes, - .fp_armv8, - .perfmon, - .crc, + .a72, }), }; - pub const cortex_a73 = Cpu{ .name = "cortex_a73", .llvm_name = "cortex-a73", .features = featureSet(&[_]Feature{ - .fuse_aes, - .fp_armv8, - .perfmon, - .crc, + .a73, }), }; - pub const cortex_a75 = Cpu{ .name = "cortex_a75", .llvm_name = "cortex-a75", .features = featureSet(&[_]Feature{ - .ccpp, - .rcpc, - .uaops, - .rdm, - .ras, - .lse, - .crc, - .perfmon, - .fp_armv8, - .vh, - .fuse_aes, - .lor, - .dotprod, - .pan, + .a75, }), }; - pub const cortex_a76 = Cpu{ .name = "cortex_a76", .llvm_name = "cortex-a76", .features = featureSet(&[_]Feature{ - .ccpp, - .rcpc, - .uaops, - .rdm, - .ras, - .lse, - .crc, - .fp_armv8, - .vh, - .lor, - .ssbs, - .dotprod, - .pan, + .a76, }), }; - pub const cortex_a76ae = Cpu{ .name = "cortex_a76ae", .llvm_name = "cortex-a76ae", .features = featureSet(&[_]Feature{ - .ccpp, - .rcpc, - .uaops, - .rdm, - .ras, - .lse, - .crc, - .fp_armv8, - .vh, - .lor, - .ssbs, - .dotprod, - .pan, + .a76, }), }; - pub const cyclone = Cpu{ .name = "cyclone", .llvm_name = "cyclone", .features = featureSet(&[_]Feature{ - .arith_cbz_fusion, - .zcz_fp_workaround, - .alternate_sextload_cvt_f32_pattern, - .fuse_crypto_eor, - .zcm, - .zcz_gp, - .perfmon, - .disable_latency_sched_heuristic, - .fp_armv8, - .zcz_fp, - .arith_bcc_fusion, - .fuse_aes, + .cyclone, }), }; - pub const exynos_m1 = Cpu{ .name = "exynos_m1", .llvm_name = "exynos-m1", .features = featureSet(&[_]Feature{ - .custom_cheap_as_move, - .crc, - .force_32bit_jump_tables, - .perfmon, - .slow_misaligned_128store, - .use_reciprocal_square_root, - .fp_armv8, - .zcz_fp, - .fuse_aes, - .slow_paired_128, - .use_postra_scheduler, + .exynosm1, }), }; - pub const exynos_m2 = Cpu{ .name = "exynos_m2", .llvm_name = "exynos-m2", .features = featureSet(&[_]Feature{ - .custom_cheap_as_move, - .crc, - .force_32bit_jump_tables, - .perfmon, - .slow_misaligned_128store, - .fp_armv8, - .zcz_fp, - .fuse_aes, - .slow_paired_128, - .use_postra_scheduler, + .exynosm2, }), }; - pub const exynos_m3 = Cpu{ .name = "exynos_m3", .llvm_name = "exynos-m3", .features = featureSet(&[_]Feature{ - .fuse_literals, - .predictable_select_expensive, - .custom_cheap_as_move, - .crc, - .force_32bit_jump_tables, - .fuse_address, - .fuse_csel, - .perfmon, - .fp_armv8, - .zcz_fp, - .fuse_aes, - .lsl_fast, - .use_postra_scheduler, + .exynosm3, }), }; - pub const exynos_m4 = Cpu{ .name = "exynos_m4", .llvm_name = "exynos-m4", .features = featureSet(&[_]Feature{ - .arith_cbz_fusion, - .custom_cheap_as_move, - .lse, - .zcz_fp, - .lsl_fast, - .lor, - .fuse_literals, - .ccpp, - .ras, - .fp_armv8, - .fuse_aes, - .pan, - .fuse_arith_logic, - .crc, - .force_32bit_jump_tables, - .fuse_address, - .fuse_csel, - .arith_bcc_fusion, - .uaops, - .rdm, - .zcz_gp, - .perfmon, - .vh, - .use_postra_scheduler, - .dotprod, + .exynosm4, }), }; - pub const exynos_m5 = Cpu{ .name = "exynos_m5", .llvm_name = "exynos-m5", .features = featureSet(&[_]Feature{ - .arith_cbz_fusion, - .custom_cheap_as_move, - .lse, - .zcz_fp, - .lsl_fast, - .lor, - .fuse_literals, - .ccpp, - .ras, - .fp_armv8, - .fuse_aes, - .pan, - .fuse_arith_logic, - .crc, - .force_32bit_jump_tables, - .fuse_address, - .fuse_csel, - .arith_bcc_fusion, - .uaops, - .rdm, - .zcz_gp, - .perfmon, - .vh, - .use_postra_scheduler, - .dotprod, + .exynosm4, }), }; - pub const falkor = Cpu{ .name = "falkor", .llvm_name = "falkor", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .custom_cheap_as_move, - .rdm, - .slow_strqro_store, - .zcz_gp, - .crc, - .perfmon, - .fp_armv8, - .zcz_fp, - .lsl_fast, - .use_postra_scheduler, + .falkor, }), }; - pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", @@ -1341,146 +1635,60 @@ pub const cpu = struct { .use_postra_scheduler, }), }; - pub const kryo = Cpu{ .name = "kryo", .llvm_name = "kryo", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .custom_cheap_as_move, - .zcz_gp, - .crc, - .perfmon, - .fp_armv8, - .zcz_fp, - .lsl_fast, - .use_postra_scheduler, + .kryo, }), }; - pub const saphira = Cpu{ .name = "saphira", .llvm_name = "saphira", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .custom_cheap_as_move, - .fmi, - .lse, - .zcz_fp, - .lsl_fast, - .lor, - .dit, - .pa, - .ccpp, - .sel2, - .ras, - .fp_armv8, - .ccidx, - .pan, - .rcpc, - .crc, - .tracev84, - .mpam, - .am, - .nv, - .tlb_rmi, - .uaops, - .rdm, - .zcz_gp, - .perfmon, - .vh, - .use_postra_scheduler, - .dotprod, - .spe, + .saphira, }), }; - pub const thunderx = Cpu{ .name = "thunderx", .llvm_name = "thunderx", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .crc, - .perfmon, - .fp_armv8, - .use_postra_scheduler, + .thunderx, }), }; - pub const thunderx2t99 = Cpu{ .name = "thunderx2t99", .llvm_name = "thunderx2t99", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .aggressive_fma, - .rdm, - .lse, - .crc, - .fp_armv8, - .vh, - .arith_bcc_fusion, - .lor, - .use_postra_scheduler, - .pan, + .thunderx2t99, }), }; - pub const thunderxt81 = Cpu{ .name = "thunderxt81", .llvm_name = "thunderxt81", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .crc, - .perfmon, - .fp_armv8, - .use_postra_scheduler, + .thunderxt81, }), }; - pub const thunderxt83 = Cpu{ .name = "thunderxt83", .llvm_name = "thunderxt83", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .crc, - .perfmon, - .fp_armv8, - .use_postra_scheduler, + .thunderxt83, }), }; - pub const thunderxt88 = Cpu{ .name = "thunderxt88", .llvm_name = "thunderxt88", .features = featureSet(&[_]Feature{ - .predictable_select_expensive, - .crc, - .perfmon, - .fp_armv8, - .use_postra_scheduler, + .thunderxt88, }), }; - pub const tsv110 = Cpu{ .name = "tsv110", .llvm_name = "tsv110", .features = featureSet(&[_]Feature{ - .ccpp, - .custom_cheap_as_move, - .uaops, - .rdm, - .ras, - .lse, - .crc, - .perfmon, - .fp_armv8, - .vh, - .fuse_aes, - .lor, - .use_postra_scheduler, - .dotprod, - .pan, - .spe, + .tsv110, }), }; }; diff --git a/lib/std/target/amdgpu.zig b/lib/std/target/amdgpu.zig index 5efc6e177f..6175456a17 100644 --- a/lib/std/target/amdgpu.zig +++ b/lib/std/target/amdgpu.zig @@ -1,2132 +1,1524 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_BitInsts16 = Feature{ - .name = "BitInsts16", - .llvm_name = "16-bit-insts", - .description = "Has i16/f16 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_addNoCarryInsts = Feature{ - .name = "addNoCarryInsts", - .llvm_name = "add-no-carry-insts", - .description = "Have VALU add/sub instructions without carry out", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_apertureRegs = Feature{ - .name = "apertureRegs", - .llvm_name = "aperture-regs", - .description = "Has Memory Aperture Base and Size Registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_atomicFaddInsts = Feature{ - .name = "atomicFaddInsts", - .llvm_name = "atomic-fadd-insts", - .description = "Has buffer_atomic_add_f32, buffer_atomic_pk_add_f16, global_atomic_add_f32, global_atomic_pk_add_f16 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_autoWaitcntBeforeBarrier = Feature{ - .name = "autoWaitcntBeforeBarrier", - .llvm_name = "auto-waitcnt-before-barrier", - .description = "Hardware automatically inserts waitcnt before barrier", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ciInsts = Feature{ - .name = "ciInsts", - .llvm_name = "ci-insts", - .description = "Additional instructions for CI+", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_codeObjectV3 = Feature{ - .name = "codeObjectV3", - .llvm_name = "code-object-v3", - .description = "Generate code object version 3", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_cumode = Feature{ - .name = "cumode", - .llvm_name = "cumode", - .description = "Enable CU wavefront execution mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dlInsts = Feature{ - .name = "dlInsts", - .llvm_name = "dl-insts", - .description = "Has v_fmac_f32 and v_xnor_b32 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dpp = Feature{ - .name = "dpp", - .llvm_name = "dpp", - .description = "Support DPP (Data Parallel Primitives) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dpp8 = Feature{ - .name = "dpp8", - .llvm_name = "dpp8", - .description = "Support DPP8 (Data Parallel Primitives) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noSramEccSupport = Feature{ - .name = "noSramEccSupport", - .llvm_name = "no-sram-ecc-support", - .description = "Hardware does not support SRAM ECC", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noXnackSupport = Feature{ - .name = "noXnackSupport", - .llvm_name = "no-xnack-support", - .description = "Hardware does not support XNACK", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot1Insts = Feature{ - .name = "dot1Insts", - .llvm_name = "dot1-insts", - .description = "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot2Insts = Feature{ - .name = "dot2Insts", - .llvm_name = "dot2-insts", - .description = "Has v_dot2_f32_f16, v_dot2_i32_i16, v_dot2_u32_u16, v_dot4_u32_u8, v_dot8_u32_u4 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot3Insts = Feature{ - .name = "dot3Insts", - .llvm_name = "dot3-insts", - .description = "Has v_dot8c_i32_i4 instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot4Insts = Feature{ - .name = "dot4Insts", - .llvm_name = "dot4-insts", - .description = "Has v_dot2c_i32_i16 instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot5Insts = Feature{ - .name = "dot5Insts", - .llvm_name = "dot5-insts", - .description = "Has v_dot2c_f32_f16 instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dot6Insts = Feature{ - .name = "dot6Insts", - .llvm_name = "dot6-insts", - .description = "Has v_dot4c_i32_i8 instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_DumpCode = Feature{ - .name = "DumpCode", - .llvm_name = "DumpCode", - .description = "Dump MachineInstrs in the CodeEmitter", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dumpcode = Feature{ - .name = "dumpcode", - .llvm_name = "dumpcode", - .description = "Dump MachineInstrs in the CodeEmitter", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_enableDs128 = Feature{ - .name = "enableDs128", - .llvm_name = "enable-ds128", - .description = "Use ds_{read|write}_b128", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loadStoreOpt = Feature{ - .name = "loadStoreOpt", - .llvm_name = "load-store-opt", - .description = "Enable SI load/store optimizer pass", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_enablePrtStrictNull = Feature{ - .name = "enablePrtStrictNull", - .llvm_name = "enable-prt-strict-null", - .description = "Enable zeroing of result registers for sparse texture fetches", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_siScheduler = Feature{ - .name = "siScheduler", - .llvm_name = "si-scheduler", - .description = "Enable SI Machine Scheduler", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_unsafeDsOffsetFolding = Feature{ - .name = "unsafeDsOffsetFolding", - .llvm_name = "unsafe-ds-offset-folding", - .description = "Force using DS instruction immediate offsets on SI", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fmaf = Feature{ - .name = "fmaf", - .llvm_name = "fmaf", - .description = "Enable single precision FMA (not as fast as mul+add, but fused)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp16Denormals = Feature{ - .name = "fp16Denormals", - .llvm_name = "fp16-denormals", - .description = "Enable half precision denormal handling", - .dependencies = &[_]*const Feature { - &feature_fp64, - }, -}; - -pub const feature_fp32Denormals = Feature{ - .name = "fp32Denormals", - .llvm_name = "fp32-denormals", - .description = "Enable single precision denormal handling", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp64 = Feature{ - .name = "fp64", - .llvm_name = "fp64", - .description = "Enable double precision operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp64Denormals = Feature{ - .name = "fp64Denormals", - .llvm_name = "fp64-denormals", - .description = "Enable double and half precision denormal handling", - .dependencies = &[_]*const Feature { - &feature_fp64, - }, -}; - -pub const feature_fp64Fp16Denormals = Feature{ - .name = "fp64Fp16Denormals", - .llvm_name = "fp64-fp16-denormals", - .description = "Enable double and half precision denormal handling", - .dependencies = &[_]*const Feature { - &feature_fp64, - }, -}; - -pub const feature_fpExceptions = Feature{ - .name = "fpExceptions", - .llvm_name = "fp-exceptions", - .description = "Enable floating point exceptions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fastFmaf = Feature{ - .name = "fastFmaf", - .llvm_name = "fast-fmaf", - .description = "Assuming f32 fma is at least as fast as mul + add", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatAddressSpace = Feature{ - .name = "flatAddressSpace", - .llvm_name = "flat-address-space", - .description = "Support flat address space", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatForGlobal = Feature{ - .name = "flatForGlobal", - .llvm_name = "flat-for-global", - .description = "Force to generate flat instruction for global", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatGlobalInsts = Feature{ - .name = "flatGlobalInsts", - .llvm_name = "flat-global-insts", - .description = "Have global_* flat memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatInstOffsets = Feature{ - .name = "flatInstOffsets", - .llvm_name = "flat-inst-offsets", - .description = "Flat instructions have immediate offset addressing mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatScratchInsts = Feature{ - .name = "flatScratchInsts", - .llvm_name = "flat-scratch-insts", - .description = "Have scratch_* flat memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_flatSegmentOffsetBug = Feature{ - .name = "flatSegmentOffsetBug", - .llvm_name = "flat-segment-offset-bug", - .description = "GFX10 bug, inst_offset ignored in flat segment", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fmaMixInsts = Feature{ - .name = "fmaMixInsts", - .llvm_name = "fma-mix-insts", - .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gcn3Encoding = Feature{ - .name = "gcn3Encoding", - .llvm_name = "gcn3-encoding", - .description = "Encoding format for VI", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gfx7Gfx8Gfx9Insts = Feature{ - .name = "gfx7Gfx8Gfx9Insts", - .llvm_name = "gfx7-gfx8-gfx9-insts", - .description = "Instructions shared in GFX7, GFX8, GFX9", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gfx8Insts = Feature{ - .name = "gfx8Insts", - .llvm_name = "gfx8-insts", - .description = "Additional instructions for GFX8+", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gfx9Insts = Feature{ - .name = "gfx9Insts", - .llvm_name = "gfx9-insts", - .description = "Additional instructions for GFX9+", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gfx10Insts = Feature{ - .name = "gfx10Insts", - .llvm_name = "gfx10-insts", - .description = "Additional instructions for GFX10+", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_instFwdPrefetchBug = Feature{ - .name = "instFwdPrefetchBug", - .llvm_name = "inst-fwd-prefetch-bug", - .description = "S_INST_PREFETCH instruction causes shader to hang", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_intClampInsts = Feature{ - .name = "intClampInsts", - .llvm_name = "int-clamp-insts", - .description = "Support clamp for integer destination", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_inv2piInlineImm = Feature{ - .name = "inv2piInlineImm", - .llvm_name = "inv-2pi-inline-imm", - .description = "Has 1 / (2 * pi) as inline immediate", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ldsbankcount16 = Feature{ - .name = "ldsbankcount16", - .llvm_name = "ldsbankcount16", - .description = "The number of LDS banks per compute unit.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ldsbankcount32 = Feature{ - .name = "ldsbankcount32", - .llvm_name = "ldsbankcount32", - .description = "The number of LDS banks per compute unit.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ldsBranchVmemWarHazard = Feature{ - .name = "ldsBranchVmemWarHazard", - .llvm_name = "lds-branch-vmem-war-hazard", - .description = "Switching between LDS and VMEM-tex not waiting VM_VSRC=0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ldsMisalignedBug = Feature{ - .name = "ldsMisalignedBug", - .llvm_name = "lds-misaligned-bug", - .description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_localmemorysize0 = Feature{ - .name = "localmemorysize0", - .llvm_name = "localmemorysize0", - .description = "The size of local memory in bytes", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_localmemorysize32768 = Feature{ - .name = "localmemorysize32768", - .llvm_name = "localmemorysize32768", - .description = "The size of local memory in bytes", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_localmemorysize65536 = Feature{ - .name = "localmemorysize65536", - .llvm_name = "localmemorysize65536", - .description = "The size of local memory in bytes", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_maiInsts = Feature{ - .name = "maiInsts", - .llvm_name = "mai-insts", - .description = "Has mAI instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mimgR128 = Feature{ - .name = "mimgR128", - .llvm_name = "mimg-r128", - .description = "Support 128-bit texture resources", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_madMixInsts = Feature{ - .name = "madMixInsts", - .llvm_name = "mad-mix-insts", - .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_maxPrivateElementSize4 = Feature{ - .name = "maxPrivateElementSize4", - .llvm_name = "max-private-element-size-4", - .description = "Maximum private access size may be 4", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_maxPrivateElementSize8 = Feature{ - .name = "maxPrivateElementSize8", - .llvm_name = "max-private-element-size-8", - .description = "Maximum private access size may be 8", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_maxPrivateElementSize16 = Feature{ - .name = "maxPrivateElementSize16", - .llvm_name = "max-private-element-size-16", - .description = "Maximum private access size may be 16", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_movrel = Feature{ - .name = "movrel", - .llvm_name = "movrel", - .description = "Has v_movrel*_b32 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nsaEncoding = Feature{ - .name = "nsaEncoding", - .llvm_name = "nsa-encoding", - .description = "Support NSA encoding for image instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nsaToVmemBug = Feature{ - .name = "nsaToVmemBug", - .llvm_name = "nsa-to-vmem-bug", - .description = "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noDataDepHazard = Feature{ - .name = "noDataDepHazard", - .llvm_name = "no-data-dep-hazard", - .description = "Does not need SW waitstates", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noSdstCmpx = Feature{ - .name = "noSdstCmpx", - .llvm_name = "no-sdst-cmpx", - .description = "V_CMPX does not write VCC/SGPR in addition to EXEC", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_offset3fBug = Feature{ - .name = "offset3fBug", - .llvm_name = "offset-3f-bug", - .description = "Branch offset of 3f hardware bug", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_pkFmacF16Inst = Feature{ - .name = "pkFmacF16Inst", - .llvm_name = "pk-fmac-f16-inst", - .description = "Has v_pk_fmac_f16 instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_promoteAlloca = Feature{ - .name = "promoteAlloca", - .llvm_name = "promote-alloca", - .description = "Enable promote alloca pass", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_r128A16 = Feature{ - .name = "r128A16", - .llvm_name = "r128-a16", - .description = "Support 16 bit coordindates/gradients/lod/clamp/mip types on gfx9", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_registerBanking = Feature{ - .name = "registerBanking", - .llvm_name = "register-banking", - .description = "Has register banking", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwa = Feature{ - .name = "sdwa", - .llvm_name = "sdwa", - .description = "Support SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwaMav = Feature{ - .name = "sdwaMav", - .llvm_name = "sdwa-mav", - .description = "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwaOmod = Feature{ - .name = "sdwaOmod", - .llvm_name = "sdwa-omod", - .description = "Support OMod with SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwaOutModsVopc = Feature{ - .name = "sdwaOutModsVopc", - .llvm_name = "sdwa-out-mods-vopc", - .description = "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwaScalar = Feature{ - .name = "sdwaScalar", - .llvm_name = "sdwa-scalar", - .description = "Support scalar register with SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sdwaSdst = Feature{ - .name = "sdwaSdst", - .llvm_name = "sdwa-sdst", - .description = "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sgprInitBug = Feature{ - .name = "sgprInitBug", - .llvm_name = "sgpr-init-bug", - .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_smemToVectorWriteHazard = Feature{ - .name = "smemToVectorWriteHazard", - .llvm_name = "smem-to-vector-write-hazard", - .description = "s_load_dword followed by v_cmp page faults", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sMemrealtime = Feature{ - .name = "sMemrealtime", - .llvm_name = "s-memrealtime", - .description = "Has s_memrealtime instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sramEcc = Feature{ - .name = "sramEcc", - .llvm_name = "sram-ecc", - .description = "Enable SRAM ECC", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_scalarAtomics = Feature{ - .name = "scalarAtomics", - .llvm_name = "scalar-atomics", - .description = "Has atomic scalar memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_scalarFlatScratchInsts = Feature{ - .name = "scalarFlatScratchInsts", - .llvm_name = "scalar-flat-scratch-insts", - .description = "Have s_scratch_* flat memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_scalarStores = Feature{ - .name = "scalarStores", - .llvm_name = "scalar-stores", - .description = "Has store scalar memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_trapHandler = Feature{ - .name = "trapHandler", - .llvm_name = "trap-handler", - .description = "Trap handler support", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_trigReducedRange = Feature{ - .name = "trigReducedRange", - .llvm_name = "trig-reduced-range", - .description = "Requires use of fract on arguments to trig instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_unalignedBufferAccess = Feature{ - .name = "unalignedBufferAccess", - .llvm_name = "unaligned-buffer-access", - .description = "Support unaligned global loads and stores", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_unalignedScratchAccess = Feature{ - .name = "unalignedScratchAccess", - .llvm_name = "unaligned-scratch-access", - .description = "Support unaligned scratch loads and stores", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_unpackedD16Vmem = Feature{ - .name = "unpackedD16Vmem", - .llvm_name = "unpacked-d16-vmem", - .description = "Has unpacked d16 vmem instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vgprIndexMode = Feature{ - .name = "vgprIndexMode", - .llvm_name = "vgpr-index-mode", - .description = "Has VGPR mode register indexing", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vmemToScalarWriteHazard = Feature{ - .name = "vmemToScalarWriteHazard", - .llvm_name = "vmem-to-scalar-write-hazard", - .description = "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vop3Literal = Feature{ - .name = "vop3Literal", - .llvm_name = "vop3-literal", - .description = "Can use one literal in VOP3", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vop3p = Feature{ - .name = "vop3p", - .llvm_name = "vop3p", - .description = "Has VOP3P packed instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vcmpxExecWarHazard = Feature{ - .name = "vcmpxExecWarHazard", - .llvm_name = "vcmpx-exec-war-hazard", - .description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vcmpxPermlaneHazard = Feature{ - .name = "vcmpxPermlaneHazard", - .llvm_name = "vcmpx-permlane-hazard", - .description = "TODO: describe me", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vscnt = Feature{ - .name = "vscnt", - .llvm_name = "vscnt", - .description = "Has separate store vscnt counter", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_wavefrontsize16 = Feature{ - .name = "wavefrontsize16", - .llvm_name = "wavefrontsize16", - .description = "The number of threads per wavefront", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_wavefrontsize32 = Feature{ - .name = "wavefrontsize32", - .llvm_name = "wavefrontsize32", - .description = "The number of threads per wavefront", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_wavefrontsize64 = Feature{ - .name = "wavefrontsize64", - .llvm_name = "wavefrontsize64", - .description = "The number of threads per wavefront", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_xnack = Feature{ - .name = "xnack", - .llvm_name = "xnack", - .description = "Enable XNACK support", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_halfRate64Ops = Feature{ - .name = "halfRate64Ops", - .llvm_name = "half-rate-64-ops", - .description = "Most fp64 instructions are half rate instead of quarter", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_BitInsts16, - &feature_addNoCarryInsts, - &feature_apertureRegs, - &feature_atomicFaddInsts, - &feature_autoWaitcntBeforeBarrier, - &feature_ciInsts, - &feature_codeObjectV3, - &feature_cumode, - &feature_dlInsts, - &feature_dpp, - &feature_dpp8, - &feature_noSramEccSupport, - &feature_noXnackSupport, - &feature_dot1Insts, - &feature_dot2Insts, - &feature_dot3Insts, - &feature_dot4Insts, - &feature_dot5Insts, - &feature_dot6Insts, - &feature_DumpCode, - &feature_dumpcode, - &feature_enableDs128, - &feature_loadStoreOpt, - &feature_enablePrtStrictNull, - &feature_siScheduler, - &feature_unsafeDsOffsetFolding, - &feature_fmaf, - &feature_fp16Denormals, - &feature_fp32Denormals, - &feature_fp64, - &feature_fp64Denormals, - &feature_fp64Fp16Denormals, - &feature_fpExceptions, - &feature_fastFmaf, - &feature_flatAddressSpace, - &feature_flatForGlobal, - &feature_flatGlobalInsts, - &feature_flatInstOffsets, - &feature_flatScratchInsts, - &feature_flatSegmentOffsetBug, - &feature_fmaMixInsts, - &feature_gcn3Encoding, - &feature_gfx7Gfx8Gfx9Insts, - &feature_gfx8Insts, - &feature_gfx9Insts, - &feature_gfx10Insts, - &feature_instFwdPrefetchBug, - &feature_intClampInsts, - &feature_inv2piInlineImm, - &feature_ldsbankcount16, - &feature_ldsbankcount32, - &feature_ldsBranchVmemWarHazard, - &feature_ldsMisalignedBug, - &feature_localmemorysize0, - &feature_localmemorysize32768, - &feature_localmemorysize65536, - &feature_maiInsts, - &feature_mimgR128, - &feature_madMixInsts, - &feature_maxPrivateElementSize4, - &feature_maxPrivateElementSize8, - &feature_maxPrivateElementSize16, - &feature_movrel, - &feature_nsaEncoding, - &feature_nsaToVmemBug, - &feature_noDataDepHazard, - &feature_noSdstCmpx, - &feature_offset3fBug, - &feature_pkFmacF16Inst, - &feature_promoteAlloca, - &feature_r128A16, - &feature_registerBanking, - &feature_sdwa, - &feature_sdwaMav, - &feature_sdwaOmod, - &feature_sdwaOutModsVopc, - &feature_sdwaScalar, - &feature_sdwaSdst, - &feature_sgprInitBug, - &feature_smemToVectorWriteHazard, - &feature_sMemrealtime, - &feature_sramEcc, - &feature_scalarAtomics, - &feature_scalarFlatScratchInsts, - &feature_scalarStores, - &feature_trapHandler, - &feature_trigReducedRange, - &feature_unalignedBufferAccess, - &feature_unalignedScratchAccess, - &feature_unpackedD16Vmem, - &feature_vgprIndexMode, - &feature_vmemToScalarWriteHazard, - &feature_vop3Literal, - &feature_vop3p, - &feature_vcmpxExecWarHazard, - &feature_vcmpxPermlaneHazard, - &feature_vscnt, - &feature_wavefrontsize16, - &feature_wavefrontsize32, - &feature_wavefrontsize64, - &feature_xnack, - &feature_halfRate64Ops, -}; - -pub const cpu_bonaire = Cpu{ - .name = "bonaire", - .llvm_name = "bonaire", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_carrizo = Cpu{ - .name = "carrizo", - .llvm_name = "carrizo", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_xnack, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_fiji = Cpu{ - .name = "fiji", - .llvm_name = "fiji", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - &feature_wavefrontsize64, - }, -}; - -pub const cpu_genericHsa = Cpu{ - .name = "genericHsa", - .llvm_name = "generic-hsa", - .dependencies = &[_]*const Feature { - &feature_flatAddressSpace, - &feature_wavefrontsize64, - }, -}; - -pub const cpu_gfx1010 = Cpu{ - .name = "gfx1010", - .llvm_name = "gfx1010", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_dlInsts, - &feature_noXnackSupport, - &feature_flatSegmentOffsetBug, - &feature_fmaMixInsts, - &feature_movrel, - &feature_registerBanking, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_mimgR128, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_noSdstCmpx, - &feature_vop3p, - &feature_sdwa, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_noDataDepHazard, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_sMemrealtime, - &feature_pkFmacF16Inst, - &feature_dpp8, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_noSramEccSupport, - &feature_gfx10Insts, - &feature_localmemorysize65536, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_vop3Literal, - &feature_sdwaOmod, - &feature_vscnt, - &feature_instFwdPrefetchBug, - &feature_ldsbankcount32, - &feature_ldsBranchVmemWarHazard, - &feature_ldsMisalignedBug, - &feature_nsaEncoding, - &feature_nsaToVmemBug, - &feature_offset3fBug, - &feature_smemToVectorWriteHazard, - &feature_scalarAtomics, - &feature_scalarFlatScratchInsts, - &feature_scalarStores, - &feature_vmemToScalarWriteHazard, - &feature_vcmpxExecWarHazard, - &feature_vcmpxPermlaneHazard, - &feature_wavefrontsize32, - }, -}; - -pub const cpu_gfx1011 = Cpu{ - .name = "gfx1011", - .llvm_name = "gfx1011", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_dlInsts, - &feature_noXnackSupport, - &feature_dot1Insts, - &feature_dot2Insts, - &feature_dot5Insts, - &feature_dot6Insts, - &feature_flatSegmentOffsetBug, - &feature_fmaMixInsts, - &feature_movrel, - &feature_registerBanking, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_mimgR128, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_noSdstCmpx, - &feature_vop3p, - &feature_sdwa, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_noDataDepHazard, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_sMemrealtime, - &feature_pkFmacF16Inst, - &feature_dpp8, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_noSramEccSupport, - &feature_gfx10Insts, - &feature_localmemorysize65536, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_vop3Literal, - &feature_sdwaOmod, - &feature_vscnt, - &feature_instFwdPrefetchBug, - &feature_ldsbankcount32, - &feature_ldsBranchVmemWarHazard, - &feature_nsaEncoding, - &feature_nsaToVmemBug, - &feature_offset3fBug, - &feature_smemToVectorWriteHazard, - &feature_scalarAtomics, - &feature_scalarFlatScratchInsts, - &feature_scalarStores, - &feature_vmemToScalarWriteHazard, - &feature_vcmpxExecWarHazard, - &feature_vcmpxPermlaneHazard, - &feature_wavefrontsize32, - }, -}; - -pub const cpu_gfx1012 = Cpu{ - .name = "gfx1012", - .llvm_name = "gfx1012", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_dlInsts, - &feature_noXnackSupport, - &feature_dot1Insts, - &feature_dot2Insts, - &feature_dot5Insts, - &feature_dot6Insts, - &feature_flatSegmentOffsetBug, - &feature_fmaMixInsts, - &feature_movrel, - &feature_registerBanking, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_mimgR128, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_noSdstCmpx, - &feature_vop3p, - &feature_sdwa, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_noDataDepHazard, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_sMemrealtime, - &feature_pkFmacF16Inst, - &feature_dpp8, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_noSramEccSupport, - &feature_gfx10Insts, - &feature_localmemorysize65536, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_vop3Literal, - &feature_sdwaOmod, - &feature_vscnt, - &feature_instFwdPrefetchBug, - &feature_ldsbankcount32, - &feature_ldsBranchVmemWarHazard, - &feature_ldsMisalignedBug, - &feature_nsaEncoding, - &feature_nsaToVmemBug, - &feature_offset3fBug, - &feature_smemToVectorWriteHazard, - &feature_scalarAtomics, - &feature_scalarFlatScratchInsts, - &feature_scalarStores, - &feature_vmemToScalarWriteHazard, - &feature_vcmpxExecWarHazard, - &feature_vcmpxPermlaneHazard, - &feature_wavefrontsize32, - }, -}; - -pub const cpu_gfx600 = Cpu{ - .name = "gfx600", - .llvm_name = "gfx600", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_gfx601 = Cpu{ - .name = "gfx601", - .llvm_name = "gfx601", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - }, -}; - -pub const cpu_gfx700 = Cpu{ - .name = "gfx700", - .llvm_name = "gfx700", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_gfx701 = Cpu{ - .name = "gfx701", - .llvm_name = "gfx701", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_gfx702 = Cpu{ - .name = "gfx702", - .llvm_name = "gfx702", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_fastFmaf, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_gfx703 = Cpu{ - .name = "gfx703", - .llvm_name = "gfx703", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_gfx704 = Cpu{ - .name = "gfx704", - .llvm_name = "gfx704", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_gfx801 = Cpu{ - .name = "gfx801", - .llvm_name = "gfx801", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_xnack, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_gfx802 = Cpu{ - .name = "gfx802", - .llvm_name = "gfx802", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_sgprInitBug, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_gfx803 = Cpu{ - .name = "gfx803", - .llvm_name = "gfx803", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_gfx810 = Cpu{ - .name = "gfx810", - .llvm_name = "gfx810", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_xnack, - }, -}; - -pub const cpu_gfx900 = Cpu{ - .name = "gfx900", - .llvm_name = "gfx900", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noSramEccSupport, - &feature_noXnackSupport, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - &feature_madMixInsts, - }, -}; - -pub const cpu_gfx902 = Cpu{ - .name = "gfx902", - .llvm_name = "gfx902", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noSramEccSupport, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - &feature_madMixInsts, - &feature_xnack, - }, -}; - -pub const cpu_gfx904 = Cpu{ - .name = "gfx904", - .llvm_name = "gfx904", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noSramEccSupport, - &feature_noXnackSupport, - &feature_fmaMixInsts, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - }, -}; - -pub const cpu_gfx906 = Cpu{ - .name = "gfx906", - .llvm_name = "gfx906", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_dlInsts, - &feature_noXnackSupport, - &feature_dot1Insts, - &feature_dot2Insts, - &feature_fmaMixInsts, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_gfx908 = Cpu{ - .name = "gfx908", - .llvm_name = "gfx908", - .dependencies = &[_]*const Feature { - &feature_atomicFaddInsts, - &feature_codeObjectV3, - &feature_dlInsts, - &feature_dot1Insts, - &feature_dot2Insts, - &feature_dot3Insts, - &feature_dot4Insts, - &feature_dot5Insts, - &feature_dot6Insts, - &feature_fmaMixInsts, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - &feature_maiInsts, - &feature_pkFmacF16Inst, - &feature_sramEcc, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_gfx909 = Cpu{ - .name = "gfx909", - .llvm_name = "gfx909", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_vgprIndexMode, - &feature_addNoCarryInsts, - &feature_fp64, - &feature_gcn3Encoding, - &feature_sdwaScalar, - &feature_flatGlobalInsts, - &feature_scalarFlatScratchInsts, - &feature_flatInstOffsets, - &feature_apertureRegs, - &feature_vop3p, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_sdwaSdst, - &feature_flatScratchInsts, - &feature_ciInsts, - &feature_r128A16, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_scalarAtomics, - &feature_inv2piInlineImm, - &feature_fastFmaf, - &feature_wavefrontsize64, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx9Insts, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_sdwaOmod, - &feature_ldsbankcount32, - &feature_madMixInsts, - &feature_xnack, - }, -}; - -pub const cpu_hainan = Cpu{ - .name = "hainan", - .llvm_name = "hainan", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - }, -}; - -pub const cpu_hawaii = Cpu{ - .name = "hawaii", - .llvm_name = "hawaii", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_iceland = Cpu{ - .name = "iceland", - .llvm_name = "iceland", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_sgprInitBug, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_kabini = Cpu{ - .name = "kabini", - .llvm_name = "kabini", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_kaveri = Cpu{ - .name = "kaveri", - .llvm_name = "kaveri", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_mullins = Cpu{ - .name = "mullins", - .llvm_name = "mullins", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_gfx7Gfx8Gfx9Insts, - &feature_movrel, - &feature_flatAddressSpace, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_ciInsts, - &feature_localmemorysize65536, - }, -}; - -pub const cpu_oland = Cpu{ - .name = "oland", - .llvm_name = "oland", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - }, -}; - -pub const cpu_pitcairn = Cpu{ - .name = "pitcairn", - .llvm_name = "pitcairn", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - }, -}; - -pub const cpu_polaris10 = Cpu{ - .name = "polaris10", - .llvm_name = "polaris10", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_polaris11 = Cpu{ - .name = "polaris11", - .llvm_name = "polaris11", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_stoney = Cpu{ - .name = "stoney", - .llvm_name = "stoney", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_ldsbankcount16, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - &feature_xnack, - }, -}; - -pub const cpu_tahiti = Cpu{ - .name = "tahiti", - .llvm_name = "tahiti", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_fastFmaf, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - &feature_halfRate64Ops, - }, -}; - -pub const cpu_tonga = Cpu{ - .name = "tonga", - .llvm_name = "tonga", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_sgprInitBug, - &feature_unpackedD16Vmem, - &feature_trigReducedRange, - &feature_vgprIndexMode, - &feature_movrel, - &feature_fp64, - &feature_gcn3Encoding, - &feature_mimgR128, - &feature_sdwa, - &feature_gfx7Gfx8Gfx9Insts, - &feature_intClampInsts, - &feature_ciInsts, - &feature_sdwaOutModsVopc, - &feature_sMemrealtime, - &feature_flatAddressSpace, - &feature_inv2piInlineImm, - &feature_wavefrontsize64, - &feature_noSramEccSupport, - &feature_sdwaMav, - &feature_localmemorysize65536, - &feature_scalarStores, - &feature_gfx8Insts, - &feature_dpp, - &feature_BitInsts16, - }, -}; - -pub const cpu_verde = Cpu{ - .name = "verde", - .llvm_name = "verde", - .dependencies = &[_]*const Feature { - &feature_codeObjectV3, - &feature_noXnackSupport, - &feature_ldsbankcount32, - &feature_trigReducedRange, - &feature_movrel, - &feature_wavefrontsize64, - &feature_fp64, - &feature_mimgR128, - &feature_noSramEccSupport, - &feature_localmemorysize32768, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_bonaire, - &cpu_carrizo, - &cpu_fiji, - &cpu_generic, - &cpu_genericHsa, - &cpu_gfx1010, - &cpu_gfx1011, - &cpu_gfx1012, - &cpu_gfx600, - &cpu_gfx601, - &cpu_gfx700, - &cpu_gfx701, - &cpu_gfx702, - &cpu_gfx703, - &cpu_gfx704, - &cpu_gfx801, - &cpu_gfx802, - &cpu_gfx803, - &cpu_gfx810, - &cpu_gfx900, - &cpu_gfx902, - &cpu_gfx904, - &cpu_gfx906, - &cpu_gfx908, - &cpu_gfx909, - &cpu_hainan, - &cpu_hawaii, - &cpu_iceland, - &cpu_kabini, - &cpu_kaveri, - &cpu_mullins, - &cpu_oland, - &cpu_pitcairn, - &cpu_polaris10, - &cpu_polaris11, - &cpu_stoney, - &cpu_tahiti, - &cpu_tonga, - &cpu_verde, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + @"16_bit_insts", + DumpCode, + add_no_carry_insts, + aperture_regs, + atomic_fadd_insts, + auto_waitcnt_before_barrier, + ci_insts, + code_object_v3, + cumode, + dl_insts, + dot1_insts, + dot2_insts, + dot3_insts, + dot4_insts, + dot5_insts, + dot6_insts, + dpp, + dpp8, + dumpcode, + enable_ds128, + enable_prt_strict_null, + fast_fmaf, + flat_address_space, + flat_for_global, + flat_global_insts, + flat_inst_offsets, + flat_scratch_insts, + flat_segment_offset_bug, + fma_mix_insts, + fmaf, + fp_exceptions, + fp16_denormals, + fp32_denormals, + fp64, + fp64_denormals, + fp64_fp16_denormals, + gcn3_encoding, + gfx10, + gfx10_insts, + gfx7_gfx8_gfx9_insts, + gfx8_insts, + gfx9, + gfx9_insts, + half_rate_64_ops, + inst_fwd_prefetch_bug, + int_clamp_insts, + inv_2pi_inline_imm, + lds_branch_vmem_war_hazard, + lds_misaligned_bug, + ldsbankcount16, + ldsbankcount32, + load_store_opt, + localmemorysize0, + localmemorysize32768, + localmemorysize65536, + mad_mix_insts, + mai_insts, + max_private_element_size_16, + max_private_element_size_4, + max_private_element_size_8, + mimg_r128, + movrel, + no_data_dep_hazard, + no_sdst_cmpx, + no_sram_ecc_support, + no_xnack_support, + nsa_encoding, + nsa_to_vmem_bug, + offset_3f_bug, + pk_fmac_f16_inst, + promote_alloca, + r128_a16, + register_banking, + s_memrealtime, + scalar_atomics, + scalar_flat_scratch_insts, + scalar_stores, + sdwa, + sdwa_mav, + sdwa_omod, + sdwa_out_mods_vopc, + sdwa_scalar, + sdwa_sdst, + sea_islands, + sgpr_init_bug, + si_scheduler, + smem_to_vector_write_hazard, + southern_islands, + sram_ecc, + trap_handler, + trig_reduced_range, + unaligned_buffer_access, + unaligned_scratch_access, + unpacked_d16_vmem, + unsafe_ds_offset_folding, + vcmpx_exec_war_hazard, + vcmpx_permlane_hazard, + vgpr_index_mode, + vmem_to_scalar_write_hazard, + volcanic_islands, + vop3_literal, + vop3p, + vscnt, + wavefrontsize16, + wavefrontsize32, + wavefrontsize64, + xnack, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.@"16_bit_insts")] = .{ + .index = @enumToInt(Feature.@"16_bit_insts"), + .name = @tagName(Feature.@"16_bit_insts"), + .llvm_name = "16-bit-insts", + .description = "Has i16/f16 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.DumpCode)] = .{ + .index = @enumToInt(Feature.DumpCode), + .name = @tagName(Feature.DumpCode), + .llvm_name = "DumpCode", + .description = "Dump MachineInstrs in the CodeEmitter", + .dependencies = 0, + }; + result[@enumToInt(Feature.add_no_carry_insts)] = .{ + .index = @enumToInt(Feature.add_no_carry_insts), + .name = @tagName(Feature.add_no_carry_insts), + .llvm_name = "add-no-carry-insts", + .description = "Have VALU add/sub instructions without carry out", + .dependencies = 0, + }; + result[@enumToInt(Feature.aperture_regs)] = .{ + .index = @enumToInt(Feature.aperture_regs), + .name = @tagName(Feature.aperture_regs), + .llvm_name = "aperture-regs", + .description = "Has Memory Aperture Base and Size Registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.atomic_fadd_insts)] = .{ + .index = @enumToInt(Feature.atomic_fadd_insts), + .name = @tagName(Feature.atomic_fadd_insts), + .llvm_name = "atomic-fadd-insts", + .description = "Has buffer_atomic_add_f32, buffer_atomic_pk_add_f16, global_atomic_add_f32, global_atomic_pk_add_f16 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.auto_waitcnt_before_barrier)] = .{ + .index = @enumToInt(Feature.auto_waitcnt_before_barrier), + .name = @tagName(Feature.auto_waitcnt_before_barrier), + .llvm_name = "auto-waitcnt-before-barrier", + .description = "Hardware automatically inserts waitcnt before barrier", + .dependencies = 0, + }; + result[@enumToInt(Feature.ci_insts)] = .{ + .index = @enumToInt(Feature.ci_insts), + .name = @tagName(Feature.ci_insts), + .llvm_name = "ci-insts", + .description = "Additional instructions for CI+", + .dependencies = 0, + }; + result[@enumToInt(Feature.code_object_v3)] = .{ + .index = @enumToInt(Feature.code_object_v3), + .name = @tagName(Feature.code_object_v3), + .llvm_name = "code-object-v3", + .description = "Generate code object version 3", + .dependencies = 0, + }; + result[@enumToInt(Feature.cumode)] = .{ + .index = @enumToInt(Feature.cumode), + .name = @tagName(Feature.cumode), + .llvm_name = "cumode", + .description = "Enable CU wavefront execution mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.dl_insts)] = .{ + .index = @enumToInt(Feature.dl_insts), + .name = @tagName(Feature.dl_insts), + .llvm_name = "dl-insts", + .description = "Has v_fmac_f32 and v_xnor_b32 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot1_insts)] = .{ + .index = @enumToInt(Feature.dot1_insts), + .name = @tagName(Feature.dot1_insts), + .llvm_name = "dot1-insts", + .description = "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot2_insts)] = .{ + .index = @enumToInt(Feature.dot2_insts), + .name = @tagName(Feature.dot2_insts), + .llvm_name = "dot2-insts", + .description = "Has v_dot2_f32_f16, v_dot2_i32_i16, v_dot2_u32_u16, v_dot4_u32_u8, v_dot8_u32_u4 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot3_insts)] = .{ + .index = @enumToInt(Feature.dot3_insts), + .name = @tagName(Feature.dot3_insts), + .llvm_name = "dot3-insts", + .description = "Has v_dot8c_i32_i4 instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot4_insts)] = .{ + .index = @enumToInt(Feature.dot4_insts), + .name = @tagName(Feature.dot4_insts), + .llvm_name = "dot4-insts", + .description = "Has v_dot2c_i32_i16 instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot5_insts)] = .{ + .index = @enumToInt(Feature.dot5_insts), + .name = @tagName(Feature.dot5_insts), + .llvm_name = "dot5-insts", + .description = "Has v_dot2c_f32_f16 instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.dot6_insts)] = .{ + .index = @enumToInt(Feature.dot6_insts), + .name = @tagName(Feature.dot6_insts), + .llvm_name = "dot6-insts", + .description = "Has v_dot4c_i32_i8 instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.dpp)] = .{ + .index = @enumToInt(Feature.dpp), + .name = @tagName(Feature.dpp), + .llvm_name = "dpp", + .description = "Support DPP (Data Parallel Primitives) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.dpp8)] = .{ + .index = @enumToInt(Feature.dpp8), + .name = @tagName(Feature.dpp8), + .llvm_name = "dpp8", + .description = "Support DPP8 (Data Parallel Primitives) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.dumpcode)] = .{ + .index = @enumToInt(Feature.dumpcode), + .name = @tagName(Feature.dumpcode), + .llvm_name = "dumpcode", + .description = "Dump MachineInstrs in the CodeEmitter", + .dependencies = 0, + }; + result[@enumToInt(Feature.enable_ds128)] = .{ + .index = @enumToInt(Feature.enable_ds128), + .name = @tagName(Feature.enable_ds128), + .llvm_name = "enable-ds128", + .description = "Use ds_read|write_b128", + .dependencies = 0, + }; + result[@enumToInt(Feature.enable_prt_strict_null)] = .{ + .index = @enumToInt(Feature.enable_prt_strict_null), + .name = @tagName(Feature.enable_prt_strict_null), + .llvm_name = "enable-prt-strict-null", + .description = "Enable zeroing of result registers for sparse texture fetches", + .dependencies = 0, + }; + result[@enumToInt(Feature.fast_fmaf)] = .{ + .index = @enumToInt(Feature.fast_fmaf), + .name = @tagName(Feature.fast_fmaf), + .llvm_name = "fast-fmaf", + .description = "Assuming f32 fma is at least as fast as mul + add", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_address_space)] = .{ + .index = @enumToInt(Feature.flat_address_space), + .name = @tagName(Feature.flat_address_space), + .llvm_name = "flat-address-space", + .description = "Support flat address space", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_for_global)] = .{ + .index = @enumToInt(Feature.flat_for_global), + .name = @tagName(Feature.flat_for_global), + .llvm_name = "flat-for-global", + .description = "Force to generate flat instruction for global", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_global_insts)] = .{ + .index = @enumToInt(Feature.flat_global_insts), + .name = @tagName(Feature.flat_global_insts), + .llvm_name = "flat-global-insts", + .description = "Have global_* flat memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_inst_offsets)] = .{ + .index = @enumToInt(Feature.flat_inst_offsets), + .name = @tagName(Feature.flat_inst_offsets), + .llvm_name = "flat-inst-offsets", + .description = "Flat instructions have immediate offset addressing mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_scratch_insts)] = .{ + .index = @enumToInt(Feature.flat_scratch_insts), + .name = @tagName(Feature.flat_scratch_insts), + .llvm_name = "flat-scratch-insts", + .description = "Have scratch_* flat memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.flat_segment_offset_bug)] = .{ + .index = @enumToInt(Feature.flat_segment_offset_bug), + .name = @tagName(Feature.flat_segment_offset_bug), + .llvm_name = "flat-segment-offset-bug", + .description = "GFX10 bug, inst_offset ignored in flat segment", + .dependencies = 0, + }; + result[@enumToInt(Feature.fma_mix_insts)] = .{ + .index = @enumToInt(Feature.fma_mix_insts), + .name = @tagName(Feature.fma_mix_insts), + .llvm_name = "fma-mix-insts", + .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.fmaf)] = .{ + .index = @enumToInt(Feature.fmaf), + .name = @tagName(Feature.fmaf), + .llvm_name = "fmaf", + .description = "Enable single precision FMA (not as fast as mul+add, but fused)", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp_exceptions)] = .{ + .index = @enumToInt(Feature.fp_exceptions), + .name = @tagName(Feature.fp_exceptions), + .llvm_name = "fp-exceptions", + .description = "Enable floating point exceptions", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp16_denormals)] = .{ + .index = @enumToInt(Feature.fp16_denormals), + .name = @tagName(Feature.fp16_denormals), + .llvm_name = "fp16-denormals", + .description = "Enable half precision denormal handling", + .dependencies = featureSet(&[_]Feature{ + .fp64_fp16_denormals, + }), + }; + result[@enumToInt(Feature.fp32_denormals)] = .{ + .index = @enumToInt(Feature.fp32_denormals), + .name = @tagName(Feature.fp32_denormals), + .llvm_name = "fp32-denormals", + .description = "Enable single precision denormal handling", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp64)] = .{ + .index = @enumToInt(Feature.fp64), + .name = @tagName(Feature.fp64), + .llvm_name = "fp64", + .description = "Enable double precision operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp64_denormals)] = .{ + .index = @enumToInt(Feature.fp64_denormals), + .name = @tagName(Feature.fp64_denormals), + .llvm_name = "fp64-denormals", + .description = "Enable double and half precision denormal handling", + .dependencies = featureSet(&[_]Feature{ + .fp64, + .fp64_fp16_denormals, + }), + }; + result[@enumToInt(Feature.fp64_fp16_denormals)] = .{ + .index = @enumToInt(Feature.fp64_fp16_denormals), + .name = @tagName(Feature.fp64_fp16_denormals), + .llvm_name = "fp64-fp16-denormals", + .description = "Enable double and half precision denormal handling", + .dependencies = featureSet(&[_]Feature{ + .fp64, + }), + }; + result[@enumToInt(Feature.gcn3_encoding)] = .{ + .index = @enumToInt(Feature.gcn3_encoding), + .name = @tagName(Feature.gcn3_encoding), + .llvm_name = "gcn3-encoding", + .description = "Encoding format for VI", + .dependencies = 0, + }; + result[@enumToInt(Feature.gfx10)] = .{ + .index = @enumToInt(Feature.gfx10), + .name = @tagName(Feature.gfx10), + .llvm_name = "gfx10", + .description = "GFX10 GPU generation", + .dependencies = featureSet(&[_]Feature{ + .@"16_bit_insts", + .add_no_carry_insts, + .aperture_regs, + .ci_insts, + .dpp, + .dpp8, + .fast_fmaf, + .flat_address_space, + .flat_global_insts, + .flat_inst_offsets, + .flat_scratch_insts, + .fma_mix_insts, + .fp64, + .gfx10_insts, + .gfx8_insts, + .gfx9_insts, + .int_clamp_insts, + .inv_2pi_inline_imm, + .localmemorysize65536, + .mimg_r128, + .movrel, + .no_data_dep_hazard, + .no_sdst_cmpx, + .no_sram_ecc_support, + .pk_fmac_f16_inst, + .register_banking, + .s_memrealtime, + .sdwa, + .sdwa_omod, + .sdwa_scalar, + .sdwa_sdst, + .vop3_literal, + .vop3p, + .vscnt, + }), + }; + result[@enumToInt(Feature.gfx10_insts)] = .{ + .index = @enumToInt(Feature.gfx10_insts), + .name = @tagName(Feature.gfx10_insts), + .llvm_name = "gfx10-insts", + .description = "Additional instructions for GFX10+", + .dependencies = 0, + }; + result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{ + .index = @enumToInt(Feature.gfx7_gfx8_gfx9_insts), + .name = @tagName(Feature.gfx7_gfx8_gfx9_insts), + .llvm_name = "gfx7-gfx8-gfx9-insts", + .description = "Instructions shared in GFX7, GFX8, GFX9", + .dependencies = 0, + }; + result[@enumToInt(Feature.gfx8_insts)] = .{ + .index = @enumToInt(Feature.gfx8_insts), + .name = @tagName(Feature.gfx8_insts), + .llvm_name = "gfx8-insts", + .description = "Additional instructions for GFX8+", + .dependencies = 0, + }; + result[@enumToInt(Feature.gfx9)] = .{ + .index = @enumToInt(Feature.gfx9), + .name = @tagName(Feature.gfx9), + .llvm_name = "gfx9", + .description = "GFX9 GPU generation", + .dependencies = featureSet(&[_]Feature{ + .@"16_bit_insts", + .add_no_carry_insts, + .aperture_regs, + .ci_insts, + .dpp, + .fast_fmaf, + .flat_address_space, + .flat_global_insts, + .flat_inst_offsets, + .flat_scratch_insts, + .fp64, + .gcn3_encoding, + .gfx7_gfx8_gfx9_insts, + .gfx8_insts, + .gfx9_insts, + .int_clamp_insts, + .inv_2pi_inline_imm, + .localmemorysize65536, + .r128_a16, + .s_memrealtime, + .scalar_atomics, + .scalar_flat_scratch_insts, + .scalar_stores, + .sdwa, + .sdwa_omod, + .sdwa_scalar, + .sdwa_sdst, + .vgpr_index_mode, + .vop3p, + .wavefrontsize64, + }), + }; + result[@enumToInt(Feature.gfx9_insts)] = .{ + .index = @enumToInt(Feature.gfx9_insts), + .name = @tagName(Feature.gfx9_insts), + .llvm_name = "gfx9-insts", + .description = "Additional instructions for GFX9+", + .dependencies = 0, + }; + result[@enumToInt(Feature.half_rate_64_ops)] = .{ + .index = @enumToInt(Feature.half_rate_64_ops), + .name = @tagName(Feature.half_rate_64_ops), + .llvm_name = "half-rate-64-ops", + .description = "Most fp64 instructions are half rate instead of quarter", + .dependencies = 0, + }; + result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{ + .index = @enumToInt(Feature.inst_fwd_prefetch_bug), + .name = @tagName(Feature.inst_fwd_prefetch_bug), + .llvm_name = "inst-fwd-prefetch-bug", + .description = "S_INST_PREFETCH instruction causes shader to hang", + .dependencies = 0, + }; + result[@enumToInt(Feature.int_clamp_insts)] = .{ + .index = @enumToInt(Feature.int_clamp_insts), + .name = @tagName(Feature.int_clamp_insts), + .llvm_name = "int-clamp-insts", + .description = "Support clamp for integer destination", + .dependencies = 0, + }; + result[@enumToInt(Feature.inv_2pi_inline_imm)] = .{ + .index = @enumToInt(Feature.inv_2pi_inline_imm), + .name = @tagName(Feature.inv_2pi_inline_imm), + .llvm_name = "inv-2pi-inline-imm", + .description = "Has 1 / (2 * pi) as inline immediate", + .dependencies = 0, + }; + result[@enumToInt(Feature.lds_branch_vmem_war_hazard)] = .{ + .index = @enumToInt(Feature.lds_branch_vmem_war_hazard), + .name = @tagName(Feature.lds_branch_vmem_war_hazard), + .llvm_name = "lds-branch-vmem-war-hazard", + .description = "Switching between LDS and VMEM-tex not waiting VM_VSRC=0", + .dependencies = 0, + }; + result[@enumToInt(Feature.lds_misaligned_bug)] = .{ + .index = @enumToInt(Feature.lds_misaligned_bug), + .name = @tagName(Feature.lds_misaligned_bug), + .llvm_name = "lds-misaligned-bug", + .description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.ldsbankcount16)] = .{ + .index = @enumToInt(Feature.ldsbankcount16), + .name = @tagName(Feature.ldsbankcount16), + .llvm_name = "ldsbankcount16", + .description = "The number of LDS banks per compute unit.", + .dependencies = 0, + }; + result[@enumToInt(Feature.ldsbankcount32)] = .{ + .index = @enumToInt(Feature.ldsbankcount32), + .name = @tagName(Feature.ldsbankcount32), + .llvm_name = "ldsbankcount32", + .description = "The number of LDS banks per compute unit.", + .dependencies = 0, + }; + result[@enumToInt(Feature.load_store_opt)] = .{ + .index = @enumToInt(Feature.load_store_opt), + .name = @tagName(Feature.load_store_opt), + .llvm_name = "load-store-opt", + .description = "Enable SI load/store optimizer pass", + .dependencies = 0, + }; + result[@enumToInt(Feature.localmemorysize0)] = .{ + .index = @enumToInt(Feature.localmemorysize0), + .name = @tagName(Feature.localmemorysize0), + .llvm_name = "localmemorysize0", + .description = "The size of local memory in bytes", + .dependencies = 0, + }; + result[@enumToInt(Feature.localmemorysize32768)] = .{ + .index = @enumToInt(Feature.localmemorysize32768), + .name = @tagName(Feature.localmemorysize32768), + .llvm_name = "localmemorysize32768", + .description = "The size of local memory in bytes", + .dependencies = 0, + }; + result[@enumToInt(Feature.localmemorysize65536)] = .{ + .index = @enumToInt(Feature.localmemorysize65536), + .name = @tagName(Feature.localmemorysize65536), + .llvm_name = "localmemorysize65536", + .description = "The size of local memory in bytes", + .dependencies = 0, + }; + result[@enumToInt(Feature.mad_mix_insts)] = .{ + .index = @enumToInt(Feature.mad_mix_insts), + .name = @tagName(Feature.mad_mix_insts), + .llvm_name = "mad-mix-insts", + .description = "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.mai_insts)] = .{ + .index = @enumToInt(Feature.mai_insts), + .name = @tagName(Feature.mai_insts), + .llvm_name = "mai-insts", + .description = "Has mAI instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.max_private_element_size_16)] = .{ + .index = @enumToInt(Feature.max_private_element_size_16), + .name = @tagName(Feature.max_private_element_size_16), + .llvm_name = "max-private-element-size-16", + .description = "Maximum private access size may be 16", + .dependencies = 0, + }; + result[@enumToInt(Feature.max_private_element_size_4)] = .{ + .index = @enumToInt(Feature.max_private_element_size_4), + .name = @tagName(Feature.max_private_element_size_4), + .llvm_name = "max-private-element-size-4", + .description = "Maximum private access size may be 4", + .dependencies = 0, + }; + result[@enumToInt(Feature.max_private_element_size_8)] = .{ + .index = @enumToInt(Feature.max_private_element_size_8), + .name = @tagName(Feature.max_private_element_size_8), + .llvm_name = "max-private-element-size-8", + .description = "Maximum private access size may be 8", + .dependencies = 0, + }; + result[@enumToInt(Feature.mimg_r128)] = .{ + .index = @enumToInt(Feature.mimg_r128), + .name = @tagName(Feature.mimg_r128), + .llvm_name = "mimg-r128", + .description = "Support 128-bit texture resources", + .dependencies = 0, + }; + result[@enumToInt(Feature.movrel)] = .{ + .index = @enumToInt(Feature.movrel), + .name = @tagName(Feature.movrel), + .llvm_name = "movrel", + .description = "Has v_movrel*_b32 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_data_dep_hazard)] = .{ + .index = @enumToInt(Feature.no_data_dep_hazard), + .name = @tagName(Feature.no_data_dep_hazard), + .llvm_name = "no-data-dep-hazard", + .description = "Does not need SW waitstates", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_sdst_cmpx)] = .{ + .index = @enumToInt(Feature.no_sdst_cmpx), + .name = @tagName(Feature.no_sdst_cmpx), + .llvm_name = "no-sdst-cmpx", + .description = "V_CMPX does not write VCC/SGPR in addition to EXEC", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_sram_ecc_support)] = .{ + .index = @enumToInt(Feature.no_sram_ecc_support), + .name = @tagName(Feature.no_sram_ecc_support), + .llvm_name = "no-sram-ecc-support", + .description = "Hardware does not support SRAM ECC", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_xnack_support)] = .{ + .index = @enumToInt(Feature.no_xnack_support), + .name = @tagName(Feature.no_xnack_support), + .llvm_name = "no-xnack-support", + .description = "Hardware does not support XNACK", + .dependencies = 0, + }; + result[@enumToInt(Feature.nsa_encoding)] = .{ + .index = @enumToInt(Feature.nsa_encoding), + .name = @tagName(Feature.nsa_encoding), + .llvm_name = "nsa-encoding", + .description = "Support NSA encoding for image instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.nsa_to_vmem_bug)] = .{ + .index = @enumToInt(Feature.nsa_to_vmem_bug), + .name = @tagName(Feature.nsa_to_vmem_bug), + .llvm_name = "nsa-to-vmem-bug", + .description = "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero", + .dependencies = 0, + }; + result[@enumToInt(Feature.offset_3f_bug)] = .{ + .index = @enumToInt(Feature.offset_3f_bug), + .name = @tagName(Feature.offset_3f_bug), + .llvm_name = "offset-3f-bug", + .description = "Branch offset of 3f hardware bug", + .dependencies = 0, + }; + result[@enumToInt(Feature.pk_fmac_f16_inst)] = .{ + .index = @enumToInt(Feature.pk_fmac_f16_inst), + .name = @tagName(Feature.pk_fmac_f16_inst), + .llvm_name = "pk-fmac-f16-inst", + .description = "Has v_pk_fmac_f16 instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.promote_alloca)] = .{ + .index = @enumToInt(Feature.promote_alloca), + .name = @tagName(Feature.promote_alloca), + .llvm_name = "promote-alloca", + .description = "Enable promote alloca pass", + .dependencies = 0, + }; + result[@enumToInt(Feature.r128_a16)] = .{ + .index = @enumToInt(Feature.r128_a16), + .name = @tagName(Feature.r128_a16), + .llvm_name = "r128-a16", + .description = "Support 16 bit coordindates/gradients/lod/clamp/mip types on gfx9", + .dependencies = 0, + }; + result[@enumToInt(Feature.register_banking)] = .{ + .index = @enumToInt(Feature.register_banking), + .name = @tagName(Feature.register_banking), + .llvm_name = "register-banking", + .description = "Has register banking", + .dependencies = 0, + }; + result[@enumToInt(Feature.s_memrealtime)] = .{ + .index = @enumToInt(Feature.s_memrealtime), + .name = @tagName(Feature.s_memrealtime), + .llvm_name = "s-memrealtime", + .description = "Has s_memrealtime instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.scalar_atomics)] = .{ + .index = @enumToInt(Feature.scalar_atomics), + .name = @tagName(Feature.scalar_atomics), + .llvm_name = "scalar-atomics", + .description = "Has atomic scalar memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.scalar_flat_scratch_insts)] = .{ + .index = @enumToInt(Feature.scalar_flat_scratch_insts), + .name = @tagName(Feature.scalar_flat_scratch_insts), + .llvm_name = "scalar-flat-scratch-insts", + .description = "Have s_scratch_* flat memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.scalar_stores)] = .{ + .index = @enumToInt(Feature.scalar_stores), + .name = @tagName(Feature.scalar_stores), + .llvm_name = "scalar-stores", + .description = "Has store scalar memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa)] = .{ + .index = @enumToInt(Feature.sdwa), + .name = @tagName(Feature.sdwa), + .llvm_name = "sdwa", + .description = "Support SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa_mav)] = .{ + .index = @enumToInt(Feature.sdwa_mav), + .name = @tagName(Feature.sdwa_mav), + .llvm_name = "sdwa-mav", + .description = "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa_omod)] = .{ + .index = @enumToInt(Feature.sdwa_omod), + .name = @tagName(Feature.sdwa_omod), + .llvm_name = "sdwa-omod", + .description = "Support OMod with SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa_out_mods_vopc)] = .{ + .index = @enumToInt(Feature.sdwa_out_mods_vopc), + .name = @tagName(Feature.sdwa_out_mods_vopc), + .llvm_name = "sdwa-out-mods-vopc", + .description = "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa_scalar)] = .{ + .index = @enumToInt(Feature.sdwa_scalar), + .name = @tagName(Feature.sdwa_scalar), + .llvm_name = "sdwa-scalar", + .description = "Support scalar register with SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sdwa_sdst)] = .{ + .index = @enumToInt(Feature.sdwa_sdst), + .name = @tagName(Feature.sdwa_sdst), + .llvm_name = "sdwa-sdst", + .description = "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.sea_islands)] = .{ + .index = @enumToInt(Feature.sea_islands), + .name = @tagName(Feature.sea_islands), + .llvm_name = "sea-islands", + .description = "SEA_ISLANDS GPU generation", + .dependencies = featureSet(&[_]Feature{ + .ci_insts, + .flat_address_space, + .fp64, + .gfx7_gfx8_gfx9_insts, + .localmemorysize65536, + .mimg_r128, + .movrel, + .no_sram_ecc_support, + .trig_reduced_range, + .wavefrontsize64, + }), + }; + result[@enumToInt(Feature.sgpr_init_bug)] = .{ + .index = @enumToInt(Feature.sgpr_init_bug), + .name = @tagName(Feature.sgpr_init_bug), + .llvm_name = "sgpr-init-bug", + .description = "VI SGPR initialization bug requiring a fixed SGPR allocation size", + .dependencies = 0, + }; + result[@enumToInt(Feature.si_scheduler)] = .{ + .index = @enumToInt(Feature.si_scheduler), + .name = @tagName(Feature.si_scheduler), + .llvm_name = "si-scheduler", + .description = "Enable SI Machine Scheduler", + .dependencies = 0, + }; + result[@enumToInt(Feature.smem_to_vector_write_hazard)] = .{ + .index = @enumToInt(Feature.smem_to_vector_write_hazard), + .name = @tagName(Feature.smem_to_vector_write_hazard), + .llvm_name = "smem-to-vector-write-hazard", + .description = "s_load_dword followed by v_cmp page faults", + .dependencies = 0, + }; + result[@enumToInt(Feature.southern_islands)] = .{ + .index = @enumToInt(Feature.southern_islands), + .name = @tagName(Feature.southern_islands), + .llvm_name = "southern-islands", + .description = "SOUTHERN_ISLANDS GPU generation", + .dependencies = featureSet(&[_]Feature{ + .fp64, + .ldsbankcount32, + .localmemorysize32768, + .mimg_r128, + .movrel, + .no_sram_ecc_support, + .no_xnack_support, + .trig_reduced_range, + .wavefrontsize64, + }), + }; + result[@enumToInt(Feature.sram_ecc)] = .{ + .index = @enumToInt(Feature.sram_ecc), + .name = @tagName(Feature.sram_ecc), + .llvm_name = "sram-ecc", + .description = "Enable SRAM ECC", + .dependencies = 0, + }; + result[@enumToInt(Feature.trap_handler)] = .{ + .index = @enumToInt(Feature.trap_handler), + .name = @tagName(Feature.trap_handler), + .llvm_name = "trap-handler", + .description = "Trap handler support", + .dependencies = 0, + }; + result[@enumToInt(Feature.trig_reduced_range)] = .{ + .index = @enumToInt(Feature.trig_reduced_range), + .name = @tagName(Feature.trig_reduced_range), + .llvm_name = "trig-reduced-range", + .description = "Requires use of fract on arguments to trig instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.unaligned_buffer_access)] = .{ + .index = @enumToInt(Feature.unaligned_buffer_access), + .name = @tagName(Feature.unaligned_buffer_access), + .llvm_name = "unaligned-buffer-access", + .description = "Support unaligned global loads and stores", + .dependencies = 0, + }; + result[@enumToInt(Feature.unaligned_scratch_access)] = .{ + .index = @enumToInt(Feature.unaligned_scratch_access), + .name = @tagName(Feature.unaligned_scratch_access), + .llvm_name = "unaligned-scratch-access", + .description = "Support unaligned scratch loads and stores", + .dependencies = 0, + }; + result[@enumToInt(Feature.unpacked_d16_vmem)] = .{ + .index = @enumToInt(Feature.unpacked_d16_vmem), + .name = @tagName(Feature.unpacked_d16_vmem), + .llvm_name = "unpacked-d16-vmem", + .description = "Has unpacked d16 vmem instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.unsafe_ds_offset_folding)] = .{ + .index = @enumToInt(Feature.unsafe_ds_offset_folding), + .name = @tagName(Feature.unsafe_ds_offset_folding), + .llvm_name = "unsafe-ds-offset-folding", + .description = "Force using DS instruction immediate offsets on SI", + .dependencies = 0, + }; + result[@enumToInt(Feature.vcmpx_exec_war_hazard)] = .{ + .index = @enumToInt(Feature.vcmpx_exec_war_hazard), + .name = @tagName(Feature.vcmpx_exec_war_hazard), + .llvm_name = "vcmpx-exec-war-hazard", + .description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)", + .dependencies = 0, + }; + result[@enumToInt(Feature.vcmpx_permlane_hazard)] = .{ + .index = @enumToInt(Feature.vcmpx_permlane_hazard), + .name = @tagName(Feature.vcmpx_permlane_hazard), + .llvm_name = "vcmpx-permlane-hazard", + .description = "TODO: describe me", + .dependencies = 0, + }; + result[@enumToInt(Feature.vgpr_index_mode)] = .{ + .index = @enumToInt(Feature.vgpr_index_mode), + .name = @tagName(Feature.vgpr_index_mode), + .llvm_name = "vgpr-index-mode", + .description = "Has VGPR mode register indexing", + .dependencies = 0, + }; + result[@enumToInt(Feature.vmem_to_scalar_write_hazard)] = .{ + .index = @enumToInt(Feature.vmem_to_scalar_write_hazard), + .name = @tagName(Feature.vmem_to_scalar_write_hazard), + .llvm_name = "vmem-to-scalar-write-hazard", + .description = "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution.", + .dependencies = 0, + }; + result[@enumToInt(Feature.volcanic_islands)] = .{ + .index = @enumToInt(Feature.volcanic_islands), + .name = @tagName(Feature.volcanic_islands), + .llvm_name = "volcanic-islands", + .description = "VOLCANIC_ISLANDS GPU generation", + .dependencies = featureSet(&[_]Feature{ + .@"16_bit_insts", + .ci_insts, + .dpp, + .flat_address_space, + .fp64, + .gcn3_encoding, + .gfx7_gfx8_gfx9_insts, + .gfx8_insts, + .int_clamp_insts, + .inv_2pi_inline_imm, + .localmemorysize65536, + .mimg_r128, + .movrel, + .no_sram_ecc_support, + .s_memrealtime, + .scalar_stores, + .sdwa, + .sdwa_mav, + .sdwa_out_mods_vopc, + .trig_reduced_range, + .vgpr_index_mode, + .wavefrontsize64, + }), + }; + result[@enumToInt(Feature.vop3_literal)] = .{ + .index = @enumToInt(Feature.vop3_literal), + .name = @tagName(Feature.vop3_literal), + .llvm_name = "vop3-literal", + .description = "Can use one literal in VOP3", + .dependencies = 0, + }; + result[@enumToInt(Feature.vop3p)] = .{ + .index = @enumToInt(Feature.vop3p), + .name = @tagName(Feature.vop3p), + .llvm_name = "vop3p", + .description = "Has VOP3P packed instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.vscnt)] = .{ + .index = @enumToInt(Feature.vscnt), + .name = @tagName(Feature.vscnt), + .llvm_name = "vscnt", + .description = "Has separate store vscnt counter", + .dependencies = 0, + }; + result[@enumToInt(Feature.wavefrontsize16)] = .{ + .index = @enumToInt(Feature.wavefrontsize16), + .name = @tagName(Feature.wavefrontsize16), + .llvm_name = "wavefrontsize16", + .description = "The number of threads per wavefront", + .dependencies = 0, + }; + result[@enumToInt(Feature.wavefrontsize32)] = .{ + .index = @enumToInt(Feature.wavefrontsize32), + .name = @tagName(Feature.wavefrontsize32), + .llvm_name = "wavefrontsize32", + .description = "The number of threads per wavefront", + .dependencies = 0, + }; + result[@enumToInt(Feature.wavefrontsize64)] = .{ + .index = @enumToInt(Feature.wavefrontsize64), + .name = @tagName(Feature.wavefrontsize64), + .llvm_name = "wavefrontsize64", + .description = "The number of threads per wavefront", + .dependencies = 0, + }; + result[@enumToInt(Feature.xnack)] = .{ + .index = @enumToInt(Feature.xnack), + .name = @tagName(Feature.xnack), + .llvm_name = "xnack", + .description = "Enable XNACK support", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const bonaire = Cpu{ + .name = "bonaire", + .llvm_name = "bonaire", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const carrizo = Cpu{ + .name = "carrizo", + .llvm_name = "carrizo", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .unpacked_d16_vmem, + .volcanic_islands, + .xnack, + }), + }; + pub const fiji = Cpu{ + .name = "fiji", + .llvm_name = "fiji", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = featureSet(&[_]Feature{ + .wavefrontsize64, + }), + }; + pub const generic_hsa = Cpu{ + .name = "generic_hsa", + .llvm_name = "generic-hsa", + .features = featureSet(&[_]Feature{ + .flat_address_space, + .wavefrontsize64, + }), + }; + pub const gfx1010 = Cpu{ + .name = "gfx1010", + .llvm_name = "gfx1010", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .dl_insts, + .flat_segment_offset_bug, + .gfx10, + .inst_fwd_prefetch_bug, + .lds_branch_vmem_war_hazard, + .lds_misaligned_bug, + .ldsbankcount32, + .no_xnack_support, + .nsa_encoding, + .nsa_to_vmem_bug, + .offset_3f_bug, + .scalar_atomics, + .scalar_flat_scratch_insts, + .scalar_stores, + .smem_to_vector_write_hazard, + .vcmpx_exec_war_hazard, + .vcmpx_permlane_hazard, + .vmem_to_scalar_write_hazard, + .wavefrontsize32, + }), + }; + pub const gfx1011 = Cpu{ + .name = "gfx1011", + .llvm_name = "gfx1011", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .dl_insts, + .dot1_insts, + .dot2_insts, + .dot5_insts, + .dot6_insts, + .flat_segment_offset_bug, + .gfx10, + .inst_fwd_prefetch_bug, + .lds_branch_vmem_war_hazard, + .ldsbankcount32, + .no_xnack_support, + .nsa_encoding, + .nsa_to_vmem_bug, + .offset_3f_bug, + .scalar_atomics, + .scalar_flat_scratch_insts, + .scalar_stores, + .smem_to_vector_write_hazard, + .vcmpx_exec_war_hazard, + .vcmpx_permlane_hazard, + .vmem_to_scalar_write_hazard, + .wavefrontsize32, + }), + }; + pub const gfx1012 = Cpu{ + .name = "gfx1012", + .llvm_name = "gfx1012", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .dl_insts, + .dot1_insts, + .dot2_insts, + .dot5_insts, + .dot6_insts, + .flat_segment_offset_bug, + .gfx10, + .inst_fwd_prefetch_bug, + .lds_branch_vmem_war_hazard, + .lds_misaligned_bug, + .ldsbankcount32, + .no_xnack_support, + .nsa_encoding, + .nsa_to_vmem_bug, + .offset_3f_bug, + .scalar_atomics, + .scalar_flat_scratch_insts, + .scalar_stores, + .smem_to_vector_write_hazard, + .vcmpx_exec_war_hazard, + .vcmpx_permlane_hazard, + .vmem_to_scalar_write_hazard, + .wavefrontsize32, + }), + }; + pub const gfx600 = Cpu{ + .name = "gfx600", + .llvm_name = "gfx600", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const gfx601 = Cpu{ + .name = "gfx601", + .llvm_name = "gfx601", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const gfx700 = Cpu{ + .name = "gfx700", + .llvm_name = "gfx700", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const gfx701 = Cpu{ + .name = "gfx701", + .llvm_name = "gfx701", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const gfx702 = Cpu{ + .name = "gfx702", + .llvm_name = "gfx702", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .ldsbankcount16, + .no_xnack_support, + .sea_islands, + }), + }; + pub const gfx703 = Cpu{ + .name = "gfx703", + .llvm_name = "gfx703", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount16, + .no_xnack_support, + .sea_islands, + }), + }; + pub const gfx704 = Cpu{ + .name = "gfx704", + .llvm_name = "gfx704", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const gfx801 = Cpu{ + .name = "gfx801", + .llvm_name = "gfx801", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .unpacked_d16_vmem, + .volcanic_islands, + .xnack, + }), + }; + pub const gfx802 = Cpu{ + .name = "gfx802", + .llvm_name = "gfx802", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sgpr_init_bug, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const gfx803 = Cpu{ + .name = "gfx803", + .llvm_name = "gfx803", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const gfx810 = Cpu{ + .name = "gfx810", + .llvm_name = "gfx810", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount16, + .volcanic_islands, + .xnack, + }), + }; + pub const gfx900 = Cpu{ + .name = "gfx900", + .llvm_name = "gfx900", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .gfx9, + .ldsbankcount32, + .mad_mix_insts, + .no_sram_ecc_support, + .no_xnack_support, + }), + }; + pub const gfx902 = Cpu{ + .name = "gfx902", + .llvm_name = "gfx902", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .gfx9, + .ldsbankcount32, + .mad_mix_insts, + .no_sram_ecc_support, + .xnack, + }), + }; + pub const gfx904 = Cpu{ + .name = "gfx904", + .llvm_name = "gfx904", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fma_mix_insts, + .gfx9, + .ldsbankcount32, + .no_sram_ecc_support, + .no_xnack_support, + }), + }; + pub const gfx906 = Cpu{ + .name = "gfx906", + .llvm_name = "gfx906", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .dl_insts, + .dot1_insts, + .dot2_insts, + .fma_mix_insts, + .gfx9, + .half_rate_64_ops, + .ldsbankcount32, + .no_xnack_support, + }), + }; + pub const gfx908 = Cpu{ + .name = "gfx908", + .llvm_name = "gfx908", + .features = featureSet(&[_]Feature{ + .atomic_fadd_insts, + .code_object_v3, + .dl_insts, + .dot1_insts, + .dot2_insts, + .dot3_insts, + .dot4_insts, + .dot5_insts, + .dot6_insts, + .fma_mix_insts, + .gfx9, + .half_rate_64_ops, + .ldsbankcount32, + .mai_insts, + .pk_fmac_f16_inst, + .sram_ecc, + }), + }; + pub const gfx909 = Cpu{ + .name = "gfx909", + .llvm_name = "gfx909", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .gfx9, + .ldsbankcount32, + .mad_mix_insts, + .xnack, + }), + }; + pub const hainan = Cpu{ + .name = "hainan", + .llvm_name = "hainan", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const hawaii = Cpu{ + .name = "hawaii", + .llvm_name = "hawaii", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const iceland = Cpu{ + .name = "iceland", + .llvm_name = "iceland", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sgpr_init_bug, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const kabini = Cpu{ + .name = "kabini", + .llvm_name = "kabini", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount16, + .no_xnack_support, + .sea_islands, + }), + }; + pub const kaveri = Cpu{ + .name = "kaveri", + .llvm_name = "kaveri", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sea_islands, + }), + }; + pub const mullins = Cpu{ + .name = "mullins", + .llvm_name = "mullins", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount16, + .no_xnack_support, + .sea_islands, + }), + }; + pub const oland = Cpu{ + .name = "oland", + .llvm_name = "oland", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const pitcairn = Cpu{ + .name = "pitcairn", + .llvm_name = "pitcairn", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const polaris10 = Cpu{ + .name = "polaris10", + .llvm_name = "polaris10", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const polaris11 = Cpu{ + .name = "polaris11", + .llvm_name = "polaris11", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const stoney = Cpu{ + .name = "stoney", + .llvm_name = "stoney", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount16, + .volcanic_islands, + .xnack, + }), + }; + pub const tahiti = Cpu{ + .name = "tahiti", + .llvm_name = "tahiti", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .fast_fmaf, + .half_rate_64_ops, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; + pub const tonga = Cpu{ + .name = "tonga", + .llvm_name = "tonga", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .sgpr_init_bug, + .unpacked_d16_vmem, + .volcanic_islands, + }), + }; + pub const verde = Cpu{ + .name = "verde", + .llvm_name = "verde", + .features = featureSet(&[_]Feature{ + .code_object_v3, + .ldsbankcount32, + .no_xnack_support, + .southern_islands, + }), + }; +}; + +/// All amdgpu CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.bonaire, + &cpu.carrizo, + &cpu.fiji, + &cpu.generic, + &cpu.generic_hsa, + &cpu.gfx1010, + &cpu.gfx1011, + &cpu.gfx1012, + &cpu.gfx600, + &cpu.gfx601, + &cpu.gfx700, + &cpu.gfx701, + &cpu.gfx702, + &cpu.gfx703, + &cpu.gfx704, + &cpu.gfx801, + &cpu.gfx802, + &cpu.gfx803, + &cpu.gfx810, + &cpu.gfx900, + &cpu.gfx902, + &cpu.gfx904, + &cpu.gfx906, + &cpu.gfx908, + &cpu.gfx909, + &cpu.hainan, + &cpu.hawaii, + &cpu.iceland, + &cpu.kabini, + &cpu.kaveri, + &cpu.mullins, + &cpu.oland, + &cpu.pitcairn, + &cpu.polaris10, + &cpu.polaris11, + &cpu.stoney, + &cpu.tahiti, + &cpu.tonga, + &cpu.verde, }; diff --git a/lib/std/target/arm.zig b/lib/std/target/arm.zig index d83be5cc48..de4bd0ed78 100644 --- a/lib/std/target/arm.zig +++ b/lib/std/target/arm.zig @@ -1,2296 +1,2675 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_msecext8 = Feature{ - .name = "msecext8", - .llvm_name = "8msecext", - .description = "Enable support for ARMv8-M Security Extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_aclass = Feature{ - .name = "aclass", - .llvm_name = "aclass", - .description = "Is application profile ('A' series)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_aes = Feature{ - .name = "aes", - .llvm_name = "aes", - .description = "Enable AES support", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_acquireRelease = Feature{ - .name = "acquireRelease", - .llvm_name = "acquire-release", - .description = "Has v8 acquire/release (lda/ldaex etc) instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_avoidMovsShop = Feature{ - .name = "avoidMovsShop", - .llvm_name = "avoid-movs-shop", - .description = "Avoid movs instructions with shifter operand", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_avoidPartialCpsr = Feature{ - .name = "avoidPartialCpsr", - .llvm_name = "avoid-partial-cpsr", - .description = "Avoid CPSR partial update for OOO execution", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_crc = Feature{ - .name = "crc", - .llvm_name = "crc", - .description = "Enable support for CRC instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_cheapPredicableCpsr = Feature{ - .name = "cheapPredicableCpsr", - .llvm_name = "cheap-predicable-cpsr", - .description = "Disable +1 predication cost for instructions updating CPSR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vldnAlign = Feature{ - .name = "vldnAlign", - .llvm_name = "vldn-align", - .description = "Check for VLDn unaligned access", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_crypto = Feature{ - .name = "crypto", - .llvm_name = "crypto", - .description = "Enable support for Cryptography extensions", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_fpregs, - }, -}; - -pub const feature_d32 = Feature{ - .name = "d32", - .llvm_name = "d32", - .description = "Extend FP to 32 double registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_db = Feature{ - .name = "db", - .llvm_name = "db", - .description = "Has data barrier (dmb/dsb) instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dfb = Feature{ - .name = "dfb", - .llvm_name = "dfb", - .description = "Has full data barrier (dfb) instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dsp = Feature{ - .name = "dsp", - .llvm_name = "dsp", - .description = "Supports DSP instructions in ARM and/or Thumb2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dontWidenVmovs = Feature{ - .name = "dontWidenVmovs", - .llvm_name = "dont-widen-vmovs", - .description = "Don't widen VMOVS to VMOVD", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dotprod = Feature{ - .name = "dotprod", - .llvm_name = "dotprod", - .description = "Enable support for dot product instructions", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_executeOnly = Feature{ - .name = "executeOnly", - .llvm_name = "execute-only", - .description = "Enable the generation of execute only code.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_expandFpMlx = Feature{ - .name = "expandFpMlx", - .llvm_name = "expand-fp-mlx", - .description = "Expand VFP/NEON MLA/MLS instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp16 = Feature{ - .name = "fp16", - .llvm_name = "fp16", - .description = "Enable half-precision floating point", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp16fml = Feature{ - .name = "fp16fml", - .llvm_name = "fp16fml", - .description = "Enable full half-precision floating point fml instructions", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_fp64 = Feature{ - .name = "fp64", - .llvm_name = "fp64", - .description = "Floating point unit supports double precision", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_fpao = Feature{ - .name = "fpao", - .llvm_name = "fpao", - .description = "Enable fast computation of positive address offsets", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fpArmv8 = Feature{ - .name = "fpArmv8", - .llvm_name = "fp-armv8", - .description = "Enable ARMv8 FP", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_d32, - &feature_fpregs, - }, -}; - -pub const feature_fpArmv8d16 = Feature{ - .name = "fpArmv8d16", - .llvm_name = "fp-armv8d16", - .description = "Enable ARMv8 FP with only 16 d-registers", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_fpArmv8d16sp = Feature{ - .name = "fpArmv8d16sp", - .llvm_name = "fp-armv8d16sp", - .description = "Enable ARMv8 FP with only 16 d-registers and no double precision", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_fpArmv8sp = Feature{ - .name = "fpArmv8sp", - .llvm_name = "fp-armv8sp", - .description = "Enable ARMv8 FP with no double precision", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_fpregs = Feature{ - .name = "fpregs", - .llvm_name = "fpregs", - .description = "Enable FP registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fpregs16 = Feature{ - .name = "fpregs16", - .llvm_name = "fpregs16", - .description = "Enable 16-bit FP registers", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_fpregs64 = Feature{ - .name = "fpregs64", - .llvm_name = "fpregs64", - .description = "Enable 64-bit FP registers", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_fullfp16 = Feature{ - .name = "fullfp16", - .llvm_name = "fullfp16", - .description = "Enable full half-precision floating point", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_fuseAes = Feature{ - .name = "fuseAes", - .llvm_name = "fuse-aes", - .description = "CPU fuses AES crypto operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fuseLiterals = Feature{ - .name = "fuseLiterals", - .llvm_name = "fuse-literals", - .description = "CPU fuses literal generation operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_hwdivArm = Feature{ - .name = "hwdivArm", - .llvm_name = "hwdiv-arm", - .description = "Enable divide instructions in ARM mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_hwdiv = Feature{ - .name = "hwdiv", - .llvm_name = "hwdiv", - .description = "Enable divide instructions in Thumb", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noBranchPredictor = Feature{ - .name = "noBranchPredictor", - .llvm_name = "no-branch-predictor", - .description = "Has no branch predictor", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_retAddrStack = Feature{ - .name = "retAddrStack", - .llvm_name = "ret-addr-stack", - .description = "Has return address stack", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowfpvmlx = Feature{ - .name = "slowfpvmlx", - .llvm_name = "slowfpvmlx", - .description = "Disable VFP / NEON MAC instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vmlxHazards = Feature{ - .name = "vmlxHazards", - .llvm_name = "vmlx-hazards", - .description = "Has VMLx hazards", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lob = Feature{ - .name = "lob", - .llvm_name = "lob", - .description = "Enable Low Overhead Branch extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_longCalls = Feature{ - .name = "longCalls", - .llvm_name = "long-calls", - .description = "Generate calls via indirect call instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mclass = Feature{ - .name = "mclass", - .llvm_name = "mclass", - .description = "Is microcontroller profile ('M' series)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mp = Feature{ - .name = "mp", - .llvm_name = "mp", - .description = "Supports Multiprocessing extension", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_muxedUnits = Feature{ - .name = "muxedUnits", - .llvm_name = "muxed-units", - .description = "Has muxed AGU and NEON/FPU", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_neon = Feature{ - .name = "neon", - .llvm_name = "neon", - .description = "Enable NEON instructions", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_fpregs, - }, -}; - -pub const feature_neonfp = Feature{ - .name = "neonfp", - .llvm_name = "neonfp", - .description = "Use NEON for single precision FP", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_neonFpmovs = Feature{ - .name = "neonFpmovs", - .llvm_name = "neon-fpmovs", - .description = "Convert VMOVSR, VMOVRS, VMOVS to NEON", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_naclTrap = Feature{ - .name = "naclTrap", - .llvm_name = "nacl-trap", - .description = "NaCl trap", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noarm = Feature{ - .name = "noarm", - .llvm_name = "noarm", - .description = "Does not support ARM mode execution", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noMovt = Feature{ - .name = "noMovt", - .llvm_name = "no-movt", - .description = "Don't use movt/movw pairs for 32-bit imms", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noNegImmediates = Feature{ - .name = "noNegImmediates", - .llvm_name = "no-neg-immediates", - .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_disablePostraScheduler = Feature{ - .name = "disablePostraScheduler", - .llvm_name = "disable-postra-scheduler", - .description = "Don't schedule again after register allocation", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nonpipelinedVfp = Feature{ - .name = "nonpipelinedVfp", - .llvm_name = "nonpipelined-vfp", - .description = "VFP instructions are not pipelined", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_perfmon = Feature{ - .name = "perfmon", - .llvm_name = "perfmon", - .description = "Enable support for Performance Monitor extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_bit32 = Feature{ - .name = "bit32", - .llvm_name = "32bit", - .description = "Prefer 32-bit Thumb instrs", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_preferIshst = Feature{ - .name = "preferIshst", - .llvm_name = "prefer-ishst", - .description = "Prefer ISHST barriers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loopAlign = Feature{ - .name = "loopAlign", - .llvm_name = "loop-align", - .description = "Prefer 32-bit alignment for loops", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_preferVmovsr = Feature{ - .name = "preferVmovsr", - .llvm_name = "prefer-vmovsr", - .description = "Prefer VMOVSR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_profUnpr = Feature{ - .name = "profUnpr", - .llvm_name = "prof-unpr", - .description = "Is profitable to unpredicate", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ras = Feature{ - .name = "ras", - .llvm_name = "ras", - .description = "Enable Reliability, Availability and Serviceability extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_rclass = Feature{ - .name = "rclass", - .llvm_name = "rclass", - .description = "Is realtime profile ('R' series)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_readTpHard = Feature{ - .name = "readTpHard", - .llvm_name = "read-tp-hard", - .description = "Reading thread pointer from register", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reserveR9 = Feature{ - .name = "reserveR9", - .llvm_name = "reserve-r9", - .description = "Reserve R9, making it unavailable as GPR", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sb = Feature{ - .name = "sb", - .llvm_name = "sb", - .description = "Enable v8.5a Speculation Barrier", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sha2 = Feature{ - .name = "sha2", - .llvm_name = "sha2", - .description = "Enable SHA1 and SHA256 support", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_slowFpBrcc = Feature{ - .name = "slowFpBrcc", - .llvm_name = "slow-fp-brcc", - .description = "FP compare + branch is slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowLoadDSubreg = Feature{ - .name = "slowLoadDSubreg", - .llvm_name = "slow-load-D-subreg", - .description = "Loading into D subregs is slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowOddReg = Feature{ - .name = "slowOddReg", - .llvm_name = "slow-odd-reg", - .description = "VLDM/VSTM starting with an odd register is slow", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowVdup32 = Feature{ - .name = "slowVdup32", - .llvm_name = "slow-vdup32", - .description = "Has slow VDUP32 - prefer VMOV", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowVgetlni32 = Feature{ - .name = "slowVgetlni32", - .llvm_name = "slow-vgetlni32", - .description = "Has slow VGETLNi32 - prefer VMOV", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_splatVfpNeon = Feature{ - .name = "splatVfpNeon", - .llvm_name = "splat-vfp-neon", - .description = "Splat register from VFP to NEON", - .dependencies = &[_]*const Feature { - &feature_dontWidenVmovs, - }, -}; - -pub const feature_strictAlign = Feature{ - .name = "strictAlign", - .llvm_name = "strict-align", - .description = "Disallow all unaligned memory access", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_thumb2 = Feature{ - .name = "thumb2", - .llvm_name = "thumb2", - .description = "Enable Thumb2 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_trustzone = Feature{ - .name = "trustzone", - .llvm_name = "trustzone", - .description = "Enable support for TrustZone security extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useAa = Feature{ - .name = "useAa", - .llvm_name = "use-aa", - .description = "Use alias analysis during codegen", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useMisched = Feature{ - .name = "useMisched", - .llvm_name = "use-misched", - .description = "Use the MachineScheduler", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_wideStrideVfp = Feature{ - .name = "wideStrideVfp", - .llvm_name = "wide-stride-vfp", - .description = "Use a wide stride when allocating VFP registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_v7clrex = Feature{ - .name = "v7clrex", - .llvm_name = "v7clrex", - .description = "Has v7 clrex instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vfp2 = Feature{ - .name = "vfp2", - .llvm_name = "vfp2", - .description = "Enable VFP2 instructions", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_fpregs, - }, -}; - -pub const feature_vfp2d16 = Feature{ - .name = "vfp2d16", - .llvm_name = "vfp2d16", - .description = "Enable VFP2 instructions with only 16 d-registers", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_vfp2d16sp = Feature{ - .name = "vfp2d16sp", - .llvm_name = "vfp2d16sp", - .description = "Enable VFP2 instructions with only 16 d-registers and no double precision", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_vfp2sp = Feature{ - .name = "vfp2sp", - .llvm_name = "vfp2sp", - .description = "Enable VFP2 instructions with no double precision", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_vfp3 = Feature{ - .name = "vfp3", - .llvm_name = "vfp3", - .description = "Enable VFP3 instructions", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_vfp3d16 = Feature{ - .name = "vfp3d16", - .llvm_name = "vfp3d16", - .description = "Enable VFP3 instructions with only 16 d-registers", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_vfp3d16sp = Feature{ - .name = "vfp3d16sp", - .llvm_name = "vfp3d16sp", - .description = "Enable VFP3 instructions with only 16 d-registers and no double precision", - .dependencies = &[_]*const Feature { - &feature_fpregs, - }, -}; - -pub const feature_vfp3sp = Feature{ - .name = "vfp3sp", - .llvm_name = "vfp3sp", - .description = "Enable VFP3 instructions with no double precision", - .dependencies = &[_]*const Feature { - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_vfp4 = Feature{ - .name = "vfp4", - .llvm_name = "vfp4", - .description = "Enable VFP4 instructions", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_d32, - &feature_fpregs, - }, -}; - -pub const feature_vfp4d16 = Feature{ - .name = "vfp4d16", - .llvm_name = "vfp4d16", - .description = "Enable VFP4 instructions with only 16 d-registers", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_vfp4d16sp = Feature{ - .name = "vfp4d16sp", - .llvm_name = "vfp4d16sp", - .description = "Enable VFP4 instructions with only 16 d-registers and no double precision", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - }, -}; - -pub const feature_vfp4sp = Feature{ - .name = "vfp4sp", - .llvm_name = "vfp4sp", - .description = "Enable VFP4 instructions with no double precision", - .dependencies = &[_]*const Feature { - &feature_fp16, - &feature_fpregs, - &feature_d32, - }, -}; - -pub const feature_vmlxForwarding = Feature{ - .name = "vmlxForwarding", - .llvm_name = "vmlx-forwarding", - .description = "Has multiplier accumulator forwarding", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_virtualization = Feature{ - .name = "virtualization", - .llvm_name = "virtualization", - .description = "Supports Virtualization extension", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_hwdivArm, - }, -}; - -pub const feature_zcz = Feature{ - .name = "zcz", - .llvm_name = "zcz", - .description = "Has zero-cycle zeroing instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_msecext8, - &feature_aclass, - &feature_aes, - &feature_acquireRelease, - &feature_avoidMovsShop, - &feature_avoidPartialCpsr, - &feature_crc, - &feature_cheapPredicableCpsr, - &feature_vldnAlign, - &feature_crypto, - &feature_d32, - &feature_db, - &feature_dfb, - &feature_dsp, - &feature_dontWidenVmovs, - &feature_dotprod, - &feature_executeOnly, - &feature_expandFpMlx, - &feature_fp16, - &feature_fp16fml, - &feature_fp64, - &feature_fpao, - &feature_fpArmv8, - &feature_fpArmv8d16, - &feature_fpArmv8d16sp, - &feature_fpArmv8sp, - &feature_fpregs, - &feature_fpregs16, - &feature_fpregs64, - &feature_fullfp16, - &feature_fuseAes, - &feature_fuseLiterals, - &feature_hwdivArm, - &feature_hwdiv, - &feature_noBranchPredictor, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_vmlxHazards, - &feature_lob, - &feature_longCalls, - &feature_mclass, - &feature_mp, - &feature_muxedUnits, - &feature_neon, - &feature_neonfp, - &feature_neonFpmovs, - &feature_naclTrap, - &feature_noarm, - &feature_noMovt, - &feature_noNegImmediates, - &feature_disablePostraScheduler, - &feature_nonpipelinedVfp, - &feature_perfmon, - &feature_bit32, - &feature_preferIshst, - &feature_loopAlign, - &feature_preferVmovsr, - &feature_profUnpr, - &feature_ras, - &feature_rclass, - &feature_readTpHard, - &feature_reserveR9, - &feature_sb, - &feature_sha2, - &feature_slowFpBrcc, - &feature_slowLoadDSubreg, - &feature_slowOddReg, - &feature_slowVdup32, - &feature_slowVgetlni32, - &feature_splatVfpNeon, - &feature_strictAlign, - &feature_thumb2, - &feature_trustzone, - &feature_useAa, - &feature_useMisched, - &feature_wideStrideVfp, - &feature_v7clrex, - &feature_vfp2, - &feature_vfp2d16, - &feature_vfp2d16sp, - &feature_vfp2sp, - &feature_vfp3, - &feature_vfp3d16, - &feature_vfp3d16sp, - &feature_vfp3sp, - &feature_vfp4, - &feature_vfp4d16, - &feature_vfp4d16sp, - &feature_vfp4sp, - &feature_vmlxForwarding, - &feature_virtualization, - &feature_zcz, -}; - -pub const cpu_arm1020e = Cpu{ - .name = "arm1020e", - .llvm_name = "arm1020e", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm1020t = Cpu{ - .name = "arm1020t", - .llvm_name = "arm1020t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm1022e = Cpu{ - .name = "arm1022e", - .llvm_name = "arm1022e", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm10e = Cpu{ - .name = "arm10e", - .llvm_name = "arm10e", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm10tdmi = Cpu{ - .name = "arm10tdmi", - .llvm_name = "arm10tdmi", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm1136jS = Cpu{ - .name = "arm1136jS", - .llvm_name = "arm1136j-s", - .dependencies = &[_]*const Feature { - &feature_dsp, - }, -}; - -pub const cpu_arm1136jfS = Cpu{ - .name = "arm1136jfS", - .llvm_name = "arm1136jf-s", - .dependencies = &[_]*const Feature { - &feature_dsp, - &feature_slowfpvmlx, - &feature_d32, - &feature_fpregs, - &feature_vfp2, - }, -}; - -pub const cpu_arm1156t2S = Cpu{ - .name = "arm1156t2S", - .llvm_name = "arm1156t2-s", - .dependencies = &[_]*const Feature { - &feature_dsp, - &feature_thumb2, - }, -}; - -pub const cpu_arm1156t2fS = Cpu{ - .name = "arm1156t2fS", - .llvm_name = "arm1156t2f-s", - .dependencies = &[_]*const Feature { - &feature_dsp, - &feature_thumb2, - &feature_slowfpvmlx, - &feature_d32, - &feature_fpregs, - &feature_vfp2, - }, -}; - -pub const cpu_arm1176jS = Cpu{ - .name = "arm1176jS", - .llvm_name = "arm1176j-s", - .dependencies = &[_]*const Feature { - &feature_trustzone, - }, -}; - -pub const cpu_arm1176jzS = Cpu{ - .name = "arm1176jzS", - .llvm_name = "arm1176jz-s", - .dependencies = &[_]*const Feature { - &feature_trustzone, - }, -}; - -pub const cpu_arm1176jzfS = Cpu{ - .name = "arm1176jzfS", - .llvm_name = "arm1176jzf-s", - .dependencies = &[_]*const Feature { - &feature_trustzone, - &feature_slowfpvmlx, - &feature_d32, - &feature_fpregs, - &feature_vfp2, - }, -}; - -pub const cpu_arm710t = Cpu{ - .name = "arm710t", - .llvm_name = "arm710t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm720t = Cpu{ - .name = "arm720t", - .llvm_name = "arm720t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm7tdmi = Cpu{ - .name = "arm7tdmi", - .llvm_name = "arm7tdmi", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm7tdmiS = Cpu{ - .name = "arm7tdmiS", - .llvm_name = "arm7tdmi-s", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm8 = Cpu{ - .name = "arm8", - .llvm_name = "arm8", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm810 = Cpu{ - .name = "arm810", - .llvm_name = "arm810", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm9 = Cpu{ - .name = "arm9", - .llvm_name = "arm9", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm920 = Cpu{ - .name = "arm920", - .llvm_name = "arm920", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm920t = Cpu{ - .name = "arm920t", - .llvm_name = "arm920t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm922t = Cpu{ - .name = "arm922t", - .llvm_name = "arm922t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm926ejS = Cpu{ - .name = "arm926ejS", - .llvm_name = "arm926ej-s", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm940t = Cpu{ - .name = "arm940t", - .llvm_name = "arm940t", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm946eS = Cpu{ - .name = "arm946eS", - .llvm_name = "arm946e-s", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm966eS = Cpu{ - .name = "arm966eS", - .llvm_name = "arm966e-s", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm968eS = Cpu{ - .name = "arm968eS", - .llvm_name = "arm968e-s", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm9e = Cpu{ - .name = "arm9e", - .llvm_name = "arm9e", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arm9tdmi = Cpu{ - .name = "arm9tdmi", - .llvm_name = "arm9tdmi", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_cortexA12 = Cpu{ - .name = "cortexA12", - .llvm_name = "cortex-a12", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_retAddrStack, - &feature_mp, - &feature_trustzone, - &feature_fp16, - &feature_vfp4, - &feature_vmlxForwarding, - &feature_hwdiv, - &feature_hwdivArm, - &feature_virtualization, - }, -}; - -pub const cpu_cortexA15 = Cpu{ - .name = "cortexA15", - .llvm_name = "cortex-a15", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_vldnAlign, - &feature_dontWidenVmovs, - &feature_retAddrStack, - &feature_mp, - &feature_muxedUnits, - &feature_splatVfpNeon, - &feature_trustzone, - &feature_fp16, - &feature_vfp4, - &feature_hwdiv, - &feature_hwdivArm, - &feature_virtualization, - }, -}; - -pub const cpu_cortexA17 = Cpu{ - .name = "cortexA17", - .llvm_name = "cortex-a17", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_retAddrStack, - &feature_mp, - &feature_trustzone, - &feature_fp16, - &feature_vfp4, - &feature_vmlxForwarding, - &feature_hwdiv, - &feature_hwdivArm, - &feature_virtualization, - }, -}; - -pub const cpu_cortexA32 = Cpu{ - .name = "cortexA32", - .llvm_name = "cortex-a32", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - }, -}; - -pub const cpu_cortexA35 = Cpu{ - .name = "cortexA35", - .llvm_name = "cortex-a35", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - }, -}; - -pub const cpu_cortexA5 = Cpu{ - .name = "cortexA5", - .llvm_name = "cortex-a5", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_mp, - &feature_slowFpBrcc, - &feature_trustzone, - &feature_fp16, - &feature_vfp4, - &feature_vmlxForwarding, - }, -}; - -pub const cpu_cortexA53 = Cpu{ - .name = "cortexA53", - .llvm_name = "cortex-a53", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - &feature_fpao, - }, -}; - -pub const cpu_cortexA55 = Cpu{ - .name = "cortexA55", - .llvm_name = "cortex-a55", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_dotprod, - }, -}; - -pub const cpu_cortexA57 = Cpu{ - .name = "cortexA57", - .llvm_name = "cortex-a57", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_avoidPartialCpsr, - &feature_cheapPredicableCpsr, - &feature_crypto, - &feature_fpao, - }, -}; - -pub const cpu_cortexA7 = Cpu{ - .name = "cortexA7", - .llvm_name = "cortex-a7", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_vmlxHazards, - &feature_mp, - &feature_slowFpBrcc, - &feature_trustzone, - &feature_fp16, - &feature_vfp4, - &feature_vmlxForwarding, - &feature_hwdiv, - &feature_hwdivArm, - &feature_virtualization, - }, -}; - -pub const cpu_cortexA72 = Cpu{ - .name = "cortexA72", - .llvm_name = "cortex-a72", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - }, -}; - -pub const cpu_cortexA73 = Cpu{ - .name = "cortexA73", - .llvm_name = "cortex-a73", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - }, -}; - -pub const cpu_cortexA75 = Cpu{ - .name = "cortexA75", - .llvm_name = "cortex-a75", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_dotprod, - }, -}; - -pub const cpu_cortexA76 = Cpu{ - .name = "cortexA76", - .llvm_name = "cortex-a76", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_crypto, - &feature_dotprod, - &feature_fullfp16, - }, -}; - -pub const cpu_cortexA76ae = Cpu{ - .name = "cortexA76ae", - .llvm_name = "cortex-a76ae", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_crypto, - &feature_dotprod, - &feature_fullfp16, - }, -}; - -pub const cpu_cortexA8 = Cpu{ - .name = "cortexA8", - .llvm_name = "cortex-a8", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_vmlxHazards, - &feature_nonpipelinedVfp, - &feature_slowFpBrcc, - &feature_trustzone, - &feature_vmlxForwarding, - }, -}; - -pub const cpu_cortexA9 = Cpu{ - .name = "cortexA9", - .llvm_name = "cortex-a9", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_vldnAlign, - &feature_expandFpMlx, - &feature_fp16, - &feature_retAddrStack, - &feature_vmlxHazards, - &feature_mp, - &feature_muxedUnits, - &feature_neonFpmovs, - &feature_preferVmovsr, - &feature_trustzone, - &feature_vmlxForwarding, - }, -}; - -pub const cpu_cortexM0 = Cpu{ - .name = "cortexM0", - .llvm_name = "cortex-m0", - .dependencies = &[_]*const Feature { - &feature_mclass, - &feature_db, - &feature_noarm, - &feature_strictAlign, - }, -}; - -pub const cpu_cortexM0plus = Cpu{ - .name = "cortexM0plus", - .llvm_name = "cortex-m0plus", - .dependencies = &[_]*const Feature { - &feature_mclass, - &feature_db, - &feature_noarm, - &feature_strictAlign, - }, -}; - -pub const cpu_cortexM1 = Cpu{ - .name = "cortexM1", - .llvm_name = "cortex-m1", - .dependencies = &[_]*const Feature { - &feature_mclass, - &feature_db, - &feature_noarm, - &feature_strictAlign, - }, -}; - -pub const cpu_cortexM23 = Cpu{ - .name = "cortexM23", - .llvm_name = "cortex-m23", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mclass, - &feature_db, - &feature_acquireRelease, - &feature_v7clrex, - &feature_noarm, - &feature_msecext8, - &feature_strictAlign, - &feature_noMovt, - }, -}; - -pub const cpu_cortexM3 = Cpu{ - .name = "cortexM3", - .llvm_name = "cortex-m3", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_noBranchPredictor, - &feature_loopAlign, - &feature_useAa, - &feature_useMisched, - }, -}; - -pub const cpu_cortexM33 = Cpu{ - .name = "cortexM33", - .llvm_name = "cortex-m33", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_msecext8, - &feature_dsp, - &feature_fp16, - &feature_fpregs, - &feature_fpArmv8d16sp, - &feature_noBranchPredictor, - &feature_slowfpvmlx, - &feature_loopAlign, - &feature_useAa, - &feature_useMisched, - }, -}; - -pub const cpu_cortexM35p = Cpu{ - .name = "cortexM35p", - .llvm_name = "cortex-m35p", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_msecext8, - &feature_dsp, - &feature_fp16, - &feature_fpregs, - &feature_fpArmv8d16sp, - &feature_noBranchPredictor, - &feature_slowfpvmlx, - &feature_loopAlign, - &feature_useAa, - &feature_useMisched, - }, -}; - -pub const cpu_cortexM4 = Cpu{ - .name = "cortexM4", - .llvm_name = "cortex-m4", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_noBranchPredictor, - &feature_slowfpvmlx, - &feature_loopAlign, - &feature_useAa, - &feature_useMisched, - &feature_fp16, - &feature_fpregs, - &feature_vfp4d16sp, - }, -}; - -pub const cpu_cortexM7 = Cpu{ - .name = "cortexM7", - .llvm_name = "cortex-m7", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_fp16, - &feature_fpregs, - &feature_fpArmv8d16, - }, -}; - -pub const cpu_cortexR4 = Cpu{ - .name = "cortexR4", - .llvm_name = "cortex-r4", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_retAddrStack, - }, -}; - -pub const cpu_cortexR4f = Cpu{ - .name = "cortexR4f", - .llvm_name = "cortex-r4f", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_slowFpBrcc, - &feature_fpregs, - &feature_vfp3d16, - }, -}; - -pub const cpu_cortexR5 = Cpu{ - .name = "cortexR5", - .llvm_name = "cortex-r5", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_hwdivArm, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_slowFpBrcc, - &feature_fpregs, - &feature_vfp3d16, - }, -}; - -pub const cpu_cortexR52 = Cpu{ - .name = "cortexR52", - .llvm_name = "cortex-r52", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dfb, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_fpregs, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_fpao, - &feature_useAa, - &feature_useMisched, - }, -}; - -pub const cpu_cortexR7 = Cpu{ - .name = "cortexR7", - .llvm_name = "cortex-r7", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_fp16, - &feature_hwdivArm, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_mp, - &feature_slowFpBrcc, - &feature_fpregs, - &feature_vfp3d16, - }, -}; - -pub const cpu_cortexR8 = Cpu{ - .name = "cortexR8", - .llvm_name = "cortex-r8", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_dsp, - &feature_rclass, - &feature_thumb2, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_fp16, - &feature_hwdivArm, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_mp, - &feature_slowFpBrcc, - &feature_fpregs, - &feature_vfp3d16, - }, -}; - -pub const cpu_cyclone = Cpu{ - .name = "cyclone", - .llvm_name = "cyclone", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_avoidMovsShop, - &feature_avoidPartialCpsr, - &feature_crypto, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_neonfp, - &feature_disablePostraScheduler, - &feature_useMisched, - &feature_vfp4, - &feature_zcz, - }, -}; - -pub const cpu_ep9312 = Cpu{ - .name = "ep9312", - .llvm_name = "ep9312", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_exynosM1 = Cpu{ - .name = "exynosM1", - .llvm_name = "exynos-m1", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_fuseLiterals, - &feature_useAa, - &feature_wideStrideVfp, - &feature_slowVgetlni32, - &feature_slowVdup32, - &feature_profUnpr, - &feature_slowFpBrcc, - &feature_retAddrStack, - &feature_zcz, - &feature_slowfpvmlx, - &feature_expandFpMlx, - &feature_fuseAes, - &feature_dontWidenVmovs, - }, -}; - -pub const cpu_exynosM2 = Cpu{ - .name = "exynosM2", - .llvm_name = "exynos-m2", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_fuseLiterals, - &feature_useAa, - &feature_wideStrideVfp, - &feature_slowVgetlni32, - &feature_slowVdup32, - &feature_profUnpr, - &feature_slowFpBrcc, - &feature_retAddrStack, - &feature_zcz, - &feature_slowfpvmlx, - &feature_expandFpMlx, - &feature_fuseAes, - &feature_dontWidenVmovs, - }, -}; - -pub const cpu_exynosM3 = Cpu{ - .name = "exynosM3", - .llvm_name = "exynos-m3", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_fuseLiterals, - &feature_useAa, - &feature_wideStrideVfp, - &feature_slowVgetlni32, - &feature_slowVdup32, - &feature_profUnpr, - &feature_slowFpBrcc, - &feature_retAddrStack, - &feature_zcz, - &feature_slowfpvmlx, - &feature_expandFpMlx, - &feature_fuseAes, - &feature_dontWidenVmovs, - }, -}; - -pub const cpu_exynosM4 = Cpu{ - .name = "exynosM4", - .llvm_name = "exynos-m4", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_dotprod, - &feature_fullfp16, - &feature_fuseLiterals, - &feature_useAa, - &feature_wideStrideVfp, - &feature_slowVgetlni32, - &feature_slowVdup32, - &feature_profUnpr, - &feature_slowFpBrcc, - &feature_retAddrStack, - &feature_zcz, - &feature_slowfpvmlx, - &feature_expandFpMlx, - &feature_fuseAes, - &feature_dontWidenVmovs, - }, -}; - -pub const cpu_exynosM5 = Cpu{ - .name = "exynosM5", - .llvm_name = "exynos-m5", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_ras, - &feature_dotprod, - &feature_fullfp16, - &feature_fuseLiterals, - &feature_useAa, - &feature_wideStrideVfp, - &feature_slowVgetlni32, - &feature_slowVdup32, - &feature_profUnpr, - &feature_slowFpBrcc, - &feature_retAddrStack, - &feature_zcz, - &feature_slowfpvmlx, - &feature_expandFpMlx, - &feature_fuseAes, - &feature_dontWidenVmovs, - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_iwmmxt = Cpu{ - .name = "iwmmxt", - .llvm_name = "iwmmxt", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_krait = Cpu{ - .name = "krait", - .llvm_name = "krait", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidPartialCpsr, - &feature_vldnAlign, - &feature_fp16, - &feature_hwdivArm, - &feature_hwdiv, - &feature_retAddrStack, - &feature_muxedUnits, - &feature_vfp4, - &feature_vmlxForwarding, - }, -}; - -pub const cpu_kryo = Cpu{ - .name = "kryo", - .llvm_name = "kryo", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_mp, - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_trustzone, - &feature_crc, - &feature_fp16, - &feature_acquireRelease, - &feature_v7clrex, - &feature_perfmon, - &feature_hwdivArm, - &feature_crypto, - }, -}; - -pub const cpu_mpcore = Cpu{ - .name = "mpcore", - .llvm_name = "mpcore", - .dependencies = &[_]*const Feature { - &feature_slowfpvmlx, - &feature_d32, - &feature_fpregs, - &feature_vfp2, - }, -}; - -pub const cpu_mpcorenovfp = Cpu{ - .name = "mpcorenovfp", - .llvm_name = "mpcorenovfp", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_sc000 = Cpu{ - .name = "sc000", - .llvm_name = "sc000", - .dependencies = &[_]*const Feature { - &feature_mclass, - &feature_db, - &feature_noarm, - &feature_strictAlign, - }, -}; - -pub const cpu_sc300 = Cpu{ - .name = "sc300", - .llvm_name = "sc300", - .dependencies = &[_]*const Feature { - &feature_hwdiv, - &feature_thumb2, - &feature_mclass, - &feature_db, - &feature_v7clrex, - &feature_perfmon, - &feature_noarm, - &feature_noBranchPredictor, - &feature_useAa, - &feature_useMisched, - }, -}; - -pub const cpu_strongarm = Cpu{ - .name = "strongarm", - .llvm_name = "strongarm", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_strongarm110 = Cpu{ - .name = "strongarm110", - .llvm_name = "strongarm110", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_strongarm1100 = Cpu{ - .name = "strongarm1100", - .llvm_name = "strongarm1100", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_strongarm1110 = Cpu{ - .name = "strongarm1110", - .llvm_name = "strongarm1110", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_swift = Cpu{ - .name = "swift", - .llvm_name = "swift", - .dependencies = &[_]*const Feature { - &feature_d32, - &feature_dsp, - &feature_thumb2, - &feature_db, - &feature_aclass, - &feature_fpregs, - &feature_v7clrex, - &feature_perfmon, - &feature_avoidMovsShop, - &feature_avoidPartialCpsr, - &feature_hwdivArm, - &feature_hwdiv, - &feature_retAddrStack, - &feature_slowfpvmlx, - &feature_vmlxHazards, - &feature_mp, - &feature_neonfp, - &feature_disablePostraScheduler, - &feature_preferIshst, - &feature_profUnpr, - &feature_slowLoadDSubreg, - &feature_slowOddReg, - &feature_slowVdup32, - &feature_slowVgetlni32, - &feature_useMisched, - &feature_wideStrideVfp, - &feature_fp16, - &feature_vfp4, - }, -}; - -pub const cpu_xscale = Cpu{ - .name = "xscale", - .llvm_name = "xscale", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_arm1020e, - &cpu_arm1020t, - &cpu_arm1022e, - &cpu_arm10e, - &cpu_arm10tdmi, - &cpu_arm1136jS, - &cpu_arm1136jfS, - &cpu_arm1156t2S, - &cpu_arm1156t2fS, - &cpu_arm1176jS, - &cpu_arm1176jzS, - &cpu_arm1176jzfS, - &cpu_arm710t, - &cpu_arm720t, - &cpu_arm7tdmi, - &cpu_arm7tdmiS, - &cpu_arm8, - &cpu_arm810, - &cpu_arm9, - &cpu_arm920, - &cpu_arm920t, - &cpu_arm922t, - &cpu_arm926ejS, - &cpu_arm940t, - &cpu_arm946eS, - &cpu_arm966eS, - &cpu_arm968eS, - &cpu_arm9e, - &cpu_arm9tdmi, - &cpu_cortexA12, - &cpu_cortexA15, - &cpu_cortexA17, - &cpu_cortexA32, - &cpu_cortexA35, - &cpu_cortexA5, - &cpu_cortexA53, - &cpu_cortexA55, - &cpu_cortexA57, - &cpu_cortexA7, - &cpu_cortexA72, - &cpu_cortexA73, - &cpu_cortexA75, - &cpu_cortexA76, - &cpu_cortexA76ae, - &cpu_cortexA8, - &cpu_cortexA9, - &cpu_cortexM0, - &cpu_cortexM0plus, - &cpu_cortexM1, - &cpu_cortexM23, - &cpu_cortexM3, - &cpu_cortexM33, - &cpu_cortexM35p, - &cpu_cortexM4, - &cpu_cortexM7, - &cpu_cortexR4, - &cpu_cortexR4f, - &cpu_cortexR5, - &cpu_cortexR52, - &cpu_cortexR7, - &cpu_cortexR8, - &cpu_cyclone, - &cpu_ep9312, - &cpu_exynosM1, - &cpu_exynosM2, - &cpu_exynosM3, - &cpu_exynosM4, - &cpu_exynosM5, - &cpu_generic, - &cpu_iwmmxt, - &cpu_krait, - &cpu_kryo, - &cpu_mpcore, - &cpu_mpcorenovfp, - &cpu_sc000, - &cpu_sc300, - &cpu_strongarm, - &cpu_strongarm110, - &cpu_strongarm1100, - &cpu_strongarm1110, - &cpu_swift, - &cpu_xscale, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + @"32bit", + @"8msecext", + a12, + a15, + a17, + a32, + a35, + a5, + a53, + a55, + a57, + a7, + a72, + a73, + a75, + a76, + a8, + a9, + aclass, + acquire_release, + aes, + armv2, + armv2a, + armv3, + armv3m, + armv4, + armv4t, + armv5t, + armv5te, + armv5tej, + armv6, + armv6_m, + armv6j, + armv6k, + armv6kz, + armv6s_m, + armv6t2, + armv7_a, + armv7_m, + armv7_r, + armv7e_m, + armv7k, + armv7s, + armv7ve, + armv8_a, + armv8_m_base, + armv8_m_main, + armv8_r, + armv8_1_a, + armv8_1_m_main, + armv8_2_a, + armv8_3_a, + armv8_4_a, + armv8_5_a, + avoid_movs_shop, + avoid_partial_cpsr, + cheap_predicable_cpsr, + crc, + crypto, + d32, + db, + dfb, + disable_postra_scheduler, + dont_widen_vmovs, + dotprod, + dsp, + execute_only, + expand_fp_mlx, + exynos, + fp_armv8, + fp_armv8d16, + fp_armv8d16sp, + fp_armv8sp, + fp16, + fp16fml, + fp64, + fpao, + fpregs, + fpregs16, + fpregs64, + fullfp16, + fuse_aes, + fuse_literals, + hwdiv, + hwdiv_arm, + iwmmxt, + iwmmxt2, + krait, + kryo, + lob, + long_calls, + loop_align, + m3, + mclass, + mp, + muxed_units, + mve, + mve_fp, + nacl_trap, + neon, + neon_fpmovs, + neonfp, + no_branch_predictor, + no_movt, + no_neg_immediates, + noarm, + nonpipelined_vfp, + perfmon, + prefer_ishst, + prefer_vmovsr, + prof_unpr, + r4, + r5, + r52, + r7, + ras, + rclass, + read_tp_hard, + reserve_r9, + ret_addr_stack, + sb, + sha2, + slow_fp_brcc, + slow_load_D_subreg, + slow_odd_reg, + slow_vdup32, + slow_vgetlni32, + slowfpvmlx, + soft_float, + splat_vfp_neon, + strict_align, + swift, + thumb_mode, + thumb2, + trustzone, + use_aa, + use_misched, + v4t, + v5t, + v5te, + v6, + v6k, + v6m, + v6t2, + v7, + v7clrex, + v8, + v8_1a, + v8_1m_main, + v8_2a, + v8_3a, + v8_4a, + v8_5a, + v8m, + v8m_main, + vfp2, + vfp2d16, + vfp2d16sp, + vfp2sp, + vfp3, + vfp3d16, + vfp3d16sp, + vfp3sp, + vfp4, + vfp4d16, + vfp4d16sp, + vfp4sp, + virtualization, + vldn_align, + vmlx_forwarding, + vmlx_hazards, + wide_stride_vfp, + xscale, + zcz, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.@"32bit")] = .{ + .index = @enumToInt(Feature.@"32bit"), + .name = @tagName(Feature.@"32bit"), + .llvm_name = "32bit", + .description = "Prefer 32-bit Thumb instrs", + .dependencies = 0, + }; + result[@enumToInt(Feature.@"8msecext")] = .{ + .index = @enumToInt(Feature.@"8msecext"), + .name = @tagName(Feature.@"8msecext"), + .llvm_name = "8msecext", + .description = "Enable support for ARMv8-M Security Extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.a12)] = .{ + .index = @enumToInt(Feature.a12), + .name = @tagName(Feature.a12), + .llvm_name = "a12", + .description = "Cortex-A12 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a15)] = .{ + .index = @enumToInt(Feature.a15), + .name = @tagName(Feature.a15), + .llvm_name = "a15", + .description = "Cortex-A15 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a17)] = .{ + .index = @enumToInt(Feature.a17), + .name = @tagName(Feature.a17), + .llvm_name = "a17", + .description = "Cortex-A17 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a32)] = .{ + .index = @enumToInt(Feature.a32), + .name = @tagName(Feature.a32), + .llvm_name = "a32", + .description = "Cortex-A32 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a35)] = .{ + .index = @enumToInt(Feature.a35), + .name = @tagName(Feature.a35), + .llvm_name = "a35", + .description = "Cortex-A35 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a5)] = .{ + .index = @enumToInt(Feature.a5), + .name = @tagName(Feature.a5), + .llvm_name = "a5", + .description = "Cortex-A5 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a53)] = .{ + .index = @enumToInt(Feature.a53), + .name = @tagName(Feature.a53), + .llvm_name = "a53", + .description = "Cortex-A53 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a55)] = .{ + .index = @enumToInt(Feature.a55), + .name = @tagName(Feature.a55), + .llvm_name = "a55", + .description = "Cortex-A55 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a57)] = .{ + .index = @enumToInt(Feature.a57), + .name = @tagName(Feature.a57), + .llvm_name = "a57", + .description = "Cortex-A57 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a7)] = .{ + .index = @enumToInt(Feature.a7), + .name = @tagName(Feature.a7), + .llvm_name = "a7", + .description = "Cortex-A7 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a72)] = .{ + .index = @enumToInt(Feature.a72), + .name = @tagName(Feature.a72), + .llvm_name = "a72", + .description = "Cortex-A72 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a73)] = .{ + .index = @enumToInt(Feature.a73), + .name = @tagName(Feature.a73), + .llvm_name = "a73", + .description = "Cortex-A73 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a75)] = .{ + .index = @enumToInt(Feature.a75), + .name = @tagName(Feature.a75), + .llvm_name = "a75", + .description = "Cortex-A75 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a76)] = .{ + .index = @enumToInt(Feature.a76), + .name = @tagName(Feature.a76), + .llvm_name = "a76", + .description = "Cortex-A76 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a8)] = .{ + .index = @enumToInt(Feature.a8), + .name = @tagName(Feature.a8), + .llvm_name = "a8", + .description = "Cortex-A8 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.a9)] = .{ + .index = @enumToInt(Feature.a9), + .name = @tagName(Feature.a9), + .llvm_name = "a9", + .description = "Cortex-A9 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.aclass)] = .{ + .index = @enumToInt(Feature.aclass), + .name = @tagName(Feature.aclass), + .llvm_name = "aclass", + .description = "Is application profile ('A' series)", + .dependencies = 0, + }; + result[@enumToInt(Feature.acquire_release)] = .{ + .index = @enumToInt(Feature.acquire_release), + .name = @tagName(Feature.acquire_release), + .llvm_name = "acquire-release", + .description = "Has v8 acquire/release (lda/ldaex etc) instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.aes)] = .{ + .index = @enumToInt(Feature.aes), + .name = @tagName(Feature.aes), + .llvm_name = "aes", + .description = "Enable AES support", + .dependencies = featureSet(&[_]Feature{ + .neon, + }), + }; + result[@enumToInt(Feature.armv2)] = .{ + .index = @enumToInt(Feature.armv2), + .name = @tagName(Feature.armv2), + .llvm_name = "armv2", + .description = "ARMv2 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.armv2a)] = .{ + .index = @enumToInt(Feature.armv2a), + .name = @tagName(Feature.armv2a), + .llvm_name = "armv2a", + .description = "ARMv2a architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.armv3)] = .{ + .index = @enumToInt(Feature.armv3), + .name = @tagName(Feature.armv3), + .llvm_name = "armv3", + .description = "ARMv3 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.armv3m)] = .{ + .index = @enumToInt(Feature.armv3m), + .name = @tagName(Feature.armv3m), + .llvm_name = "armv3m", + .description = "ARMv3m architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.armv4)] = .{ + .index = @enumToInt(Feature.armv4), + .name = @tagName(Feature.armv4), + .llvm_name = "armv4", + .description = "ARMv4 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.armv4t)] = .{ + .index = @enumToInt(Feature.armv4t), + .name = @tagName(Feature.armv4t), + .llvm_name = "armv4t", + .description = "ARMv4t architecture", + .dependencies = featureSet(&[_]Feature{ + .v4t, + }), + }; + result[@enumToInt(Feature.armv5t)] = .{ + .index = @enumToInt(Feature.armv5t), + .name = @tagName(Feature.armv5t), + .llvm_name = "armv5t", + .description = "ARMv5t architecture", + .dependencies = featureSet(&[_]Feature{ + .v5t, + }), + }; + result[@enumToInt(Feature.armv5te)] = .{ + .index = @enumToInt(Feature.armv5te), + .name = @tagName(Feature.armv5te), + .llvm_name = "armv5te", + .description = "ARMv5te architecture", + .dependencies = featureSet(&[_]Feature{ + .v5te, + }), + }; + result[@enumToInt(Feature.armv5tej)] = .{ + .index = @enumToInt(Feature.armv5tej), + .name = @tagName(Feature.armv5tej), + .llvm_name = "armv5tej", + .description = "ARMv5tej architecture", + .dependencies = featureSet(&[_]Feature{ + .v5te, + }), + }; + result[@enumToInt(Feature.armv6)] = .{ + .index = @enumToInt(Feature.armv6), + .name = @tagName(Feature.armv6), + .llvm_name = "armv6", + .description = "ARMv6 architecture", + .dependencies = featureSet(&[_]Feature{ + .dsp, + .v6, + }), + }; + result[@enumToInt(Feature.armv6_m)] = .{ + .index = @enumToInt(Feature.armv6_m), + .name = @tagName(Feature.armv6_m), + .llvm_name = "armv6-m", + .description = "ARMv6m architecture", + .dependencies = featureSet(&[_]Feature{ + .db, + .mclass, + .noarm, + .strict_align, + .thumb_mode, + .v6m, + }), + }; + result[@enumToInt(Feature.armv6j)] = .{ + .index = @enumToInt(Feature.armv6j), + .name = @tagName(Feature.armv6j), + .llvm_name = "armv6j", + .description = "ARMv7a architecture", + .dependencies = featureSet(&[_]Feature{ + .armv6, + }), + }; + result[@enumToInt(Feature.armv6k)] = .{ + .index = @enumToInt(Feature.armv6k), + .name = @tagName(Feature.armv6k), + .llvm_name = "armv6k", + .description = "ARMv6k architecture", + .dependencies = featureSet(&[_]Feature{ + .v6k, + }), + }; + result[@enumToInt(Feature.armv6kz)] = .{ + .index = @enumToInt(Feature.armv6kz), + .name = @tagName(Feature.armv6kz), + .llvm_name = "armv6kz", + .description = "ARMv6kz architecture", + .dependencies = featureSet(&[_]Feature{ + .trustzone, + .v6k, + }), + }; + result[@enumToInt(Feature.armv6s_m)] = .{ + .index = @enumToInt(Feature.armv6s_m), + .name = @tagName(Feature.armv6s_m), + .llvm_name = "armv6s-m", + .description = "ARMv6sm architecture", + .dependencies = featureSet(&[_]Feature{ + .db, + .mclass, + .noarm, + .strict_align, + .thumb_mode, + .v6m, + }), + }; + result[@enumToInt(Feature.armv6t2)] = .{ + .index = @enumToInt(Feature.armv6t2), + .name = @tagName(Feature.armv6t2), + .llvm_name = "armv6t2", + .description = "ARMv6t2 architecture", + .dependencies = featureSet(&[_]Feature{ + .dsp, + .v6t2, + }), + }; + result[@enumToInt(Feature.armv7_a)] = .{ + .index = @enumToInt(Feature.armv7_a), + .name = @tagName(Feature.armv7_a), + .llvm_name = "armv7-a", + .description = "ARMv7a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .db, + .dsp, + .neon, + .v7, + }), + }; + result[@enumToInt(Feature.armv7_m)] = .{ + .index = @enumToInt(Feature.armv7_m), + .name = @tagName(Feature.armv7_m), + .llvm_name = "armv7-m", + .description = "ARMv7m architecture", + .dependencies = featureSet(&[_]Feature{ + .db, + .hwdiv, + .mclass, + .noarm, + .thumb_mode, + .thumb2, + .v7, + }), + }; + result[@enumToInt(Feature.armv7_r)] = .{ + .index = @enumToInt(Feature.armv7_r), + .name = @tagName(Feature.armv7_r), + .llvm_name = "armv7-r", + .description = "ARMv7r architecture", + .dependencies = featureSet(&[_]Feature{ + .db, + .dsp, + .hwdiv, + .rclass, + .v7, + }), + }; + result[@enumToInt(Feature.armv7e_m)] = .{ + .index = @enumToInt(Feature.armv7e_m), + .name = @tagName(Feature.armv7e_m), + .llvm_name = "armv7e-m", + .description = "ARMv7em architecture", + .dependencies = featureSet(&[_]Feature{ + .db, + .dsp, + .hwdiv, + .mclass, + .noarm, + .thumb_mode, + .thumb2, + .v7, + }), + }; + result[@enumToInt(Feature.armv7k)] = .{ + .index = @enumToInt(Feature.armv7k), + .name = @tagName(Feature.armv7k), + .llvm_name = "armv7k", + .description = "ARMv7a architecture", + .dependencies = featureSet(&[_]Feature{ + .armv7_a, + }), + }; + result[@enumToInt(Feature.armv7s)] = .{ + .index = @enumToInt(Feature.armv7s), + .name = @tagName(Feature.armv7s), + .llvm_name = "armv7s", + .description = "ARMv7a architecture", + .dependencies = featureSet(&[_]Feature{ + .armv7_a, + }), + }; + result[@enumToInt(Feature.armv7ve)] = .{ + .index = @enumToInt(Feature.armv7ve), + .name = @tagName(Feature.armv7ve), + .llvm_name = "armv7ve", + .description = "ARMv7ve architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .db, + .dsp, + .mp, + .neon, + .trustzone, + .v7, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_a)] = .{ + .index = @enumToInt(Feature.armv8_a), + .name = @tagName(Feature.armv8_a), + .llvm_name = "armv8-a", + .description = "ARMv8a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dsp, + .fp_armv8, + .mp, + .neon, + .trustzone, + .v8, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_m_base)] = .{ + .index = @enumToInt(Feature.armv8_m_base), + .name = @tagName(Feature.armv8_m_base), + .llvm_name = "armv8-m.base", + .description = "ARMv8mBaseline architecture", + .dependencies = featureSet(&[_]Feature{ + .@"8msecext", + .acquire_release, + .db, + .hwdiv, + .mclass, + .noarm, + .strict_align, + .thumb_mode, + .v7clrex, + .v8m, + }), + }; + result[@enumToInt(Feature.armv8_m_main)] = .{ + .index = @enumToInt(Feature.armv8_m_main), + .name = @tagName(Feature.armv8_m_main), + .llvm_name = "armv8-m.main", + .description = "ARMv8mMainline architecture", + .dependencies = featureSet(&[_]Feature{ + .@"8msecext", + .acquire_release, + .db, + .hwdiv, + .mclass, + .noarm, + .thumb_mode, + .v8m_main, + }), + }; + result[@enumToInt(Feature.armv8_r)] = .{ + .index = @enumToInt(Feature.armv8_r), + .name = @tagName(Feature.armv8_r), + .llvm_name = "armv8-r", + .description = "ARMv8r architecture", + .dependencies = featureSet(&[_]Feature{ + .crc, + .db, + .dfb, + .dsp, + .fp_armv8, + .mp, + .neon, + .rclass, + .v8, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_1_a)] = .{ + .index = @enumToInt(Feature.armv8_1_a), + .name = @tagName(Feature.armv8_1_a), + .llvm_name = "armv8.1-a", + .description = "ARMv81a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dsp, + .fp_armv8, + .mp, + .neon, + .trustzone, + .v8_1a, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_1_m_main)] = .{ + .index = @enumToInt(Feature.armv8_1_m_main), + .name = @tagName(Feature.armv8_1_m_main), + .llvm_name = "armv8.1-m.main", + .description = "ARMv81mMainline architecture", + .dependencies = featureSet(&[_]Feature{ + .@"8msecext", + .acquire_release, + .db, + .hwdiv, + .lob, + .mclass, + .noarm, + .ras, + .thumb_mode, + .v8_1m_main, + }), + }; + result[@enumToInt(Feature.armv8_2_a)] = .{ + .index = @enumToInt(Feature.armv8_2_a), + .name = @tagName(Feature.armv8_2_a), + .llvm_name = "armv8.2-a", + .description = "ARMv82a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dsp, + .fp_armv8, + .mp, + .neon, + .ras, + .trustzone, + .v8_2a, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_3_a)] = .{ + .index = @enumToInt(Feature.armv8_3_a), + .name = @tagName(Feature.armv8_3_a), + .llvm_name = "armv8.3-a", + .description = "ARMv83a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dsp, + .fp_armv8, + .mp, + .neon, + .ras, + .trustzone, + .v8_3a, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_4_a)] = .{ + .index = @enumToInt(Feature.armv8_4_a), + .name = @tagName(Feature.armv8_4_a), + .llvm_name = "armv8.4-a", + .description = "ARMv84a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dotprod, + .dsp, + .fp_armv8, + .mp, + .neon, + .ras, + .trustzone, + .v8_4a, + .virtualization, + }), + }; + result[@enumToInt(Feature.armv8_5_a)] = .{ + .index = @enumToInt(Feature.armv8_5_a), + .name = @tagName(Feature.armv8_5_a), + .llvm_name = "armv8.5-a", + .description = "ARMv85a architecture", + .dependencies = featureSet(&[_]Feature{ + .aclass, + .crc, + .crypto, + .db, + .dotprod, + .dsp, + .fp_armv8, + .mp, + .neon, + .ras, + .trustzone, + .v8_5a, + .virtualization, + }), + }; + result[@enumToInt(Feature.avoid_movs_shop)] = .{ + .index = @enumToInt(Feature.avoid_movs_shop), + .name = @tagName(Feature.avoid_movs_shop), + .llvm_name = "avoid-movs-shop", + .description = "Avoid movs instructions with shifter operand", + .dependencies = 0, + }; + result[@enumToInt(Feature.avoid_partial_cpsr)] = .{ + .index = @enumToInt(Feature.avoid_partial_cpsr), + .name = @tagName(Feature.avoid_partial_cpsr), + .llvm_name = "avoid-partial-cpsr", + .description = "Avoid CPSR partial update for OOO execution", + .dependencies = 0, + }; + result[@enumToInt(Feature.cheap_predicable_cpsr)] = .{ + .index = @enumToInt(Feature.cheap_predicable_cpsr), + .name = @tagName(Feature.cheap_predicable_cpsr), + .llvm_name = "cheap-predicable-cpsr", + .description = "Disable +1 predication cost for instructions updating CPSR", + .dependencies = 0, + }; + result[@enumToInt(Feature.crc)] = .{ + .index = @enumToInt(Feature.crc), + .name = @tagName(Feature.crc), + .llvm_name = "crc", + .description = "Enable support for CRC instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.crypto)] = .{ + .index = @enumToInt(Feature.crypto), + .name = @tagName(Feature.crypto), + .llvm_name = "crypto", + .description = "Enable support for Cryptography extensions", + .dependencies = featureSet(&[_]Feature{ + .aes, + .neon, + .sha2, + }), + }; + result[@enumToInt(Feature.d32)] = .{ + .index = @enumToInt(Feature.d32), + .name = @tagName(Feature.d32), + .llvm_name = "d32", + .description = "Extend FP to 32 double registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.db)] = .{ + .index = @enumToInt(Feature.db), + .name = @tagName(Feature.db), + .llvm_name = "db", + .description = "Has data barrier (dmb/dsb) instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dfb)] = .{ + .index = @enumToInt(Feature.dfb), + .name = @tagName(Feature.dfb), + .llvm_name = "dfb", + .description = "Has full data barrier (dfb) instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.disable_postra_scheduler)] = .{ + .index = @enumToInt(Feature.disable_postra_scheduler), + .name = @tagName(Feature.disable_postra_scheduler), + .llvm_name = "disable-postra-scheduler", + .description = "Don't schedule again after register allocation", + .dependencies = 0, + }; + result[@enumToInt(Feature.dont_widen_vmovs)] = .{ + .index = @enumToInt(Feature.dont_widen_vmovs), + .name = @tagName(Feature.dont_widen_vmovs), + .llvm_name = "dont-widen-vmovs", + .description = "Don't widen VMOVS to VMOVD", + .dependencies = 0, + }; + result[@enumToInt(Feature.dotprod)] = .{ + .index = @enumToInt(Feature.dotprod), + .name = @tagName(Feature.dotprod), + .llvm_name = "dotprod", + .description = "Enable support for dot product instructions", + .dependencies = featureSet(&[_]Feature{ + .neon, + }), + }; + result[@enumToInt(Feature.dsp)] = .{ + .index = @enumToInt(Feature.dsp), + .name = @tagName(Feature.dsp), + .llvm_name = "dsp", + .description = "Supports DSP instructions in ARM and/or Thumb2", + .dependencies = 0, + }; + result[@enumToInt(Feature.execute_only)] = .{ + .index = @enumToInt(Feature.execute_only), + .name = @tagName(Feature.execute_only), + .llvm_name = "execute-only", + .description = "Enable the generation of execute only code.", + .dependencies = 0, + }; + result[@enumToInt(Feature.expand_fp_mlx)] = .{ + .index = @enumToInt(Feature.expand_fp_mlx), + .name = @tagName(Feature.expand_fp_mlx), + .llvm_name = "expand-fp-mlx", + .description = "Expand VFP/NEON MLA/MLS instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.exynos)] = .{ + .index = @enumToInt(Feature.exynos), + .name = @tagName(Feature.exynos), + .llvm_name = "exynos", + .description = "Samsung Exynos processors", + .dependencies = featureSet(&[_]Feature{ + .crc, + .crypto, + .expand_fp_mlx, + .fuse_aes, + .fuse_literals, + .hwdiv, + .hwdiv_arm, + .prof_unpr, + .ret_addr_stack, + .slow_fp_brcc, + .slow_vdup32, + .slow_vgetlni32, + .slowfpvmlx, + .splat_vfp_neon, + .use_aa, + .wide_stride_vfp, + .zcz, + }), + }; + result[@enumToInt(Feature.fp_armv8)] = .{ + .index = @enumToInt(Feature.fp_armv8), + .name = @tagName(Feature.fp_armv8), + .llvm_name = "fp-armv8", + .description = "Enable ARMv8 FP", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8d16, + .fp_armv8sp, + .vfp4, + }), + }; + result[@enumToInt(Feature.fp_armv8d16)] = .{ + .index = @enumToInt(Feature.fp_armv8d16), + .name = @tagName(Feature.fp_armv8d16), + .llvm_name = "fp-armv8d16", + .description = "Enable ARMv8 FP with only 16 d-registers", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8d16sp, + .fp64, + .vfp4d16, + }), + }; + result[@enumToInt(Feature.fp_armv8d16sp)] = .{ + .index = @enumToInt(Feature.fp_armv8d16sp), + .name = @tagName(Feature.fp_armv8d16sp), + .llvm_name = "fp-armv8d16sp", + .description = "Enable ARMv8 FP with only 16 d-registers and no double precision", + .dependencies = featureSet(&[_]Feature{ + .vfp4d16sp, + }), + }; + result[@enumToInt(Feature.fp_armv8sp)] = .{ + .index = @enumToInt(Feature.fp_armv8sp), + .name = @tagName(Feature.fp_armv8sp), + .llvm_name = "fp-armv8sp", + .description = "Enable ARMv8 FP with no double precision", + .dependencies = featureSet(&[_]Feature{ + .d32, + .fp_armv8d16sp, + .vfp4sp, + }), + }; + result[@enumToInt(Feature.fp16)] = .{ + .index = @enumToInt(Feature.fp16), + .name = @tagName(Feature.fp16), + .llvm_name = "fp16", + .description = "Enable half-precision floating point", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp16fml)] = .{ + .index = @enumToInt(Feature.fp16fml), + .name = @tagName(Feature.fp16fml), + .llvm_name = "fp16fml", + .description = "Enable full half-precision floating point fml instructions", + .dependencies = featureSet(&[_]Feature{ + .fullfp16, + }), + }; + result[@enumToInt(Feature.fp64)] = .{ + .index = @enumToInt(Feature.fp64), + .name = @tagName(Feature.fp64), + .llvm_name = "fp64", + .description = "Floating point unit supports double precision", + .dependencies = featureSet(&[_]Feature{ + .fpregs64, + }), + }; + result[@enumToInt(Feature.fpao)] = .{ + .index = @enumToInt(Feature.fpao), + .name = @tagName(Feature.fpao), + .llvm_name = "fpao", + .description = "Enable fast computation of positive address offsets", + .dependencies = 0, + }; + result[@enumToInt(Feature.fpregs)] = .{ + .index = @enumToInt(Feature.fpregs), + .name = @tagName(Feature.fpregs), + .llvm_name = "fpregs", + .description = "Enable FP registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.fpregs16)] = .{ + .index = @enumToInt(Feature.fpregs16), + .name = @tagName(Feature.fpregs16), + .llvm_name = "fpregs16", + .description = "Enable 16-bit FP registers", + .dependencies = featureSet(&[_]Feature{ + .fpregs, + }), + }; + result[@enumToInt(Feature.fpregs64)] = .{ + .index = @enumToInt(Feature.fpregs64), + .name = @tagName(Feature.fpregs64), + .llvm_name = "fpregs64", + .description = "Enable 64-bit FP registers", + .dependencies = featureSet(&[_]Feature{ + .fpregs, + }), + }; + result[@enumToInt(Feature.fullfp16)] = .{ + .index = @enumToInt(Feature.fullfp16), + .name = @tagName(Feature.fullfp16), + .llvm_name = "fullfp16", + .description = "Enable full half-precision floating point", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8d16sp, + .fpregs16, + }), + }; + result[@enumToInt(Feature.fuse_aes)] = .{ + .index = @enumToInt(Feature.fuse_aes), + .name = @tagName(Feature.fuse_aes), + .llvm_name = "fuse-aes", + .description = "CPU fuses AES crypto operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.fuse_literals)] = .{ + .index = @enumToInt(Feature.fuse_literals), + .name = @tagName(Feature.fuse_literals), + .llvm_name = "fuse-literals", + .description = "CPU fuses literal generation operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.hwdiv)] = .{ + .index = @enumToInt(Feature.hwdiv), + .name = @tagName(Feature.hwdiv), + .llvm_name = "hwdiv", + .description = "Enable divide instructions in Thumb", + .dependencies = 0, + }; + result[@enumToInt(Feature.hwdiv_arm)] = .{ + .index = @enumToInt(Feature.hwdiv_arm), + .name = @tagName(Feature.hwdiv_arm), + .llvm_name = "hwdiv-arm", + .description = "Enable divide instructions in ARM mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.iwmmxt)] = .{ + .index = @enumToInt(Feature.iwmmxt), + .name = @tagName(Feature.iwmmxt), + .llvm_name = "iwmmxt", + .description = "ARMv5te architecture", + .dependencies = featureSet(&[_]Feature{ + .armv5te, + }), + }; + result[@enumToInt(Feature.iwmmxt2)] = .{ + .index = @enumToInt(Feature.iwmmxt2), + .name = @tagName(Feature.iwmmxt2), + .llvm_name = "iwmmxt2", + .description = "ARMv5te architecture", + .dependencies = featureSet(&[_]Feature{ + .armv5te, + }), + }; + result[@enumToInt(Feature.krait)] = .{ + .index = @enumToInt(Feature.krait), + .name = @tagName(Feature.krait), + .llvm_name = "krait", + .description = "Qualcomm Krait processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.kryo)] = .{ + .index = @enumToInt(Feature.kryo), + .name = @tagName(Feature.kryo), + .llvm_name = "kryo", + .description = "Qualcomm Kryo processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.lob)] = .{ + .index = @enumToInt(Feature.lob), + .name = @tagName(Feature.lob), + .llvm_name = "lob", + .description = "Enable Low Overhead Branch extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.long_calls)] = .{ + .index = @enumToInt(Feature.long_calls), + .name = @tagName(Feature.long_calls), + .llvm_name = "long-calls", + .description = "Generate calls via indirect call instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.loop_align)] = .{ + .index = @enumToInt(Feature.loop_align), + .name = @tagName(Feature.loop_align), + .llvm_name = "loop-align", + .description = "Prefer 32-bit alignment for loops", + .dependencies = 0, + }; + result[@enumToInt(Feature.m3)] = .{ + .index = @enumToInt(Feature.m3), + .name = @tagName(Feature.m3), + .llvm_name = "m3", + .description = "Cortex-M3 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.mclass)] = .{ + .index = @enumToInt(Feature.mclass), + .name = @tagName(Feature.mclass), + .llvm_name = "mclass", + .description = "Is microcontroller profile ('M' series)", + .dependencies = 0, + }; + result[@enumToInt(Feature.mp)] = .{ + .index = @enumToInt(Feature.mp), + .name = @tagName(Feature.mp), + .llvm_name = "mp", + .description = "Supports Multiprocessing extension", + .dependencies = 0, + }; + result[@enumToInt(Feature.muxed_units)] = .{ + .index = @enumToInt(Feature.muxed_units), + .name = @tagName(Feature.muxed_units), + .llvm_name = "muxed-units", + .description = "Has muxed AGU and NEON/FPU", + .dependencies = 0, + }; + result[@enumToInt(Feature.mve)] = .{ + .index = @enumToInt(Feature.mve), + .name = @tagName(Feature.mve), + .llvm_name = "mve", + .description = "Support M-Class Vector Extension with integer ops", + .dependencies = featureSet(&[_]Feature{ + .dsp, + .fpregs16, + .fpregs64, + .v8_1m_main, + }), + }; + result[@enumToInt(Feature.mve_fp)] = .{ + .index = @enumToInt(Feature.mve_fp), + .name = @tagName(Feature.mve_fp), + .llvm_name = "mve.fp", + .description = "Support M-Class Vector Extension with integer and floating ops", + .dependencies = featureSet(&[_]Feature{ + .fp_armv8d16sp, + .fullfp16, + .mve, + }), + }; + result[@enumToInt(Feature.nacl_trap)] = .{ + .index = @enumToInt(Feature.nacl_trap), + .name = @tagName(Feature.nacl_trap), + .llvm_name = "nacl-trap", + .description = "NaCl trap", + .dependencies = 0, + }; + result[@enumToInt(Feature.neon)] = .{ + .index = @enumToInt(Feature.neon), + .name = @tagName(Feature.neon), + .llvm_name = "neon", + .description = "Enable NEON instructions", + .dependencies = featureSet(&[_]Feature{ + .vfp3, + }), + }; + result[@enumToInt(Feature.neon_fpmovs)] = .{ + .index = @enumToInt(Feature.neon_fpmovs), + .name = @tagName(Feature.neon_fpmovs), + .llvm_name = "neon-fpmovs", + .description = "Convert VMOVSR, VMOVRS, VMOVS to NEON", + .dependencies = 0, + }; + result[@enumToInt(Feature.neonfp)] = .{ + .index = @enumToInt(Feature.neonfp), + .name = @tagName(Feature.neonfp), + .llvm_name = "neonfp", + .description = "Use NEON for single precision FP", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_branch_predictor)] = .{ + .index = @enumToInt(Feature.no_branch_predictor), + .name = @tagName(Feature.no_branch_predictor), + .llvm_name = "no-branch-predictor", + .description = "Has no branch predictor", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_movt)] = .{ + .index = @enumToInt(Feature.no_movt), + .name = @tagName(Feature.no_movt), + .llvm_name = "no-movt", + .description = "Don't use movt/movw pairs for 32-bit imms", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_neg_immediates)] = .{ + .index = @enumToInt(Feature.no_neg_immediates), + .name = @tagName(Feature.no_neg_immediates), + .llvm_name = "no-neg-immediates", + .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.", + .dependencies = 0, + }; + result[@enumToInt(Feature.noarm)] = .{ + .index = @enumToInt(Feature.noarm), + .name = @tagName(Feature.noarm), + .llvm_name = "noarm", + .description = "Does not support ARM mode execution", + .dependencies = 0, + }; + result[@enumToInt(Feature.nonpipelined_vfp)] = .{ + .index = @enumToInt(Feature.nonpipelined_vfp), + .name = @tagName(Feature.nonpipelined_vfp), + .llvm_name = "nonpipelined-vfp", + .description = "VFP instructions are not pipelined", + .dependencies = 0, + }; + result[@enumToInt(Feature.perfmon)] = .{ + .index = @enumToInt(Feature.perfmon), + .name = @tagName(Feature.perfmon), + .llvm_name = "perfmon", + .description = "Enable support for Performance Monitor extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.prefer_ishst)] = .{ + .index = @enumToInt(Feature.prefer_ishst), + .name = @tagName(Feature.prefer_ishst), + .llvm_name = "prefer-ishst", + .description = "Prefer ISHST barriers", + .dependencies = 0, + }; + result[@enumToInt(Feature.prefer_vmovsr)] = .{ + .index = @enumToInt(Feature.prefer_vmovsr), + .name = @tagName(Feature.prefer_vmovsr), + .llvm_name = "prefer-vmovsr", + .description = "Prefer VMOVSR", + .dependencies = 0, + }; + result[@enumToInt(Feature.prof_unpr)] = .{ + .index = @enumToInt(Feature.prof_unpr), + .name = @tagName(Feature.prof_unpr), + .llvm_name = "prof-unpr", + .description = "Is profitable to unpredicate", + .dependencies = 0, + }; + result[@enumToInt(Feature.r4)] = .{ + .index = @enumToInt(Feature.r4), + .name = @tagName(Feature.r4), + .llvm_name = "r4", + .description = "Cortex-R4 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.r5)] = .{ + .index = @enumToInt(Feature.r5), + .name = @tagName(Feature.r5), + .llvm_name = "r5", + .description = "Cortex-R5 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.r52)] = .{ + .index = @enumToInt(Feature.r52), + .name = @tagName(Feature.r52), + .llvm_name = "r52", + .description = "Cortex-R52 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.r7)] = .{ + .index = @enumToInt(Feature.r7), + .name = @tagName(Feature.r7), + .llvm_name = "r7", + .description = "Cortex-R7 ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.ras)] = .{ + .index = @enumToInt(Feature.ras), + .name = @tagName(Feature.ras), + .llvm_name = "ras", + .description = "Enable Reliability, Availability and Serviceability extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.rclass)] = .{ + .index = @enumToInt(Feature.rclass), + .name = @tagName(Feature.rclass), + .llvm_name = "rclass", + .description = "Is realtime profile ('R' series)", + .dependencies = 0, + }; + result[@enumToInt(Feature.read_tp_hard)] = .{ + .index = @enumToInt(Feature.read_tp_hard), + .name = @tagName(Feature.read_tp_hard), + .llvm_name = "read-tp-hard", + .description = "Reading thread pointer from register", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserve_r9)] = .{ + .index = @enumToInt(Feature.reserve_r9), + .name = @tagName(Feature.reserve_r9), + .llvm_name = "reserve-r9", + .description = "Reserve R9, making it unavailable as GPR", + .dependencies = 0, + }; + result[@enumToInt(Feature.ret_addr_stack)] = .{ + .index = @enumToInt(Feature.ret_addr_stack), + .name = @tagName(Feature.ret_addr_stack), + .llvm_name = "ret-addr-stack", + .description = "Has return address stack", + .dependencies = 0, + }; + result[@enumToInt(Feature.sb)] = .{ + .index = @enumToInt(Feature.sb), + .name = @tagName(Feature.sb), + .llvm_name = "sb", + .description = "Enable v8.5a Speculation Barrier", + .dependencies = 0, + }; + result[@enumToInt(Feature.sha2)] = .{ + .index = @enumToInt(Feature.sha2), + .name = @tagName(Feature.sha2), + .llvm_name = "sha2", + .description = "Enable SHA1 and SHA256 support", + .dependencies = featureSet(&[_]Feature{ + .neon, + }), + }; + result[@enumToInt(Feature.slow_fp_brcc)] = .{ + .index = @enumToInt(Feature.slow_fp_brcc), + .name = @tagName(Feature.slow_fp_brcc), + .llvm_name = "slow-fp-brcc", + .description = "FP compare + branch is slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_load_D_subreg)] = .{ + .index = @enumToInt(Feature.slow_load_D_subreg), + .name = @tagName(Feature.slow_load_D_subreg), + .llvm_name = "slow-load-D-subreg", + .description = "Loading into D subregs is slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_odd_reg)] = .{ + .index = @enumToInt(Feature.slow_odd_reg), + .name = @tagName(Feature.slow_odd_reg), + .llvm_name = "slow-odd-reg", + .description = "VLDM/VSTM starting with an odd register is slow", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_vdup32)] = .{ + .index = @enumToInt(Feature.slow_vdup32), + .name = @tagName(Feature.slow_vdup32), + .llvm_name = "slow-vdup32", + .description = "Has slow VDUP32 - prefer VMOV", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_vgetlni32)] = .{ + .index = @enumToInt(Feature.slow_vgetlni32), + .name = @tagName(Feature.slow_vgetlni32), + .llvm_name = "slow-vgetlni32", + .description = "Has slow VGETLNi32 - prefer VMOV", + .dependencies = 0, + }; + result[@enumToInt(Feature.slowfpvmlx)] = .{ + .index = @enumToInt(Feature.slowfpvmlx), + .name = @tagName(Feature.slowfpvmlx), + .llvm_name = "slowfpvmlx", + .description = "Disable VFP / NEON MAC instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.soft_float)] = .{ + .index = @enumToInt(Feature.soft_float), + .name = @tagName(Feature.soft_float), + .llvm_name = "soft-float", + .description = "Use software floating point features.", + .dependencies = 0, + }; + result[@enumToInt(Feature.splat_vfp_neon)] = .{ + .index = @enumToInt(Feature.splat_vfp_neon), + .name = @tagName(Feature.splat_vfp_neon), + .llvm_name = "splat-vfp-neon", + .description = "Splat register from VFP to NEON", + .dependencies = featureSet(&[_]Feature{ + .dont_widen_vmovs, + }), + }; + result[@enumToInt(Feature.strict_align)] = .{ + .index = @enumToInt(Feature.strict_align), + .name = @tagName(Feature.strict_align), + .llvm_name = "strict-align", + .description = "Disallow all unaligned memory access", + .dependencies = 0, + }; + result[@enumToInt(Feature.swift)] = .{ + .index = @enumToInt(Feature.swift), + .name = @tagName(Feature.swift), + .llvm_name = "swift", + .description = "Swift ARM processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.thumb_mode)] = .{ + .index = @enumToInt(Feature.thumb_mode), + .name = @tagName(Feature.thumb_mode), + .llvm_name = "thumb-mode", + .description = "Thumb mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.thumb2)] = .{ + .index = @enumToInt(Feature.thumb2), + .name = @tagName(Feature.thumb2), + .llvm_name = "thumb2", + .description = "Enable Thumb2 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.trustzone)] = .{ + .index = @enumToInt(Feature.trustzone), + .name = @tagName(Feature.trustzone), + .llvm_name = "trustzone", + .description = "Enable support for TrustZone security extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_aa)] = .{ + .index = @enumToInt(Feature.use_aa), + .name = @tagName(Feature.use_aa), + .llvm_name = "use-aa", + .description = "Use alias analysis during codegen", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_misched)] = .{ + .index = @enumToInt(Feature.use_misched), + .name = @tagName(Feature.use_misched), + .llvm_name = "use-misched", + .description = "Use the MachineScheduler", + .dependencies = 0, + }; + result[@enumToInt(Feature.v4t)] = .{ + .index = @enumToInt(Feature.v4t), + .name = @tagName(Feature.v4t), + .llvm_name = "v4t", + .description = "Support ARM v4T instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.v5t)] = .{ + .index = @enumToInt(Feature.v5t), + .name = @tagName(Feature.v5t), + .llvm_name = "v5t", + .description = "Support ARM v5T instructions", + .dependencies = featureSet(&[_]Feature{ + .v4t, + }), + }; + result[@enumToInt(Feature.v5te)] = .{ + .index = @enumToInt(Feature.v5te), + .name = @tagName(Feature.v5te), + .llvm_name = "v5te", + .description = "Support ARM v5TE, v5TEj, and v5TExp instructions", + .dependencies = featureSet(&[_]Feature{ + .v5t, + }), + }; + result[@enumToInt(Feature.v6)] = .{ + .index = @enumToInt(Feature.v6), + .name = @tagName(Feature.v6), + .llvm_name = "v6", + .description = "Support ARM v6 instructions", + .dependencies = featureSet(&[_]Feature{ + .v5te, + }), + }; + result[@enumToInt(Feature.v6k)] = .{ + .index = @enumToInt(Feature.v6k), + .name = @tagName(Feature.v6k), + .llvm_name = "v6k", + .description = "Support ARM v6k instructions", + .dependencies = featureSet(&[_]Feature{ + .v6, + }), + }; + result[@enumToInt(Feature.v6m)] = .{ + .index = @enumToInt(Feature.v6m), + .name = @tagName(Feature.v6m), + .llvm_name = "v6m", + .description = "Support ARM v6M instructions", + .dependencies = featureSet(&[_]Feature{ + .v6, + }), + }; + result[@enumToInt(Feature.v6t2)] = .{ + .index = @enumToInt(Feature.v6t2), + .name = @tagName(Feature.v6t2), + .llvm_name = "v6t2", + .description = "Support ARM v6t2 instructions", + .dependencies = featureSet(&[_]Feature{ + .thumb2, + .v6k, + .v8m, + }), + }; + result[@enumToInt(Feature.v7)] = .{ + .index = @enumToInt(Feature.v7), + .name = @tagName(Feature.v7), + .llvm_name = "v7", + .description = "Support ARM v7 instructions", + .dependencies = featureSet(&[_]Feature{ + .perfmon, + .v6t2, + .v7clrex, + }), + }; + result[@enumToInt(Feature.v7clrex)] = .{ + .index = @enumToInt(Feature.v7clrex), + .name = @tagName(Feature.v7clrex), + .llvm_name = "v7clrex", + .description = "Has v7 clrex instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.v8)] = .{ + .index = @enumToInt(Feature.v8), + .name = @tagName(Feature.v8), + .llvm_name = "v8", + .description = "Support ARM v8 instructions", + .dependencies = featureSet(&[_]Feature{ + .acquire_release, + .v7, + }), + }; + result[@enumToInt(Feature.v8_1a)] = .{ + .index = @enumToInt(Feature.v8_1a), + .name = @tagName(Feature.v8_1a), + .llvm_name = "v8.1a", + .description = "Support ARM v8.1a instructions", + .dependencies = featureSet(&[_]Feature{ + .v8, + }), + }; + result[@enumToInt(Feature.v8_1m_main)] = .{ + .index = @enumToInt(Feature.v8_1m_main), + .name = @tagName(Feature.v8_1m_main), + .llvm_name = "v8.1m.main", + .description = "Support ARM v8-1M Mainline instructions", + .dependencies = featureSet(&[_]Feature{ + .v8m_main, + }), + }; + result[@enumToInt(Feature.v8_2a)] = .{ + .index = @enumToInt(Feature.v8_2a), + .name = @tagName(Feature.v8_2a), + .llvm_name = "v8.2a", + .description = "Support ARM v8.2a instructions", + .dependencies = featureSet(&[_]Feature{ + .v8_1a, + }), + }; + result[@enumToInt(Feature.v8_3a)] = .{ + .index = @enumToInt(Feature.v8_3a), + .name = @tagName(Feature.v8_3a), + .llvm_name = "v8.3a", + .description = "Support ARM v8.3a instructions", + .dependencies = featureSet(&[_]Feature{ + .v8_2a, + }), + }; + result[@enumToInt(Feature.v8_4a)] = .{ + .index = @enumToInt(Feature.v8_4a), + .name = @tagName(Feature.v8_4a), + .llvm_name = "v8.4a", + .description = "Support ARM v8.4a instructions", + .dependencies = featureSet(&[_]Feature{ + .dotprod, + .v8_3a, + }), + }; + result[@enumToInt(Feature.v8_5a)] = .{ + .index = @enumToInt(Feature.v8_5a), + .name = @tagName(Feature.v8_5a), + .llvm_name = "v8.5a", + .description = "Support ARM v8.5a instructions", + .dependencies = featureSet(&[_]Feature{ + .sb, + .v8_4a, + }), + }; + result[@enumToInt(Feature.v8m)] = .{ + .index = @enumToInt(Feature.v8m), + .name = @tagName(Feature.v8m), + .llvm_name = "v8m", + .description = "Support ARM v8M Baseline instructions", + .dependencies = featureSet(&[_]Feature{ + .v6m, + }), + }; + result[@enumToInt(Feature.v8m_main)] = .{ + .index = @enumToInt(Feature.v8m_main), + .name = @tagName(Feature.v8m_main), + .llvm_name = "v8m.main", + .description = "Support ARM v8M Mainline instructions", + .dependencies = featureSet(&[_]Feature{ + .v7, + }), + }; + result[@enumToInt(Feature.vfp2)] = .{ + .index = @enumToInt(Feature.vfp2), + .name = @tagName(Feature.vfp2), + .llvm_name = "vfp2", + .description = "Enable VFP2 instructions", + .dependencies = featureSet(&[_]Feature{ + .vfp2d16, + .vfp2sp, + }), + }; + result[@enumToInt(Feature.vfp2d16)] = .{ + .index = @enumToInt(Feature.vfp2d16), + .name = @tagName(Feature.vfp2d16), + .llvm_name = "vfp2d16", + .description = "Enable VFP2 instructions", + .dependencies = featureSet(&[_]Feature{ + .fp64, + .vfp2d16sp, + }), + }; + result[@enumToInt(Feature.vfp2d16sp)] = .{ + .index = @enumToInt(Feature.vfp2d16sp), + .name = @tagName(Feature.vfp2d16sp), + .llvm_name = "vfp2d16sp", + .description = "Enable VFP2 instructions with no double precision", + .dependencies = featureSet(&[_]Feature{ + .fpregs, + }), + }; + result[@enumToInt(Feature.vfp2sp)] = .{ + .index = @enumToInt(Feature.vfp2sp), + .name = @tagName(Feature.vfp2sp), + .llvm_name = "vfp2sp", + .description = "Enable VFP2 instructions with no double precision", + .dependencies = featureSet(&[_]Feature{ + .vfp2d16sp, + }), + }; + result[@enumToInt(Feature.vfp3)] = .{ + .index = @enumToInt(Feature.vfp3), + .name = @tagName(Feature.vfp3), + .llvm_name = "vfp3", + .description = "Enable VFP3 instructions", + .dependencies = featureSet(&[_]Feature{ + .vfp3d16, + .vfp3sp, + }), + }; + result[@enumToInt(Feature.vfp3d16)] = .{ + .index = @enumToInt(Feature.vfp3d16), + .name = @tagName(Feature.vfp3d16), + .llvm_name = "vfp3d16", + .description = "Enable VFP3 instructions with only 16 d-registers", + .dependencies = featureSet(&[_]Feature{ + .fp64, + .vfp2, + .vfp3d16sp, + }), + }; + result[@enumToInt(Feature.vfp3d16sp)] = .{ + .index = @enumToInt(Feature.vfp3d16sp), + .name = @tagName(Feature.vfp3d16sp), + .llvm_name = "vfp3d16sp", + .description = "Enable VFP3 instructions with only 16 d-registers and no double precision", + .dependencies = featureSet(&[_]Feature{ + .vfp2sp, + }), + }; + result[@enumToInt(Feature.vfp3sp)] = .{ + .index = @enumToInt(Feature.vfp3sp), + .name = @tagName(Feature.vfp3sp), + .llvm_name = "vfp3sp", + .description = "Enable VFP3 instructions with no double precision", + .dependencies = featureSet(&[_]Feature{ + .d32, + .vfp3d16sp, + }), + }; + result[@enumToInt(Feature.vfp4)] = .{ + .index = @enumToInt(Feature.vfp4), + .name = @tagName(Feature.vfp4), + .llvm_name = "vfp4", + .description = "Enable VFP4 instructions", + .dependencies = featureSet(&[_]Feature{ + .fp16, + .vfp3, + .vfp4d16, + .vfp4sp, + }), + }; + result[@enumToInt(Feature.vfp4d16)] = .{ + .index = @enumToInt(Feature.vfp4d16), + .name = @tagName(Feature.vfp4d16), + .llvm_name = "vfp4d16", + .description = "Enable VFP4 instructions with only 16 d-registers", + .dependencies = featureSet(&[_]Feature{ + .fp16, + .fp64, + .vfp3d16, + .vfp4d16sp, + }), + }; + result[@enumToInt(Feature.vfp4d16sp)] = .{ + .index = @enumToInt(Feature.vfp4d16sp), + .name = @tagName(Feature.vfp4d16sp), + .llvm_name = "vfp4d16sp", + .description = "Enable VFP4 instructions with only 16 d-registers and no double precision", + .dependencies = featureSet(&[_]Feature{ + .fp16, + .vfp3d16sp, + }), + }; + result[@enumToInt(Feature.vfp4sp)] = .{ + .index = @enumToInt(Feature.vfp4sp), + .name = @tagName(Feature.vfp4sp), + .llvm_name = "vfp4sp", + .description = "Enable VFP4 instructions with no double precision", + .dependencies = featureSet(&[_]Feature{ + .d32, + .fp16, + .vfp3sp, + .vfp4d16sp, + }), + }; + result[@enumToInt(Feature.virtualization)] = .{ + .index = @enumToInt(Feature.virtualization), + .name = @tagName(Feature.virtualization), + .llvm_name = "virtualization", + .description = "Supports Virtualization extension", + .dependencies = featureSet(&[_]Feature{ + .hwdiv, + .hwdiv_arm, + }), + }; + result[@enumToInt(Feature.vldn_align)] = .{ + .index = @enumToInt(Feature.vldn_align), + .name = @tagName(Feature.vldn_align), + .llvm_name = "vldn-align", + .description = "Check for VLDn unaligned access", + .dependencies = 0, + }; + result[@enumToInt(Feature.vmlx_forwarding)] = .{ + .index = @enumToInt(Feature.vmlx_forwarding), + .name = @tagName(Feature.vmlx_forwarding), + .llvm_name = "vmlx-forwarding", + .description = "Has multiplier accumulator forwarding", + .dependencies = 0, + }; + result[@enumToInt(Feature.vmlx_hazards)] = .{ + .index = @enumToInt(Feature.vmlx_hazards), + .name = @tagName(Feature.vmlx_hazards), + .llvm_name = "vmlx-hazards", + .description = "Has VMLx hazards", + .dependencies = 0, + }; + result[@enumToInt(Feature.wide_stride_vfp)] = .{ + .index = @enumToInt(Feature.wide_stride_vfp), + .name = @tagName(Feature.wide_stride_vfp), + .llvm_name = "wide-stride-vfp", + .description = "Use a wide stride when allocating VFP registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.xscale)] = .{ + .index = @enumToInt(Feature.xscale), + .name = @tagName(Feature.xscale), + .llvm_name = "xscale", + .description = "ARMv5te architecture", + .dependencies = featureSet(&[_]Feature{ + .armv5te, + }), + }; + result[@enumToInt(Feature.zcz)] = .{ + .index = @enumToInt(Feature.zcz), + .name = @tagName(Feature.zcz), + .llvm_name = "zcz", + .description = "Has zero-cycle zeroing instructions", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const arm1020e = Cpu{ + .name = "arm1020e", + .llvm_name = "arm1020e", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm1020t = Cpu{ + .name = "arm1020t", + .llvm_name = "arm1020t", + .features = featureSet(&[_]Feature{ + .armv5t, + }), + }; + pub const arm1022e = Cpu{ + .name = "arm1022e", + .llvm_name = "arm1022e", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm10e = Cpu{ + .name = "arm10e", + .llvm_name = "arm10e", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm10tdmi = Cpu{ + .name = "arm10tdmi", + .llvm_name = "arm10tdmi", + .features = featureSet(&[_]Feature{ + .armv5t, + }), + }; + pub const arm1136j_s = Cpu{ + .name = "arm1136j_s", + .llvm_name = "arm1136j-s", + .features = featureSet(&[_]Feature{ + .armv6, + }), + }; + pub const arm1136jf_s = Cpu{ + .name = "arm1136jf_s", + .llvm_name = "arm1136jf-s", + .features = featureSet(&[_]Feature{ + .armv6, + .slowfpvmlx, + .vfp2, + }), + }; + pub const arm1156t2_s = Cpu{ + .name = "arm1156t2_s", + .llvm_name = "arm1156t2-s", + .features = featureSet(&[_]Feature{ + .armv6t2, + }), + }; + pub const arm1156t2f_s = Cpu{ + .name = "arm1156t2f_s", + .llvm_name = "arm1156t2f-s", + .features = featureSet(&[_]Feature{ + .armv6t2, + .slowfpvmlx, + .vfp2, + }), + }; + pub const arm1176j_s = Cpu{ + .name = "arm1176j_s", + .llvm_name = "arm1176j-s", + .features = featureSet(&[_]Feature{ + .armv6kz, + }), + }; + pub const arm1176jz_s = Cpu{ + .name = "arm1176jz_s", + .llvm_name = "arm1176jz-s", + .features = featureSet(&[_]Feature{ + .armv6kz, + }), + }; + pub const arm1176jzf_s = Cpu{ + .name = "arm1176jzf_s", + .llvm_name = "arm1176jzf-s", + .features = featureSet(&[_]Feature{ + .armv6kz, + .slowfpvmlx, + .vfp2, + }), + }; + pub const arm710t = Cpu{ + .name = "arm710t", + .llvm_name = "arm710t", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm720t = Cpu{ + .name = "arm720t", + .llvm_name = "arm720t", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm7tdmi = Cpu{ + .name = "arm7tdmi", + .llvm_name = "arm7tdmi", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm7tdmi_s = Cpu{ + .name = "arm7tdmi_s", + .llvm_name = "arm7tdmi-s", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm8 = Cpu{ + .name = "arm8", + .llvm_name = "arm8", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const arm810 = Cpu{ + .name = "arm810", + .llvm_name = "arm810", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const arm9 = Cpu{ + .name = "arm9", + .llvm_name = "arm9", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm920 = Cpu{ + .name = "arm920", + .llvm_name = "arm920", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm920t = Cpu{ + .name = "arm920t", + .llvm_name = "arm920t", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm922t = Cpu{ + .name = "arm922t", + .llvm_name = "arm922t", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm926ej_s = Cpu{ + .name = "arm926ej_s", + .llvm_name = "arm926ej-s", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm940t = Cpu{ + .name = "arm940t", + .llvm_name = "arm940t", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const arm946e_s = Cpu{ + .name = "arm946e_s", + .llvm_name = "arm946e-s", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm966e_s = Cpu{ + .name = "arm966e_s", + .llvm_name = "arm966e-s", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm968e_s = Cpu{ + .name = "arm968e_s", + .llvm_name = "arm968e-s", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm9e = Cpu{ + .name = "arm9e", + .llvm_name = "arm9e", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const arm9tdmi = Cpu{ + .name = "arm9tdmi", + .llvm_name = "arm9tdmi", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const cortex_a12 = Cpu{ + .name = "cortex_a12", + .llvm_name = "cortex-a12", + .features = featureSet(&[_]Feature{ + .a12, + .armv7_a, + .avoid_partial_cpsr, + .mp, + .ret_addr_stack, + .trustzone, + .vfp4, + .virtualization, + .vmlx_forwarding, + }), + }; + pub const cortex_a15 = Cpu{ + .name = "cortex_a15", + .llvm_name = "cortex-a15", + .features = featureSet(&[_]Feature{ + .a15, + .armv7_a, + .avoid_partial_cpsr, + .dont_widen_vmovs, + .mp, + .muxed_units, + .ret_addr_stack, + .splat_vfp_neon, + .trustzone, + .vfp4, + .virtualization, + .vldn_align, + }), + }; + pub const cortex_a17 = Cpu{ + .name = "cortex_a17", + .llvm_name = "cortex-a17", + .features = featureSet(&[_]Feature{ + .a17, + .armv7_a, + .avoid_partial_cpsr, + .mp, + .ret_addr_stack, + .trustzone, + .vfp4, + .virtualization, + .vmlx_forwarding, + }), + }; + pub const cortex_a32 = Cpu{ + .name = "cortex_a32", + .llvm_name = "cortex-a32", + .features = featureSet(&[_]Feature{ + .armv8_a, + .crc, + .crypto, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a35 = Cpu{ + .name = "cortex_a35", + .llvm_name = "cortex-a35", + .features = featureSet(&[_]Feature{ + .a35, + .armv8_a, + .crc, + .crypto, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a5 = Cpu{ + .name = "cortex_a5", + .llvm_name = "cortex-a5", + .features = featureSet(&[_]Feature{ + .a5, + .armv7_a, + .mp, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .trustzone, + .vfp4, + .vmlx_forwarding, + }), + }; + pub const cortex_a53 = Cpu{ + .name = "cortex_a53", + .llvm_name = "cortex-a53", + .features = featureSet(&[_]Feature{ + .a53, + .armv8_a, + .crc, + .crypto, + .fpao, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a55 = Cpu{ + .name = "cortex_a55", + .llvm_name = "cortex-a55", + .features = featureSet(&[_]Feature{ + .a55, + .armv8_2_a, + .dotprod, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a57 = Cpu{ + .name = "cortex_a57", + .llvm_name = "cortex-a57", + .features = featureSet(&[_]Feature{ + .a57, + .armv8_a, + .avoid_partial_cpsr, + .cheap_predicable_cpsr, + .crc, + .crypto, + .fpao, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a7 = Cpu{ + .name = "cortex_a7", + .llvm_name = "cortex-a7", + .features = featureSet(&[_]Feature{ + .a7, + .armv7_a, + .mp, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .trustzone, + .vfp4, + .virtualization, + .vmlx_forwarding, + .vmlx_hazards, + }), + }; + pub const cortex_a72 = Cpu{ + .name = "cortex_a72", + .llvm_name = "cortex-a72", + .features = featureSet(&[_]Feature{ + .a72, + .armv8_a, + .crc, + .crypto, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a73 = Cpu{ + .name = "cortex_a73", + .llvm_name = "cortex-a73", + .features = featureSet(&[_]Feature{ + .a73, + .armv8_a, + .crc, + .crypto, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a75 = Cpu{ + .name = "cortex_a75", + .llvm_name = "cortex-a75", + .features = featureSet(&[_]Feature{ + .a75, + .armv8_2_a, + .dotprod, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a76 = Cpu{ + .name = "cortex_a76", + .llvm_name = "cortex-a76", + .features = featureSet(&[_]Feature{ + .a76, + .armv8_2_a, + .crc, + .crypto, + .dotprod, + .fullfp16, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a76ae = Cpu{ + .name = "cortex_a76ae", + .llvm_name = "cortex-a76ae", + .features = featureSet(&[_]Feature{ + .a76, + .armv8_2_a, + .crc, + .crypto, + .dotprod, + .fullfp16, + .hwdiv, + .hwdiv_arm, + }), + }; + pub const cortex_a8 = Cpu{ + .name = "cortex_a8", + .llvm_name = "cortex-a8", + .features = featureSet(&[_]Feature{ + .a8, + .armv7_a, + .nonpipelined_vfp, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .trustzone, + .vmlx_forwarding, + .vmlx_hazards, + }), + }; + pub const cortex_a9 = Cpu{ + .name = "cortex_a9", + .llvm_name = "cortex-a9", + .features = featureSet(&[_]Feature{ + .a9, + .armv7_a, + .avoid_partial_cpsr, + .expand_fp_mlx, + .fp16, + .mp, + .muxed_units, + .neon_fpmovs, + .prefer_vmovsr, + .ret_addr_stack, + .trustzone, + .vldn_align, + .vmlx_forwarding, + .vmlx_hazards, + }), + }; + pub const cortex_m0 = Cpu{ + .name = "cortex_m0", + .llvm_name = "cortex-m0", + .features = featureSet(&[_]Feature{ + .armv6_m, + }), + }; + pub const cortex_m0plus = Cpu{ + .name = "cortex_m0plus", + .llvm_name = "cortex-m0plus", + .features = featureSet(&[_]Feature{ + .armv6_m, + }), + }; + pub const cortex_m1 = Cpu{ + .name = "cortex_m1", + .llvm_name = "cortex-m1", + .features = featureSet(&[_]Feature{ + .armv6_m, + }), + }; + pub const cortex_m23 = Cpu{ + .name = "cortex_m23", + .llvm_name = "cortex-m23", + .features = featureSet(&[_]Feature{ + .armv8_m_base, + .no_movt, + }), + }; + pub const cortex_m3 = Cpu{ + .name = "cortex_m3", + .llvm_name = "cortex-m3", + .features = featureSet(&[_]Feature{ + .armv7_m, + .loop_align, + .m3, + .no_branch_predictor, + .use_aa, + .use_misched, + }), + }; + pub const cortex_m33 = Cpu{ + .name = "cortex_m33", + .llvm_name = "cortex-m33", + .features = featureSet(&[_]Feature{ + .armv8_m_main, + .dsp, + .fp_armv8d16sp, + .loop_align, + .no_branch_predictor, + .slowfpvmlx, + .use_aa, + .use_misched, + }), + }; + pub const cortex_m35p = Cpu{ + .name = "cortex_m35p", + .llvm_name = "cortex-m35p", + .features = featureSet(&[_]Feature{ + .armv8_m_main, + .dsp, + .fp_armv8d16sp, + .loop_align, + .no_branch_predictor, + .slowfpvmlx, + .use_aa, + .use_misched, + }), + }; + pub const cortex_m4 = Cpu{ + .name = "cortex_m4", + .llvm_name = "cortex-m4", + .features = featureSet(&[_]Feature{ + .armv7e_m, + .loop_align, + .no_branch_predictor, + .slowfpvmlx, + .use_aa, + .use_misched, + .vfp4d16sp, + }), + }; + pub const cortex_m7 = Cpu{ + .name = "cortex_m7", + .llvm_name = "cortex-m7", + .features = featureSet(&[_]Feature{ + .armv7e_m, + .fp_armv8d16, + }), + }; + pub const cortex_r4 = Cpu{ + .name = "cortex_r4", + .llvm_name = "cortex-r4", + .features = featureSet(&[_]Feature{ + .armv7_r, + .avoid_partial_cpsr, + .r4, + .ret_addr_stack, + }), + }; + pub const cortex_r4f = Cpu{ + .name = "cortex_r4f", + .llvm_name = "cortex-r4f", + .features = featureSet(&[_]Feature{ + .armv7_r, + .avoid_partial_cpsr, + .r4, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .vfp3d16, + }), + }; + pub const cortex_r5 = Cpu{ + .name = "cortex_r5", + .llvm_name = "cortex-r5", + .features = featureSet(&[_]Feature{ + .armv7_r, + .avoid_partial_cpsr, + .hwdiv_arm, + .r5, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .vfp3d16, + }), + }; + pub const cortex_r52 = Cpu{ + .name = "cortex_r52", + .llvm_name = "cortex-r52", + .features = featureSet(&[_]Feature{ + .armv8_r, + .fpao, + .r52, + .use_aa, + .use_misched, + }), + }; + pub const cortex_r7 = Cpu{ + .name = "cortex_r7", + .llvm_name = "cortex-r7", + .features = featureSet(&[_]Feature{ + .armv7_r, + .avoid_partial_cpsr, + .fp16, + .hwdiv_arm, + .mp, + .r7, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .vfp3d16, + }), + }; + pub const cortex_r8 = Cpu{ + .name = "cortex_r8", + .llvm_name = "cortex-r8", + .features = featureSet(&[_]Feature{ + .armv7_r, + .avoid_partial_cpsr, + .fp16, + .hwdiv_arm, + .mp, + .ret_addr_stack, + .slow_fp_brcc, + .slowfpvmlx, + .vfp3d16, + }), + }; + pub const cyclone = Cpu{ + .name = "cyclone", + .llvm_name = "cyclone", + .features = featureSet(&[_]Feature{ + .armv8_a, + .avoid_movs_shop, + .avoid_partial_cpsr, + .crypto, + .disable_postra_scheduler, + .hwdiv, + .hwdiv_arm, + .mp, + .neonfp, + .ret_addr_stack, + .slowfpvmlx, + .swift, + .use_misched, + .vfp4, + .zcz, + }), + }; + pub const ep9312 = Cpu{ + .name = "ep9312", + .llvm_name = "ep9312", + .features = featureSet(&[_]Feature{ + .armv4t, + }), + }; + pub const exynos_m1 = Cpu{ + .name = "exynos_m1", + .llvm_name = "exynos-m1", + .features = featureSet(&[_]Feature{ + .armv8_a, + .exynos, + }), + }; + pub const exynos_m2 = Cpu{ + .name = "exynos_m2", + .llvm_name = "exynos-m2", + .features = featureSet(&[_]Feature{ + .armv8_a, + .exynos, + }), + }; + pub const exynos_m3 = Cpu{ + .name = "exynos_m3", + .llvm_name = "exynos-m3", + .features = featureSet(&[_]Feature{ + .armv8_a, + .exynos, + }), + }; + pub const exynos_m4 = Cpu{ + .name = "exynos_m4", + .llvm_name = "exynos-m4", + .features = featureSet(&[_]Feature{ + .armv8_2_a, + .dotprod, + .exynos, + .fullfp16, + }), + }; + pub const exynos_m5 = Cpu{ + .name = "exynos_m5", + .llvm_name = "exynos-m5", + .features = featureSet(&[_]Feature{ + .armv8_2_a, + .dotprod, + .exynos, + .fullfp16, + }), + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const iwmmxt = Cpu{ + .name = "iwmmxt", + .llvm_name = "iwmmxt", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; + pub const krait = Cpu{ + .name = "krait", + .llvm_name = "krait", + .features = featureSet(&[_]Feature{ + .armv7_a, + .avoid_partial_cpsr, + .fp16, + .hwdiv, + .hwdiv_arm, + .krait, + .muxed_units, + .ret_addr_stack, + .vfp4, + .vldn_align, + .vmlx_forwarding, + }), + }; + pub const kryo = Cpu{ + .name = "kryo", + .llvm_name = "kryo", + .features = featureSet(&[_]Feature{ + .armv8_a, + .crc, + .crypto, + .hwdiv, + .hwdiv_arm, + .kryo, + }), + }; + pub const mpcore = Cpu{ + .name = "mpcore", + .llvm_name = "mpcore", + .features = featureSet(&[_]Feature{ + .armv6k, + .slowfpvmlx, + .vfp2, + }), + }; + pub const mpcorenovfp = Cpu{ + .name = "mpcorenovfp", + .llvm_name = "mpcorenovfp", + .features = featureSet(&[_]Feature{ + .armv6k, + }), + }; + pub const sc000 = Cpu{ + .name = "sc000", + .llvm_name = "sc000", + .features = featureSet(&[_]Feature{ + .armv6_m, + }), + }; + pub const sc300 = Cpu{ + .name = "sc300", + .llvm_name = "sc300", + .features = featureSet(&[_]Feature{ + .armv7_m, + .m3, + .no_branch_predictor, + .use_aa, + .use_misched, + }), + }; + pub const strongarm = Cpu{ + .name = "strongarm", + .llvm_name = "strongarm", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const strongarm110 = Cpu{ + .name = "strongarm110", + .llvm_name = "strongarm110", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const strongarm1100 = Cpu{ + .name = "strongarm1100", + .llvm_name = "strongarm1100", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const strongarm1110 = Cpu{ + .name = "strongarm1110", + .llvm_name = "strongarm1110", + .features = featureSet(&[_]Feature{ + .armv4, + }), + }; + pub const swift = Cpu{ + .name = "swift", + .llvm_name = "swift", + .features = featureSet(&[_]Feature{ + .armv7_a, + .avoid_movs_shop, + .avoid_partial_cpsr, + .disable_postra_scheduler, + .hwdiv, + .hwdiv_arm, + .mp, + .neonfp, + .prefer_ishst, + .prof_unpr, + .ret_addr_stack, + .slow_load_D_subreg, + .slow_odd_reg, + .slow_vdup32, + .slow_vgetlni32, + .slowfpvmlx, + .swift, + .use_misched, + .vfp4, + .vmlx_hazards, + .wide_stride_vfp, + }), + }; + pub const xscale = Cpu{ + .name = "xscale", + .llvm_name = "xscale", + .features = featureSet(&[_]Feature{ + .armv5te, + }), + }; +}; + +/// All arm CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.arm1020e, + &cpu.arm1020t, + &cpu.arm1022e, + &cpu.arm10e, + &cpu.arm10tdmi, + &cpu.arm1136j_s, + &cpu.arm1136jf_s, + &cpu.arm1156t2_s, + &cpu.arm1156t2f_s, + &cpu.arm1176j_s, + &cpu.arm1176jz_s, + &cpu.arm1176jzf_s, + &cpu.arm710t, + &cpu.arm720t, + &cpu.arm7tdmi, + &cpu.arm7tdmi_s, + &cpu.arm8, + &cpu.arm810, + &cpu.arm9, + &cpu.arm920, + &cpu.arm920t, + &cpu.arm922t, + &cpu.arm926ej_s, + &cpu.arm940t, + &cpu.arm946e_s, + &cpu.arm966e_s, + &cpu.arm968e_s, + &cpu.arm9e, + &cpu.arm9tdmi, + &cpu.cortex_a12, + &cpu.cortex_a15, + &cpu.cortex_a17, + &cpu.cortex_a32, + &cpu.cortex_a35, + &cpu.cortex_a5, + &cpu.cortex_a53, + &cpu.cortex_a55, + &cpu.cortex_a57, + &cpu.cortex_a7, + &cpu.cortex_a72, + &cpu.cortex_a73, + &cpu.cortex_a75, + &cpu.cortex_a76, + &cpu.cortex_a76ae, + &cpu.cortex_a8, + &cpu.cortex_a9, + &cpu.cortex_m0, + &cpu.cortex_m0plus, + &cpu.cortex_m1, + &cpu.cortex_m23, + &cpu.cortex_m3, + &cpu.cortex_m33, + &cpu.cortex_m35p, + &cpu.cortex_m4, + &cpu.cortex_m7, + &cpu.cortex_r4, + &cpu.cortex_r4f, + &cpu.cortex_r5, + &cpu.cortex_r52, + &cpu.cortex_r7, + &cpu.cortex_r8, + &cpu.cyclone, + &cpu.ep9312, + &cpu.exynos_m1, + &cpu.exynos_m2, + &cpu.exynos_m3, + &cpu.exynos_m4, + &cpu.exynos_m5, + &cpu.generic, + &cpu.iwmmxt, + &cpu.krait, + &cpu.kryo, + &cpu.mpcore, + &cpu.mpcorenovfp, + &cpu.sc000, + &cpu.sc300, + &cpu.strongarm, + &cpu.strongarm110, + &cpu.strongarm1100, + &cpu.strongarm1110, + &cpu.swift, + &cpu.xscale, }; diff --git a/lib/std/target/avr.zig b/lib/std/target/avr.zig index 21b1591b7b..fecb45b69e 100644 --- a/lib/std/target/avr.zig +++ b/lib/std/target/avr.zig @@ -1,4791 +1,2441 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_addsubiw = Feature{ - .name = "addsubiw", - .llvm_name = "addsubiw", - .description = "Enable 16-bit register-immediate addition and subtraction instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_break = Feature{ - .name = "break", - .llvm_name = "break", - .description = "The device supports the `BREAK` debugging instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_des = Feature{ - .name = "des", - .llvm_name = "des", - .description = "The device supports the `DES k` encryption instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_eijmpcall = Feature{ - .name = "eijmpcall", - .llvm_name = "eijmpcall", - .description = "The device supports the `EIJMP`/`EICALL` instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_elpm = Feature{ - .name = "elpm", - .llvm_name = "elpm", - .description = "The device supports the ELPM instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_elpmx = Feature{ - .name = "elpmx", - .llvm_name = "elpmx", - .description = "The device supports the `ELPM Rd, Z[+]` instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ijmpcall = Feature{ - .name = "ijmpcall", - .llvm_name = "ijmpcall", - .description = "The device supports `IJMP`/`ICALL`instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_jmpcall = Feature{ - .name = "jmpcall", - .llvm_name = "jmpcall", - .description = "The device supports the `JMP` and `CALL` instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lpm = Feature{ - .name = "lpm", - .llvm_name = "lpm", - .description = "The device supports the `LPM` instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lpmx = Feature{ - .name = "lpmx", - .llvm_name = "lpmx", - .description = "The device supports the `LPM Rd, Z[+]` instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_movw = Feature{ - .name = "movw", - .llvm_name = "movw", - .description = "The device supports the 16-bit MOVW instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mul = Feature{ - .name = "mul", - .llvm_name = "mul", - .description = "The device supports the multiplication instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_rmw = Feature{ - .name = "rmw", - .llvm_name = "rmw", - .description = "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_spm = Feature{ - .name = "spm", - .llvm_name = "spm", - .description = "The device supports the `SPM` instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_spmx = Feature{ - .name = "spmx", - .llvm_name = "spmx", - .description = "The device supports the `SPM Z+` instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sram = Feature{ - .name = "sram", - .llvm_name = "sram", - .description = "The device has random access memory", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_smallstack = Feature{ - .name = "smallstack", - .llvm_name = "smallstack", - .description = "The device has an 8-bit stack pointer", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tinyencoding = Feature{ - .name = "tinyencoding", - .llvm_name = "tinyencoding", - .description = "The device has Tiny core specific instruction encodings", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_addsubiw, - &feature_break, - &feature_des, - &feature_eijmpcall, - &feature_elpm, - &feature_elpmx, - &feature_ijmpcall, - &feature_jmpcall, - &feature_lpm, - &feature_lpmx, - &feature_movw, - &feature_mul, - &feature_rmw, - &feature_spm, - &feature_spmx, - &feature_sram, - &feature_smallstack, - &feature_tinyencoding, -}; - -pub const cpu_at43usb320 = Cpu{ - .name = "at43usb320", - .llvm_name = "at43usb320", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at43usb355 = Cpu{ - .name = "at43usb355", - .llvm_name = "at43usb355", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at76c711 = Cpu{ - .name = "at76c711", - .llvm_name = "at76c711", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at86rf401 = Cpu{ - .name = "at86rf401", - .llvm_name = "at86rf401", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - }, -}; - -pub const cpu_at90c8534 = Cpu{ - .name = "at90c8534", - .llvm_name = "at90c8534", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90can128 = Cpu{ - .name = "at90can128", - .llvm_name = "at90can128", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90can32 = Cpu{ - .name = "at90can32", - .llvm_name = "at90can32", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90can64 = Cpu{ - .name = "at90can64", - .llvm_name = "at90can64", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm1 = Cpu{ - .name = "at90pwm1", - .llvm_name = "at90pwm1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm161 = Cpu{ - .name = "at90pwm161", - .llvm_name = "at90pwm161", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm2 = Cpu{ - .name = "at90pwm2", - .llvm_name = "at90pwm2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm216 = Cpu{ - .name = "at90pwm216", - .llvm_name = "at90pwm216", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm2b = Cpu{ - .name = "at90pwm2b", - .llvm_name = "at90pwm2b", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm3 = Cpu{ - .name = "at90pwm3", - .llvm_name = "at90pwm3", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm316 = Cpu{ - .name = "at90pwm316", - .llvm_name = "at90pwm316", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm3b = Cpu{ - .name = "at90pwm3b", - .llvm_name = "at90pwm3b", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90pwm81 = Cpu{ - .name = "at90pwm81", - .llvm_name = "at90pwm81", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90s1200 = Cpu{ - .name = "at90s1200", - .llvm_name = "at90s1200", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_at90s2313 = Cpu{ - .name = "at90s2313", - .llvm_name = "at90s2313", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s2323 = Cpu{ - .name = "at90s2323", - .llvm_name = "at90s2323", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s2333 = Cpu{ - .name = "at90s2333", - .llvm_name = "at90s2333", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s2343 = Cpu{ - .name = "at90s2343", - .llvm_name = "at90s2343", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s4414 = Cpu{ - .name = "at90s4414", - .llvm_name = "at90s4414", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s4433 = Cpu{ - .name = "at90s4433", - .llvm_name = "at90s4433", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s4434 = Cpu{ - .name = "at90s4434", - .llvm_name = "at90s4434", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s8515 = Cpu{ - .name = "at90s8515", - .llvm_name = "at90s8515", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90s8535 = Cpu{ - .name = "at90s8535", - .llvm_name = "at90s8535", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_at90scr100 = Cpu{ - .name = "at90scr100", - .llvm_name = "at90scr100", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90usb1286 = Cpu{ - .name = "at90usb1286", - .llvm_name = "at90usb1286", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90usb1287 = Cpu{ - .name = "at90usb1287", - .llvm_name = "at90usb1287", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90usb162 = Cpu{ - .name = "at90usb162", - .llvm_name = "at90usb162", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_at90usb646 = Cpu{ - .name = "at90usb646", - .llvm_name = "at90usb646", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90usb647 = Cpu{ - .name = "at90usb647", - .llvm_name = "at90usb647", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_at90usb82 = Cpu{ - .name = "at90usb82", - .llvm_name = "at90usb82", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_at94k = Cpu{ - .name = "at94k", - .llvm_name = "at94k", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - &feature_mul, - }, -}; - -pub const cpu_ata5272 = Cpu{ - .name = "ata5272", - .llvm_name = "ata5272", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_ata5505 = Cpu{ - .name = "ata5505", - .llvm_name = "ata5505", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_ata5790 = Cpu{ - .name = "ata5790", - .llvm_name = "ata5790", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_ata5795 = Cpu{ - .name = "ata5795", - .llvm_name = "ata5795", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_ata6285 = Cpu{ - .name = "ata6285", - .llvm_name = "ata6285", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_ata6286 = Cpu{ - .name = "ata6286", - .llvm_name = "ata6286", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_ata6289 = Cpu{ - .name = "ata6289", - .llvm_name = "ata6289", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega103 = Cpu{ - .name = "atmega103", - .llvm_name = "atmega103", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_atmega128 = Cpu{ - .name = "atmega128", - .llvm_name = "atmega128", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega1280 = Cpu{ - .name = "atmega1280", - .llvm_name = "atmega1280", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega1281 = Cpu{ - .name = "atmega1281", - .llvm_name = "atmega1281", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega1284 = Cpu{ - .name = "atmega1284", - .llvm_name = "atmega1284", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega1284p = Cpu{ - .name = "atmega1284p", - .llvm_name = "atmega1284p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega1284rfr2 = Cpu{ - .name = "atmega1284rfr2", - .llvm_name = "atmega1284rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega128a = Cpu{ - .name = "atmega128a", - .llvm_name = "atmega128a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega128rfa1 = Cpu{ - .name = "atmega128rfa1", - .llvm_name = "atmega128rfa1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega128rfr2 = Cpu{ - .name = "atmega128rfr2", - .llvm_name = "atmega128rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16 = Cpu{ - .name = "atmega16", - .llvm_name = "atmega16", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega161 = Cpu{ - .name = "atmega161", - .llvm_name = "atmega161", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - &feature_mul, - &feature_spm, - }, -}; - -pub const cpu_atmega162 = Cpu{ - .name = "atmega162", - .llvm_name = "atmega162", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega163 = Cpu{ - .name = "atmega163", - .llvm_name = "atmega163", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - &feature_mul, - &feature_spm, - }, -}; - -pub const cpu_atmega164a = Cpu{ - .name = "atmega164a", - .llvm_name = "atmega164a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega164p = Cpu{ - .name = "atmega164p", - .llvm_name = "atmega164p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega164pa = Cpu{ - .name = "atmega164pa", - .llvm_name = "atmega164pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega165 = Cpu{ - .name = "atmega165", - .llvm_name = "atmega165", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega165a = Cpu{ - .name = "atmega165a", - .llvm_name = "atmega165a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega165p = Cpu{ - .name = "atmega165p", - .llvm_name = "atmega165p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega165pa = Cpu{ - .name = "atmega165pa", - .llvm_name = "atmega165pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega168 = Cpu{ - .name = "atmega168", - .llvm_name = "atmega168", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega168a = Cpu{ - .name = "atmega168a", - .llvm_name = "atmega168a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega168p = Cpu{ - .name = "atmega168p", - .llvm_name = "atmega168p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega168pa = Cpu{ - .name = "atmega168pa", - .llvm_name = "atmega168pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega169 = Cpu{ - .name = "atmega169", - .llvm_name = "atmega169", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega169a = Cpu{ - .name = "atmega169a", - .llvm_name = "atmega169a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega169p = Cpu{ - .name = "atmega169p", - .llvm_name = "atmega169p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega169pa = Cpu{ - .name = "atmega169pa", - .llvm_name = "atmega169pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16a = Cpu{ - .name = "atmega16a", - .llvm_name = "atmega16a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16hva = Cpu{ - .name = "atmega16hva", - .llvm_name = "atmega16hva", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16hva2 = Cpu{ - .name = "atmega16hva2", - .llvm_name = "atmega16hva2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16hvb = Cpu{ - .name = "atmega16hvb", - .llvm_name = "atmega16hvb", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16hvbrevb = Cpu{ - .name = "atmega16hvbrevb", - .llvm_name = "atmega16hvbrevb", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16m1 = Cpu{ - .name = "atmega16m1", - .llvm_name = "atmega16m1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega16u2 = Cpu{ - .name = "atmega16u2", - .llvm_name = "atmega16u2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_atmega16u4 = Cpu{ - .name = "atmega16u4", - .llvm_name = "atmega16u4", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega2560 = Cpu{ - .name = "atmega2560", - .llvm_name = "atmega2560", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega2561 = Cpu{ - .name = "atmega2561", - .llvm_name = "atmega2561", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega2564rfr2 = Cpu{ - .name = "atmega2564rfr2", - .llvm_name = "atmega2564rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega256rfr2 = Cpu{ - .name = "atmega256rfr2", - .llvm_name = "atmega256rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32 = Cpu{ - .name = "atmega32", - .llvm_name = "atmega32", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega323 = Cpu{ - .name = "atmega323", - .llvm_name = "atmega323", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega324a = Cpu{ - .name = "atmega324a", - .llvm_name = "atmega324a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega324p = Cpu{ - .name = "atmega324p", - .llvm_name = "atmega324p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega324pa = Cpu{ - .name = "atmega324pa", - .llvm_name = "atmega324pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega325 = Cpu{ - .name = "atmega325", - .llvm_name = "atmega325", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3250 = Cpu{ - .name = "atmega3250", - .llvm_name = "atmega3250", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3250a = Cpu{ - .name = "atmega3250a", - .llvm_name = "atmega3250a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3250p = Cpu{ - .name = "atmega3250p", - .llvm_name = "atmega3250p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3250pa = Cpu{ - .name = "atmega3250pa", - .llvm_name = "atmega3250pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega325a = Cpu{ - .name = "atmega325a", - .llvm_name = "atmega325a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega325p = Cpu{ - .name = "atmega325p", - .llvm_name = "atmega325p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega325pa = Cpu{ - .name = "atmega325pa", - .llvm_name = "atmega325pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega328 = Cpu{ - .name = "atmega328", - .llvm_name = "atmega328", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega328p = Cpu{ - .name = "atmega328p", - .llvm_name = "atmega328p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega329 = Cpu{ - .name = "atmega329", - .llvm_name = "atmega329", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3290 = Cpu{ - .name = "atmega3290", - .llvm_name = "atmega3290", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3290a = Cpu{ - .name = "atmega3290a", - .llvm_name = "atmega3290a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3290p = Cpu{ - .name = "atmega3290p", - .llvm_name = "atmega3290p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega3290pa = Cpu{ - .name = "atmega3290pa", - .llvm_name = "atmega3290pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega329a = Cpu{ - .name = "atmega329a", - .llvm_name = "atmega329a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega329p = Cpu{ - .name = "atmega329p", - .llvm_name = "atmega329p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega329pa = Cpu{ - .name = "atmega329pa", - .llvm_name = "atmega329pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32a = Cpu{ - .name = "atmega32a", - .llvm_name = "atmega32a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32c1 = Cpu{ - .name = "atmega32c1", - .llvm_name = "atmega32c1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32hvb = Cpu{ - .name = "atmega32hvb", - .llvm_name = "atmega32hvb", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32hvbrevb = Cpu{ - .name = "atmega32hvbrevb", - .llvm_name = "atmega32hvbrevb", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32m1 = Cpu{ - .name = "atmega32m1", - .llvm_name = "atmega32m1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32u2 = Cpu{ - .name = "atmega32u2", - .llvm_name = "atmega32u2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_atmega32u4 = Cpu{ - .name = "atmega32u4", - .llvm_name = "atmega32u4", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega32u6 = Cpu{ - .name = "atmega32u6", - .llvm_name = "atmega32u6", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega406 = Cpu{ - .name = "atmega406", - .llvm_name = "atmega406", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega48 = Cpu{ - .name = "atmega48", - .llvm_name = "atmega48", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega48a = Cpu{ - .name = "atmega48a", - .llvm_name = "atmega48a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega48p = Cpu{ - .name = "atmega48p", - .llvm_name = "atmega48p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega48pa = Cpu{ - .name = "atmega48pa", - .llvm_name = "atmega48pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64 = Cpu{ - .name = "atmega64", - .llvm_name = "atmega64", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega640 = Cpu{ - .name = "atmega640", - .llvm_name = "atmega640", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega644 = Cpu{ - .name = "atmega644", - .llvm_name = "atmega644", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega644a = Cpu{ - .name = "atmega644a", - .llvm_name = "atmega644a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega644p = Cpu{ - .name = "atmega644p", - .llvm_name = "atmega644p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega644pa = Cpu{ - .name = "atmega644pa", - .llvm_name = "atmega644pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega644rfr2 = Cpu{ - .name = "atmega644rfr2", - .llvm_name = "atmega644rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega645 = Cpu{ - .name = "atmega645", - .llvm_name = "atmega645", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6450 = Cpu{ - .name = "atmega6450", - .llvm_name = "atmega6450", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6450a = Cpu{ - .name = "atmega6450a", - .llvm_name = "atmega6450a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6450p = Cpu{ - .name = "atmega6450p", - .llvm_name = "atmega6450p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega645a = Cpu{ - .name = "atmega645a", - .llvm_name = "atmega645a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega645p = Cpu{ - .name = "atmega645p", - .llvm_name = "atmega645p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega649 = Cpu{ - .name = "atmega649", - .llvm_name = "atmega649", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6490 = Cpu{ - .name = "atmega6490", - .llvm_name = "atmega6490", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6490a = Cpu{ - .name = "atmega6490a", - .llvm_name = "atmega6490a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega6490p = Cpu{ - .name = "atmega6490p", - .llvm_name = "atmega6490p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega649a = Cpu{ - .name = "atmega649a", - .llvm_name = "atmega649a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega649p = Cpu{ - .name = "atmega649p", - .llvm_name = "atmega649p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64a = Cpu{ - .name = "atmega64a", - .llvm_name = "atmega64a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64c1 = Cpu{ - .name = "atmega64c1", - .llvm_name = "atmega64c1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64hve = Cpu{ - .name = "atmega64hve", - .llvm_name = "atmega64hve", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64m1 = Cpu{ - .name = "atmega64m1", - .llvm_name = "atmega64m1", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega64rfr2 = Cpu{ - .name = "atmega64rfr2", - .llvm_name = "atmega64rfr2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega8 = Cpu{ - .name = "atmega8", - .llvm_name = "atmega8", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega8515 = Cpu{ - .name = "atmega8515", - .llvm_name = "atmega8515", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - &feature_mul, - &feature_spm, - }, -}; - -pub const cpu_atmega8535 = Cpu{ - .name = "atmega8535", - .llvm_name = "atmega8535", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - &feature_movw, - &feature_mul, - &feature_spm, - }, -}; - -pub const cpu_atmega88 = Cpu{ - .name = "atmega88", - .llvm_name = "atmega88", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega88a = Cpu{ - .name = "atmega88a", - .llvm_name = "atmega88a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega88p = Cpu{ - .name = "atmega88p", - .llvm_name = "atmega88p", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega88pa = Cpu{ - .name = "atmega88pa", - .llvm_name = "atmega88pa", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega8a = Cpu{ - .name = "atmega8a", - .llvm_name = "atmega8a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega8hva = Cpu{ - .name = "atmega8hva", - .llvm_name = "atmega8hva", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atmega8u2 = Cpu{ - .name = "atmega8u2", - .llvm_name = "atmega8u2", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny10 = Cpu{ - .name = "attiny10", - .llvm_name = "attiny10", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny102 = Cpu{ - .name = "attiny102", - .llvm_name = "attiny102", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny104 = Cpu{ - .name = "attiny104", - .llvm_name = "attiny104", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny11 = Cpu{ - .name = "attiny11", - .llvm_name = "attiny11", - .dependencies = &[_]*const Feature { - &feature_lpm, - }, -}; - -pub const cpu_attiny12 = Cpu{ - .name = "attiny12", - .llvm_name = "attiny12", - .dependencies = &[_]*const Feature { - &feature_lpm, - }, -}; - -pub const cpu_attiny13 = Cpu{ - .name = "attiny13", - .llvm_name = "attiny13", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny13a = Cpu{ - .name = "attiny13a", - .llvm_name = "attiny13a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny15 = Cpu{ - .name = "attiny15", - .llvm_name = "attiny15", - .dependencies = &[_]*const Feature { - &feature_lpm, - }, -}; - -pub const cpu_attiny1634 = Cpu{ - .name = "attiny1634", - .llvm_name = "attiny1634", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny167 = Cpu{ - .name = "attiny167", - .llvm_name = "attiny167", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny20 = Cpu{ - .name = "attiny20", - .llvm_name = "attiny20", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny22 = Cpu{ - .name = "attiny22", - .llvm_name = "attiny22", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_attiny2313 = Cpu{ - .name = "attiny2313", - .llvm_name = "attiny2313", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny2313a = Cpu{ - .name = "attiny2313a", - .llvm_name = "attiny2313a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny24 = Cpu{ - .name = "attiny24", - .llvm_name = "attiny24", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny24a = Cpu{ - .name = "attiny24a", - .llvm_name = "attiny24a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny25 = Cpu{ - .name = "attiny25", - .llvm_name = "attiny25", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny26 = Cpu{ - .name = "attiny26", - .llvm_name = "attiny26", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - &feature_lpmx, - }, -}; - -pub const cpu_attiny261 = Cpu{ - .name = "attiny261", - .llvm_name = "attiny261", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny261a = Cpu{ - .name = "attiny261a", - .llvm_name = "attiny261a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny28 = Cpu{ - .name = "attiny28", - .llvm_name = "attiny28", - .dependencies = &[_]*const Feature { - &feature_lpm, - }, -}; - -pub const cpu_attiny4 = Cpu{ - .name = "attiny4", - .llvm_name = "attiny4", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny40 = Cpu{ - .name = "attiny40", - .llvm_name = "attiny40", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny4313 = Cpu{ - .name = "attiny4313", - .llvm_name = "attiny4313", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny43u = Cpu{ - .name = "attiny43u", - .llvm_name = "attiny43u", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny44 = Cpu{ - .name = "attiny44", - .llvm_name = "attiny44", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny44a = Cpu{ - .name = "attiny44a", - .llvm_name = "attiny44a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny45 = Cpu{ - .name = "attiny45", - .llvm_name = "attiny45", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny461 = Cpu{ - .name = "attiny461", - .llvm_name = "attiny461", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny461a = Cpu{ - .name = "attiny461a", - .llvm_name = "attiny461a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny48 = Cpu{ - .name = "attiny48", - .llvm_name = "attiny48", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny5 = Cpu{ - .name = "attiny5", - .llvm_name = "attiny5", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_attiny828 = Cpu{ - .name = "attiny828", - .llvm_name = "attiny828", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny84 = Cpu{ - .name = "attiny84", - .llvm_name = "attiny84", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny84a = Cpu{ - .name = "attiny84a", - .llvm_name = "attiny84a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny85 = Cpu{ - .name = "attiny85", - .llvm_name = "attiny85", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny861 = Cpu{ - .name = "attiny861", - .llvm_name = "attiny861", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny861a = Cpu{ - .name = "attiny861a", - .llvm_name = "attiny861a", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny87 = Cpu{ - .name = "attiny87", - .llvm_name = "attiny87", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny88 = Cpu{ - .name = "attiny88", - .llvm_name = "attiny88", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_attiny9 = Cpu{ - .name = "attiny9", - .llvm_name = "attiny9", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_atxmega128a1 = Cpu{ - .name = "atxmega128a1", - .llvm_name = "atxmega128a1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128a1u = Cpu{ - .name = "atxmega128a1u", - .llvm_name = "atxmega128a1u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128a3 = Cpu{ - .name = "atxmega128a3", - .llvm_name = "atxmega128a3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128a3u = Cpu{ - .name = "atxmega128a3u", - .llvm_name = "atxmega128a3u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128a4u = Cpu{ - .name = "atxmega128a4u", - .llvm_name = "atxmega128a4u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128b1 = Cpu{ - .name = "atxmega128b1", - .llvm_name = "atxmega128b1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128b3 = Cpu{ - .name = "atxmega128b3", - .llvm_name = "atxmega128b3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128c3 = Cpu{ - .name = "atxmega128c3", - .llvm_name = "atxmega128c3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128d3 = Cpu{ - .name = "atxmega128d3", - .llvm_name = "atxmega128d3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega128d4 = Cpu{ - .name = "atxmega128d4", - .llvm_name = "atxmega128d4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega16a4 = Cpu{ - .name = "atxmega16a4", - .llvm_name = "atxmega16a4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega16a4u = Cpu{ - .name = "atxmega16a4u", - .llvm_name = "atxmega16a4u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega16c4 = Cpu{ - .name = "atxmega16c4", - .llvm_name = "atxmega16c4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega16d4 = Cpu{ - .name = "atxmega16d4", - .llvm_name = "atxmega16d4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega16e5 = Cpu{ - .name = "atxmega16e5", - .llvm_name = "atxmega16e5", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega192a3 = Cpu{ - .name = "atxmega192a3", - .llvm_name = "atxmega192a3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega192a3u = Cpu{ - .name = "atxmega192a3u", - .llvm_name = "atxmega192a3u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega192c3 = Cpu{ - .name = "atxmega192c3", - .llvm_name = "atxmega192c3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega192d3 = Cpu{ - .name = "atxmega192d3", - .llvm_name = "atxmega192d3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256a3 = Cpu{ - .name = "atxmega256a3", - .llvm_name = "atxmega256a3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256a3b = Cpu{ - .name = "atxmega256a3b", - .llvm_name = "atxmega256a3b", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256a3bu = Cpu{ - .name = "atxmega256a3bu", - .llvm_name = "atxmega256a3bu", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256a3u = Cpu{ - .name = "atxmega256a3u", - .llvm_name = "atxmega256a3u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256c3 = Cpu{ - .name = "atxmega256c3", - .llvm_name = "atxmega256c3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega256d3 = Cpu{ - .name = "atxmega256d3", - .llvm_name = "atxmega256d3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32a4 = Cpu{ - .name = "atxmega32a4", - .llvm_name = "atxmega32a4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32a4u = Cpu{ - .name = "atxmega32a4u", - .llvm_name = "atxmega32a4u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32c4 = Cpu{ - .name = "atxmega32c4", - .llvm_name = "atxmega32c4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32d4 = Cpu{ - .name = "atxmega32d4", - .llvm_name = "atxmega32d4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32e5 = Cpu{ - .name = "atxmega32e5", - .llvm_name = "atxmega32e5", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega32x1 = Cpu{ - .name = "atxmega32x1", - .llvm_name = "atxmega32x1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega384c3 = Cpu{ - .name = "atxmega384c3", - .llvm_name = "atxmega384c3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega384d3 = Cpu{ - .name = "atxmega384d3", - .llvm_name = "atxmega384d3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64a1 = Cpu{ - .name = "atxmega64a1", - .llvm_name = "atxmega64a1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64a1u = Cpu{ - .name = "atxmega64a1u", - .llvm_name = "atxmega64a1u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64a3 = Cpu{ - .name = "atxmega64a3", - .llvm_name = "atxmega64a3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64a3u = Cpu{ - .name = "atxmega64a3u", - .llvm_name = "atxmega64a3u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64a4u = Cpu{ - .name = "atxmega64a4u", - .llvm_name = "atxmega64a4u", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64b1 = Cpu{ - .name = "atxmega64b1", - .llvm_name = "atxmega64b1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64b3 = Cpu{ - .name = "atxmega64b3", - .llvm_name = "atxmega64b3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64c3 = Cpu{ - .name = "atxmega64c3", - .llvm_name = "atxmega64c3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_rmw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64d3 = Cpu{ - .name = "atxmega64d3", - .llvm_name = "atxmega64d3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega64d4 = Cpu{ - .name = "atxmega64d4", - .llvm_name = "atxmega64d4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_atxmega8e5 = Cpu{ - .name = "atxmega8e5", - .llvm_name = "atxmega8e5", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avr1 = Cpu{ - .name = "avr1", - .llvm_name = "avr1", - .dependencies = &[_]*const Feature { - &feature_lpm, - }, -}; - -pub const cpu_avr2 = Cpu{ - .name = "avr2", - .llvm_name = "avr2", - .dependencies = &[_]*const Feature { - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_avr25 = Cpu{ - .name = "avr25", - .llvm_name = "avr25", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_avr3 = Cpu{ - .name = "avr3", - .llvm_name = "avr3", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_avr31 = Cpu{ - .name = "avr31", - .llvm_name = "avr31", - .dependencies = &[_]*const Feature { - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_ijmpcall, - }, -}; - -pub const cpu_avr35 = Cpu{ - .name = "avr35", - .llvm_name = "avr35", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - }, -}; - -pub const cpu_avr4 = Cpu{ - .name = "avr4", - .llvm_name = "avr4", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avr5 = Cpu{ - .name = "avr5", - .llvm_name = "avr5", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avr51 = Cpu{ - .name = "avr51", - .llvm_name = "avr51", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avr6 = Cpu{ - .name = "avr6", - .llvm_name = "avr6", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrtiny = Cpu{ - .name = "avrtiny", - .llvm_name = "avrtiny", - .dependencies = &[_]*const Feature { - &feature_sram, - &feature_break, - &feature_tinyencoding, - }, -}; - -pub const cpu_avrxmega1 = Cpu{ - .name = "avrxmega1", - .llvm_name = "avrxmega1", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega2 = Cpu{ - .name = "avrxmega2", - .llvm_name = "avrxmega2", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega3 = Cpu{ - .name = "avrxmega3", - .llvm_name = "avrxmega3", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega4 = Cpu{ - .name = "avrxmega4", - .llvm_name = "avrxmega4", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega5 = Cpu{ - .name = "avrxmega5", - .llvm_name = "avrxmega5", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega6 = Cpu{ - .name = "avrxmega6", - .llvm_name = "avrxmega6", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_avrxmega7 = Cpu{ - .name = "avrxmega7", - .llvm_name = "avrxmega7", - .dependencies = &[_]*const Feature { - &feature_spmx, - &feature_des, - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_elpm, - &feature_sram, - &feature_addsubiw, - &feature_elpmx, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_eijmpcall, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpu_m3000 = Cpu{ - .name = "m3000", - .llvm_name = "m3000", - .dependencies = &[_]*const Feature { - &feature_lpmx, - &feature_jmpcall, - &feature_lpm, - &feature_sram, - &feature_addsubiw, - &feature_movw, - &feature_ijmpcall, - &feature_break, - &feature_spm, - &feature_mul, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_at43usb320, - &cpu_at43usb355, - &cpu_at76c711, - &cpu_at86rf401, - &cpu_at90c8534, - &cpu_at90can128, - &cpu_at90can32, - &cpu_at90can64, - &cpu_at90pwm1, - &cpu_at90pwm161, - &cpu_at90pwm2, - &cpu_at90pwm216, - &cpu_at90pwm2b, - &cpu_at90pwm3, - &cpu_at90pwm316, - &cpu_at90pwm3b, - &cpu_at90pwm81, - &cpu_at90s1200, - &cpu_at90s2313, - &cpu_at90s2323, - &cpu_at90s2333, - &cpu_at90s2343, - &cpu_at90s4414, - &cpu_at90s4433, - &cpu_at90s4434, - &cpu_at90s8515, - &cpu_at90s8535, - &cpu_at90scr100, - &cpu_at90usb1286, - &cpu_at90usb1287, - &cpu_at90usb162, - &cpu_at90usb646, - &cpu_at90usb647, - &cpu_at90usb82, - &cpu_at94k, - &cpu_ata5272, - &cpu_ata5505, - &cpu_ata5790, - &cpu_ata5795, - &cpu_ata6285, - &cpu_ata6286, - &cpu_ata6289, - &cpu_atmega103, - &cpu_atmega128, - &cpu_atmega1280, - &cpu_atmega1281, - &cpu_atmega1284, - &cpu_atmega1284p, - &cpu_atmega1284rfr2, - &cpu_atmega128a, - &cpu_atmega128rfa1, - &cpu_atmega128rfr2, - &cpu_atmega16, - &cpu_atmega161, - &cpu_atmega162, - &cpu_atmega163, - &cpu_atmega164a, - &cpu_atmega164p, - &cpu_atmega164pa, - &cpu_atmega165, - &cpu_atmega165a, - &cpu_atmega165p, - &cpu_atmega165pa, - &cpu_atmega168, - &cpu_atmega168a, - &cpu_atmega168p, - &cpu_atmega168pa, - &cpu_atmega169, - &cpu_atmega169a, - &cpu_atmega169p, - &cpu_atmega169pa, - &cpu_atmega16a, - &cpu_atmega16hva, - &cpu_atmega16hva2, - &cpu_atmega16hvb, - &cpu_atmega16hvbrevb, - &cpu_atmega16m1, - &cpu_atmega16u2, - &cpu_atmega16u4, - &cpu_atmega2560, - &cpu_atmega2561, - &cpu_atmega2564rfr2, - &cpu_atmega256rfr2, - &cpu_atmega32, - &cpu_atmega323, - &cpu_atmega324a, - &cpu_atmega324p, - &cpu_atmega324pa, - &cpu_atmega325, - &cpu_atmega3250, - &cpu_atmega3250a, - &cpu_atmega3250p, - &cpu_atmega3250pa, - &cpu_atmega325a, - &cpu_atmega325p, - &cpu_atmega325pa, - &cpu_atmega328, - &cpu_atmega328p, - &cpu_atmega329, - &cpu_atmega3290, - &cpu_atmega3290a, - &cpu_atmega3290p, - &cpu_atmega3290pa, - &cpu_atmega329a, - &cpu_atmega329p, - &cpu_atmega329pa, - &cpu_atmega32a, - &cpu_atmega32c1, - &cpu_atmega32hvb, - &cpu_atmega32hvbrevb, - &cpu_atmega32m1, - &cpu_atmega32u2, - &cpu_atmega32u4, - &cpu_atmega32u6, - &cpu_atmega406, - &cpu_atmega48, - &cpu_atmega48a, - &cpu_atmega48p, - &cpu_atmega48pa, - &cpu_atmega64, - &cpu_atmega640, - &cpu_atmega644, - &cpu_atmega644a, - &cpu_atmega644p, - &cpu_atmega644pa, - &cpu_atmega644rfr2, - &cpu_atmega645, - &cpu_atmega6450, - &cpu_atmega6450a, - &cpu_atmega6450p, - &cpu_atmega645a, - &cpu_atmega645p, - &cpu_atmega649, - &cpu_atmega6490, - &cpu_atmega6490a, - &cpu_atmega6490p, - &cpu_atmega649a, - &cpu_atmega649p, - &cpu_atmega64a, - &cpu_atmega64c1, - &cpu_atmega64hve, - &cpu_atmega64m1, - &cpu_atmega64rfr2, - &cpu_atmega8, - &cpu_atmega8515, - &cpu_atmega8535, - &cpu_atmega88, - &cpu_atmega88a, - &cpu_atmega88p, - &cpu_atmega88pa, - &cpu_atmega8a, - &cpu_atmega8hva, - &cpu_atmega8u2, - &cpu_attiny10, - &cpu_attiny102, - &cpu_attiny104, - &cpu_attiny11, - &cpu_attiny12, - &cpu_attiny13, - &cpu_attiny13a, - &cpu_attiny15, - &cpu_attiny1634, - &cpu_attiny167, - &cpu_attiny20, - &cpu_attiny22, - &cpu_attiny2313, - &cpu_attiny2313a, - &cpu_attiny24, - &cpu_attiny24a, - &cpu_attiny25, - &cpu_attiny26, - &cpu_attiny261, - &cpu_attiny261a, - &cpu_attiny28, - &cpu_attiny4, - &cpu_attiny40, - &cpu_attiny4313, - &cpu_attiny43u, - &cpu_attiny44, - &cpu_attiny44a, - &cpu_attiny45, - &cpu_attiny461, - &cpu_attiny461a, - &cpu_attiny48, - &cpu_attiny5, - &cpu_attiny828, - &cpu_attiny84, - &cpu_attiny84a, - &cpu_attiny85, - &cpu_attiny861, - &cpu_attiny861a, - &cpu_attiny87, - &cpu_attiny88, - &cpu_attiny9, - &cpu_atxmega128a1, - &cpu_atxmega128a1u, - &cpu_atxmega128a3, - &cpu_atxmega128a3u, - &cpu_atxmega128a4u, - &cpu_atxmega128b1, - &cpu_atxmega128b3, - &cpu_atxmega128c3, - &cpu_atxmega128d3, - &cpu_atxmega128d4, - &cpu_atxmega16a4, - &cpu_atxmega16a4u, - &cpu_atxmega16c4, - &cpu_atxmega16d4, - &cpu_atxmega16e5, - &cpu_atxmega192a3, - &cpu_atxmega192a3u, - &cpu_atxmega192c3, - &cpu_atxmega192d3, - &cpu_atxmega256a3, - &cpu_atxmega256a3b, - &cpu_atxmega256a3bu, - &cpu_atxmega256a3u, - &cpu_atxmega256c3, - &cpu_atxmega256d3, - &cpu_atxmega32a4, - &cpu_atxmega32a4u, - &cpu_atxmega32c4, - &cpu_atxmega32d4, - &cpu_atxmega32e5, - &cpu_atxmega32x1, - &cpu_atxmega384c3, - &cpu_atxmega384d3, - &cpu_atxmega64a1, - &cpu_atxmega64a1u, - &cpu_atxmega64a3, - &cpu_atxmega64a3u, - &cpu_atxmega64a4u, - &cpu_atxmega64b1, - &cpu_atxmega64b3, - &cpu_atxmega64c3, - &cpu_atxmega64d3, - &cpu_atxmega64d4, - &cpu_atxmega8e5, - &cpu_avr1, - &cpu_avr2, - &cpu_avr25, - &cpu_avr3, - &cpu_avr31, - &cpu_avr35, - &cpu_avr4, - &cpu_avr5, - &cpu_avr51, - &cpu_avr6, - &cpu_avrtiny, - &cpu_avrxmega1, - &cpu_avrxmega2, - &cpu_avrxmega3, - &cpu_avrxmega4, - &cpu_avrxmega5, - &cpu_avrxmega6, - &cpu_avrxmega7, - &cpu_m3000, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + addsubiw, + avr0, + avr1, + avr2, + avr25, + avr3, + avr31, + avr35, + avr4, + avr5, + avr51, + avr6, + avrtiny, + break, + des, + eijmpcall, + elpm, + elpmx, + ijmpcall, + jmpcall, + lpm, + lpmx, + movw, + mul, + rmw, + smallstack, + special, + spm, + spmx, + sram, + tinyencoding, + xmega, + xmegau, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.addsubiw)] = .{ + .index = @enumToInt(Feature.addsubiw), + .name = @tagName(Feature.addsubiw), + .llvm_name = "addsubiw", + .description = "Enable 16-bit register-immediate addition and subtraction instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.avr0)] = .{ + .index = @enumToInt(Feature.avr0), + .name = @tagName(Feature.avr0), + .llvm_name = "avr0", + .description = "The device is a part of the avr0 family", + .dependencies = 0, + }; + result[@enumToInt(Feature.avr1)] = .{ + .index = @enumToInt(Feature.avr1), + .name = @tagName(Feature.avr1), + .llvm_name = "avr1", + .description = "The device is a part of the avr1 family", + .dependencies = featureSet(&[_]Feature{ + .avr0, + .lpm, + }), + }; + result[@enumToInt(Feature.avr2)] = .{ + .index = @enumToInt(Feature.avr2), + .name = @tagName(Feature.avr2), + .llvm_name = "avr2", + .description = "The device is a part of the avr2 family", + .dependencies = featureSet(&[_]Feature{ + .addsubiw, + .avr1, + .ijmpcall, + .sram, + }), + }; + result[@enumToInt(Feature.avr25)] = .{ + .index = @enumToInt(Feature.avr25), + .name = @tagName(Feature.avr25), + .llvm_name = "avr25", + .description = "The device is a part of the avr25 family", + .dependencies = featureSet(&[_]Feature{ + .avr2, + .break, + .lpmx, + .movw, + .spm, + }), + }; + result[@enumToInt(Feature.avr3)] = .{ + .index = @enumToInt(Feature.avr3), + .name = @tagName(Feature.avr3), + .llvm_name = "avr3", + .description = "The device is a part of the avr3 family", + .dependencies = featureSet(&[_]Feature{ + .avr2, + .jmpcall, + }), + }; + result[@enumToInt(Feature.avr31)] = .{ + .index = @enumToInt(Feature.avr31), + .name = @tagName(Feature.avr31), + .llvm_name = "avr31", + .description = "The device is a part of the avr31 family", + .dependencies = featureSet(&[_]Feature{ + .avr3, + .elpm, + }), + }; + result[@enumToInt(Feature.avr35)] = .{ + .index = @enumToInt(Feature.avr35), + .name = @tagName(Feature.avr35), + .llvm_name = "avr35", + .description = "The device is a part of the avr35 family", + .dependencies = featureSet(&[_]Feature{ + .avr3, + .break, + .lpmx, + .movw, + .spm, + }), + }; + result[@enumToInt(Feature.avr4)] = .{ + .index = @enumToInt(Feature.avr4), + .name = @tagName(Feature.avr4), + .llvm_name = "avr4", + .description = "The device is a part of the avr4 family", + .dependencies = featureSet(&[_]Feature{ + .avr2, + .break, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + result[@enumToInt(Feature.avr5)] = .{ + .index = @enumToInt(Feature.avr5), + .name = @tagName(Feature.avr5), + .llvm_name = "avr5", + .description = "The device is a part of the avr5 family", + .dependencies = featureSet(&[_]Feature{ + .avr3, + .break, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + result[@enumToInt(Feature.avr51)] = .{ + .index = @enumToInt(Feature.avr51), + .name = @tagName(Feature.avr51), + .llvm_name = "avr51", + .description = "The device is a part of the avr51 family", + .dependencies = featureSet(&[_]Feature{ + .avr5, + .elpm, + .elpmx, + }), + }; + result[@enumToInt(Feature.avr6)] = .{ + .index = @enumToInt(Feature.avr6), + .name = @tagName(Feature.avr6), + .llvm_name = "avr6", + .description = "The device is a part of the avr6 family", + .dependencies = featureSet(&[_]Feature{ + .avr51, + }), + }; + result[@enumToInt(Feature.avrtiny)] = .{ + .index = @enumToInt(Feature.avrtiny), + .name = @tagName(Feature.avrtiny), + .llvm_name = "avrtiny", + .description = "The device is a part of the avrtiny family", + .dependencies = featureSet(&[_]Feature{ + .avr0, + .break, + .sram, + .tinyencoding, + }), + }; + result[@enumToInt(Feature.break)] = .{ + .index = @enumToInt(Feature.break), + .name = @tagName(Feature.break), + .llvm_name = "break", + .description = "The device supports the `BREAK` debugging instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.des)] = .{ + .index = @enumToInt(Feature.des), + .name = @tagName(Feature.des), + .llvm_name = "des", + .description = "The device supports the `DES k` encryption instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.eijmpcall)] = .{ + .index = @enumToInt(Feature.eijmpcall), + .name = @tagName(Feature.eijmpcall), + .llvm_name = "eijmpcall", + .description = "The device supports the `EIJMP`/`EICALL` instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.elpm)] = .{ + .index = @enumToInt(Feature.elpm), + .name = @tagName(Feature.elpm), + .llvm_name = "elpm", + .description = "The device supports the ELPM instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.elpmx)] = .{ + .index = @enumToInt(Feature.elpmx), + .name = @tagName(Feature.elpmx), + .llvm_name = "elpmx", + .description = "The device supports the `ELPM Rd, Z[+]` instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.ijmpcall)] = .{ + .index = @enumToInt(Feature.ijmpcall), + .name = @tagName(Feature.ijmpcall), + .llvm_name = "ijmpcall", + .description = "The device supports `IJMP`/`ICALL`instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.jmpcall)] = .{ + .index = @enumToInt(Feature.jmpcall), + .name = @tagName(Feature.jmpcall), + .llvm_name = "jmpcall", + .description = "The device supports the `JMP` and `CALL` instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.lpm)] = .{ + .index = @enumToInt(Feature.lpm), + .name = @tagName(Feature.lpm), + .llvm_name = "lpm", + .description = "The device supports the `LPM` instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.lpmx)] = .{ + .index = @enumToInt(Feature.lpmx), + .name = @tagName(Feature.lpmx), + .llvm_name = "lpmx", + .description = "The device supports the `LPM Rd, Z[+]` instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.movw)] = .{ + .index = @enumToInt(Feature.movw), + .name = @tagName(Feature.movw), + .llvm_name = "movw", + .description = "The device supports the 16-bit MOVW instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.mul)] = .{ + .index = @enumToInt(Feature.mul), + .name = @tagName(Feature.mul), + .llvm_name = "mul", + .description = "The device supports the multiplication instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.rmw)] = .{ + .index = @enumToInt(Feature.rmw), + .name = @tagName(Feature.rmw), + .llvm_name = "rmw", + .description = "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT", + .dependencies = 0, + }; + result[@enumToInt(Feature.smallstack)] = .{ + .index = @enumToInt(Feature.smallstack), + .name = @tagName(Feature.smallstack), + .llvm_name = "smallstack", + .description = "The device has an 8-bit stack pointer", + .dependencies = 0, + }; + result[@enumToInt(Feature.special)] = .{ + .index = @enumToInt(Feature.special), + .name = @tagName(Feature.special), + .llvm_name = "special", + .description = "Enable use of the entire instruction set - used for debugging", + .dependencies = featureSet(&[_]Feature{ + .addsubiw, + .break, + .des, + .eijmpcall, + .elpm, + .elpmx, + .ijmpcall, + .jmpcall, + .lpm, + .lpmx, + .movw, + .mul, + .rmw, + .spm, + .spmx, + .sram, + }), + }; + result[@enumToInt(Feature.spm)] = .{ + .index = @enumToInt(Feature.spm), + .name = @tagName(Feature.spm), + .llvm_name = "spm", + .description = "The device supports the `SPM` instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.spmx)] = .{ + .index = @enumToInt(Feature.spmx), + .name = @tagName(Feature.spmx), + .llvm_name = "spmx", + .description = "The device supports the `SPM Z+` instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.sram)] = .{ + .index = @enumToInt(Feature.sram), + .name = @tagName(Feature.sram), + .llvm_name = "sram", + .description = "The device has random access memory", + .dependencies = 0, + }; + result[@enumToInt(Feature.tinyencoding)] = .{ + .index = @enumToInt(Feature.tinyencoding), + .name = @tagName(Feature.tinyencoding), + .llvm_name = "tinyencoding", + .description = "The device has Tiny core specific instruction encodings", + .dependencies = 0, + }; + result[@enumToInt(Feature.xmega)] = .{ + .index = @enumToInt(Feature.xmega), + .name = @tagName(Feature.xmega), + .llvm_name = "xmega", + .description = "The device is a part of the xmega family", + .dependencies = featureSet(&[_]Feature{ + .avr51, + .des, + .eijmpcall, + .spmx, + }), + }; + result[@enumToInt(Feature.xmegau)] = .{ + .index = @enumToInt(Feature.xmegau), + .name = @tagName(Feature.xmegau), + .llvm_name = "xmegau", + .description = "The device is a part of the xmegau family", + .dependencies = featureSet(&[_]Feature{ + .rmw, + .xmega, + }), + }; + break :blk result; +}; + +pub const cpu = struct { + pub const at43usb320 = Cpu{ + .name = "at43usb320", + .llvm_name = "at43usb320", + .features = featureSet(&[_]Feature{ + .avr31, + }), + }; + pub const at43usb355 = Cpu{ + .name = "at43usb355", + .llvm_name = "at43usb355", + .features = featureSet(&[_]Feature{ + .avr3, + }), + }; + pub const at76c711 = Cpu{ + .name = "at76c711", + .llvm_name = "at76c711", + .features = featureSet(&[_]Feature{ + .avr3, + }), + }; + pub const at86rf401 = Cpu{ + .name = "at86rf401", + .llvm_name = "at86rf401", + .features = featureSet(&[_]Feature{ + .avr2, + .lpmx, + .movw, + }), + }; + pub const at90c8534 = Cpu{ + .name = "at90c8534", + .llvm_name = "at90c8534", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90can128 = Cpu{ + .name = "at90can128", + .llvm_name = "at90can128", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const at90can32 = Cpu{ + .name = "at90can32", + .llvm_name = "at90can32", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90can64 = Cpu{ + .name = "at90can64", + .llvm_name = "at90can64", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90pwm1 = Cpu{ + .name = "at90pwm1", + .llvm_name = "at90pwm1", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90pwm161 = Cpu{ + .name = "at90pwm161", + .llvm_name = "at90pwm161", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90pwm2 = Cpu{ + .name = "at90pwm2", + .llvm_name = "at90pwm2", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90pwm216 = Cpu{ + .name = "at90pwm216", + .llvm_name = "at90pwm216", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90pwm2b = Cpu{ + .name = "at90pwm2b", + .llvm_name = "at90pwm2b", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90pwm3 = Cpu{ + .name = "at90pwm3", + .llvm_name = "at90pwm3", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90pwm316 = Cpu{ + .name = "at90pwm316", + .llvm_name = "at90pwm316", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90pwm3b = Cpu{ + .name = "at90pwm3b", + .llvm_name = "at90pwm3b", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90pwm81 = Cpu{ + .name = "at90pwm81", + .llvm_name = "at90pwm81", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const at90s1200 = Cpu{ + .name = "at90s1200", + .llvm_name = "at90s1200", + .features = featureSet(&[_]Feature{ + .avr0, + }), + }; + pub const at90s2313 = Cpu{ + .name = "at90s2313", + .llvm_name = "at90s2313", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s2323 = Cpu{ + .name = "at90s2323", + .llvm_name = "at90s2323", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s2333 = Cpu{ + .name = "at90s2333", + .llvm_name = "at90s2333", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s2343 = Cpu{ + .name = "at90s2343", + .llvm_name = "at90s2343", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s4414 = Cpu{ + .name = "at90s4414", + .llvm_name = "at90s4414", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s4433 = Cpu{ + .name = "at90s4433", + .llvm_name = "at90s4433", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s4434 = Cpu{ + .name = "at90s4434", + .llvm_name = "at90s4434", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s8515 = Cpu{ + .name = "at90s8515", + .llvm_name = "at90s8515", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90s8535 = Cpu{ + .name = "at90s8535", + .llvm_name = "at90s8535", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const at90scr100 = Cpu{ + .name = "at90scr100", + .llvm_name = "at90scr100", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90usb1286 = Cpu{ + .name = "at90usb1286", + .llvm_name = "at90usb1286", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const at90usb1287 = Cpu{ + .name = "at90usb1287", + .llvm_name = "at90usb1287", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const at90usb162 = Cpu{ + .name = "at90usb162", + .llvm_name = "at90usb162", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const at90usb646 = Cpu{ + .name = "at90usb646", + .llvm_name = "at90usb646", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90usb647 = Cpu{ + .name = "at90usb647", + .llvm_name = "at90usb647", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const at90usb82 = Cpu{ + .name = "at90usb82", + .llvm_name = "at90usb82", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const at94k = Cpu{ + .name = "at94k", + .llvm_name = "at94k", + .features = featureSet(&[_]Feature{ + .avr3, + .lpmx, + .movw, + .mul, + }), + }; + pub const ata5272 = Cpu{ + .name = "ata5272", + .llvm_name = "ata5272", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const ata5505 = Cpu{ + .name = "ata5505", + .llvm_name = "ata5505", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const ata5790 = Cpu{ + .name = "ata5790", + .llvm_name = "ata5790", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const ata5795 = Cpu{ + .name = "ata5795", + .llvm_name = "ata5795", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const ata6285 = Cpu{ + .name = "ata6285", + .llvm_name = "ata6285", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const ata6286 = Cpu{ + .name = "ata6286", + .llvm_name = "ata6286", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const ata6289 = Cpu{ + .name = "ata6289", + .llvm_name = "ata6289", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega103 = Cpu{ + .name = "atmega103", + .llvm_name = "atmega103", + .features = featureSet(&[_]Feature{ + .avr31, + }), + }; + pub const atmega128 = Cpu{ + .name = "atmega128", + .llvm_name = "atmega128", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega1280 = Cpu{ + .name = "atmega1280", + .llvm_name = "atmega1280", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega1281 = Cpu{ + .name = "atmega1281", + .llvm_name = "atmega1281", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega1284 = Cpu{ + .name = "atmega1284", + .llvm_name = "atmega1284", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega1284p = Cpu{ + .name = "atmega1284p", + .llvm_name = "atmega1284p", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega1284rfr2 = Cpu{ + .name = "atmega1284rfr2", + .llvm_name = "atmega1284rfr2", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega128a = Cpu{ + .name = "atmega128a", + .llvm_name = "atmega128a", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega128rfa1 = Cpu{ + .name = "atmega128rfa1", + .llvm_name = "atmega128rfa1", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega128rfr2 = Cpu{ + .name = "atmega128rfr2", + .llvm_name = "atmega128rfr2", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const atmega16 = Cpu{ + .name = "atmega16", + .llvm_name = "atmega16", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega161 = Cpu{ + .name = "atmega161", + .llvm_name = "atmega161", + .features = featureSet(&[_]Feature{ + .avr3, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + pub const atmega162 = Cpu{ + .name = "atmega162", + .llvm_name = "atmega162", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega163 = Cpu{ + .name = "atmega163", + .llvm_name = "atmega163", + .features = featureSet(&[_]Feature{ + .avr3, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + pub const atmega164a = Cpu{ + .name = "atmega164a", + .llvm_name = "atmega164a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega164p = Cpu{ + .name = "atmega164p", + .llvm_name = "atmega164p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega164pa = Cpu{ + .name = "atmega164pa", + .llvm_name = "atmega164pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega165 = Cpu{ + .name = "atmega165", + .llvm_name = "atmega165", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega165a = Cpu{ + .name = "atmega165a", + .llvm_name = "atmega165a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega165p = Cpu{ + .name = "atmega165p", + .llvm_name = "atmega165p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega165pa = Cpu{ + .name = "atmega165pa", + .llvm_name = "atmega165pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega168 = Cpu{ + .name = "atmega168", + .llvm_name = "atmega168", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega168a = Cpu{ + .name = "atmega168a", + .llvm_name = "atmega168a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega168p = Cpu{ + .name = "atmega168p", + .llvm_name = "atmega168p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega168pa = Cpu{ + .name = "atmega168pa", + .llvm_name = "atmega168pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega169 = Cpu{ + .name = "atmega169", + .llvm_name = "atmega169", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega169a = Cpu{ + .name = "atmega169a", + .llvm_name = "atmega169a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega169p = Cpu{ + .name = "atmega169p", + .llvm_name = "atmega169p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega169pa = Cpu{ + .name = "atmega169pa", + .llvm_name = "atmega169pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16a = Cpu{ + .name = "atmega16a", + .llvm_name = "atmega16a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16hva = Cpu{ + .name = "atmega16hva", + .llvm_name = "atmega16hva", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16hva2 = Cpu{ + .name = "atmega16hva2", + .llvm_name = "atmega16hva2", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16hvb = Cpu{ + .name = "atmega16hvb", + .llvm_name = "atmega16hvb", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16hvbrevb = Cpu{ + .name = "atmega16hvbrevb", + .llvm_name = "atmega16hvbrevb", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16m1 = Cpu{ + .name = "atmega16m1", + .llvm_name = "atmega16m1", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega16u2 = Cpu{ + .name = "atmega16u2", + .llvm_name = "atmega16u2", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const atmega16u4 = Cpu{ + .name = "atmega16u4", + .llvm_name = "atmega16u4", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega2560 = Cpu{ + .name = "atmega2560", + .llvm_name = "atmega2560", + .features = featureSet(&[_]Feature{ + .avr6, + }), + }; + pub const atmega2561 = Cpu{ + .name = "atmega2561", + .llvm_name = "atmega2561", + .features = featureSet(&[_]Feature{ + .avr6, + }), + }; + pub const atmega2564rfr2 = Cpu{ + .name = "atmega2564rfr2", + .llvm_name = "atmega2564rfr2", + .features = featureSet(&[_]Feature{ + .avr6, + }), + }; + pub const atmega256rfr2 = Cpu{ + .name = "atmega256rfr2", + .llvm_name = "atmega256rfr2", + .features = featureSet(&[_]Feature{ + .avr6, + }), + }; + pub const atmega32 = Cpu{ + .name = "atmega32", + .llvm_name = "atmega32", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega323 = Cpu{ + .name = "atmega323", + .llvm_name = "atmega323", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega324a = Cpu{ + .name = "atmega324a", + .llvm_name = "atmega324a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega324p = Cpu{ + .name = "atmega324p", + .llvm_name = "atmega324p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega324pa = Cpu{ + .name = "atmega324pa", + .llvm_name = "atmega324pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega325 = Cpu{ + .name = "atmega325", + .llvm_name = "atmega325", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3250 = Cpu{ + .name = "atmega3250", + .llvm_name = "atmega3250", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3250a = Cpu{ + .name = "atmega3250a", + .llvm_name = "atmega3250a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3250p = Cpu{ + .name = "atmega3250p", + .llvm_name = "atmega3250p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3250pa = Cpu{ + .name = "atmega3250pa", + .llvm_name = "atmega3250pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega325a = Cpu{ + .name = "atmega325a", + .llvm_name = "atmega325a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega325p = Cpu{ + .name = "atmega325p", + .llvm_name = "atmega325p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega325pa = Cpu{ + .name = "atmega325pa", + .llvm_name = "atmega325pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega328 = Cpu{ + .name = "atmega328", + .llvm_name = "atmega328", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega328p = Cpu{ + .name = "atmega328p", + .llvm_name = "atmega328p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega329 = Cpu{ + .name = "atmega329", + .llvm_name = "atmega329", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3290 = Cpu{ + .name = "atmega3290", + .llvm_name = "atmega3290", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3290a = Cpu{ + .name = "atmega3290a", + .llvm_name = "atmega3290a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3290p = Cpu{ + .name = "atmega3290p", + .llvm_name = "atmega3290p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega3290pa = Cpu{ + .name = "atmega3290pa", + .llvm_name = "atmega3290pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega329a = Cpu{ + .name = "atmega329a", + .llvm_name = "atmega329a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega329p = Cpu{ + .name = "atmega329p", + .llvm_name = "atmega329p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega329pa = Cpu{ + .name = "atmega329pa", + .llvm_name = "atmega329pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32a = Cpu{ + .name = "atmega32a", + .llvm_name = "atmega32a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32c1 = Cpu{ + .name = "atmega32c1", + .llvm_name = "atmega32c1", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32hvb = Cpu{ + .name = "atmega32hvb", + .llvm_name = "atmega32hvb", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32hvbrevb = Cpu{ + .name = "atmega32hvbrevb", + .llvm_name = "atmega32hvbrevb", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32m1 = Cpu{ + .name = "atmega32m1", + .llvm_name = "atmega32m1", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32u2 = Cpu{ + .name = "atmega32u2", + .llvm_name = "atmega32u2", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const atmega32u4 = Cpu{ + .name = "atmega32u4", + .llvm_name = "atmega32u4", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega32u6 = Cpu{ + .name = "atmega32u6", + .llvm_name = "atmega32u6", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega406 = Cpu{ + .name = "atmega406", + .llvm_name = "atmega406", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega48 = Cpu{ + .name = "atmega48", + .llvm_name = "atmega48", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega48a = Cpu{ + .name = "atmega48a", + .llvm_name = "atmega48a", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega48p = Cpu{ + .name = "atmega48p", + .llvm_name = "atmega48p", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega48pa = Cpu{ + .name = "atmega48pa", + .llvm_name = "atmega48pa", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega64 = Cpu{ + .name = "atmega64", + .llvm_name = "atmega64", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega640 = Cpu{ + .name = "atmega640", + .llvm_name = "atmega640", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega644 = Cpu{ + .name = "atmega644", + .llvm_name = "atmega644", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega644a = Cpu{ + .name = "atmega644a", + .llvm_name = "atmega644a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega644p = Cpu{ + .name = "atmega644p", + .llvm_name = "atmega644p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega644pa = Cpu{ + .name = "atmega644pa", + .llvm_name = "atmega644pa", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega644rfr2 = Cpu{ + .name = "atmega644rfr2", + .llvm_name = "atmega644rfr2", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega645 = Cpu{ + .name = "atmega645", + .llvm_name = "atmega645", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6450 = Cpu{ + .name = "atmega6450", + .llvm_name = "atmega6450", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6450a = Cpu{ + .name = "atmega6450a", + .llvm_name = "atmega6450a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6450p = Cpu{ + .name = "atmega6450p", + .llvm_name = "atmega6450p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega645a = Cpu{ + .name = "atmega645a", + .llvm_name = "atmega645a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega645p = Cpu{ + .name = "atmega645p", + .llvm_name = "atmega645p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega649 = Cpu{ + .name = "atmega649", + .llvm_name = "atmega649", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6490 = Cpu{ + .name = "atmega6490", + .llvm_name = "atmega6490", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6490a = Cpu{ + .name = "atmega6490a", + .llvm_name = "atmega6490a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega6490p = Cpu{ + .name = "atmega6490p", + .llvm_name = "atmega6490p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega649a = Cpu{ + .name = "atmega649a", + .llvm_name = "atmega649a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega649p = Cpu{ + .name = "atmega649p", + .llvm_name = "atmega649p", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega64a = Cpu{ + .name = "atmega64a", + .llvm_name = "atmega64a", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega64c1 = Cpu{ + .name = "atmega64c1", + .llvm_name = "atmega64c1", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega64hve = Cpu{ + .name = "atmega64hve", + .llvm_name = "atmega64hve", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega64m1 = Cpu{ + .name = "atmega64m1", + .llvm_name = "atmega64m1", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega64rfr2 = Cpu{ + .name = "atmega64rfr2", + .llvm_name = "atmega64rfr2", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const atmega8 = Cpu{ + .name = "atmega8", + .llvm_name = "atmega8", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega8515 = Cpu{ + .name = "atmega8515", + .llvm_name = "atmega8515", + .features = featureSet(&[_]Feature{ + .avr2, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + pub const atmega8535 = Cpu{ + .name = "atmega8535", + .llvm_name = "atmega8535", + .features = featureSet(&[_]Feature{ + .avr2, + .lpmx, + .movw, + .mul, + .spm, + }), + }; + pub const atmega88 = Cpu{ + .name = "atmega88", + .llvm_name = "atmega88", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega88a = Cpu{ + .name = "atmega88a", + .llvm_name = "atmega88a", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega88p = Cpu{ + .name = "atmega88p", + .llvm_name = "atmega88p", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega88pa = Cpu{ + .name = "atmega88pa", + .llvm_name = "atmega88pa", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega8a = Cpu{ + .name = "atmega8a", + .llvm_name = "atmega8a", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega8hva = Cpu{ + .name = "atmega8hva", + .llvm_name = "atmega8hva", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const atmega8u2 = Cpu{ + .name = "atmega8u2", + .llvm_name = "atmega8u2", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const attiny10 = Cpu{ + .name = "attiny10", + .llvm_name = "attiny10", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny102 = Cpu{ + .name = "attiny102", + .llvm_name = "attiny102", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny104 = Cpu{ + .name = "attiny104", + .llvm_name = "attiny104", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny11 = Cpu{ + .name = "attiny11", + .llvm_name = "attiny11", + .features = featureSet(&[_]Feature{ + .avr1, + }), + }; + pub const attiny12 = Cpu{ + .name = "attiny12", + .llvm_name = "attiny12", + .features = featureSet(&[_]Feature{ + .avr1, + }), + }; + pub const attiny13 = Cpu{ + .name = "attiny13", + .llvm_name = "attiny13", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny13a = Cpu{ + .name = "attiny13a", + .llvm_name = "attiny13a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny15 = Cpu{ + .name = "attiny15", + .llvm_name = "attiny15", + .features = featureSet(&[_]Feature{ + .avr1, + }), + }; + pub const attiny1634 = Cpu{ + .name = "attiny1634", + .llvm_name = "attiny1634", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const attiny167 = Cpu{ + .name = "attiny167", + .llvm_name = "attiny167", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const attiny20 = Cpu{ + .name = "attiny20", + .llvm_name = "attiny20", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny22 = Cpu{ + .name = "attiny22", + .llvm_name = "attiny22", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const attiny2313 = Cpu{ + .name = "attiny2313", + .llvm_name = "attiny2313", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny2313a = Cpu{ + .name = "attiny2313a", + .llvm_name = "attiny2313a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny24 = Cpu{ + .name = "attiny24", + .llvm_name = "attiny24", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny24a = Cpu{ + .name = "attiny24a", + .llvm_name = "attiny24a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny25 = Cpu{ + .name = "attiny25", + .llvm_name = "attiny25", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny26 = Cpu{ + .name = "attiny26", + .llvm_name = "attiny26", + .features = featureSet(&[_]Feature{ + .avr2, + .lpmx, + }), + }; + pub const attiny261 = Cpu{ + .name = "attiny261", + .llvm_name = "attiny261", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny261a = Cpu{ + .name = "attiny261a", + .llvm_name = "attiny261a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny28 = Cpu{ + .name = "attiny28", + .llvm_name = "attiny28", + .features = featureSet(&[_]Feature{ + .avr1, + }), + }; + pub const attiny4 = Cpu{ + .name = "attiny4", + .llvm_name = "attiny4", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny40 = Cpu{ + .name = "attiny40", + .llvm_name = "attiny40", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny4313 = Cpu{ + .name = "attiny4313", + .llvm_name = "attiny4313", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny43u = Cpu{ + .name = "attiny43u", + .llvm_name = "attiny43u", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny44 = Cpu{ + .name = "attiny44", + .llvm_name = "attiny44", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny44a = Cpu{ + .name = "attiny44a", + .llvm_name = "attiny44a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny45 = Cpu{ + .name = "attiny45", + .llvm_name = "attiny45", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny461 = Cpu{ + .name = "attiny461", + .llvm_name = "attiny461", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny461a = Cpu{ + .name = "attiny461a", + .llvm_name = "attiny461a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny48 = Cpu{ + .name = "attiny48", + .llvm_name = "attiny48", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny5 = Cpu{ + .name = "attiny5", + .llvm_name = "attiny5", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const attiny828 = Cpu{ + .name = "attiny828", + .llvm_name = "attiny828", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny84 = Cpu{ + .name = "attiny84", + .llvm_name = "attiny84", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny84a = Cpu{ + .name = "attiny84a", + .llvm_name = "attiny84a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny85 = Cpu{ + .name = "attiny85", + .llvm_name = "attiny85", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny861 = Cpu{ + .name = "attiny861", + .llvm_name = "attiny861", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny861a = Cpu{ + .name = "attiny861a", + .llvm_name = "attiny861a", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny87 = Cpu{ + .name = "attiny87", + .llvm_name = "attiny87", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny88 = Cpu{ + .name = "attiny88", + .llvm_name = "attiny88", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const attiny9 = Cpu{ + .name = "attiny9", + .llvm_name = "attiny9", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const atxmega128a1 = Cpu{ + .name = "atxmega128a1", + .llvm_name = "atxmega128a1", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega128a1u = Cpu{ + .name = "atxmega128a1u", + .llvm_name = "atxmega128a1u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128a3 = Cpu{ + .name = "atxmega128a3", + .llvm_name = "atxmega128a3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega128a3u = Cpu{ + .name = "atxmega128a3u", + .llvm_name = "atxmega128a3u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128a4u = Cpu{ + .name = "atxmega128a4u", + .llvm_name = "atxmega128a4u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128b1 = Cpu{ + .name = "atxmega128b1", + .llvm_name = "atxmega128b1", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128b3 = Cpu{ + .name = "atxmega128b3", + .llvm_name = "atxmega128b3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128c3 = Cpu{ + .name = "atxmega128c3", + .llvm_name = "atxmega128c3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega128d3 = Cpu{ + .name = "atxmega128d3", + .llvm_name = "atxmega128d3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega128d4 = Cpu{ + .name = "atxmega128d4", + .llvm_name = "atxmega128d4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega16a4 = Cpu{ + .name = "atxmega16a4", + .llvm_name = "atxmega16a4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega16a4u = Cpu{ + .name = "atxmega16a4u", + .llvm_name = "atxmega16a4u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega16c4 = Cpu{ + .name = "atxmega16c4", + .llvm_name = "atxmega16c4", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega16d4 = Cpu{ + .name = "atxmega16d4", + .llvm_name = "atxmega16d4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega16e5 = Cpu{ + .name = "atxmega16e5", + .llvm_name = "atxmega16e5", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega192a3 = Cpu{ + .name = "atxmega192a3", + .llvm_name = "atxmega192a3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega192a3u = Cpu{ + .name = "atxmega192a3u", + .llvm_name = "atxmega192a3u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega192c3 = Cpu{ + .name = "atxmega192c3", + .llvm_name = "atxmega192c3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega192d3 = Cpu{ + .name = "atxmega192d3", + .llvm_name = "atxmega192d3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega256a3 = Cpu{ + .name = "atxmega256a3", + .llvm_name = "atxmega256a3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega256a3b = Cpu{ + .name = "atxmega256a3b", + .llvm_name = "atxmega256a3b", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega256a3bu = Cpu{ + .name = "atxmega256a3bu", + .llvm_name = "atxmega256a3bu", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega256a3u = Cpu{ + .name = "atxmega256a3u", + .llvm_name = "atxmega256a3u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega256c3 = Cpu{ + .name = "atxmega256c3", + .llvm_name = "atxmega256c3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega256d3 = Cpu{ + .name = "atxmega256d3", + .llvm_name = "atxmega256d3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega32a4 = Cpu{ + .name = "atxmega32a4", + .llvm_name = "atxmega32a4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega32a4u = Cpu{ + .name = "atxmega32a4u", + .llvm_name = "atxmega32a4u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega32c4 = Cpu{ + .name = "atxmega32c4", + .llvm_name = "atxmega32c4", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega32d4 = Cpu{ + .name = "atxmega32d4", + .llvm_name = "atxmega32d4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega32e5 = Cpu{ + .name = "atxmega32e5", + .llvm_name = "atxmega32e5", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega32x1 = Cpu{ + .name = "atxmega32x1", + .llvm_name = "atxmega32x1", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega384c3 = Cpu{ + .name = "atxmega384c3", + .llvm_name = "atxmega384c3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega384d3 = Cpu{ + .name = "atxmega384d3", + .llvm_name = "atxmega384d3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega64a1 = Cpu{ + .name = "atxmega64a1", + .llvm_name = "atxmega64a1", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega64a1u = Cpu{ + .name = "atxmega64a1u", + .llvm_name = "atxmega64a1u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64a3 = Cpu{ + .name = "atxmega64a3", + .llvm_name = "atxmega64a3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega64a3u = Cpu{ + .name = "atxmega64a3u", + .llvm_name = "atxmega64a3u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64a4u = Cpu{ + .name = "atxmega64a4u", + .llvm_name = "atxmega64a4u", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64b1 = Cpu{ + .name = "atxmega64b1", + .llvm_name = "atxmega64b1", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64b3 = Cpu{ + .name = "atxmega64b3", + .llvm_name = "atxmega64b3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64c3 = Cpu{ + .name = "atxmega64c3", + .llvm_name = "atxmega64c3", + .features = featureSet(&[_]Feature{ + .xmegau, + }), + }; + pub const atxmega64d3 = Cpu{ + .name = "atxmega64d3", + .llvm_name = "atxmega64d3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega64d4 = Cpu{ + .name = "atxmega64d4", + .llvm_name = "atxmega64d4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const atxmega8e5 = Cpu{ + .name = "atxmega8e5", + .llvm_name = "atxmega8e5", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avr1 = Cpu{ + .name = "avr1", + .llvm_name = "avr1", + .features = featureSet(&[_]Feature{ + .avr1, + }), + }; + pub const avr2 = Cpu{ + .name = "avr2", + .llvm_name = "avr2", + .features = featureSet(&[_]Feature{ + .avr2, + }), + }; + pub const avr25 = Cpu{ + .name = "avr25", + .llvm_name = "avr25", + .features = featureSet(&[_]Feature{ + .avr25, + }), + }; + pub const avr3 = Cpu{ + .name = "avr3", + .llvm_name = "avr3", + .features = featureSet(&[_]Feature{ + .avr3, + }), + }; + pub const avr31 = Cpu{ + .name = "avr31", + .llvm_name = "avr31", + .features = featureSet(&[_]Feature{ + .avr31, + }), + }; + pub const avr35 = Cpu{ + .name = "avr35", + .llvm_name = "avr35", + .features = featureSet(&[_]Feature{ + .avr35, + }), + }; + pub const avr4 = Cpu{ + .name = "avr4", + .llvm_name = "avr4", + .features = featureSet(&[_]Feature{ + .avr4, + }), + }; + pub const avr5 = Cpu{ + .name = "avr5", + .llvm_name = "avr5", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; + pub const avr51 = Cpu{ + .name = "avr51", + .llvm_name = "avr51", + .features = featureSet(&[_]Feature{ + .avr51, + }), + }; + pub const avr6 = Cpu{ + .name = "avr6", + .llvm_name = "avr6", + .features = featureSet(&[_]Feature{ + .avr6, + }), + }; + pub const avrtiny = Cpu{ + .name = "avrtiny", + .llvm_name = "avrtiny", + .features = featureSet(&[_]Feature{ + .avrtiny, + }), + }; + pub const avrxmega1 = Cpu{ + .name = "avrxmega1", + .llvm_name = "avrxmega1", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega2 = Cpu{ + .name = "avrxmega2", + .llvm_name = "avrxmega2", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega3 = Cpu{ + .name = "avrxmega3", + .llvm_name = "avrxmega3", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega4 = Cpu{ + .name = "avrxmega4", + .llvm_name = "avrxmega4", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega5 = Cpu{ + .name = "avrxmega5", + .llvm_name = "avrxmega5", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega6 = Cpu{ + .name = "avrxmega6", + .llvm_name = "avrxmega6", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const avrxmega7 = Cpu{ + .name = "avrxmega7", + .llvm_name = "avrxmega7", + .features = featureSet(&[_]Feature{ + .xmega, + }), + }; + pub const m3000 = Cpu{ + .name = "m3000", + .llvm_name = "m3000", + .features = featureSet(&[_]Feature{ + .avr5, + }), + }; +}; + +/// All avr CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.at43usb320, + &cpu.at43usb355, + &cpu.at76c711, + &cpu.at86rf401, + &cpu.at90c8534, + &cpu.at90can128, + &cpu.at90can32, + &cpu.at90can64, + &cpu.at90pwm1, + &cpu.at90pwm161, + &cpu.at90pwm2, + &cpu.at90pwm216, + &cpu.at90pwm2b, + &cpu.at90pwm3, + &cpu.at90pwm316, + &cpu.at90pwm3b, + &cpu.at90pwm81, + &cpu.at90s1200, + &cpu.at90s2313, + &cpu.at90s2323, + &cpu.at90s2333, + &cpu.at90s2343, + &cpu.at90s4414, + &cpu.at90s4433, + &cpu.at90s4434, + &cpu.at90s8515, + &cpu.at90s8535, + &cpu.at90scr100, + &cpu.at90usb1286, + &cpu.at90usb1287, + &cpu.at90usb162, + &cpu.at90usb646, + &cpu.at90usb647, + &cpu.at90usb82, + &cpu.at94k, + &cpu.ata5272, + &cpu.ata5505, + &cpu.ata5790, + &cpu.ata5795, + &cpu.ata6285, + &cpu.ata6286, + &cpu.ata6289, + &cpu.atmega103, + &cpu.atmega128, + &cpu.atmega1280, + &cpu.atmega1281, + &cpu.atmega1284, + &cpu.atmega1284p, + &cpu.atmega1284rfr2, + &cpu.atmega128a, + &cpu.atmega128rfa1, + &cpu.atmega128rfr2, + &cpu.atmega16, + &cpu.atmega161, + &cpu.atmega162, + &cpu.atmega163, + &cpu.atmega164a, + &cpu.atmega164p, + &cpu.atmega164pa, + &cpu.atmega165, + &cpu.atmega165a, + &cpu.atmega165p, + &cpu.atmega165pa, + &cpu.atmega168, + &cpu.atmega168a, + &cpu.atmega168p, + &cpu.atmega168pa, + &cpu.atmega169, + &cpu.atmega169a, + &cpu.atmega169p, + &cpu.atmega169pa, + &cpu.atmega16a, + &cpu.atmega16hva, + &cpu.atmega16hva2, + &cpu.atmega16hvb, + &cpu.atmega16hvbrevb, + &cpu.atmega16m1, + &cpu.atmega16u2, + &cpu.atmega16u4, + &cpu.atmega2560, + &cpu.atmega2561, + &cpu.atmega2564rfr2, + &cpu.atmega256rfr2, + &cpu.atmega32, + &cpu.atmega323, + &cpu.atmega324a, + &cpu.atmega324p, + &cpu.atmega324pa, + &cpu.atmega325, + &cpu.atmega3250, + &cpu.atmega3250a, + &cpu.atmega3250p, + &cpu.atmega3250pa, + &cpu.atmega325a, + &cpu.atmega325p, + &cpu.atmega325pa, + &cpu.atmega328, + &cpu.atmega328p, + &cpu.atmega329, + &cpu.atmega3290, + &cpu.atmega3290a, + &cpu.atmega3290p, + &cpu.atmega3290pa, + &cpu.atmega329a, + &cpu.atmega329p, + &cpu.atmega329pa, + &cpu.atmega32a, + &cpu.atmega32c1, + &cpu.atmega32hvb, + &cpu.atmega32hvbrevb, + &cpu.atmega32m1, + &cpu.atmega32u2, + &cpu.atmega32u4, + &cpu.atmega32u6, + &cpu.atmega406, + &cpu.atmega48, + &cpu.atmega48a, + &cpu.atmega48p, + &cpu.atmega48pa, + &cpu.atmega64, + &cpu.atmega640, + &cpu.atmega644, + &cpu.atmega644a, + &cpu.atmega644p, + &cpu.atmega644pa, + &cpu.atmega644rfr2, + &cpu.atmega645, + &cpu.atmega6450, + &cpu.atmega6450a, + &cpu.atmega6450p, + &cpu.atmega645a, + &cpu.atmega645p, + &cpu.atmega649, + &cpu.atmega6490, + &cpu.atmega6490a, + &cpu.atmega6490p, + &cpu.atmega649a, + &cpu.atmega649p, + &cpu.atmega64a, + &cpu.atmega64c1, + &cpu.atmega64hve, + &cpu.atmega64m1, + &cpu.atmega64rfr2, + &cpu.atmega8, + &cpu.atmega8515, + &cpu.atmega8535, + &cpu.atmega88, + &cpu.atmega88a, + &cpu.atmega88p, + &cpu.atmega88pa, + &cpu.atmega8a, + &cpu.atmega8hva, + &cpu.atmega8u2, + &cpu.attiny10, + &cpu.attiny102, + &cpu.attiny104, + &cpu.attiny11, + &cpu.attiny12, + &cpu.attiny13, + &cpu.attiny13a, + &cpu.attiny15, + &cpu.attiny1634, + &cpu.attiny167, + &cpu.attiny20, + &cpu.attiny22, + &cpu.attiny2313, + &cpu.attiny2313a, + &cpu.attiny24, + &cpu.attiny24a, + &cpu.attiny25, + &cpu.attiny26, + &cpu.attiny261, + &cpu.attiny261a, + &cpu.attiny28, + &cpu.attiny4, + &cpu.attiny40, + &cpu.attiny4313, + &cpu.attiny43u, + &cpu.attiny44, + &cpu.attiny44a, + &cpu.attiny45, + &cpu.attiny461, + &cpu.attiny461a, + &cpu.attiny48, + &cpu.attiny5, + &cpu.attiny828, + &cpu.attiny84, + &cpu.attiny84a, + &cpu.attiny85, + &cpu.attiny861, + &cpu.attiny861a, + &cpu.attiny87, + &cpu.attiny88, + &cpu.attiny9, + &cpu.atxmega128a1, + &cpu.atxmega128a1u, + &cpu.atxmega128a3, + &cpu.atxmega128a3u, + &cpu.atxmega128a4u, + &cpu.atxmega128b1, + &cpu.atxmega128b3, + &cpu.atxmega128c3, + &cpu.atxmega128d3, + &cpu.atxmega128d4, + &cpu.atxmega16a4, + &cpu.atxmega16a4u, + &cpu.atxmega16c4, + &cpu.atxmega16d4, + &cpu.atxmega16e5, + &cpu.atxmega192a3, + &cpu.atxmega192a3u, + &cpu.atxmega192c3, + &cpu.atxmega192d3, + &cpu.atxmega256a3, + &cpu.atxmega256a3b, + &cpu.atxmega256a3bu, + &cpu.atxmega256a3u, + &cpu.atxmega256c3, + &cpu.atxmega256d3, + &cpu.atxmega32a4, + &cpu.atxmega32a4u, + &cpu.atxmega32c4, + &cpu.atxmega32d4, + &cpu.atxmega32e5, + &cpu.atxmega32x1, + &cpu.atxmega384c3, + &cpu.atxmega384d3, + &cpu.atxmega64a1, + &cpu.atxmega64a1u, + &cpu.atxmega64a3, + &cpu.atxmega64a3u, + &cpu.atxmega64a4u, + &cpu.atxmega64b1, + &cpu.atxmega64b3, + &cpu.atxmega64c3, + &cpu.atxmega64d3, + &cpu.atxmega64d4, + &cpu.atxmega8e5, + &cpu.avr1, + &cpu.avr2, + &cpu.avr25, + &cpu.avr3, + &cpu.avr31, + &cpu.avr35, + &cpu.avr4, + &cpu.avr5, + &cpu.avr51, + &cpu.avr6, + &cpu.avrtiny, + &cpu.avrxmega1, + &cpu.avrxmega2, + &cpu.avrxmega3, + &cpu.avrxmega4, + &cpu.avrxmega5, + &cpu.avrxmega6, + &cpu.avrxmega7, + &cpu.m3000, }; diff --git a/lib/std/target/bpf.zig b/lib/std/target/bpf.zig index 62c69746f8..bb10a84ff8 100644 --- a/lib/std/target/bpf.zig +++ b/lib/std/target/bpf.zig @@ -1,75 +1,77 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; -pub const feature_alu32 = Feature{ - .name = "alu32", - .llvm_name = "alu32", - .description = "Enable ALU32 instructions", - .dependencies = &[_]*const Feature { - }, +pub const Feature = enum { + alu32, + dummy, + dwarfris, }; -pub const feature_dummy = Feature{ - .name = "dummy", - .llvm_name = "dummy", - .description = "unused feature", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dwarfris = Feature{ - .name = "dwarfris", - .llvm_name = "dwarfris", - .description = "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_alu32, - &feature_dummy, - &feature_dwarfris, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_probe = Cpu{ - .name = "probe", - .llvm_name = "probe", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_v1 = Cpu{ - .name = "v1", - .llvm_name = "v1", - .dependencies = &[_]*const Feature { - }, -}; +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); -pub const cpu_v2 = Cpu{ - .name = "v2", - .llvm_name = "v2", - .dependencies = &[_]*const Feature { - }, +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.alu32)] = .{ + .index = @enumToInt(Feature.alu32), + .name = @tagName(Feature.alu32), + .llvm_name = "alu32", + .description = "Enable ALU32 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.dummy)] = .{ + .index = @enumToInt(Feature.dummy), + .name = @tagName(Feature.dummy), + .llvm_name = "dummy", + .description = "unused feature", + .dependencies = 0, + }; + result[@enumToInt(Feature.dwarfris)] = .{ + .index = @enumToInt(Feature.dwarfris), + .name = @tagName(Feature.dwarfris), + .llvm_name = "dwarfris", + .description = "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections", + .dependencies = 0, + }; + break :blk result; }; -pub const cpu_v3 = Cpu{ - .name = "v3", - .llvm_name = "v3", - .dependencies = &[_]*const Feature { - }, +pub const cpu = struct { + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const probe = Cpu{ + .name = "probe", + .llvm_name = "probe", + .features = 0, + }; + pub const v1 = Cpu{ + .name = "v1", + .llvm_name = "v1", + .features = 0, + }; + pub const v2 = Cpu{ + .name = "v2", + .llvm_name = "v2", + .features = 0, + }; + pub const v3 = Cpu{ + .name = "v3", + .llvm_name = "v3", + .features = 0, + }; }; -pub const cpus = &[_]*const Cpu { - &cpu_generic, - &cpu_probe, - &cpu_v1, - &cpu_v2, - &cpu_v3, +/// All bpf CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.generic, + &cpu.probe, + &cpu.v1, + &cpu.v2, + &cpu.v3, }; diff --git a/lib/std/target/hexagon.zig b/lib/std/target/hexagon.zig index 54f59d651a..441abb9cbd 100644 --- a/lib/std/target/hexagon.zig +++ b/lib/std/target/hexagon.zig @@ -1,200 +1,355 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; -pub const feature_duplex = Feature{ - .name = "duplex", - .llvm_name = "duplex", - .description = "Enable generation of duplex instruction", - .dependencies = &[_]*const Feature { - }, +pub const Feature = enum { + duplex, + hvx, + hvx_length128b, + hvx_length64b, + hvxv60, + hvxv62, + hvxv65, + hvxv66, + long_calls, + mem_noshuf, + memops, + noreturn_stack_elim, + nvj, + nvs, + packets, + reserved_r19, + small_data, + v5, + v55, + v60, + v62, + v65, + v66, + zreg, }; -pub const feature_longCalls = Feature{ - .name = "longCalls", - .llvm_name = "long-calls", - .description = "Use constant-extended calls", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mem_noshuf = Feature{ - .name = "mem_noshuf", - .llvm_name = "mem_noshuf", - .description = "Supports mem_noshuf feature", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_memops = Feature{ - .name = "memops", - .llvm_name = "memops", - .description = "Use memop instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nvj = Feature{ - .name = "nvj", - .llvm_name = "nvj", - .description = "Support for new-value jumps", - .dependencies = &[_]*const Feature { - &feature_packets, - }, -}; - -pub const feature_nvs = Feature{ - .name = "nvs", - .llvm_name = "nvs", - .description = "Support for new-value stores", - .dependencies = &[_]*const Feature { - &feature_packets, - }, -}; - -pub const feature_noreturnStackElim = Feature{ - .name = "noreturnStackElim", - .llvm_name = "noreturn-stack-elim", - .description = "Eliminate stack allocation in a noreturn function when possible", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_packets = Feature{ - .name = "packets", - .llvm_name = "packets", - .description = "Support for instruction packets", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_reservedR19 = Feature{ - .name = "reservedR19", - .llvm_name = "reserved-r19", - .description = "Reserve register R19", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_smallData = Feature{ - .name = "smallData", - .llvm_name = "small-data", - .description = "Allow GP-relative addressing of global variables", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_duplex, - &feature_longCalls, - &feature_mem_noshuf, - &feature_memops, - &feature_nvj, - &feature_nvs, - &feature_noreturnStackElim, - &feature_packets, - &feature_reservedR19, - &feature_smallData, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, -}; - -pub const cpu_hexagonv5 = Cpu{ - .name = "hexagonv5", - .llvm_name = "hexagonv5", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, -}; - -pub const cpu_hexagonv55 = Cpu{ - .name = "hexagonv55", - .llvm_name = "hexagonv55", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, -}; - -pub const cpu_hexagonv60 = Cpu{ - .name = "hexagonv60", - .llvm_name = "hexagonv60", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, -}; - -pub const cpu_hexagonv62 = Cpu{ - .name = "hexagonv62", - .llvm_name = "hexagonv62", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, -}; +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); -pub const cpu_hexagonv65 = Cpu{ - .name = "hexagonv65", - .llvm_name = "hexagonv65", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_mem_noshuf, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.duplex)] = .{ + .index = @enumToInt(Feature.duplex), + .name = @tagName(Feature.duplex), + .llvm_name = "duplex", + .description = "Enable generation of duplex instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.hvx)] = .{ + .index = @enumToInt(Feature.hvx), + .name = @tagName(Feature.hvx), + .llvm_name = "hvx", + .description = "Hexagon HVX instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.hvx_length128b)] = .{ + .index = @enumToInt(Feature.hvx_length128b), + .name = @tagName(Feature.hvx_length128b), + .llvm_name = "hvx-length128b", + .description = "Hexagon HVX 128B instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + }), + }; + result[@enumToInt(Feature.hvx_length64b)] = .{ + .index = @enumToInt(Feature.hvx_length64b), + .name = @tagName(Feature.hvx_length64b), + .llvm_name = "hvx-length64b", + .description = "Hexagon HVX 64B instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + }), + }; + result[@enumToInt(Feature.hvxv60)] = .{ + .index = @enumToInt(Feature.hvxv60), + .name = @tagName(Feature.hvxv60), + .llvm_name = "hvxv60", + .description = "Hexagon HVX instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + }), + }; + result[@enumToInt(Feature.hvxv62)] = .{ + .index = @enumToInt(Feature.hvxv62), + .name = @tagName(Feature.hvxv62), + .llvm_name = "hvxv62", + .description = "Hexagon HVX instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + .hvxv60, + }), + }; + result[@enumToInt(Feature.hvxv65)] = .{ + .index = @enumToInt(Feature.hvxv65), + .name = @tagName(Feature.hvxv65), + .llvm_name = "hvxv65", + .description = "Hexagon HVX instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + .hvxv60, + .hvxv62, + }), + }; + result[@enumToInt(Feature.hvxv66)] = .{ + .index = @enumToInt(Feature.hvxv66), + .name = @tagName(Feature.hvxv66), + .llvm_name = "hvxv66", + .description = "Hexagon HVX instructions", + .dependencies = featureSet(&[_]Feature{ + .hvx, + .hvxv60, + .hvxv62, + .hvxv65, + .zreg, + }), + }; + result[@enumToInt(Feature.long_calls)] = .{ + .index = @enumToInt(Feature.long_calls), + .name = @tagName(Feature.long_calls), + .llvm_name = "long-calls", + .description = "Use constant-extended calls", + .dependencies = 0, + }; + result[@enumToInt(Feature.mem_noshuf)] = .{ + .index = @enumToInt(Feature.mem_noshuf), + .name = @tagName(Feature.mem_noshuf), + .llvm_name = "mem_noshuf", + .description = "Supports mem_noshuf feature", + .dependencies = 0, + }; + result[@enumToInt(Feature.memops)] = .{ + .index = @enumToInt(Feature.memops), + .name = @tagName(Feature.memops), + .llvm_name = "memops", + .description = "Use memop instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.noreturn_stack_elim)] = .{ + .index = @enumToInt(Feature.noreturn_stack_elim), + .name = @tagName(Feature.noreturn_stack_elim), + .llvm_name = "noreturn-stack-elim", + .description = "Eliminate stack allocation in a noreturn function when possible", + .dependencies = 0, + }; + result[@enumToInt(Feature.nvj)] = .{ + .index = @enumToInt(Feature.nvj), + .name = @tagName(Feature.nvj), + .llvm_name = "nvj", + .description = "Support for new-value jumps", + .dependencies = featureSet(&[_]Feature{ + .packets, + }), + }; + result[@enumToInt(Feature.nvs)] = .{ + .index = @enumToInt(Feature.nvs), + .name = @tagName(Feature.nvs), + .llvm_name = "nvs", + .description = "Support for new-value stores", + .dependencies = featureSet(&[_]Feature{ + .packets, + }), + }; + result[@enumToInt(Feature.packets)] = .{ + .index = @enumToInt(Feature.packets), + .name = @tagName(Feature.packets), + .llvm_name = "packets", + .description = "Support for instruction packets", + .dependencies = 0, + }; + result[@enumToInt(Feature.reserved_r19)] = .{ + .index = @enumToInt(Feature.reserved_r19), + .name = @tagName(Feature.reserved_r19), + .llvm_name = "reserved-r19", + .description = "Reserve register R19", + .dependencies = 0, + }; + result[@enumToInt(Feature.small_data)] = .{ + .index = @enumToInt(Feature.small_data), + .name = @tagName(Feature.small_data), + .llvm_name = "small-data", + .description = "Allow GP-relative addressing of global variables", + .dependencies = 0, + }; + result[@enumToInt(Feature.v5)] = .{ + .index = @enumToInt(Feature.v5), + .name = @tagName(Feature.v5), + .llvm_name = "v5", + .description = "Enable Hexagon V5 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.v55)] = .{ + .index = @enumToInt(Feature.v55), + .name = @tagName(Feature.v55), + .llvm_name = "v55", + .description = "Enable Hexagon V55 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.v60)] = .{ + .index = @enumToInt(Feature.v60), + .name = @tagName(Feature.v60), + .llvm_name = "v60", + .description = "Enable Hexagon V60 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.v62)] = .{ + .index = @enumToInt(Feature.v62), + .name = @tagName(Feature.v62), + .llvm_name = "v62", + .description = "Enable Hexagon V62 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.v65)] = .{ + .index = @enumToInt(Feature.v65), + .name = @tagName(Feature.v65), + .llvm_name = "v65", + .description = "Enable Hexagon V65 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.v66)] = .{ + .index = @enumToInt(Feature.v66), + .name = @tagName(Feature.v66), + .llvm_name = "v66", + .description = "Enable Hexagon V66 architecture", + .dependencies = 0, + }; + result[@enumToInt(Feature.zreg)] = .{ + .index = @enumToInt(Feature.zreg), + .name = @tagName(Feature.zreg), + .llvm_name = "zreg", + .description = "Hexagon ZReg extension instructions", + .dependencies = 0, + }; + break :blk result; }; -pub const cpu_hexagonv66 = Cpu{ - .name = "hexagonv66", - .llvm_name = "hexagonv66", - .dependencies = &[_]*const Feature { - &feature_duplex, - &feature_mem_noshuf, - &feature_memops, - &feature_packets, - &feature_nvj, - &feature_nvs, - &feature_smallData, - }, +pub const cpu = struct { + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = featureSet(&[_]Feature{ + .duplex, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + .v60, + }), + }; + pub const hexagonv5 = Cpu{ + .name = "hexagonv5", + .llvm_name = "hexagonv5", + .features = featureSet(&[_]Feature{ + .duplex, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + }), + }; + pub const hexagonv55 = Cpu{ + .name = "hexagonv55", + .llvm_name = "hexagonv55", + .features = featureSet(&[_]Feature{ + .duplex, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + }), + }; + pub const hexagonv60 = Cpu{ + .name = "hexagonv60", + .llvm_name = "hexagonv60", + .features = featureSet(&[_]Feature{ + .duplex, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + .v60, + }), + }; + pub const hexagonv62 = Cpu{ + .name = "hexagonv62", + .llvm_name = "hexagonv62", + .features = featureSet(&[_]Feature{ + .duplex, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + .v60, + .v62, + }), + }; + pub const hexagonv65 = Cpu{ + .name = "hexagonv65", + .llvm_name = "hexagonv65", + .features = featureSet(&[_]Feature{ + .duplex, + .mem_noshuf, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + .v60, + .v62, + .v65, + }), + }; + pub const hexagonv66 = Cpu{ + .name = "hexagonv66", + .llvm_name = "hexagonv66", + .features = featureSet(&[_]Feature{ + .duplex, + .mem_noshuf, + .memops, + .nvj, + .nvs, + .packets, + .small_data, + .v5, + .v55, + .v60, + .v62, + .v65, + .v66, + }), + }; }; -pub const cpus = &[_]*const Cpu { - &cpu_generic, - &cpu_hexagonv5, - &cpu_hexagonv55, - &cpu_hexagonv60, - &cpu_hexagonv62, - &cpu_hexagonv65, - &cpu_hexagonv66, +/// All hexagon CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.generic, + &cpu.hexagonv5, + &cpu.hexagonv55, + &cpu.hexagonv60, + &cpu.hexagonv62, + &cpu.hexagonv65, + &cpu.hexagonv66, }; diff --git a/lib/std/target/mips.zig b/lib/std/target/mips.zig index 7c7bb3bfbe..d4f9df4fbb 100644 --- a/lib/std/target/mips.zig +++ b/lib/std/target/mips.zig @@ -1,819 +1,611 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_abs2008 = Feature{ - .name = "abs2008", - .llvm_name = "abs2008", - .description = "Disable IEEE 754-2008 abs.fmt mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_crc = Feature{ - .name = "crc", - .llvm_name = "crc", - .description = "Mips R6 CRC ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_cnmips = Feature{ - .name = "cnmips", - .llvm_name = "cnmips", - .description = "Octeon cnMIPS Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_dsp = Feature{ - .name = "dsp", - .llvm_name = "dsp", - .description = "Mips DSP ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dspr2 = Feature{ - .name = "dspr2", - .llvm_name = "dspr2", - .description = "Mips DSP-R2 ASE", - .dependencies = &[_]*const Feature { - &feature_dsp, - }, -}; - -pub const feature_dspr3 = Feature{ - .name = "dspr3", - .llvm_name = "dspr3", - .description = "Mips DSP-R3 ASE", - .dependencies = &[_]*const Feature { - &feature_dsp, - }, -}; - -pub const feature_eva = Feature{ - .name = "eva", - .llvm_name = "eva", - .description = "Mips EVA ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fp64 = Feature{ - .name = "fp64", - .llvm_name = "fp64", - .description = "Support 64-bit FP registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fpxx = Feature{ - .name = "fpxx", - .llvm_name = "fpxx", - .description = "Support for FPXX", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ginv = Feature{ - .name = "ginv", - .llvm_name = "ginv", - .description = "Mips Global Invalidate ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_gp64 = Feature{ - .name = "gp64", - .llvm_name = "gp64", - .description = "General Purpose Registers are 64-bit wide", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_longCalls = Feature{ - .name = "longCalls", - .llvm_name = "long-calls", - .description = "Disable use of the jal instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_msa = Feature{ - .name = "msa", - .llvm_name = "msa", - .description = "Mips MSA ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mt = Feature{ - .name = "mt", - .llvm_name = "mt", - .description = "Mips MT ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nomadd4 = Feature{ - .name = "nomadd4", - .llvm_name = "nomadd4", - .description = "Disable 4-operand madd.fmt and related instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_micromips = Feature{ - .name = "micromips", - .llvm_name = "micromips", - .description = "microMips mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips1 = Feature{ - .name = "mips1", - .llvm_name = "mips1", - .description = "Mips I ISA Support [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips2 = Feature{ - .name = "mips2", - .llvm_name = "mips2", - .description = "Mips II ISA Support [highly experimental]", - .dependencies = &[_]*const Feature { - &feature_mips1, - }, -}; - -pub const feature_mips3 = Feature{ - .name = "mips3", - .llvm_name = "mips3", - .description = "MIPS III ISA Support [highly experimental]", - .dependencies = &[_]*const Feature { - &feature_mips3_32r2, - &feature_mips3_32, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips3_32 = Feature{ - .name = "mips3_32", - .llvm_name = "mips3_32", - .description = "Subset of MIPS-III that is also in MIPS32 [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips3_32r2 = Feature{ - .name = "mips3_32r2", - .llvm_name = "mips3_32r2", - .description = "Subset of MIPS-III that is also in MIPS32r2 [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips4 = Feature{ - .name = "mips4", - .llvm_name = "mips4", - .description = "MIPS IV ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips4_32 = Feature{ - .name = "mips4_32", - .llvm_name = "mips4_32", - .description = "Subset of MIPS-IV that is also in MIPS32 [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips4_32r2 = Feature{ - .name = "mips4_32r2", - .llvm_name = "mips4_32r2", - .description = "Subset of MIPS-IV that is also in MIPS32r2 [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips5 = Feature{ - .name = "mips5", - .llvm_name = "mips5", - .description = "MIPS V ISA Support [highly experimental]", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips5_32r2 = Feature{ - .name = "mips5_32r2", - .llvm_name = "mips5_32r2", - .description = "Subset of MIPS-V that is also in MIPS32r2 [highly experimental]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips16 = Feature{ - .name = "mips16", - .llvm_name = "mips16", - .description = "Mips16 mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mips32 = Feature{ - .name = "mips32", - .llvm_name = "mips32", - .description = "Mips32 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips3_32, - &feature_mips4_32, - &feature_mips1, - }, -}; - -pub const feature_mips32r2 = Feature{ - .name = "mips32r2", - .llvm_name = "mips32r2", - .description = "Mips32r2 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - }, -}; - -pub const feature_mips32r3 = Feature{ - .name = "mips32r3", - .llvm_name = "mips32r3", - .description = "Mips32r3 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - }, -}; - -pub const feature_mips32r5 = Feature{ - .name = "mips32r5", - .llvm_name = "mips32r5", - .description = "Mips32r5 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - }, -}; - -pub const feature_mips32r6 = Feature{ - .name = "mips32r6", - .llvm_name = "mips32r6", - .description = "Mips32r6 ISA Support [experimental]", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_nan2008, - &feature_mips1, - &feature_fp64, - &feature_abs2008, - }, -}; - -pub const feature_mips64 = Feature{ - .name = "mips64", - .llvm_name = "mips64", - .description = "Mips64 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips64r2 = Feature{ - .name = "mips64r2", - .llvm_name = "mips64r2", - .description = "Mips64r2 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips64r3 = Feature{ - .name = "mips64r3", - .llvm_name = "mips64r3", - .description = "Mips64r3 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips64r5 = Feature{ - .name = "mips64r5", - .llvm_name = "mips64r5", - .description = "Mips64r5 ISA Support", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - }, -}; - -pub const feature_mips64r6 = Feature{ - .name = "mips64r6", - .llvm_name = "mips64r6", - .description = "Mips64r6 ISA Support [experimental]", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_nan2008, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_abs2008, - }, -}; - -pub const feature_nan2008 = Feature{ - .name = "nan2008", - .llvm_name = "nan2008", - .description = "IEEE 754-2008 NaN encoding", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noabicalls = Feature{ - .name = "noabicalls", - .llvm_name = "noabicalls", - .description = "Disable SVR4-style position-independent code", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nooddspreg = Feature{ - .name = "nooddspreg", - .llvm_name = "nooddspreg", - .description = "Disable odd numbered single-precision registers", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptr64 = Feature{ - .name = "ptr64", - .llvm_name = "ptr64", - .description = "Pointers are 64-bit wide", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_singleFloat = Feature{ - .name = "singleFloat", - .llvm_name = "single-float", - .description = "Only supports single precision float", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_softFloat = Feature{ - .name = "softFloat", - .llvm_name = "soft-float", - .description = "Does not support floating point instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sym32 = Feature{ - .name = "sym32", - .llvm_name = "sym32", - .description = "Symbols are 32 bit on Mips64", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useIndirectJumpHazard = Feature{ - .name = "useIndirectJumpHazard", - .llvm_name = "use-indirect-jump-hazard", - .description = "Use indirect jump guards to prevent certain speculation based attacks", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_useTccInDiv = Feature{ - .name = "useTccInDiv", - .llvm_name = "use-tcc-in-div", - .description = "Force the assembler to use trapping", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vfpu = Feature{ - .name = "vfpu", - .llvm_name = "vfpu", - .description = "Enable vector FPU instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_virt = Feature{ - .name = "virt", - .llvm_name = "virt", - .description = "Mips Virtualization ASE", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_p5600 = Feature{ - .name = "p5600", - .llvm_name = "p5600", - .description = "The P5600 Processor", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - }, -}; - -pub const features = &[_]*const Feature { - &feature_abs2008, - &feature_crc, - &feature_cnmips, - &feature_dsp, - &feature_dspr2, - &feature_dspr3, - &feature_eva, - &feature_fp64, - &feature_fpxx, - &feature_ginv, - &feature_gp64, - &feature_longCalls, - &feature_msa, - &feature_mt, - &feature_nomadd4, - &feature_micromips, - &feature_mips1, - &feature_mips2, - &feature_mips3, - &feature_mips3_32, - &feature_mips3_32r2, - &feature_mips4, - &feature_mips4_32, - &feature_mips4_32r2, - &feature_mips5, - &feature_mips5_32r2, - &feature_mips16, - &feature_mips32, - &feature_mips32r2, - &feature_mips32r3, - &feature_mips32r5, - &feature_mips32r6, - &feature_mips64, - &feature_mips64r2, - &feature_mips64r3, - &feature_mips64r5, - &feature_mips64r6, - &feature_nan2008, - &feature_noabicalls, - &feature_nooddspreg, - &feature_ptr64, - &feature_singleFloat, - &feature_softFloat, - &feature_sym32, - &feature_useIndirectJumpHazard, - &feature_useTccInDiv, - &feature_vfpu, - &feature_virt, - &feature_p5600, -}; - -pub const cpu_mips1 = Cpu{ - .name = "mips1", - .llvm_name = "mips1", - .dependencies = &[_]*const Feature { - &feature_mips1, - }, -}; - -pub const cpu_mips2 = Cpu{ - .name = "mips2", - .llvm_name = "mips2", - .dependencies = &[_]*const Feature { - &feature_mips1, - &feature_mips2, - }, -}; - -pub const cpu_mips3 = Cpu{ - .name = "mips3", - .llvm_name = "mips3", - .dependencies = &[_]*const Feature { - &feature_mips3_32r2, - &feature_mips3_32, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips3, - }, -}; - -pub const cpu_mips32 = Cpu{ - .name = "mips32", - .llvm_name = "mips32", - .dependencies = &[_]*const Feature { - &feature_mips3_32, - &feature_mips4_32, - &feature_mips1, - &feature_mips32, - }, -}; - -pub const cpu_mips32r2 = Cpu{ - .name = "mips32r2", - .llvm_name = "mips32r2", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - &feature_mips32r2, - }, -}; - -pub const cpu_mips32r3 = Cpu{ - .name = "mips32r3", - .llvm_name = "mips32r3", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - &feature_mips32r3, - }, -}; - -pub const cpu_mips32r5 = Cpu{ - .name = "mips32r5", - .llvm_name = "mips32r5", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - &feature_mips32r5, - }, -}; - -pub const cpu_mips32r6 = Cpu{ - .name = "mips32r6", - .llvm_name = "mips32r6", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_nan2008, - &feature_mips1, - &feature_fp64, - &feature_abs2008, - &feature_mips32r6, - }, -}; - -pub const cpu_mips4 = Cpu{ - .name = "mips4", - .llvm_name = "mips4", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips4, - }, -}; - -pub const cpu_mips5 = Cpu{ - .name = "mips5", - .llvm_name = "mips5", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips5, - }, -}; - -pub const cpu_mips64 = Cpu{ - .name = "mips64", - .llvm_name = "mips64", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips64, - }, -}; - -pub const cpu_mips64r2 = Cpu{ - .name = "mips64r2", - .llvm_name = "mips64r2", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips64r2, - }, -}; - -pub const cpu_mips64r3 = Cpu{ - .name = "mips64r3", - .llvm_name = "mips64r3", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips64r3, - }, -}; - -pub const cpu_mips64r5 = Cpu{ - .name = "mips64r5", - .llvm_name = "mips64r5", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_mips64r5, - }, -}; - -pub const cpu_mips64r6 = Cpu{ - .name = "mips64r6", - .llvm_name = "mips64r6", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_nan2008, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_abs2008, - &feature_mips64r6, - }, -}; - -pub const cpu_octeon = Cpu{ - .name = "octeon", - .llvm_name = "octeon", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_gp64, - &feature_mips1, - &feature_fp64, - &feature_cnmips, - &feature_mips64r2, - }, -}; - -pub const cpu_p5600 = Cpu{ - .name = "p5600", - .llvm_name = "p5600", - .dependencies = &[_]*const Feature { - &feature_mips4_32, - &feature_mips5_32r2, - &feature_mips3_32r2, - &feature_mips3_32, - &feature_mips4_32r2, - &feature_mips1, - &feature_p5600, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_mips1, - &cpu_mips2, - &cpu_mips3, - &cpu_mips32, - &cpu_mips32r2, - &cpu_mips32r3, - &cpu_mips32r5, - &cpu_mips32r6, - &cpu_mips4, - &cpu_mips5, - &cpu_mips64, - &cpu_mips64r2, - &cpu_mips64r3, - &cpu_mips64r5, - &cpu_mips64r6, - &cpu_octeon, - &cpu_p5600, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + abs2008, + cnmips, + crc, + dsp, + dspr2, + dspr3, + eva, + fp64, + fpxx, + ginv, + gp64, + long_calls, + micromips, + mips1, + mips16, + mips2, + mips3, + mips32, + mips32r2, + mips32r3, + mips32r5, + mips32r6, + mips3_32, + mips3_32r2, + mips4, + mips4_32, + mips4_32r2, + mips5, + mips5_32r2, + mips64, + mips64r2, + mips64r3, + mips64r5, + mips64r6, + msa, + mt, + nan2008, + noabicalls, + nomadd4, + nooddspreg, + p5600, + ptr64, + single_float, + soft_float, + sym32, + use_indirect_jump_hazard, + use_tcc_in_div, + vfpu, + virt, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.abs2008)] = .{ + .index = @enumToInt(Feature.abs2008), + .name = @tagName(Feature.abs2008), + .llvm_name = "abs2008", + .description = "Disable IEEE 754-2008 abs.fmt mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.cnmips)] = .{ + .index = @enumToInt(Feature.cnmips), + .name = @tagName(Feature.cnmips), + .llvm_name = "cnmips", + .description = "Octeon cnMIPS Support", + .dependencies = featureSet(&[_]Feature{ + .mips64r2, + }), + }; + result[@enumToInt(Feature.crc)] = .{ + .index = @enumToInt(Feature.crc), + .name = @tagName(Feature.crc), + .llvm_name = "crc", + .description = "Mips R6 CRC ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.dsp)] = .{ + .index = @enumToInt(Feature.dsp), + .name = @tagName(Feature.dsp), + .llvm_name = "dsp", + .description = "Mips DSP ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.dspr2)] = .{ + .index = @enumToInt(Feature.dspr2), + .name = @tagName(Feature.dspr2), + .llvm_name = "dspr2", + .description = "Mips DSP-R2 ASE", + .dependencies = featureSet(&[_]Feature{ + .dsp, + }), + }; + result[@enumToInt(Feature.dspr3)] = .{ + .index = @enumToInt(Feature.dspr3), + .name = @tagName(Feature.dspr3), + .llvm_name = "dspr3", + .description = "Mips DSP-R3 ASE", + .dependencies = featureSet(&[_]Feature{ + .dsp, + .dspr2, + }), + }; + result[@enumToInt(Feature.eva)] = .{ + .index = @enumToInt(Feature.eva), + .name = @tagName(Feature.eva), + .llvm_name = "eva", + .description = "Mips EVA ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp64)] = .{ + .index = @enumToInt(Feature.fp64), + .name = @tagName(Feature.fp64), + .llvm_name = "fp64", + .description = "Support 64-bit FP registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.fpxx)] = .{ + .index = @enumToInt(Feature.fpxx), + .name = @tagName(Feature.fpxx), + .llvm_name = "fpxx", + .description = "Support for FPXX", + .dependencies = 0, + }; + result[@enumToInt(Feature.ginv)] = .{ + .index = @enumToInt(Feature.ginv), + .name = @tagName(Feature.ginv), + .llvm_name = "ginv", + .description = "Mips Global Invalidate ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.gp64)] = .{ + .index = @enumToInt(Feature.gp64), + .name = @tagName(Feature.gp64), + .llvm_name = "gp64", + .description = "General Purpose Registers are 64-bit wide", + .dependencies = 0, + }; + result[@enumToInt(Feature.long_calls)] = .{ + .index = @enumToInt(Feature.long_calls), + .name = @tagName(Feature.long_calls), + .llvm_name = "long-calls", + .description = "Disable use of the jal instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.micromips)] = .{ + .index = @enumToInt(Feature.micromips), + .name = @tagName(Feature.micromips), + .llvm_name = "micromips", + .description = "microMips mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips1)] = .{ + .index = @enumToInt(Feature.mips1), + .name = @tagName(Feature.mips1), + .llvm_name = "mips1", + .description = "Mips I ISA Support [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips16)] = .{ + .index = @enumToInt(Feature.mips16), + .name = @tagName(Feature.mips16), + .llvm_name = "mips16", + .description = "Mips16 mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips2)] = .{ + .index = @enumToInt(Feature.mips2), + .name = @tagName(Feature.mips2), + .llvm_name = "mips2", + .description = "Mips II ISA Support [highly experimental]", + .dependencies = featureSet(&[_]Feature{ + .mips1, + }), + }; + result[@enumToInt(Feature.mips3)] = .{ + .index = @enumToInt(Feature.mips3), + .name = @tagName(Feature.mips3), + .llvm_name = "mips3", + .description = "MIPS III ISA Support [highly experimental]", + .dependencies = featureSet(&[_]Feature{ + .fp64, + .gp64, + .mips2, + .mips3_32, + .mips3_32r2, + }), + }; + result[@enumToInt(Feature.mips32)] = .{ + .index = @enumToInt(Feature.mips32), + .name = @tagName(Feature.mips32), + .llvm_name = "mips32", + .description = "Mips32 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips2, + .mips3_32, + .mips4_32, + }), + }; + result[@enumToInt(Feature.mips32r2)] = .{ + .index = @enumToInt(Feature.mips32r2), + .name = @tagName(Feature.mips32r2), + .llvm_name = "mips32r2", + .description = "Mips32r2 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32, + .mips3_32r2, + .mips4_32r2, + .mips5_32r2, + }), + }; + result[@enumToInt(Feature.mips32r3)] = .{ + .index = @enumToInt(Feature.mips32r3), + .name = @tagName(Feature.mips32r3), + .llvm_name = "mips32r3", + .description = "Mips32r3 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32r2, + }), + }; + result[@enumToInt(Feature.mips32r5)] = .{ + .index = @enumToInt(Feature.mips32r5), + .name = @tagName(Feature.mips32r5), + .llvm_name = "mips32r5", + .description = "Mips32r5 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32r3, + }), + }; + result[@enumToInt(Feature.mips32r6)] = .{ + .index = @enumToInt(Feature.mips32r6), + .name = @tagName(Feature.mips32r6), + .llvm_name = "mips32r6", + .description = "Mips32r6 ISA Support [experimental]", + .dependencies = featureSet(&[_]Feature{ + .abs2008, + .fp64, + .mips32r5, + .nan2008, + }), + }; + result[@enumToInt(Feature.mips3_32)] = .{ + .index = @enumToInt(Feature.mips3_32), + .name = @tagName(Feature.mips3_32), + .llvm_name = "mips3_32", + .description = "Subset of MIPS-III that is also in MIPS32 [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips3_32r2)] = .{ + .index = @enumToInt(Feature.mips3_32r2), + .name = @tagName(Feature.mips3_32r2), + .llvm_name = "mips3_32r2", + .description = "Subset of MIPS-III that is also in MIPS32r2 [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips4)] = .{ + .index = @enumToInt(Feature.mips4), + .name = @tagName(Feature.mips4), + .llvm_name = "mips4", + .description = "MIPS IV ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips3, + .mips4_32, + .mips4_32r2, + }), + }; + result[@enumToInt(Feature.mips4_32)] = .{ + .index = @enumToInt(Feature.mips4_32), + .name = @tagName(Feature.mips4_32), + .llvm_name = "mips4_32", + .description = "Subset of MIPS-IV that is also in MIPS32 [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips4_32r2)] = .{ + .index = @enumToInt(Feature.mips4_32r2), + .name = @tagName(Feature.mips4_32r2), + .llvm_name = "mips4_32r2", + .description = "Subset of MIPS-IV that is also in MIPS32r2 [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips5)] = .{ + .index = @enumToInt(Feature.mips5), + .name = @tagName(Feature.mips5), + .llvm_name = "mips5", + .description = "MIPS V ISA Support [highly experimental]", + .dependencies = featureSet(&[_]Feature{ + .mips4, + .mips5_32r2, + }), + }; + result[@enumToInt(Feature.mips5_32r2)] = .{ + .index = @enumToInt(Feature.mips5_32r2), + .name = @tagName(Feature.mips5_32r2), + .llvm_name = "mips5_32r2", + .description = "Subset of MIPS-V that is also in MIPS32r2 [highly experimental]", + .dependencies = 0, + }; + result[@enumToInt(Feature.mips64)] = .{ + .index = @enumToInt(Feature.mips64), + .name = @tagName(Feature.mips64), + .llvm_name = "mips64", + .description = "Mips64 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32, + .mips5, + }), + }; + result[@enumToInt(Feature.mips64r2)] = .{ + .index = @enumToInt(Feature.mips64r2), + .name = @tagName(Feature.mips64r2), + .llvm_name = "mips64r2", + .description = "Mips64r2 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32r2, + .mips64, + }), + }; + result[@enumToInt(Feature.mips64r3)] = .{ + .index = @enumToInt(Feature.mips64r3), + .name = @tagName(Feature.mips64r3), + .llvm_name = "mips64r3", + .description = "Mips64r3 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32r3, + .mips64r2, + }), + }; + result[@enumToInt(Feature.mips64r5)] = .{ + .index = @enumToInt(Feature.mips64r5), + .name = @tagName(Feature.mips64r5), + .llvm_name = "mips64r5", + .description = "Mips64r5 ISA Support", + .dependencies = featureSet(&[_]Feature{ + .mips32r5, + .mips64r3, + }), + }; + result[@enumToInt(Feature.mips64r6)] = .{ + .index = @enumToInt(Feature.mips64r6), + .name = @tagName(Feature.mips64r6), + .llvm_name = "mips64r6", + .description = "Mips64r6 ISA Support [experimental]", + .dependencies = featureSet(&[_]Feature{ + .abs2008, + .mips32r6, + .mips64r5, + .nan2008, + }), + }; + result[@enumToInt(Feature.msa)] = .{ + .index = @enumToInt(Feature.msa), + .name = @tagName(Feature.msa), + .llvm_name = "msa", + .description = "Mips MSA ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.mt)] = .{ + .index = @enumToInt(Feature.mt), + .name = @tagName(Feature.mt), + .llvm_name = "mt", + .description = "Mips MT ASE", + .dependencies = 0, + }; + result[@enumToInt(Feature.nan2008)] = .{ + .index = @enumToInt(Feature.nan2008), + .name = @tagName(Feature.nan2008), + .llvm_name = "nan2008", + .description = "IEEE 754-2008 NaN encoding", + .dependencies = 0, + }; + result[@enumToInt(Feature.noabicalls)] = .{ + .index = @enumToInt(Feature.noabicalls), + .name = @tagName(Feature.noabicalls), + .llvm_name = "noabicalls", + .description = "Disable SVR4-style position-independent code", + .dependencies = 0, + }; + result[@enumToInt(Feature.nomadd4)] = .{ + .index = @enumToInt(Feature.nomadd4), + .name = @tagName(Feature.nomadd4), + .llvm_name = "nomadd4", + .description = "Disable 4-operand madd.fmt and related instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.nooddspreg)] = .{ + .index = @enumToInt(Feature.nooddspreg), + .name = @tagName(Feature.nooddspreg), + .llvm_name = "nooddspreg", + .description = "Disable odd numbered single-precision registers", + .dependencies = 0, + }; + result[@enumToInt(Feature.p5600)] = .{ + .index = @enumToInt(Feature.p5600), + .name = @tagName(Feature.p5600), + .llvm_name = "p5600", + .description = "The P5600 Processor", + .dependencies = featureSet(&[_]Feature{ + .mips32r5, + }), + }; + result[@enumToInt(Feature.ptr64)] = .{ + .index = @enumToInt(Feature.ptr64), + .name = @tagName(Feature.ptr64), + .llvm_name = "ptr64", + .description = "Pointers are 64-bit wide", + .dependencies = 0, + }; + result[@enumToInt(Feature.single_float)] = .{ + .index = @enumToInt(Feature.single_float), + .name = @tagName(Feature.single_float), + .llvm_name = "single-float", + .description = "Only supports single precision float", + .dependencies = 0, + }; + result[@enumToInt(Feature.soft_float)] = .{ + .index = @enumToInt(Feature.soft_float), + .name = @tagName(Feature.soft_float), + .llvm_name = "soft-float", + .description = "Does not support floating point instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.sym32)] = .{ + .index = @enumToInt(Feature.sym32), + .name = @tagName(Feature.sym32), + .llvm_name = "sym32", + .description = "Symbols are 32 bit on Mips64", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_indirect_jump_hazard)] = .{ + .index = @enumToInt(Feature.use_indirect_jump_hazard), + .name = @tagName(Feature.use_indirect_jump_hazard), + .llvm_name = "use-indirect-jump-hazard", + .description = "Use indirect jump guards to prevent certain speculation based attacks", + .dependencies = 0, + }; + result[@enumToInt(Feature.use_tcc_in_div)] = .{ + .index = @enumToInt(Feature.use_tcc_in_div), + .name = @tagName(Feature.use_tcc_in_div), + .llvm_name = "use-tcc-in-div", + .description = "Force the assembler to use trapping", + .dependencies = 0, + }; + result[@enumToInt(Feature.vfpu)] = .{ + .index = @enumToInt(Feature.vfpu), + .name = @tagName(Feature.vfpu), + .llvm_name = "vfpu", + .description = "Enable vector FPU instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.virt)] = .{ + .index = @enumToInt(Feature.virt), + .name = @tagName(Feature.virt), + .llvm_name = "virt", + .description = "Mips Virtualization ASE", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const mips1 = Cpu{ + .name = "mips1", + .llvm_name = "mips1", + .features = featureSet(&[_]Feature{ + .mips1, + }), + }; + pub const mips2 = Cpu{ + .name = "mips2", + .llvm_name = "mips2", + .features = featureSet(&[_]Feature{ + .mips2, + }), + }; + pub const mips3 = Cpu{ + .name = "mips3", + .llvm_name = "mips3", + .features = featureSet(&[_]Feature{ + .mips3, + }), + }; + pub const mips32 = Cpu{ + .name = "mips32", + .llvm_name = "mips32", + .features = featureSet(&[_]Feature{ + .mips32, + }), + }; + pub const mips32r2 = Cpu{ + .name = "mips32r2", + .llvm_name = "mips32r2", + .features = featureSet(&[_]Feature{ + .mips32r2, + }), + }; + pub const mips32r3 = Cpu{ + .name = "mips32r3", + .llvm_name = "mips32r3", + .features = featureSet(&[_]Feature{ + .mips32r3, + }), + }; + pub const mips32r5 = Cpu{ + .name = "mips32r5", + .llvm_name = "mips32r5", + .features = featureSet(&[_]Feature{ + .mips32r5, + }), + }; + pub const mips32r6 = Cpu{ + .name = "mips32r6", + .llvm_name = "mips32r6", + .features = featureSet(&[_]Feature{ + .mips32r6, + }), + }; + pub const mips4 = Cpu{ + .name = "mips4", + .llvm_name = "mips4", + .features = featureSet(&[_]Feature{ + .mips4, + }), + }; + pub const mips5 = Cpu{ + .name = "mips5", + .llvm_name = "mips5", + .features = featureSet(&[_]Feature{ + .mips5, + }), + }; + pub const mips64 = Cpu{ + .name = "mips64", + .llvm_name = "mips64", + .features = featureSet(&[_]Feature{ + .mips64, + }), + }; + pub const mips64r2 = Cpu{ + .name = "mips64r2", + .llvm_name = "mips64r2", + .features = featureSet(&[_]Feature{ + .mips64r2, + }), + }; + pub const mips64r3 = Cpu{ + .name = "mips64r3", + .llvm_name = "mips64r3", + .features = featureSet(&[_]Feature{ + .mips64r3, + }), + }; + pub const mips64r5 = Cpu{ + .name = "mips64r5", + .llvm_name = "mips64r5", + .features = featureSet(&[_]Feature{ + .mips64r5, + }), + }; + pub const mips64r6 = Cpu{ + .name = "mips64r6", + .llvm_name = "mips64r6", + .features = featureSet(&[_]Feature{ + .mips64r6, + }), + }; + pub const octeon = Cpu{ + .name = "octeon", + .llvm_name = "octeon", + .features = featureSet(&[_]Feature{ + .cnmips, + .mips64r2, + }), + }; + pub const p5600 = Cpu{ + .name = "p5600", + .llvm_name = "p5600", + .features = featureSet(&[_]Feature{ + .p5600, + }), + }; +}; + +/// All mips CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.mips1, + &cpu.mips2, + &cpu.mips3, + &cpu.mips32, + &cpu.mips32r2, + &cpu.mips32r3, + &cpu.mips32r5, + &cpu.mips32r6, + &cpu.mips4, + &cpu.mips5, + &cpu.mips64, + &cpu.mips64r2, + &cpu.mips64r3, + &cpu.mips64r5, + &cpu.mips64r6, + &cpu.octeon, + &cpu.p5600, }; diff --git a/lib/std/target/msp430.zig b/lib/std/target/msp430.zig index 75e641f0dc..21d6a8211d 100644 --- a/lib/std/target/msp430.zig +++ b/lib/std/target/msp430.zig @@ -1,69 +1,75 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; -pub const feature_hwmult16 = Feature{ - .name = "hwmult16", - .llvm_name = "hwmult16", - .description = "Enable 16-bit hardware multiplier", - .dependencies = &[_]*const Feature { - }, +pub const Feature = enum { + ext, + hwmult16, + hwmult32, + hwmultf5, }; -pub const feature_hwmult32 = Feature{ - .name = "hwmult32", - .llvm_name = "hwmult32", - .description = "Enable 32-bit hardware multiplier", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_hwmultf5 = Feature{ - .name = "hwmultf5", - .llvm_name = "hwmultf5", - .description = "Enable F5 series hardware multiplier", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ext = Feature{ - .name = "ext", - .llvm_name = "ext", - .description = "Enable MSP430-X extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_hwmult16, - &feature_hwmult32, - &feature_hwmultf5, - &feature_ext, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, -}; +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); -pub const cpu_msp430 = Cpu{ - .name = "msp430", - .llvm_name = "msp430", - .dependencies = &[_]*const Feature { - }, +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.ext)] = .{ + .index = @enumToInt(Feature.ext), + .name = @tagName(Feature.ext), + .llvm_name = "ext", + .description = "Enable MSP430-X extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.hwmult16)] = .{ + .index = @enumToInt(Feature.hwmult16), + .name = @tagName(Feature.hwmult16), + .llvm_name = "hwmult16", + .description = "Enable 16-bit hardware multiplier", + .dependencies = 0, + }; + result[@enumToInt(Feature.hwmult32)] = .{ + .index = @enumToInt(Feature.hwmult32), + .name = @tagName(Feature.hwmult32), + .llvm_name = "hwmult32", + .description = "Enable 32-bit hardware multiplier", + .dependencies = 0, + }; + result[@enumToInt(Feature.hwmultf5)] = .{ + .index = @enumToInt(Feature.hwmultf5), + .name = @tagName(Feature.hwmultf5), + .llvm_name = "hwmultf5", + .description = "Enable F5 series hardware multiplier", + .dependencies = 0, + }; + break :blk result; }; -pub const cpu_msp430x = Cpu{ - .name = "msp430x", - .llvm_name = "msp430x", - .dependencies = &[_]*const Feature { - &feature_ext, - }, +pub const cpu = struct { + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const msp430 = Cpu{ + .name = "msp430", + .llvm_name = "msp430", + .features = 0, + }; + pub const msp430x = Cpu{ + .name = "msp430x", + .llvm_name = "msp430x", + .features = featureSet(&[_]Feature{ + .ext, + }), + }; }; -pub const cpus = &[_]*const Cpu { - &cpu_generic, - &cpu_msp430, - &cpu_msp430x, +/// All msp430 CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.generic, + &cpu.msp430, + &cpu.msp430x, }; diff --git a/lib/std/target/nvptx.zig b/lib/std/target/nvptx.zig index cddd800f30..d277785aff 100644 --- a/lib/std/target/nvptx.zig +++ b/lib/std/target/nvptx.zig @@ -1,379 +1,354 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_ptx32 = Feature{ - .name = "ptx32", - .llvm_name = "ptx32", - .description = "Use PTX version 3.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx40 = Feature{ - .name = "ptx40", - .llvm_name = "ptx40", - .description = "Use PTX version 4.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx41 = Feature{ - .name = "ptx41", - .llvm_name = "ptx41", - .description = "Use PTX version 4.1", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx42 = Feature{ - .name = "ptx42", - .llvm_name = "ptx42", - .description = "Use PTX version 4.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx43 = Feature{ - .name = "ptx43", - .llvm_name = "ptx43", - .description = "Use PTX version 4.3", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx50 = Feature{ - .name = "ptx50", - .llvm_name = "ptx50", - .description = "Use PTX version 5.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx60 = Feature{ - .name = "ptx60", - .llvm_name = "ptx60", - .description = "Use PTX version 6.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx61 = Feature{ - .name = "ptx61", - .llvm_name = "ptx61", - .description = "Use PTX version 6.1", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx63 = Feature{ - .name = "ptx63", - .llvm_name = "ptx63", - .description = "Use PTX version 6.3", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ptx64 = Feature{ - .name = "ptx64", - .llvm_name = "ptx64", - .description = "Use PTX version 6.4", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_20 = Feature{ - .name = "sm_20", - .llvm_name = "sm_20", - .description = "Target SM 2.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_21 = Feature{ - .name = "sm_21", - .llvm_name = "sm_21", - .description = "Target SM 2.1", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_30 = Feature{ - .name = "sm_30", - .llvm_name = "sm_30", - .description = "Target SM 3.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_32 = Feature{ - .name = "sm_32", - .llvm_name = "sm_32", - .description = "Target SM 3.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_35 = Feature{ - .name = "sm_35", - .llvm_name = "sm_35", - .description = "Target SM 3.5", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_37 = Feature{ - .name = "sm_37", - .llvm_name = "sm_37", - .description = "Target SM 3.7", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_50 = Feature{ - .name = "sm_50", - .llvm_name = "sm_50", - .description = "Target SM 5.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_52 = Feature{ - .name = "sm_52", - .llvm_name = "sm_52", - .description = "Target SM 5.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_53 = Feature{ - .name = "sm_53", - .llvm_name = "sm_53", - .description = "Target SM 5.3", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_60 = Feature{ - .name = "sm_60", - .llvm_name = "sm_60", - .description = "Target SM 6.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_61 = Feature{ - .name = "sm_61", - .llvm_name = "sm_61", - .description = "Target SM 6.1", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_62 = Feature{ - .name = "sm_62", - .llvm_name = "sm_62", - .description = "Target SM 6.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_70 = Feature{ - .name = "sm_70", - .llvm_name = "sm_70", - .description = "Target SM 7.0", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_72 = Feature{ - .name = "sm_72", - .llvm_name = "sm_72", - .description = "Target SM 7.2", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_sm_75 = Feature{ - .name = "sm_75", - .llvm_name = "sm_75", - .description = "Target SM 7.5", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_ptx32, - &feature_ptx40, - &feature_ptx41, - &feature_ptx42, - &feature_ptx43, - &feature_ptx50, - &feature_ptx60, - &feature_ptx61, - &feature_ptx63, - &feature_ptx64, - &feature_sm_20, - &feature_sm_21, - &feature_sm_30, - &feature_sm_32, - &feature_sm_35, - &feature_sm_37, - &feature_sm_50, - &feature_sm_52, - &feature_sm_53, - &feature_sm_60, - &feature_sm_61, - &feature_sm_62, - &feature_sm_70, - &feature_sm_72, - &feature_sm_75, -}; - -pub const cpu_sm_20 = Cpu{ - .name = "sm_20", - .llvm_name = "sm_20", - .dependencies = &[_]*const Feature { - &feature_sm_20, - }, -}; - -pub const cpu_sm_21 = Cpu{ - .name = "sm_21", - .llvm_name = "sm_21", - .dependencies = &[_]*const Feature { - &feature_sm_21, - }, -}; - -pub const cpu_sm_30 = Cpu{ - .name = "sm_30", - .llvm_name = "sm_30", - .dependencies = &[_]*const Feature { - &feature_sm_30, - }, -}; - -pub const cpu_sm_32 = Cpu{ - .name = "sm_32", - .llvm_name = "sm_32", - .dependencies = &[_]*const Feature { - &feature_ptx40, - &feature_sm_32, - }, -}; - -pub const cpu_sm_35 = Cpu{ - .name = "sm_35", - .llvm_name = "sm_35", - .dependencies = &[_]*const Feature { - &feature_sm_35, - }, -}; - -pub const cpu_sm_37 = Cpu{ - .name = "sm_37", - .llvm_name = "sm_37", - .dependencies = &[_]*const Feature { - &feature_ptx41, - &feature_sm_37, - }, -}; - -pub const cpu_sm_50 = Cpu{ - .name = "sm_50", - .llvm_name = "sm_50", - .dependencies = &[_]*const Feature { - &feature_ptx40, - &feature_sm_50, - }, -}; - -pub const cpu_sm_52 = Cpu{ - .name = "sm_52", - .llvm_name = "sm_52", - .dependencies = &[_]*const Feature { - &feature_ptx41, - &feature_sm_52, - }, -}; - -pub const cpu_sm_53 = Cpu{ - .name = "sm_53", - .llvm_name = "sm_53", - .dependencies = &[_]*const Feature { - &feature_ptx42, - &feature_sm_53, - }, -}; - -pub const cpu_sm_60 = Cpu{ - .name = "sm_60", - .llvm_name = "sm_60", - .dependencies = &[_]*const Feature { - &feature_ptx50, - &feature_sm_60, - }, -}; - -pub const cpu_sm_61 = Cpu{ - .name = "sm_61", - .llvm_name = "sm_61", - .dependencies = &[_]*const Feature { - &feature_ptx50, - &feature_sm_61, - }, -}; - -pub const cpu_sm_62 = Cpu{ - .name = "sm_62", - .llvm_name = "sm_62", - .dependencies = &[_]*const Feature { - &feature_ptx50, - &feature_sm_62, - }, -}; - -pub const cpu_sm_70 = Cpu{ - .name = "sm_70", - .llvm_name = "sm_70", - .dependencies = &[_]*const Feature { - &feature_ptx60, - &feature_sm_70, - }, -}; - -pub const cpu_sm_72 = Cpu{ - .name = "sm_72", - .llvm_name = "sm_72", - .dependencies = &[_]*const Feature { - &feature_ptx61, - &feature_sm_72, - }, -}; - -pub const cpu_sm_75 = Cpu{ - .name = "sm_75", - .llvm_name = "sm_75", - .dependencies = &[_]*const Feature { - &feature_ptx63, - &feature_sm_75, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_sm_20, - &cpu_sm_21, - &cpu_sm_30, - &cpu_sm_32, - &cpu_sm_35, - &cpu_sm_37, - &cpu_sm_50, - &cpu_sm_52, - &cpu_sm_53, - &cpu_sm_60, - &cpu_sm_61, - &cpu_sm_62, - &cpu_sm_70, - &cpu_sm_72, - &cpu_sm_75, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + ptx32, + ptx40, + ptx41, + ptx42, + ptx43, + ptx50, + ptx60, + ptx61, + ptx63, + ptx64, + sm_20, + sm_21, + sm_30, + sm_32, + sm_35, + sm_37, + sm_50, + sm_52, + sm_53, + sm_60, + sm_61, + sm_62, + sm_70, + sm_72, + sm_75, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.ptx32)] = .{ + .index = @enumToInt(Feature.ptx32), + .name = @tagName(Feature.ptx32), + .llvm_name = "ptx32", + .description = "Use PTX version 3.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx40)] = .{ + .index = @enumToInt(Feature.ptx40), + .name = @tagName(Feature.ptx40), + .llvm_name = "ptx40", + .description = "Use PTX version 4.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx41)] = .{ + .index = @enumToInt(Feature.ptx41), + .name = @tagName(Feature.ptx41), + .llvm_name = "ptx41", + .description = "Use PTX version 4.1", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx42)] = .{ + .index = @enumToInt(Feature.ptx42), + .name = @tagName(Feature.ptx42), + .llvm_name = "ptx42", + .description = "Use PTX version 4.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx43)] = .{ + .index = @enumToInt(Feature.ptx43), + .name = @tagName(Feature.ptx43), + .llvm_name = "ptx43", + .description = "Use PTX version 4.3", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx50)] = .{ + .index = @enumToInt(Feature.ptx50), + .name = @tagName(Feature.ptx50), + .llvm_name = "ptx50", + .description = "Use PTX version 5.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx60)] = .{ + .index = @enumToInt(Feature.ptx60), + .name = @tagName(Feature.ptx60), + .llvm_name = "ptx60", + .description = "Use PTX version 6.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx61)] = .{ + .index = @enumToInt(Feature.ptx61), + .name = @tagName(Feature.ptx61), + .llvm_name = "ptx61", + .description = "Use PTX version 6.1", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx63)] = .{ + .index = @enumToInt(Feature.ptx63), + .name = @tagName(Feature.ptx63), + .llvm_name = "ptx63", + .description = "Use PTX version 6.3", + .dependencies = 0, + }; + result[@enumToInt(Feature.ptx64)] = .{ + .index = @enumToInt(Feature.ptx64), + .name = @tagName(Feature.ptx64), + .llvm_name = "ptx64", + .description = "Use PTX version 6.4", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_20)] = .{ + .index = @enumToInt(Feature.sm_20), + .name = @tagName(Feature.sm_20), + .llvm_name = "sm_20", + .description = "Target SM 2.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_21)] = .{ + .index = @enumToInt(Feature.sm_21), + .name = @tagName(Feature.sm_21), + .llvm_name = "sm_21", + .description = "Target SM 2.1", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_30)] = .{ + .index = @enumToInt(Feature.sm_30), + .name = @tagName(Feature.sm_30), + .llvm_name = "sm_30", + .description = "Target SM 3.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_32)] = .{ + .index = @enumToInt(Feature.sm_32), + .name = @tagName(Feature.sm_32), + .llvm_name = "sm_32", + .description = "Target SM 3.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_35)] = .{ + .index = @enumToInt(Feature.sm_35), + .name = @tagName(Feature.sm_35), + .llvm_name = "sm_35", + .description = "Target SM 3.5", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_37)] = .{ + .index = @enumToInt(Feature.sm_37), + .name = @tagName(Feature.sm_37), + .llvm_name = "sm_37", + .description = "Target SM 3.7", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_50)] = .{ + .index = @enumToInt(Feature.sm_50), + .name = @tagName(Feature.sm_50), + .llvm_name = "sm_50", + .description = "Target SM 5.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_52)] = .{ + .index = @enumToInt(Feature.sm_52), + .name = @tagName(Feature.sm_52), + .llvm_name = "sm_52", + .description = "Target SM 5.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_53)] = .{ + .index = @enumToInt(Feature.sm_53), + .name = @tagName(Feature.sm_53), + .llvm_name = "sm_53", + .description = "Target SM 5.3", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_60)] = .{ + .index = @enumToInt(Feature.sm_60), + .name = @tagName(Feature.sm_60), + .llvm_name = "sm_60", + .description = "Target SM 6.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_61)] = .{ + .index = @enumToInt(Feature.sm_61), + .name = @tagName(Feature.sm_61), + .llvm_name = "sm_61", + .description = "Target SM 6.1", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_62)] = .{ + .index = @enumToInt(Feature.sm_62), + .name = @tagName(Feature.sm_62), + .llvm_name = "sm_62", + .description = "Target SM 6.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_70)] = .{ + .index = @enumToInt(Feature.sm_70), + .name = @tagName(Feature.sm_70), + .llvm_name = "sm_70", + .description = "Target SM 7.0", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_72)] = .{ + .index = @enumToInt(Feature.sm_72), + .name = @tagName(Feature.sm_72), + .llvm_name = "sm_72", + .description = "Target SM 7.2", + .dependencies = 0, + }; + result[@enumToInt(Feature.sm_75)] = .{ + .index = @enumToInt(Feature.sm_75), + .name = @tagName(Feature.sm_75), + .llvm_name = "sm_75", + .description = "Target SM 7.5", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const sm_20 = Cpu{ + .name = "sm_20", + .llvm_name = "sm_20", + .features = featureSet(&[_]Feature{ + .sm_20, + }), + }; + pub const sm_21 = Cpu{ + .name = "sm_21", + .llvm_name = "sm_21", + .features = featureSet(&[_]Feature{ + .sm_21, + }), + }; + pub const sm_30 = Cpu{ + .name = "sm_30", + .llvm_name = "sm_30", + .features = featureSet(&[_]Feature{ + .sm_30, + }), + }; + pub const sm_32 = Cpu{ + .name = "sm_32", + .llvm_name = "sm_32", + .features = featureSet(&[_]Feature{ + .ptx40, + .sm_32, + }), + }; + pub const sm_35 = Cpu{ + .name = "sm_35", + .llvm_name = "sm_35", + .features = featureSet(&[_]Feature{ + .sm_35, + }), + }; + pub const sm_37 = Cpu{ + .name = "sm_37", + .llvm_name = "sm_37", + .features = featureSet(&[_]Feature{ + .ptx41, + .sm_37, + }), + }; + pub const sm_50 = Cpu{ + .name = "sm_50", + .llvm_name = "sm_50", + .features = featureSet(&[_]Feature{ + .ptx40, + .sm_50, + }), + }; + pub const sm_52 = Cpu{ + .name = "sm_52", + .llvm_name = "sm_52", + .features = featureSet(&[_]Feature{ + .ptx41, + .sm_52, + }), + }; + pub const sm_53 = Cpu{ + .name = "sm_53", + .llvm_name = "sm_53", + .features = featureSet(&[_]Feature{ + .ptx42, + .sm_53, + }), + }; + pub const sm_60 = Cpu{ + .name = "sm_60", + .llvm_name = "sm_60", + .features = featureSet(&[_]Feature{ + .ptx50, + .sm_60, + }), + }; + pub const sm_61 = Cpu{ + .name = "sm_61", + .llvm_name = "sm_61", + .features = featureSet(&[_]Feature{ + .ptx50, + .sm_61, + }), + }; + pub const sm_62 = Cpu{ + .name = "sm_62", + .llvm_name = "sm_62", + .features = featureSet(&[_]Feature{ + .ptx50, + .sm_62, + }), + }; + pub const sm_70 = Cpu{ + .name = "sm_70", + .llvm_name = "sm_70", + .features = featureSet(&[_]Feature{ + .ptx60, + .sm_70, + }), + }; + pub const sm_72 = Cpu{ + .name = "sm_72", + .llvm_name = "sm_72", + .features = featureSet(&[_]Feature{ + .ptx61, + .sm_72, + }), + }; + pub const sm_75 = Cpu{ + .name = "sm_75", + .llvm_name = "sm_75", + .features = featureSet(&[_]Feature{ + .ptx63, + .sm_75, + }), + }; +}; + +/// All nvptx CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.sm_20, + &cpu.sm_21, + &cpu.sm_30, + &cpu.sm_32, + &cpu.sm_35, + &cpu.sm_37, + &cpu.sm_50, + &cpu.sm_52, + &cpu.sm_53, + &cpu.sm_60, + &cpu.sm_61, + &cpu.sm_62, + &cpu.sm_70, + &cpu.sm_72, + &cpu.sm_75, }; diff --git a/lib/std/target/powerpc.zig b/lib/std/target/powerpc.zig index f0d475a6e5..bac15f231a 100644 --- a/lib/std/target/powerpc.zig +++ b/lib/std/target/powerpc.zig @@ -1,1115 +1,1035 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_bit64 = Feature{ - .name = "bit64", - .llvm_name = "64bit", - .description = "Enable 64-bit instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_bitregs64 = Feature{ - .name = "bitregs64", - .llvm_name = "64bitregs", - .description = "Enable 64-bit registers usage for ppc32 [beta]", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_altivec = Feature{ - .name = "altivec", - .llvm_name = "altivec", - .description = "Enable Altivec instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_bpermd = Feature{ - .name = "bpermd", - .llvm_name = "bpermd", - .description = "Enable the bpermd instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_booke = Feature{ - .name = "booke", - .llvm_name = "booke", - .description = "Enable Book E instructions", - .dependencies = &[_]*const Feature { - &feature_icbt, - }, -}; - -pub const feature_cmpb = Feature{ - .name = "cmpb", - .llvm_name = "cmpb", - .description = "Enable the cmpb instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_crbits = Feature{ - .name = "crbits", - .llvm_name = "crbits", - .description = "Use condition-register bits individually", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_directMove = Feature{ - .name = "directMove", - .llvm_name = "direct-move", - .description = "Enable Power8 direct move instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_e500 = Feature{ - .name = "e500", - .llvm_name = "e500", - .description = "Enable E500/E500mc instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_extdiv = Feature{ - .name = "extdiv", - .llvm_name = "extdiv", - .description = "Enable extended divide instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fcpsgn = Feature{ - .name = "fcpsgn", - .llvm_name = "fcpsgn", - .description = "Enable the fcpsgn instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fpcvt = Feature{ - .name = "fpcvt", - .llvm_name = "fpcvt", - .description = "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fprnd = Feature{ - .name = "fprnd", - .llvm_name = "fprnd", - .description = "Enable the fri[mnpz] instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fpu = Feature{ - .name = "fpu", - .llvm_name = "fpu", - .description = "Enable classic FPU instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fre = Feature{ - .name = "fre", - .llvm_name = "fre", - .description = "Enable the fre instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fres = Feature{ - .name = "fres", - .llvm_name = "fres", - .description = "Enable the fres instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_frsqrte = Feature{ - .name = "frsqrte", - .llvm_name = "frsqrte", - .description = "Enable the frsqrte instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_frsqrtes = Feature{ - .name = "frsqrtes", - .llvm_name = "frsqrtes", - .description = "Enable the frsqrtes instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_fsqrt = Feature{ - .name = "fsqrt", - .llvm_name = "fsqrt", - .description = "Enable the fsqrt instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_float128 = Feature{ - .name = "float128", - .llvm_name = "float128", - .description = "Enable the __float128 data type for IEEE-754R Binary128.", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_htm = Feature{ - .name = "htm", - .llvm_name = "htm", - .description = "Enable Hardware Transactional Memory instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_hardFloat = Feature{ - .name = "hardFloat", - .llvm_name = "hard-float", - .description = "Enable floating-point instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_icbt = Feature{ - .name = "icbt", - .llvm_name = "icbt", - .description = "Enable icbt instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_isaV30Instructions = Feature{ - .name = "isaV30Instructions", - .llvm_name = "isa-v30-instructions", - .description = "Enable instructions added in ISA 3.0.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_isel = Feature{ - .name = "isel", - .llvm_name = "isel", - .description = "Enable the isel instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_invariantFunctionDescriptors = Feature{ - .name = "invariantFunctionDescriptors", - .llvm_name = "invariant-function-descriptors", - .description = "Assume function descriptors are invariant", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ldbrx = Feature{ - .name = "ldbrx", - .llvm_name = "ldbrx", - .description = "Enable the ldbrx instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_lfiwax = Feature{ - .name = "lfiwax", - .llvm_name = "lfiwax", - .description = "Enable the lfiwax instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_longcall = Feature{ - .name = "longcall", - .llvm_name = "longcall", - .description = "Always use indirect calls", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mfocrf = Feature{ - .name = "mfocrf", - .llvm_name = "mfocrf", - .description = "Enable the MFOCRF instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_msync = Feature{ - .name = "msync", - .llvm_name = "msync", - .description = "Has only the msync instruction instead of sync", - .dependencies = &[_]*const Feature { - &feature_icbt, - }, -}; - -pub const feature_power8Altivec = Feature{ - .name = "power8Altivec", - .llvm_name = "power8-altivec", - .description = "Enable POWER8 Altivec instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_crypto = Feature{ - .name = "crypto", - .llvm_name = "crypto", - .description = "Enable POWER8 Crypto instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_power8Vector = Feature{ - .name = "power8Vector", - .llvm_name = "power8-vector", - .description = "Enable POWER8 vector instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_power9Altivec = Feature{ - .name = "power9Altivec", - .llvm_name = "power9-altivec", - .description = "Enable POWER9 Altivec instructions", - .dependencies = &[_]*const Feature { - &feature_isaV30Instructions, - &feature_hardFloat, - }, -}; - -pub const feature_power9Vector = Feature{ - .name = "power9Vector", - .llvm_name = "power9-vector", - .description = "Enable POWER9 vector instructions", - .dependencies = &[_]*const Feature { - &feature_isaV30Instructions, - &feature_hardFloat, - }, -}; - -pub const feature_popcntd = Feature{ - .name = "popcntd", - .llvm_name = "popcntd", - .description = "Enable the popcnt[dw] instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ppc4xx = Feature{ - .name = "ppc4xx", - .llvm_name = "ppc4xx", - .description = "Enable PPC 4xx instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ppc6xx = Feature{ - .name = "ppc6xx", - .llvm_name = "ppc6xx", - .description = "Enable PPC 6xx instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ppcPostraSched = Feature{ - .name = "ppcPostraSched", - .llvm_name = "ppc-postra-sched", - .description = "Use PowerPC post-RA scheduling strategy", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_ppcPreraSched = Feature{ - .name = "ppcPreraSched", - .llvm_name = "ppc-prera-sched", - .description = "Use PowerPC pre-RA scheduling strategy", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_partwordAtomics = Feature{ - .name = "partwordAtomics", - .llvm_name = "partword-atomics", - .description = "Enable l[bh]arx and st[bh]cx.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_qpx = Feature{ - .name = "qpx", - .llvm_name = "qpx", - .description = "Enable QPX instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_recipprec = Feature{ - .name = "recipprec", - .llvm_name = "recipprec", - .description = "Assume higher precision reciprocal estimates", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_spe = Feature{ - .name = "spe", - .llvm_name = "spe", - .description = "Enable SPE instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_stfiwx = Feature{ - .name = "stfiwx", - .llvm_name = "stfiwx", - .description = "Enable the stfiwx instruction", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_securePlt = Feature{ - .name = "securePlt", - .llvm_name = "secure-plt", - .description = "Enable secure plt mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_slowPopcntd = Feature{ - .name = "slowPopcntd", - .llvm_name = "slow-popcntd", - .description = "Has slow popcnt[dw] instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_twoConstNr = Feature{ - .name = "twoConstNr", - .llvm_name = "two-const-nr", - .description = "Requires two constant Newton-Raphson computation", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vsx = Feature{ - .name = "vsx", - .llvm_name = "vsx", - .description = "Enable VSX instructions", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const feature_vectorsUseTwoUnits = Feature{ - .name = "vectorsUseTwoUnits", - .llvm_name = "vectors-use-two-units", - .description = "Vectors use two units", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_bit64, - &feature_bitregs64, - &feature_altivec, - &feature_bpermd, - &feature_booke, - &feature_cmpb, - &feature_crbits, - &feature_directMove, - &feature_e500, - &feature_extdiv, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fpu, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_float128, - &feature_htm, - &feature_hardFloat, - &feature_icbt, - &feature_isaV30Instructions, - &feature_isel, - &feature_invariantFunctionDescriptors, - &feature_ldbrx, - &feature_lfiwax, - &feature_longcall, - &feature_mfocrf, - &feature_msync, - &feature_power8Altivec, - &feature_crypto, - &feature_power8Vector, - &feature_power9Altivec, - &feature_power9Vector, - &feature_popcntd, - &feature_ppc4xx, - &feature_ppc6xx, - &feature_ppcPostraSched, - &feature_ppcPreraSched, - &feature_partwordAtomics, - &feature_qpx, - &feature_recipprec, - &feature_spe, - &feature_stfiwx, - &feature_securePlt, - &feature_slowPopcntd, - &feature_twoConstNr, - &feature_vsx, - &feature_vectorsUseTwoUnits, -}; - -pub const cpu_440 = Cpu{ - .name = "440", - .llvm_name = "440", - .dependencies = &[_]*const Feature { - &feature_icbt, - &feature_booke, - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - &feature_isel, - &feature_msync, - }, -}; - -pub const cpu_450 = Cpu{ - .name = "450", - .llvm_name = "450", - .dependencies = &[_]*const Feature { - &feature_icbt, - &feature_booke, - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - &feature_isel, - &feature_msync, - }, -}; - -pub const cpu_601 = Cpu{ - .name = "601", - .llvm_name = "601", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fpu, - }, -}; - -pub const cpu_602 = Cpu{ - .name = "602", - .llvm_name = "602", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fpu, - }, -}; - -pub const cpu_603 = Cpu{ - .name = "603", - .llvm_name = "603", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_e603 = Cpu{ - .name = "e603", - .llvm_name = "603e", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_ev603 = Cpu{ - .name = "ev603", - .llvm_name = "603ev", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_604 = Cpu{ - .name = "604", - .llvm_name = "604", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_e604 = Cpu{ - .name = "e604", - .llvm_name = "604e", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_620 = Cpu{ - .name = "620", - .llvm_name = "620", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_7400 = Cpu{ - .name = "7400", - .llvm_name = "7400", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_7450 = Cpu{ - .name = "7450", - .llvm_name = "7450", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_750 = Cpu{ - .name = "750", - .llvm_name = "750", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_970 = Cpu{ - .name = "970", - .llvm_name = "970", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_a2 = Cpu{ - .name = "a2", - .llvm_name = "a2", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_icbt, - &feature_booke, - &feature_cmpb, - &feature_hardFloat, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_recipprec, - &feature_stfiwx, - &feature_slowPopcntd, - }, -}; - -pub const cpu_a2q = Cpu{ - .name = "a2q", - .llvm_name = "a2q", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_icbt, - &feature_booke, - &feature_cmpb, - &feature_hardFloat, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_qpx, - &feature_recipprec, - &feature_stfiwx, - &feature_slowPopcntd, - }, -}; - -pub const cpu_e500 = Cpu{ - .name = "e500", - .llvm_name = "e500", - .dependencies = &[_]*const Feature { - &feature_icbt, - &feature_booke, - &feature_isel, - }, -}; - -pub const cpu_e500mc = Cpu{ - .name = "e500mc", - .llvm_name = "e500mc", - .dependencies = &[_]*const Feature { - &feature_icbt, - &feature_booke, - &feature_isel, - &feature_hardFloat, - &feature_stfiwx, - }, -}; - -pub const cpu_e5500 = Cpu{ - .name = "e5500", - .llvm_name = "e5500", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_icbt, - &feature_booke, - &feature_isel, - &feature_mfocrf, - &feature_hardFloat, - &feature_stfiwx, - }, -}; - -pub const cpu_g3 = Cpu{ - .name = "g3", - .llvm_name = "g3", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_g4 = Cpu{ - .name = "g4", - .llvm_name = "g4", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_g4Plus = Cpu{ - .name = "g4Plus", - .llvm_name = "g4+", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - }, -}; - -pub const cpu_g5 = Cpu{ - .name = "g5", - .llvm_name = "g5", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const cpu_ppc = Cpu{ - .name = "ppc", - .llvm_name = "ppc", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const cpu_ppc32 = Cpu{ - .name = "ppc32", - .llvm_name = "ppc32", - .dependencies = &[_]*const Feature { - &feature_hardFloat, - }, -}; - -pub const cpu_ppc64 = Cpu{ - .name = "ppc64", - .llvm_name = "ppc64", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_ppc64le = Cpu{ - .name = "ppc64le", - .llvm_name = "ppc64le", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_bpermd, - &feature_cmpb, - &feature_directMove, - &feature_extdiv, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_htm, - &feature_icbt, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_power8Altivec, - &feature_crypto, - &feature_power8Vector, - &feature_popcntd, - &feature_partwordAtomics, - &feature_recipprec, - &feature_stfiwx, - &feature_twoConstNr, - &feature_vsx, - }, -}; - -pub const cpu_pwr3 = Cpu{ - .name = "pwr3", - .llvm_name = "pwr3", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr4 = Cpu{ - .name = "pwr4", - .llvm_name = "pwr4", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fres, - &feature_frsqrte, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr5 = Cpu{ - .name = "pwr5", - .llvm_name = "pwr5", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr5x = Cpu{ - .name = "pwr5x", - .llvm_name = "pwr5x", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_mfocrf, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr6 = Cpu{ - .name = "pwr6", - .llvm_name = "pwr6", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_cmpb, - &feature_fcpsgn, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_lfiwax, - &feature_mfocrf, - &feature_recipprec, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr6x = Cpu{ - .name = "pwr6x", - .llvm_name = "pwr6x", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_cmpb, - &feature_fcpsgn, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_lfiwax, - &feature_mfocrf, - &feature_recipprec, - &feature_stfiwx, - }, -}; - -pub const cpu_pwr7 = Cpu{ - .name = "pwr7", - .llvm_name = "pwr7", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_bpermd, - &feature_cmpb, - &feature_extdiv, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_popcntd, - &feature_recipprec, - &feature_stfiwx, - &feature_twoConstNr, - &feature_vsx, - }, -}; - -pub const cpu_pwr8 = Cpu{ - .name = "pwr8", - .llvm_name = "pwr8", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_bpermd, - &feature_cmpb, - &feature_directMove, - &feature_extdiv, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_htm, - &feature_icbt, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_power8Altivec, - &feature_crypto, - &feature_power8Vector, - &feature_popcntd, - &feature_partwordAtomics, - &feature_recipprec, - &feature_stfiwx, - &feature_twoConstNr, - &feature_vsx, - }, -}; - -pub const cpu_pwr9 = Cpu{ - .name = "pwr9", - .llvm_name = "pwr9", - .dependencies = &[_]*const Feature { - &feature_bit64, - &feature_hardFloat, - &feature_altivec, - &feature_bpermd, - &feature_cmpb, - &feature_directMove, - &feature_extdiv, - &feature_fcpsgn, - &feature_fpcvt, - &feature_fprnd, - &feature_fre, - &feature_fres, - &feature_frsqrte, - &feature_frsqrtes, - &feature_fsqrt, - &feature_htm, - &feature_icbt, - &feature_isaV30Instructions, - &feature_isel, - &feature_ldbrx, - &feature_lfiwax, - &feature_mfocrf, - &feature_power8Altivec, - &feature_crypto, - &feature_power8Vector, - &feature_power9Altivec, - &feature_power9Vector, - &feature_popcntd, - &feature_ppcPostraSched, - &feature_ppcPreraSched, - &feature_partwordAtomics, - &feature_recipprec, - &feature_stfiwx, - &feature_twoConstNr, - &feature_vsx, - &feature_vectorsUseTwoUnits, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_440, - &cpu_450, - &cpu_601, - &cpu_602, - &cpu_603, - &cpu_e603, - &cpu_ev603, - &cpu_604, - &cpu_e604, - &cpu_620, - &cpu_7400, - &cpu_7450, - &cpu_750, - &cpu_970, - &cpu_a2, - &cpu_a2q, - &cpu_e500, - &cpu_e500mc, - &cpu_e5500, - &cpu_g3, - &cpu_g4, - &cpu_g4Plus, - &cpu_g5, - &cpu_generic, - &cpu_ppc, - &cpu_ppc32, - &cpu_ppc64, - &cpu_ppc64le, - &cpu_pwr3, - &cpu_pwr4, - &cpu_pwr5, - &cpu_pwr5x, - &cpu_pwr6, - &cpu_pwr6x, - &cpu_pwr7, - &cpu_pwr8, - &cpu_pwr9, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + @"64bit", + @"64bitregs", + altivec, + booke, + bpermd, + cmpb, + crbits, + crypto, + direct_move, + e500, + extdiv, + fcpsgn, + float128, + fpcvt, + fprnd, + fpu, + fre, + fres, + frsqrte, + frsqrtes, + fsqrt, + hard_float, + htm, + icbt, + invariant_function_descriptors, + isa_v30_instructions, + isel, + ldbrx, + lfiwax, + longcall, + mfocrf, + msync, + partword_atomics, + popcntd, + power8_altivec, + power8_vector, + power9_altivec, + power9_vector, + ppc_postra_sched, + ppc_prera_sched, + ppc4xx, + ppc6xx, + qpx, + recipprec, + secure_plt, + slow_popcntd, + spe, + stfiwx, + two_const_nr, + vectors_use_two_units, + vsx, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.@"64bit")] = .{ + .index = @enumToInt(Feature.@"64bit"), + .name = @tagName(Feature.@"64bit"), + .llvm_name = "64bit", + .description = "Enable 64-bit instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.@"64bitregs")] = .{ + .index = @enumToInt(Feature.@"64bitregs"), + .name = @tagName(Feature.@"64bitregs"), + .llvm_name = "64bitregs", + .description = "Enable 64-bit registers usage for ppc32 [beta]", + .dependencies = 0, + }; + result[@enumToInt(Feature.altivec)] = .{ + .index = @enumToInt(Feature.altivec), + .name = @tagName(Feature.altivec), + .llvm_name = "altivec", + .description = "Enable Altivec instructions", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.booke)] = .{ + .index = @enumToInt(Feature.booke), + .name = @tagName(Feature.booke), + .llvm_name = "booke", + .description = "Enable Book E instructions", + .dependencies = featureSet(&[_]Feature{ + .icbt, + }), + }; + result[@enumToInt(Feature.bpermd)] = .{ + .index = @enumToInt(Feature.bpermd), + .name = @tagName(Feature.bpermd), + .llvm_name = "bpermd", + .description = "Enable the bpermd instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.cmpb)] = .{ + .index = @enumToInt(Feature.cmpb), + .name = @tagName(Feature.cmpb), + .llvm_name = "cmpb", + .description = "Enable the cmpb instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.crbits)] = .{ + .index = @enumToInt(Feature.crbits), + .name = @tagName(Feature.crbits), + .llvm_name = "crbits", + .description = "Use condition-register bits individually", + .dependencies = 0, + }; + result[@enumToInt(Feature.crypto)] = .{ + .index = @enumToInt(Feature.crypto), + .name = @tagName(Feature.crypto), + .llvm_name = "crypto", + .description = "Enable POWER8 Crypto instructions", + .dependencies = featureSet(&[_]Feature{ + .power8_altivec, + }), + }; + result[@enumToInt(Feature.direct_move)] = .{ + .index = @enumToInt(Feature.direct_move), + .name = @tagName(Feature.direct_move), + .llvm_name = "direct-move", + .description = "Enable Power8 direct move instructions", + .dependencies = featureSet(&[_]Feature{ + .vsx, + }), + }; + result[@enumToInt(Feature.e500)] = .{ + .index = @enumToInt(Feature.e500), + .name = @tagName(Feature.e500), + .llvm_name = "e500", + .description = "Enable E500/E500mc instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.extdiv)] = .{ + .index = @enumToInt(Feature.extdiv), + .name = @tagName(Feature.extdiv), + .llvm_name = "extdiv", + .description = "Enable extended divide instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.fcpsgn)] = .{ + .index = @enumToInt(Feature.fcpsgn), + .name = @tagName(Feature.fcpsgn), + .llvm_name = "fcpsgn", + .description = "Enable the fcpsgn instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.float128)] = .{ + .index = @enumToInt(Feature.float128), + .name = @tagName(Feature.float128), + .llvm_name = "float128", + .description = "Enable the __float128 data type for IEEE-754R Binary128.", + .dependencies = featureSet(&[_]Feature{ + .vsx, + }), + }; + result[@enumToInt(Feature.fpcvt)] = .{ + .index = @enumToInt(Feature.fpcvt), + .name = @tagName(Feature.fpcvt), + .llvm_name = "fpcvt", + .description = "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.fprnd)] = .{ + .index = @enumToInt(Feature.fprnd), + .name = @tagName(Feature.fprnd), + .llvm_name = "fprnd", + .description = "Enable the fri[mnpz] instructions", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.fpu)] = .{ + .index = @enumToInt(Feature.fpu), + .name = @tagName(Feature.fpu), + .llvm_name = "fpu", + .description = "Enable classic FPU instructions", + .dependencies = featureSet(&[_]Feature{ + .hard_float, + }), + }; + result[@enumToInt(Feature.fre)] = .{ + .index = @enumToInt(Feature.fre), + .name = @tagName(Feature.fre), + .llvm_name = "fre", + .description = "Enable the fre instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.fres)] = .{ + .index = @enumToInt(Feature.fres), + .name = @tagName(Feature.fres), + .llvm_name = "fres", + .description = "Enable the fres instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.frsqrte)] = .{ + .index = @enumToInt(Feature.frsqrte), + .name = @tagName(Feature.frsqrte), + .llvm_name = "frsqrte", + .description = "Enable the frsqrte instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.frsqrtes)] = .{ + .index = @enumToInt(Feature.frsqrtes), + .name = @tagName(Feature.frsqrtes), + .llvm_name = "frsqrtes", + .description = "Enable the frsqrtes instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.fsqrt)] = .{ + .index = @enumToInt(Feature.fsqrt), + .name = @tagName(Feature.fsqrt), + .llvm_name = "fsqrt", + .description = "Enable the fsqrt instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.hard_float)] = .{ + .index = @enumToInt(Feature.hard_float), + .name = @tagName(Feature.hard_float), + .llvm_name = "hard-float", + .description = "Enable floating-point instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.htm)] = .{ + .index = @enumToInt(Feature.htm), + .name = @tagName(Feature.htm), + .llvm_name = "htm", + .description = "Enable Hardware Transactional Memory instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.icbt)] = .{ + .index = @enumToInt(Feature.icbt), + .name = @tagName(Feature.icbt), + .llvm_name = "icbt", + .description = "Enable icbt instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.invariant_function_descriptors)] = .{ + .index = @enumToInt(Feature.invariant_function_descriptors), + .name = @tagName(Feature.invariant_function_descriptors), + .llvm_name = "invariant-function-descriptors", + .description = "Assume function descriptors are invariant", + .dependencies = 0, + }; + result[@enumToInt(Feature.isa_v30_instructions)] = .{ + .index = @enumToInt(Feature.isa_v30_instructions), + .name = @tagName(Feature.isa_v30_instructions), + .llvm_name = "isa-v30-instructions", + .description = "Enable instructions added in ISA 3.0.", + .dependencies = 0, + }; + result[@enumToInt(Feature.isel)] = .{ + .index = @enumToInt(Feature.isel), + .name = @tagName(Feature.isel), + .llvm_name = "isel", + .description = "Enable the isel instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.ldbrx)] = .{ + .index = @enumToInt(Feature.ldbrx), + .name = @tagName(Feature.ldbrx), + .llvm_name = "ldbrx", + .description = "Enable the ldbrx instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.lfiwax)] = .{ + .index = @enumToInt(Feature.lfiwax), + .name = @tagName(Feature.lfiwax), + .llvm_name = "lfiwax", + .description = "Enable the lfiwax instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.longcall)] = .{ + .index = @enumToInt(Feature.longcall), + .name = @tagName(Feature.longcall), + .llvm_name = "longcall", + .description = "Always use indirect calls", + .dependencies = 0, + }; + result[@enumToInt(Feature.mfocrf)] = .{ + .index = @enumToInt(Feature.mfocrf), + .name = @tagName(Feature.mfocrf), + .llvm_name = "mfocrf", + .description = "Enable the MFOCRF instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.msync)] = .{ + .index = @enumToInt(Feature.msync), + .name = @tagName(Feature.msync), + .llvm_name = "msync", + .description = "Has only the msync instruction instead of sync", + .dependencies = featureSet(&[_]Feature{ + .booke, + }), + }; + result[@enumToInt(Feature.partword_atomics)] = .{ + .index = @enumToInt(Feature.partword_atomics), + .name = @tagName(Feature.partword_atomics), + .llvm_name = "partword-atomics", + .description = "Enable l[bh]arx and st[bh]cx.", + .dependencies = 0, + }; + result[@enumToInt(Feature.popcntd)] = .{ + .index = @enumToInt(Feature.popcntd), + .name = @tagName(Feature.popcntd), + .llvm_name = "popcntd", + .description = "Enable the popcnt[dw] instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.power8_altivec)] = .{ + .index = @enumToInt(Feature.power8_altivec), + .name = @tagName(Feature.power8_altivec), + .llvm_name = "power8-altivec", + .description = "Enable POWER8 Altivec instructions", + .dependencies = featureSet(&[_]Feature{ + .altivec, + }), + }; + result[@enumToInt(Feature.power8_vector)] = .{ + .index = @enumToInt(Feature.power8_vector), + .name = @tagName(Feature.power8_vector), + .llvm_name = "power8-vector", + .description = "Enable POWER8 vector instructions", + .dependencies = featureSet(&[_]Feature{ + .power8_altivec, + .vsx, + }), + }; + result[@enumToInt(Feature.power9_altivec)] = .{ + .index = @enumToInt(Feature.power9_altivec), + .name = @tagName(Feature.power9_altivec), + .llvm_name = "power9-altivec", + .description = "Enable POWER9 Altivec instructions", + .dependencies = featureSet(&[_]Feature{ + .isa_v30_instructions, + .power8_altivec, + }), + }; + result[@enumToInt(Feature.power9_vector)] = .{ + .index = @enumToInt(Feature.power9_vector), + .name = @tagName(Feature.power9_vector), + .llvm_name = "power9-vector", + .description = "Enable POWER9 vector instructions", + .dependencies = featureSet(&[_]Feature{ + .isa_v30_instructions, + .power8_vector, + .power9_altivec, + }), + }; + result[@enumToInt(Feature.ppc_postra_sched)] = .{ + .index = @enumToInt(Feature.ppc_postra_sched), + .name = @tagName(Feature.ppc_postra_sched), + .llvm_name = "ppc-postra-sched", + .description = "Use PowerPC post-RA scheduling strategy", + .dependencies = 0, + }; + result[@enumToInt(Feature.ppc_prera_sched)] = .{ + .index = @enumToInt(Feature.ppc_prera_sched), + .name = @tagName(Feature.ppc_prera_sched), + .llvm_name = "ppc-prera-sched", + .description = "Use PowerPC pre-RA scheduling strategy", + .dependencies = 0, + }; + result[@enumToInt(Feature.ppc4xx)] = .{ + .index = @enumToInt(Feature.ppc4xx), + .name = @tagName(Feature.ppc4xx), + .llvm_name = "ppc4xx", + .description = "Enable PPC 4xx instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.ppc6xx)] = .{ + .index = @enumToInt(Feature.ppc6xx), + .name = @tagName(Feature.ppc6xx), + .llvm_name = "ppc6xx", + .description = "Enable PPC 6xx instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.qpx)] = .{ + .index = @enumToInt(Feature.qpx), + .name = @tagName(Feature.qpx), + .llvm_name = "qpx", + .description = "Enable QPX instructions", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.recipprec)] = .{ + .index = @enumToInt(Feature.recipprec), + .name = @tagName(Feature.recipprec), + .llvm_name = "recipprec", + .description = "Assume higher precision reciprocal estimates", + .dependencies = 0, + }; + result[@enumToInt(Feature.secure_plt)] = .{ + .index = @enumToInt(Feature.secure_plt), + .name = @tagName(Feature.secure_plt), + .llvm_name = "secure-plt", + .description = "Enable secure plt mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.slow_popcntd)] = .{ + .index = @enumToInt(Feature.slow_popcntd), + .name = @tagName(Feature.slow_popcntd), + .llvm_name = "slow-popcntd", + .description = "Has slow popcnt[dw] instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.spe)] = .{ + .index = @enumToInt(Feature.spe), + .name = @tagName(Feature.spe), + .llvm_name = "spe", + .description = "Enable SPE instructions", + .dependencies = featureSet(&[_]Feature{ + .hard_float, + }), + }; + result[@enumToInt(Feature.stfiwx)] = .{ + .index = @enumToInt(Feature.stfiwx), + .name = @tagName(Feature.stfiwx), + .llvm_name = "stfiwx", + .description = "Enable the stfiwx instruction", + .dependencies = featureSet(&[_]Feature{ + .fpu, + }), + }; + result[@enumToInt(Feature.two_const_nr)] = .{ + .index = @enumToInt(Feature.two_const_nr), + .name = @tagName(Feature.two_const_nr), + .llvm_name = "two-const-nr", + .description = "Requires two constant Newton-Raphson computation", + .dependencies = 0, + }; + result[@enumToInt(Feature.vectors_use_two_units)] = .{ + .index = @enumToInt(Feature.vectors_use_two_units), + .name = @tagName(Feature.vectors_use_two_units), + .llvm_name = "vectors-use-two-units", + .description = "Vectors use two units", + .dependencies = 0, + }; + result[@enumToInt(Feature.vsx)] = .{ + .index = @enumToInt(Feature.vsx), + .name = @tagName(Feature.vsx), + .llvm_name = "vsx", + .description = "Enable VSX instructions", + .dependencies = featureSet(&[_]Feature{ + .altivec, + }), + }; + break :blk result; +}; + +pub const cpu = struct { + pub const @"440" = Cpu{ + .name = "@"440"", + .llvm_name = "440", + .features = featureSet(&[_]Feature{ + .booke, + .fres, + .frsqrte, + .icbt, + .isel, + .msync, + }), + }; + pub const @"450" = Cpu{ + .name = "@"450"", + .llvm_name = "450", + .features = featureSet(&[_]Feature{ + .booke, + .fres, + .frsqrte, + .icbt, + .isel, + .msync, + }), + }; + pub const @"601" = Cpu{ + .name = "@"601"", + .llvm_name = "601", + .features = featureSet(&[_]Feature{ + .fpu, + }), + }; + pub const @"602" = Cpu{ + .name = "@"602"", + .llvm_name = "602", + .features = featureSet(&[_]Feature{ + .fpu, + }), + }; + pub const @"603" = Cpu{ + .name = "@"603"", + .llvm_name = "603", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"603e" = Cpu{ + .name = "@"603e"", + .llvm_name = "603e", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"603ev" = Cpu{ + .name = "@"603ev"", + .llvm_name = "603ev", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"604" = Cpu{ + .name = "@"604"", + .llvm_name = "604", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"604e" = Cpu{ + .name = "@"604e"", + .llvm_name = "604e", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"620" = Cpu{ + .name = "@"620"", + .llvm_name = "620", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"7400" = Cpu{ + .name = "@"7400"", + .llvm_name = "7400", + .features = featureSet(&[_]Feature{ + .altivec, + .fres, + .frsqrte, + }), + }; + pub const @"7450" = Cpu{ + .name = "@"7450"", + .llvm_name = "7450", + .features = featureSet(&[_]Feature{ + .altivec, + .fres, + .frsqrte, + }), + }; + pub const @"750" = Cpu{ + .name = "@"750"", + .llvm_name = "750", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const @"970" = Cpu{ + .name = "@"970"", + .llvm_name = "970", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fres, + .frsqrte, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const a2 = Cpu{ + .name = "a2", + .llvm_name = "a2", + .features = featureSet(&[_]Feature{ + .@"64bit", + .booke, + .cmpb, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .icbt, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .recipprec, + .slow_popcntd, + .stfiwx, + }), + }; + pub const a2q = Cpu{ + .name = "a2q", + .llvm_name = "a2q", + .features = featureSet(&[_]Feature{ + .@"64bit", + .booke, + .cmpb, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .icbt, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .qpx, + .recipprec, + .slow_popcntd, + .stfiwx, + }), + }; + pub const e500 = Cpu{ + .name = "e500", + .llvm_name = "e500", + .features = featureSet(&[_]Feature{ + .booke, + .icbt, + .isel, + }), + }; + pub const e500mc = Cpu{ + .name = "e500mc", + .llvm_name = "e500mc", + .features = featureSet(&[_]Feature{ + .booke, + .icbt, + .isel, + .stfiwx, + }), + }; + pub const e5500 = Cpu{ + .name = "e5500", + .llvm_name = "e5500", + .features = featureSet(&[_]Feature{ + .@"64bit", + .booke, + .icbt, + .isel, + .mfocrf, + .stfiwx, + }), + }; + pub const g3 = Cpu{ + .name = "g3", + .llvm_name = "g3", + .features = featureSet(&[_]Feature{ + .fres, + .frsqrte, + }), + }; + pub const g4 = Cpu{ + .name = "g4", + .llvm_name = "g4", + .features = featureSet(&[_]Feature{ + .altivec, + .fres, + .frsqrte, + }), + }; + pub const g4+ = Cpu{ + .name = "g4+", + .llvm_name = "g4+", + .features = featureSet(&[_]Feature{ + .altivec, + .fres, + .frsqrte, + }), + }; + pub const g5 = Cpu{ + .name = "g5", + .llvm_name = "g5", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fres, + .frsqrte, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = featureSet(&[_]Feature{ + .hard_float, + }), + }; + pub const ppc = Cpu{ + .name = "ppc", + .llvm_name = "ppc", + .features = featureSet(&[_]Feature{ + .hard_float, + }), + }; + pub const ppc32 = Cpu{ + .name = "ppc32", + .llvm_name = "ppc32", + .features = featureSet(&[_]Feature{ + .hard_float, + }), + }; + pub const ppc64 = Cpu{ + .name = "ppc64", + .llvm_name = "ppc64", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fres, + .frsqrte, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const ppc64le = Cpu{ + .name = "ppc64le", + .llvm_name = "ppc64le", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .bpermd, + .cmpb, + .crypto, + .direct_move, + .extdiv, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .htm, + .icbt, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .partword_atomics, + .popcntd, + .power8_altivec, + .power8_vector, + .recipprec, + .stfiwx, + .two_const_nr, + .vsx, + }), + }; + pub const pwr3 = Cpu{ + .name = "pwr3", + .llvm_name = "pwr3", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fres, + .frsqrte, + .mfocrf, + .stfiwx, + }), + }; + pub const pwr4 = Cpu{ + .name = "pwr4", + .llvm_name = "pwr4", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fres, + .frsqrte, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const pwr5 = Cpu{ + .name = "pwr5", + .llvm_name = "pwr5", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const pwr5x = Cpu{ + .name = "pwr5x", + .llvm_name = "pwr5x", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .mfocrf, + .stfiwx, + }), + }; + pub const pwr6 = Cpu{ + .name = "pwr6", + .llvm_name = "pwr6", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .cmpb, + .fcpsgn, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .lfiwax, + .mfocrf, + .recipprec, + .stfiwx, + }), + }; + pub const pwr6x = Cpu{ + .name = "pwr6x", + .llvm_name = "pwr6x", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .cmpb, + .fcpsgn, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .lfiwax, + .mfocrf, + .recipprec, + .stfiwx, + }), + }; + pub const pwr7 = Cpu{ + .name = "pwr7", + .llvm_name = "pwr7", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .bpermd, + .cmpb, + .extdiv, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .popcntd, + .recipprec, + .stfiwx, + .two_const_nr, + .vsx, + }), + }; + pub const pwr8 = Cpu{ + .name = "pwr8", + .llvm_name = "pwr8", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .bpermd, + .cmpb, + .crypto, + .direct_move, + .extdiv, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .htm, + .icbt, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .partword_atomics, + .popcntd, + .power8_altivec, + .power8_vector, + .recipprec, + .stfiwx, + .two_const_nr, + .vsx, + }), + }; + pub const pwr9 = Cpu{ + .name = "pwr9", + .llvm_name = "pwr9", + .features = featureSet(&[_]Feature{ + .@"64bit", + .altivec, + .bpermd, + .cmpb, + .crypto, + .direct_move, + .extdiv, + .fcpsgn, + .fpcvt, + .fprnd, + .fre, + .fres, + .frsqrte, + .frsqrtes, + .fsqrt, + .htm, + .icbt, + .isa_v30_instructions, + .isel, + .ldbrx, + .lfiwax, + .mfocrf, + .partword_atomics, + .popcntd, + .power8_altivec, + .power8_vector, + .power9_altivec, + .power9_vector, + .ppc_postra_sched, + .ppc_prera_sched, + .recipprec, + .stfiwx, + .two_const_nr, + .vectors_use_two_units, + .vsx, + }), + }; +}; + +/// All powerpc CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.@"440", + &cpu.@"450", + &cpu.@"601", + &cpu.@"602", + &cpu.@"603", + &cpu.@"603e", + &cpu.@"603ev", + &cpu.@"604", + &cpu.@"604e", + &cpu.@"620", + &cpu.@"7400", + &cpu.@"7450", + &cpu.@"750", + &cpu.@"970", + &cpu.a2, + &cpu.a2q, + &cpu.e500, + &cpu.e500mc, + &cpu.e5500, + &cpu.g3, + &cpu.g4, + &cpu.g4+, + &cpu.g5, + &cpu.generic, + &cpu.ppc, + &cpu.ppc32, + &cpu.ppc64, + &cpu.ppc64le, + &cpu.pwr3, + &cpu.pwr4, + &cpu.pwr5, + &cpu.pwr5x, + &cpu.pwr6, + &cpu.pwr6x, + &cpu.pwr7, + &cpu.pwr8, + &cpu.pwr9, }; diff --git a/lib/std/target/riscv.zig b/lib/std/target/riscv.zig index bf82cc9f82..7181028cc2 100644 --- a/lib/std/target/riscv.zig +++ b/lib/std/target/riscv.zig @@ -1,98 +1,103 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; -pub const feature_bit64 = Feature{ - .name = "bit64", - .llvm_name = "64bit", - .description = "Implements RV64", - .dependencies = &[_]*const Feature { - }, +pub const Feature = enum { + @"64bit", + a, + c, + d, + e, + f, + m, + relax, }; -pub const feature_e = Feature{ - .name = "e", - .llvm_name = "e", - .description = "Implements RV32E (provides 16 rather than 32 GPRs)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_relax = Feature{ - .name = "relax", - .llvm_name = "relax", - .description = "Enable Linker relaxation.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_a = Feature{ - .name = "a", - .llvm_name = "a", - .description = "'A' (Atomic Instructions)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_c = Feature{ - .name = "c", - .llvm_name = "c", - .description = "'C' (Compressed Instructions)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_d = Feature{ - .name = "d", - .llvm_name = "d", - .description = "'D' (Double-Precision Floating-Point)", - .dependencies = &[_]*const Feature { - &feature_f, - }, -}; - -pub const feature_f = Feature{ - .name = "f", - .llvm_name = "f", - .description = "'F' (Single-Precision Floating-Point)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_m = Feature{ - .name = "m", - .llvm_name = "m", - .description = "'M' (Integer Multiplication and Division)", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_bit64, - &feature_e, - &feature_relax, - &feature_a, - &feature_c, - &feature_d, - &feature_f, - &feature_m, -}; +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); -pub const cpu_genericRv32 = Cpu{ - .name = "genericRv32", - .llvm_name = "generic-rv32", - .dependencies = &[_]*const Feature { - }, +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.@"64bit")] = .{ + .index = @enumToInt(Feature.@"64bit"), + .name = @tagName(Feature.@"64bit"), + .llvm_name = "64bit", + .description = "Implements RV64", + .dependencies = 0, + }; + result[@enumToInt(Feature.a)] = .{ + .index = @enumToInt(Feature.a), + .name = @tagName(Feature.a), + .llvm_name = "a", + .description = "'A' (Atomic Instructions)", + .dependencies = 0, + }; + result[@enumToInt(Feature.c)] = .{ + .index = @enumToInt(Feature.c), + .name = @tagName(Feature.c), + .llvm_name = "c", + .description = "'C' (Compressed Instructions)", + .dependencies = 0, + }; + result[@enumToInt(Feature.d)] = .{ + .index = @enumToInt(Feature.d), + .name = @tagName(Feature.d), + .llvm_name = "d", + .description = "'D' (Double-Precision Floating-Point)", + .dependencies = featureSet(&[_]Feature{ + .f, + }), + }; + result[@enumToInt(Feature.e)] = .{ + .index = @enumToInt(Feature.e), + .name = @tagName(Feature.e), + .llvm_name = "e", + .description = "Implements RV32E (provides 16 rather than 32 GPRs)", + .dependencies = 0, + }; + result[@enumToInt(Feature.f)] = .{ + .index = @enumToInt(Feature.f), + .name = @tagName(Feature.f), + .llvm_name = "f", + .description = "'F' (Single-Precision Floating-Point)", + .dependencies = 0, + }; + result[@enumToInt(Feature.m)] = .{ + .index = @enumToInt(Feature.m), + .name = @tagName(Feature.m), + .llvm_name = "m", + .description = "'M' (Integer Multiplication and Division)", + .dependencies = 0, + }; + result[@enumToInt(Feature.relax)] = .{ + .index = @enumToInt(Feature.relax), + .name = @tagName(Feature.relax), + .llvm_name = "relax", + .description = "Enable Linker relaxation.", + .dependencies = 0, + }; + break :blk result; }; -pub const cpu_genericRv64 = Cpu{ - .name = "genericRv64", - .llvm_name = "generic-rv64", - .dependencies = &[_]*const Feature { - &feature_bit64, - }, +pub const cpu = struct { + pub const generic_rv32 = Cpu{ + .name = "generic_rv32", + .llvm_name = "generic-rv32", + .features = 0, + }; + pub const generic_rv64 = Cpu{ + .name = "generic_rv64", + .llvm_name = "generic-rv64", + .features = featureSet(&[_]Feature{ + .@"64bit", + }), + }; }; -pub const cpus = &[_]*const Cpu { - &cpu_genericRv32, - &cpu_genericRv64, +/// All riscv CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.generic_rv32, + &cpu.generic_rv64, }; diff --git a/lib/std/target/sparc.zig b/lib/std/target/sparc.zig index 7dfaa47df7..6b1787f31f 100644 --- a/lib/std/target/sparc.zig +++ b/lib/std/target/sparc.zig @@ -1,489 +1,528 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_hardQuadFloat = Feature{ - .name = "hardQuadFloat", - .llvm_name = "hard-quad-float", - .description = "Enable quad-word floating point instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_leon = Feature{ - .name = "leon", - .llvm_name = "leon", - .description = "Enable LEON extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noFmuls = Feature{ - .name = "noFmuls", - .llvm_name = "no-fmuls", - .description = "Disable the fmuls instruction.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_noFsmuld = Feature{ - .name = "noFsmuld", - .llvm_name = "no-fsmuld", - .description = "Disable the fsmuld instruction.", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_leonpwrpsr = Feature{ - .name = "leonpwrpsr", - .llvm_name = "leonpwrpsr", - .description = "Enable the PWRPSR instruction", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_softFloat = Feature{ - .name = "softFloat", - .llvm_name = "soft-float", - .description = "Use software emulation for floating point", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_softMulDiv = Feature{ - .name = "softMulDiv", - .llvm_name = "soft-mul-div", - .description = "Use software emulation for integer multiply and divide", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_deprecatedV8 = Feature{ - .name = "deprecatedV8", - .llvm_name = "deprecated-v8", - .description = "Enable deprecated V8 instructions in V9 mode", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_v9 = Feature{ - .name = "v9", - .llvm_name = "v9", - .description = "Enable SPARC-V9 instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vis = Feature{ - .name = "vis", - .llvm_name = "vis", - .description = "Enable UltraSPARC Visual Instruction Set extensions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vis2 = Feature{ - .name = "vis2", - .llvm_name = "vis2", - .description = "Enable Visual Instruction Set extensions II", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vis3 = Feature{ - .name = "vis3", - .llvm_name = "vis3", - .description = "Enable Visual Instruction Set extensions III", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_hardQuadFloat, - &feature_leon, - &feature_noFmuls, - &feature_noFsmuld, - &feature_leonpwrpsr, - &feature_softFloat, - &feature_softMulDiv, - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - &feature_vis3, -}; - -pub const cpu_at697e = Cpu{ - .name = "at697e", - .llvm_name = "at697e", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_at697f = Cpu{ - .name = "at697f", - .llvm_name = "at697f", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_f934 = Cpu{ - .name = "f934", - .llvm_name = "f934", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_gr712rc = Cpu{ - .name = "gr712rc", - .llvm_name = "gr712rc", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_gr740 = Cpu{ - .name = "gr740", - .llvm_name = "gr740", - .dependencies = &[_]*const Feature { - &feature_leon, - &feature_leonpwrpsr, - }, -}; - -pub const cpu_hypersparc = Cpu{ - .name = "hypersparc", - .llvm_name = "hypersparc", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_leon2 = Cpu{ - .name = "leon2", - .llvm_name = "leon2", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_leon3 = Cpu{ - .name = "leon3", - .llvm_name = "leon3", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_leon4 = Cpu{ - .name = "leon4", - .llvm_name = "leon4", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2080 = Cpu{ - .name = "ma2080", - .llvm_name = "ma2080", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2085 = Cpu{ - .name = "ma2085", - .llvm_name = "ma2085", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2100 = Cpu{ - .name = "ma2100", - .llvm_name = "ma2100", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2150 = Cpu{ - .name = "ma2150", - .llvm_name = "ma2150", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2155 = Cpu{ - .name = "ma2155", - .llvm_name = "ma2155", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2450 = Cpu{ - .name = "ma2450", - .llvm_name = "ma2450", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2455 = Cpu{ - .name = "ma2455", - .llvm_name = "ma2455", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2480 = Cpu{ - .name = "ma2480", - .llvm_name = "ma2480", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2485 = Cpu{ - .name = "ma2485", - .llvm_name = "ma2485", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2x5x = Cpu{ - .name = "ma2x5x", - .llvm_name = "ma2x5x", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_ma2x8x = Cpu{ - .name = "ma2x8x", - .llvm_name = "ma2x8x", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_myriad2 = Cpu{ - .name = "myriad2", - .llvm_name = "myriad2", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_myriad21 = Cpu{ - .name = "myriad21", - .llvm_name = "myriad2.1", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_myriad22 = Cpu{ - .name = "myriad22", - .llvm_name = "myriad2.2", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_myriad23 = Cpu{ - .name = "myriad23", - .llvm_name = "myriad2.3", - .dependencies = &[_]*const Feature { - &feature_leon, - }, -}; - -pub const cpu_niagara = Cpu{ - .name = "niagara", - .llvm_name = "niagara", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - }, -}; - -pub const cpu_niagara2 = Cpu{ - .name = "niagara2", - .llvm_name = "niagara2", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - }, -}; - -pub const cpu_niagara3 = Cpu{ - .name = "niagara3", - .llvm_name = "niagara3", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - }, -}; - -pub const cpu_niagara4 = Cpu{ - .name = "niagara4", - .llvm_name = "niagara4", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - &feature_vis3, - }, -}; - -pub const cpu_sparclet = Cpu{ - .name = "sparclet", - .llvm_name = "sparclet", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_sparclite = Cpu{ - .name = "sparclite", - .llvm_name = "sparclite", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_sparclite86x = Cpu{ - .name = "sparclite86x", - .llvm_name = "sparclite86x", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_supersparc = Cpu{ - .name = "supersparc", - .llvm_name = "supersparc", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_tsc701 = Cpu{ - .name = "tsc701", - .llvm_name = "tsc701", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_ultrasparc = Cpu{ - .name = "ultrasparc", - .llvm_name = "ultrasparc", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - }, -}; - -pub const cpu_ultrasparc3 = Cpu{ - .name = "ultrasparc3", - .llvm_name = "ultrasparc3", - .dependencies = &[_]*const Feature { - &feature_deprecatedV8, - &feature_v9, - &feature_vis, - &feature_vis2, - }, -}; - -pub const cpu_ut699 = Cpu{ - .name = "ut699", - .llvm_name = "ut699", - .dependencies = &[_]*const Feature { - &feature_leon, - &feature_noFmuls, - &feature_noFsmuld, - }, -}; - -pub const cpu_v7 = Cpu{ - .name = "v7", - .llvm_name = "v7", - .dependencies = &[_]*const Feature { - &feature_noFsmuld, - &feature_softMulDiv, - }, -}; - -pub const cpu_v8 = Cpu{ - .name = "v8", - .llvm_name = "v8", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_v9 = Cpu{ - .name = "v9", - .llvm_name = "v9", - .dependencies = &[_]*const Feature { - &feature_v9, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_at697e, - &cpu_at697f, - &cpu_f934, - &cpu_generic, - &cpu_gr712rc, - &cpu_gr740, - &cpu_hypersparc, - &cpu_leon2, - &cpu_leon3, - &cpu_leon4, - &cpu_ma2080, - &cpu_ma2085, - &cpu_ma2100, - &cpu_ma2150, - &cpu_ma2155, - &cpu_ma2450, - &cpu_ma2455, - &cpu_ma2480, - &cpu_ma2485, - &cpu_ma2x5x, - &cpu_ma2x8x, - &cpu_myriad2, - &cpu_myriad21, - &cpu_myriad22, - &cpu_myriad23, - &cpu_niagara, - &cpu_niagara2, - &cpu_niagara3, - &cpu_niagara4, - &cpu_sparclet, - &cpu_sparclite, - &cpu_sparclite86x, - &cpu_supersparc, - &cpu_tsc701, - &cpu_ultrasparc, - &cpu_ultrasparc3, - &cpu_ut699, - &cpu_v7, - &cpu_v8, - &cpu_v9, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + deprecated_v8, + detectroundchange, + fixallfdivsqrt, + hard_quad_float, + hasleoncasa, + hasumacsmac, + insertnopload, + leon, + leoncyclecounter, + leonpwrpsr, + no_fmuls, + no_fsmuld, + popc, + soft_float, + soft_mul_div, + v9, + vis, + vis2, + vis3, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.deprecated_v8)] = .{ + .index = @enumToInt(Feature.deprecated_v8), + .name = @tagName(Feature.deprecated_v8), + .llvm_name = "deprecated-v8", + .description = "Enable deprecated V8 instructions in V9 mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.detectroundchange)] = .{ + .index = @enumToInt(Feature.detectroundchange), + .name = @tagName(Feature.detectroundchange), + .llvm_name = "detectroundchange", + .description = "LEON3 erratum detection: Detects any rounding mode change request: use only the round-to-nearest rounding mode", + .dependencies = 0, + }; + result[@enumToInt(Feature.fixallfdivsqrt)] = .{ + .index = @enumToInt(Feature.fixallfdivsqrt), + .name = @tagName(Feature.fixallfdivsqrt), + .llvm_name = "fixallfdivsqrt", + .description = "LEON erratum fix: Fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store", + .dependencies = 0, + }; + result[@enumToInt(Feature.hard_quad_float)] = .{ + .index = @enumToInt(Feature.hard_quad_float), + .name = @tagName(Feature.hard_quad_float), + .llvm_name = "hard-quad-float", + .description = "Enable quad-word floating point instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.hasleoncasa)] = .{ + .index = @enumToInt(Feature.hasleoncasa), + .name = @tagName(Feature.hasleoncasa), + .llvm_name = "hasleoncasa", + .description = "Enable CASA instruction for LEON3 and LEON4 processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.hasumacsmac)] = .{ + .index = @enumToInt(Feature.hasumacsmac), + .name = @tagName(Feature.hasumacsmac), + .llvm_name = "hasumacsmac", + .description = "Enable UMAC and SMAC for LEON3 and LEON4 processors", + .dependencies = 0, + }; + result[@enumToInt(Feature.insertnopload)] = .{ + .index = @enumToInt(Feature.insertnopload), + .name = @tagName(Feature.insertnopload), + .llvm_name = "insertnopload", + .description = "LEON3 erratum fix: Insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.leon)] = .{ + .index = @enumToInt(Feature.leon), + .name = @tagName(Feature.leon), + .llvm_name = "leon", + .description = "Enable LEON extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.leoncyclecounter)] = .{ + .index = @enumToInt(Feature.leoncyclecounter), + .name = @tagName(Feature.leoncyclecounter), + .llvm_name = "leoncyclecounter", + .description = "Use the Leon cycle counter register", + .dependencies = 0, + }; + result[@enumToInt(Feature.leonpwrpsr)] = .{ + .index = @enumToInt(Feature.leonpwrpsr), + .name = @tagName(Feature.leonpwrpsr), + .llvm_name = "leonpwrpsr", + .description = "Enable the PWRPSR instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_fmuls)] = .{ + .index = @enumToInt(Feature.no_fmuls), + .name = @tagName(Feature.no_fmuls), + .llvm_name = "no-fmuls", + .description = "Disable the fmuls instruction.", + .dependencies = 0, + }; + result[@enumToInt(Feature.no_fsmuld)] = .{ + .index = @enumToInt(Feature.no_fsmuld), + .name = @tagName(Feature.no_fsmuld), + .llvm_name = "no-fsmuld", + .description = "Disable the fsmuld instruction.", + .dependencies = 0, + }; + result[@enumToInt(Feature.popc)] = .{ + .index = @enumToInt(Feature.popc), + .name = @tagName(Feature.popc), + .llvm_name = "popc", + .description = "Use the popc (population count) instruction", + .dependencies = 0, + }; + result[@enumToInt(Feature.soft_float)] = .{ + .index = @enumToInt(Feature.soft_float), + .name = @tagName(Feature.soft_float), + .llvm_name = "soft-float", + .description = "Use software emulation for floating point", + .dependencies = 0, + }; + result[@enumToInt(Feature.soft_mul_div)] = .{ + .index = @enumToInt(Feature.soft_mul_div), + .name = @tagName(Feature.soft_mul_div), + .llvm_name = "soft-mul-div", + .description = "Use software emulation for integer multiply and divide", + .dependencies = 0, + }; + result[@enumToInt(Feature.v9)] = .{ + .index = @enumToInt(Feature.v9), + .name = @tagName(Feature.v9), + .llvm_name = "v9", + .description = "Enable SPARC-V9 instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.vis)] = .{ + .index = @enumToInt(Feature.vis), + .name = @tagName(Feature.vis), + .llvm_name = "vis", + .description = "Enable UltraSPARC Visual Instruction Set extensions", + .dependencies = 0, + }; + result[@enumToInt(Feature.vis2)] = .{ + .index = @enumToInt(Feature.vis2), + .name = @tagName(Feature.vis2), + .llvm_name = "vis2", + .description = "Enable Visual Instruction Set extensions II", + .dependencies = 0, + }; + result[@enumToInt(Feature.vis3)] = .{ + .index = @enumToInt(Feature.vis3), + .name = @tagName(Feature.vis3), + .llvm_name = "vis3", + .description = "Enable Visual Instruction Set extensions III", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const at697e = Cpu{ + .name = "at697e", + .llvm_name = "at697e", + .features = featureSet(&[_]Feature{ + .insertnopload, + .leon, + }), + }; + pub const at697f = Cpu{ + .name = "at697f", + .llvm_name = "at697f", + .features = featureSet(&[_]Feature{ + .insertnopload, + .leon, + }), + }; + pub const f934 = Cpu{ + .name = "f934", + .llvm_name = "f934", + .features = 0, + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const gr712rc = Cpu{ + .name = "gr712rc", + .llvm_name = "gr712rc", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const gr740 = Cpu{ + .name = "gr740", + .llvm_name = "gr740", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .hasumacsmac, + .leon, + .leoncyclecounter, + .leonpwrpsr, + }), + }; + pub const hypersparc = Cpu{ + .name = "hypersparc", + .llvm_name = "hypersparc", + .features = 0, + }; + pub const leon2 = Cpu{ + .name = "leon2", + .llvm_name = "leon2", + .features = featureSet(&[_]Feature{ + .leon, + }), + }; + pub const leon3 = Cpu{ + .name = "leon3", + .llvm_name = "leon3", + .features = featureSet(&[_]Feature{ + .hasumacsmac, + .leon, + }), + }; + pub const leon4 = Cpu{ + .name = "leon4", + .llvm_name = "leon4", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .hasumacsmac, + .leon, + }), + }; + pub const ma2080 = Cpu{ + .name = "ma2080", + .llvm_name = "ma2080", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2085 = Cpu{ + .name = "ma2085", + .llvm_name = "ma2085", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2100 = Cpu{ + .name = "ma2100", + .llvm_name = "ma2100", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2150 = Cpu{ + .name = "ma2150", + .llvm_name = "ma2150", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2155 = Cpu{ + .name = "ma2155", + .llvm_name = "ma2155", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2450 = Cpu{ + .name = "ma2450", + .llvm_name = "ma2450", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2455 = Cpu{ + .name = "ma2455", + .llvm_name = "ma2455", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2480 = Cpu{ + .name = "ma2480", + .llvm_name = "ma2480", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2485 = Cpu{ + .name = "ma2485", + .llvm_name = "ma2485", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2x5x = Cpu{ + .name = "ma2x5x", + .llvm_name = "ma2x5x", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const ma2x8x = Cpu{ + .name = "ma2x8x", + .llvm_name = "ma2x8x", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const myriad2 = Cpu{ + .name = "myriad2", + .llvm_name = "myriad2", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const myriad2_1 = Cpu{ + .name = "myriad2_1", + .llvm_name = "myriad2.1", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const myriad2_2 = Cpu{ + .name = "myriad2_2", + .llvm_name = "myriad2.2", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const myriad2_3 = Cpu{ + .name = "myriad2_3", + .llvm_name = "myriad2.3", + .features = featureSet(&[_]Feature{ + .hasleoncasa, + .leon, + }), + }; + pub const niagara = Cpu{ + .name = "niagara", + .llvm_name = "niagara", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .v9, + .vis, + .vis2, + }), + }; + pub const niagara2 = Cpu{ + .name = "niagara2", + .llvm_name = "niagara2", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .popc, + .v9, + .vis, + .vis2, + }), + }; + pub const niagara3 = Cpu{ + .name = "niagara3", + .llvm_name = "niagara3", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .popc, + .v9, + .vis, + .vis2, + }), + }; + pub const niagara4 = Cpu{ + .name = "niagara4", + .llvm_name = "niagara4", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .popc, + .v9, + .vis, + .vis2, + .vis3, + }), + }; + pub const sparclet = Cpu{ + .name = "sparclet", + .llvm_name = "sparclet", + .features = 0, + }; + pub const sparclite = Cpu{ + .name = "sparclite", + .llvm_name = "sparclite", + .features = 0, + }; + pub const sparclite86x = Cpu{ + .name = "sparclite86x", + .llvm_name = "sparclite86x", + .features = 0, + }; + pub const supersparc = Cpu{ + .name = "supersparc", + .llvm_name = "supersparc", + .features = 0, + }; + pub const tsc701 = Cpu{ + .name = "tsc701", + .llvm_name = "tsc701", + .features = 0, + }; + pub const ultrasparc = Cpu{ + .name = "ultrasparc", + .llvm_name = "ultrasparc", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .v9, + .vis, + }), + }; + pub const ultrasparc3 = Cpu{ + .name = "ultrasparc3", + .llvm_name = "ultrasparc3", + .features = featureSet(&[_]Feature{ + .deprecated_v8, + .v9, + .vis, + .vis2, + }), + }; + pub const ut699 = Cpu{ + .name = "ut699", + .llvm_name = "ut699", + .features = featureSet(&[_]Feature{ + .fixallfdivsqrt, + .insertnopload, + .leon, + .no_fmuls, + .no_fsmuld, + }), + }; + pub const v7 = Cpu{ + .name = "v7", + .llvm_name = "v7", + .features = featureSet(&[_]Feature{ + .no_fsmuld, + .soft_mul_div, + }), + }; + pub const v8 = Cpu{ + .name = "v8", + .llvm_name = "v8", + .features = 0, + }; + pub const v9 = Cpu{ + .name = "v9", + .llvm_name = "v9", + .features = featureSet(&[_]Feature{ + .v9, + }), + }; +}; + +/// All sparc CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.at697e, + &cpu.at697f, + &cpu.f934, + &cpu.generic, + &cpu.gr712rc, + &cpu.gr740, + &cpu.hypersparc, + &cpu.leon2, + &cpu.leon3, + &cpu.leon4, + &cpu.ma2080, + &cpu.ma2085, + &cpu.ma2100, + &cpu.ma2150, + &cpu.ma2155, + &cpu.ma2450, + &cpu.ma2455, + &cpu.ma2480, + &cpu.ma2485, + &cpu.ma2x5x, + &cpu.ma2x8x, + &cpu.myriad2, + &cpu.myriad2_1, + &cpu.myriad2_2, + &cpu.myriad2_3, + &cpu.niagara, + &cpu.niagara2, + &cpu.niagara3, + &cpu.niagara4, + &cpu.sparclet, + &cpu.sparclite, + &cpu.sparclite86x, + &cpu.supersparc, + &cpu.tsc701, + &cpu.ultrasparc, + &cpu.ultrasparc3, + &cpu.ut699, + &cpu.v7, + &cpu.v8, + &cpu.v9, }; diff --git a/lib/std/target/systemz.zig b/lib/std/target/systemz.zig index 1a3f8ec970..3479ebf7b4 100644 --- a/lib/std/target/systemz.zig +++ b/lib/std/target/systemz.zig @@ -1,610 +1,575 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; - -pub const feature_dfpPackedConversion = Feature{ - .name = "dfpPackedConversion", - .llvm_name = "dfp-packed-conversion", - .description = "Assume that the DFP packed-conversion facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_dfpZonedConversion = Feature{ - .name = "dfpZonedConversion", - .llvm_name = "dfp-zoned-conversion", - .description = "Assume that the DFP zoned-conversion facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_deflateConversion = Feature{ - .name = "deflateConversion", - .llvm_name = "deflate-conversion", - .description = "Assume that the deflate-conversion facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_distinctOps = Feature{ - .name = "distinctOps", - .llvm_name = "distinct-ops", - .description = "Assume that the distinct-operands facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_enhancedDat2 = Feature{ - .name = "enhancedDat2", - .llvm_name = "enhanced-dat-2", - .description = "Assume that the enhanced-DAT facility 2 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_enhancedSort = Feature{ - .name = "enhancedSort", - .llvm_name = "enhanced-sort", - .description = "Assume that the enhanced-sort facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_executionHint = Feature{ - .name = "executionHint", - .llvm_name = "execution-hint", - .description = "Assume that the execution-hint facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fpExtension = Feature{ - .name = "fpExtension", - .llvm_name = "fp-extension", - .description = "Assume that the floating-point extension facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_fastSerialization = Feature{ - .name = "fastSerialization", - .llvm_name = "fast-serialization", - .description = "Assume that the fast-serialization facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_guardedStorage = Feature{ - .name = "guardedStorage", - .llvm_name = "guarded-storage", - .description = "Assume that the guarded-storage facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_highWord = Feature{ - .name = "highWord", - .llvm_name = "high-word", - .description = "Assume that the high-word facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_insertReferenceBitsMultiple = Feature{ - .name = "insertReferenceBitsMultiple", - .llvm_name = "insert-reference-bits-multiple", - .description = "Assume that the insert-reference-bits-multiple facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_interlockedAccess1 = Feature{ - .name = "interlockedAccess1", - .llvm_name = "interlocked-access1", - .description = "Assume that interlocked-access facility 1 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loadAndTrap = Feature{ - .name = "loadAndTrap", - .llvm_name = "load-and-trap", - .description = "Assume that the load-and-trap facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loadAndZeroRightmostByte = Feature{ - .name = "loadAndZeroRightmostByte", - .llvm_name = "load-and-zero-rightmost-byte", - .description = "Assume that the load-and-zero-rightmost-byte facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loadStoreOnCond = Feature{ - .name = "loadStoreOnCond", - .llvm_name = "load-store-on-cond", - .description = "Assume that the load/store-on-condition facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_loadStoreOnCond2 = Feature{ - .name = "loadStoreOnCond2", - .llvm_name = "load-store-on-cond-2", - .description = "Assume that the load/store-on-condition facility 2 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension3 = Feature{ - .name = "messageSecurityAssistExtension3", - .llvm_name = "message-security-assist-extension3", - .description = "Assume that the message-security-assist extension facility 3 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension4 = Feature{ - .name = "messageSecurityAssistExtension4", - .llvm_name = "message-security-assist-extension4", - .description = "Assume that the message-security-assist extension facility 4 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension5 = Feature{ - .name = "messageSecurityAssistExtension5", - .llvm_name = "message-security-assist-extension5", - .description = "Assume that the message-security-assist extension facility 5 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension7 = Feature{ - .name = "messageSecurityAssistExtension7", - .llvm_name = "message-security-assist-extension7", - .description = "Assume that the message-security-assist extension facility 7 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension8 = Feature{ - .name = "messageSecurityAssistExtension8", - .llvm_name = "message-security-assist-extension8", - .description = "Assume that the message-security-assist extension facility 8 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_messageSecurityAssistExtension9 = Feature{ - .name = "messageSecurityAssistExtension9", - .llvm_name = "message-security-assist-extension9", - .description = "Assume that the message-security-assist extension facility 9 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_miscellaneousExtensions = Feature{ - .name = "miscellaneousExtensions", - .llvm_name = "miscellaneous-extensions", - .description = "Assume that the miscellaneous-extensions facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_miscellaneousExtensions2 = Feature{ - .name = "miscellaneousExtensions2", - .llvm_name = "miscellaneous-extensions-2", - .description = "Assume that the miscellaneous-extensions facility 2 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_miscellaneousExtensions3 = Feature{ - .name = "miscellaneousExtensions3", - .llvm_name = "miscellaneous-extensions-3", - .description = "Assume that the miscellaneous-extensions facility 3 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_populationCount = Feature{ - .name = "populationCount", - .llvm_name = "population-count", - .description = "Assume that the population-count facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_processorAssist = Feature{ - .name = "processorAssist", - .llvm_name = "processor-assist", - .description = "Assume that the processor-assist facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_resetReferenceBitsMultiple = Feature{ - .name = "resetReferenceBitsMultiple", - .llvm_name = "reset-reference-bits-multiple", - .description = "Assume that the reset-reference-bits-multiple facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_transactionalExecution = Feature{ - .name = "transactionalExecution", - .llvm_name = "transactional-execution", - .description = "Assume that the transactional-execution facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vector = Feature{ - .name = "vector", - .llvm_name = "vector", - .description = "Assume that the vectory facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vectorEnhancements1 = Feature{ - .name = "vectorEnhancements1", - .llvm_name = "vector-enhancements-1", - .description = "Assume that the vector enhancements facility 1 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vectorEnhancements2 = Feature{ - .name = "vectorEnhancements2", - .llvm_name = "vector-enhancements-2", - .description = "Assume that the vector enhancements facility 2 is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vectorPackedDecimal = Feature{ - .name = "vectorPackedDecimal", - .llvm_name = "vector-packed-decimal", - .description = "Assume that the vector packed decimal facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_vectorPackedDecimalEnhancement = Feature{ - .name = "vectorPackedDecimalEnhancement", - .llvm_name = "vector-packed-decimal-enhancement", - .description = "Assume that the vector packed decimal enhancement facility is installed", - .dependencies = &[_]*const Feature { - }, -}; - -pub const features = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_deflateConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_enhancedSort, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_guardedStorage, - &feature_highWord, - &feature_insertReferenceBitsMultiple, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_messageSecurityAssistExtension7, - &feature_messageSecurityAssistExtension8, - &feature_messageSecurityAssistExtension9, - &feature_miscellaneousExtensions, - &feature_miscellaneousExtensions2, - &feature_miscellaneousExtensions3, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - &feature_vectorEnhancements1, - &feature_vectorEnhancements2, - &feature_vectorPackedDecimal, - &feature_vectorPackedDecimalEnhancement, -}; - -pub const cpu_arch10 = Cpu{ - .name = "arch10", - .llvm_name = "arch10", - .dependencies = &[_]*const Feature { - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadStoreOnCond, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_miscellaneousExtensions, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - }, -}; - -pub const cpu_arch11 = Cpu{ - .name = "arch11", - .llvm_name = "arch11", - .dependencies = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_miscellaneousExtensions, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - }, -}; - -pub const cpu_arch12 = Cpu{ - .name = "arch12", - .llvm_name = "arch12", - .dependencies = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_guardedStorage, - &feature_highWord, - &feature_insertReferenceBitsMultiple, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_messageSecurityAssistExtension7, - &feature_messageSecurityAssistExtension8, - &feature_miscellaneousExtensions, - &feature_miscellaneousExtensions2, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - &feature_vectorEnhancements1, - &feature_vectorPackedDecimal, - }, -}; - -pub const cpu_arch13 = Cpu{ - .name = "arch13", - .llvm_name = "arch13", - .dependencies = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_deflateConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_enhancedSort, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_guardedStorage, - &feature_highWord, - &feature_insertReferenceBitsMultiple, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_messageSecurityAssistExtension7, - &feature_messageSecurityAssistExtension8, - &feature_messageSecurityAssistExtension9, - &feature_miscellaneousExtensions, - &feature_miscellaneousExtensions2, - &feature_miscellaneousExtensions3, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - &feature_vectorEnhancements1, - &feature_vectorEnhancements2, - &feature_vectorPackedDecimal, - &feature_vectorPackedDecimalEnhancement, - }, -}; - -pub const cpu_arch8 = Cpu{ - .name = "arch8", - .llvm_name = "arch8", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_arch9 = Cpu{ - .name = "arch9", - .llvm_name = "arch9", - .dependencies = &[_]*const Feature { - &feature_distinctOps, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadStoreOnCond, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_populationCount, - &feature_resetReferenceBitsMultiple, - }, -}; - -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_z10 = Cpu{ - .name = "z10", - .llvm_name = "z10", - .dependencies = &[_]*const Feature { - }, -}; - -pub const cpu_z13 = Cpu{ - .name = "z13", - .llvm_name = "z13", - .dependencies = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_miscellaneousExtensions, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - }, -}; - -pub const cpu_z14 = Cpu{ - .name = "z14", - .llvm_name = "z14", - .dependencies = &[_]*const Feature { - &feature_dfpPackedConversion, - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_guardedStorage, - &feature_highWord, - &feature_insertReferenceBitsMultiple, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadAndZeroRightmostByte, - &feature_loadStoreOnCond, - &feature_loadStoreOnCond2, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_messageSecurityAssistExtension5, - &feature_messageSecurityAssistExtension7, - &feature_messageSecurityAssistExtension8, - &feature_miscellaneousExtensions, - &feature_miscellaneousExtensions2, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - &feature_vector, - &feature_vectorEnhancements1, - &feature_vectorPackedDecimal, - }, -}; - -pub const cpu_z196 = Cpu{ - .name = "z196", - .llvm_name = "z196", - .dependencies = &[_]*const Feature { - &feature_distinctOps, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadStoreOnCond, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_populationCount, - &feature_resetReferenceBitsMultiple, - }, -}; - -pub const cpu_zEC12 = Cpu{ - .name = "zEC12", - .llvm_name = "zEC12", - .dependencies = &[_]*const Feature { - &feature_dfpZonedConversion, - &feature_distinctOps, - &feature_enhancedDat2, - &feature_executionHint, - &feature_fpExtension, - &feature_fastSerialization, - &feature_highWord, - &feature_interlockedAccess1, - &feature_loadAndTrap, - &feature_loadStoreOnCond, - &feature_messageSecurityAssistExtension3, - &feature_messageSecurityAssistExtension4, - &feature_miscellaneousExtensions, - &feature_populationCount, - &feature_processorAssist, - &feature_resetReferenceBitsMultiple, - &feature_transactionalExecution, - }, -}; - -pub const cpus = &[_]*const Cpu { - &cpu_arch10, - &cpu_arch11, - &cpu_arch12, - &cpu_arch13, - &cpu_arch8, - &cpu_arch9, - &cpu_generic, - &cpu_z10, - &cpu_z13, - &cpu_z14, - &cpu_z196, - &cpu_zEC12, +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; + +pub const Feature = enum { + deflate_conversion, + dfp_packed_conversion, + dfp_zoned_conversion, + distinct_ops, + enhanced_dat_2, + enhanced_sort, + execution_hint, + fast_serialization, + fp_extension, + guarded_storage, + high_word, + insert_reference_bits_multiple, + interlocked_access1, + load_and_trap, + load_and_zero_rightmost_byte, + load_store_on_cond, + load_store_on_cond_2, + message_security_assist_extension3, + message_security_assist_extension4, + message_security_assist_extension5, + message_security_assist_extension7, + message_security_assist_extension8, + message_security_assist_extension9, + miscellaneous_extensions, + miscellaneous_extensions_2, + miscellaneous_extensions_3, + population_count, + processor_assist, + reset_reference_bits_multiple, + transactional_execution, + vector, + vector_enhancements_1, + vector_enhancements_2, + vector_packed_decimal, + vector_packed_decimal_enhancement, +}; + +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); + +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.deflate_conversion)] = .{ + .index = @enumToInt(Feature.deflate_conversion), + .name = @tagName(Feature.deflate_conversion), + .llvm_name = "deflate-conversion", + .description = "Assume that the deflate-conversion facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.dfp_packed_conversion)] = .{ + .index = @enumToInt(Feature.dfp_packed_conversion), + .name = @tagName(Feature.dfp_packed_conversion), + .llvm_name = "dfp-packed-conversion", + .description = "Assume that the DFP packed-conversion facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.dfp_zoned_conversion)] = .{ + .index = @enumToInt(Feature.dfp_zoned_conversion), + .name = @tagName(Feature.dfp_zoned_conversion), + .llvm_name = "dfp-zoned-conversion", + .description = "Assume that the DFP zoned-conversion facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.distinct_ops)] = .{ + .index = @enumToInt(Feature.distinct_ops), + .name = @tagName(Feature.distinct_ops), + .llvm_name = "distinct-ops", + .description = "Assume that the distinct-operands facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.enhanced_dat_2)] = .{ + .index = @enumToInt(Feature.enhanced_dat_2), + .name = @tagName(Feature.enhanced_dat_2), + .llvm_name = "enhanced-dat-2", + .description = "Assume that the enhanced-DAT facility 2 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.enhanced_sort)] = .{ + .index = @enumToInt(Feature.enhanced_sort), + .name = @tagName(Feature.enhanced_sort), + .llvm_name = "enhanced-sort", + .description = "Assume that the enhanced-sort facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.execution_hint)] = .{ + .index = @enumToInt(Feature.execution_hint), + .name = @tagName(Feature.execution_hint), + .llvm_name = "execution-hint", + .description = "Assume that the execution-hint facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.fast_serialization)] = .{ + .index = @enumToInt(Feature.fast_serialization), + .name = @tagName(Feature.fast_serialization), + .llvm_name = "fast-serialization", + .description = "Assume that the fast-serialization facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.fp_extension)] = .{ + .index = @enumToInt(Feature.fp_extension), + .name = @tagName(Feature.fp_extension), + .llvm_name = "fp-extension", + .description = "Assume that the floating-point extension facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.guarded_storage)] = .{ + .index = @enumToInt(Feature.guarded_storage), + .name = @tagName(Feature.guarded_storage), + .llvm_name = "guarded-storage", + .description = "Assume that the guarded-storage facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.high_word)] = .{ + .index = @enumToInt(Feature.high_word), + .name = @tagName(Feature.high_word), + .llvm_name = "high-word", + .description = "Assume that the high-word facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.insert_reference_bits_multiple)] = .{ + .index = @enumToInt(Feature.insert_reference_bits_multiple), + .name = @tagName(Feature.insert_reference_bits_multiple), + .llvm_name = "insert-reference-bits-multiple", + .description = "Assume that the insert-reference-bits-multiple facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.interlocked_access1)] = .{ + .index = @enumToInt(Feature.interlocked_access1), + .name = @tagName(Feature.interlocked_access1), + .llvm_name = "interlocked-access1", + .description = "Assume that interlocked-access facility 1 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.load_and_trap)] = .{ + .index = @enumToInt(Feature.load_and_trap), + .name = @tagName(Feature.load_and_trap), + .llvm_name = "load-and-trap", + .description = "Assume that the load-and-trap facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.load_and_zero_rightmost_byte)] = .{ + .index = @enumToInt(Feature.load_and_zero_rightmost_byte), + .name = @tagName(Feature.load_and_zero_rightmost_byte), + .llvm_name = "load-and-zero-rightmost-byte", + .description = "Assume that the load-and-zero-rightmost-byte facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.load_store_on_cond)] = .{ + .index = @enumToInt(Feature.load_store_on_cond), + .name = @tagName(Feature.load_store_on_cond), + .llvm_name = "load-store-on-cond", + .description = "Assume that the load/store-on-condition facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.load_store_on_cond_2)] = .{ + .index = @enumToInt(Feature.load_store_on_cond_2), + .name = @tagName(Feature.load_store_on_cond_2), + .llvm_name = "load-store-on-cond-2", + .description = "Assume that the load/store-on-condition facility 2 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension3)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension3), + .name = @tagName(Feature.message_security_assist_extension3), + .llvm_name = "message-security-assist-extension3", + .description = "Assume that the message-security-assist extension facility 3 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension4)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension4), + .name = @tagName(Feature.message_security_assist_extension4), + .llvm_name = "message-security-assist-extension4", + .description = "Assume that the message-security-assist extension facility 4 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension5)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension5), + .name = @tagName(Feature.message_security_assist_extension5), + .llvm_name = "message-security-assist-extension5", + .description = "Assume that the message-security-assist extension facility 5 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension7)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension7), + .name = @tagName(Feature.message_security_assist_extension7), + .llvm_name = "message-security-assist-extension7", + .description = "Assume that the message-security-assist extension facility 7 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension8)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension8), + .name = @tagName(Feature.message_security_assist_extension8), + .llvm_name = "message-security-assist-extension8", + .description = "Assume that the message-security-assist extension facility 8 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.message_security_assist_extension9)] = .{ + .index = @enumToInt(Feature.message_security_assist_extension9), + .name = @tagName(Feature.message_security_assist_extension9), + .llvm_name = "message-security-assist-extension9", + .description = "Assume that the message-security-assist extension facility 9 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.miscellaneous_extensions)] = .{ + .index = @enumToInt(Feature.miscellaneous_extensions), + .name = @tagName(Feature.miscellaneous_extensions), + .llvm_name = "miscellaneous-extensions", + .description = "Assume that the miscellaneous-extensions facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.miscellaneous_extensions_2)] = .{ + .index = @enumToInt(Feature.miscellaneous_extensions_2), + .name = @tagName(Feature.miscellaneous_extensions_2), + .llvm_name = "miscellaneous-extensions-2", + .description = "Assume that the miscellaneous-extensions facility 2 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.miscellaneous_extensions_3)] = .{ + .index = @enumToInt(Feature.miscellaneous_extensions_3), + .name = @tagName(Feature.miscellaneous_extensions_3), + .llvm_name = "miscellaneous-extensions-3", + .description = "Assume that the miscellaneous-extensions facility 3 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.population_count)] = .{ + .index = @enumToInt(Feature.population_count), + .name = @tagName(Feature.population_count), + .llvm_name = "population-count", + .description = "Assume that the population-count facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.processor_assist)] = .{ + .index = @enumToInt(Feature.processor_assist), + .name = @tagName(Feature.processor_assist), + .llvm_name = "processor-assist", + .description = "Assume that the processor-assist facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.reset_reference_bits_multiple)] = .{ + .index = @enumToInt(Feature.reset_reference_bits_multiple), + .name = @tagName(Feature.reset_reference_bits_multiple), + .llvm_name = "reset-reference-bits-multiple", + .description = "Assume that the reset-reference-bits-multiple facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.transactional_execution)] = .{ + .index = @enumToInt(Feature.transactional_execution), + .name = @tagName(Feature.transactional_execution), + .llvm_name = "transactional-execution", + .description = "Assume that the transactional-execution facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.vector)] = .{ + .index = @enumToInt(Feature.vector), + .name = @tagName(Feature.vector), + .llvm_name = "vector", + .description = "Assume that the vectory facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.vector_enhancements_1)] = .{ + .index = @enumToInt(Feature.vector_enhancements_1), + .name = @tagName(Feature.vector_enhancements_1), + .llvm_name = "vector-enhancements-1", + .description = "Assume that the vector enhancements facility 1 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.vector_enhancements_2)] = .{ + .index = @enumToInt(Feature.vector_enhancements_2), + .name = @tagName(Feature.vector_enhancements_2), + .llvm_name = "vector-enhancements-2", + .description = "Assume that the vector enhancements facility 2 is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.vector_packed_decimal)] = .{ + .index = @enumToInt(Feature.vector_packed_decimal), + .name = @tagName(Feature.vector_packed_decimal), + .llvm_name = "vector-packed-decimal", + .description = "Assume that the vector packed decimal facility is installed", + .dependencies = 0, + }; + result[@enumToInt(Feature.vector_packed_decimal_enhancement)] = .{ + .index = @enumToInt(Feature.vector_packed_decimal_enhancement), + .name = @tagName(Feature.vector_packed_decimal_enhancement), + .llvm_name = "vector-packed-decimal-enhancement", + .description = "Assume that the vector packed decimal enhancement facility is installed", + .dependencies = 0, + }; + break :blk result; +}; + +pub const cpu = struct { + pub const arch10 = Cpu{ + .name = "arch10", + .llvm_name = "arch10", + .features = featureSet(&[_]Feature{ + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_and_trap, + .load_store_on_cond, + .message_security_assist_extension3, + .message_security_assist_extension4, + .miscellaneous_extensions, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + }), + }; + pub const arch11 = Cpu{ + .name = "arch11", + .llvm_name = "arch11", + .features = featureSet(&[_]Feature{ + .dfp_packed_conversion, + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_and_trap, + .load_and_zero_rightmost_byte, + .load_store_on_cond, + .load_store_on_cond_2, + .message_security_assist_extension3, + .message_security_assist_extension4, + .message_security_assist_extension5, + .miscellaneous_extensions, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + .vector, + }), + }; + pub const arch12 = Cpu{ + .name = "arch12", + .llvm_name = "arch12", + .features = featureSet(&[_]Feature{ + .dfp_packed_conversion, + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .guarded_storage, + .high_word, + .insert_reference_bits_multiple, + .interlocked_access1, + .load_and_trap, + .load_and_zero_rightmost_byte, + .load_store_on_cond, + .load_store_on_cond_2, + .message_security_assist_extension3, + .message_security_assist_extension4, + .message_security_assist_extension5, + .message_security_assist_extension7, + .message_security_assist_extension8, + .miscellaneous_extensions, + .miscellaneous_extensions_2, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + .vector, + .vector_enhancements_1, + .vector_packed_decimal, + }), + }; + pub const arch13 = Cpu{ + .name = "arch13", + .llvm_name = "arch13", + .features = featureSet(&[_]Feature{ + .deflate_conversion, + .dfp_packed_conversion, + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .enhanced_sort, + .execution_hint, + .fast_serialization, + .fp_extension, + .guarded_storage, + .high_word, + .insert_reference_bits_multiple, + .interlocked_access1, + .load_and_trap, + .load_and_zero_rightmost_byte, + .load_store_on_cond, + .load_store_on_cond_2, + .message_security_assist_extension3, + .message_security_assist_extension4, + .message_security_assist_extension5, + .message_security_assist_extension7, + .message_security_assist_extension8, + .message_security_assist_extension9, + .miscellaneous_extensions, + .miscellaneous_extensions_2, + .miscellaneous_extensions_3, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + .vector, + .vector_enhancements_1, + .vector_enhancements_2, + .vector_packed_decimal, + .vector_packed_decimal_enhancement, + }), + }; + pub const arch8 = Cpu{ + .name = "arch8", + .llvm_name = "arch8", + .features = 0, + }; + pub const arch9 = Cpu{ + .name = "arch9", + .llvm_name = "arch9", + .features = featureSet(&[_]Feature{ + .distinct_ops, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_store_on_cond, + .message_security_assist_extension3, + .message_security_assist_extension4, + .population_count, + .reset_reference_bits_multiple, + }), + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const z10 = Cpu{ + .name = "z10", + .llvm_name = "z10", + .features = 0, + }; + pub const z13 = Cpu{ + .name = "z13", + .llvm_name = "z13", + .features = featureSet(&[_]Feature{ + .dfp_packed_conversion, + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_and_trap, + .load_and_zero_rightmost_byte, + .load_store_on_cond, + .load_store_on_cond_2, + .message_security_assist_extension3, + .message_security_assist_extension4, + .message_security_assist_extension5, + .miscellaneous_extensions, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + .vector, + }), + }; + pub const z14 = Cpu{ + .name = "z14", + .llvm_name = "z14", + .features = featureSet(&[_]Feature{ + .dfp_packed_conversion, + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .guarded_storage, + .high_word, + .insert_reference_bits_multiple, + .interlocked_access1, + .load_and_trap, + .load_and_zero_rightmost_byte, + .load_store_on_cond, + .load_store_on_cond_2, + .message_security_assist_extension3, + .message_security_assist_extension4, + .message_security_assist_extension5, + .message_security_assist_extension7, + .message_security_assist_extension8, + .miscellaneous_extensions, + .miscellaneous_extensions_2, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + .vector, + .vector_enhancements_1, + .vector_packed_decimal, + }), + }; + pub const z196 = Cpu{ + .name = "z196", + .llvm_name = "z196", + .features = featureSet(&[_]Feature{ + .distinct_ops, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_store_on_cond, + .message_security_assist_extension3, + .message_security_assist_extension4, + .population_count, + .reset_reference_bits_multiple, + }), + }; + pub const zEC12 = Cpu{ + .name = "zEC12", + .llvm_name = "zEC12", + .features = featureSet(&[_]Feature{ + .dfp_zoned_conversion, + .distinct_ops, + .enhanced_dat_2, + .execution_hint, + .fast_serialization, + .fp_extension, + .high_word, + .interlocked_access1, + .load_and_trap, + .load_store_on_cond, + .message_security_assist_extension3, + .message_security_assist_extension4, + .miscellaneous_extensions, + .population_count, + .processor_assist, + .reset_reference_bits_multiple, + .transactional_execution, + }), + }; +}; + +/// All systemz CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.arch10, + &cpu.arch11, + &cpu.arch12, + &cpu.arch13, + &cpu.arch8, + &cpu.arch9, + &cpu.generic, + &cpu.z10, + &cpu.z13, + &cpu.z14, + &cpu.z196, + &cpu.zEC12, }; diff --git a/lib/std/target/wasm.zig b/lib/std/target/wasm.zig index 61df1820b5..8546b067dd 100644 --- a/lib/std/target/wasm.zig +++ b/lib/std/target/wasm.zig @@ -1,128 +1,129 @@ -const Feature = @import("std").target.Feature; -const Cpu = @import("std").target.Cpu; +const std = @import("../std.zig"); +const Cpu = std.Target.Cpu; -pub const feature_atomics = Feature{ - .name = "atomics", - .llvm_name = "atomics", - .description = "Enable Atomics", - .dependencies = &[_]*const Feature { - }, +pub const Feature = enum { + atomics, + bulk_memory, + exception_handling, + multivalue, + mutable_globals, + nontrapping_fptoint, + sign_ext, + simd128, + tail_call, + unimplemented_simd128, }; -pub const feature_bulkMemory = Feature{ - .name = "bulkMemory", - .llvm_name = "bulk-memory", - .description = "Enable bulk memory operations", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_exceptionHandling = Feature{ - .name = "exceptionHandling", - .llvm_name = "exception-handling", - .description = "Enable Wasm exception handling", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_multivalue = Feature{ - .name = "multivalue", - .llvm_name = "multivalue", - .description = "Enable multivalue blocks, instructions, and functions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_mutableGlobals = Feature{ - .name = "mutableGlobals", - .llvm_name = "mutable-globals", - .description = "Enable mutable globals", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_nontrappingFptoint = Feature{ - .name = "nontrappingFptoint", - .llvm_name = "nontrapping-fptoint", - .description = "Enable non-trapping float-to-int conversion operators", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_simd128 = Feature{ - .name = "simd128", - .llvm_name = "simd128", - .description = "Enable 128-bit SIMD", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_signExt = Feature{ - .name = "signExt", - .llvm_name = "sign-ext", - .description = "Enable sign extension operators", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_tailCall = Feature{ - .name = "tailCall", - .llvm_name = "tail-call", - .description = "Enable tail call instructions", - .dependencies = &[_]*const Feature { - }, -}; - -pub const feature_unimplementedSimd128 = Feature{ - .name = "unimplementedSimd128", - .llvm_name = "unimplemented-simd128", - .description = "Enable 128-bit SIMD not yet implemented in engines", - .dependencies = &[_]*const Feature { - &feature_simd128, - }, -}; - -pub const features = &[_]*const Feature { - &feature_atomics, - &feature_bulkMemory, - &feature_exceptionHandling, - &feature_multivalue, - &feature_mutableGlobals, - &feature_nontrappingFptoint, - &feature_simd128, - &feature_signExt, - &feature_tailCall, - &feature_unimplementedSimd128, -}; - -pub const cpu_bleedingEdge = Cpu{ - .name = "bleedingEdge", - .llvm_name = "bleeding-edge", - .dependencies = &[_]*const Feature { - &feature_atomics, - &feature_mutableGlobals, - &feature_nontrappingFptoint, - &feature_simd128, - &feature_signExt, - }, -}; +pub usingnamespace Cpu.Feature.feature_set_fns(Feature); -pub const cpu_generic = Cpu{ - .name = "generic", - .llvm_name = "generic", - .dependencies = &[_]*const Feature { - }, +pub const all_features = blk: { + const len = @typeInfo(Feature).Enum.fields.len; + std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); + var result: [len]Cpu.Feature = undefined; + result[@enumToInt(Feature.atomics)] = .{ + .index = @enumToInt(Feature.atomics), + .name = @tagName(Feature.atomics), + .llvm_name = "atomics", + .description = "Enable Atomics", + .dependencies = 0, + }; + result[@enumToInt(Feature.bulk_memory)] = .{ + .index = @enumToInt(Feature.bulk_memory), + .name = @tagName(Feature.bulk_memory), + .llvm_name = "bulk-memory", + .description = "Enable bulk memory operations", + .dependencies = 0, + }; + result[@enumToInt(Feature.exception_handling)] = .{ + .index = @enumToInt(Feature.exception_handling), + .name = @tagName(Feature.exception_handling), + .llvm_name = "exception-handling", + .description = "Enable Wasm exception handling", + .dependencies = 0, + }; + result[@enumToInt(Feature.multivalue)] = .{ + .index = @enumToInt(Feature.multivalue), + .name = @tagName(Feature.multivalue), + .llvm_name = "multivalue", + .description = "Enable multivalue blocks, instructions, and functions", + .dependencies = 0, + }; + result[@enumToInt(Feature.mutable_globals)] = .{ + .index = @enumToInt(Feature.mutable_globals), + .name = @tagName(Feature.mutable_globals), + .llvm_name = "mutable-globals", + .description = "Enable mutable globals", + .dependencies = 0, + }; + result[@enumToInt(Feature.nontrapping_fptoint)] = .{ + .index = @enumToInt(Feature.nontrapping_fptoint), + .name = @tagName(Feature.nontrapping_fptoint), + .llvm_name = "nontrapping-fptoint", + .description = "Enable non-trapping float-to-int conversion operators", + .dependencies = 0, + }; + result[@enumToInt(Feature.sign_ext)] = .{ + .index = @enumToInt(Feature.sign_ext), + .name = @tagName(Feature.sign_ext), + .llvm_name = "sign-ext", + .description = "Enable sign extension operators", + .dependencies = 0, + }; + result[@enumToInt(Feature.simd128)] = .{ + .index = @enumToInt(Feature.simd128), + .name = @tagName(Feature.simd128), + .llvm_name = "simd128", + .description = "Enable 128-bit SIMD", + .dependencies = 0, + }; + result[@enumToInt(Feature.tail_call)] = .{ + .index = @enumToInt(Feature.tail_call), + .name = @tagName(Feature.tail_call), + .llvm_name = "tail-call", + .description = "Enable tail call instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.unimplemented_simd128)] = .{ + .index = @enumToInt(Feature.unimplemented_simd128), + .name = @tagName(Feature.unimplemented_simd128), + .llvm_name = "unimplemented-simd128", + .description = "Enable 128-bit SIMD not yet implemented in engines", + .dependencies = featureSet(&[_]Feature{ + .simd128, + }), + }; + break :blk result; }; -pub const cpu_mvp = Cpu{ - .name = "mvp", - .llvm_name = "mvp", - .dependencies = &[_]*const Feature { - }, +pub const cpu = struct { + pub const bleeding_edge = Cpu{ + .name = "bleeding_edge", + .llvm_name = "bleeding-edge", + .features = featureSet(&[_]Feature{ + .atomics, + .mutable_globals, + .nontrapping_fptoint, + .sign_ext, + .simd128, + }), + }; + pub const generic = Cpu{ + .name = "generic", + .llvm_name = "generic", + .features = 0, + }; + pub const mvp = Cpu{ + .name = "mvp", + .llvm_name = "mvp", + .features = 0, + }; }; -pub const cpus = &[_]*const Cpu { - &cpu_bleedingEdge, - &cpu_generic, - &cpu_mvp, +/// All wasm CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. +pub const all_cpus = &[_]*const Cpu{ + &cpu.bleeding_edge, + &cpu.generic, + &cpu.mvp, }; diff --git a/lib/std/target/x86.zig b/lib/std/target/x86.zig index 50b332f5e1..9d3b574401 100644 --- a/lib/std/target/x86.zig +++ b/lib/std/target/x86.zig @@ -108,12 +108,12 @@ pub const Feature = enum { slow_unaligned_mem_32, soft_float, sse, + sse_unaligned_mem, sse2, sse3, sse4_1, sse4_2, sse4a, - sse_unaligned_mem, ssse3, tbm, vaes, @@ -134,7 +134,6 @@ pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; std.debug.assert(len <= @typeInfo(Cpu.Feature.Set).Int.bits); var result: [len]Cpu.Feature = undefined; - result[@enumToInt(Feature.@"16bit_mode")] = .{ .index = @enumToInt(Feature.@"16bit_mode"), .name = @tagName(Feature.@"16bit_mode"), @@ -142,7 +141,6 @@ pub const all_features = blk: { .description = "16-bit mode (i8086)", .dependencies = 0, }; - result[@enumToInt(Feature.@"32bit_mode")] = .{ .index = @enumToInt(Feature.@"32bit_mode"), .name = @tagName(Feature.@"32bit_mode"), @@ -150,7 +148,6 @@ pub const all_features = blk: { .description = "32-bit mode (80386)", .dependencies = 0, }; - result[@enumToInt(Feature.@"3dnow")] = .{ .index = @enumToInt(Feature.@"3dnow"), .name = @tagName(Feature.@"3dnow"), @@ -160,17 +157,15 @@ pub const all_features = blk: { .mmx, }), }; - result[@enumToInt(Feature.@"3dnowa")] = .{ .index = @enumToInt(Feature.@"3dnowa"), .name = @tagName(Feature.@"3dnowa"), .llvm_name = "3dnowa", .description = "Enable 3DNow! Athlon instructions", .dependencies = featureSet(&[_]Feature{ - .mmx, + .@"3dnow", }), }; - result[@enumToInt(Feature.@"64bit")] = .{ .index = @enumToInt(Feature.@"64bit"), .name = @tagName(Feature.@"64bit"), @@ -178,7 +173,6 @@ pub const all_features = blk: { .description = "Support 64-bit instructions", .dependencies = 0, }; - result[@enumToInt(Feature.@"64bit_mode")] = .{ .index = @enumToInt(Feature.@"64bit_mode"), .name = @tagName(Feature.@"64bit_mode"), @@ -186,167 +180,233 @@ pub const all_features = blk: { .description = "64-bit mode (x86_64)", .dependencies = 0, }; - result[@enumToInt(Feature.adx)] = .{ .index = @enumToInt(Feature.adx), .name = @tagName(Feature.adx), .llvm_name = "adx", .description = "Support ADX instructions", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.aes)] = .{ .index = @enumToInt(Feature.aes), .name = @tagName(Feature.aes), .llvm_name = "aes", .description = "Enable AES instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse2, }), }; - result[@enumToInt(Feature.avx)] = .{ .index = @enumToInt(Feature.avx), .name = @tagName(Feature.avx), .llvm_name = "avx", .description = "Enable AVX instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse4_2, }), }; - result[@enumToInt(Feature.avx2)] = .{ .index = @enumToInt(Feature.avx2), .name = @tagName(Feature.avx2), .llvm_name = "avx2", .description = "Enable AVX2 instructions", .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.avx512f)] = .{ - .index = @enumToInt(Feature.avx512f), - .name = @tagName(Feature.avx512f), - .llvm_name = "avx512f", - .description = "Enable AVX-512 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, + .avx, }), }; - result[@enumToInt(Feature.avx512bf16)] = .{ .index = @enumToInt(Feature.avx512bf16), .name = @tagName(Feature.avx512bf16), .llvm_name = "avx512bf16", .description = "Support bfloat16 floating point", .dependencies = featureSet(&[_]Feature{ - .sse, + .avx512bw, }), }; - result[@enumToInt(Feature.avx512bitalg)] = .{ .index = @enumToInt(Feature.avx512bitalg), .name = @tagName(Feature.avx512bitalg), .llvm_name = "avx512bitalg", .description = "Enable AVX-512 Bit Algorithms", .dependencies = featureSet(&[_]Feature{ - .sse, + .avx512bw, + }), + }; + result[@enumToInt(Feature.avx512bw)] = .{ + .index = @enumToInt(Feature.avx512bw), + .name = @tagName(Feature.avx512bw), + .llvm_name = "avx512bw", + .description = "Enable AVX-512 Byte and Word Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512cd)] = .{ + .index = @enumToInt(Feature.avx512cd), + .name = @tagName(Feature.avx512cd), + .llvm_name = "avx512cd", + .description = "Enable AVX-512 Conflict Detection Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512dq)] = .{ + .index = @enumToInt(Feature.avx512dq), + .name = @tagName(Feature.avx512dq), + .llvm_name = "avx512dq", + .description = "Enable AVX-512 Doubleword and Quadword Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512er)] = .{ + .index = @enumToInt(Feature.avx512er), + .name = @tagName(Feature.avx512er), + .llvm_name = "avx512er", + .description = "Enable AVX-512 Exponential and Reciprocal Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512f)] = .{ + .index = @enumToInt(Feature.avx512f), + .name = @tagName(Feature.avx512f), + .llvm_name = "avx512f", + .description = "Enable AVX-512 instructions", + .dependencies = featureSet(&[_]Feature{ + .avx2, + .f16c, + .fma, + }), + }; + result[@enumToInt(Feature.avx512ifma)] = .{ + .index = @enumToInt(Feature.avx512ifma), + .name = @tagName(Feature.avx512ifma), + .llvm_name = "avx512ifma", + .description = "Enable AVX-512 Integer Fused Multiple-Add", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512pf)] = .{ + .index = @enumToInt(Feature.avx512pf), + .name = @tagName(Feature.avx512pf), + .llvm_name = "avx512pf", + .description = "Enable AVX-512 PreFetch Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512vbmi)] = .{ + .index = @enumToInt(Feature.avx512vbmi), + .name = @tagName(Feature.avx512vbmi), + .llvm_name = "avx512vbmi", + .description = "Enable AVX-512 Vector Byte Manipulation Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512bw, + }), + }; + result[@enumToInt(Feature.avx512vbmi2)] = .{ + .index = @enumToInt(Feature.avx512vbmi2), + .name = @tagName(Feature.avx512vbmi2), + .llvm_name = "avx512vbmi2", + .description = "Enable AVX-512 further Vector Byte Manipulation Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512bw, + }), + }; + result[@enumToInt(Feature.avx512vl)] = .{ + .index = @enumToInt(Feature.avx512vl), + .name = @tagName(Feature.avx512vl), + .llvm_name = "avx512vl", + .description = "Enable AVX-512 Vector Length eXtensions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512vnni)] = .{ + .index = @enumToInt(Feature.avx512vnni), + .name = @tagName(Feature.avx512vnni), + .llvm_name = "avx512vnni", + .description = "Enable AVX-512 Vector Neural Network Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512vp2intersect)] = .{ + .index = @enumToInt(Feature.avx512vp2intersect), + .name = @tagName(Feature.avx512vp2intersect), + .llvm_name = "avx512vp2intersect", + .description = "Enable AVX-512 vp2intersect", + .dependencies = featureSet(&[_]Feature{ + .avx512f, + }), + }; + result[@enumToInt(Feature.avx512vpopcntdq)] = .{ + .index = @enumToInt(Feature.avx512vpopcntdq), + .name = @tagName(Feature.avx512vpopcntdq), + .llvm_name = "avx512vpopcntdq", + .description = "Enable AVX-512 Population Count Instructions", + .dependencies = featureSet(&[_]Feature{ + .avx512f, }), }; - result[@enumToInt(Feature.bmi)] = .{ .index = @enumToInt(Feature.bmi), .name = @tagName(Feature.bmi), .llvm_name = "bmi", .description = "Support BMI instructions", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.bmi2)] = .{ .index = @enumToInt(Feature.bmi2), .name = @tagName(Feature.bmi2), .llvm_name = "bmi2", .description = "Support BMI2 instructions", - .dependencies = featureSet(&[_]Feature{}), - }; - - result[@enumToInt(Feature.avx512bw)] = .{ - .index = @enumToInt(Feature.avx512bw), - .name = @tagName(Feature.avx512bw), - .llvm_name = "avx512bw", - .description = "Enable AVX-512 Byte and Word Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), + .dependencies = 0, }; - result[@enumToInt(Feature.branchfusion)] = .{ .index = @enumToInt(Feature.branchfusion), .name = @tagName(Feature.branchfusion), .llvm_name = "branchfusion", .description = "CMP/TEST can be fused with conditional branches", - .dependencies = featureSet(&[_]Feature{}), - }; - - result[@enumToInt(Feature.avx512cd)] = .{ - .index = @enumToInt(Feature.avx512cd), - .name = @tagName(Feature.avx512cd), - .llvm_name = "avx512cd", - .description = "Enable AVX-512 Conflict Detection Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), + .dependencies = 0, }; - result[@enumToInt(Feature.cldemote)] = .{ .index = @enumToInt(Feature.cldemote), .name = @tagName(Feature.cldemote), .llvm_name = "cldemote", .description = "Enable Cache Demote", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.clflushopt)] = .{ .index = @enumToInt(Feature.clflushopt), .name = @tagName(Feature.clflushopt), .llvm_name = "clflushopt", .description = "Flush A Cache Line Optimized", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.clwb)] = .{ .index = @enumToInt(Feature.clwb), .name = @tagName(Feature.clwb), .llvm_name = "clwb", .description = "Cache Line Write Back", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.clzero)] = .{ .index = @enumToInt(Feature.clzero), .name = @tagName(Feature.clzero), .llvm_name = "clzero", .description = "Enable Cache Line Zero", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.cmov)] = .{ .index = @enumToInt(Feature.cmov), .name = @tagName(Feature.cmov), .llvm_name = "cmov", .description = "Enable conditional move instructions", - .dependencies = featureSet(&[_]Feature{}), - }; - - result[@enumToInt(Feature.cx8)] = .{ - .index = @enumToInt(Feature.cx8), - .name = @tagName(Feature.cx8), - .llvm_name = "cx8", - .description = "Support CMPXCHG8B instructions", - .dependencies = featureSet(&[_]Feature{}), + .dependencies = 0, }; - result[@enumToInt(Feature.cx16)] = .{ .index = @enumToInt(Feature.cx16), .name = @tagName(Feature.cx16), @@ -356,17 +416,13 @@ pub const all_features = blk: { .cx8, }), }; - - result[@enumToInt(Feature.avx512dq)] = .{ - .index = @enumToInt(Feature.avx512dq), - .name = @tagName(Feature.avx512dq), - .llvm_name = "avx512dq", - .description = "Enable AVX-512 Doubleword and Quadword Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), + result[@enumToInt(Feature.cx8)] = .{ + .index = @enumToInt(Feature.cx8), + .name = @tagName(Feature.cx8), + .llvm_name = "cx8", + .description = "Support CMPXCHG8B instructions", + .dependencies = 0, }; - result[@enumToInt(Feature.enqcmd)] = .{ .index = @enumToInt(Feature.enqcmd), .name = @tagName(Feature.enqcmd), @@ -374,17 +430,6 @@ pub const all_features = blk: { .description = "Has ENQCMD instructions", .dependencies = 0, }; - - result[@enumToInt(Feature.avx512er)] = .{ - .index = @enumToInt(Feature.avx512er), - .name = @tagName(Feature.avx512er), - .llvm_name = "avx512er", - .description = "Enable AVX-512 Exponential and Reciprocal Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - result[@enumToInt(Feature.ermsb)] = .{ .index = @enumToInt(Feature.ermsb), .name = @tagName(Feature.ermsb), @@ -392,53 +437,29 @@ pub const all_features = blk: { .description = "REP MOVS/STOS are fast", .dependencies = 0, }; - result[@enumToInt(Feature.f16c)] = .{ .index = @enumToInt(Feature.f16c), .name = @tagName(Feature.f16c), .llvm_name = "f16c", .description = "Support 16-bit floating point conversion instructions", .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.fma)] = .{ - .index = @enumToInt(Feature.fma), - .name = @tagName(Feature.fma), - .llvm_name = "fma", - .description = "Enable three-operand fused multiple-add", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.fma4)] = .{ - .index = @enumToInt(Feature.fma4), - .name = @tagName(Feature.fma4), - .llvm_name = "fma4", - .description = "Enable four-operand fused multiple-add", - .dependencies = featureSet(&[_]Feature{ - .sse, + .avx, }), }; - - result[@enumToInt(Feature.fsgsbase)] = .{ - .index = @enumToInt(Feature.fsgsbase), - .name = @tagName(Feature.fsgsbase), - .llvm_name = "fsgsbase", - .description = "Support FS/GS Base instructions", + result[@enumToInt(Feature.false_deps_lzcnt_tzcnt)] = .{ + .index = @enumToInt(Feature.false_deps_lzcnt_tzcnt), + .name = @tagName(Feature.false_deps_lzcnt_tzcnt), + .llvm_name = "false-deps-lzcnt-tzcnt", + .description = "LZCNT/TZCNT have a false dependency on dest register", .dependencies = 0, }; - - result[@enumToInt(Feature.fxsr)] = .{ - .index = @enumToInt(Feature.fxsr), - .name = @tagName(Feature.fxsr), - .llvm_name = "fxsr", - .description = "Support fxsave/fxrestore instructions", + result[@enumToInt(Feature.false_deps_popcnt)] = .{ + .index = @enumToInt(Feature.false_deps_popcnt), + .name = @tagName(Feature.false_deps_popcnt), + .llvm_name = "false-deps-popcnt", + .description = "POPCNT has a false dependency on dest register", .dependencies = 0, }; - result[@enumToInt(Feature.fast_11bytenop)] = .{ .index = @enumToInt(Feature.fast_11bytenop), .name = @tagName(Feature.fast_11bytenop), @@ -446,7 +467,6 @@ pub const all_features = blk: { .description = "Target can quickly decode up to 11 byte NOPs", .dependencies = 0, }; - result[@enumToInt(Feature.fast_15bytenop)] = .{ .index = @enumToInt(Feature.fast_15bytenop), .name = @tagName(Feature.fast_15bytenop), @@ -454,7 +474,6 @@ pub const all_features = blk: { .description = "Target can quickly decode up to 15 byte NOPs", .dependencies = 0, }; - result[@enumToInt(Feature.fast_bextr)] = .{ .index = @enumToInt(Feature.fast_bextr), .name = @tagName(Feature.fast_bextr), @@ -462,17 +481,22 @@ pub const all_features = blk: { .description = "Indicates that the BEXTR instruction is implemented as a single uop with good throughput", .dependencies = 0, }; - + result[@enumToInt(Feature.fast_gather)] = .{ + .index = @enumToInt(Feature.fast_gather), + .name = @tagName(Feature.fast_gather), + .llvm_name = "fast-gather", + .description = "Indicates if gather is reasonably fast", + .dependencies = 0, + }; result[@enumToInt(Feature.fast_hops)] = .{ .index = @enumToInt(Feature.fast_hops), .name = @tagName(Feature.fast_hops), .llvm_name = "fast-hops", .description = "Prefer horizontal vector math instructions (haddp, phsub, etc.) over normal vector instructions with shuffles", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse3, }), }; - result[@enumToInt(Feature.fast_lzcnt)] = .{ .index = @enumToInt(Feature.fast_lzcnt), .name = @tagName(Feature.fast_lzcnt), @@ -480,7 +504,6 @@ pub const all_features = blk: { .description = "LZCNT instructions are as fast as most simple integer ops", .dependencies = 0, }; - result[@enumToInt(Feature.fast_partial_ymm_or_zmm_write)] = .{ .index = @enumToInt(Feature.fast_partial_ymm_or_zmm_write), .name = @tagName(Feature.fast_partial_ymm_or_zmm_write), @@ -488,15 +511,6 @@ pub const all_features = blk: { .description = "Partial writes to YMM/ZMM registers are fast", .dependencies = 0, }; - - result[@enumToInt(Feature.fast_shld_rotate)] = .{ - .index = @enumToInt(Feature.fast_shld_rotate), - .name = @tagName(Feature.fast_shld_rotate), - .llvm_name = "fast-shld-rotate", - .description = "SHLD can be used as a faster rotate", - .dependencies = 0, - }; - result[@enumToInt(Feature.fast_scalar_fsqrt)] = .{ .index = @enumToInt(Feature.fast_scalar_fsqrt), .name = @tagName(Feature.fast_scalar_fsqrt), @@ -504,7 +518,6 @@ pub const all_features = blk: { .description = "Scalar SQRT is fast (disable Newton-Raphson)", .dependencies = 0, }; - result[@enumToInt(Feature.fast_scalar_shift_masks)] = .{ .index = @enumToInt(Feature.fast_scalar_shift_masks), .name = @tagName(Feature.fast_scalar_shift_masks), @@ -512,7 +525,13 @@ pub const all_features = blk: { .description = "Prefer a left/right scalar logical shift pair over a shift+and pair", .dependencies = 0, }; - + result[@enumToInt(Feature.fast_shld_rotate)] = .{ + .index = @enumToInt(Feature.fast_shld_rotate), + .name = @tagName(Feature.fast_shld_rotate), + .llvm_name = "fast-shld-rotate", + .description = "SHLD can be used as a faster rotate", + .dependencies = 0, + }; result[@enumToInt(Feature.fast_variable_shuffle)] = .{ .index = @enumToInt(Feature.fast_variable_shuffle), .name = @tagName(Feature.fast_variable_shuffle), @@ -520,7 +539,6 @@ pub const all_features = blk: { .description = "Shuffles with variable masks are fast", .dependencies = 0, }; - result[@enumToInt(Feature.fast_vector_fsqrt)] = .{ .index = @enumToInt(Feature.fast_vector_fsqrt), .name = @tagName(Feature.fast_vector_fsqrt), @@ -528,7 +546,6 @@ pub const all_features = blk: { .description = "Vector SQRT is fast (disable Newton-Raphson)", .dependencies = 0, }; - result[@enumToInt(Feature.fast_vector_shift_masks)] = .{ .index = @enumToInt(Feature.fast_vector_shift_masks), .name = @tagName(Feature.fast_vector_shift_masks), @@ -536,35 +553,62 @@ pub const all_features = blk: { .description = "Prefer a left/right vector logical shift pair over a shift+and pair", .dependencies = 0, }; - + result[@enumToInt(Feature.fma)] = .{ + .index = @enumToInt(Feature.fma), + .name = @tagName(Feature.fma), + .llvm_name = "fma", + .description = "Enable three-operand fused multiple-add", + .dependencies = featureSet(&[_]Feature{ + .avx, + }), + }; + result[@enumToInt(Feature.fma4)] = .{ + .index = @enumToInt(Feature.fma4), + .name = @tagName(Feature.fma4), + .llvm_name = "fma4", + .description = "Enable four-operand fused multiple-add", + .dependencies = featureSet(&[_]Feature{ + .avx, + .sse4a, + }), + }; + result[@enumToInt(Feature.fsgsbase)] = .{ + .index = @enumToInt(Feature.fsgsbase), + .name = @tagName(Feature.fsgsbase), + .llvm_name = "fsgsbase", + .description = "Support FS/GS Base instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.fxsr)] = .{ + .index = @enumToInt(Feature.fxsr), + .name = @tagName(Feature.fxsr), + .llvm_name = "fxsr", + .description = "Support fxsave/fxrestore instructions", + .dependencies = 0, + }; result[@enumToInt(Feature.gfni)] = .{ .index = @enumToInt(Feature.gfni), .name = @tagName(Feature.gfni), .llvm_name = "gfni", .description = "Enable Galois Field Arithmetic Instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse2, }), }; - - result[@enumToInt(Feature.fast_gather)] = .{ - .index = @enumToInt(Feature.fast_gather), - .name = @tagName(Feature.fast_gather), - .llvm_name = "fast-gather", - .description = "Indicates if gather is reasonably fast", + result[@enumToInt(Feature.idivl_to_divb)] = .{ + .index = @enumToInt(Feature.idivl_to_divb), + .name = @tagName(Feature.idivl_to_divb), + .llvm_name = "idivl-to-divb", + .description = "Use 8-bit divide for positive values less than 256", .dependencies = 0, }; - - result[@enumToInt(Feature.avx512ifma)] = .{ - .index = @enumToInt(Feature.avx512ifma), - .name = @tagName(Feature.avx512ifma), - .llvm_name = "avx512ifma", - .description = "Enable AVX-512 Integer Fused Multiple-Add", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), + result[@enumToInt(Feature.idivq_to_divl)] = .{ + .index = @enumToInt(Feature.idivq_to_divl), + .name = @tagName(Feature.idivq_to_divl), + .llvm_name = "idivq-to-divl", + .description = "Use 32-bit divide for positive values less than 2^32", + .dependencies = 0, }; - result[@enumToInt(Feature.invpcid)] = .{ .index = @enumToInt(Feature.invpcid), .name = @tagName(Feature.invpcid), @@ -572,15 +616,6 @@ pub const all_features = blk: { .description = "Invalidate Process-Context Identifier", .dependencies = 0, }; - - result[@enumToInt(Feature.sahf)] = .{ - .index = @enumToInt(Feature.sahf), - .name = @tagName(Feature.sahf), - .llvm_name = "sahf", - .description = "Support LAHF and SAHF instructions", - .dependencies = 0, - }; - result[@enumToInt(Feature.lea_sp)] = .{ .index = @enumToInt(Feature.lea_sp), .name = @tagName(Feature.lea_sp), @@ -588,7 +623,6 @@ pub const all_features = blk: { .description = "Use LEA for adjusting the stack pointer", .dependencies = 0, }; - result[@enumToInt(Feature.lea_uses_ag)] = .{ .index = @enumToInt(Feature.lea_uses_ag), .name = @tagName(Feature.lea_uses_ag), @@ -596,7 +630,6 @@ pub const all_features = blk: { .description = "LEA instruction needs inputs at AG stage", .dependencies = 0, }; - result[@enumToInt(Feature.lwp)] = .{ .index = @enumToInt(Feature.lwp), .name = @tagName(Feature.lwp), @@ -604,7 +637,6 @@ pub const all_features = blk: { .description = "Enable LWP instructions", .dependencies = 0, }; - result[@enumToInt(Feature.lzcnt)] = .{ .index = @enumToInt(Feature.lzcnt), .name = @tagName(Feature.lzcnt), @@ -612,15 +644,20 @@ pub const all_features = blk: { .description = "Support LZCNT instruction", .dependencies = 0, }; - - result[@enumToInt(Feature.false_deps_lzcnt_tzcnt)] = .{ - .index = @enumToInt(Feature.false_deps_lzcnt_tzcnt), - .name = @tagName(Feature.false_deps_lzcnt_tzcnt), - .llvm_name = "false-deps-lzcnt-tzcnt", - .description = "LZCNT/TZCNT have a false dependency on dest register", + result[@enumToInt(Feature.macrofusion)] = .{ + .index = @enumToInt(Feature.macrofusion), + .name = @tagName(Feature.macrofusion), + .llvm_name = "macrofusion", + .description = "Various instructions can be fused with conditional branches", + .dependencies = 0, + }; + result[@enumToInt(Feature.merge_to_threeway_branch)] = .{ + .index = @enumToInt(Feature.merge_to_threeway_branch), + .name = @tagName(Feature.merge_to_threeway_branch), + .llvm_name = "merge-to-threeway-branch", + .description = "Merge branches to a three-way conditional branch", .dependencies = 0, }; - result[@enumToInt(Feature.mmx)] = .{ .index = @enumToInt(Feature.mmx), .name = @tagName(Feature.mmx), @@ -628,7 +665,6 @@ pub const all_features = blk: { .description = "Enable MMX instructions", .dependencies = 0, }; - result[@enumToInt(Feature.movbe)] = .{ .index = @enumToInt(Feature.movbe), .name = @tagName(Feature.movbe), @@ -636,7 +672,6 @@ pub const all_features = blk: { .description = "Support MOVBE instruction", .dependencies = 0, }; - result[@enumToInt(Feature.movdir64b)] = .{ .index = @enumToInt(Feature.movdir64b), .name = @tagName(Feature.movdir64b), @@ -644,7 +679,6 @@ pub const all_features = blk: { .description = "Support movdir64b instruction", .dependencies = 0, }; - result[@enumToInt(Feature.movdiri)] = .{ .index = @enumToInt(Feature.movdiri), .name = @tagName(Feature.movdiri), @@ -652,7 +686,6 @@ pub const all_features = blk: { .description = "Support movdiri instruction", .dependencies = 0, }; - result[@enumToInt(Feature.mpx)] = .{ .index = @enumToInt(Feature.mpx), .name = @tagName(Feature.mpx), @@ -660,7 +693,6 @@ pub const all_features = blk: { .description = "Support MPX instructions", .dependencies = 0, }; - result[@enumToInt(Feature.mwaitx)] = .{ .index = @enumToInt(Feature.mwaitx), .name = @tagName(Feature.mwaitx), @@ -668,23 +700,6 @@ pub const all_features = blk: { .description = "Enable MONITORX/MWAITX timer functionality", .dependencies = 0, }; - - result[@enumToInt(Feature.macrofusion)] = .{ - .index = @enumToInt(Feature.macrofusion), - .name = @tagName(Feature.macrofusion), - .llvm_name = "macrofusion", - .description = "Various instructions can be fused with conditional branches", - .dependencies = 0, - }; - - result[@enumToInt(Feature.merge_to_threeway_branch)] = .{ - .index = @enumToInt(Feature.merge_to_threeway_branch), - .name = @tagName(Feature.merge_to_threeway_branch), - .llvm_name = "merge-to-threeway-branch", - .description = "Merge branches to a three-way conditional branch", - .dependencies = 0, - }; - result[@enumToInt(Feature.nopl)] = .{ .index = @enumToInt(Feature.nopl), .name = @tagName(Feature.nopl), @@ -692,17 +707,22 @@ pub const all_features = blk: { .description = "Enable NOPL instruction", .dependencies = 0, }; - + result[@enumToInt(Feature.pad_short_functions)] = .{ + .index = @enumToInt(Feature.pad_short_functions), + .name = @tagName(Feature.pad_short_functions), + .llvm_name = "pad-short-functions", + .description = "Pad short functions", + .dependencies = 0, + }; result[@enumToInt(Feature.pclmul)] = .{ .index = @enumToInt(Feature.pclmul), .name = @tagName(Feature.pclmul), .llvm_name = "pclmul", .description = "Enable packed carry-less multiplication instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse2, }), }; - result[@enumToInt(Feature.pconfig)] = .{ .index = @enumToInt(Feature.pconfig), .name = @tagName(Feature.pconfig), @@ -710,17 +730,6 @@ pub const all_features = blk: { .description = "platform configuration instruction", .dependencies = 0, }; - - result[@enumToInt(Feature.avx512pf)] = .{ - .index = @enumToInt(Feature.avx512pf), - .name = @tagName(Feature.avx512pf), - .llvm_name = "avx512pf", - .description = "Enable AVX-512 PreFetch Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - result[@enumToInt(Feature.pku)] = .{ .index = @enumToInt(Feature.pku), .name = @tagName(Feature.pku), @@ -728,7 +737,6 @@ pub const all_features = blk: { .description = "Enable protection keys", .dependencies = 0, }; - result[@enumToInt(Feature.popcnt)] = .{ .index = @enumToInt(Feature.popcnt), .name = @tagName(Feature.popcnt), @@ -736,15 +744,13 @@ pub const all_features = blk: { .description = "Support POPCNT instruction", .dependencies = 0, }; - - result[@enumToInt(Feature.false_deps_popcnt)] = .{ - .index = @enumToInt(Feature.false_deps_popcnt), - .name = @tagName(Feature.false_deps_popcnt), - .llvm_name = "false-deps-popcnt", - .description = "POPCNT has a false dependency on dest register", + result[@enumToInt(Feature.prefer_256_bit)] = .{ + .index = @enumToInt(Feature.prefer_256_bit), + .name = @tagName(Feature.prefer_256_bit), + .llvm_name = "prefer-256-bit", + .description = "Prefer 256-bit AVX instructions", .dependencies = 0, }; - result[@enumToInt(Feature.prefetchwt1)] = .{ .index = @enumToInt(Feature.prefetchwt1), .name = @tagName(Feature.prefetchwt1), @@ -752,7 +758,6 @@ pub const all_features = blk: { .description = "Prefetch with Intent to Write and T1 Hint", .dependencies = 0, }; - result[@enumToInt(Feature.prfchw)] = .{ .index = @enumToInt(Feature.prfchw), .name = @tagName(Feature.prfchw), @@ -760,7 +765,6 @@ pub const all_features = blk: { .description = "Support PRFCHW instructions", .dependencies = 0, }; - result[@enumToInt(Feature.ptwrite)] = .{ .index = @enumToInt(Feature.ptwrite), .name = @tagName(Feature.ptwrite), @@ -768,23 +772,6 @@ pub const all_features = blk: { .description = "Support ptwrite instruction", .dependencies = 0, }; - - result[@enumToInt(Feature.pad_short_functions)] = .{ - .index = @enumToInt(Feature.pad_short_functions), - .name = @tagName(Feature.pad_short_functions), - .llvm_name = "pad-short-functions", - .description = "Pad short functions", - .dependencies = 0, - }; - - result[@enumToInt(Feature.prefer_256_bit)] = .{ - .index = @enumToInt(Feature.prefer_256_bit), - .name = @tagName(Feature.prefer_256_bit), - .llvm_name = "prefer-256-bit", - .description = "Prefer 256-bit AVX instructions", - .dependencies = 0, - }; - result[@enumToInt(Feature.rdpid)] = .{ .index = @enumToInt(Feature.rdpid), .name = @tagName(Feature.rdpid), @@ -792,7 +779,6 @@ pub const all_features = blk: { .description = "Support RDPID instructions", .dependencies = 0, }; - result[@enumToInt(Feature.rdrnd)] = .{ .index = @enumToInt(Feature.rdrnd), .name = @tagName(Feature.rdrnd), @@ -800,7 +786,6 @@ pub const all_features = blk: { .description = "Support RDRAND instruction", .dependencies = 0, }; - result[@enumToInt(Feature.rdseed)] = .{ .index = @enumToInt(Feature.rdseed), .name = @tagName(Feature.rdseed), @@ -808,26 +793,16 @@ pub const all_features = blk: { .description = "Support RDSEED instruction", .dependencies = 0, }; - - result[@enumToInt(Feature.rtm)] = .{ - .index = @enumToInt(Feature.rtm), - .name = @tagName(Feature.rtm), - .llvm_name = "rtm", - .description = "Support RTM instructions", - .dependencies = 0, - }; - result[@enumToInt(Feature.retpoline)] = .{ .index = @enumToInt(Feature.retpoline), .name = @tagName(Feature.retpoline), .llvm_name = "retpoline", .description = "Remove speculation of indirect branches from the generated code, either by avoiding them entirely or lowering them with a speculation blocking construct", .dependencies = featureSet(&[_]Feature{ - .retpoline_indirect_calls, .retpoline_indirect_branches, + .retpoline_indirect_calls, }), }; - result[@enumToInt(Feature.retpoline_external_thunk)] = .{ .index = @enumToInt(Feature.retpoline_external_thunk), .name = @tagName(Feature.retpoline_external_thunk), @@ -837,7 +812,6 @@ pub const all_features = blk: { .retpoline_indirect_calls, }), }; - result[@enumToInt(Feature.retpoline_indirect_branches)] = .{ .index = @enumToInt(Feature.retpoline_indirect_branches), .name = @tagName(Feature.retpoline_indirect_branches), @@ -845,7 +819,6 @@ pub const all_features = blk: { .description = "Remove speculation of indirect branches from the generated code", .dependencies = 0, }; - result[@enumToInt(Feature.retpoline_indirect_calls)] = .{ .index = @enumToInt(Feature.retpoline_indirect_calls), .name = @tagName(Feature.retpoline_indirect_calls), @@ -853,7 +826,20 @@ pub const all_features = blk: { .description = "Remove speculation of indirect calls from the generated code", .dependencies = 0, }; - + result[@enumToInt(Feature.rtm)] = .{ + .index = @enumToInt(Feature.rtm), + .name = @tagName(Feature.rtm), + .llvm_name = "rtm", + .description = "Support RTM instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.sahf)] = .{ + .index = @enumToInt(Feature.sahf), + .name = @tagName(Feature.sahf), + .llvm_name = "sahf", + .description = "Support LAHF and SAHF instructions", + .dependencies = 0, + }; result[@enumToInt(Feature.sgx)] = .{ .index = @enumToInt(Feature.sgx), .name = @tagName(Feature.sgx), @@ -861,17 +847,15 @@ pub const all_features = blk: { .description = "Enable Software Guard Extensions", .dependencies = 0, }; - result[@enumToInt(Feature.sha)] = .{ .index = @enumToInt(Feature.sha), .name = @tagName(Feature.sha), .llvm_name = "sha", .description = "Enable SHA instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse2, }), }; - result[@enumToInt(Feature.shstk)] = .{ .index = @enumToInt(Feature.shstk), .name = @tagName(Feature.shstk), @@ -879,83 +863,6 @@ pub const all_features = blk: { .description = "Support CET Shadow-Stack instructions", .dependencies = 0, }; - - result[@enumToInt(Feature.sse)] = .{ - .index = @enumToInt(Feature.sse), - .name = @tagName(Feature.sse), - .llvm_name = "sse", - .description = "Enable SSE instructions", - .dependencies = 0, - }; - - result[@enumToInt(Feature.sse2)] = .{ - .index = @enumToInt(Feature.sse2), - .name = @tagName(Feature.sse2), - .llvm_name = "sse2", - .description = "Enable SSE2 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.sse3)] = .{ - .index = @enumToInt(Feature.sse3), - .name = @tagName(Feature.sse3), - .llvm_name = "sse3", - .description = "Enable SSE3 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.sse4a)] = .{ - .index = @enumToInt(Feature.sse4a), - .name = @tagName(Feature.sse4a), - .llvm_name = "sse4a", - .description = "Support SSE 4a instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.sse4_1)] = .{ - .index = @enumToInt(Feature.sse4_1), - .name = @tagName(Feature.sse4_1), - .llvm_name = "sse4.1", - .description = "Enable SSE 4.1 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.sse4_2)] = .{ - .index = @enumToInt(Feature.sse4_2), - .name = @tagName(Feature.sse4_2), - .llvm_name = "sse4.2", - .description = "Enable SSE 4.2 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.sse_unaligned_mem)] = .{ - .index = @enumToInt(Feature.sse_unaligned_mem), - .name = @tagName(Feature.sse_unaligned_mem), - .llvm_name = "sse-unaligned-mem", - .description = "Allow unaligned memory operands with SSE instructions", - .dependencies = 0, - }; - - result[@enumToInt(Feature.ssse3)] = .{ - .index = @enumToInt(Feature.ssse3), - .name = @tagName(Feature.ssse3), - .llvm_name = "ssse3", - .description = "Enable SSSE3 instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - result[@enumToInt(Feature.slow_3ops_lea)] = .{ .index = @enumToInt(Feature.slow_3ops_lea), .name = @tagName(Feature.slow_3ops_lea), @@ -963,23 +870,6 @@ pub const all_features = blk: { .description = "LEA instruction with 3 ops or certain registers is slow", .dependencies = 0, }; - - result[@enumToInt(Feature.idivl_to_divb)] = .{ - .index = @enumToInt(Feature.idivl_to_divb), - .name = @tagName(Feature.idivl_to_divb), - .llvm_name = "idivl-to-divb", - .description = "Use 8-bit divide for positive values less than 256", - .dependencies = 0, - }; - - result[@enumToInt(Feature.idivq_to_divl)] = .{ - .index = @enumToInt(Feature.idivq_to_divl), - .name = @tagName(Feature.idivq_to_divl), - .llvm_name = "idivq-to-divl", - .description = "Use 32-bit divide for positive values less than 2^32", - .dependencies = 0, - }; - result[@enumToInt(Feature.slow_incdec)] = .{ .index = @enumToInt(Feature.slow_incdec), .name = @tagName(Feature.slow_incdec), @@ -987,7 +877,6 @@ pub const all_features = blk: { .description = "INC and DEC instructions are slower than ADD and SUB", .dependencies = 0, }; - result[@enumToInt(Feature.slow_lea)] = .{ .index = @enumToInt(Feature.slow_lea), .name = @tagName(Feature.slow_lea), @@ -995,7 +884,6 @@ pub const all_features = blk: { .description = "LEA instruction with certain arguments is slow", .dependencies = 0, }; - result[@enumToInt(Feature.slow_pmaddwd)] = .{ .index = @enumToInt(Feature.slow_pmaddwd), .name = @tagName(Feature.slow_pmaddwd), @@ -1003,7 +891,6 @@ pub const all_features = blk: { .description = "PMADDWD is slower than PMULLD", .dependencies = 0, }; - result[@enumToInt(Feature.slow_pmulld)] = .{ .index = @enumToInt(Feature.slow_pmulld), .name = @tagName(Feature.slow_pmulld), @@ -1011,7 +898,6 @@ pub const all_features = blk: { .description = "PMULLD instruction is slow", .dependencies = 0, }; - result[@enumToInt(Feature.slow_shld)] = .{ .index = @enumToInt(Feature.slow_shld), .name = @tagName(Feature.slow_shld), @@ -1019,7 +905,6 @@ pub const all_features = blk: { .description = "SHLD instruction is slow", .dependencies = 0, }; - result[@enumToInt(Feature.slow_two_mem_ops)] = .{ .index = @enumToInt(Feature.slow_two_mem_ops), .name = @tagName(Feature.slow_two_mem_ops), @@ -1027,7 +912,6 @@ pub const all_features = blk: { .description = "Two memory operand instructions are slow", .dependencies = 0, }; - result[@enumToInt(Feature.slow_unaligned_mem_16)] = .{ .index = @enumToInt(Feature.slow_unaligned_mem_16), .name = @tagName(Feature.slow_unaligned_mem_16), @@ -1035,7 +919,6 @@ pub const all_features = blk: { .description = "Slow unaligned 16-byte memory access", .dependencies = 0, }; - result[@enumToInt(Feature.slow_unaligned_mem_32)] = .{ .index = @enumToInt(Feature.slow_unaligned_mem_32), .name = @tagName(Feature.slow_unaligned_mem_32), @@ -1043,7 +926,6 @@ pub const all_features = blk: { .description = "Slow unaligned 32-byte memory access", .dependencies = 0, }; - result[@enumToInt(Feature.soft_float)] = .{ .index = @enumToInt(Feature.soft_float), .name = @tagName(Feature.soft_float), @@ -1051,95 +933,101 @@ pub const all_features = blk: { .description = "Use software floating point features", .dependencies = 0, }; - - result[@enumToInt(Feature.tbm)] = .{ - .index = @enumToInt(Feature.tbm), - .name = @tagName(Feature.tbm), - .llvm_name = "tbm", - .description = "Enable TBM instructions", + result[@enumToInt(Feature.sse)] = .{ + .index = @enumToInt(Feature.sse), + .name = @tagName(Feature.sse), + .llvm_name = "sse", + .description = "Enable SSE instructions", .dependencies = 0, }; - - result[@enumToInt(Feature.vaes)] = .{ - .index = @enumToInt(Feature.vaes), - .name = @tagName(Feature.vaes), - .llvm_name = "vaes", - .description = "Promote selected AES instructions to AVX512/AVX registers", + result[@enumToInt(Feature.sse_unaligned_mem)] = .{ + .index = @enumToInt(Feature.sse_unaligned_mem), + .name = @tagName(Feature.sse_unaligned_mem), + .llvm_name = "sse-unaligned-mem", + .description = "Allow unaligned memory operands with SSE instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.sse2)] = .{ + .index = @enumToInt(Feature.sse2), + .name = @tagName(Feature.sse2), + .llvm_name = "sse2", + .description = "Enable SSE2 instructions", .dependencies = featureSet(&[_]Feature{ .sse, }), }; - - result[@enumToInt(Feature.avx512vbmi)] = .{ - .index = @enumToInt(Feature.avx512vbmi), - .name = @tagName(Feature.avx512vbmi), - .llvm_name = "avx512vbmi", - .description = "Enable AVX-512 Vector Byte Manipulation Instructions", + result[@enumToInt(Feature.sse3)] = .{ + .index = @enumToInt(Feature.sse3), + .name = @tagName(Feature.sse3), + .llvm_name = "sse3", + .description = "Enable SSE3 instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse2, }), }; - - result[@enumToInt(Feature.avx512vbmi2)] = .{ - .index = @enumToInt(Feature.avx512vbmi2), - .name = @tagName(Feature.avx512vbmi2), - .llvm_name = "avx512vbmi2", - .description = "Enable AVX-512 further Vector Byte Manipulation Instructions", + result[@enumToInt(Feature.sse4_1)] = .{ + .index = @enumToInt(Feature.sse4_1), + .name = @tagName(Feature.sse4_1), + .llvm_name = "sse4.1", + .description = "Enable SSE 4.1 instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .ssse3, }), }; - - result[@enumToInt(Feature.avx512vl)] = .{ - .index = @enumToInt(Feature.avx512vl), - .name = @tagName(Feature.avx512vl), - .llvm_name = "avx512vl", - .description = "Enable AVX-512 Vector Length eXtensions", + result[@enumToInt(Feature.sse4_2)] = .{ + .index = @enumToInt(Feature.sse4_2), + .name = @tagName(Feature.sse4_2), + .llvm_name = "sse4.2", + .description = "Enable SSE 4.2 instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse4_1, }), }; - - result[@enumToInt(Feature.avx512vnni)] = .{ - .index = @enumToInt(Feature.avx512vnni), - .name = @tagName(Feature.avx512vnni), - .llvm_name = "avx512vnni", - .description = "Enable AVX-512 Vector Neural Network Instructions", + result[@enumToInt(Feature.sse4a)] = .{ + .index = @enumToInt(Feature.sse4a), + .name = @tagName(Feature.sse4a), + .llvm_name = "sse4a", + .description = "Support SSE 4a instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse3, }), }; - - result[@enumToInt(Feature.avx512vp2intersect)] = .{ - .index = @enumToInt(Feature.avx512vp2intersect), - .name = @tagName(Feature.avx512vp2intersect), - .llvm_name = "avx512vp2intersect", - .description = "Enable AVX-512 vp2intersect", + result[@enumToInt(Feature.ssse3)] = .{ + .index = @enumToInt(Feature.ssse3), + .name = @tagName(Feature.ssse3), + .llvm_name = "ssse3", + .description = "Enable SSSE3 instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .sse3, + }), + }; + result[@enumToInt(Feature.tbm)] = .{ + .index = @enumToInt(Feature.tbm), + .name = @tagName(Feature.tbm), + .llvm_name = "tbm", + .description = "Enable TBM instructions", + .dependencies = 0, + }; + result[@enumToInt(Feature.vaes)] = .{ + .index = @enumToInt(Feature.vaes), + .name = @tagName(Feature.vaes), + .llvm_name = "vaes", + .description = "Promote selected AES instructions to AVX512/AVX registers", + .dependencies = featureSet(&[_]Feature{ + .aes, + .avx, }), }; - result[@enumToInt(Feature.vpclmulqdq)] = .{ .index = @enumToInt(Feature.vpclmulqdq), .name = @tagName(Feature.vpclmulqdq), .llvm_name = "vpclmulqdq", .description = "Enable vpclmulqdq instructions", .dependencies = featureSet(&[_]Feature{ - .sse, - }), - }; - - result[@enumToInt(Feature.avx512vpopcntdq)] = .{ - .index = @enumToInt(Feature.avx512vpopcntdq), - .name = @tagName(Feature.avx512vpopcntdq), - .llvm_name = "avx512vpopcntdq", - .description = "Enable AVX-512 Population Count Instructions", - .dependencies = featureSet(&[_]Feature{ - .sse, + .avx, + .pclmul, }), }; - result[@enumToInt(Feature.waitpkg)] = .{ .index = @enumToInt(Feature.waitpkg), .name = @tagName(Feature.waitpkg), @@ -1147,7 +1035,6 @@ pub const all_features = blk: { .description = "Wait and pause enhancements", .dependencies = 0, }; - result[@enumToInt(Feature.wbnoinvd)] = .{ .index = @enumToInt(Feature.wbnoinvd), .name = @tagName(Feature.wbnoinvd), @@ -1155,7 +1042,6 @@ pub const all_features = blk: { .description = "Write Back No Invalidate", .dependencies = 0, }; - result[@enumToInt(Feature.x87)] = .{ .index = @enumToInt(Feature.x87), .name = @tagName(Feature.x87), @@ -1163,17 +1049,15 @@ pub const all_features = blk: { .description = "Enable X87 float instructions", .dependencies = 0, }; - result[@enumToInt(Feature.xop)] = .{ .index = @enumToInt(Feature.xop), .name = @tagName(Feature.xop), .llvm_name = "xop", .description = "Enable XOP instructions", .dependencies = featureSet(&[_]Feature{ - .sse, + .fma4, }), }; - result[@enumToInt(Feature.xsave)] = .{ .index = @enumToInt(Feature.xsave), .name = @tagName(Feature.xsave), @@ -1181,7 +1065,6 @@ pub const all_features = blk: { .description = "Support xsave instructions", .dependencies = 0, }; - result[@enumToInt(Feature.xsavec)] = .{ .index = @enumToInt(Feature.xsavec), .name = @tagName(Feature.xsavec), @@ -1189,7 +1072,6 @@ pub const all_features = blk: { .description = "Support xsavec instructions", .dependencies = 0, }; - result[@enumToInt(Feature.xsaveopt)] = .{ .index = @enumToInt(Feature.xsaveopt), .name = @tagName(Feature.xsaveopt), @@ -1197,7 +1079,6 @@ pub const all_features = blk: { .description = "Support xsaveopt instructions", .dependencies = 0, }; - result[@enumToInt(Feature.xsaves)] = .{ .index = @enumToInt(Feature.xsaves), .name = @tagName(Feature.xsaves), @@ -1205,7 +1086,6 @@ pub const all_features = blk: { .description = "Support xsaves instructions", .dependencies = 0, }; - break :blk result; }; @@ -1214,30 +1094,26 @@ pub const cpu = struct { .name = "amdfam10", .llvm_name = "amdfam10", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_scalar_shift_masks, - .sahf, + .fxsr, .lzcnt, .nopl, .popcnt, - .sse, - .sse4a, + .sahf, .slow_shld, + .sse4a, .x87, }), }; - pub const athlon = Cpu{ .name = "athlon", .llvm_name = "athlon", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cmov, .cx8, @@ -1247,66 +1123,57 @@ pub const cpu = struct { .x87, }), }; - - pub const athlon4 = Cpu{ + pub const athlon_4 = Cpu{ .name = "athlon_4", .llvm_name = "athlon-4", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cmov, .cx8, .fxsr, .nopl, - .sse, .slow_shld, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const athlon_fx = Cpu{ .name = "athlon_fx", .llvm_name = "athlon-fx", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, .cx8, - .fxsr, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse2, .slow_shld, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const athlon_mp = Cpu{ .name = "athlon_mp", .llvm_name = "athlon-mp", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cmov, .cx8, .fxsr, .nopl, - .sse, .slow_shld, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const athlon_tbird = Cpu{ .name = "athlon_tbird", .llvm_name = "athlon-tbird", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cmov, .cx8, @@ -1316,129 +1183,113 @@ pub const cpu = struct { .x87, }), }; - pub const athlon_xp = Cpu{ .name = "athlon_xp", .llvm_name = "athlon-xp", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cmov, .cx8, .fxsr, .nopl, - .sse, .slow_shld, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const athlon64 = Cpu{ .name = "athlon64", .llvm_name = "athlon64", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, .cx8, - .fxsr, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse2, .slow_shld, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const athlon64_sse3 = Cpu{ .name = "athlon64_sse3", .llvm_name = "athlon64-sse3", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse3, .slow_shld, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const atom = Cpu{ .name = "atom", .llvm_name = "atom", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, + .idivl_to_divb, + .idivq_to_divl, .lea_sp, .lea_uses_ag, .mmx, .movbe, .nopl, .pad_short_functions, - .sse, - .ssse3, - .idivl_to_divb, - .idivq_to_divl, + .sahf, .slow_two_mem_ops, .slow_unaligned_mem_16, + .ssse3, .x87, }), }; - pub const barcelona = Cpu{ .name = "barcelona", .llvm_name = "barcelona", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_scalar_shift_masks, - .sahf, + .fxsr, .lzcnt, .nopl, .popcnt, - .sse, - .sse4a, + .sahf, .slow_shld, + .sse4a, .x87, }), }; - pub const bdver1 = Cpu{ .name = "bdver1", .llvm_name = "bdver1", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .branchfusion, .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_11bytenop, .fast_scalar_shift_masks, - .sahf, + .fxsr, .lwp, .lzcnt, .mmx, @@ -1446,32 +1297,30 @@ pub const cpu = struct { .pclmul, .popcnt, .prfchw, + .sahf, .slow_shld, .x87, .xop, .xsave, }), }; - pub const bdver2 = Cpu{ .name = "bdver2", .llvm_name = "bdver2", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .bmi, .branchfusion, .cmov, - .cx8, .cx16, + .cx8, .f16c, - .fma, - .fxsr, .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, - .sahf, + .fma, + .fxsr, .lwp, .lzcnt, .mmx, @@ -1479,6 +1328,7 @@ pub const cpu = struct { .pclmul, .popcnt, .prfchw, + .sahf, .slow_shld, .tbm, .x87, @@ -1486,27 +1336,24 @@ pub const cpu = struct { .xsave, }), }; - pub const bdver3 = Cpu{ .name = "bdver3", .llvm_name = "bdver3", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .bmi, .branchfusion, .cmov, - .cx8, .cx16, + .cx8, .f16c, - .fma, - .fsgsbase, - .fxsr, .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, - .sahf, + .fma, + .fsgsbase, + .fxsr, .lwp, .lzcnt, .mmx, @@ -1514,6 +1361,7 @@ pub const cpu = struct { .pclmul, .popcnt, .prfchw, + .sahf, .slow_shld, .tbm, .x87, @@ -1522,29 +1370,26 @@ pub const cpu = struct { .xsaveopt, }), }; - pub const bdver4 = Cpu{ .name = "bdver4", .llvm_name = "bdver4", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .avx2, .bmi, .bmi2, .branchfusion, .cmov, - .cx8, .cx16, + .cx8, .f16c, - .fma, - .fsgsbase, - .fxsr, .fast_11bytenop, .fast_bextr, .fast_scalar_shift_masks, - .sahf, + .fma, + .fsgsbase, + .fxsr, .lwp, .lzcnt, .mmx, @@ -1553,6 +1398,7 @@ pub const cpu = struct { .pclmul, .popcnt, .prfchw, + .sahf, .slow_shld, .tbm, .x87, @@ -1561,119 +1407,110 @@ pub const cpu = struct { .xsaveopt, }), }; - pub const bonnell = Cpu{ .name = "bonnell", .llvm_name = "bonnell", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, + .idivl_to_divb, + .idivq_to_divl, .lea_sp, .lea_uses_ag, .mmx, .movbe, .nopl, .pad_short_functions, - .sse, - .ssse3, - .idivl_to_divb, - .idivq_to_divl, + .sahf, .slow_two_mem_ops, .slow_unaligned_mem_16, + .ssse3, .x87, }), }; - pub const broadwell = Cpu{ .name = "broadwell", .llvm_name = "broadwell", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .avx, .avx2, .bmi, .bmi2, .cmov, - .cx8, .cx16, + .cx8, .ermsb, .f16c, + .false_deps_lzcnt_tzcnt, + .false_deps_popcnt, + .fast_scalar_fsqrt, + .fast_shld_rotate, + .fast_variable_shuffle, .fma, .fsgsbase, .fxsr, - .fast_shld_rotate, - .fast_scalar_fsqrt, - .fast_variable_shuffle, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, - .false_deps_lzcnt_tzcnt, - .mmx, - .movbe, .macrofusion, .merge_to_threeway_branch, + .mmx, + .movbe, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const btver1 = Cpu{ .name = "btver1", .llvm_name = "btver1", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_15bytenop, .fast_scalar_shift_masks, .fast_vector_shift_masks, - .sahf, + .fxsr, .lzcnt, .mmx, .nopl, .popcnt, .prfchw, - .sse, + .sahf, + .slow_shld, .sse4a, .ssse3, - .slow_shld, .x87, }), }; - pub const btver2 = Cpu{ .name = "btver2", .llvm_name = "btver2", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .avx, .bmi, .cmov, - .cx8, .cx16, + .cx8, .f16c, - .fxsr, .fast_15bytenop, .fast_bextr, .fast_hops, @@ -1681,7 +1518,7 @@ pub const cpu = struct { .fast_partial_ymm_or_zmm_write, .fast_scalar_shift_masks, .fast_vector_shift_masks, - .sahf, + .fxsr, .lzcnt, .mmx, .movbe, @@ -1689,27 +1526,25 @@ pub const cpu = struct { .pclmul, .popcnt, .prfchw, + .sahf, + .slow_shld, .sse4a, .ssse3, - .slow_shld, .x87, .xsave, .xsaveopt, }), }; - pub const c3 = Cpu{ .name = "c3", .llvm_name = "c3", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnow", .slow_unaligned_mem_16, .x87, }), }; - - pub const c32 = Cpu{ + pub const c3_2 = Cpu{ .name = "c3_2", .llvm_name = "c3-2", .features = featureSet(&[_]Feature{ @@ -1717,51 +1552,51 @@ pub const cpu = struct { .cx8, .fxsr, .mmx, - .sse, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const cannonlake = Cpu{ .name = "cannonlake", .llvm_name = "cannonlake", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, + .avx512bw, + .avx512cd, + .avx512dq, .avx512f, + .avx512ifma, + .avx512vbmi, + .avx512vl, .bmi, .bmi2, - .avx512bw, - .avx512cd, .clflushopt, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, - .avx512ifma, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, @@ -1769,13 +1604,11 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, + .sahf, .sgx, .sha, - .sse4_2, .slow_3ops_lea, - .idivq_to_divl, - .avx512vbmi, - .avx512vl, + .sse4_2, .x87, .xsave, .xsavec, @@ -1783,59 +1616,57 @@ pub const cpu = struct { .xsaves, }), }; - pub const cascadelake = Cpu{ .name = "cascadelake", .llvm_name = "cascadelake", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, + .avx512bw, + .avx512cd, + .avx512dq, .avx512f, + .avx512vl, + .avx512vnni, .bmi, .bmi2, - .avx512bw, - .avx512cd, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .false_deps_popcnt, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, - .avx512vl, - .avx512vnni, + .sse4_2, .x87, .xsave, .xsavec, @@ -1843,60 +1674,58 @@ pub const cpu = struct { .xsaves, }), }; - pub const cooperlake = Cpu{ .name = "cooperlake", .llvm_name = "cooperlake", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, - .avx512f, .avx512bf16, - .bmi, - .bmi2, .avx512bw, .avx512cd, + .avx512dq, + .avx512f, + .avx512vl, + .avx512vnni, + .bmi, + .bmi2, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .false_deps_popcnt, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, - .avx512vl, - .avx512vnni, + .sse4_2, .x87, .xsave, .xsavec, @@ -1904,155 +1733,144 @@ pub const cpu = struct { .xsaves, }), }; - pub const core_avx_i = Cpu{ .name = "core_avx_i", .llvm_name = "core-avx-i", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .cmov, - .cx8, .cx16, + .cx8, .f16c, + .false_deps_popcnt, + .fast_scalar_fsqrt, + .fast_shld_rotate, .fsgsbase, .fxsr, - .fast_shld_rotate, - .fast_scalar_fsqrt, - .sahf, - .mmx, + .idivq_to_divl, .macrofusion, .merge_to_threeway_branch, + .mmx, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .rdrnd, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_unaligned_mem_32, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const core_avx2 = Cpu{ .name = "core_avx2", .llvm_name = "core-avx2", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .avx2, .bmi, .bmi2, .cmov, - .cx8, .cx16, + .cx8, .ermsb, .f16c, + .false_deps_lzcnt_tzcnt, + .false_deps_popcnt, + .fast_scalar_fsqrt, + .fast_shld_rotate, + .fast_variable_shuffle, .fma, .fsgsbase, .fxsr, - .fast_shld_rotate, - .fast_scalar_fsqrt, - .fast_variable_shuffle, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, - .false_deps_lzcnt_tzcnt, - .mmx, - .movbe, .macrofusion, .merge_to_threeway_branch, + .mmx, + .movbe, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .rdrnd, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const core2 = Cpu{ .name = "core2", .llvm_name = "core2", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, - .mmx, .macrofusion, + .mmx, .nopl, - .sse, - .ssse3, + .sahf, .slow_unaligned_mem_16, + .ssse3, .x87, }), }; - pub const corei7 = Cpu{ .name = "corei7", .llvm_name = "corei7", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, - .mmx, .macrofusion, + .mmx, .nopl, .popcnt, - .sse, + .sahf, .sse4_2, .x87, }), }; - pub const corei7_avx = Cpu{ .name = "corei7_avx", .llvm_name = "corei7-avx", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .cmov, - .cx8, .cx16, - .fxsr, - .fast_shld_rotate, + .cx8, + .false_deps_popcnt, .fast_scalar_fsqrt, - .sahf, - .mmx, + .fast_shld_rotate, + .fxsr, + .idivq_to_divl, .macrofusion, .merge_to_threeway_branch, + .mmx, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_unaligned_mem_32, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const generic = Cpu{ .name = "generic", .llvm_name = "generic", @@ -2062,49 +1880,45 @@ pub const cpu = struct { .x87, }), }; - pub const geode = Cpu{ .name = "geode", .llvm_name = "geode", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .cx8, .slow_unaligned_mem_16, .x87, }), }; - pub const goldmont = Cpu{ .name = "goldmont", .llvm_name = "goldmont", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .clflushopt, .cmov, - .cx8, .cx16, + .cx8, + .false_deps_popcnt, .fsgsbase, .fxsr, - .sahf, .mmx, .movbe, .mpx, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, + .sahf, .sha, - .sse4_2, - .ssse3, .slow_incdec, .slow_lea, .slow_two_mem_ops, + .sse4_2, + .ssse3, .x87, .xsave, .xsavec, @@ -2112,21 +1926,18 @@ pub const cpu = struct { .xsaves, }), }; - pub const goldmont_plus = Cpu{ .name = "goldmont_plus", .llvm_name = "goldmont-plus", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .clflushopt, .cmov, - .cx8, .cx16, + .cx8, .fsgsbase, .fxsr, - .sahf, .mmx, .movbe, .mpx, @@ -2138,13 +1949,14 @@ pub const cpu = struct { .rdpid, .rdrnd, .rdseed, + .sahf, .sgx, .sha, - .sse4_2, - .ssse3, .slow_incdec, .slow_lea, .slow_two_mem_ops, + .sse4_2, + .ssse3, .x87, .xsave, .xsavec, @@ -2152,50 +1964,47 @@ pub const cpu = struct { .xsaves, }), }; - pub const haswell = Cpu{ .name = "haswell", .llvm_name = "haswell", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .avx2, .bmi, .bmi2, .cmov, - .cx8, .cx16, + .cx8, .ermsb, .f16c, + .false_deps_lzcnt_tzcnt, + .false_deps_popcnt, + .fast_scalar_fsqrt, + .fast_shld_rotate, + .fast_variable_shuffle, .fma, .fsgsbase, .fxsr, - .fast_shld_rotate, - .fast_scalar_fsqrt, - .fast_variable_shuffle, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, - .false_deps_lzcnt_tzcnt, - .mmx, - .movbe, .macrofusion, .merge_to_threeway_branch, + .mmx, + .movbe, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .rdrnd, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const _i386 = Cpu{ .name = "_i386", .llvm_name = "i386", @@ -2204,7 +2013,6 @@ pub const cpu = struct { .x87, }), }; - pub const _i486 = Cpu{ .name = "_i486", .llvm_name = "i486", @@ -2213,7 +2021,6 @@ pub const cpu = struct { .x87, }), }; - pub const _i586 = Cpu{ .name = "_i586", .llvm_name = "i586", @@ -2223,7 +2030,6 @@ pub const cpu = struct { .x87, }), }; - pub const _i686 = Cpu{ .name = "_i686", .llvm_name = "i686", @@ -2234,49 +2040,52 @@ pub const cpu = struct { .x87, }), }; - pub const icelake_client = Cpu{ .name = "icelake_client", .llvm_name = "icelake-client", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, - .avx512f, .avx512bitalg, - .bmi, - .bmi2, .avx512bw, .avx512cd, + .avx512dq, + .avx512f, + .avx512ifma, + .avx512vbmi, + .avx512vbmi2, + .avx512vl, + .avx512vnni, + .avx512vpopcntdq, + .bmi, + .bmi2, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, + .fma, + .fsgsbase, + .fxsr, .gfni, - .fast_gather, - .avx512ifma, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, @@ -2285,18 +2094,13 @@ pub const cpu = struct { .rdpid, .rdrnd, .rdseed, + .sahf, .sgx, .sha, - .sse4_2, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .vaes, - .avx512vbmi, - .avx512vbmi2, - .avx512vl, - .avx512vnni, .vpclmulqdq, - .avx512vpopcntdq, .x87, .xsave, .xsavec, @@ -2304,49 +2108,52 @@ pub const cpu = struct { .xsaves, }), }; - pub const icelake_server = Cpu{ .name = "icelake_server", .llvm_name = "icelake-server", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, - .avx512f, .avx512bitalg, - .bmi, - .bmi2, .avx512bw, .avx512cd, + .avx512dq, + .avx512f, + .avx512ifma, + .avx512vbmi, + .avx512vbmi2, + .avx512vl, + .avx512vnni, + .avx512vpopcntdq, + .bmi, + .bmi2, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, + .fma, + .fsgsbase, + .fxsr, .gfni, - .fast_gather, - .avx512ifma, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pconfig, @@ -2356,18 +2163,13 @@ pub const cpu = struct { .rdpid, .rdrnd, .rdseed, + .sahf, .sgx, .sha, - .sse4_2, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .vaes, - .avx512vbmi, - .avx512vbmi2, - .avx512vl, - .avx512vnni, .vpclmulqdq, - .avx512vpopcntdq, .wbnoinvd, .x87, .xsave, @@ -2376,41 +2178,38 @@ pub const cpu = struct { .xsaves, }), }; - pub const ivybridge = Cpu{ .name = "ivybridge", .llvm_name = "ivybridge", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .cmov, - .cx8, .cx16, + .cx8, .f16c, + .false_deps_popcnt, + .fast_scalar_fsqrt, + .fast_shld_rotate, .fsgsbase, .fxsr, - .fast_shld_rotate, - .fast_scalar_fsqrt, - .sahf, - .mmx, + .idivq_to_divl, .macrofusion, .merge_to_threeway_branch, + .mmx, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .rdrnd, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_unaligned_mem_32, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const k6 = Cpu{ .name = "k6", .llvm_name = "k6", @@ -2421,108 +2220,96 @@ pub const cpu = struct { .x87, }), }; - - pub const k62 = Cpu{ + pub const k6_2 = Cpu{ .name = "k6_2", .llvm_name = "k6-2", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnow", .cx8, .slow_unaligned_mem_16, .x87, }), }; - - pub const k63 = Cpu{ + pub const k6_3 = Cpu{ .name = "k6_3", .llvm_name = "k6-3", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnow", .cx8, .slow_unaligned_mem_16, .x87, }), }; - pub const k8 = Cpu{ .name = "k8", .llvm_name = "k8", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, .cx8, - .fxsr, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse2, .slow_shld, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const k8_sse3 = Cpu{ .name = "k8_sse3", .llvm_name = "k8-sse3", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse3, .slow_shld, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const knl = Cpu{ .name = "knl", .llvm_name = "knl", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, + .avx512cd, + .avx512er, .avx512f, + .avx512pf, .bmi, .bmi2, - .avx512cd, .cmov, - .cx8, .cx16, - .avx512er, + .cx8, .f16c, + .fast_gather, + .fast_partial_ymm_or_zmm_write, .fma, .fsgsbase, .fxsr, - .fast_partial_ymm_or_zmm_write, - .fast_gather, - .sahf, + .idivq_to_divl, .lzcnt, .mmx, .movbe, .nopl, .pclmul, - .avx512pf, .popcnt, .prefetchwt1, .prfchw, .rdrnd, .rdseed, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_incdec, .slow_pmaddwd, .slow_two_mem_ops, @@ -2531,158 +2318,142 @@ pub const cpu = struct { .xsaveopt, }), }; - pub const knm = Cpu{ .name = "knm", .llvm_name = "knm", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, + .avx512cd, + .avx512er, .avx512f, + .avx512pf, + .avx512vpopcntdq, .bmi, .bmi2, - .avx512cd, .cmov, - .cx8, .cx16, - .avx512er, + .cx8, .f16c, + .fast_gather, + .fast_partial_ymm_or_zmm_write, .fma, .fsgsbase, .fxsr, - .fast_partial_ymm_or_zmm_write, - .fast_gather, - .sahf, + .idivq_to_divl, .lzcnt, .mmx, .movbe, .nopl, .pclmul, - .avx512pf, .popcnt, .prefetchwt1, .prfchw, .rdrnd, .rdseed, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_incdec, .slow_pmaddwd, .slow_two_mem_ops, - .avx512vpopcntdq, .x87, .xsave, .xsaveopt, }), }; - pub const lakemont = Cpu{ .name = "lakemont", .llvm_name = "lakemont", .features = 0, }; - pub const nehalem = Cpu{ .name = "nehalem", .llvm_name = "nehalem", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, - .mmx, .macrofusion, + .mmx, .nopl, .popcnt, - .sse, + .sahf, .sse4_2, .x87, }), }; - pub const nocona = Cpu{ .name = "nocona", .llvm_name = "nocona", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, .mmx, .nopl, - .sse, - .sse3, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const opteron = Cpu{ .name = "opteron", .llvm_name = "opteron", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, .cx8, - .fxsr, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse2, .slow_shld, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const opteron_sse3 = Cpu{ .name = "opteron_sse3", .llvm_name = "opteron-sse3", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnowa", .@"64bit", .cmov, - .cx8, .cx16, - .fxsr, + .cx8, .fast_scalar_shift_masks, + .fxsr, .nopl, - .sse, - .sse3, .slow_shld, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const penryn = Cpu{ .name = "penryn", .llvm_name = "penryn", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, - .mmx, .macrofusion, + .mmx, .nopl, - .sse, - .sse4_1, + .sahf, .slow_unaligned_mem_16, + .sse4_1, .x87, }), }; - pub const pentium = Cpu{ .name = "pentium", .llvm_name = "pentium", @@ -2692,7 +2463,6 @@ pub const cpu = struct { .x87, }), }; - pub const pentium_m = Cpu{ .name = "pentium_m", .llvm_name = "pentium-m", @@ -2702,13 +2472,11 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, - .sse2, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const pentium_mmx = Cpu{ .name = "pentium_mmx", .llvm_name = "pentium-mmx", @@ -2719,7 +2487,6 @@ pub const cpu = struct { .x87, }), }; - pub const pentium2 = Cpu{ .name = "pentium2", .llvm_name = "pentium2", @@ -2733,7 +2500,6 @@ pub const cpu = struct { .x87, }), }; - pub const pentium3 = Cpu{ .name = "pentium3", .llvm_name = "pentium3", @@ -2743,12 +2509,11 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const pentium3m = Cpu{ .name = "pentium3m", .llvm_name = "pentium3m", @@ -2758,12 +2523,11 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, .slow_unaligned_mem_16, + .sse, .x87, }), }; - pub const pentium4 = Cpu{ .name = "pentium4", .llvm_name = "pentium4", @@ -2773,13 +2537,11 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, - .sse2, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const pentium4m = Cpu{ .name = "pentium4m", .llvm_name = "pentium4m", @@ -2789,13 +2551,11 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, - .sse2, .slow_unaligned_mem_16, + .sse2, .x87, }), }; - pub const pentiumpro = Cpu{ .name = "pentiumpro", .llvm_name = "pentiumpro", @@ -2807,7 +2567,6 @@ pub const cpu = struct { .x87, }), }; - pub const prescott = Cpu{ .name = "prescott", .llvm_name = "prescott", @@ -2817,125 +2576,118 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, - .sse3, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const sandybridge = Cpu{ .name = "sandybridge", .llvm_name = "sandybridge", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .avx, .cmov, - .cx8, .cx16, - .fxsr, - .fast_shld_rotate, + .cx8, + .false_deps_popcnt, .fast_scalar_fsqrt, - .sahf, - .mmx, + .fast_shld_rotate, + .fxsr, + .idivq_to_divl, .macrofusion, .merge_to_threeway_branch, + .mmx, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, .slow_unaligned_mem_32, + .sse4_2, .x87, .xsave, .xsaveopt, }), }; - pub const silvermont = Cpu{ .name = "silvermont", .llvm_name = "silvermont", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, + .false_deps_popcnt, .fxsr, - .sahf, + .idivq_to_divl, .mmx, .movbe, .nopl, - .sse, .pclmul, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, - .sse4_2, - .ssse3, - .idivq_to_divl, + .sahf, .slow_incdec, .slow_lea, .slow_pmulld, .slow_two_mem_ops, + .sse4_2, + .ssse3, .x87, }), }; - pub const skx = Cpu{ .name = "skx", .llvm_name = "skx", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, + .avx512bw, + .avx512cd, + .avx512dq, .avx512f, + .avx512vl, .bmi, .bmi2, - .avx512bw, - .avx512cd, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .false_deps_popcnt, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, - .avx512vl, + .sse4_2, .x87, .xsave, .xsavec, @@ -2943,14 +2695,12 @@ pub const cpu = struct { .xsaves, }), }; - pub const skylake = Cpu{ .name = "skylake", .llvm_name = "skylake", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, @@ -2958,37 +2708,37 @@ pub const cpu = struct { .bmi2, .clflushopt, .cmov, - .cx8, .cx16, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .false_deps_popcnt, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, + .sahf, .sgx, - .sse4_2, .slow_3ops_lea, - .idivq_to_divl, + .sse4_2, .x87, .xsave, .xsavec, @@ -2996,58 +2746,56 @@ pub const cpu = struct { .xsaves, }), }; - pub const skylake_avx512 = Cpu{ .name = "skylake_avx512", .llvm_name = "skylake-avx512", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx, .avx2, + .avx512bw, + .avx512cd, + .avx512dq, .avx512f, + .avx512vl, .bmi, .bmi2, - .avx512bw, - .avx512cd, .clflushopt, .clwb, .cmov, - .cx8, .cx16, - .avx512dq, + .cx8, .ermsb, .f16c, - .fma, - .fsgsbase, - .fxsr, - .fast_shld_rotate, + .false_deps_popcnt, + .fast_gather, .fast_scalar_fsqrt, + .fast_shld_rotate, .fast_variable_shuffle, .fast_vector_fsqrt, - .fast_gather, + .fma, + .fsgsbase, + .fxsr, + .idivq_to_divl, .invpcid, - .sahf, .lzcnt, + .macrofusion, + .merge_to_threeway_branch, .mmx, .movbe, .mpx, - .macrofusion, - .merge_to_threeway_branch, .nopl, .pclmul, .pku, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, .rdseed, - .sse4_2, + .sahf, .slow_3ops_lea, - .idivq_to_divl, - .avx512vl, + .sse4_2, .x87, .xsave, .xsavec, @@ -3055,53 +2803,48 @@ pub const cpu = struct { .xsaves, }), }; - pub const slm = Cpu{ .name = "slm", .llvm_name = "slm", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, + .false_deps_popcnt, .fxsr, - .sahf, + .idivq_to_divl, .mmx, .movbe, .nopl, - .sse, .pclmul, .popcnt, - .false_deps_popcnt, .prfchw, .rdrnd, - .sse4_2, - .ssse3, - .idivq_to_divl, + .sahf, .slow_incdec, .slow_lea, .slow_pmulld, .slow_two_mem_ops, + .sse4_2, + .ssse3, .x87, }), }; - pub const tremont = Cpu{ .name = "tremont", .llvm_name = "tremont", .features = featureSet(&[_]Feature{ .@"64bit", - .sse, .aes, .cldemote, .clflushopt, .cmov, - .cx8, .cx16, + .cx8, .fsgsbase, .fxsr, .gfni, - .sahf, .mmx, .movbe, .movdir64b, @@ -3115,13 +2858,14 @@ pub const cpu = struct { .rdpid, .rdrnd, .rdseed, + .sahf, .sgx, .sha, - .sse4_2, - .ssse3, .slow_incdec, .slow_lea, .slow_two_mem_ops, + .sse4_2, + .ssse3, .waitpkg, .x87, .xsave, @@ -3130,28 +2874,25 @@ pub const cpu = struct { .xsaves, }), }; - pub const westmere = Cpu{ .name = "westmere", .llvm_name = "westmere", .features = featureSet(&[_]Feature{ .@"64bit", .cmov, - .cx8, .cx16, + .cx8, .fxsr, - .sahf, - .mmx, .macrofusion, + .mmx, .nopl, - .sse, .pclmul, .popcnt, + .sahf, .sse4_2, .x87, }), }; - pub const winchip_c6 = Cpu{ .name = "winchip_c6", .llvm_name = "winchip-c6", @@ -3161,18 +2902,15 @@ pub const cpu = struct { .x87, }), }; - pub const winchip2 = Cpu{ .name = "winchip2", .llvm_name = "winchip2", .features = featureSet(&[_]Feature{ - .mmx, .@"3dnow", .slow_unaligned_mem_16, .x87, }), }; - pub const x86_64 = Cpu{ .name = "x86_64", .llvm_name = "x86-64", @@ -3181,17 +2919,15 @@ pub const cpu = struct { .cmov, .cx8, .fxsr, - .mmx, .macrofusion, + .mmx, .nopl, - .sse, - .sse2, .slow_3ops_lea, .slow_incdec, + .sse2, .x87, }), }; - pub const yonah = Cpu{ .name = "yonah", .llvm_name = "yonah", @@ -3201,20 +2937,17 @@ pub const cpu = struct { .fxsr, .mmx, .nopl, - .sse, - .sse3, .slow_unaligned_mem_16, + .sse3, .x87, }), }; - pub const znver1 = Cpu{ .name = "znver1", .llvm_name = "znver1", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx2, .bmi, @@ -3223,17 +2956,15 @@ pub const cpu = struct { .clflushopt, .clzero, .cmov, - .cx8, .cx16, .f16c, - .fma, - .fsgsbase, - .fxsr, .fast_15bytenop, .fast_bextr, .fast_lzcnt, .fast_scalar_shift_masks, - .sahf, + .fma, + .fsgsbase, + .fxsr, .lzcnt, .mmx, .movbe, @@ -3244,9 +2975,10 @@ pub const cpu = struct { .prfchw, .rdrnd, .rdseed, + .sahf, .sha, - .sse4a, .slow_shld, + .sse4a, .x87, .xsave, .xsavec, @@ -3254,14 +2986,12 @@ pub const cpu = struct { .xsaves, }), }; - pub const znver2 = Cpu{ .name = "znver2", .llvm_name = "znver2", .features = featureSet(&[_]Feature{ .@"64bit", .adx, - .sse, .aes, .avx2, .bmi, @@ -3271,17 +3001,15 @@ pub const cpu = struct { .clwb, .clzero, .cmov, - .cx8, .cx16, .f16c, - .fma, - .fsgsbase, - .fxsr, .fast_15bytenop, .fast_bextr, .fast_lzcnt, .fast_scalar_shift_masks, - .sahf, + .fma, + .fsgsbase, + .fxsr, .lzcnt, .mmx, .movbe, @@ -3293,9 +3021,10 @@ pub const cpu = struct { .rdpid, .rdrnd, .rdseed, + .sahf, .sha, - .sse4a, .slow_shld, + .sse4a, .wbnoinvd, .x87, .xsave, @@ -3306,10 +3035,13 @@ pub const cpu = struct { }; }; +/// All x86 CPUs, sorted alphabetically by name. +/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 +/// compiler has inefficient memory and CPU usage, affecting build times. pub const all_cpus = &[_]*const Cpu{ &cpu.amdfam10, &cpu.athlon, - &cpu.athlon4, + &cpu.athlon_4, &cpu.athlon_fx, &cpu.athlon_mp, &cpu.athlon_tbird, @@ -3327,7 +3059,7 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.btver1, &cpu.btver2, &cpu.c3, - &cpu.c32, + &cpu.c3_2, &cpu.cannonlake, &cpu.cascadelake, &cpu.cooperlake, @@ -3349,8 +3081,8 @@ pub const all_cpus = &[_]*const Cpu{ &cpu.icelake_server, &cpu.ivybridge, &cpu.k6, - &cpu.k62, - &cpu.k63, + &cpu.k6_2, + &cpu.k6_3, &cpu.k8, &cpu.k8_sse3, &cpu.knl, |
