authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-26 16:33:40-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-26 16:36:14-07:00
log0ca3582a86da377a25ea144acf94531dd8a28722
treeb18114547c561264532a8f5aee68f225553bff53
parent1e7083d09cc77663560b4c971421bff06f2c6c12

update CPU features to LLVM 16


21 files changed, 1784 insertions(+), 155 deletions(-)

build.zig+7
......@@ -97,6 +97,11 @@ pub fn build(b: *Builder) !void {
9797 "llvm-has-arc",
9898 "Whether LLVM has the experimental target arc enabled",
9999 ) orelse false;
100 const llvm_has_xtensa = b.option(
101 bool,
102 "llvm-has-xtensa",
103 "Whether LLVM has the experimental target xtensa enabled",
104 ) orelse false;
100105 const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;
101106 const enable_symlinks_windows = b.option(bool, "enable-symlinks-windows", "Run tests requiring presence of symlinks on Windows") orelse false;
102107 const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
......@@ -186,6 +191,7 @@ pub fn build(b: *Builder) !void {
186191 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
187192 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
188193 exe_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
194 exe_options.addOption(bool, "llvm_has_xtensa", llvm_has_xtensa);
189195 exe_options.addOption(bool, "force_gpa", force_gpa);
190196 exe_options.addOption(bool, "only_c", only_c);
191197 exe_options.addOption(bool, "omit_pkg_fetching_code", false);
......@@ -340,6 +346,7 @@ pub fn build(b: *Builder) !void {
340346 test_cases_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
341347 test_cases_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
342348 test_cases_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
349 test_cases_options.addOption(bool, "llvm_has_xtensa", llvm_has_xtensa);
343350 test_cases_options.addOption(bool, "force_gpa", force_gpa);
344351 test_cases_options.addOption(bool, "only_c", only_c);
345352 test_cases_options.addOption(bool, "enable_qemu", b.enable_qemu);
lib/std/target.zig+21-1
......@@ -459,6 +459,7 @@ pub const Target = struct {
459459 pub const bpf = @import("target/bpf.zig");
460460 pub const csky = @import("target/csky.zig");
461461 pub const hexagon = @import("target/hexagon.zig");
462 pub const loongarch = @import("target/loongarch.zig");
462463 pub const m68k = @import("target/m68k.zig");
463464 pub const mips = @import("target/mips.zig");
464465 pub const msp430 = @import("target/msp430.zig");
......@@ -471,6 +472,7 @@ pub const Target = struct {
471472 pub const ve = @import("target/ve.zig");
472473 pub const wasm = @import("target/wasm.zig");
473474 pub const x86 = @import("target/x86.zig");
475 pub const xtensa = @import("target/xtensa.zig");
474476
475477 pub const Abi = enum {
476478 none,
......@@ -1007,6 +1009,7 @@ pub const Target = struct {
10071009 .thumbeb => .ARM,
10081010 .x86 => .@"386",
10091011 .xcore => .XCORE,
1012 .xtensa => .XTENSA,
10101013 .nvptx => .NONE,
10111014 .amdil => .NONE,
10121015 .hsail => .NONE,
......@@ -1032,7 +1035,7 @@ pub const Target = struct {
10321035 .spir64 => .NONE,
10331036 .wasm64 => .NONE,
10341037 .renderscript64 => .NONE,
1035 .amdgcn => .NONE,
1038 .amdgcn => .AMDGPU,
10361039 .bpfel => .BPF,
10371040 .bpfeb => .BPF,
10381041 .csky => .CSKY,
......@@ -1122,6 +1125,7 @@ pub const Target = struct {
11221125 .amdil64,
11231126 .bpfel,
11241127 .csky,
1128 .xtensa,
11251129 .hexagon,
11261130 .hsail,
11271131 .hsail64,
......@@ -1236,6 +1240,7 @@ pub const Target = struct {
12361240 .spirv32,
12371241 .loongarch32,
12381242 .dxil,
1243 .xtensa,
12391244 => return 32,
12401245
12411246 .aarch64,
......@@ -1271,6 +1276,7 @@ pub const Target = struct {
12711276 .arm, .armeb, .thumb, .thumbeb => "arm",
12721277 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
12731278 .bpfel, .bpfeb => "bpf",
1279 .loongarch32, .loongarch64 => "loongarch",
12741280 .mips, .mipsel, .mips64, .mips64el => "mips",
12751281 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",
12761282 .amdgcn => "amdgpu",
......@@ -1290,9 +1296,13 @@ pub const Target = struct {
12901296 return switch (arch) {
12911297 .arm, .armeb, .thumb, .thumbeb => &arm.all_features,
12921298 .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features,
1299 .arc => &arc.all_features,
12931300 .avr => &avr.all_features,
12941301 .bpfel, .bpfeb => &bpf.all_features,
1302 .csky => &csky.all_features,
12951303 .hexagon => &hexagon.all_features,
1304 .loongarch32, .loongarch64 => &loongarch.all_features,
1305 .m68k => &m68k.all_features,
12961306 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
12971307 .msp430 => &msp430.all_features,
12981308 .powerpc, .powerpcle, .powerpc64, .powerpc64le => &powerpc.all_features,
......@@ -1302,6 +1312,7 @@ pub const Target = struct {
13021312 .spirv32, .spirv64 => &spirv.all_features,
13031313 .s390x => &s390x.all_features,
13041314 .x86, .x86_64 => &x86.all_features,
1315 .xtensa => &xtensa.all_features,
13051316 .nvptx, .nvptx64 => &nvptx.all_features,
13061317 .ve => &ve.all_features,
13071318 .wasm32, .wasm64 => &wasm.all_features,
......@@ -1313,11 +1324,15 @@ pub const Target = struct {
13131324 /// All processors Zig is aware of, sorted lexicographically by name.
13141325 pub fn allCpuModels(arch: Arch) []const *const Cpu.Model {
13151326 return switch (arch) {
1327 .arc => comptime allCpusFromDecls(arc.cpu),
13161328 .arm, .armeb, .thumb, .thumbeb => comptime allCpusFromDecls(arm.cpu),
13171329 .aarch64, .aarch64_be, .aarch64_32 => comptime allCpusFromDecls(aarch64.cpu),
13181330 .avr => comptime allCpusFromDecls(avr.cpu),
13191331 .bpfel, .bpfeb => comptime allCpusFromDecls(bpf.cpu),
1332 .csky => comptime allCpusFromDecls(csky.cpu),
13201333 .hexagon => comptime allCpusFromDecls(hexagon.cpu),
1334 .loongarch32, .loongarch64 => comptime allCpusFromDecls(loongarch.cpu),
1335 .m68k => comptime allCpusFromDecls(m68k.cpu),
13211336 .mips, .mipsel, .mips64, .mips64el => comptime allCpusFromDecls(mips.cpu),
13221337 .msp430 => comptime allCpusFromDecls(msp430.cpu),
13231338 .powerpc, .powerpcle, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),
......@@ -1326,6 +1341,7 @@ pub const Target = struct {
13261341 .sparc, .sparc64, .sparcel => comptime allCpusFromDecls(sparc.cpu),
13271342 .s390x => comptime allCpusFromDecls(s390x.cpu),
13281343 .x86, .x86_64 => comptime allCpusFromDecls(x86.cpu),
1344 .xtensa => comptime allCpusFromDecls(xtensa.cpu),
13291345 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),
13301346 .ve => comptime allCpusFromDecls(ve.cpu),
13311347 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),
......@@ -1373,6 +1389,8 @@ pub const Target = struct {
13731389 .avr => &avr.cpu.avr2,
13741390 .bpfel, .bpfeb => &bpf.cpu.generic,
13751391 .hexagon => &hexagon.cpu.generic,
1392 .loongarch32 => &loongarch.cpu.generic_la32,
1393 .loongarch64 => &loongarch.cpu.generic_la64,
13761394 .m68k => &m68k.cpu.generic,
13771395 .mips, .mipsel => &mips.cpu.mips32,
13781396 .mips64, .mips64el => &mips.cpu.mips64,
......@@ -1720,6 +1738,7 @@ pub const Target = struct {
17201738 .dxil,
17211739 .loongarch32,
17221740 .loongarch64,
1741 .xtensa,
17231742 => return result,
17241743 },
17251744
......@@ -1884,6 +1903,7 @@ pub const Target = struct {
18841903 .dxil,
18851904 .loongarch32,
18861905 .loongarch64,
1906 .xtensa,
18871907 => 16,
18881908 };
18891909 }
lib/std/target/aarch64.zig+445-97
......@@ -20,6 +20,7 @@ pub const Feature = enum {
2020 arith_bcc_fusion,
2121 arith_cbz_fusion,
2222 ascend_store_address,
23 b16b16,
2324 balance_fp_ops,
2425 bf16,
2526 brbe,
......@@ -36,19 +37,23 @@ pub const Feature = enum {
3637 ccdp,
3738 ccidx,
3839 ccpp,
40 clrbhb,
3941 cmp_bcc_fusion,
4042 complxnum,
4143 contextidr_el2,
4244 cortex_r82,
4345 crc,
4446 crypto,
47 cssc,
4548 custom_cheap_as_move,
49 d128,
4650 disable_latency_sched_heuristic,
4751 dit,
4852 dotprod,
4953 ecv,
5054 el2vmsa,
5155 el3,
56 enable_select_opt,
5257 ete,
5358 exynos_cheap_as_move,
5459 f32mm,
......@@ -56,6 +61,7 @@ pub const Feature = enum {
5661 fgt,
5762 fix_cortex_a53_835769,
5863 flagm,
64 fmv,
5965 force_32bit_jump_tables,
6066 fp16fml,
6167 fp_armv8,
......@@ -74,17 +80,20 @@ pub const Feature = enum {
7480 hbc,
7581 hcx,
7682 i8mm,
83 ite,
7784 jsconv,
78 ldapr,
7985 lor,
8086 ls64,
8187 lse,
88 lse128,
8289 lse2,
8390 lsl_fast,
91 mec,
8492 mops,
8593 mpam,
8694 mte,
8795 neon,
96 nmi,
8897 no_bti_at_return_twice,
8998 no_neg_immediates,
9099 no_zcz_fp,
......@@ -96,9 +105,12 @@ pub const Feature = enum {
96105 perfmon,
97106 predictable_select_expensive,
98107 predres,
108 prfm_slc_target,
99109 rand,
100110 ras,
111 rasv2,
101112 rcpc,
113 rcpc3,
102114 rcpc_immo,
103115 rdm,
104116 reserve_x1,
......@@ -136,10 +148,14 @@ pub const Feature = enum {
136148 slow_strqro_store,
137149 sm4,
138150 sme,
139 sme_f64,
140 sme_i64,
151 sme2,
152 sme2p1,
153 sme_f16f16,
154 sme_f64f64,
155 sme_i16i64,
141156 spe,
142157 spe_eef,
158 specres2,
143159 specrestrict,
144160 ssbs,
145161 strict_align,
......@@ -149,7 +165,9 @@ pub const Feature = enum {
149165 sve2_bitperm,
150166 sve2_sha3,
151167 sve2_sm4,
168 sve2p1,
152169 tagged_globals,
170 the,
153171 tlb_rmi,
154172 tme,
155173 tpidr_el1,
......@@ -170,11 +188,13 @@ pub const Feature = enum {
170188 v8_6a,
171189 v8_7a,
172190 v8_8a,
191 v8_9a,
173192 v8a,
174193 v8r,
175194 v9_1a,
176195 v9_2a,
177196 v9_3a,
197 v9_4a,
178198 v9a,
179199 vh,
180200 wfxt,
......@@ -199,6 +219,7 @@ pub const all_features = blk: {
199219 .llvm_name = "a510",
200220 .description = "Cortex-A510 ARM processors",
201221 .dependencies = featureSet(&[_]Feature{
222 .fuse_adrp_add,
202223 .fuse_aes,
203224 .use_postra_scheduler,
204225 }),
......@@ -207,6 +228,7 @@ pub const all_features = blk: {
207228 .llvm_name = "a65",
208229 .description = "Cortex-A65 ARM processors",
209230 .dependencies = featureSet(&[_]Feature{
231 .enable_select_opt,
210232 .fuse_address,
211233 .fuse_adrp_add,
212234 .fuse_aes,
......@@ -218,7 +240,10 @@ pub const all_features = blk: {
218240 .description = "Cortex-A710 ARM processors",
219241 .dependencies = featureSet(&[_]Feature{
220242 .cmp_bcc_fusion,
243 .enable_select_opt,
244 .fuse_adrp_add,
221245 .fuse_aes,
246 .lsl_fast,
222247 .use_postra_scheduler,
223248 }),
224249 };
......@@ -226,7 +251,10 @@ pub const all_features = blk: {
226251 .llvm_name = "a76",
227252 .description = "Cortex-A76 ARM processors",
228253 .dependencies = featureSet(&[_]Feature{
254 .enable_select_opt,
255 .fuse_adrp_add,
229256 .fuse_aes,
257 .lsl_fast,
230258 }),
231259 };
232260 result[@enumToInt(Feature.a78)] = .{
......@@ -234,7 +262,10 @@ pub const all_features = blk: {
234262 .description = "Cortex-A78 ARM processors",
235263 .dependencies = featureSet(&[_]Feature{
236264 .cmp_bcc_fusion,
265 .enable_select_opt,
266 .fuse_adrp_add,
237267 .fuse_aes,
268 .lsl_fast,
238269 .use_postra_scheduler,
239270 }),
240271 };
......@@ -243,13 +274,16 @@ pub const all_features = blk: {
243274 .description = "Cortex-A78C ARM processors",
244275 .dependencies = featureSet(&[_]Feature{
245276 .cmp_bcc_fusion,
277 .enable_select_opt,
278 .fuse_adrp_add,
246279 .fuse_aes,
280 .lsl_fast,
247281 .use_postra_scheduler,
248282 }),
249283 };
250284 result[@enumToInt(Feature.aes)] = .{
251285 .llvm_name = "aes",
252 .description = "Enable AES support",
286 .description = "Enable AES support (FEAT_AES, FEAT_PMULL)",
253287 .dependencies = featureSet(&[_]Feature{
254288 .neon,
255289 }),
......@@ -266,17 +300,17 @@ pub const all_features = blk: {
266300 };
267301 result[@enumToInt(Feature.altnzcv)] = .{
268302 .llvm_name = "altnzcv",
269 .description = "Enable alternative NZCV format for floating point comparisons",
303 .description = "Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)",
270304 .dependencies = featureSet(&[_]Feature{}),
271305 };
272306 result[@enumToInt(Feature.am)] = .{
273307 .llvm_name = "am",
274 .description = "Enable v8.4-A Activity Monitors extension",
308 .description = "Enable v8.4-A Activity Monitors extension (FEAT_AMUv1)",
275309 .dependencies = featureSet(&[_]Feature{}),
276310 };
277311 result[@enumToInt(Feature.amvs)] = .{
278312 .llvm_name = "amvs",
279 .description = "Enable v8.6-A Activity Monitors Virtualization support",
313 .description = "Enable v8.6-A Activity Monitors Virtualization support (FEAT_AMUv1p1)",
280314 .dependencies = featureSet(&[_]Feature{
281315 .am,
282316 }),
......@@ -296,6 +330,11 @@ pub const all_features = blk: {
296330 .description = "Schedule vector stores by ascending address",
297331 .dependencies = featureSet(&[_]Feature{}),
298332 };
333 result[@enumToInt(Feature.b16b16)] = .{
334 .llvm_name = "b16b16",
335 .description = "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)",
336 .dependencies = featureSet(&[_]Feature{}),
337 };
299338 result[@enumToInt(Feature.balance_fp_ops)] = .{
300339 .llvm_name = "balance-fp-ops",
301340 .description = "balance mix of odd and even D-registers for fp multiply(-accumulate) ops",
......@@ -303,17 +342,17 @@ pub const all_features = blk: {
303342 };
304343 result[@enumToInt(Feature.bf16)] = .{
305344 .llvm_name = "bf16",
306 .description = "Enable BFloat16 Extension",
345 .description = "Enable BFloat16 Extension (FEAT_BF16)",
307346 .dependencies = featureSet(&[_]Feature{}),
308347 };
309348 result[@enumToInt(Feature.brbe)] = .{
310349 .llvm_name = "brbe",
311 .description = "Enable Branch Record Buffer Extension",
350 .description = "Enable Branch Record Buffer Extension (FEAT_BRBE)",
312351 .dependencies = featureSet(&[_]Feature{}),
313352 };
314353 result[@enumToInt(Feature.bti)] = .{
315354 .llvm_name = "bti",
316 .description = "Enable Branch Target Identification",
355 .description = "Enable Branch Target Identification (FEAT_BTI)",
317356 .dependencies = featureSet(&[_]Feature{}),
318357 };
319358 result[@enumToInt(Feature.call_saved_x10)] = .{
......@@ -363,17 +402,22 @@ pub const all_features = blk: {
363402 };
364403 result[@enumToInt(Feature.ccdp)] = .{
365404 .llvm_name = "ccdp",
366 .description = "Enable v8.5 Cache Clean to Point of Deep Persistence",
405 .description = "Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)",
367406 .dependencies = featureSet(&[_]Feature{}),
368407 };
369408 result[@enumToInt(Feature.ccidx)] = .{
370409 .llvm_name = "ccidx",
371 .description = "Enable v8.3-A Extend of the CCSIDR number of sets",
410 .description = "Enable v8.3-A Extend of the CCSIDR number of sets (FEAT_CCIDX)",
372411 .dependencies = featureSet(&[_]Feature{}),
373412 };
374413 result[@enumToInt(Feature.ccpp)] = .{
375414 .llvm_name = "ccpp",
376 .description = "Enable v8.2 data Cache Clean to Point of Persistence",
415 .description = "Enable v8.2 data Cache Clean to Point of Persistence (FEAT_DPB)",
416 .dependencies = featureSet(&[_]Feature{}),
417 };
418 result[@enumToInt(Feature.clrbhb)] = .{
419 .llvm_name = "clrbhb",
420 .description = "Enable Clear BHB instruction (FEAT_CLRBHB)",
377421 .dependencies = featureSet(&[_]Feature{}),
378422 };
379423 result[@enumToInt(Feature.cmp_bcc_fusion)] = .{
......@@ -383,7 +427,7 @@ pub const all_features = blk: {
383427 };
384428 result[@enumToInt(Feature.complxnum)] = .{
385429 .llvm_name = "complxnum",
386 .description = "Enable v8.3-A Floating-point complex number support",
430 .description = "Enable v8.3-A Floating-point complex number support (FEAT_FCMA)",
387431 .dependencies = featureSet(&[_]Feature{
388432 .neon,
389433 }),
......@@ -402,7 +446,7 @@ pub const all_features = blk: {
402446 };
403447 result[@enumToInt(Feature.crc)] = .{
404448 .llvm_name = "crc",
405 .description = "Enable ARMv8 CRC-32 checksum instructions",
449 .description = "Enable ARMv8 CRC-32 checksum instructions (FEAT_CRC32)",
406450 .dependencies = featureSet(&[_]Feature{}),
407451 };
408452 result[@enumToInt(Feature.crypto)] = .{
......@@ -413,11 +457,23 @@ pub const all_features = blk: {
413457 .sha2,
414458 }),
415459 };
460 result[@enumToInt(Feature.cssc)] = .{
461 .llvm_name = "cssc",
462 .description = "Enable Common Short Sequence Compression (CSSC) instructions (FEAT_CSSC)",
463 .dependencies = featureSet(&[_]Feature{}),
464 };
416465 result[@enumToInt(Feature.custom_cheap_as_move)] = .{
417466 .llvm_name = "custom-cheap-as-move",
418467 .description = "Use custom handling of cheap instructions",
419468 .dependencies = featureSet(&[_]Feature{}),
420469 };
470 result[@enumToInt(Feature.d128)] = .{
471 .llvm_name = "d128",
472 .description = "Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers and Instructions (FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128)",
473 .dependencies = featureSet(&[_]Feature{
474 .lse128,
475 }),
476 };
421477 result[@enumToInt(Feature.disable_latency_sched_heuristic)] = .{
422478 .llvm_name = "disable-latency-sched-heuristic",
423479 .description = "Disable latency scheduling heuristic",
......@@ -425,17 +481,17 @@ pub const all_features = blk: {
425481 };
426482 result[@enumToInt(Feature.dit)] = .{
427483 .llvm_name = "dit",
428 .description = "Enable v8.4-A Data Independent Timing instructions",
484 .description = "Enable v8.4-A Data Independent Timing instructions (FEAT_DIT)",
429485 .dependencies = featureSet(&[_]Feature{}),
430486 };
431487 result[@enumToInt(Feature.dotprod)] = .{
432488 .llvm_name = "dotprod",
433 .description = "Enable dot product support",
489 .description = "Enable dot product support (FEAT_DotProd)",
434490 .dependencies = featureSet(&[_]Feature{}),
435491 };
436492 result[@enumToInt(Feature.ecv)] = .{
437493 .llvm_name = "ecv",
438 .description = "Enable enhanced counter virtualization extension",
494 .description = "Enable enhanced counter virtualization extension (FEAT_ECV)",
439495 .dependencies = featureSet(&[_]Feature{}),
440496 };
441497 result[@enumToInt(Feature.el2vmsa)] = .{
......@@ -448,9 +504,14 @@ pub const all_features = blk: {
448504 .description = "Enable Exception Level 3",
449505 .dependencies = featureSet(&[_]Feature{}),
450506 };
507 result[@enumToInt(Feature.enable_select_opt)] = .{
508 .llvm_name = "enable-select-opt",
509 .description = "Enable the select optimize pass for select loop heuristics",
510 .dependencies = featureSet(&[_]Feature{}),
511 };
451512 result[@enumToInt(Feature.ete)] = .{
452513 .llvm_name = "ete",
453 .description = "Enable Embedded Trace Extension",
514 .description = "Enable Embedded Trace Extension (FEAT_ETE)",
454515 .dependencies = featureSet(&[_]Feature{
455516 .trbe,
456517 }),
......@@ -464,21 +525,21 @@ pub const all_features = blk: {
464525 };
465526 result[@enumToInt(Feature.f32mm)] = .{
466527 .llvm_name = "f32mm",
467 .description = "Enable Matrix Multiply FP32 Extension",
528 .description = "Enable Matrix Multiply FP32 Extension (FEAT_F32MM)",
468529 .dependencies = featureSet(&[_]Feature{
469530 .sve,
470531 }),
471532 };
472533 result[@enumToInt(Feature.f64mm)] = .{
473534 .llvm_name = "f64mm",
474 .description = "Enable Matrix Multiply FP64 Extension",
535 .description = "Enable Matrix Multiply FP64 Extension (FEAT_F64MM)",
475536 .dependencies = featureSet(&[_]Feature{
476537 .sve,
477538 }),
478539 };
479540 result[@enumToInt(Feature.fgt)] = .{
480541 .llvm_name = "fgt",
481 .description = "Enable fine grained virtualization traps extension",
542 .description = "Enable fine grained virtualization traps extension (FEAT_FGT)",
482543 .dependencies = featureSet(&[_]Feature{}),
483544 };
484545 result[@enumToInt(Feature.fix_cortex_a53_835769)] = .{
......@@ -488,7 +549,12 @@ pub const all_features = blk: {
488549 };
489550 result[@enumToInt(Feature.flagm)] = .{
490551 .llvm_name = "flagm",
491 .description = "Enable v8.4-A Flag Manipulation Instructions",
552 .description = "Enable v8.4-A Flag Manipulation Instructions (FEAT_FlagM)",
553 .dependencies = featureSet(&[_]Feature{}),
554 };
555 result[@enumToInt(Feature.fmv)] = .{
556 .llvm_name = "fmv",
557 .description = "Enable Function Multi Versioning support.",
492558 .dependencies = featureSet(&[_]Feature{}),
493559 };
494560 result[@enumToInt(Feature.force_32bit_jump_tables)] = .{
......@@ -498,24 +564,24 @@ pub const all_features = blk: {
498564 };
499565 result[@enumToInt(Feature.fp16fml)] = .{
500566 .llvm_name = "fp16fml",
501 .description = "Enable FP16 FML instructions",
567 .description = "Enable FP16 FML instructions (FEAT_FHM)",
502568 .dependencies = featureSet(&[_]Feature{
503569 .fullfp16,
504570 }),
505571 };
506572 result[@enumToInt(Feature.fp_armv8)] = .{
507573 .llvm_name = "fp-armv8",
508 .description = "Enable ARMv8 FP",
574 .description = "Enable ARMv8 FP (FEAT_FP)",
509575 .dependencies = featureSet(&[_]Feature{}),
510576 };
511577 result[@enumToInt(Feature.fptoint)] = .{
512578 .llvm_name = "fptoint",
513 .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",
579 .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 (FEAT_FRINTTS)",
514580 .dependencies = featureSet(&[_]Feature{}),
515581 };
516582 result[@enumToInt(Feature.fullfp16)] = .{
517583 .llvm_name = "fullfp16",
518 .description = "Full FP16",
584 .description = "Full FP16 (FEAT_FP16)",
519585 .dependencies = featureSet(&[_]Feature{
520586 .fp_armv8,
521587 }),
......@@ -572,49 +638,58 @@ pub const all_features = blk: {
572638 };
573639 result[@enumToInt(Feature.hbc)] = .{
574640 .llvm_name = "hbc",
575 .description = "Enable Armv8.8-A Hinted Conditional Branches Extension",
641 .description = "Enable Armv8.8-A Hinted Conditional Branches Extension (FEAT_HBC)",
576642 .dependencies = featureSet(&[_]Feature{}),
577643 };
578644 result[@enumToInt(Feature.hcx)] = .{
579645 .llvm_name = "hcx",
580 .description = "Enable Armv8.7-A HCRX_EL2 system register",
646 .description = "Enable Armv8.7-A HCRX_EL2 system register (FEAT_HCX)",
581647 .dependencies = featureSet(&[_]Feature{}),
582648 };
583649 result[@enumToInt(Feature.i8mm)] = .{
584650 .llvm_name = "i8mm",
585 .description = "Enable Matrix Multiply Int8 Extension",
651 .description = "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)",
586652 .dependencies = featureSet(&[_]Feature{}),
587653 };
654 result[@enumToInt(Feature.ite)] = .{
655 .llvm_name = "ite",
656 .description = "Enable Armv9.4-A Instrumentation Extension FEAT_ITE",
657 .dependencies = featureSet(&[_]Feature{
658 .ete,
659 }),
660 };
588661 result[@enumToInt(Feature.jsconv)] = .{
589662 .llvm_name = "jsconv",
590 .description = "Enable v8.3-A JavaScript FP conversion instructions",
663 .description = "Enable v8.3-A JavaScript FP conversion instructions (FEAT_JSCVT)",
591664 .dependencies = featureSet(&[_]Feature{
592665 .fp_armv8,
593666 }),
594667 };
595 result[@enumToInt(Feature.ldapr)] = .{
596 .llvm_name = "ldapr",
597 .description = "Use LDAPR to lower atomic loads; experimental until we have more testing/a formal correctness proof",
598 .dependencies = featureSet(&[_]Feature{}),
599 };
600668 result[@enumToInt(Feature.lor)] = .{
601669 .llvm_name = "lor",
602 .description = "Enables ARM v8.1 Limited Ordering Regions extension",
670 .description = "Enables ARM v8.1 Limited Ordering Regions extension (FEAT_LOR)",
603671 .dependencies = featureSet(&[_]Feature{}),
604672 };
605673 result[@enumToInt(Feature.ls64)] = .{
606674 .llvm_name = "ls64",
607 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension",
675 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)",
608676 .dependencies = featureSet(&[_]Feature{}),
609677 };
610678 result[@enumToInt(Feature.lse)] = .{
611679 .llvm_name = "lse",
612 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions",
680 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions (FEAT_LSE)",
613681 .dependencies = featureSet(&[_]Feature{}),
614682 };
683 result[@enumToInt(Feature.lse128)] = .{
684 .llvm_name = "lse128",
685 .description = "Enable Armv9.4-A 128-bit Atomic Instructions (FEAT_LSE128)",
686 .dependencies = featureSet(&[_]Feature{
687 .lse,
688 }),
689 };
615690 result[@enumToInt(Feature.lse2)] = .{
616691 .llvm_name = "lse2",
617 .description = "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules",
692 .description = "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules (FEAT_LSE2)",
618693 .dependencies = featureSet(&[_]Feature{}),
619694 };
620695 result[@enumToInt(Feature.lsl_fast)] = .{
......@@ -622,28 +697,40 @@ pub const all_features = blk: {
622697 .description = "CPU has a fastpath logical shift of up to 3 places",
623698 .dependencies = featureSet(&[_]Feature{}),
624699 };
700 result[@enumToInt(Feature.mec)] = .{
701 .llvm_name = "mec",
702 .description = "Enable Memory Encryption Contexts Extension",
703 .dependencies = featureSet(&[_]Feature{
704 .rme,
705 }),
706 };
625707 result[@enumToInt(Feature.mops)] = .{
626708 .llvm_name = "mops",
627 .description = "Enable Armv8.8-A memcpy and memset acceleration instructions",
709 .description = "Enable Armv8.8-A memcpy and memset acceleration instructions (FEAT_MOPS)",
628710 .dependencies = featureSet(&[_]Feature{}),
629711 };
630712 result[@enumToInt(Feature.mpam)] = .{
631713 .llvm_name = "mpam",
632 .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension",
714 .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension (FEAT_MPAM)",
633715 .dependencies = featureSet(&[_]Feature{}),
634716 };
635717 result[@enumToInt(Feature.mte)] = .{
636718 .llvm_name = "mte",
637 .description = "Enable Memory Tagging Extension",
719 .description = "Enable Memory Tagging Extension (FEAT_MTE, FEAT_MTE2)",
638720 .dependencies = featureSet(&[_]Feature{}),
639721 };
640722 result[@enumToInt(Feature.neon)] = .{
641723 .llvm_name = "neon",
642 .description = "Enable Advanced SIMD instructions",
724 .description = "Enable Advanced SIMD instructions (FEAT_AdvSIMD)",
643725 .dependencies = featureSet(&[_]Feature{
644726 .fp_armv8,
645727 }),
646728 };
729 result[@enumToInt(Feature.nmi)] = .{
730 .llvm_name = "nmi",
731 .description = "Enable Armv8.8-A Non-maskable Interrupts (FEAT_NMI, FEAT_GICv3_NMI)",
732 .dependencies = featureSet(&[_]Feature{}),
733 };
647734 result[@enumToInt(Feature.no_bti_at_return_twice)] = .{
648735 .llvm_name = "no-bti-at-return-twice",
649736 .description = "Don't place a BTI instruction after a return-twice",
......@@ -661,7 +748,7 @@ pub const all_features = blk: {
661748 };
662749 result[@enumToInt(Feature.nv)] = .{
663750 .llvm_name = "nv",
664 .description = "Enable v8.4-A Nested Virtualization Enchancement",
751 .description = "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)",
665752 .dependencies = featureSet(&[_]Feature{}),
666753 };
667754 result[@enumToInt(Feature.outline_atomics)] = .{
......@@ -671,24 +758,24 @@ pub const all_features = blk: {
671758 };
672759 result[@enumToInt(Feature.pan)] = .{
673760 .llvm_name = "pan",
674 .description = "Enables ARM v8.1 Privileged Access-Never extension",
761 .description = "Enables ARM v8.1 Privileged Access-Never extension (FEAT_PAN)",
675762 .dependencies = featureSet(&[_]Feature{}),
676763 };
677764 result[@enumToInt(Feature.pan_rwv)] = .{
678765 .llvm_name = "pan-rwv",
679 .description = "Enable v8.2 PAN s1e1R and s1e1W Variants",
766 .description = "Enable v8.2 PAN s1e1R and s1e1W Variants (FEAT_PAN2)",
680767 .dependencies = featureSet(&[_]Feature{
681768 .pan,
682769 }),
683770 };
684771 result[@enumToInt(Feature.pauth)] = .{
685772 .llvm_name = "pauth",
686 .description = "Enable v8.3-A Pointer Authentication extension",
773 .description = "Enable v8.3-A Pointer Authentication extension (FEAT_PAuth)",
687774 .dependencies = featureSet(&[_]Feature{}),
688775 };
689776 result[@enumToInt(Feature.perfmon)] = .{
690777 .llvm_name = "perfmon",
691 .description = "Enable ARMv8 PMUv3 Performance Monitors extension",
778 .description = "Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension (FEAT_PMUv3)",
692779 .dependencies = featureSet(&[_]Feature{}),
693780 };
694781 result[@enumToInt(Feature.predictable_select_expensive)] = .{
......@@ -698,34 +785,53 @@ pub const all_features = blk: {
698785 };
699786 result[@enumToInt(Feature.predres)] = .{
700787 .llvm_name = "predres",
701 .description = "Enable v8.5a execution and data prediction invalidation instructions",
788 .description = "Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)",
789 .dependencies = featureSet(&[_]Feature{}),
790 };
791 result[@enumToInt(Feature.prfm_slc_target)] = .{
792 .llvm_name = "prfm-slc-target",
793 .description = "Enable SLC target for PRFM instruction",
702794 .dependencies = featureSet(&[_]Feature{}),
703795 };
704796 result[@enumToInt(Feature.rand)] = .{
705797 .llvm_name = "rand",
706 .description = "Enable Random Number generation instructions",
798 .description = "Enable Random Number generation instructions (FEAT_RNG)",
707799 .dependencies = featureSet(&[_]Feature{}),
708800 };
709801 result[@enumToInt(Feature.ras)] = .{
710802 .llvm_name = "ras",
711 .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions",
803 .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions (FEAT_RAS, FEAT_RASv1p1)",
712804 .dependencies = featureSet(&[_]Feature{}),
713805 };
806 result[@enumToInt(Feature.rasv2)] = .{
807 .llvm_name = "rasv2",
808 .description = "Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions (FEAT_RASv2)",
809 .dependencies = featureSet(&[_]Feature{
810 .ras,
811 }),
812 };
714813 result[@enumToInt(Feature.rcpc)] = .{
715814 .llvm_name = "rcpc",
716 .description = "Enable support for RCPC extension",
815 .description = "Enable support for RCPC extension (FEAT_LRCPC)",
717816 .dependencies = featureSet(&[_]Feature{}),
718817 };
818 result[@enumToInt(Feature.rcpc3)] = .{
819 .llvm_name = "rcpc3",
820 .description = "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set (FEAT_LRCPC3)",
821 .dependencies = featureSet(&[_]Feature{
822 .rcpc_immo,
823 }),
824 };
719825 result[@enumToInt(Feature.rcpc_immo)] = .{
720826 .llvm_name = "rcpc-immo",
721 .description = "Enable v8.4-A RCPC instructions with Immediate Offsets",
827 .description = "Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
722828 .dependencies = featureSet(&[_]Feature{
723829 .rcpc,
724830 }),
725831 };
726832 result[@enumToInt(Feature.rdm)] = .{
727833 .llvm_name = "rdm",
728 .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions",
834 .description = "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions (FEAT_RDM)",
729835 .dependencies = featureSet(&[_]Feature{}),
730836 };
731837 result[@enumToInt(Feature.reserve_x1)] = .{
......@@ -855,29 +961,29 @@ pub const all_features = blk: {
855961 };
856962 result[@enumToInt(Feature.rme)] = .{
857963 .llvm_name = "rme",
858 .description = "Enable Realm Management Extension",
964 .description = "Enable Realm Management Extension (FEAT_RME)",
859965 .dependencies = featureSet(&[_]Feature{}),
860966 };
861967 result[@enumToInt(Feature.sb)] = .{
862968 .llvm_name = "sb",
863 .description = "Enable v8.5 Speculation Barrier",
969 .description = "Enable v8.5 Speculation Barrier (FEAT_SB)",
864970 .dependencies = featureSet(&[_]Feature{}),
865971 };
866972 result[@enumToInt(Feature.sel2)] = .{
867973 .llvm_name = "sel2",
868 .description = "Enable v8.4-A Secure Exception Level 2 extension",
974 .description = "Enable v8.4-A Secure Exception Level 2 extension (FEAT_SEL2)",
869975 .dependencies = featureSet(&[_]Feature{}),
870976 };
871977 result[@enumToInt(Feature.sha2)] = .{
872978 .llvm_name = "sha2",
873 .description = "Enable SHA1 and SHA256 support",
979 .description = "Enable SHA1 and SHA256 support (FEAT_SHA1, FEAT_SHA256)",
874980 .dependencies = featureSet(&[_]Feature{
875981 .neon,
876982 }),
877983 };
878984 result[@enumToInt(Feature.sha3)] = .{
879985 .llvm_name = "sha3",
880 .description = "Enable SHA512 and SHA3 support",
986 .description = "Enable SHA512 and SHA3 support (FEAT_SHA3, FEAT_SHA512)",
881987 .dependencies = featureSet(&[_]Feature{
882988 .sha2,
883989 }),
......@@ -899,51 +1005,77 @@ pub const all_features = blk: {
8991005 };
9001006 result[@enumToInt(Feature.sm4)] = .{
9011007 .llvm_name = "sm4",
902 .description = "Enable SM3 and SM4 support",
1008 .description = "Enable SM3 and SM4 support (FEAT_SM4, FEAT_SM3)",
9031009 .dependencies = featureSet(&[_]Feature{
9041010 .neon,
9051011 }),
9061012 };
9071013 result[@enumToInt(Feature.sme)] = .{
9081014 .llvm_name = "sme",
909 .description = "Enable Scalable Matrix Extension (SME)",
1015 .description = "Enable Scalable Matrix Extension (SME) (FEAT_SME)",
9101016 .dependencies = featureSet(&[_]Feature{
9111017 .bf16,
9121018 .use_scalar_inc_vl,
9131019 }),
9141020 };
915 result[@enumToInt(Feature.sme_f64)] = .{
916 .llvm_name = "sme-f64",
917 .description = "Enable Scalable Matrix Extension (SME) F64F64 instructions",
1021 result[@enumToInt(Feature.sme2)] = .{
1022 .llvm_name = "sme2",
1023 .description = "Enable Scalable Matrix Extension 2 (SME2) instructions",
9181024 .dependencies = featureSet(&[_]Feature{
9191025 .sme,
9201026 }),
9211027 };
922 result[@enumToInt(Feature.sme_i64)] = .{
923 .llvm_name = "sme-i64",
924 .description = "Enable Scalable Matrix Extension (SME) I16I64 instructions",
1028 result[@enumToInt(Feature.sme2p1)] = .{
1029 .llvm_name = "sme2p1",
1030 .description = "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions",
1031 .dependencies = featureSet(&[_]Feature{
1032 .sme2,
1033 }),
1034 };
1035 result[@enumToInt(Feature.sme_f16f16)] = .{
1036 .llvm_name = "sme-f16f16",
1037 .description = "Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)",
1038 .dependencies = featureSet(&[_]Feature{}),
1039 };
1040 result[@enumToInt(Feature.sme_f64f64)] = .{
1041 .llvm_name = "sme-f64f64",
1042 .description = "Enable Scalable Matrix Extension (SME) F64F64 instructions (FEAT_SME_F64F64)",
1043 .dependencies = featureSet(&[_]Feature{
1044 .sme,
1045 }),
1046 };
1047 result[@enumToInt(Feature.sme_i16i64)] = .{
1048 .llvm_name = "sme-i16i64",
1049 .description = "Enable Scalable Matrix Extension (SME) I16I64 instructions (FEAT_SME_I16I64)",
9251050 .dependencies = featureSet(&[_]Feature{
9261051 .sme,
9271052 }),
9281053 };
9291054 result[@enumToInt(Feature.spe)] = .{
9301055 .llvm_name = "spe",
931 .description = "Enable Statistical Profiling extension",
1056 .description = "Enable Statistical Profiling extension (FEAT_SPE)",
9321057 .dependencies = featureSet(&[_]Feature{}),
9331058 };
9341059 result[@enumToInt(Feature.spe_eef)] = .{
9351060 .llvm_name = "spe-eef",
936 .description = "Enable extra register in the Statistical Profiling Extension",
1061 .description = "Enable extra register in the Statistical Profiling Extension (FEAT_SPEv1p2)",
9371062 .dependencies = featureSet(&[_]Feature{}),
9381063 };
1064 result[@enumToInt(Feature.specres2)] = .{
1065 .llvm_name = "specres2",
1066 .description = "Enable Speculation Restriction Instruction (FEAT_SPECRES2)",
1067 .dependencies = featureSet(&[_]Feature{
1068 .predres,
1069 }),
1070 };
9391071 result[@enumToInt(Feature.specrestrict)] = .{
9401072 .llvm_name = "specrestrict",
941 .description = "Enable architectural speculation restriction",
1073 .description = "Enable architectural speculation restriction (FEAT_CSV2_2)",
9421074 .dependencies = featureSet(&[_]Feature{}),
9431075 };
9441076 result[@enumToInt(Feature.ssbs)] = .{
9451077 .llvm_name = "ssbs",
946 .description = "Enable Speculative Store Bypass Safe bit",
1078 .description = "Enable Speculative Store Bypass Safe bit (FEAT_SSBS, FEAT_SSBS2)",
9471079 .dependencies = featureSet(&[_]Feature{}),
9481080 };
9491081 result[@enumToInt(Feature.strict_align)] = .{
......@@ -953,14 +1085,14 @@ pub const all_features = blk: {
9531085 };
9541086 result[@enumToInt(Feature.sve)] = .{
9551087 .llvm_name = "sve",
956 .description = "Enable Scalable Vector Extension (SVE) instructions",
1088 .description = "Enable Scalable Vector Extension (SVE) instructions (FEAT_SVE)",
9571089 .dependencies = featureSet(&[_]Feature{
9581090 .fullfp16,
9591091 }),
9601092 };
9611093 result[@enumToInt(Feature.sve2)] = .{
9621094 .llvm_name = "sve2",
963 .description = "Enable Scalable Vector Extension 2 (SVE2) instructions",
1095 .description = "Enable Scalable Vector Extension 2 (SVE2) instructions (FEAT_SVE2)",
9641096 .dependencies = featureSet(&[_]Feature{
9651097 .sve,
9661098 .use_scalar_inc_vl,
......@@ -968,7 +1100,7 @@ pub const all_features = blk: {
9681100 };
9691101 result[@enumToInt(Feature.sve2_aes)] = .{
9701102 .llvm_name = "sve2-aes",
971 .description = "Enable AES SVE2 instructions",
1103 .description = "Enable AES SVE2 instructions (FEAT_SVE_AES, FEAT_SVE_PMULL128)",
9721104 .dependencies = featureSet(&[_]Feature{
9731105 .aes,
9741106 .sve2,
......@@ -976,14 +1108,14 @@ pub const all_features = blk: {
9761108 };
9771109 result[@enumToInt(Feature.sve2_bitperm)] = .{
9781110 .llvm_name = "sve2-bitperm",
979 .description = "Enable bit permutation SVE2 instructions",
1111 .description = "Enable bit permutation SVE2 instructions (FEAT_SVE_BitPerm)",
9801112 .dependencies = featureSet(&[_]Feature{
9811113 .sve2,
9821114 }),
9831115 };
9841116 result[@enumToInt(Feature.sve2_sha3)] = .{
9851117 .llvm_name = "sve2-sha3",
986 .description = "Enable SHA3 SVE2 instructions",
1118 .description = "Enable SHA3 SVE2 instructions (FEAT_SVE_SHA3)",
9871119 .dependencies = featureSet(&[_]Feature{
9881120 .sha3,
9891121 .sve2,
......@@ -991,25 +1123,37 @@ pub const all_features = blk: {
9911123 };
9921124 result[@enumToInt(Feature.sve2_sm4)] = .{
9931125 .llvm_name = "sve2-sm4",
994 .description = "Enable SM4 SVE2 instructions",
1126 .description = "Enable SM4 SVE2 instructions (FEAT_SVE_SM4)",
9951127 .dependencies = featureSet(&[_]Feature{
9961128 .sm4,
9971129 .sve2,
9981130 }),
9991131 };
1132 result[@enumToInt(Feature.sve2p1)] = .{
1133 .llvm_name = "sve2p1",
1134 .description = "Enable Scalable Vector Extension 2.1 instructions",
1135 .dependencies = featureSet(&[_]Feature{
1136 .sve2,
1137 }),
1138 };
10001139 result[@enumToInt(Feature.tagged_globals)] = .{
10011140 .llvm_name = "tagged-globals",
10021141 .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits",
10031142 .dependencies = featureSet(&[_]Feature{}),
10041143 };
1144 result[@enumToInt(Feature.the)] = .{
1145 .llvm_name = "the",
1146 .description = "Enable Armv8.9-A Translation Hardening Extension (FEAT_THE)",
1147 .dependencies = featureSet(&[_]Feature{}),
1148 };
10051149 result[@enumToInt(Feature.tlb_rmi)] = .{
10061150 .llvm_name = "tlb-rmi",
1007 .description = "Enable v8.4-A TLB Range and Maintenance Instructions",
1151 .description = "Enable v8.4-A TLB Range and Maintenance Instructions (FEAT_TLBIOS, FEAT_TLBIRANGE)",
10081152 .dependencies = featureSet(&[_]Feature{}),
10091153 };
10101154 result[@enumToInt(Feature.tme)] = .{
10111155 .llvm_name = "tme",
1012 .description = "Enable Transactional Memory Extension",
1156 .description = "Enable Transactional Memory Extension (FEAT_TME)",
10131157 .dependencies = featureSet(&[_]Feature{}),
10141158 };
10151159 result[@enumToInt(Feature.tpidr_el1)] = .{
......@@ -1029,17 +1173,17 @@ pub const all_features = blk: {
10291173 };
10301174 result[@enumToInt(Feature.tracev8_4)] = .{
10311175 .llvm_name = "tracev8.4",
1032 .description = "Enable v8.4-A Trace extension",
1176 .description = "Enable v8.4-A Trace extension (FEAT_TRF)",
10331177 .dependencies = featureSet(&[_]Feature{}),
10341178 };
10351179 result[@enumToInt(Feature.trbe)] = .{
10361180 .llvm_name = "trbe",
1037 .description = "Enable Trace Buffer Extension",
1181 .description = "Enable Trace Buffer Extension (FEAT_TRBE)",
10381182 .dependencies = featureSet(&[_]Feature{}),
10391183 };
10401184 result[@enumToInt(Feature.uaops)] = .{
10411185 .llvm_name = "uaops",
1042 .description = "Enable v8.2 UAO PState",
1186 .description = "Enable v8.2 UAO PState (FEAT_UAO)",
10431187 .dependencies = featureSet(&[_]Feature{}),
10441188 };
10451189 result[@enumToInt(Feature.use_experimental_zeroing_pseudos)] = .{
......@@ -1159,9 +1303,22 @@ pub const all_features = blk: {
11591303 .dependencies = featureSet(&[_]Feature{
11601304 .hbc,
11611305 .mops,
1306 .nmi,
11621307 .v8_7a,
11631308 }),
11641309 };
1310 result[@enumToInt(Feature.v8_9a)] = .{
1311 .llvm_name = "v8.9a",
1312 .description = "Support ARM v8.9a instructions",
1313 .dependencies = featureSet(&[_]Feature{
1314 .clrbhb,
1315 .cssc,
1316 .prfm_slc_target,
1317 .rasv2,
1318 .specres2,
1319 .v8_8a,
1320 }),
1321 };
11651322 result[@enumToInt(Feature.v8a)] = .{
11661323 .llvm_name = "v8a",
11671324 .description = "Support ARM v8.0a instructions",
......@@ -1221,29 +1378,38 @@ pub const all_features = blk: {
12211378 .v9_2a,
12221379 }),
12231380 };
1381 result[@enumToInt(Feature.v9_4a)] = .{
1382 .llvm_name = "v9.4a",
1383 .description = "Support ARM v9.4a instructions",
1384 .dependencies = featureSet(&[_]Feature{
1385 .v8_9a,
1386 .v9_3a,
1387 }),
1388 };
12241389 result[@enumToInt(Feature.v9a)] = .{
12251390 .llvm_name = "v9a",
12261391 .description = "Support ARM v9a instructions",
12271392 .dependencies = featureSet(&[_]Feature{
1393 .mec,
12281394 .sve2,
12291395 .v8_5a,
12301396 }),
12311397 };
12321398 result[@enumToInt(Feature.vh)] = .{
12331399 .llvm_name = "vh",
1234 .description = "Enables ARM v8.1 Virtual Host extension",
1400 .description = "Enables ARM v8.1 Virtual Host extension (FEAT_VHE)",
12351401 .dependencies = featureSet(&[_]Feature{
12361402 .contextidr_el2,
12371403 }),
12381404 };
12391405 result[@enumToInt(Feature.wfxt)] = .{
12401406 .llvm_name = "wfxt",
1241 .description = "Enable Armv8.7-A WFET and WFIT instruction",
1407 .description = "Enable Armv8.7-A WFET and WFIT instruction (FEAT_WFxT)",
12421408 .dependencies = featureSet(&[_]Feature{}),
12431409 };
12441410 result[@enumToInt(Feature.xs)] = .{
12451411 .llvm_name = "xs",
1246 .description = "Enable Armv8.7-A limited-TLB-maintenance instruction",
1412 .description = "Enable Armv8.7-A limited-TLB-maintenance instruction (FEAT_XS)",
12471413 .dependencies = featureSet(&[_]Feature{}),
12481414 };
12491415 result[@enumToInt(Feature.zcm)] = .{
......@@ -1296,6 +1462,26 @@ pub const cpu = struct {
12961462 .name = "ampere1",
12971463 .llvm_name = "ampere1",
12981464 .features = featureSet(&[_]Feature{
1465 .aes,
1466 .aggressive_fma,
1467 .arith_bcc_fusion,
1468 .cmp_bcc_fusion,
1469 .fuse_address,
1470 .fuse_aes,
1471 .fuse_literals,
1472 .lsl_fast,
1473 .perfmon,
1474 .rand,
1475 .sha3,
1476 .use_postra_scheduler,
1477 .v8_6a,
1478 }),
1479 };
1480 pub const ampere1a = CpuModel{
1481 .name = "ampere1a",
1482 .llvm_name = "ampere1a",
1483 .features = featureSet(&[_]Feature{
1484 .aes,
12991485 .aggressive_fma,
13001486 .arith_bcc_fusion,
13011487 .cmp_bcc_fusion,
......@@ -1305,6 +1491,9 @@ pub const cpu = struct {
13051491 .lsl_fast,
13061492 .mte,
13071493 .perfmon,
1494 .rand,
1495 .sha3,
1496 .sm4,
13081497 .use_postra_scheduler,
13091498 .v8_6a,
13101499 }),
......@@ -1418,6 +1607,53 @@ pub const cpu = struct {
14181607 .zcz,
14191608 }),
14201609 };
1610 pub const apple_a15 = CpuModel{
1611 .name = "apple_a15",
1612 .llvm_name = "apple-a15",
1613 .features = featureSet(&[_]Feature{
1614 .alternate_sextload_cvt_f32_pattern,
1615 .arith_bcc_fusion,
1616 .arith_cbz_fusion,
1617 .crypto,
1618 .disable_latency_sched_heuristic,
1619 .fp16fml,
1620 .fuse_address,
1621 .fuse_aes,
1622 .fuse_arith_logic,
1623 .fuse_crypto_eor,
1624 .fuse_csel,
1625 .fuse_literals,
1626 .perfmon,
1627 .sha3,
1628 .v8_6a,
1629 .zcm,
1630 .zcz,
1631 }),
1632 };
1633 pub const apple_a16 = CpuModel{
1634 .name = "apple_a16",
1635 .llvm_name = "apple-a16",
1636 .features = featureSet(&[_]Feature{
1637 .alternate_sextload_cvt_f32_pattern,
1638 .arith_bcc_fusion,
1639 .arith_cbz_fusion,
1640 .crypto,
1641 .disable_latency_sched_heuristic,
1642 .fp16fml,
1643 .fuse_address,
1644 .fuse_aes,
1645 .fuse_arith_logic,
1646 .fuse_crypto_eor,
1647 .fuse_csel,
1648 .fuse_literals,
1649 .hcx,
1650 .perfmon,
1651 .sha3,
1652 .v8_6a,
1653 .zcm,
1654 .zcz,
1655 }),
1656 };
14211657 pub const apple_a7 = CpuModel{
14221658 .name = "apple_a7",
14231659 .llvm_name = "apple-a7",
......@@ -1476,30 +1712,22 @@ pub const cpu = struct {
14761712 .name = "apple_latest",
14771713 .llvm_name = "apple-latest",
14781714 .features = featureSet(&[_]Feature{
1479 .aggressive_fma,
14801715 .alternate_sextload_cvt_f32_pattern,
1481 .altnzcv,
14821716 .arith_bcc_fusion,
14831717 .arith_cbz_fusion,
1484 .ccdp,
14851718 .crypto,
14861719 .disable_latency_sched_heuristic,
14871720 .fp16fml,
1488 .fptoint,
14891721 .fuse_address,
1490 .fuse_adrp_add,
14911722 .fuse_aes,
14921723 .fuse_arith_logic,
14931724 .fuse_crypto_eor,
14941725 .fuse_csel,
14951726 .fuse_literals,
1727 .hcx,
14961728 .perfmon,
1497 .predres,
1498 .sb,
14991729 .sha3,
1500 .specrestrict,
1501 .ssbs,
1502 .v8_4a,
1730 .v8_6a,
15031731 .zcm,
15041732 .zcz,
15051733 }),
......@@ -1536,6 +1764,29 @@ pub const cpu = struct {
15361764 .zcz,
15371765 }),
15381766 };
1767 pub const apple_m2 = CpuModel{
1768 .name = "apple_m2",
1769 .llvm_name = "apple-m2",
1770 .features = featureSet(&[_]Feature{
1771 .alternate_sextload_cvt_f32_pattern,
1772 .arith_bcc_fusion,
1773 .arith_cbz_fusion,
1774 .crypto,
1775 .disable_latency_sched_heuristic,
1776 .fp16fml,
1777 .fuse_address,
1778 .fuse_aes,
1779 .fuse_arith_logic,
1780 .fuse_crypto_eor,
1781 .fuse_csel,
1782 .fuse_literals,
1783 .perfmon,
1784 .sha3,
1785 .v8_6a,
1786 .zcm,
1787 .zcz,
1788 }),
1789 };
15391790 pub const apple_s4 = CpuModel{
15401791 .name = "apple_s4",
15411792 .llvm_name = "apple-s4",
......@@ -1624,6 +1875,7 @@ pub const cpu = struct {
16241875 .crc,
16251876 .crypto,
16261877 .custom_cheap_as_move,
1878 .fuse_adrp_add,
16271879 .fuse_aes,
16281880 .perfmon,
16291881 .use_postra_scheduler,
......@@ -1638,6 +1890,7 @@ pub const cpu = struct {
16381890 .dotprod,
16391891 .fullfp16,
16401892 .fuse_address,
1893 .fuse_adrp_add,
16411894 .fuse_aes,
16421895 .perfmon,
16431896 .rcpc,
......@@ -1653,6 +1906,7 @@ pub const cpu = struct {
16531906 .crc,
16541907 .crypto,
16551908 .custom_cheap_as_move,
1909 .enable_select_opt,
16561910 .fuse_adrp_add,
16571911 .fuse_aes,
16581912 .fuse_literals,
......@@ -1705,12 +1959,34 @@ pub const cpu = struct {
17051959 .v9a,
17061960 }),
17071961 };
1962 pub const cortex_a715 = CpuModel{
1963 .name = "cortex_a715",
1964 .llvm_name = "cortex-a715",
1965 .features = featureSet(&[_]Feature{
1966 .bf16,
1967 .cmp_bcc_fusion,
1968 .enable_select_opt,
1969 .ete,
1970 .fp16fml,
1971 .fuse_adrp_add,
1972 .fuse_aes,
1973 .i8mm,
1974 .lsl_fast,
1975 .mte,
1976 .perfmon,
1977 .spe,
1978 .sve2_bitperm,
1979 .use_postra_scheduler,
1980 .v9a,
1981 }),
1982 };
17081983 pub const cortex_a72 = CpuModel{
17091984 .name = "cortex_a72",
17101985 .llvm_name = "cortex-a72",
17111986 .features = featureSet(&[_]Feature{
17121987 .crc,
17131988 .crypto,
1989 .enable_select_opt,
17141990 .fuse_adrp_add,
17151991 .fuse_aes,
17161992 .fuse_literals,
......@@ -1724,6 +2000,8 @@ pub const cpu = struct {
17242000 .features = featureSet(&[_]Feature{
17252001 .crc,
17262002 .crypto,
2003 .enable_select_opt,
2004 .fuse_adrp_add,
17272005 .fuse_aes,
17282006 .perfmon,
17292007 .v8a,
......@@ -1735,7 +2013,9 @@ pub const cpu = struct {
17352013 .features = featureSet(&[_]Feature{
17362014 .crypto,
17372015 .dotprod,
2016 .enable_select_opt,
17382017 .fullfp16,
2018 .fuse_adrp_add,
17392019 .fuse_aes,
17402020 .perfmon,
17412021 .rcpc,
......@@ -1777,8 +2057,11 @@ pub const cpu = struct {
17772057 .cmp_bcc_fusion,
17782058 .crypto,
17792059 .dotprod,
2060 .enable_select_opt,
17802061 .fullfp16,
2062 .fuse_adrp_add,
17812063 .fuse_aes,
2064 .lsl_fast,
17822065 .perfmon,
17832066 .rcpc,
17842067 .ssbs,
......@@ -1837,8 +2120,11 @@ pub const cpu = struct {
18372120 .cmp_bcc_fusion,
18382121 .crypto,
18392122 .dotprod,
2123 .enable_select_opt,
18402124 .fullfp16,
2125 .fuse_adrp_add,
18412126 .fuse_aes,
2127 .lsl_fast,
18422128 .perfmon,
18432129 .rcpc,
18442130 .spe,
......@@ -1854,11 +2140,16 @@ pub const cpu = struct {
18542140 .cmp_bcc_fusion,
18552141 .crypto,
18562142 .dotprod,
2143 .enable_select_opt,
2144 .flagm,
18572145 .fullfp16,
2146 .fuse_adrp_add,
18582147 .fuse_aes,
2148 .lse2,
2149 .lsl_fast,
18592150 .pauth,
18602151 .perfmon,
1861 .rcpc,
2152 .rcpc_immo,
18622153 .spe,
18632154 .ssbs,
18642155 .use_postra_scheduler,
......@@ -1871,12 +2162,35 @@ pub const cpu = struct {
18712162 .features = featureSet(&[_]Feature{
18722163 .bf16,
18732164 .cmp_bcc_fusion,
2165 .enable_select_opt,
2166 .ete,
2167 .fp16fml,
2168 .fuse_adrp_add,
2169 .fuse_aes,
2170 .i8mm,
2171 .lsl_fast,
2172 .mte,
2173 .perfmon,
2174 .sve2_bitperm,
2175 .use_postra_scheduler,
2176 .v9a,
2177 }),
2178 };
2179 pub const cortex_x3 = CpuModel{
2180 .name = "cortex_x3",
2181 .llvm_name = "cortex-x3",
2182 .features = featureSet(&[_]Feature{
2183 .bf16,
2184 .enable_select_opt,
18742185 .ete,
18752186 .fp16fml,
2187 .fuse_adrp_add,
18762188 .fuse_aes,
18772189 .i8mm,
2190 .lsl_fast,
18782191 .mte,
18792192 .perfmon,
2193 .spe,
18802194 .sve2_bitperm,
18812195 .use_postra_scheduler,
18822196 .v9a,
......@@ -2032,6 +2346,7 @@ pub const cpu = struct {
20322346 .name = "generic",
20332347 .llvm_name = "generic",
20342348 .features = featureSet(&[_]Feature{
2349 .enable_select_opt,
20352350 .ete,
20362351 .fuse_adrp_add,
20372352 .fuse_aes,
......@@ -2061,9 +2376,12 @@ pub const cpu = struct {
20612376 .bf16,
20622377 .ccdp,
20632378 .crypto,
2379 .enable_select_opt,
20642380 .fp16fml,
2381 .fuse_adrp_add,
20652382 .fuse_aes,
20662383 .i8mm,
2384 .lsl_fast,
20672385 .perfmon,
20682386 .rand,
20692387 .spe,
......@@ -2080,6 +2398,7 @@ pub const cpu = struct {
20802398 .crypto,
20812399 .dotprod,
20822400 .fullfp16,
2401 .fuse_adrp_add,
20832402 .fuse_aes,
20842403 .perfmon,
20852404 .rcpc,
......@@ -2094,8 +2413,11 @@ pub const cpu = struct {
20942413 .features = featureSet(&[_]Feature{
20952414 .crypto,
20962415 .dotprod,
2416 .enable_select_opt,
20972417 .fullfp16,
2418 .fuse_adrp_add,
20982419 .fuse_aes,
2420 .lsl_fast,
20992421 .perfmon,
21002422 .rcpc,
21012423 .spe,
......@@ -2110,9 +2432,12 @@ pub const cpu = struct {
21102432 .features = featureSet(&[_]Feature{
21112433 .bf16,
21122434 .crypto,
2435 .enable_select_opt,
21132436 .ete,
2437 .fuse_adrp_add,
21142438 .fuse_aes,
21152439 .i8mm,
2440 .lsl_fast,
21162441 .mte,
21172442 .perfmon,
21182443 .sve2_bitperm,
......@@ -2127,9 +2452,12 @@ pub const cpu = struct {
21272452 .bf16,
21282453 .ccdp,
21292454 .crypto,
2455 .enable_select_opt,
21302456 .fp16fml,
2457 .fuse_adrp_add,
21312458 .fuse_aes,
21322459 .i8mm,
2460 .lsl_fast,
21332461 .perfmon,
21342462 .rand,
21352463 .spe,
......@@ -2139,6 +2467,26 @@ pub const cpu = struct {
21392467 .v8_4a,
21402468 }),
21412469 };
2470 pub const neoverse_v2 = CpuModel{
2471 .name = "neoverse_v2",
2472 .llvm_name = "neoverse-v2",
2473 .features = featureSet(&[_]Feature{
2474 .bf16,
2475 .enable_select_opt,
2476 .ete,
2477 .fp16fml,
2478 .fuse_aes,
2479 .i8mm,
2480 .lsl_fast,
2481 .mte,
2482 .perfmon,
2483 .rand,
2484 .spe,
2485 .sve2_bitperm,
2486 .use_postra_scheduler,
2487 .v9a,
2488 }),
2489 };
21422490 pub const saphira = CpuModel{
21432491 .name = "saphira",
21442492 .llvm_name = "saphira",
lib/std/target/amdgpu.zig+79-3
......@@ -14,6 +14,7 @@ pub const Feature = enum {
1414 atomic_fadd_rtn_insts,
1515 atomic_pk_fadd_no_rtn_insts,
1616 auto_waitcnt_before_barrier,
17 back_off_barrier,
1718 ci_insts,
1819 cumode,
1920 dl_insts,
......@@ -25,6 +26,7 @@ pub const Feature = enum {
2526 dot6_insts,
2627 dot7_insts,
2728 dot8_insts,
29 dot9_insts,
2830 dpp,
2931 dpp8,
3032 dpp_64bit,
......@@ -34,6 +36,7 @@ pub const Feature = enum {
3436 fast_denormal_f32,
3537 fast_fmaf,
3638 flat_address_space,
39 flat_atomic_fadd_f32_inst,
3740 flat_for_global,
3841 flat_global_insts,
3942 flat_inst_offsets,
......@@ -41,6 +44,7 @@ pub const Feature = enum {
4144 flat_scratch_insts,
4245 flat_segment_offset_bug,
4346 fma_mix_insts,
47 fmacf64_inst,
4448 fmaf,
4549 fp64,
4650 fp8_insts,
......@@ -54,6 +58,7 @@ pub const Feature = enum {
5458 gfx10_b_encoding,
5559 gfx10_insts,
5660 gfx11,
61 gfx11_full_vgprs,
5762 gfx11_insts,
5863 gfx7_gfx8_gfx9_insts,
5964 gfx8_insts,
......@@ -75,6 +80,7 @@ pub const Feature = enum {
7580 load_store_opt,
7681 localmemorysize32768,
7782 localmemorysize65536,
83 mad_intra_fwd_bug,
7884 mad_mac_f32_insts,
7985 mad_mix_insts,
8086 mai_insts,
......@@ -130,6 +136,7 @@ pub const Feature = enum {
130136 unpacked_d16_vmem,
131137 unsafe_ds_offset_folding,
132138 user_sgpr_init16_bug,
139 valu_trans_use_hazard,
133140 vcmpx_exec_war_hazard,
134141 vcmpx_permlane_hazard,
135142 vgpr_index_mode,
......@@ -162,7 +169,7 @@ pub const all_features = blk: {
162169 };
163170 result[@enumToInt(Feature.a16)] = .{
164171 .llvm_name = "a16",
165 .description = "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",
172 .description = "Support A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",
166173 .dependencies = featureSet(&[_]Feature{}),
167174 };
168175 result[@enumToInt(Feature.add_no_carry_insts)] = .{
......@@ -206,6 +213,11 @@ pub const all_features = blk: {
206213 .description = "Hardware automatically inserts waitcnt before barrier",
207214 .dependencies = featureSet(&[_]Feature{}),
208215 };
216 result[@enumToInt(Feature.back_off_barrier)] = .{
217 .llvm_name = "back-off-barrier",
218 .description = "Hardware supports backing off s_barrier if an exception occurs",
219 .dependencies = featureSet(&[_]Feature{}),
220 };
209221 result[@enumToInt(Feature.ci_insts)] = .{
210222 .llvm_name = "ci-insts",
211223 .description = "Additional instructions for CI+",
......@@ -258,7 +270,12 @@ pub const all_features = blk: {
258270 };
259271 result[@enumToInt(Feature.dot8_insts)] = .{
260272 .llvm_name = "dot8-insts",
261 .description = "Has v_dot2_f16_f16, v_dot2_bf16_bf16, v_dot2_f32_bf16, v_dot4_i32_iu8, v_dot8_i32_iu4 instructions",
273 .description = "Has v_dot4_i32_iu8, v_dot8_i32_iu4 instructions",
274 .dependencies = featureSet(&[_]Feature{}),
275 };
276 result[@enumToInt(Feature.dot9_insts)] = .{
277 .llvm_name = "dot9-insts",
278 .description = "Has v_dot2_f16_f16, v_dot2_bf16_bf16, v_dot2_f32_bf16 instructions",
262279 .dependencies = featureSet(&[_]Feature{}),
263280 };
264281 result[@enumToInt(Feature.dpp)] = .{
......@@ -306,6 +323,11 @@ pub const all_features = blk: {
306323 .description = "Support flat address space",
307324 .dependencies = featureSet(&[_]Feature{}),
308325 };
326 result[@enumToInt(Feature.flat_atomic_fadd_f32_inst)] = .{
327 .llvm_name = "flat-atomic-fadd-f32-inst",
328 .description = "Has flat_atomic_add_f32 instruction",
329 .dependencies = featureSet(&[_]Feature{}),
330 };
309331 result[@enumToInt(Feature.flat_for_global)] = .{
310332 .llvm_name = "flat-for-global",
311333 .description = "Force to generate flat instruction for global",
......@@ -341,6 +363,11 @@ pub const all_features = blk: {
341363 .description = "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions",
342364 .dependencies = featureSet(&[_]Feature{}),
343365 };
366 result[@enumToInt(Feature.fmacf64_inst)] = .{
367 .llvm_name = "fmacf64-inst",
368 .description = "Has v_fmac_f64 instruction",
369 .dependencies = featureSet(&[_]Feature{}),
370 };
344371 result[@enumToInt(Feature.fmaf)] = .{
345372 .llvm_name = "fmaf",
346373 .description = "Enable single precision FMA (not as fast as mul+add, but fused)",
......@@ -487,6 +514,11 @@ pub const all_features = blk: {
487514 .vscnt,
488515 }),
489516 };
517 result[@enumToInt(Feature.gfx11_full_vgprs)] = .{
518 .llvm_name = "gfx11-full-vgprs",
519 .description = "GFX11 with 50% more physical VGPRs and 50% larger allocation granule than GFX10",
520 .dependencies = featureSet(&[_]Feature{}),
521 };
490522 result[@enumToInt(Feature.gfx11_insts)] = .{
491523 .llvm_name = "gfx11-insts",
492524 .description = "Additional instructions for GFX11+",
......@@ -507,6 +539,7 @@ pub const all_features = blk: {
507539 .description = "GFX9 GPU generation",
508540 .dependencies = featureSet(&[_]Feature{
509541 .@"16_bit_insts",
542 .a16,
510543 .add_no_carry_insts,
511544 .aperture_regs,
512545 .ci_insts,
......@@ -629,6 +662,11 @@ pub const all_features = blk: {
629662 .description = "The size of local memory in bytes",
630663 .dependencies = featureSet(&[_]Feature{}),
631664 };
665 result[@enumToInt(Feature.mad_intra_fwd_bug)] = .{
666 .llvm_name = "mad-intra-fwd-bug",
667 .description = "MAD_U64/I64 intra instruction forwarding bug",
668 .dependencies = featureSet(&[_]Feature{}),
669 };
632670 result[@enumToInt(Feature.mad_mac_f32_insts)] = .{
633671 .llvm_name = "mad-mac-f32-insts",
634672 .description = "Has v_mad_f32/v_mac_f32/v_madak_f32/v_madmk_f32 instructions",
......@@ -933,6 +971,11 @@ pub const all_features = blk: {
933971 .description = "Bug requiring at least 16 user+system SGPRs to be enabled",
934972 .dependencies = featureSet(&[_]Feature{}),
935973 };
974 result[@enumToInt(Feature.valu_trans_use_hazard)] = .{
975 .llvm_name = "valu-trans-use-hazard",
976 .description = "Hazard when TRANS instructions are closely followed by a use of the result",
977 .dependencies = featureSet(&[_]Feature{}),
978 };
936979 result[@enumToInt(Feature.vcmpx_exec_war_hazard)] = .{
937980 .llvm_name = "vcmpx-exec-war-hazard",
938981 .description = "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)",
......@@ -1089,6 +1132,7 @@ pub const cpu = struct {
10891132 .name = "gfx1010",
10901133 .llvm_name = "gfx1010",
10911134 .features = featureSet(&[_]Feature{
1135 .back_off_barrier,
10921136 .dl_insts,
10931137 .ds_src2_insts,
10941138 .flat_segment_offset_bug,
......@@ -1120,6 +1164,7 @@ pub const cpu = struct {
11201164 .name = "gfx1011",
11211165 .llvm_name = "gfx1011",
11221166 .features = featureSet(&[_]Feature{
1167 .back_off_barrier,
11231168 .dl_insts,
11241169 .dot1_insts,
11251170 .dot2_insts,
......@@ -1156,6 +1201,7 @@ pub const cpu = struct {
11561201 .name = "gfx1012",
11571202 .llvm_name = "gfx1012",
11581203 .features = featureSet(&[_]Feature{
1204 .back_off_barrier,
11591205 .dl_insts,
11601206 .dot1_insts,
11611207 .dot2_insts,
......@@ -1192,6 +1238,7 @@ pub const cpu = struct {
11921238 .name = "gfx1013",
11931239 .llvm_name = "gfx1013",
11941240 .features = featureSet(&[_]Feature{
1241 .back_off_barrier,
11951242 .dl_insts,
11961243 .ds_src2_insts,
11971244 .flat_segment_offset_bug,
......@@ -1224,6 +1271,7 @@ pub const cpu = struct {
12241271 .name = "gfx1030",
12251272 .llvm_name = "gfx1030",
12261273 .features = featureSet(&[_]Feature{
1274 .back_off_barrier,
12271275 .dl_insts,
12281276 .dot1_insts,
12291277 .dot2_insts,
......@@ -1245,6 +1293,7 @@ pub const cpu = struct {
12451293 .name = "gfx1031",
12461294 .llvm_name = "gfx1031",
12471295 .features = featureSet(&[_]Feature{
1296 .back_off_barrier,
12481297 .dl_insts,
12491298 .dot1_insts,
12501299 .dot2_insts,
......@@ -1266,6 +1315,7 @@ pub const cpu = struct {
12661315 .name = "gfx1032",
12671316 .llvm_name = "gfx1032",
12681317 .features = featureSet(&[_]Feature{
1318 .back_off_barrier,
12691319 .dl_insts,
12701320 .dot1_insts,
12711321 .dot2_insts,
......@@ -1287,6 +1337,7 @@ pub const cpu = struct {
12871337 .name = "gfx1033",
12881338 .llvm_name = "gfx1033",
12891339 .features = featureSet(&[_]Feature{
1340 .back_off_barrier,
12901341 .dl_insts,
12911342 .dot1_insts,
12921343 .dot2_insts,
......@@ -1308,6 +1359,7 @@ pub const cpu = struct {
13081359 .name = "gfx1034",
13091360 .llvm_name = "gfx1034",
13101361 .features = featureSet(&[_]Feature{
1362 .back_off_barrier,
13111363 .dl_insts,
13121364 .dot1_insts,
13131365 .dot2_insts,
......@@ -1329,6 +1381,7 @@ pub const cpu = struct {
13291381 .name = "gfx1035",
13301382 .llvm_name = "gfx1035",
13311383 .features = featureSet(&[_]Feature{
1384 .back_off_barrier,
13321385 .dl_insts,
13331386 .dot1_insts,
13341387 .dot2_insts,
......@@ -1350,6 +1403,7 @@ pub const cpu = struct {
13501403 .name = "gfx1036",
13511404 .llvm_name = "gfx1036",
13521405 .features = featureSet(&[_]Feature{
1406 .back_off_barrier,
13531407 .dl_insts,
13541408 .dot1_insts,
13551409 .dot2_insts,
......@@ -1378,14 +1432,19 @@ pub const cpu = struct {
13781432 .dot5_insts,
13791433 .dot7_insts,
13801434 .dot8_insts,
1435 .dot9_insts,
1436 .flat_atomic_fadd_f32_inst,
13811437 .gfx11,
1438 .gfx11_full_vgprs,
13821439 .image_insts,
13831440 .ldsbankcount32,
1441 .mad_intra_fwd_bug,
13841442 .nsa_encoding,
13851443 .nsa_max_size_5,
13861444 .packed_tid,
13871445 .shader_cycles_register,
13881446 .user_sgpr_init16_bug,
1447 .valu_trans_use_hazard,
13891448 .vcmpx_permlane_hazard,
13901449 .wavefrontsize32,
13911450 }),
......@@ -1401,13 +1460,18 @@ pub const cpu = struct {
14011460 .dot5_insts,
14021461 .dot7_insts,
14031462 .dot8_insts,
1463 .dot9_insts,
1464 .flat_atomic_fadd_f32_inst,
14041465 .gfx11,
1466 .gfx11_full_vgprs,
14051467 .image_insts,
14061468 .ldsbankcount32,
1469 .mad_intra_fwd_bug,
14071470 .nsa_encoding,
14081471 .nsa_max_size_5,
14091472 .packed_tid,
14101473 .shader_cycles_register,
1474 .valu_trans_use_hazard,
14111475 .vcmpx_permlane_hazard,
14121476 .wavefrontsize32,
14131477 }),
......@@ -1423,14 +1487,18 @@ pub const cpu = struct {
14231487 .dot5_insts,
14241488 .dot7_insts,
14251489 .dot8_insts,
1490 .dot9_insts,
1491 .flat_atomic_fadd_f32_inst,
14261492 .gfx11,
14271493 .image_insts,
14281494 .ldsbankcount32,
1495 .mad_intra_fwd_bug,
14291496 .nsa_encoding,
14301497 .nsa_max_size_5,
14311498 .packed_tid,
14321499 .shader_cycles_register,
14331500 .user_sgpr_init16_bug,
1501 .valu_trans_use_hazard,
14341502 .vcmpx_permlane_hazard,
14351503 .wavefrontsize32,
14361504 }),
......@@ -1446,14 +1514,17 @@ pub const cpu = struct {
14461514 .dot5_insts,
14471515 .dot7_insts,
14481516 .dot8_insts,
1517 .dot9_insts,
1518 .flat_atomic_fadd_f32_inst,
14491519 .gfx11,
14501520 .image_insts,
14511521 .ldsbankcount32,
1522 .mad_intra_fwd_bug,
14521523 .nsa_encoding,
14531524 .nsa_max_size_5,
14541525 .packed_tid,
14551526 .shader_cycles_register,
1456 .user_sgpr_init16_bug,
1527 .valu_trans_use_hazard,
14571528 .vcmpx_permlane_hazard,
14581529 .wavefrontsize32,
14591530 }),
......@@ -1696,6 +1767,7 @@ pub const cpu = struct {
16961767 .atomic_fadd_no_rtn_insts,
16971768 .atomic_fadd_rtn_insts,
16981769 .atomic_pk_fadd_no_rtn_insts,
1770 .back_off_barrier,
16991771 .dl_insts,
17001772 .dot1_insts,
17011773 .dot2_insts,
......@@ -1706,6 +1778,7 @@ pub const cpu = struct {
17061778 .dot7_insts,
17071779 .dpp_64bit,
17081780 .fma_mix_insts,
1781 .fmacf64_inst,
17091782 .full_rate_64_ops,
17101783 .gfx9,
17111784 .gfx90a_insts,
......@@ -1741,6 +1814,7 @@ pub const cpu = struct {
17411814 .atomic_fadd_no_rtn_insts,
17421815 .atomic_fadd_rtn_insts,
17431816 .atomic_pk_fadd_no_rtn_insts,
1817 .back_off_barrier,
17441818 .dl_insts,
17451819 .dot1_insts,
17461820 .dot2_insts,
......@@ -1750,7 +1824,9 @@ pub const cpu = struct {
17501824 .dot6_insts,
17511825 .dot7_insts,
17521826 .dpp_64bit,
1827 .flat_atomic_fadd_f32_inst,
17531828 .fma_mix_insts,
1829 .fmacf64_inst,
17541830 .fp8_insts,
17551831 .full_rate_64_ops,
17561832 .gfx9,
lib/std/target/arm.zig+69-4
......@@ -17,6 +17,7 @@ pub const Feature = enum {
1717 avoid_movs_shop,
1818 avoid_partial_cpsr,
1919 bf16,
20 big_endian_instructions,
2021 cde,
2122 cdecp0,
2223 cdecp1,
......@@ -27,6 +28,7 @@ pub const Feature = enum {
2728 cdecp6,
2829 cdecp7,
2930 cheap_predicable_cpsr,
31 clrbhb,
3032 crc,
3133 crypto,
3234 d32,
......@@ -77,11 +79,13 @@ pub const Feature = enum {
7779 has_v8_6a,
7880 has_v8_7a,
7981 has_v8_8a,
82 has_v8_9a,
8083 has_v8m,
8184 has_v8m_main,
8285 has_v9_1a,
8386 has_v9_2a,
8487 has_v9_3a,
88 has_v9_4a,
8589 has_v9a,
8690 hwdiv,
8791 hwdiv_arm,
......@@ -171,6 +175,7 @@ pub const Feature = enum {
171175 v8_6a,
172176 v8_7a,
173177 v8_8a,
178 v8_9a,
174179 v8a,
175180 v8m,
176181 v8m_main,
......@@ -178,6 +183,7 @@ pub const Feature = enum {
178183 v9_1a,
179184 v9_2a,
180185 v9_3a,
186 v9_4a,
181187 v9a,
182188 vfp2,
183189 vfp2sp,
......@@ -274,6 +280,11 @@ pub const all_features = blk: {
274280 .neon,
275281 }),
276282 };
283 result[@enumToInt(Feature.big_endian_instructions)] = .{
284 .llvm_name = "big-endian-instructions",
285 .description = "Expect instructions to be stored big-endian.",
286 .dependencies = featureSet(&[_]Feature{}),
287 };
277288 result[@enumToInt(Feature.cde)] = .{
278289 .llvm_name = "cde",
279290 .description = "Support CDE instructions",
......@@ -342,6 +353,11 @@ pub const all_features = blk: {
342353 .description = "Disable +1 predication cost for instructions updating CPSR",
343354 .dependencies = featureSet(&[_]Feature{}),
344355 };
356 result[@enumToInt(Feature.clrbhb)] = .{
357 .llvm_name = "clrbhb",
358 .description = "Enable Clear BHB instruction",
359 .dependencies = featureSet(&[_]Feature{}),
360 };
345361 result[@enumToInt(Feature.crc)] = .{
346362 .llvm_name = "crc",
347363 .description = "Enable support for CRC instructions",
......@@ -681,6 +697,14 @@ pub const all_features = blk: {
681697 .has_v8_7a,
682698 }),
683699 };
700 result[@enumToInt(Feature.has_v8_9a)] = .{
701 .llvm_name = "v8.9a",
702 .description = "Support ARM v8.9a instructions",
703 .dependencies = featureSet(&[_]Feature{
704 .clrbhb,
705 .has_v8_8a,
706 }),
707 };
684708 result[@enumToInt(Feature.has_v8m)] = .{
685709 .llvm_name = "v8m",
686710 .description = "Support ARM v8M Baseline instructions",
......@@ -719,6 +743,14 @@ pub const all_features = blk: {
719743 .has_v9_2a,
720744 }),
721745 };
746 result[@enumToInt(Feature.has_v9_4a)] = .{
747 .llvm_name = "v9.4a",
748 .description = "Support ARM v9.4a instructions",
749 .dependencies = featureSet(&[_]Feature{
750 .has_v8_9a,
751 .has_v9_3a,
752 }),
753 };
722754 result[@enumToInt(Feature.has_v9a)] = .{
723755 .llvm_name = "v9a",
724756 .description = "Support ARM v9a instructions",
......@@ -1027,28 +1059,28 @@ pub const all_features = blk: {
10271059 .dependencies = featureSet(&[_]Feature{}),
10281060 };
10291061 result[@enumToInt(Feature.v2)] = .{
1030 .llvm_name = "armv2",
1062 .llvm_name = null,
10311063 .description = "ARMv2 architecture",
10321064 .dependencies = featureSet(&[_]Feature{
10331065 .strict_align,
10341066 }),
10351067 };
10361068 result[@enumToInt(Feature.v2a)] = .{
1037 .llvm_name = "armv2a",
1069 .llvm_name = null,
10381070 .description = "ARMv2a architecture",
10391071 .dependencies = featureSet(&[_]Feature{
10401072 .strict_align,
10411073 }),
10421074 };
10431075 result[@enumToInt(Feature.v3)] = .{
1044 .llvm_name = "armv3",
1076 .llvm_name = null,
10451077 .description = "ARMv3 architecture",
10461078 .dependencies = featureSet(&[_]Feature{
10471079 .strict_align,
10481080 }),
10491081 };
10501082 result[@enumToInt(Feature.v3m)] = .{
1051 .llvm_name = "armv3m",
1083 .llvm_name = null,
10521084 .description = "ARMv3m architecture",
10531085 .dependencies = featureSet(&[_]Feature{
10541086 .strict_align,
......@@ -1384,6 +1416,23 @@ pub const all_features = blk: {
13841416 .virtualization,
13851417 }),
13861418 };
1419 result[@enumToInt(Feature.v8_9a)] = .{
1420 .llvm_name = "armv8.9-a",
1421 .description = "ARMv89a architecture",
1422 .dependencies = featureSet(&[_]Feature{
1423 .aclass,
1424 .crc,
1425 .crypto,
1426 .db,
1427 .dsp,
1428 .fp_armv8,
1429 .has_v8_9a,
1430 .mp,
1431 .ras,
1432 .trustzone,
1433 .virtualization,
1434 }),
1435 };
13871436 result[@enumToInt(Feature.v8a)] = .{
13881437 .llvm_name = "armv8-a",
13891438 .description = "ARMv8a architecture",
......@@ -1495,6 +1544,22 @@ pub const all_features = blk: {
14951544 .virtualization,
14961545 }),
14971546 };
1547 result[@enumToInt(Feature.v9_4a)] = .{
1548 .llvm_name = "armv9.4-a",
1549 .description = "ARMv94a architecture",
1550 .dependencies = featureSet(&[_]Feature{
1551 .aclass,
1552 .crc,
1553 .db,
1554 .dsp,
1555 .fp_armv8,
1556 .has_v9_4a,
1557 .mp,
1558 .ras,
1559 .trustzone,
1560 .virtualization,
1561 }),
1562 };
14981563 result[@enumToInt(Feature.v9a)] = .{
14991564 .llvm_name = "armv9-a",
15001565 .description = "ARMv9a architecture",
lib/std/target/avr.zig+10
......@@ -30,6 +30,7 @@ pub const Feature = enum {
3030 memmappedregs,
3131 movw,
3232 mul,
33 progmem,
3334 rmw,
3435 smallstack,
3536 special,
......@@ -68,6 +69,7 @@ pub const all_features = blk: {
6869 .avr0,
6970 .lpm,
7071 .memmappedregs,
72 .progmem,
7173 }),
7274 };
7375 result[@enumToInt(Feature.avr2)] = .{
......@@ -156,6 +158,7 @@ pub const all_features = blk: {
156158 .description = "The device is a part of the avr6 family",
157159 .dependencies = featureSet(&[_]Feature{
158160 .avr51,
161 .eijmpcall,
159162 }),
160163 };
161164 result[@enumToInt(Feature.avrtiny)] = .{
......@@ -229,6 +232,11 @@ pub const all_features = blk: {
229232 .description = "The device supports the multiplication instructions",
230233 .dependencies = featureSet(&[_]Feature{}),
231234 };
235 result[@enumToInt(Feature.progmem)] = .{
236 .llvm_name = "progmem",
237 .description = "The device has a separate flash namespace",
238 .dependencies = featureSet(&[_]Feature{}),
239 };
232240 result[@enumToInt(Feature.rmw)] = .{
233241 .llvm_name = "rmw",
234242 .description = "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT",
......@@ -299,6 +307,7 @@ pub const all_features = blk: {
299307 .lpmx,
300308 .movw,
301309 .mul,
310 .progmem,
302311 .spm,
303312 .spmx,
304313 .sram,
......@@ -317,6 +326,7 @@ pub const all_features = blk: {
317326 .lpmx,
318327 .movw,
319328 .mul,
329 .progmem,
320330 .sram,
321331 }),
322332 };
lib/std/target/csky.zig+3-1
......@@ -3075,7 +3075,9 @@ pub const cpu = struct {
30753075 pub const generic = CpuModel{
30763076 .name = "generic",
30773077 .llvm_name = "generic",
3078 .features = featureSet(&[_]Feature{}),
3078 .features = featureSet(&[_]Feature{
3079 .btst16,
3080 }),
30793081 };
30803082 pub const @"i805" = CpuModel{
30813083 .name = "i805",
lib/std/target/hexagon.zig+99
......@@ -21,6 +21,8 @@ pub const Feature = enum {
2121 hvxv67,
2222 hvxv68,
2323 hvxv69,
24 hvxv71,
25 hvxv73,
2426 long_calls,
2527 mem_noshuf,
2628 memops,
......@@ -42,6 +44,8 @@ pub const Feature = enum {
4244 v67,
4345 v68,
4446 v69,
47 v71,
48 v73,
4549 zreg,
4650};
4751
......@@ -153,6 +157,20 @@ pub const all_features = blk: {
153157 .hvxv68,
154158 }),
155159 };
160 result[@enumToInt(Feature.hvxv71)] = .{
161 .llvm_name = "hvxv71",
162 .description = "Hexagon HVX instructions",
163 .dependencies = featureSet(&[_]Feature{
164 .hvxv69,
165 }),
166 };
167 result[@enumToInt(Feature.hvxv73)] = .{
168 .llvm_name = "hvxv73",
169 .description = "Hexagon HVX instructions",
170 .dependencies = featureSet(&[_]Feature{
171 .hvxv71,
172 }),
173 };
156174 result[@enumToInt(Feature.long_calls)] = .{
157175 .llvm_name = "long-calls",
158176 .description = "Use constant-extended calls",
......@@ -262,6 +280,16 @@ pub const all_features = blk: {
262280 .description = "Enable Hexagon V69 architecture",
263281 .dependencies = featureSet(&[_]Feature{}),
264282 };
283 result[@enumToInt(Feature.v71)] = .{
284 .llvm_name = "v71",
285 .description = "Enable Hexagon V71 architecture",
286 .dependencies = featureSet(&[_]Feature{}),
287 };
288 result[@enumToInt(Feature.v73)] = .{
289 .llvm_name = "v73",
290 .description = "Enable Hexagon V73 architecture",
291 .dependencies = featureSet(&[_]Feature{}),
292 };
265293 result[@enumToInt(Feature.zreg)] = .{
266294 .llvm_name = "zreg",
267295 .description = "Hexagon ZReg extension instructions",
......@@ -484,4 +512,75 @@ pub const cpu = struct {
484512 .v69,
485513 }),
486514 };
515 pub const hexagonv71 = CpuModel{
516 .name = "hexagonv71",
517 .llvm_name = "hexagonv71",
518 .features = featureSet(&[_]Feature{
519 .cabac,
520 .compound,
521 .duplex,
522 .mem_noshuf,
523 .memops,
524 .nvj,
525 .nvs,
526 .small_data,
527 .v5,
528 .v55,
529 .v60,
530 .v62,
531 .v65,
532 .v66,
533 .v67,
534 .v68,
535 .v69,
536 .v71,
537 }),
538 };
539 pub const hexagonv71t = CpuModel{
540 .name = "hexagonv71t",
541 .llvm_name = "hexagonv71t",
542 .features = featureSet(&[_]Feature{
543 .audio,
544 .compound,
545 .mem_noshuf,
546 .memops,
547 .nvs,
548 .small_data,
549 .tinycore,
550 .v5,
551 .v55,
552 .v60,
553 .v62,
554 .v65,
555 .v66,
556 .v67,
557 .v68,
558 .v69,
559 .v71,
560 }),
561 };
562 pub const hexagonv73 = CpuModel{
563 .name = "hexagonv73",
564 .llvm_name = "hexagonv73",
565 .features = featureSet(&[_]Feature{
566 .compound,
567 .duplex,
568 .mem_noshuf,
569 .memops,
570 .nvj,
571 .nvs,
572 .small_data,
573 .v5,
574 .v55,
575 .v60,
576 .v62,
577 .v65,
578 .v66,
579 .v67,
580 .v68,
581 .v69,
582 .v71,
583 .v73,
584 }),
585 };
487586};
lib/std/target/loongarch.zig created+129
......@@ -0,0 +1,129 @@
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
3const std = @import("../std.zig");
4const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;
6
7pub const Feature = enum {
8 @"32bit",
9 @"64bit",
10 d,
11 f,
12 la_global_with_abs,
13 la_global_with_pcrel,
14 la_local_with_abs,
15 lasx,
16 lbt,
17 lsx,
18 lvz,
19};
20
21pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
22pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
23pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
24pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
25
26pub const all_features = blk: {
27 const len = @typeInfo(Feature).Enum.fields.len;
28 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
29 var result: [len]CpuFeature = undefined;
30 result[@enumToInt(Feature.@"32bit")] = .{
31 .llvm_name = "32bit",
32 .description = "LA32 Basic Integer and Privilege Instruction Set",
33 .dependencies = featureSet(&[_]Feature{}),
34 };
35 result[@enumToInt(Feature.@"64bit")] = .{
36 .llvm_name = "64bit",
37 .description = "LA64 Basic Integer and Privilege Instruction Set",
38 .dependencies = featureSet(&[_]Feature{}),
39 };
40 result[@enumToInt(Feature.d)] = .{
41 .llvm_name = "d",
42 .description = "'D' (Double-Precision Floating-Point)",
43 .dependencies = featureSet(&[_]Feature{
44 .f,
45 }),
46 };
47 result[@enumToInt(Feature.f)] = .{
48 .llvm_name = "f",
49 .description = "'F' (Single-Precision Floating-Point)",
50 .dependencies = featureSet(&[_]Feature{}),
51 };
52 result[@enumToInt(Feature.la_global_with_abs)] = .{
53 .llvm_name = "la-global-with-abs",
54 .description = "Expand la.global as la.abs",
55 .dependencies = featureSet(&[_]Feature{}),
56 };
57 result[@enumToInt(Feature.la_global_with_pcrel)] = .{
58 .llvm_name = "la-global-with-pcrel",
59 .description = "Expand la.global as la.pcrel",
60 .dependencies = featureSet(&[_]Feature{}),
61 };
62 result[@enumToInt(Feature.la_local_with_abs)] = .{
63 .llvm_name = "la-local-with-abs",
64 .description = "Expand la.local as la.abs",
65 .dependencies = featureSet(&[_]Feature{}),
66 };
67 result[@enumToInt(Feature.lasx)] = .{
68 .llvm_name = "lasx",
69 .description = "'LASX' (Loongson Advanced SIMD Extension)",
70 .dependencies = featureSet(&[_]Feature{
71 .lsx,
72 }),
73 };
74 result[@enumToInt(Feature.lbt)] = .{
75 .llvm_name = "lbt",
76 .description = "'LBT' (Loongson Binary Translation Extension)",
77 .dependencies = featureSet(&[_]Feature{}),
78 };
79 result[@enumToInt(Feature.lsx)] = .{
80 .llvm_name = "lsx",
81 .description = "'LSX' (Loongson SIMD Extension)",
82 .dependencies = featureSet(&[_]Feature{
83 .d,
84 }),
85 };
86 result[@enumToInt(Feature.lvz)] = .{
87 .llvm_name = "lvz",
88 .description = "'LVZ' (Loongson Virtualization Extension)",
89 .dependencies = featureSet(&[_]Feature{}),
90 };
91 const ti = @typeInfo(Feature);
92 for (result) |*elem, i| {
93 elem.index = i;
94 elem.name = ti.Enum.fields[i].name;
95 }
96 break :blk result;
97};
98
99pub const cpu = struct {
100 pub const generic = CpuModel{
101 .name = "generic",
102 .llvm_name = "generic",
103 .features = featureSet(&[_]Feature{}),
104 };
105 pub const generic_la32 = CpuModel{
106 .name = "generic_la32",
107 .llvm_name = "generic-la32",
108 .features = featureSet(&[_]Feature{
109 .@"32bit",
110 }),
111 };
112 pub const generic_la64 = CpuModel{
113 .name = "generic_la64",
114 .llvm_name = "generic-la64",
115 .features = featureSet(&[_]Feature{
116 .@"64bit",
117 }),
118 };
119 pub const la464 = CpuModel{
120 .name = "la464",
121 .llvm_name = "la464",
122 .features = featureSet(&[_]Feature{
123 .@"64bit",
124 .lasx,
125 .lbt,
126 .lvz,
127 }),
128 };
129};
lib/std/target/nvptx.zig+63
......@@ -22,6 +22,9 @@ pub const Feature = enum {
2222 ptx73,
2323 ptx74,
2424 ptx75,
25 ptx76,
26 ptx77,
27 ptx78,
2528 sm_20,
2629 sm_21,
2730 sm_30,
......@@ -39,6 +42,9 @@ pub const Feature = enum {
3942 sm_75,
4043 sm_80,
4144 sm_86,
45 sm_87,
46 sm_89,
47 sm_90,
4248};
4349
4450pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
......@@ -135,6 +141,21 @@ pub const all_features = blk: {
135141 .description = "Use PTX version 7.5",
136142 .dependencies = featureSet(&[_]Feature{}),
137143 };
144 result[@enumToInt(Feature.ptx76)] = .{
145 .llvm_name = "ptx76",
146 .description = "Use PTX version 7.6",
147 .dependencies = featureSet(&[_]Feature{}),
148 };
149 result[@enumToInt(Feature.ptx77)] = .{
150 .llvm_name = "ptx77",
151 .description = "Use PTX version 7.7",
152 .dependencies = featureSet(&[_]Feature{}),
153 };
154 result[@enumToInt(Feature.ptx78)] = .{
155 .llvm_name = "ptx78",
156 .description = "Use PTX version 7.8",
157 .dependencies = featureSet(&[_]Feature{}),
158 };
138159 result[@enumToInt(Feature.sm_20)] = .{
139160 .llvm_name = "sm_20",
140161 .description = "Target SM 2.0",
......@@ -220,6 +241,21 @@ pub const all_features = blk: {
220241 .description = "Target SM 8.6",
221242 .dependencies = featureSet(&[_]Feature{}),
222243 };
244 result[@enumToInt(Feature.sm_87)] = .{
245 .llvm_name = "sm_87",
246 .description = "Target SM 8.7",
247 .dependencies = featureSet(&[_]Feature{}),
248 };
249 result[@enumToInt(Feature.sm_89)] = .{
250 .llvm_name = "sm_89",
251 .description = "Target SM 8.9",
252 .dependencies = featureSet(&[_]Feature{}),
253 };
254 result[@enumToInt(Feature.sm_90)] = .{
255 .llvm_name = "sm_90",
256 .description = "Target SM 9.0",
257 .dependencies = featureSet(&[_]Feature{}),
258 };
223259 const ti = @typeInfo(Feature);
224260 for (result) |*elem, i| {
225261 elem.index = i;
......@@ -233,6 +269,7 @@ pub const cpu = struct {
233269 .name = "sm_20",
234270 .llvm_name = "sm_20",
235271 .features = featureSet(&[_]Feature{
272 .ptx32,
236273 .sm_20,
237274 }),
238275 };
......@@ -240,6 +277,7 @@ pub const cpu = struct {
240277 .name = "sm_21",
241278 .llvm_name = "sm_21",
242279 .features = featureSet(&[_]Feature{
280 .ptx32,
243281 .sm_21,
244282 }),
245283 };
......@@ -262,6 +300,7 @@ pub const cpu = struct {
262300 .name = "sm_35",
263301 .llvm_name = "sm_35",
264302 .features = featureSet(&[_]Feature{
303 .ptx32,
265304 .sm_35,
266305 }),
267306 };
......@@ -361,4 +400,28 @@ pub const cpu = struct {
361400 .sm_86,
362401 }),
363402 };
403 pub const sm_87 = CpuModel{
404 .name = "sm_87",
405 .llvm_name = "sm_87",
406 .features = featureSet(&[_]Feature{
407 .ptx74,
408 .sm_87,
409 }),
410 };
411 pub const sm_89 = CpuModel{
412 .name = "sm_89",
413 .llvm_name = "sm_89",
414 .features = featureSet(&[_]Feature{
415 .ptx78,
416 .sm_89,
417 }),
418 };
419 pub const sm_90 = CpuModel{
420 .name = "sm_90",
421 .llvm_name = "sm_90",
422 .features = featureSet(&[_]Feature{
423 .ptx78,
424 .sm_90,
425 }),
426 };
364427};
lib/std/target/powerpc.zig+8
......@@ -19,6 +19,7 @@ pub const Feature = enum {
1919 e500,
2020 efpu2,
2121 extdiv,
22 fast_MFLR,
2223 fcpsgn,
2324 float128,
2425 fpcvt,
......@@ -176,6 +177,11 @@ pub const all_features = blk: {
176177 .description = "Enable extended divide instructions",
177178 .dependencies = featureSet(&[_]Feature{}),
178179 };
180 result[@enumToInt(Feature.fast_MFLR)] = .{
181 .llvm_name = "fast-MFLR",
182 .description = "MFLR is a fast instruction",
183 .dependencies = featureSet(&[_]Feature{}),
184 };
179185 result[@enumToInt(Feature.fcpsgn)] = .{
180186 .llvm_name = "fcpsgn",
181187 .description = "Enable the fcpsgn instruction",
......@@ -787,6 +793,7 @@ pub const cpu = struct {
787793 .crypto,
788794 .direct_move,
789795 .extdiv,
796 .fast_MFLR,
790797 .fcpsgn,
791798 .fpcvt,
792799 .fprnd,
......@@ -941,6 +948,7 @@ pub const cpu = struct {
941948 .crypto,
942949 .direct_move,
943950 .extdiv,
951 .fast_MFLR,
944952 .fcpsgn,
945953 .fpcvt,
946954 .fprnd,
lib/std/target/riscv.zig+143-37
......@@ -5,22 +5,26 @@ const CpuFeature = std.Target.Cpu.Feature;
55const CpuModel = std.Target.Cpu.Model;
66
77pub const Feature = enum {
8 @"32bit",
89 @"64bit",
910 a,
1011 c,
1112 d,
1213 e,
13 experimental_zbe,
14 experimental_zbf,
15 experimental_zbm,
16 experimental_zbp,
17 experimental_zbr,
18 experimental_zbt,
14 experimental_zawrs,
15 experimental_zca,
16 experimental_zcd,
17 experimental_zcf,
18 experimental_zihintntl,
19 experimental_ztso,
1920 experimental_zvfh,
2021 f,
22 forced_atomics,
23 h,
2124 lui_addi_fusion,
2225 m,
2326 no_default_unroll,
27 no_optimized_zero_stride_load,
2428 no_rvc_hints,
2529 relax,
2630 reserve_x1,
......@@ -55,8 +59,15 @@ pub const Feature = enum {
5559 reserve_x8,
5660 reserve_x9,
5761 save_restore,
62 short_forward_branch_opt,
63 svinval,
64 svnapot,
65 svpbmt,
66 tagged_globals,
5867 unaligned_scalar_mem,
5968 v,
69 xtheadvdot,
70 xventanacondops,
6071 zba,
6172 zbb,
6273 zbc,
......@@ -100,6 +111,7 @@ pub const Feature = enum {
100111 zvl4096b,
101112 zvl512b,
102113 zvl64b,
114 zvl65536b,
103115 zvl8192b,
104116};
105117
......@@ -112,6 +124,11 @@ pub const all_features = blk: {
112124 const len = @typeInfo(Feature).Enum.fields.len;
113125 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
114126 var result: [len]CpuFeature = undefined;
127 result[@enumToInt(Feature.@"32bit")] = .{
128 .llvm_name = "32bit",
129 .description = "Implements RV32",
130 .dependencies = featureSet(&[_]Feature{}),
131 };
115132 result[@enumToInt(Feature.@"64bit")] = .{
116133 .llvm_name = "64bit",
117134 .description = "Implements RV64",
......@@ -139,34 +156,34 @@ pub const all_features = blk: {
139156 .description = "Implements RV32E (provides 16 rather than 32 GPRs)",
140157 .dependencies = featureSet(&[_]Feature{}),
141158 };
142 result[@enumToInt(Feature.experimental_zbe)] = .{
143 .llvm_name = "experimental-zbe",
144 .description = "'Zbe' (Extract-Deposit 'Zb' Instructions)",
159 result[@enumToInt(Feature.experimental_zawrs)] = .{
160 .llvm_name = "experimental-zawrs",
161 .description = "'Zawrs' (Wait on Reservation Set)",
145162 .dependencies = featureSet(&[_]Feature{}),
146163 };
147 result[@enumToInt(Feature.experimental_zbf)] = .{
148 .llvm_name = "experimental-zbf",
149 .description = "'Zbf' (Bit-Field 'Zb' Instructions)",
164 result[@enumToInt(Feature.experimental_zca)] = .{
165 .llvm_name = "experimental-zca",
166 .description = "'Zca' (part of the C extension, excluding compressed floating point loads/stores)",
150167 .dependencies = featureSet(&[_]Feature{}),
151168 };
152 result[@enumToInt(Feature.experimental_zbm)] = .{
153 .llvm_name = "experimental-zbm",
154 .description = "'Zbm' (Matrix 'Zb' Instructions)",
169 result[@enumToInt(Feature.experimental_zcd)] = .{
170 .llvm_name = "experimental-zcd",
171 .description = "'Zcd' (Compressed Double-Precision Floating-Point Instructions)",
155172 .dependencies = featureSet(&[_]Feature{}),
156173 };
157 result[@enumToInt(Feature.experimental_zbp)] = .{
158 .llvm_name = "experimental-zbp",
159 .description = "'Zbp' (Permutation 'Zb' Instructions)",
174 result[@enumToInt(Feature.experimental_zcf)] = .{
175 .llvm_name = "experimental-zcf",
176 .description = "'Zcf' (Compressed Single-Precision Floating-Point Instructions)",
160177 .dependencies = featureSet(&[_]Feature{}),
161178 };
162 result[@enumToInt(Feature.experimental_zbr)] = .{
163 .llvm_name = "experimental-zbr",
164 .description = "'Zbr' (Polynomial Reduction 'Zb' Instructions)",
179 result[@enumToInt(Feature.experimental_zihintntl)] = .{
180 .llvm_name = "experimental-zihintntl",
181 .description = "'zihintntl' (Non-Temporal Locality Hints)",
165182 .dependencies = featureSet(&[_]Feature{}),
166183 };
167 result[@enumToInt(Feature.experimental_zbt)] = .{
168 .llvm_name = "experimental-zbt",
169 .description = "'Zbt' (Ternary 'Zb' Instructions)",
184 result[@enumToInt(Feature.experimental_ztso)] = .{
185 .llvm_name = "experimental-ztso",
186 .description = "'Ztso' (Memory Model - Total Store Order)",
170187 .dependencies = featureSet(&[_]Feature{}),
171188 };
172189 result[@enumToInt(Feature.experimental_zvfh)] = .{
......@@ -181,6 +198,16 @@ pub const all_features = blk: {
181198 .description = "'F' (Single-Precision Floating-Point)",
182199 .dependencies = featureSet(&[_]Feature{}),
183200 };
201 result[@enumToInt(Feature.forced_atomics)] = .{
202 .llvm_name = "forced-atomics",
203 .description = "Assume that lock-free native-width atomics are available",
204 .dependencies = featureSet(&[_]Feature{}),
205 };
206 result[@enumToInt(Feature.h)] = .{
207 .llvm_name = "h",
208 .description = "'H' (Hypervisor)",
209 .dependencies = featureSet(&[_]Feature{}),
210 };
184211 result[@enumToInt(Feature.lui_addi_fusion)] = .{
185212 .llvm_name = "lui-addi-fusion",
186213 .description = "Enable LUI+ADDI macrofusion",
......@@ -196,6 +223,11 @@ pub const all_features = blk: {
196223 .description = "Disable default unroll preference.",
197224 .dependencies = featureSet(&[_]Feature{}),
198225 };
226 result[@enumToInt(Feature.no_optimized_zero_stride_load)] = .{
227 .llvm_name = "no-optimized-zero-stride-load",
228 .description = "Hasn't optimized (perform fewer memory operations)zero-stride vector load",
229 .dependencies = featureSet(&[_]Feature{}),
230 };
199231 result[@enumToInt(Feature.no_rvc_hints)] = .{
200232 .llvm_name = "no-rvc-hints",
201233 .description = "Disable RVC Hint Instructions.",
......@@ -366,6 +398,31 @@ pub const all_features = blk: {
366398 .description = "Enable save/restore.",
367399 .dependencies = featureSet(&[_]Feature{}),
368400 };
401 result[@enumToInt(Feature.short_forward_branch_opt)] = .{
402 .llvm_name = "short-forward-branch-opt",
403 .description = "Enable short forward branch optimization",
404 .dependencies = featureSet(&[_]Feature{}),
405 };
406 result[@enumToInt(Feature.svinval)] = .{
407 .llvm_name = "svinval",
408 .description = "'Svinval' (Fine-Grained Address-Translation Cache Invalidation)",
409 .dependencies = featureSet(&[_]Feature{}),
410 };
411 result[@enumToInt(Feature.svnapot)] = .{
412 .llvm_name = "svnapot",
413 .description = "'Svnapot' (NAPOT Translation Contiguity)",
414 .dependencies = featureSet(&[_]Feature{}),
415 };
416 result[@enumToInt(Feature.svpbmt)] = .{
417 .llvm_name = "svpbmt",
418 .description = "'Svpbmt' (Page-Based Memory Types)",
419 .dependencies = featureSet(&[_]Feature{}),
420 };
421 result[@enumToInt(Feature.tagged_globals)] = .{
422 .llvm_name = "tagged-globals",
423 .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits",
424 .dependencies = featureSet(&[_]Feature{}),
425 };
369426 result[@enumToInt(Feature.unaligned_scalar_mem)] = .{
370427 .llvm_name = "unaligned-scalar-mem",
371428 .description = "Has reasonably performant unaligned scalar loads and stores",
......@@ -380,6 +437,18 @@ pub const all_features = blk: {
380437 .zvl128b,
381438 }),
382439 };
440 result[@enumToInt(Feature.xtheadvdot)] = .{
441 .llvm_name = "xtheadvdot",
442 .description = "'xtheadvdot' (T-Head Vector Extensions for Dot)",
443 .dependencies = featureSet(&[_]Feature{
444 .v,
445 }),
446 };
447 result[@enumToInt(Feature.xventanacondops)] = .{
448 .llvm_name = "xventanacondops",
449 .description = "'XVentanaCondOps' (Ventana Conditional Ops)",
450 .dependencies = featureSet(&[_]Feature{}),
451 };
383452 result[@enumToInt(Feature.zba)] = .{
384453 .llvm_name = "zba",
385454 .description = "'Zba' (Address Generation Instructions)",
......@@ -652,6 +721,13 @@ pub const all_features = blk: {
652721 .zvl32b,
653722 }),
654723 };
724 result[@enumToInt(Feature.zvl65536b)] = .{
725 .llvm_name = "zvl65536b",
726 .description = "'Zvl' (Minimum Vector Length) 65536",
727 .dependencies = featureSet(&[_]Feature{
728 .zvl32768b,
729 }),
730 };
655731 result[@enumToInt(Feature.zvl8192b)] = .{
656732 .llvm_name = "zvl8192b",
657733 .description = "'Zvl' (Minimum Vector Length) 8192",
......@@ -697,7 +773,9 @@ pub const cpu = struct {
697773 pub const generic_rv32 = CpuModel{
698774 .name = "generic_rv32",
699775 .llvm_name = "generic-rv32",
700 .features = featureSet(&[_]Feature{}),
776 .features = featureSet(&[_]Feature{
777 .@"32bit",
778 }),
701779 };
702780 pub const generic_rv64 = CpuModel{
703781 .name = "generic_rv64",
......@@ -706,10 +784,17 @@ pub const cpu = struct {
706784 .@"64bit",
707785 }),
708786 };
787 pub const rocket = CpuModel{
788 .name = "rocket",
789 .llvm_name = "rocket",
790 .features = featureSet(&[_]Feature{}),
791 };
709792 pub const rocket_rv32 = CpuModel{
710793 .name = "rocket_rv32",
711794 .llvm_name = "rocket-rv32",
712 .features = featureSet(&[_]Feature{}),
795 .features = featureSet(&[_]Feature{
796 .@"32bit",
797 }),
713798 };
714799 pub const rocket_rv64 = CpuModel{
715800 .name = "rocket_rv64",
......@@ -718,25 +803,19 @@ pub const cpu = struct {
718803 .@"64bit",
719804 }),
720805 };
721 pub const sifive_7_rv32 = CpuModel{
722 .name = "sifive_7_rv32",
723 .llvm_name = "sifive-7-rv32",
806 pub const sifive_7_series = CpuModel{
807 .name = "sifive_7_series",
808 .llvm_name = "sifive-7-series",
724809 .features = featureSet(&[_]Feature{
725810 .no_default_unroll,
726 }),
727 };
728 pub const sifive_7_rv64 = CpuModel{
729 .name = "sifive_7_rv64",
730 .llvm_name = "sifive-7-rv64",
731 .features = featureSet(&[_]Feature{
732 .@"64bit",
733 .no_default_unroll,
811 .short_forward_branch_opt,
734812 }),
735813 };
736814 pub const sifive_e20 = CpuModel{
737815 .name = "sifive_e20",
738816 .llvm_name = "sifive-e20",
739817 .features = featureSet(&[_]Feature{
818 .@"32bit",
740819 .c,
741820 .m,
742821 }),
......@@ -745,6 +824,7 @@ pub const cpu = struct {
745824 .name = "sifive_e21",
746825 .llvm_name = "sifive-e21",
747826 .features = featureSet(&[_]Feature{
827 .@"32bit",
748828 .a,
749829 .c,
750830 .m,
......@@ -754,6 +834,7 @@ pub const cpu = struct {
754834 .name = "sifive_e24",
755835 .llvm_name = "sifive-e24",
756836 .features = featureSet(&[_]Feature{
837 .@"32bit",
757838 .a,
758839 .c,
759840 .f,
......@@ -764,6 +845,7 @@ pub const cpu = struct {
764845 .name = "sifive_e31",
765846 .llvm_name = "sifive-e31",
766847 .features = featureSet(&[_]Feature{
848 .@"32bit",
767849 .a,
768850 .c,
769851 .m,
......@@ -773,6 +855,7 @@ pub const cpu = struct {
773855 .name = "sifive_e34",
774856 .llvm_name = "sifive-e34",
775857 .features = featureSet(&[_]Feature{
858 .@"32bit",
776859 .a,
777860 .c,
778861 .f,
......@@ -783,11 +866,13 @@ pub const cpu = struct {
783866 .name = "sifive_e76",
784867 .llvm_name = "sifive-e76",
785868 .features = featureSet(&[_]Feature{
869 .@"32bit",
786870 .a,
787871 .c,
788872 .f,
789873 .m,
790874 .no_default_unroll,
875 .short_forward_branch_opt,
791876 }),
792877 };
793878 pub const sifive_s21 = CpuModel{
......@@ -831,6 +916,7 @@ pub const cpu = struct {
831916 .d,
832917 .m,
833918 .no_default_unroll,
919 .short_forward_branch_opt,
834920 }),
835921 };
836922 pub const sifive_u54 = CpuModel{
......@@ -854,6 +940,26 @@ pub const cpu = struct {
854940 .d,
855941 .m,
856942 .no_default_unroll,
943 .short_forward_branch_opt,
944 }),
945 };
946 pub const syntacore_scr1_base = CpuModel{
947 .name = "syntacore_scr1_base",
948 .llvm_name = "syntacore-scr1-base",
949 .features = featureSet(&[_]Feature{
950 .@"32bit",
951 .c,
952 .no_default_unroll,
953 }),
954 };
955 pub const syntacore_scr1_max = CpuModel{
956 .name = "syntacore_scr1_max",
957 .llvm_name = "syntacore-scr1-max",
958 .features = featureSet(&[_]Feature{
959 .@"32bit",
960 .c,
961 .m,
962 .no_default_unroll,
857963 }),
858964 };
859965};
lib/std/target/wasm.zig+4-1
......@@ -113,7 +113,10 @@ pub const cpu = struct {
113113 pub const generic = CpuModel{
114114 .name = "generic",
115115 .llvm_name = "generic",
116 .features = featureSet(&[_]Feature{}),
116 .features = featureSet(&[_]Feature{
117 .mutable_globals,
118 .sign_ext,
119 }),
117120 };
118121 pub const mvp = CpuModel{
119122 .name = "mvp",
lib/std/target/x86.zig+555-5
......@@ -12,7 +12,9 @@ pub const Feature = enum {
1212 @"64bit",
1313 adx,
1414 aes,
15 allow_light_256_bit,
1516 amx_bf16,
17 amx_fp16,
1618 amx_int8,
1719 amx_tile,
1820 avx,
......@@ -33,7 +35,10 @@ pub const Feature = enum {
3335 avx512vnni,
3436 avx512vp2intersect,
3537 avx512vpopcntdq,
38 avxifma,
39 avxneconvert,
3640 avxvnni,
41 avxvnniint8,
3742 bmi,
3843 bmi2,
3944 branchfusion,
......@@ -42,6 +47,7 @@ pub const Feature = enum {
4247 clwb,
4348 clzero,
4449 cmov,
50 cmpccxadd,
4551 crc32,
4652 cx16,
4753 cx8,
......@@ -104,9 +110,11 @@ pub const Feature = enum {
104110 prefer_128_bit,
105111 prefer_256_bit,
106112 prefer_mask_registers,
113 prefetchi,
107114 prefetchwt1,
108115 prfchw,
109116 ptwrite,
117 raoint,
110118 rdpid,
111119 rdpru,
112120 rdrnd,
......@@ -211,6 +219,11 @@ pub const all_features = blk: {
211219 .sse2,
212220 }),
213221 };
222 result[@enumToInt(Feature.allow_light_256_bit)] = .{
223 .llvm_name = "allow-light-256-bit",
224 .description = "Enable generation of 256-bit load/stores even if we prefer 128-bit",
225 .dependencies = featureSet(&[_]Feature{}),
226 };
214227 result[@enumToInt(Feature.amx_bf16)] = .{
215228 .llvm_name = "amx-bf16",
216229 .description = "Support AMX-BF16 instructions",
......@@ -218,6 +231,13 @@ pub const all_features = blk: {
218231 .amx_tile,
219232 }),
220233 };
234 result[@enumToInt(Feature.amx_fp16)] = .{
235 .llvm_name = "amx-fp16",
236 .description = "Support AMX amx-fp16 instructions",
237 .dependencies = featureSet(&[_]Feature{
238 .amx_tile,
239 }),
240 };
221241 result[@enumToInt(Feature.amx_int8)] = .{
222242 .llvm_name = "amx-int8",
223243 .description = "Support AMX-INT8 instructions",
......@@ -360,6 +380,20 @@ pub const all_features = blk: {
360380 .avx512f,
361381 }),
362382 };
383 result[@enumToInt(Feature.avxifma)] = .{
384 .llvm_name = "avxifma",
385 .description = "Enable AVX-IFMA",
386 .dependencies = featureSet(&[_]Feature{
387 .avx2,
388 }),
389 };
390 result[@enumToInt(Feature.avxneconvert)] = .{
391 .llvm_name = "avxneconvert",
392 .description = "Support AVX-NE-CONVERT instructions",
393 .dependencies = featureSet(&[_]Feature{
394 .avx2,
395 }),
396 };
363397 result[@enumToInt(Feature.avxvnni)] = .{
364398 .llvm_name = "avxvnni",
365399 .description = "Support AVX_VNNI encoding",
......@@ -367,6 +401,13 @@ pub const all_features = blk: {
367401 .avx2,
368402 }),
369403 };
404 result[@enumToInt(Feature.avxvnniint8)] = .{
405 .llvm_name = "avxvnniint8",
406 .description = "Enable AVX-VNNI-INT8",
407 .dependencies = featureSet(&[_]Feature{
408 .avx2,
409 }),
410 };
370411 result[@enumToInt(Feature.bmi)] = .{
371412 .llvm_name = "bmi",
372413 .description = "Support BMI instructions",
......@@ -407,6 +448,11 @@ pub const all_features = blk: {
407448 .description = "Enable conditional move instructions",
408449 .dependencies = featureSet(&[_]Feature{}),
409450 };
451 result[@enumToInt(Feature.cmpccxadd)] = .{
452 .llvm_name = "cmpccxadd",
453 .description = "Support CMPCCXADD instructions",
454 .dependencies = featureSet(&[_]Feature{}),
455 };
410456 result[@enumToInt(Feature.crc32)] = .{
411457 .llvm_name = "crc32",
412458 .description = "Enable SSE 4.2 CRC32 instruction (used when SSE4.2 is supported but function is GPR only)",
......@@ -732,6 +778,11 @@ pub const all_features = blk: {
732778 .description = "Prefer AVX512 mask registers over PTEST/MOVMSK",
733779 .dependencies = featureSet(&[_]Feature{}),
734780 };
781 result[@enumToInt(Feature.prefetchi)] = .{
782 .llvm_name = "prefetchi",
783 .description = "Prefetch instruction with T0 or T1 Hint",
784 .dependencies = featureSet(&[_]Feature{}),
785 };
735786 result[@enumToInt(Feature.prefetchwt1)] = .{
736787 .llvm_name = "prefetchwt1",
737788 .description = "Prefetch with Intent to Write and T1 Hint",
......@@ -747,6 +798,11 @@ pub const all_features = blk: {
747798 .description = "Support ptwrite instruction",
748799 .dependencies = featureSet(&[_]Feature{}),
749800 };
801 result[@enumToInt(Feature.raoint)] = .{
802 .llvm_name = "raoint",
803 .description = "Support RAO-INT instructions",
804 .dependencies = featureSet(&[_]Feature{}),
805 };
750806 result[@enumToInt(Feature.rdpid)] = .{
751807 .llvm_name = "rdpid",
752808 .description = "Support RDPID instructions",
......@@ -1059,6 +1115,7 @@ pub const cpu = struct {
10591115 .features = featureSet(&[_]Feature{
10601116 .@"64bit",
10611117 .adx,
1118 .allow_light_256_bit,
10621119 .avxvnni,
10631120 .bmi,
10641121 .bmi2,
......@@ -1488,6 +1545,7 @@ pub const cpu = struct {
14881545 .features = featureSet(&[_]Feature{
14891546 .@"64bit",
14901547 .adx,
1548 .allow_light_256_bit,
14911549 .avx2,
14921550 .bmi,
14931551 .bmi2,
......@@ -1615,6 +1673,7 @@ pub const cpu = struct {
16151673 .@"64bit",
16161674 .adx,
16171675 .aes,
1676 .allow_light_256_bit,
16181677 .avx512cd,
16191678 .avx512dq,
16201679 .avx512ifma,
......@@ -1667,6 +1726,7 @@ pub const cpu = struct {
16671726 .@"64bit",
16681727 .adx,
16691728 .aes,
1729 .allow_light_256_bit,
16701730 .avx512bw,
16711731 .avx512cd,
16721732 .avx512dq,
......@@ -1720,6 +1780,7 @@ pub const cpu = struct {
17201780 .@"64bit",
17211781 .adx,
17221782 .aes,
1783 .allow_light_256_bit,
17231784 .avx512bf16,
17241785 .avx512cd,
17251786 .avx512dq,
......@@ -1789,6 +1850,7 @@ pub const cpu = struct {
17891850 .llvm_name = "core-avx2",
17901851 .features = featureSet(&[_]Feature{
17911852 .@"64bit",
1853 .allow_light_256_bit,
17921854 .avx2,
17931855 .bmi,
17941856 .bmi2,
......@@ -1901,6 +1963,86 @@ pub const cpu = struct {
19011963 .xsaveopt,
19021964 }),
19031965 };
1966 pub const emeraldrapids = CpuModel{
1967 .name = "emeraldrapids",
1968 .llvm_name = "emeraldrapids",
1969 .features = featureSet(&[_]Feature{
1970 .@"64bit",
1971 .adx,
1972 .allow_light_256_bit,
1973 .amx_bf16,
1974 .amx_int8,
1975 .avx512bf16,
1976 .avx512bitalg,
1977 .avx512cd,
1978 .avx512fp16,
1979 .avx512ifma,
1980 .avx512vbmi,
1981 .avx512vbmi2,
1982 .avx512vnni,
1983 .avx512vpopcntdq,
1984 .avxvnni,
1985 .bmi,
1986 .bmi2,
1987 .cldemote,
1988 .clflushopt,
1989 .clwb,
1990 .cmov,
1991 .crc32,
1992 .cx16,
1993 .enqcmd,
1994 .ermsb,
1995 .false_deps_getmant,
1996 .false_deps_mulc,
1997 .false_deps_mullq,
1998 .false_deps_perm,
1999 .false_deps_range,
2000 .fast_15bytenop,
2001 .fast_gather,
2002 .fast_scalar_fsqrt,
2003 .fast_shld_rotate,
2004 .fast_variable_crosslane_shuffle,
2005 .fast_variable_perlane_shuffle,
2006 .fast_vector_fsqrt,
2007 .fsgsbase,
2008 .fsrm,
2009 .fxsr,
2010 .gfni,
2011 .idivq_to_divl,
2012 .invpcid,
2013 .lzcnt,
2014 .macrofusion,
2015 .mmx,
2016 .movbe,
2017 .movdir64b,
2018 .movdiri,
2019 .nopl,
2020 .pconfig,
2021 .pku,
2022 .popcnt,
2023 .prefer_256_bit,
2024 .prfchw,
2025 .ptwrite,
2026 .rdpid,
2027 .rdrnd,
2028 .rdseed,
2029 .sahf,
2030 .serialize,
2031 .sha,
2032 .shstk,
2033 .tsxldtrk,
2034 .uintr,
2035 .vaes,
2036 .vpclmulqdq,
2037 .vzeroupper,
2038 .waitpkg,
2039 .wbnoinvd,
2040 .x87,
2041 .xsavec,
2042 .xsaveopt,
2043 .xsaves,
2044 }),
2045 };
19042046 pub const generic = CpuModel{
19052047 .name = "generic",
19062048 .llvm_name = "generic",
......@@ -2000,11 +2142,155 @@ pub const cpu = struct {
20002142 .xsaves,
20012143 }),
20022144 };
2145 pub const grandridge = CpuModel{
2146 .name = "grandridge",
2147 .llvm_name = "grandridge",
2148 .features = featureSet(&[_]Feature{
2149 .@"64bit",
2150 .adx,
2151 .avxifma,
2152 .avxneconvert,
2153 .avxvnni,
2154 .avxvnniint8,
2155 .bmi,
2156 .bmi2,
2157 .cldemote,
2158 .clflushopt,
2159 .clwb,
2160 .cmov,
2161 .cmpccxadd,
2162 .crc32,
2163 .cx16,
2164 .f16c,
2165 .fast_movbe,
2166 .fma,
2167 .fsgsbase,
2168 .fxsr,
2169 .gfni,
2170 .hreset,
2171 .invpcid,
2172 .lzcnt,
2173 .mmx,
2174 .movbe,
2175 .movdir64b,
2176 .movdiri,
2177 .nopl,
2178 .pconfig,
2179 .pku,
2180 .popcnt,
2181 .prfchw,
2182 .ptwrite,
2183 .raoint,
2184 .rdpid,
2185 .rdrnd,
2186 .rdseed,
2187 .sahf,
2188 .serialize,
2189 .sha,
2190 .shstk,
2191 .slow_incdec,
2192 .slow_lea,
2193 .slow_two_mem_ops,
2194 .use_glm_div_sqrt_costs,
2195 .vaes,
2196 .vpclmulqdq,
2197 .vzeroupper,
2198 .waitpkg,
2199 .widekl,
2200 .x87,
2201 .xsavec,
2202 .xsaveopt,
2203 .xsaves,
2204 }),
2205 };
2206 pub const graniterapids = CpuModel{
2207 .name = "graniterapids",
2208 .llvm_name = "graniterapids",
2209 .features = featureSet(&[_]Feature{
2210 .@"64bit",
2211 .adx,
2212 .allow_light_256_bit,
2213 .amx_bf16,
2214 .amx_fp16,
2215 .amx_int8,
2216 .avx512bf16,
2217 .avx512bitalg,
2218 .avx512cd,
2219 .avx512fp16,
2220 .avx512ifma,
2221 .avx512vbmi,
2222 .avx512vbmi2,
2223 .avx512vnni,
2224 .avx512vpopcntdq,
2225 .avxvnni,
2226 .bmi,
2227 .bmi2,
2228 .cldemote,
2229 .clflushopt,
2230 .clwb,
2231 .cmov,
2232 .crc32,
2233 .cx16,
2234 .enqcmd,
2235 .ermsb,
2236 .false_deps_getmant,
2237 .false_deps_mulc,
2238 .false_deps_mullq,
2239 .false_deps_perm,
2240 .false_deps_range,
2241 .fast_15bytenop,
2242 .fast_gather,
2243 .fast_scalar_fsqrt,
2244 .fast_shld_rotate,
2245 .fast_variable_crosslane_shuffle,
2246 .fast_variable_perlane_shuffle,
2247 .fast_vector_fsqrt,
2248 .fsgsbase,
2249 .fsrm,
2250 .fxsr,
2251 .gfni,
2252 .idivq_to_divl,
2253 .invpcid,
2254 .lzcnt,
2255 .macrofusion,
2256 .mmx,
2257 .movbe,
2258 .movdir64b,
2259 .movdiri,
2260 .nopl,
2261 .pconfig,
2262 .pku,
2263 .popcnt,
2264 .prefer_256_bit,
2265 .prefetchi,
2266 .prfchw,
2267 .ptwrite,
2268 .rdpid,
2269 .rdrnd,
2270 .rdseed,
2271 .sahf,
2272 .serialize,
2273 .sha,
2274 .shstk,
2275 .tsxldtrk,
2276 .uintr,
2277 .vaes,
2278 .vpclmulqdq,
2279 .vzeroupper,
2280 .waitpkg,
2281 .wbnoinvd,
2282 .x87,
2283 .xsavec,
2284 .xsaveopt,
2285 .xsaves,
2286 }),
2287 };
20032288 pub const haswell = CpuModel{
20042289 .name = "haswell",
20052290 .llvm_name = "haswell",
20062291 .features = featureSet(&[_]Feature{
20072292 .@"64bit",
2293 .allow_light_256_bit,
20082294 .avx2,
20092295 .bmi,
20102296 .bmi2,
......@@ -2085,6 +2371,7 @@ pub const cpu = struct {
20852371 .features = featureSet(&[_]Feature{
20862372 .@"64bit",
20872373 .adx,
2374 .allow_light_256_bit,
20882375 .avx512bitalg,
20892376 .avx512cd,
20902377 .avx512dq,
......@@ -2128,7 +2415,6 @@ pub const cpu = struct {
21282415 .rdseed,
21292416 .sahf,
21302417 .sha,
2131 .slow_3ops_lea,
21322418 .vaes,
21332419 .vpclmulqdq,
21342420 .vzeroupper,
......@@ -2144,6 +2430,7 @@ pub const cpu = struct {
21442430 .features = featureSet(&[_]Feature{
21452431 .@"64bit",
21462432 .adx,
2433 .allow_light_256_bit,
21472434 .avx512bitalg,
21482435 .avx512cd,
21492436 .avx512dq,
......@@ -2189,7 +2476,6 @@ pub const cpu = struct {
21892476 .rdseed,
21902477 .sahf,
21912478 .sha,
2192 .slow_3ops_lea,
21932479 .vaes,
21942480 .vpclmulqdq,
21952481 .vzeroupper,
......@@ -2392,6 +2678,70 @@ pub const cpu = struct {
23922678 .vzeroupper,
23932679 }),
23942680 };
2681 pub const meteorlake = CpuModel{
2682 .name = "meteorlake",
2683 .llvm_name = "meteorlake",
2684 .features = featureSet(&[_]Feature{
2685 .@"64bit",
2686 .adx,
2687 .allow_light_256_bit,
2688 .avxvnni,
2689 .bmi,
2690 .bmi2,
2691 .cldemote,
2692 .clflushopt,
2693 .clwb,
2694 .cmov,
2695 .crc32,
2696 .cx16,
2697 .f16c,
2698 .false_deps_perm,
2699 .false_deps_popcnt,
2700 .fast_15bytenop,
2701 .fast_gather,
2702 .fast_scalar_fsqrt,
2703 .fast_shld_rotate,
2704 .fast_variable_crosslane_shuffle,
2705 .fast_variable_perlane_shuffle,
2706 .fast_vector_fsqrt,
2707 .fma,
2708 .fsgsbase,
2709 .fxsr,
2710 .gfni,
2711 .hreset,
2712 .idivq_to_divl,
2713 .invpcid,
2714 .lzcnt,
2715 .macrofusion,
2716 .mmx,
2717 .movbe,
2718 .movdir64b,
2719 .movdiri,
2720 .nopl,
2721 .pconfig,
2722 .pku,
2723 .popcnt,
2724 .prfchw,
2725 .ptwrite,
2726 .rdpid,
2727 .rdrnd,
2728 .rdseed,
2729 .sahf,
2730 .serialize,
2731 .sha,
2732 .shstk,
2733 .slow_3ops_lea,
2734 .vaes,
2735 .vpclmulqdq,
2736 .vzeroupper,
2737 .waitpkg,
2738 .widekl,
2739 .x87,
2740 .xsavec,
2741 .xsaveopt,
2742 .xsaves,
2743 }),
2744 };
23952745 pub const nehalem = CpuModel{
23962746 .name = "nehalem",
23972747 .llvm_name = "nehalem",
......@@ -2620,12 +2970,77 @@ pub const cpu = struct {
26202970 .x87,
26212971 }),
26222972 };
2973 pub const raptorlake = CpuModel{
2974 .name = "raptorlake",
2975 .llvm_name = "raptorlake",
2976 .features = featureSet(&[_]Feature{
2977 .@"64bit",
2978 .adx,
2979 .allow_light_256_bit,
2980 .avxvnni,
2981 .bmi,
2982 .bmi2,
2983 .cldemote,
2984 .clflushopt,
2985 .clwb,
2986 .cmov,
2987 .crc32,
2988 .cx16,
2989 .f16c,
2990 .false_deps_perm,
2991 .false_deps_popcnt,
2992 .fast_15bytenop,
2993 .fast_gather,
2994 .fast_scalar_fsqrt,
2995 .fast_shld_rotate,
2996 .fast_variable_crosslane_shuffle,
2997 .fast_variable_perlane_shuffle,
2998 .fast_vector_fsqrt,
2999 .fma,
3000 .fsgsbase,
3001 .fxsr,
3002 .gfni,
3003 .hreset,
3004 .idivq_to_divl,
3005 .invpcid,
3006 .lzcnt,
3007 .macrofusion,
3008 .mmx,
3009 .movbe,
3010 .movdir64b,
3011 .movdiri,
3012 .nopl,
3013 .pconfig,
3014 .pku,
3015 .popcnt,
3016 .prfchw,
3017 .ptwrite,
3018 .rdpid,
3019 .rdrnd,
3020 .rdseed,
3021 .sahf,
3022 .serialize,
3023 .sha,
3024 .shstk,
3025 .slow_3ops_lea,
3026 .vaes,
3027 .vpclmulqdq,
3028 .vzeroupper,
3029 .waitpkg,
3030 .widekl,
3031 .x87,
3032 .xsavec,
3033 .xsaveopt,
3034 .xsaves,
3035 }),
3036 };
26233037 pub const rocketlake = CpuModel{
26243038 .name = "rocketlake",
26253039 .llvm_name = "rocketlake",
26263040 .features = featureSet(&[_]Feature{
26273041 .@"64bit",
26283042 .adx,
3043 .allow_light_256_bit,
26293044 .avx512bitalg,
26303045 .avx512cd,
26313046 .avx512dq,
......@@ -2669,7 +3084,6 @@ pub const cpu = struct {
26693084 .rdseed,
26703085 .sahf,
26713086 .sha,
2672 .slow_3ops_lea,
26733087 .vaes,
26743088 .vpclmulqdq,
26753089 .vzeroupper,
......@@ -2713,6 +3127,7 @@ pub const cpu = struct {
27133127 .features = featureSet(&[_]Feature{
27143128 .@"64bit",
27153129 .adx,
3130 .allow_light_256_bit,
27163131 .amx_bf16,
27173132 .amx_int8,
27183133 .avx512bf16,
......@@ -2773,7 +3188,6 @@ pub const cpu = struct {
27733188 .serialize,
27743189 .sha,
27753190 .shstk,
2776 .slow_3ops_lea,
27773191 .tsxldtrk,
27783192 .uintr,
27793193 .vaes,
......@@ -2787,6 +3201,66 @@ pub const cpu = struct {
27873201 .xsaves,
27883202 }),
27893203 };
3204 pub const sierraforest = CpuModel{
3205 .name = "sierraforest",
3206 .llvm_name = "sierraforest",
3207 .features = featureSet(&[_]Feature{
3208 .@"64bit",
3209 .adx,
3210 .avxifma,
3211 .avxneconvert,
3212 .avxvnni,
3213 .avxvnniint8,
3214 .bmi,
3215 .bmi2,
3216 .cldemote,
3217 .clflushopt,
3218 .clwb,
3219 .cmov,
3220 .cmpccxadd,
3221 .crc32,
3222 .cx16,
3223 .f16c,
3224 .fast_movbe,
3225 .fma,
3226 .fsgsbase,
3227 .fxsr,
3228 .gfni,
3229 .hreset,
3230 .invpcid,
3231 .lzcnt,
3232 .mmx,
3233 .movbe,
3234 .movdir64b,
3235 .movdiri,
3236 .nopl,
3237 .pconfig,
3238 .pku,
3239 .popcnt,
3240 .prfchw,
3241 .ptwrite,
3242 .rdpid,
3243 .rdrnd,
3244 .rdseed,
3245 .sahf,
3246 .serialize,
3247 .sha,
3248 .shstk,
3249 .slow_incdec,
3250 .slow_lea,
3251 .slow_two_mem_ops,
3252 .use_glm_div_sqrt_costs,
3253 .vaes,
3254 .vpclmulqdq,
3255 .vzeroupper,
3256 .waitpkg,
3257 .widekl,
3258 .x87,
3259 .xsavec,
3260 .xsaveopt,
3261 .xsaves,
3262 }),
3263 };
27903264 pub const silvermont = CpuModel{
27913265 .name = "silvermont",
27923266 .llvm_name = "silvermont",
......@@ -2825,6 +3299,7 @@ pub const cpu = struct {
28253299 .@"64bit",
28263300 .adx,
28273301 .aes,
3302 .allow_light_256_bit,
28283303 .avx512bw,
28293304 .avx512cd,
28303305 .avx512dq,
......@@ -2877,6 +3352,7 @@ pub const cpu = struct {
28773352 .@"64bit",
28783353 .adx,
28793354 .aes,
3355 .allow_light_256_bit,
28803356 .avx2,
28813357 .bmi,
28823358 .bmi2,
......@@ -2925,6 +3401,7 @@ pub const cpu = struct {
29253401 .@"64bit",
29263402 .adx,
29273403 .aes,
3404 .allow_light_256_bit,
29283405 .avx512bw,
29293406 .avx512cd,
29303407 .avx512dq,
......@@ -3007,6 +3484,7 @@ pub const cpu = struct {
30073484 .features = featureSet(&[_]Feature{
30083485 .@"64bit",
30093486 .adx,
3487 .allow_light_256_bit,
30103488 .avx512bitalg,
30113489 .avx512cd,
30123490 .avx512dq,
......@@ -3055,7 +3533,6 @@ pub const cpu = struct {
30553533 .sahf,
30563534 .sha,
30573535 .shstk,
3058 .slow_3ops_lea,
30593536 .vaes,
30603537 .vpclmulqdq,
30613538 .vzeroupper,
......@@ -3194,6 +3671,7 @@ pub const cpu = struct {
31943671 .llvm_name = "x86-64-v3",
31953672 .features = featureSet(&[_]Feature{
31963673 .@"64bit",
3674 .allow_light_256_bit,
31973675 .avx2,
31983676 .bmi,
31993677 .bmi2,
......@@ -3229,6 +3707,7 @@ pub const cpu = struct {
32293707 .llvm_name = "x86-64-v4",
32303708 .features = featureSet(&[_]Feature{
32313709 .@"64bit",
3710 .allow_light_256_bit,
32323711 .avx512bw,
32333712 .avx512cd,
32343713 .avx512dq,
......@@ -3284,6 +3763,7 @@ pub const cpu = struct {
32843763 .@"64bit",
32853764 .adx,
32863765 .aes,
3766 .allow_light_256_bit,
32873767 .avx2,
32883768 .bmi,
32893769 .bmi2,
......@@ -3334,6 +3814,7 @@ pub const cpu = struct {
33343814 .@"64bit",
33353815 .adx,
33363816 .aes,
3817 .allow_light_256_bit,
33373818 .avx2,
33383819 .bmi,
33393820 .bmi2,
......@@ -3387,6 +3868,7 @@ pub const cpu = struct {
33873868 .features = featureSet(&[_]Feature{
33883869 .@"64bit",
33893870 .adx,
3871 .allow_light_256_bit,
33903872 .avx2,
33913873 .bmi,
33923874 .bmi2,
......@@ -3439,4 +3921,72 @@ pub const cpu = struct {
34393921 .xsaves,
34403922 }),
34413923 };
3924 pub const znver4 = CpuModel{
3925 .name = "znver4",
3926 .llvm_name = "znver4",
3927 .features = featureSet(&[_]Feature{
3928 .@"64bit",
3929 .adx,
3930 .allow_light_256_bit,
3931 .avx512bf16,
3932 .avx512bitalg,
3933 .avx512cd,
3934 .avx512dq,
3935 .avx512ifma,
3936 .avx512vbmi,
3937 .avx512vbmi2,
3938 .avx512vl,
3939 .avx512vnni,
3940 .avx512vpopcntdq,
3941 .bmi,
3942 .bmi2,
3943 .branchfusion,
3944 .clflushopt,
3945 .clwb,
3946 .clzero,
3947 .cmov,
3948 .crc32,
3949 .cx16,
3950 .fast_15bytenop,
3951 .fast_bextr,
3952 .fast_lzcnt,
3953 .fast_movbe,
3954 .fast_scalar_fsqrt,
3955 .fast_scalar_shift_masks,
3956 .fast_variable_perlane_shuffle,
3957 .fast_vector_fsqrt,
3958 .fsgsbase,
3959 .fsrm,
3960 .fxsr,
3961 .gfni,
3962 .invpcid,
3963 .lzcnt,
3964 .macrofusion,
3965 .mmx,
3966 .movbe,
3967 .mwaitx,
3968 .nopl,
3969 .pku,
3970 .popcnt,
3971 .prfchw,
3972 .rdpid,
3973 .rdpru,
3974 .rdrnd,
3975 .rdseed,
3976 .sahf,
3977 .sbb_dep_breaking,
3978 .sha,
3979 .shstk,
3980 .slow_shld,
3981 .sse4a,
3982 .vaes,
3983 .vpclmulqdq,
3984 .vzeroupper,
3985 .wbnoinvd,
3986 .x87,
3987 .xsavec,
3988 .xsaveopt,
3989 .xsaves,
3990 }),
3991 };
34423992};
lib/std/target/xtensa.zig created+39
......@@ -0,0 +1,39 @@
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
3const std = @import("../std.zig");
4const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;
6
7pub const Feature = enum {
8 density,
9};
10
11pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
12pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
13pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
14pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
15
16pub const all_features = blk: {
17 const len = @typeInfo(Feature).Enum.fields.len;
18 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
19 var result: [len]CpuFeature = undefined;
20 result[@enumToInt(Feature.density)] = .{
21 .llvm_name = "density",
22 .description = "Enable Density instructions",
23 .dependencies = featureSet(&[_]Feature{}),
24 };
25 const ti = @typeInfo(Feature);
26 for (result) |*elem, i| {
27 elem.index = i;
28 elem.name = ti.Enum.fields[i].name;
29 }
30 break :blk result;
31};
32
33pub const cpu = struct {
34 pub const generic = CpuModel{
35 .name = "generic",
36 .llvm_name = "generic",
37 .features = featureSet(&[_]Feature{}),
38 };
39};
src/codegen/llvm.zig+16-2
......@@ -78,6 +78,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
7878 .x86 => "i386",
7979 .x86_64 => "x86_64",
8080 .xcore => "xcore",
81 .xtensa => "xtensa",
8182 .nvptx => "nvptx",
8283 .nvptx64 => "nvptx64",
8384 .le32 => "le32",
......@@ -88,6 +89,8 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
8889 .hsail64 => "hsail64",
8990 .spir => "spir",
9091 .spir64 => "spir64",
92 .spirv32 => "spirv32",
93 .spirv64 => "spirv64",
9194 .kalimba => "kalimba",
9295 .shave => "shave",
9396 .lanai => "lanai",
......@@ -97,8 +100,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
97100 .renderscript64 => "renderscript64",
98101 .ve => "ve",
99102 .spu_2 => return error.@"LLVM backend does not support SPU Mark II",
100 .spirv32 => return error.@"LLVM backend does not support SPIR-V",
101 .spirv64 => return error.@"LLVM backend does not support SPIR-V",
102103 };
103104 try llvm_triple.appendSlice(llvm_arch);
104105 try llvm_triple.appendSlice("-unknown-");
......@@ -169,6 +170,9 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
169170 .gnuabi64 => "gnuabi64",
170171 .gnueabi => "gnueabi",
171172 .gnueabihf => "gnueabihf",
173 .gnuf32 => "gnuf32",
174 .gnuf64 => "gnuf64",
175 .gnusf => "gnusf",
172176 .gnux32 => "gnux32",
173177 .gnuilp32 => "gnuilp32",
174178 .code16 => "code16",
......@@ -290,6 +294,7 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
290294 .x86 => .x86,
291295 .x86_64 => .x86_64,
292296 .xcore => .xcore,
297 .xtensa => .xtensa,
293298 .nvptx => .nvptx,
294299 .nvptx64 => .nvptx64,
295300 .le32 => .le32,
......@@ -10092,6 +10097,15 @@ fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
1009210097 llvm.LLVMInitializeX86AsmPrinter();
1009310098 llvm.LLVMInitializeX86AsmParser();
1009410099 },
10100 .xtensa => {
10101 if (build_options.llvm_has_xtensa) {
10102 llvm.LLVMInitializeXtensaTarget();
10103 llvm.LLVMInitializeXtensaTargetInfo();
10104 llvm.LLVMInitializeXtensaTargetMC();
10105 llvm.LLVMInitializeXtensaAsmPrinter();
10106 llvm.LLVMInitializeXtensaAsmParser();
10107 }
10108 },
1009510109 .xcore => {
1009610110 llvm.LLVMInitializeXCoreTarget();
1009710111 llvm.LLVMInitializeXCoreTargetInfo();
src/codegen/llvm/bindings.zig+5
......@@ -1133,6 +1133,7 @@ pub extern fn LLVMInitializeSystemZTargetInfo() void;
11331133pub extern fn LLVMInitializeWebAssemblyTargetInfo() void;
11341134pub extern fn LLVMInitializeX86TargetInfo() void;
11351135pub extern fn LLVMInitializeXCoreTargetInfo() void;
1136pub extern fn LLVMInitializeXtensaTargetInfo() void;
11361137pub extern fn LLVMInitializeM68kTargetInfo() void;
11371138pub extern fn LLVMInitializeCSKYTargetInfo() void;
11381139pub extern fn LLVMInitializeVETargetInfo() void;
......@@ -1155,6 +1156,7 @@ pub extern fn LLVMInitializeSystemZTarget() void;
11551156pub extern fn LLVMInitializeWebAssemblyTarget() void;
11561157pub extern fn LLVMInitializeX86Target() void;
11571158pub extern fn LLVMInitializeXCoreTarget() void;
1159pub extern fn LLVMInitializeXtensaTarget() void;
11581160pub extern fn LLVMInitializeM68kTarget() void;
11591161pub extern fn LLVMInitializeVETarget() void;
11601162pub extern fn LLVMInitializeCSKYTarget() void;
......@@ -1177,6 +1179,7 @@ pub extern fn LLVMInitializeSystemZTargetMC() void;
11771179pub extern fn LLVMInitializeWebAssemblyTargetMC() void;
11781180pub extern fn LLVMInitializeX86TargetMC() void;
11791181pub extern fn LLVMInitializeXCoreTargetMC() void;
1182pub extern fn LLVMInitializeXtensaTargetMC() void;
11801183pub extern fn LLVMInitializeM68kTargetMC() void;
11811184pub extern fn LLVMInitializeCSKYTargetMC() void;
11821185pub extern fn LLVMInitializeVETargetMC() void;
......@@ -1199,6 +1202,7 @@ pub extern fn LLVMInitializeSystemZAsmPrinter() void;
11991202pub extern fn LLVMInitializeWebAssemblyAsmPrinter() void;
12001203pub extern fn LLVMInitializeX86AsmPrinter() void;
12011204pub extern fn LLVMInitializeXCoreAsmPrinter() void;
1205pub extern fn LLVMInitializeXtensaAsmPrinter() void;
12021206pub extern fn LLVMInitializeM68kAsmPrinter() void;
12031207pub extern fn LLVMInitializeVEAsmPrinter() void;
12041208pub extern fn LLVMInitializeARCAsmPrinter() void;
......@@ -1218,6 +1222,7 @@ pub extern fn LLVMInitializeSparcAsmParser() void;
12181222pub extern fn LLVMInitializeSystemZAsmParser() void;
12191223pub extern fn LLVMInitializeWebAssemblyAsmParser() void;
12201224pub extern fn LLVMInitializeX86AsmParser() void;
1225pub extern fn LLVMInitializeXtensaAsmParser() void;
12211226pub extern fn LLVMInitializeM68kAsmParser() void;
12221227pub extern fn LLVMInitializeCSKYAsmParser() void;
12231228pub extern fn LLVMInitializeVEAsmParser() void;
src/target.zig+8-4
......@@ -88,6 +88,9 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {
8888 .gnuabi64,
8989 .gnueabi,
9090 .gnueabihf,
91 .gnuf32,
92 .gnuf64,
93 .gnusf,
9194 .gnux32,
9295 .gnuilp32,
9396 => return "glibc",
......@@ -286,6 +289,7 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
286289 .x86,
287290 .x86_64,
288291 .xcore,
292 .xtensa,
289293 .nvptx,
290294 .nvptx64,
291295 .le32,
......@@ -296,6 +300,8 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
296300 .hsail64,
297301 .spir,
298302 .spir64,
303 .spirv32,
304 .spirv64,
299305 .kalimba,
300306 .shave,
301307 .lanai,
......@@ -306,10 +312,7 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
306312 .ve,
307313 => true,
308314
309 .spu_2,
310 .spirv32,
311 .spirv64,
312 => false,
315 .spu_2 => false,
313316 };
314317}
315318
......@@ -566,6 +569,7 @@ pub fn atomicPtrAlignment(
566569 .spirv32,
567570 .dxil,
568571 .loongarch32,
572 .xtensa,
569573 => 32,
570574
571575 .aarch64,
src/type.zig+1
......@@ -7051,6 +7051,7 @@ pub const CType = enum {
70517051 .renderscript32,
70527052 .ve,
70537053 .spu_2,
7054 .xtensa,
70547055 => 4,
70557056
70567057 .aarch64_32,
stage1/config.zig.in+1
......@@ -2,6 +2,7 @@ pub const have_llvm = true;
22pub const llvm_has_m68k = false;
33pub const llvm_has_csky = false;
44pub const llvm_has_arc = false;
5pub const llvm_has_xtensa = false;
56pub const version: [:0]const u8 = "@RESOLVED_ZIG_VERSION@";
67pub const semver = @import("std").SemanticVersion.parse(version) catch unreachable;
78pub const enable_logging: bool = false;
tools/update_cpu_features.zig+79
......@@ -79,6 +79,10 @@ const llvm_targets = [_]LlvmTarget{
7979 .llvm_name = "neoversev1",
8080 .flatten = true,
8181 },
82 .{
83 .llvm_name = "neoversev2",
84 .flatten = true,
85 },
8286 .{
8387 .llvm_name = "neoverse512tvb",
8488 .flatten = true,
......@@ -137,6 +141,14 @@ const llvm_targets = [_]LlvmTarget{
137141 .llvm_name = "a77",
138142 .flatten = true,
139143 },
144 .{
145 .llvm_name = "a715",
146 .flatten = true,
147 },
148 .{
149 .llvm_name = "ampere1a",
150 .flatten = true,
151 },
140152 .{
141153 .llvm_name = "apple-a7",
142154 .flatten = true,
......@@ -161,6 +173,14 @@ const llvm_targets = [_]LlvmTarget{
161173 .llvm_name = "apple-a14",
162174 .flatten = true,
163175 },
176 .{
177 .llvm_name = "apple-a15",
178 .flatten = true,
179 },
180 .{
181 .llvm_name = "apple-a16",
182 .flatten = true,
183 },
164184 .{
165185 .llvm_name = "apple-a7-sysreg",
166186 .flatten = true,
......@@ -181,6 +201,10 @@ const llvm_targets = [_]LlvmTarget{
181201 .llvm_name = "cortex-x2",
182202 .flatten = true,
183203 },
204 .{
205 .llvm_name = "cortex-x3",
206 .flatten = true,
207 },
184208 .{
185209 .llvm_name = "falkor",
186210 .flatten = true,
......@@ -594,6 +618,10 @@ const llvm_targets = [_]LlvmTarget{
594618 .llvm_name = "armv8.8-a",
595619 .zig_name = "v8_8a",
596620 },
621 .{
622 .llvm_name = "armv8.9-a",
623 .zig_name = "v8_9a",
624 },
597625 .{
598626 .llvm_name = "armv8-a",
599627 .zig_name = "v8a",
......@@ -622,6 +650,10 @@ const llvm_targets = [_]LlvmTarget{
622650 .llvm_name = "armv9.3-a",
623651 .zig_name = "v9_3a",
624652 },
653 .{
654 .llvm_name = "armv9.4-a",
655 .zig_name = "v9_4a",
656 },
625657 .{
626658 .llvm_name = "armv9-a",
627659 .zig_name = "v9a",
......@@ -710,6 +742,10 @@ const llvm_targets = [_]LlvmTarget{
710742 .llvm_name = "v8.8a",
711743 .zig_name = "has_v8_8a",
712744 },
745 .{
746 .llvm_name = "v8.9a",
747 .zig_name = "has_v8_9a",
748 },
713749 .{
714750 .llvm_name = "v9a",
715751 .zig_name = "has_v9a",
......@@ -726,6 +762,33 @@ const llvm_targets = [_]LlvmTarget{
726762 .llvm_name = "v9.3a",
727763 .zig_name = "has_v9_3a",
728764 },
765 .{
766 .llvm_name = "v9.4a",
767 .zig_name = "has_v9_4a",
768 },
769 },
770 // LLVM removed support for v2 and v3 but zig wants to support targeting old hardware
771 .extra_features = &.{
772 .{
773 .zig_name = "v2",
774 .desc = "ARMv2 architecture",
775 .deps = &.{"strict_align"},
776 },
777 .{
778 .zig_name = "v2a",
779 .desc = "ARMv2a architecture",
780 .deps = &.{"strict_align"},
781 },
782 .{
783 .zig_name = "v3",
784 .desc = "ARMv3 architecture",
785 .deps = &.{"strict_align"},
786 },
787 .{
788 .zig_name = "v3m",
789 .desc = "ARMv3m architecture",
790 .deps = &.{"strict_align"},
791 },
729792 },
730793 },
731794 .{
......@@ -753,6 +816,11 @@ const llvm_targets = [_]LlvmTarget{
753816 .llvm_name = "Lanai",
754817 .td_name = "Lanai.td",
755818 },
819 .{
820 .zig_name = "loongarch",
821 .llvm_name = "LoongArch",
822 .td_name = "LoongArch.td",
823 },
756824 .{
757825 .zig_name = "m68k",
758826 .llvm_name = "M68k",
......@@ -812,6 +880,12 @@ const llvm_targets = [_]LlvmTarget{
812880 .llvm_name = "Sparc",
813881 .td_name = "Sparc.td",
814882 },
883 // TODO: merge tools/update_spirv_features.zig into this script
884 //.{
885 // .zig_name = "spirv",
886 // .llvm_name = "SPIRV",
887 // .td_name = "SPIRV.td",
888 //},
815889 .{
816890 .zig_name = "s390x",
817891 .llvm_name = "SystemZ",
......@@ -847,6 +921,11 @@ const llvm_targets = [_]LlvmTarget{
847921 .llvm_name = "XCore",
848922 .td_name = "XCore.td",
849923 },
924 .{
925 .zig_name = "xtensa",
926 .llvm_name = "Xtensa",
927 .td_name = "Xtensa.td",
928 },
850929};
851930
852931pub fn main() anyerror!void {