authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-01 21:35:19-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-01 21:35:19-07:00
logd55d98919dd03ac8dcaa787409cacb895dd105d9
treefaa2f6788f648dfe728b131ca6f192bbfefe3ec2
parentd19290e603833a197bc8bfc8315561ec77291225

update CPU features to LLVM 14

Notable changes: `_i386`, `_i486`, and `_i686` are renamed to `i386`, `i486`, and `i686` respectively. `std.zig.fmtId` is enhanced to support formatting `i386` as `@"i386"`. Some CPU features which are actually CPU models have been properly flattened, such as `apple_a12`, `apple_a13`, `apple_a7`, `cortex_a78c`, `exynos_m4`, `neoverse_e1`, `neoverse_n1`, `neoverse_n2`, `neoverse_v1`. Some CPU features have been added and some have been removed, following LLVM's lead. CSky CPU features support is added.

15 files changed, 1885 insertions(+), 395 deletions(-)

lib/std/target.zig+2-1
......@@ -444,6 +444,7 @@ pub const Target = struct {
444444 pub const arm = @import("target/arm.zig");
445445 pub const avr = @import("target/avr.zig");
446446 pub const bpf = @import("target/bpf.zig");
447 pub const csky = @import("target/csky.zig");
447448 pub const hexagon = @import("target/hexagon.zig");
448449 pub const mips = @import("target/mips.zig");
449450 pub const msp430 = @import("target/msp430.zig");
......@@ -1287,7 +1288,7 @@ pub const Target = struct {
12871288 .sparc, .sparcel => &sparc.cpu.generic,
12881289 .sparc64 => &sparc.cpu.v9, // 64-bit SPARC needs v9 as the baseline
12891290 .s390x => &systemz.cpu.generic,
1290 .i386 => &x86.cpu._i386,
1291 .i386 => &x86.cpu.i386,
12911292 .x86_64 => &x86.cpu.x86_64,
12921293 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
12931294 .ve => &ve.cpu.generic,
lib/std/target/aarch64.zig+477-227
......@@ -5,17 +5,18 @@ const CpuFeature = std.Target.Cpu.Feature;
55const CpuModel = std.Target.Cpu.Model;
66
77pub const Feature = enum {
8 a510,
89 a65,
10 a710,
911 a76,
12 a78,
13 a78c,
1014 aes,
1115 aggressive_fma,
1216 alternate_sextload_cvt_f32_pattern,
1317 altnzcv,
1418 am,
1519 amvs,
16 apple_a12,
17 apple_a13,
18 apple_a7,
1920 arith_bcc_fusion,
2021 arith_cbz_fusion,
2122 balance_fp_ops,
......@@ -37,7 +38,6 @@ pub const Feature = enum {
3738 cmp_bcc_fusion,
3839 complxnum,
3940 contextidr_el2,
40 cortex_a78c,
4141 cortex_r82,
4242 crc,
4343 crypto,
......@@ -46,12 +46,14 @@ pub const Feature = enum {
4646 dit,
4747 dotprod,
4848 ecv,
49 el2vmsa,
50 el3,
4951 ete,
5052 exynos_cheap_as_move,
51 exynos_m4,
5253 f32mm,
5354 f64mm,
5455 fgt,
56 fix_cortex_a53_835769,
5557 flagm,
5658 force_32bit_jump_tables,
5759 fp16fml,
......@@ -67,20 +69,20 @@ pub const Feature = enum {
6769 harden_sls_blr,
6870 harden_sls_nocomdat,
6971 harden_sls_retbr,
72 hbc,
7073 hcx,
7174 i8mm,
7275 jsconv,
7376 lor,
7477 ls64,
7578 lse,
79 lse2,
7680 lsl_fast,
81 mops,
7782 mpam,
7883 mte,
7984 neon,
80 neoverse_e1,
81 neoverse_n1,
82 neoverse_n2,
83 neoverse_v1,
85 no_bti_at_return_twice,
8486 no_neg_immediates,
8587 no_zcz_fp,
8688 nv,
......@@ -89,7 +91,6 @@ pub const Feature = enum {
8991 pan_rwv,
9092 pauth,
9193 perfmon,
92 pmu,
9394 predictable_select_expensive,
9495 predres,
9596 rand,
......@@ -138,6 +139,7 @@ pub const Feature = enum {
138139 spe_eef,
139140 specrestrict,
140141 ssbs,
142 streaming_sve,
141143 strict_align,
142144 sve,
143145 sve2,
......@@ -157,6 +159,7 @@ pub const Feature = enum {
157159 use_experimental_zeroing_pseudos,
158160 use_postra_scheduler,
159161 use_reciprocal_square_root,
162 use_scalar_inc_vl,
160163 v8_1a,
161164 v8_2a,
162165 v8_3a,
......@@ -164,8 +167,13 @@ pub const Feature = enum {
164167 v8_5a,
165168 v8_6a,
166169 v8_7a,
170 v8_8a,
167171 v8a,
168172 v8r,
173 v9_1a,
174 v9_2a,
175 v9_3a,
176 v9a,
169177 vh,
170178 wfxt,
171179 xs,
......@@ -185,32 +193,55 @@ pub const all_features = blk: {
185193 const len = @typeInfo(Feature).Enum.fields.len;
186194 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
187195 var result: [len]CpuFeature = undefined;
196 result[@enumToInt(Feature.a510)] = .{
197 .llvm_name = "a510",
198 .description = "Cortex-A510 ARM processors",
199 .dependencies = featureSet(&[_]Feature{
200 .fuse_aes,
201 .use_postra_scheduler,
202 }),
203 };
188204 result[@enumToInt(Feature.a65)] = .{
189205 .llvm_name = "a65",
190206 .description = "Cortex-A65 ARM processors",
191207 .dependencies = featureSet(&[_]Feature{
192 .crypto,
193 .dotprod,
194 .fullfp16,
195208 .fuse_address,
196209 .fuse_aes,
197210 .fuse_literals,
198 .rcpc,
199 .ssbs,
200 .v8_2a,
211 }),
212 };
213 result[@enumToInt(Feature.a710)] = .{
214 .llvm_name = "a710",
215 .description = "Cortex-A710 ARM processors",
216 .dependencies = featureSet(&[_]Feature{
217 .cmp_bcc_fusion,
218 .fuse_aes,
219 .use_postra_scheduler,
201220 }),
202221 };
203222 result[@enumToInt(Feature.a76)] = .{
204223 .llvm_name = "a76",
205224 .description = "Cortex-A76 ARM processors",
206225 .dependencies = featureSet(&[_]Feature{
207 .crypto,
208 .dotprod,
209 .fullfp16,
210226 .fuse_aes,
211 .rcpc,
212 .ssbs,
213 .v8_2a,
227 }),
228 };
229 result[@enumToInt(Feature.a78)] = .{
230 .llvm_name = "a78",
231 .description = "Cortex-A78 ARM processors",
232 .dependencies = featureSet(&[_]Feature{
233 .cmp_bcc_fusion,
234 .fuse_aes,
235 .use_postra_scheduler,
236 }),
237 };
238 result[@enumToInt(Feature.a78c)] = .{
239 .llvm_name = "a78c",
240 .description = "Cortex-A78C ARM processors",
241 .dependencies = featureSet(&[_]Feature{
242 .cmp_bcc_fusion,
243 .fuse_aes,
244 .use_postra_scheduler,
214245 }),
215246 };
216247 result[@enumToInt(Feature.aes)] = .{
......@@ -247,60 +278,6 @@ pub const all_features = blk: {
247278 .am,
248279 }),
249280 };
250 result[@enumToInt(Feature.apple_a12)] = .{
251 .llvm_name = "apple-a12",
252 .description = "Apple A12",
253 .dependencies = featureSet(&[_]Feature{
254 .alternate_sextload_cvt_f32_pattern,
255 .arith_bcc_fusion,
256 .arith_cbz_fusion,
257 .crypto,
258 .disable_latency_sched_heuristic,
259 .fullfp16,
260 .fuse_aes,
261 .fuse_crypto_eor,
262 .perfmon,
263 .v8_3a,
264 .zcm,
265 .zcz,
266 }),
267 };
268 result[@enumToInt(Feature.apple_a13)] = .{
269 .llvm_name = "apple-a13",
270 .description = "Apple A13",
271 .dependencies = featureSet(&[_]Feature{
272 .alternate_sextload_cvt_f32_pattern,
273 .arith_bcc_fusion,
274 .arith_cbz_fusion,
275 .crypto,
276 .disable_latency_sched_heuristic,
277 .fp16fml,
278 .fuse_aes,
279 .fuse_crypto_eor,
280 .perfmon,
281 .sha3,
282 .v8_4a,
283 .zcm,
284 .zcz,
285 }),
286 };
287 result[@enumToInt(Feature.apple_a7)] = .{
288 .llvm_name = "apple-a7",
289 .description = "Apple A7 (the CPU formerly known as Cyclone)",
290 .dependencies = featureSet(&[_]Feature{
291 .alternate_sextload_cvt_f32_pattern,
292 .arith_bcc_fusion,
293 .arith_cbz_fusion,
294 .crypto,
295 .disable_latency_sched_heuristic,
296 .fuse_aes,
297 .fuse_crypto_eor,
298 .perfmon,
299 .zcm,
300 .zcz,
301 .zcz_fp_workaround,
302 }),
303 };
304281 result[@enumToInt(Feature.arith_bcc_fusion)] = .{
305282 .llvm_name = "arith-bcc-fusion",
306283 .description = "CPU fuses arithmetic+bcc operations",
......@@ -408,31 +385,11 @@ pub const all_features = blk: {
408385 .description = "Enable RW operand Context ID Register (EL2)",
409386 .dependencies = featureSet(&[_]Feature{}),
410387 };
411 result[@enumToInt(Feature.cortex_a78c)] = .{
412 .llvm_name = "cortex-a78c",
413 .description = "Cortex-A78C ARM processors",
414 .dependencies = featureSet(&[_]Feature{
415 .cmp_bcc_fusion,
416 .crypto,
417 .dotprod,
418 .flagm,
419 .fp16fml,
420 .fuse_aes,
421 .pauth,
422 .perfmon,
423 .rcpc,
424 .spe,
425 .ssbs,
426 .use_postra_scheduler,
427 .v8_2a,
428 }),
429 };
430388 result[@enumToInt(Feature.cortex_r82)] = .{
431389 .llvm_name = "cortex-r82",
432 .description = "Cortex-R82 ARM Processors",
390 .description = "Cortex-R82 ARM processors",
433391 .dependencies = featureSet(&[_]Feature{
434392 .use_postra_scheduler,
435 .v8r,
436393 }),
437394 };
438395 result[@enumToInt(Feature.crc)] = .{
......@@ -473,6 +430,16 @@ pub const all_features = blk: {
473430 .description = "Enable enhanced counter virtualization extension",
474431 .dependencies = featureSet(&[_]Feature{}),
475432 };
433 result[@enumToInt(Feature.el2vmsa)] = .{
434 .llvm_name = "el2vmsa",
435 .description = "Enable Exception Level 2 Virtual Memory System Architecture",
436 .dependencies = featureSet(&[_]Feature{}),
437 };
438 result[@enumToInt(Feature.el3)] = .{
439 .llvm_name = "el3",
440 .description = "Enable Exception Level 3",
441 .dependencies = featureSet(&[_]Feature{}),
442 };
476443 result[@enumToInt(Feature.ete)] = .{
477444 .llvm_name = "ete",
478445 .description = "Enable Embedded Trace Extension",
......@@ -487,29 +454,6 @@ pub const all_features = blk: {
487454 .custom_cheap_as_move,
488455 }),
489456 };
490 result[@enumToInt(Feature.exynos_m4)] = .{
491 .llvm_name = "exynosm4",
492 .description = "Samsung Exynos-M4 processors",
493 .dependencies = featureSet(&[_]Feature{
494 .arith_bcc_fusion,
495 .arith_cbz_fusion,
496 .crypto,
497 .dotprod,
498 .exynos_cheap_as_move,
499 .force_32bit_jump_tables,
500 .fullfp16,
501 .fuse_address,
502 .fuse_aes,
503 .fuse_arith_logic,
504 .fuse_csel,
505 .fuse_literals,
506 .lsl_fast,
507 .perfmon,
508 .use_postra_scheduler,
509 .v8_2a,
510 .zcz,
511 }),
512 };
513457 result[@enumToInt(Feature.f32mm)] = .{
514458 .llvm_name = "f32mm",
515459 .description = "Enable Matrix Multiply FP32 Extension",
......@@ -529,6 +473,11 @@ pub const all_features = blk: {
529473 .description = "Enable fine grained virtualization traps extension",
530474 .dependencies = featureSet(&[_]Feature{}),
531475 };
476 result[@enumToInt(Feature.fix_cortex_a53_835769)] = .{
477 .llvm_name = "fix-cortex-a53-835769",
478 .description = "Mitigate Cortex-A53 Erratum 835769",
479 .dependencies = featureSet(&[_]Feature{}),
480 };
532481 result[@enumToInt(Feature.flagm)] = .{
533482 .llvm_name = "flagm",
534483 .description = "Enable v8.4-A Flag Manipulation Instructions",
......@@ -608,6 +557,11 @@ pub const all_features = blk: {
608557 .description = "Harden against straight line speculation across RET and BR instructions",
609558 .dependencies = featureSet(&[_]Feature{}),
610559 };
560 result[@enumToInt(Feature.hbc)] = .{
561 .llvm_name = "hbc",
562 .description = "Enable Armv8.8-A Hinted Conditional Branches Extension",
563 .dependencies = featureSet(&[_]Feature{}),
564 };
611565 result[@enumToInt(Feature.hcx)] = .{
612566 .llvm_name = "hcx",
613567 .description = "Enable Armv8.7-A HCRX_EL2 system register",
......@@ -640,11 +594,21 @@ pub const all_features = blk: {
640594 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions",
641595 .dependencies = featureSet(&[_]Feature{}),
642596 };
597 result[@enumToInt(Feature.lse2)] = .{
598 .llvm_name = "lse2",
599 .description = "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules",
600 .dependencies = featureSet(&[_]Feature{}),
601 };
643602 result[@enumToInt(Feature.lsl_fast)] = .{
644603 .llvm_name = "lsl-fast",
645604 .description = "CPU has a fastpath logical shift of up to 3 places",
646605 .dependencies = featureSet(&[_]Feature{}),
647606 };
607 result[@enumToInt(Feature.mops)] = .{
608 .llvm_name = "mops",
609 .description = "Enable Armv8.8-A memcpy and memset acceleration instructions",
610 .dependencies = featureSet(&[_]Feature{}),
611 };
648612 result[@enumToInt(Feature.mpam)] = .{
649613 .llvm_name = "mpam",
650614 .description = "Enable v8.4-A Memory system Partitioning and Monitoring extension",
......@@ -662,68 +626,10 @@ pub const all_features = blk: {
662626 .fp_armv8,
663627 }),
664628 };
665 result[@enumToInt(Feature.neoverse_e1)] = .{
666 .llvm_name = "neoversee1",
667 .description = "Neoverse E1 ARM processors",
668 .dependencies = featureSet(&[_]Feature{
669 .crypto,
670 .dotprod,
671 .fullfp16,
672 .fuse_aes,
673 .rcpc,
674 .ssbs,
675 .use_postra_scheduler,
676 .v8_2a,
677 }),
678 };
679 result[@enumToInt(Feature.neoverse_n1)] = .{
680 .llvm_name = "neoversen1",
681 .description = "Neoverse N1 ARM processors",
682 .dependencies = featureSet(&[_]Feature{
683 .crypto,
684 .dotprod,
685 .fullfp16,
686 .fuse_aes,
687 .rcpc,
688 .spe,
689 .ssbs,
690 .use_postra_scheduler,
691 .v8_2a,
692 }),
693 };
694 result[@enumToInt(Feature.neoverse_n2)] = .{
695 .llvm_name = "neoversen2",
696 .description = "Neoverse N2 ARM processors",
697 .dependencies = featureSet(&[_]Feature{
698 .bf16,
699 .crypto,
700 .ete,
701 .fuse_aes,
702 .i8mm,
703 .mte,
704 .sve2_bitperm,
705 .use_postra_scheduler,
706 .v8_5a,
707 }),
708 };
709 result[@enumToInt(Feature.neoverse_v1)] = .{
710 .llvm_name = "neoversev1",
711 .description = "Neoverse V1 ARM processors",
712 .dependencies = featureSet(&[_]Feature{
713 .bf16,
714 .ccdp,
715 .crypto,
716 .fp16fml,
717 .fuse_aes,
718 .i8mm,
719 .perfmon,
720 .rand,
721 .spe,
722 .ssbs,
723 .sve,
724 .use_postra_scheduler,
725 .v8_4a,
726 }),
629 result[@enumToInt(Feature.no_bti_at_return_twice)] = .{
630 .llvm_name = "no-bti-at-return-twice",
631 .description = "Don't place a BTI instruction after a return-twice",
632 .dependencies = featureSet(&[_]Feature{}),
727633 };
728634 result[@enumToInt(Feature.no_neg_immediates)] = .{
729635 .llvm_name = "no-neg-immediates",
......@@ -767,11 +673,6 @@ pub const all_features = blk: {
767673 .description = "Enable ARMv8 PMUv3 Performance Monitors extension",
768674 .dependencies = featureSet(&[_]Feature{}),
769675 };
770 result[@enumToInt(Feature.pmu)] = .{
771 .llvm_name = "pmu",
772 .description = "Enable v8.4-A PMU extension",
773 .dependencies = featureSet(&[_]Feature{}),
774 };
775676 result[@enumToInt(Feature.predictable_select_expensive)] = .{
776677 .llvm_name = "predictable-select-expensive",
777678 .description = "Prefer likely predicted branches over selects",
......@@ -990,7 +891,7 @@ pub const all_features = blk: {
990891 .description = "Enable Scalable Matrix Extension (SME)",
991892 .dependencies = featureSet(&[_]Feature{
992893 .bf16,
993 .sve2,
894 .streaming_sve,
994895 }),
995896 };
996897 result[@enumToInt(Feature.sme_f64)] = .{
......@@ -1027,6 +928,11 @@ pub const all_features = blk: {
1027928 .description = "Enable Speculative Store Bypass Safe bit",
1028929 .dependencies = featureSet(&[_]Feature{}),
1029930 };
931 result[@enumToInt(Feature.streaming_sve)] = .{
932 .llvm_name = "streaming-sve",
933 .description = "Enable subset of SVE(2) instructions for Streaming SVE execution mode",
934 .dependencies = featureSet(&[_]Feature{}),
935 };
1030936 result[@enumToInt(Feature.strict_align)] = .{
1031937 .llvm_name = "strict-align",
1032938 .description = "Disallow all unaligned memory access",
......@@ -1044,6 +950,7 @@ pub const all_features = blk: {
1044950 .description = "Enable Scalable Vector Extension 2 (SVE2) instructions",
1045951 .dependencies = featureSet(&[_]Feature{
1046952 .sve,
953 .use_scalar_inc_vl,
1047954 }),
1048955 };
1049956 result[@enumToInt(Feature.sve2_aes)] = .{
......@@ -1137,6 +1044,11 @@ pub const all_features = blk: {
11371044 .description = "Use the reciprocal square root approximation",
11381045 .dependencies = featureSet(&[_]Feature{}),
11391046 };
1047 result[@enumToInt(Feature.use_scalar_inc_vl)] = .{
1048 .llvm_name = "use-scalar-inc-vl",
1049 .description = "Prefer inc/dec over add+cnt",
1050 .dependencies = featureSet(&[_]Feature{}),
1051 };
11401052 result[@enumToInt(Feature.v8_1a)] = .{
11411053 .llvm_name = "v8.1a",
11421054 .description = "Support ARM v8.1a instructions",
......@@ -1181,9 +1093,9 @@ pub const all_features = blk: {
11811093 .dit,
11821094 .dotprod,
11831095 .flagm,
1096 .lse2,
11841097 .mpam,
11851098 .nv,
1186 .pmu,
11871099 .rcpc_immo,
11881100 .sel2,
11891101 .tlb_rmi,
......@@ -1228,10 +1140,21 @@ pub const all_features = blk: {
12281140 .xs,
12291141 }),
12301142 };
1143 result[@enumToInt(Feature.v8_8a)] = .{
1144 .llvm_name = "v8.8a",
1145 .description = "Support ARM v8.8a instructions",
1146 .dependencies = featureSet(&[_]Feature{
1147 .hbc,
1148 .mops,
1149 .v8_7a,
1150 }),
1151 };
12311152 result[@enumToInt(Feature.v8a)] = .{
1232 .llvm_name = null,
1233 .description = "Support ARM v8a instructions",
1153 .llvm_name = "v8a",
1154 .description = "Support ARM v8.0a instructions",
12341155 .dependencies = featureSet(&[_]Feature{
1156 .el2vmsa,
1157 .el3,
12351158 .neon,
12361159 }),
12371160 };
......@@ -1247,27 +1170,51 @@ pub const all_features = blk: {
12471170 .dit,
12481171 .dotprod,
12491172 .flagm,
1250 .fp16fml,
12511173 .jsconv,
12521174 .lse,
12531175 .pan_rwv,
12541176 .pauth,
1255 .perfmon,
1256 .predres,
12571177 .ras,
12581178 .rcpc_immo,
12591179 .rdm,
1260 .sb,
12611180 .sel2,
1262 .sha3,
1263 .sm4,
1264 .specrestrict,
1265 .ssbs,
12661181 .tlb_rmi,
12671182 .tracev8_4,
12681183 .uaops,
12691184 }),
12701185 };
1186 result[@enumToInt(Feature.v9_1a)] = .{
1187 .llvm_name = "v9.1a",
1188 .description = "Support ARM v9.1a instructions",
1189 .dependencies = featureSet(&[_]Feature{
1190 .v8_6a,
1191 .v9a,
1192 }),
1193 };
1194 result[@enumToInt(Feature.v9_2a)] = .{
1195 .llvm_name = "v9.2a",
1196 .description = "Support ARM v9.2a instructions",
1197 .dependencies = featureSet(&[_]Feature{
1198 .v8_7a,
1199 .v9_1a,
1200 }),
1201 };
1202 result[@enumToInt(Feature.v9_3a)] = .{
1203 .llvm_name = "v9.3a",
1204 .description = "Support ARM v9.3a instructions",
1205 .dependencies = featureSet(&[_]Feature{
1206 .v8_8a,
1207 .v9_2a,
1208 }),
1209 };
1210 result[@enumToInt(Feature.v9a)] = .{
1211 .llvm_name = "v9a",
1212 .description = "Support ARM v9a instructions",
1213 .dependencies = featureSet(&[_]Feature{
1214 .sve2,
1215 .v8_5a,
1216 }),
1217 };
12711218 result[@enumToInt(Feature.vh)] = .{
12721219 .llvm_name = "vh",
12731220 .description = "Enables ARM v8.1 Virtual Host extension",
......@@ -1331,6 +1278,23 @@ pub const cpu = struct {
13311278 .v8_2a,
13321279 }),
13331280 };
1281 pub const ampere1 = CpuModel{
1282 .name = "ampere1",
1283 .llvm_name = "ampere1",
1284 .features = featureSet(&[_]Feature{
1285 .aggressive_fma,
1286 .arith_bcc_fusion,
1287 .cmp_bcc_fusion,
1288 .fuse_address,
1289 .fuse_aes,
1290 .fuse_literals,
1291 .lsl_fast,
1292 .mte,
1293 .perfmon,
1294 .use_postra_scheduler,
1295 .v8_6a,
1296 }),
1297 };
13341298 pub const apple_a10 = CpuModel{
13351299 .name = "apple_a10",
13361300 .llvm_name = "apple-a10",
......@@ -1347,6 +1311,7 @@ pub const cpu = struct {
13471311 .pan,
13481312 .perfmon,
13491313 .rdm,
1314 .v8a,
13501315 .vh,
13511316 .zcm,
13521317 .zcz,
......@@ -1374,26 +1339,49 @@ pub const cpu = struct {
13741339 .name = "apple_a12",
13751340 .llvm_name = "apple-a12",
13761341 .features = featureSet(&[_]Feature{
1377 .apple_a12,
1342 .alternate_sextload_cvt_f32_pattern,
1343 .arith_bcc_fusion,
1344 .arith_cbz_fusion,
1345 .crypto,
1346 .disable_latency_sched_heuristic,
1347 .fullfp16,
1348 .fuse_aes,
1349 .fuse_crypto_eor,
1350 .perfmon,
1351 .v8_3a,
1352 .zcm,
1353 .zcz,
13781354 }),
13791355 };
13801356 pub const apple_a13 = CpuModel{
13811357 .name = "apple_a13",
13821358 .llvm_name = "apple-a13",
13831359 .features = featureSet(&[_]Feature{
1384 .apple_a13,
1385 }),
1386 };
1387 pub const apple_a14 = CpuModel{
1388 .name = "apple_a14",
1389 .llvm_name = "apple-a14",
1390 .features = featureSet(&[_]Feature{
1391 .aggressive_fma,
13921360 .alternate_sextload_cvt_f32_pattern,
1393 .altnzcv,
13941361 .arith_bcc_fusion,
13951362 .arith_cbz_fusion,
1396 .ccdp,
1363 .crypto,
1364 .disable_latency_sched_heuristic,
1365 .fp16fml,
1366 .fuse_aes,
1367 .fuse_crypto_eor,
1368 .perfmon,
1369 .sha3,
1370 .v8_4a,
1371 .zcm,
1372 .zcz,
1373 }),
1374 };
1375 pub const apple_a14 = CpuModel{
1376 .name = "apple_a14",
1377 .llvm_name = "apple-a14",
1378 .features = featureSet(&[_]Feature{
1379 .aggressive_fma,
1380 .alternate_sextload_cvt_f32_pattern,
1381 .altnzcv,
1382 .arith_bcc_fusion,
1383 .arith_cbz_fusion,
1384 .ccdp,
13971385 .crypto,
13981386 .disable_latency_sched_heuristic,
13991387 .fp16fml,
......@@ -1419,21 +1407,54 @@ pub const cpu = struct {
14191407 .name = "apple_a7",
14201408 .llvm_name = "apple-a7",
14211409 .features = featureSet(&[_]Feature{
1422 .apple_a7,
1410 .alternate_sextload_cvt_f32_pattern,
1411 .arith_bcc_fusion,
1412 .arith_cbz_fusion,
1413 .crypto,
1414 .disable_latency_sched_heuristic,
1415 .fuse_aes,
1416 .fuse_crypto_eor,
1417 .perfmon,
1418 .v8a,
1419 .zcm,
1420 .zcz,
1421 .zcz_fp_workaround,
14231422 }),
14241423 };
14251424 pub const apple_a8 = CpuModel{
14261425 .name = "apple_a8",
14271426 .llvm_name = "apple-a8",
14281427 .features = featureSet(&[_]Feature{
1429 .apple_a7,
1428 .alternate_sextload_cvt_f32_pattern,
1429 .arith_bcc_fusion,
1430 .arith_cbz_fusion,
1431 .crypto,
1432 .disable_latency_sched_heuristic,
1433 .fuse_aes,
1434 .fuse_crypto_eor,
1435 .perfmon,
1436 .v8a,
1437 .zcm,
1438 .zcz,
1439 .zcz_fp_workaround,
14301440 }),
14311441 };
14321442 pub const apple_a9 = CpuModel{
14331443 .name = "apple_a9",
14341444 .llvm_name = "apple-a9",
14351445 .features = featureSet(&[_]Feature{
1436 .apple_a7,
1446 .alternate_sextload_cvt_f32_pattern,
1447 .arith_bcc_fusion,
1448 .arith_cbz_fusion,
1449 .crypto,
1450 .disable_latency_sched_heuristic,
1451 .fuse_aes,
1452 .fuse_crypto_eor,
1453 .perfmon,
1454 .v8a,
1455 .zcm,
1456 .zcz,
1457 .zcz_fp_workaround,
14371458 }),
14381459 };
14391460 pub const apple_latest = CpuModel{
......@@ -1502,14 +1523,36 @@ pub const cpu = struct {
15021523 .name = "apple_s4",
15031524 .llvm_name = "apple-s4",
15041525 .features = featureSet(&[_]Feature{
1505 .apple_a12,
1526 .alternate_sextload_cvt_f32_pattern,
1527 .arith_bcc_fusion,
1528 .arith_cbz_fusion,
1529 .crypto,
1530 .disable_latency_sched_heuristic,
1531 .fullfp16,
1532 .fuse_aes,
1533 .fuse_crypto_eor,
1534 .perfmon,
1535 .v8_3a,
1536 .zcm,
1537 .zcz,
15061538 }),
15071539 };
15081540 pub const apple_s5 = CpuModel{
15091541 .name = "apple_s5",
15101542 .llvm_name = "apple-s5",
15111543 .features = featureSet(&[_]Feature{
1512 .apple_a12,
1544 .alternate_sextload_cvt_f32_pattern,
1545 .arith_bcc_fusion,
1546 .arith_cbz_fusion,
1547 .crypto,
1548 .disable_latency_sched_heuristic,
1549 .fullfp16,
1550 .fuse_aes,
1551 .fuse_crypto_eor,
1552 .perfmon,
1553 .v8_3a,
1554 .zcm,
1555 .zcz,
15131556 }),
15141557 };
15151558 pub const carmel = CpuModel{
......@@ -1541,6 +1584,21 @@ pub const cpu = struct {
15411584 .v8a,
15421585 }),
15431586 };
1587 pub const cortex_a510 = CpuModel{
1588 .name = "cortex_a510",
1589 .llvm_name = "cortex-a510",
1590 .features = featureSet(&[_]Feature{
1591 .a510,
1592 .bf16,
1593 .ete,
1594 .fp16fml,
1595 .i8mm,
1596 .mte,
1597 .perfmon,
1598 .sve2_bitperm,
1599 .v9a,
1600 }),
1601 };
15441602 pub const cortex_a53 = CpuModel{
15451603 .name = "cortex_a53",
15461604 .llvm_name = "cortex-a53",
......@@ -1562,6 +1620,7 @@ pub const cpu = struct {
15621620 .crypto,
15631621 .dotprod,
15641622 .fullfp16,
1623 .fuse_address,
15651624 .fuse_aes,
15661625 .perfmon,
15671626 .rcpc,
......@@ -1590,6 +1649,12 @@ pub const cpu = struct {
15901649 .llvm_name = "cortex-a65",
15911650 .features = featureSet(&[_]Feature{
15921651 .a65,
1652 .crypto,
1653 .dotprod,
1654 .fullfp16,
1655 .rcpc,
1656 .ssbs,
1657 .v8_2a,
15931658 }),
15941659 };
15951660 pub const cortex_a65ae = CpuModel{
......@@ -1597,6 +1662,27 @@ pub const cpu = struct {
15971662 .llvm_name = "cortex-a65ae",
15981663 .features = featureSet(&[_]Feature{
15991664 .a65,
1665 .crypto,
1666 .dotprod,
1667 .fullfp16,
1668 .rcpc,
1669 .ssbs,
1670 .v8_2a,
1671 }),
1672 };
1673 pub const cortex_a710 = CpuModel{
1674 .name = "cortex_a710",
1675 .llvm_name = "cortex-a710",
1676 .features = featureSet(&[_]Feature{
1677 .a710,
1678 .bf16,
1679 .ete,
1680 .fp16fml,
1681 .i8mm,
1682 .mte,
1683 .perfmon,
1684 .sve2_bitperm,
1685 .v9a,
16001686 }),
16011687 };
16021688 pub const cortex_a72 = CpuModel{
......@@ -1640,6 +1726,12 @@ pub const cpu = struct {
16401726 .llvm_name = "cortex-a76",
16411727 .features = featureSet(&[_]Feature{
16421728 .a76,
1729 .crypto,
1730 .dotprod,
1731 .fullfp16,
1732 .rcpc,
1733 .ssbs,
1734 .v8_2a,
16431735 }),
16441736 };
16451737 pub const cortex_a76ae = CpuModel{
......@@ -1647,6 +1739,12 @@ pub const cpu = struct {
16471739 .llvm_name = "cortex-a76ae",
16481740 .features = featureSet(&[_]Feature{
16491741 .a76,
1742 .crypto,
1743 .dotprod,
1744 .fullfp16,
1745 .rcpc,
1746 .ssbs,
1747 .v8_2a,
16501748 }),
16511749 };
16521750 pub const cortex_a77 = CpuModel{
......@@ -1659,6 +1757,7 @@ pub const cpu = struct {
16591757 .fullfp16,
16601758 .fuse_aes,
16611759 .rcpc,
1760 .ssbs,
16621761 .v8_2a,
16631762 }),
16641763 };
......@@ -1666,16 +1765,14 @@ pub const cpu = struct {
16661765 .name = "cortex_a78",
16671766 .llvm_name = "cortex-a78",
16681767 .features = featureSet(&[_]Feature{
1669 .cmp_bcc_fusion,
1768 .a78,
16701769 .crypto,
16711770 .dotprod,
16721771 .fullfp16,
1673 .fuse_aes,
16741772 .perfmon,
16751773 .rcpc,
16761774 .spe,
16771775 .ssbs,
1678 .use_postra_scheduler,
16791776 .v8_2a,
16801777 }),
16811778 };
......@@ -1683,7 +1780,17 @@ pub const cpu = struct {
16831780 .name = "cortex_a78c",
16841781 .llvm_name = "cortex-a78c",
16851782 .features = featureSet(&[_]Feature{
1686 .cortex_a78c,
1783 .a78c,
1784 .crypto,
1785 .dotprod,
1786 .flagm,
1787 .fp16fml,
1788 .pauth,
1789 .perfmon,
1790 .rcpc,
1791 .spe,
1792 .ssbs,
1793 .v8_2a,
16871794 }),
16881795 };
16891796 pub const cortex_r82 = CpuModel{
......@@ -1691,6 +1798,13 @@ pub const cpu = struct {
16911798 .llvm_name = "cortex-r82",
16921799 .features = featureSet(&[_]Feature{
16931800 .cortex_r82,
1801 .fp16fml,
1802 .perfmon,
1803 .predres,
1804 .sb,
1805 .specrestrict,
1806 .ssbs,
1807 .v8r,
16941808 }),
16951809 };
16961810 pub const cortex_x1 = CpuModel{
......@@ -1705,15 +1819,62 @@ pub const cpu = struct {
17051819 .perfmon,
17061820 .rcpc,
17071821 .spe,
1822 .ssbs,
1823 .use_postra_scheduler,
1824 .v8_2a,
1825 }),
1826 };
1827 pub const cortex_x1c = CpuModel{
1828 .name = "cortex_x1c",
1829 .llvm_name = "cortex-x1c",
1830 .features = featureSet(&[_]Feature{
1831 .cmp_bcc_fusion,
1832 .crypto,
1833 .dotprod,
1834 .fullfp16,
1835 .fuse_aes,
1836 .pauth,
1837 .perfmon,
1838 .rcpc,
1839 .spe,
1840 .ssbs,
17081841 .use_postra_scheduler,
17091842 .v8_2a,
17101843 }),
17111844 };
1845 pub const cortex_x2 = CpuModel{
1846 .name = "cortex_x2",
1847 .llvm_name = "cortex-x2",
1848 .features = featureSet(&[_]Feature{
1849 .bf16,
1850 .cmp_bcc_fusion,
1851 .ete,
1852 .fp16fml,
1853 .fuse_aes,
1854 .i8mm,
1855 .mte,
1856 .perfmon,
1857 .sve2_bitperm,
1858 .use_postra_scheduler,
1859 .v9a,
1860 }),
1861 };
17121862 pub const cyclone = CpuModel{
17131863 .name = "cyclone",
17141864 .llvm_name = "cyclone",
17151865 .features = featureSet(&[_]Feature{
1716 .apple_a7,
1866 .alternate_sextload_cvt_f32_pattern,
1867 .arith_bcc_fusion,
1868 .arith_cbz_fusion,
1869 .crypto,
1870 .disable_latency_sched_heuristic,
1871 .fuse_aes,
1872 .fuse_crypto_eor,
1873 .perfmon,
1874 .v8a,
1875 .zcm,
1876 .zcz,
1877 .zcz_fp_workaround,
17171878 }),
17181879 };
17191880 pub const emag = CpuModel{
......@@ -1763,33 +1924,68 @@ pub const cpu = struct {
17631924 .name = "exynos_m3",
17641925 .llvm_name = "exynos-m3",
17651926 .features = featureSet(&[_]Feature{
1927 .arith_bcc_fusion,
1928 .arith_cbz_fusion,
17661929 .crc,
17671930 .crypto,
17681931 .exynos_cheap_as_move,
17691932 .force_32bit_jump_tables,
17701933 .fuse_address,
17711934 .fuse_aes,
1935 .fuse_arith_logic,
17721936 .fuse_csel,
17731937 .fuse_literals,
17741938 .lsl_fast,
17751939 .perfmon,
1776 .predictable_select_expensive,
17771940 .use_postra_scheduler,
17781941 .v8a,
1942 .zcz,
17791943 }),
17801944 };
17811945 pub const exynos_m4 = CpuModel{
17821946 .name = "exynos_m4",
17831947 .llvm_name = "exynos-m4",
17841948 .features = featureSet(&[_]Feature{
1785 .exynos_m4,
1949 .arith_bcc_fusion,
1950 .arith_cbz_fusion,
1951 .crypto,
1952 .dotprod,
1953 .exynos_cheap_as_move,
1954 .force_32bit_jump_tables,
1955 .fullfp16,
1956 .fuse_address,
1957 .fuse_aes,
1958 .fuse_arith_logic,
1959 .fuse_csel,
1960 .fuse_literals,
1961 .lsl_fast,
1962 .perfmon,
1963 .use_postra_scheduler,
1964 .v8_2a,
1965 .zcz,
17861966 }),
17871967 };
17881968 pub const exynos_m5 = CpuModel{
17891969 .name = "exynos_m5",
17901970 .llvm_name = "exynos-m5",
17911971 .features = featureSet(&[_]Feature{
1792 .exynos_m4,
1972 .arith_bcc_fusion,
1973 .arith_cbz_fusion,
1974 .crypto,
1975 .dotprod,
1976 .exynos_cheap_as_move,
1977 .force_32bit_jump_tables,
1978 .fullfp16,
1979 .fuse_address,
1980 .fuse_aes,
1981 .fuse_arith_logic,
1982 .fuse_csel,
1983 .fuse_literals,
1984 .lsl_fast,
1985 .perfmon,
1986 .use_postra_scheduler,
1987 .v8_2a,
1988 .zcz,
17931989 }),
17941990 };
17951991 pub const falkor = CpuModel{
......@@ -1835,32 +2031,86 @@ pub const cpu = struct {
18352031 .zcz,
18362032 }),
18372033 };
2034 pub const neoverse_512tvb = CpuModel{
2035 .name = "neoverse_512tvb",
2036 .llvm_name = "neoverse-512tvb",
2037 .features = featureSet(&[_]Feature{
2038 .bf16,
2039 .ccdp,
2040 .crypto,
2041 .fp16fml,
2042 .fuse_aes,
2043 .i8mm,
2044 .perfmon,
2045 .rand,
2046 .spe,
2047 .ssbs,
2048 .sve,
2049 .use_postra_scheduler,
2050 .v8_4a,
2051 }),
2052 };
18382053 pub const neoverse_e1 = CpuModel{
18392054 .name = "neoverse_e1",
18402055 .llvm_name = "neoverse-e1",
18412056 .features = featureSet(&[_]Feature{
1842 .neoverse_e1,
2057 .crypto,
2058 .dotprod,
2059 .fullfp16,
2060 .fuse_aes,
2061 .rcpc,
2062 .ssbs,
2063 .use_postra_scheduler,
2064 .v8_2a,
18432065 }),
18442066 };
18452067 pub const neoverse_n1 = CpuModel{
18462068 .name = "neoverse_n1",
18472069 .llvm_name = "neoverse-n1",
18482070 .features = featureSet(&[_]Feature{
1849 .neoverse_n1,
2071 .crypto,
2072 .dotprod,
2073 .fullfp16,
2074 .fuse_aes,
2075 .rcpc,
2076 .spe,
2077 .ssbs,
2078 .use_postra_scheduler,
2079 .v8_2a,
18502080 }),
18512081 };
18522082 pub const neoverse_n2 = CpuModel{
18532083 .name = "neoverse_n2",
18542084 .llvm_name = "neoverse-n2",
18552085 .features = featureSet(&[_]Feature{
1856 .neoverse_n2,
2086 .bf16,
2087 .crypto,
2088 .ete,
2089 .fuse_aes,
2090 .i8mm,
2091 .mte,
2092 .sve2_bitperm,
2093 .use_postra_scheduler,
2094 .v8_5a,
18572095 }),
18582096 };
18592097 pub const neoverse_v1 = CpuModel{
18602098 .name = "neoverse_v1",
18612099 .llvm_name = "neoverse-v1",
18622100 .features = featureSet(&[_]Feature{
1863 .neoverse_v1,
2101 .bf16,
2102 .ccdp,
2103 .crypto,
2104 .fp16fml,
2105 .fuse_aes,
2106 .i8mm,
2107 .perfmon,
2108 .rand,
2109 .spe,
2110 .ssbs,
2111 .sve,
2112 .use_postra_scheduler,
2113 .v8_4a,
18642114 }),
18652115 };
18662116 pub const saphira = CpuModel{
lib/std/target/amdgpu.zig-13
......@@ -65,7 +65,6 @@ pub const Feature = enum {
6565 ldsbankcount16,
6666 ldsbankcount32,
6767 load_store_opt,
68 localmemorysize0,
6968 localmemorysize32768,
7069 localmemorysize65536,
7170 mad_mac_f32_insts,
......@@ -92,7 +91,6 @@ pub const Feature = enum {
9291 pk_fmac_f16_inst,
9392 promote_alloca,
9493 r128_a16,
95 register_banking,
9694 s_memrealtime,
9795 s_memtime_inst,
9896 scalar_atomics,
......@@ -374,7 +372,6 @@ pub const all_features = blk: {
374372 .no_data_dep_hazard,
375373 .no_sdst_cmpx,
376374 .pk_fmac_f16_inst,
377 .register_banking,
378375 .s_memrealtime,
379376 .s_memtime_inst,
380377 .sdwa,
......@@ -525,11 +522,6 @@ pub const all_features = blk: {
525522 .description = "Enable SI load/store optimizer pass",
526523 .dependencies = featureSet(&[_]Feature{}),
527524 };
528 result[@enumToInt(Feature.localmemorysize0)] = .{
529 .llvm_name = "localmemorysize0",
530 .description = "The size of local memory in bytes",
531 .dependencies = featureSet(&[_]Feature{}),
532 };
533525 result[@enumToInt(Feature.localmemorysize32768)] = .{
534526 .llvm_name = "localmemorysize32768",
535527 .description = "The size of local memory in bytes",
......@@ -660,11 +652,6 @@ pub const all_features = blk: {
660652 .description = "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128",
661653 .dependencies = featureSet(&[_]Feature{}),
662654 };
663 result[@enumToInt(Feature.register_banking)] = .{
664 .llvm_name = "register-banking",
665 .description = "Has register banking",
666 .dependencies = featureSet(&[_]Feature{}),
667 };
668655 result[@enumToInt(Feature.s_memrealtime)] = .{
669656 .llvm_name = "s-memrealtime",
670657 .description = "Has s_memrealtime instruction",
lib/std/target/arm.zig+174-1
......@@ -36,6 +36,7 @@ pub const Feature = enum {
3636 execute_only,
3737 expand_fp_mlx,
3838 exynos,
39 fix_cmse_cve_2021_35465,
3940 fp16,
4041 fp16fml,
4142 fp64,
......@@ -71,8 +72,13 @@ pub const Feature = enum {
7172 has_v8_5a,
7273 has_v8_6a,
7374 has_v8_7a,
75 has_v8_8a,
7476 has_v8m,
7577 has_v8m_main,
78 has_v9_1a,
79 has_v9_2a,
80 has_v9_3a,
81 has_v9a,
7682 hwdiv,
7783 hwdiv_arm,
7884 i8mm,
......@@ -95,10 +101,12 @@ pub const Feature = enum {
95101 neon_fpmovs,
96102 neonfp,
97103 no_branch_predictor,
104 no_bti_at_return_twice,
98105 no_movt,
99106 no_neg_immediates,
100107 noarm,
101108 nonpipelined_vfp,
109 pacbti,
102110 perfmon,
103111 prefer_ishst,
104112 prefer_vmovsr,
......@@ -157,10 +165,15 @@ pub const Feature = enum {
157165 v8_5a,
158166 v8_6a,
159167 v8_7a,
168 v8_8a,
160169 v8a,
161170 v8m,
162171 v8m_main,
163172 v8r,
173 v9_1a,
174 v9_2a,
175 v9_3a,
176 v9a,
164177 vfp2,
165178 vfp2sp,
166179 vfp3,
......@@ -390,6 +403,11 @@ pub const all_features = blk: {
390403 .zcz,
391404 }),
392405 };
406 result[@enumToInt(Feature.fix_cmse_cve_2021_35465)] = .{
407 .llvm_name = "fix-cmse-cve-2021-35465",
408 .description = "Mitigate against the cve-2021-35465 security vulnurability",
409 .dependencies = featureSet(&[_]Feature{}),
410 };
393411 result[@enumToInt(Feature.fp16)] = .{
394412 .llvm_name = "fp16",
395413 .description = "Enable half-precision floating point",
......@@ -553,7 +571,6 @@ pub const all_features = blk: {
553571 .dependencies = featureSet(&[_]Feature{
554572 .has_v6t2,
555573 .has_v7clrex,
556 .perfmon,
557574 }),
558575 };
559576 result[@enumToInt(Feature.has_v7clrex)] = .{
......@@ -567,6 +584,7 @@ pub const all_features = blk: {
567584 .dependencies = featureSet(&[_]Feature{
568585 .acquire_release,
569586 .has_v7,
587 .perfmon,
570588 }),
571589 };
572590 result[@enumToInt(Feature.has_v8_1a)] = .{
......@@ -629,6 +647,13 @@ pub const all_features = blk: {
629647 .has_v8_6a,
630648 }),
631649 };
650 result[@enumToInt(Feature.has_v8_8a)] = .{
651 .llvm_name = "v8.8a",
652 .description = "Support ARM v8.8a instructions",
653 .dependencies = featureSet(&[_]Feature{
654 .has_v8_7a,
655 }),
656 };
632657 result[@enumToInt(Feature.has_v8m)] = .{
633658 .llvm_name = "v8m",
634659 .description = "Support ARM v8M Baseline instructions",
......@@ -643,6 +668,37 @@ pub const all_features = blk: {
643668 .has_v7,
644669 }),
645670 };
671 result[@enumToInt(Feature.has_v9_1a)] = .{
672 .llvm_name = "v9.1a",
673 .description = "Support ARM v9.1a instructions",
674 .dependencies = featureSet(&[_]Feature{
675 .has_v8_6a,
676 .has_v9a,
677 }),
678 };
679 result[@enumToInt(Feature.has_v9_2a)] = .{
680 .llvm_name = "v9.2a",
681 .description = "Support ARM v9.2a instructions",
682 .dependencies = featureSet(&[_]Feature{
683 .has_v8_7a,
684 .has_v9_1a,
685 }),
686 };
687 result[@enumToInt(Feature.has_v9_3a)] = .{
688 .llvm_name = "v9.3a",
689 .description = "Support ARM v9.3a instructions",
690 .dependencies = featureSet(&[_]Feature{
691 .has_v8_8a,
692 .has_v9_2a,
693 }),
694 };
695 result[@enumToInt(Feature.has_v9a)] = .{
696 .llvm_name = "v9a",
697 .description = "Support ARM v9a instructions",
698 .dependencies = featureSet(&[_]Feature{
699 .has_v8_5a,
700 }),
701 };
646702 result[@enumToInt(Feature.hwdiv)] = .{
647703 .llvm_name = "hwdiv",
648704 .description = "Enable divide instructions in Thumb",
......@@ -769,6 +825,11 @@ pub const all_features = blk: {
769825 .description = "Has no branch predictor",
770826 .dependencies = featureSet(&[_]Feature{}),
771827 };
828 result[@enumToInt(Feature.no_bti_at_return_twice)] = .{
829 .llvm_name = "no-bti-at-return-twice",
830 .description = "Don't place a BTI instruction after a return-twice",
831 .dependencies = featureSet(&[_]Feature{}),
832 };
772833 result[@enumToInt(Feature.no_movt)] = .{
773834 .llvm_name = "no-movt",
774835 .description = "Don't use movt/movw pairs for 32-bit imms",
......@@ -789,6 +850,11 @@ pub const all_features = blk: {
789850 .description = "VFP instructions are not pipelined",
790851 .dependencies = featureSet(&[_]Feature{}),
791852 };
853 result[@enumToInt(Feature.pacbti)] = .{
854 .llvm_name = "pacbti",
855 .description = "Enable Pointer Authentication and Branch Target Identification",
856 .dependencies = featureSet(&[_]Feature{}),
857 };
792858 result[@enumToInt(Feature.perfmon)] = .{
793859 .llvm_name = "perfmon",
794860 .description = "Enable support for Performance Monitor extensions",
......@@ -1066,6 +1132,7 @@ pub const all_features = blk: {
10661132 .dsp,
10671133 .has_v7,
10681134 .neon,
1135 .perfmon,
10691136 }),
10701137 };
10711138 result[@enumToInt(Feature.v7em)] = .{
......@@ -1108,6 +1175,7 @@ pub const all_features = blk: {
11081175 .dsp,
11091176 .has_v7,
11101177 .hwdiv,
1178 .perfmon,
11111179 .rclass,
11121180 }),
11131181 };
......@@ -1128,6 +1196,7 @@ pub const all_features = blk: {
11281196 .has_v7,
11291197 .mp,
11301198 .neon,
1199 .perfmon,
11311200 .trustzone,
11321201 .virtualization,
11331202 }),
......@@ -1266,6 +1335,23 @@ pub const all_features = blk: {
12661335 .virtualization,
12671336 }),
12681337 };
1338 result[@enumToInt(Feature.v8_8a)] = .{
1339 .llvm_name = "armv8.8-a",
1340 .description = "ARMv88a architecture",
1341 .dependencies = featureSet(&[_]Feature{
1342 .aclass,
1343 .crc,
1344 .crypto,
1345 .db,
1346 .dsp,
1347 .fp_armv8,
1348 .has_v8_8a,
1349 .mp,
1350 .ras,
1351 .trustzone,
1352 .virtualization,
1353 }),
1354 };
12691355 result[@enumToInt(Feature.v8a)] = .{
12701356 .llvm_name = "armv8-a",
12711357 .description = "ARMv8a architecture",
......@@ -1328,6 +1414,71 @@ pub const all_features = blk: {
13281414 .virtualization,
13291415 }),
13301416 };
1417 result[@enumToInt(Feature.v9_1a)] = .{
1418 .llvm_name = "armv9.1-a",
1419 .description = "ARMv91a architecture",
1420 .dependencies = featureSet(&[_]Feature{
1421 .aclass,
1422 .crc,
1423 .db,
1424 .dsp,
1425 .fp_armv8,
1426 .has_v9_1a,
1427 .mp,
1428 .ras,
1429 .trustzone,
1430 .virtualization,
1431 }),
1432 };
1433 result[@enumToInt(Feature.v9_2a)] = .{
1434 .llvm_name = "armv9.2-a",
1435 .description = "ARMv92a architecture",
1436 .dependencies = featureSet(&[_]Feature{
1437 .aclass,
1438 .crc,
1439 .db,
1440 .dsp,
1441 .fp_armv8,
1442 .has_v9_2a,
1443 .mp,
1444 .ras,
1445 .trustzone,
1446 .virtualization,
1447 }),
1448 };
1449 result[@enumToInt(Feature.v9_3a)] = .{
1450 .llvm_name = "armv9.3-a",
1451 .description = "ARMv93a architecture",
1452 .dependencies = featureSet(&[_]Feature{
1453 .aclass,
1454 .crc,
1455 .crypto,
1456 .db,
1457 .dsp,
1458 .fp_armv8,
1459 .has_v9_3a,
1460 .mp,
1461 .ras,
1462 .trustzone,
1463 .virtualization,
1464 }),
1465 };
1466 result[@enumToInt(Feature.v9a)] = .{
1467 .llvm_name = "armv9-a",
1468 .description = "ARMv9a architecture",
1469 .dependencies = featureSet(&[_]Feature{
1470 .aclass,
1471 .crc,
1472 .db,
1473 .dsp,
1474 .fp_armv8,
1475 .has_v9a,
1476 .mp,
1477 .ras,
1478 .trustzone,
1479 .virtualization,
1480 }),
1481 };
13311482 result[@enumToInt(Feature.vfp2)] = .{
13321483 .llvm_name = "vfp2",
13331484 .description = "Enable VFP2 instructions",
......@@ -1781,6 +1932,16 @@ pub const cpu = struct {
17811932 .vmlx_hazards,
17821933 }),
17831934 };
1935 pub const cortex_a710 = CpuModel{
1936 .name = "cortex_a710",
1937 .llvm_name = "cortex-a710",
1938 .features = featureSet(&[_]Feature{
1939 .bf16,
1940 .fp16fml,
1941 .i8mm,
1942 .v9a,
1943 }),
1944 };
17841945 pub const cortex_a72 = CpuModel{
17851946 .name = "cortex_a72",
17861947 .llvm_name = "cortex-a72",
......@@ -1933,6 +2094,7 @@ pub const cpu = struct {
19332094 .llvm_name = "cortex-m33",
19342095 .features = featureSet(&[_]Feature{
19352096 .dsp,
2097 .fix_cmse_cve_2021_35465,
19362098 .fp_armv8d16sp,
19372099 .loop_align,
19382100 .no_branch_predictor,
......@@ -1947,6 +2109,7 @@ pub const cpu = struct {
19472109 .llvm_name = "cortex-m35p",
19482110 .features = featureSet(&[_]Feature{
19492111 .dsp,
2112 .fix_cmse_cve_2021_35465,
19502113 .fp_armv8d16sp,
19512114 .loop_align,
19522115 .no_branch_predictor,
......@@ -1973,6 +2136,7 @@ pub const cpu = struct {
19732136 .name = "cortex_m55",
19742137 .llvm_name = "cortex-m55",
19752138 .features = featureSet(&[_]Feature{
2139 .fix_cmse_cve_2021_35465,
19762140 .fp_armv8d16,
19772141 .loop_align,
19782142 .mve_fp,
......@@ -2079,6 +2243,15 @@ pub const cpu = struct {
20792243 .v8_2a,
20802244 }),
20812245 };
2246 pub const cortex_x1c = CpuModel{
2247 .name = "cortex_x1c",
2248 .llvm_name = "cortex-x1c",
2249 .features = featureSet(&[_]Feature{
2250 .dotprod,
2251 .fullfp16,
2252 .v8_2a,
2253 }),
2254 };
20822255 pub const cyclone = CpuModel{
20832256 .name = "cyclone",
20842257 .llvm_name = "cyclone",
lib/std/target/avr.zig+280
......@@ -583,6 +583,20 @@ pub const cpu = struct {
583583 .avr35,
584584 }),
585585 };
586 pub const ata5702m322 = CpuModel{
587 .name = "ata5702m322",
588 .llvm_name = "ata5702m322",
589 .features = featureSet(&[_]Feature{
590 .avr5,
591 }),
592 };
593 pub const ata5782 = CpuModel{
594 .name = "ata5782",
595 .llvm_name = "ata5782",
596 .features = featureSet(&[_]Feature{
597 .avr5,
598 }),
599 };
586600 pub const ata5790 = CpuModel{
587601 .name = "ata5790",
588602 .llvm_name = "ata5790",
......@@ -590,6 +604,20 @@ pub const cpu = struct {
590604 .avr5,
591605 }),
592606 };
607 pub const ata5790n = CpuModel{
608 .name = "ata5790n",
609 .llvm_name = "ata5790n",
610 .features = featureSet(&[_]Feature{
611 .avr5,
612 }),
613 };
614 pub const ata5791 = CpuModel{
615 .name = "ata5791",
616 .llvm_name = "ata5791",
617 .features = featureSet(&[_]Feature{
618 .avr5,
619 }),
620 };
593621 pub const ata5795 = CpuModel{
594622 .name = "ata5795",
595623 .llvm_name = "ata5795",
......@@ -597,6 +625,13 @@ pub const cpu = struct {
597625 .avr5,
598626 }),
599627 };
628 pub const ata5831 = CpuModel{
629 .name = "ata5831",
630 .llvm_name = "ata5831",
631 .features = featureSet(&[_]Feature{
632 .avr5,
633 }),
634 };
600635 pub const ata6285 = CpuModel{
601636 .name = "ata6285",
602637 .llvm_name = "ata6285",
......@@ -618,6 +653,55 @@ pub const cpu = struct {
618653 .avr4,
619654 }),
620655 };
656 pub const ata6612c = CpuModel{
657 .name = "ata6612c",
658 .llvm_name = "ata6612c",
659 .features = featureSet(&[_]Feature{
660 .avr4,
661 }),
662 };
663 pub const ata6613c = CpuModel{
664 .name = "ata6613c",
665 .llvm_name = "ata6613c",
666 .features = featureSet(&[_]Feature{
667 .avr5,
668 }),
669 };
670 pub const ata6614q = CpuModel{
671 .name = "ata6614q",
672 .llvm_name = "ata6614q",
673 .features = featureSet(&[_]Feature{
674 .avr5,
675 }),
676 };
677 pub const ata6617c = CpuModel{
678 .name = "ata6617c",
679 .llvm_name = "ata6617c",
680 .features = featureSet(&[_]Feature{
681 .avr35,
682 }),
683 };
684 pub const ata664251 = CpuModel{
685 .name = "ata664251",
686 .llvm_name = "ata664251",
687 .features = featureSet(&[_]Feature{
688 .avr35,
689 }),
690 };
691 pub const ata8210 = CpuModel{
692 .name = "ata8210",
693 .llvm_name = "ata8210",
694 .features = featureSet(&[_]Feature{
695 .avr5,
696 }),
697 };
698 pub const ata8510 = CpuModel{
699 .name = "ata8510",
700 .llvm_name = "ata8510",
701 .features = featureSet(&[_]Feature{
702 .avr5,
703 }),
704 };
621705 pub const atmega103 = CpuModel{
622706 .name = "atmega103",
623707 .llvm_name = "atmega103",
......@@ -1347,6 +1431,13 @@ pub const cpu = struct {
13471431 .avr5,
13481432 }),
13491433 };
1434 pub const atmega64hve2 = CpuModel{
1435 .name = "atmega64hve2",
1436 .llvm_name = "atmega64hve2",
1437 .features = featureSet(&[_]Feature{
1438 .avr5,
1439 }),
1440 };
13501441 pub const atmega64m1 = CpuModel{
13511442 .name = "atmega64m1",
13521443 .llvm_name = "atmega64m1",
......@@ -1510,6 +1601,48 @@ pub const cpu = struct {
15101601 .avr1,
15111602 }),
15121603 };
1604 pub const attiny1604 = CpuModel{
1605 .name = "attiny1604",
1606 .llvm_name = "attiny1604",
1607 .features = featureSet(&[_]Feature{
1608 .xmega,
1609 }),
1610 };
1611 pub const attiny1606 = CpuModel{
1612 .name = "attiny1606",
1613 .llvm_name = "attiny1606",
1614 .features = featureSet(&[_]Feature{
1615 .xmega,
1616 }),
1617 };
1618 pub const attiny1607 = CpuModel{
1619 .name = "attiny1607",
1620 .llvm_name = "attiny1607",
1621 .features = featureSet(&[_]Feature{
1622 .xmega,
1623 }),
1624 };
1625 pub const attiny1614 = CpuModel{
1626 .name = "attiny1614",
1627 .llvm_name = "attiny1614",
1628 .features = featureSet(&[_]Feature{
1629 .xmega,
1630 }),
1631 };
1632 pub const attiny1616 = CpuModel{
1633 .name = "attiny1616",
1634 .llvm_name = "attiny1616",
1635 .features = featureSet(&[_]Feature{
1636 .xmega,
1637 }),
1638 };
1639 pub const attiny1617 = CpuModel{
1640 .name = "attiny1617",
1641 .llvm_name = "attiny1617",
1642 .features = featureSet(&[_]Feature{
1643 .xmega,
1644 }),
1645 };
15131646 pub const attiny1634 = CpuModel{
15141647 .name = "attiny1634",
15151648 .llvm_name = "attiny1634",
......@@ -1531,6 +1664,34 @@ pub const cpu = struct {
15311664 .avrtiny,
15321665 }),
15331666 };
1667 pub const attiny202 = CpuModel{
1668 .name = "attiny202",
1669 .llvm_name = "attiny202",
1670 .features = featureSet(&[_]Feature{
1671 .xmega,
1672 }),
1673 };
1674 pub const attiny204 = CpuModel{
1675 .name = "attiny204",
1676 .llvm_name = "attiny204",
1677 .features = featureSet(&[_]Feature{
1678 .xmega,
1679 }),
1680 };
1681 pub const attiny212 = CpuModel{
1682 .name = "attiny212",
1683 .llvm_name = "attiny212",
1684 .features = featureSet(&[_]Feature{
1685 .xmega,
1686 }),
1687 };
1688 pub const attiny214 = CpuModel{
1689 .name = "attiny214",
1690 .llvm_name = "attiny214",
1691 .features = featureSet(&[_]Feature{
1692 .xmega,
1693 }),
1694 };
15341695 pub const attiny22 = CpuModel{
15351696 .name = "attiny22",
15361697 .llvm_name = "attiny22",
......@@ -1602,6 +1763,20 @@ pub const cpu = struct {
16021763 .avr1,
16031764 }),
16041765 };
1766 pub const attiny3216 = CpuModel{
1767 .name = "attiny3216",
1768 .llvm_name = "attiny3216",
1769 .features = featureSet(&[_]Feature{
1770 .xmega,
1771 }),
1772 };
1773 pub const attiny3217 = CpuModel{
1774 .name = "attiny3217",
1775 .llvm_name = "attiny3217",
1776 .features = featureSet(&[_]Feature{
1777 .xmega,
1778 }),
1779 };
16051780 pub const attiny4 = CpuModel{
16061781 .name = "attiny4",
16071782 .llvm_name = "attiny4",
......@@ -1616,6 +1791,55 @@ pub const cpu = struct {
16161791 .avrtiny,
16171792 }),
16181793 };
1794 pub const attiny402 = CpuModel{
1795 .name = "attiny402",
1796 .llvm_name = "attiny402",
1797 .features = featureSet(&[_]Feature{
1798 .xmega,
1799 }),
1800 };
1801 pub const attiny404 = CpuModel{
1802 .name = "attiny404",
1803 .llvm_name = "attiny404",
1804 .features = featureSet(&[_]Feature{
1805 .xmega,
1806 }),
1807 };
1808 pub const attiny406 = CpuModel{
1809 .name = "attiny406",
1810 .llvm_name = "attiny406",
1811 .features = featureSet(&[_]Feature{
1812 .xmega,
1813 }),
1814 };
1815 pub const attiny412 = CpuModel{
1816 .name = "attiny412",
1817 .llvm_name = "attiny412",
1818 .features = featureSet(&[_]Feature{
1819 .xmega,
1820 }),
1821 };
1822 pub const attiny414 = CpuModel{
1823 .name = "attiny414",
1824 .llvm_name = "attiny414",
1825 .features = featureSet(&[_]Feature{
1826 .xmega,
1827 }),
1828 };
1829 pub const attiny416 = CpuModel{
1830 .name = "attiny416",
1831 .llvm_name = "attiny416",
1832 .features = featureSet(&[_]Feature{
1833 .xmega,
1834 }),
1835 };
1836 pub const attiny417 = CpuModel{
1837 .name = "attiny417",
1838 .llvm_name = "attiny417",
1839 .features = featureSet(&[_]Feature{
1840 .xmega,
1841 }),
1842 };
16191843 pub const attiny4313 = CpuModel{
16201844 .name = "attiny4313",
16211845 .llvm_name = "attiny4313",
......@@ -1686,6 +1910,48 @@ pub const cpu = struct {
16861910 .avrtiny,
16871911 }),
16881912 };
1913 pub const attiny804 = CpuModel{
1914 .name = "attiny804",
1915 .llvm_name = "attiny804",
1916 .features = featureSet(&[_]Feature{
1917 .xmega,
1918 }),
1919 };
1920 pub const attiny806 = CpuModel{
1921 .name = "attiny806",
1922 .llvm_name = "attiny806",
1923 .features = featureSet(&[_]Feature{
1924 .xmega,
1925 }),
1926 };
1927 pub const attiny807 = CpuModel{
1928 .name = "attiny807",
1929 .llvm_name = "attiny807",
1930 .features = featureSet(&[_]Feature{
1931 .xmega,
1932 }),
1933 };
1934 pub const attiny814 = CpuModel{
1935 .name = "attiny814",
1936 .llvm_name = "attiny814",
1937 .features = featureSet(&[_]Feature{
1938 .xmega,
1939 }),
1940 };
1941 pub const attiny816 = CpuModel{
1942 .name = "attiny816",
1943 .llvm_name = "attiny816",
1944 .features = featureSet(&[_]Feature{
1945 .xmega,
1946 }),
1947 };
1948 pub const attiny817 = CpuModel{
1949 .name = "attiny817",
1950 .llvm_name = "attiny817",
1951 .features = featureSet(&[_]Feature{
1952 .xmega,
1953 }),
1954 };
16891955 pub const attiny828 = CpuModel{
16901956 .name = "attiny828",
16911957 .llvm_name = "attiny828",
......@@ -1945,6 +2211,13 @@ pub const cpu = struct {
19452211 .xmegau,
19462212 }),
19472213 };
2214 pub const atxmega32c3 = CpuModel{
2215 .name = "atxmega32c3",
2216 .llvm_name = "atxmega32c3",
2217 .features = featureSet(&[_]Feature{
2218 .xmegau,
2219 }),
2220 };
19482221 pub const atxmega32c4 = CpuModel{
19492222 .name = "atxmega32c4",
19502223 .llvm_name = "atxmega32c4",
......@@ -1952,6 +2225,13 @@ pub const cpu = struct {
19522225 .xmegau,
19532226 }),
19542227 };
2228 pub const atxmega32d3 = CpuModel{
2229 .name = "atxmega32d3",
2230 .llvm_name = "atxmega32d3",
2231 .features = featureSet(&[_]Feature{
2232 .xmega,
2233 }),
2234 };
19552235 pub const atxmega32d4 = CpuModel{
19562236 .name = "atxmega32d4",
19572237 .llvm_name = "atxmega32d4",
lib/std/target/csky.zig created+163
......@@ -0,0 +1,163 @@
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 @"10e60",
9 @"2e3",
10 @"3e3r1",
11 @"3e3r3",
12 @"3e7",
13 @"7e10",
14 btst16,
15 doloop,
16 e1,
17 e2,
18 elrw,
19 fpuv2_df,
20 fpuv2_sf,
21 fpuv3_df,
22 fpuv3_sf,
23 hard_float,
24 hard_float_abi,
25 java,
26 mp1e2,
27};
28
29pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
30pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
31pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
32pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
33
34pub const all_features = blk: {
35 const len = @typeInfo(Feature).Enum.fields.len;
36 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
37 var result: [len]CpuFeature = undefined;
38 result[@enumToInt(Feature.@"10e60")] = .{
39 .llvm_name = "10e60",
40 .description = "Support CSKY 10e60 instructions",
41 .dependencies = featureSet(&[_]Feature{
42 .@"7e10",
43 }),
44 };
45 result[@enumToInt(Feature.@"2e3")] = .{
46 .llvm_name = "2e3",
47 .description = "Support CSKY 2e3 instructions",
48 .dependencies = featureSet(&[_]Feature{
49 .e2,
50 }),
51 };
52 result[@enumToInt(Feature.@"3e3r1")] = .{
53 .llvm_name = "3e3r1",
54 .description = "Support CSKY 3e3r1 instructions",
55 .dependencies = featureSet(&[_]Feature{}),
56 };
57 result[@enumToInt(Feature.@"3e3r3")] = .{
58 .llvm_name = "3e3r3",
59 .description = "Support CSKY 3e3r3 instructions",
60 .dependencies = featureSet(&[_]Feature{
61 .doloop,
62 }),
63 };
64 result[@enumToInt(Feature.@"3e7")] = .{
65 .llvm_name = "3e7",
66 .description = "Support CSKY 3e7 instructions",
67 .dependencies = featureSet(&[_]Feature{
68 .@"2e3",
69 }),
70 };
71 result[@enumToInt(Feature.@"7e10")] = .{
72 .llvm_name = "7e10",
73 .description = "Support CSKY 7e10 instructions",
74 .dependencies = featureSet(&[_]Feature{
75 .@"3e7",
76 }),
77 };
78 result[@enumToInt(Feature.btst16)] = .{
79 .llvm_name = "btst16",
80 .description = "Use the 16-bit btsti instruction",
81 .dependencies = featureSet(&[_]Feature{}),
82 };
83 result[@enumToInt(Feature.doloop)] = .{
84 .llvm_name = "doloop",
85 .description = "Enable doloop instructions",
86 .dependencies = featureSet(&[_]Feature{}),
87 };
88 result[@enumToInt(Feature.e1)] = .{
89 .llvm_name = "e1",
90 .description = "Support CSKY e1 instructions",
91 .dependencies = featureSet(&[_]Feature{
92 .elrw,
93 }),
94 };
95 result[@enumToInt(Feature.e2)] = .{
96 .llvm_name = "e2",
97 .description = "Support CSKY e2 instructions",
98 .dependencies = featureSet(&[_]Feature{
99 .e1,
100 }),
101 };
102 result[@enumToInt(Feature.elrw)] = .{
103 .llvm_name = "elrw",
104 .description = "Use the extend LRW instruction",
105 .dependencies = featureSet(&[_]Feature{}),
106 };
107 result[@enumToInt(Feature.fpuv2_df)] = .{
108 .llvm_name = "fpuv2_df",
109 .description = "Enable FPUv2 double float instructions",
110 .dependencies = featureSet(&[_]Feature{}),
111 };
112 result[@enumToInt(Feature.fpuv2_sf)] = .{
113 .llvm_name = "fpuv2_sf",
114 .description = "Enable FPUv2 single float instructions",
115 .dependencies = featureSet(&[_]Feature{}),
116 };
117 result[@enumToInt(Feature.fpuv3_df)] = .{
118 .llvm_name = "fpuv3_df",
119 .description = "Enable FPUv3 double float instructions",
120 .dependencies = featureSet(&[_]Feature{}),
121 };
122 result[@enumToInt(Feature.fpuv3_sf)] = .{
123 .llvm_name = "fpuv3_sf",
124 .description = "Enable FPUv3 single float instructions",
125 .dependencies = featureSet(&[_]Feature{}),
126 };
127 result[@enumToInt(Feature.hard_float)] = .{
128 .llvm_name = "hard-float",
129 .description = "Use hard floating point features",
130 .dependencies = featureSet(&[_]Feature{}),
131 };
132 result[@enumToInt(Feature.hard_float_abi)] = .{
133 .llvm_name = "hard-float-abi",
134 .description = "Use hard floating point ABI to pass args",
135 .dependencies = featureSet(&[_]Feature{}),
136 };
137 result[@enumToInt(Feature.java)] = .{
138 .llvm_name = "java",
139 .description = "Enable java instructions",
140 .dependencies = featureSet(&[_]Feature{}),
141 };
142 result[@enumToInt(Feature.mp1e2)] = .{
143 .llvm_name = "mp1e2",
144 .description = "Support CSKY mp1e2 instructions",
145 .dependencies = featureSet(&[_]Feature{
146 .@"3e7",
147 }),
148 };
149 const ti = @typeInfo(Feature);
150 for (result) |*elem, i| {
151 elem.index = i;
152 elem.name = ti.Enum.fields[i].name;
153 }
154 break :blk result;
155};
156
157pub const cpu = struct {
158 pub const generic = CpuModel{
159 .name = "generic",
160 .llvm_name = "generic",
161 .features = featureSet(&[_]Feature{}),
162 };
163};
lib/std/target/hexagon.zig+64
......@@ -6,17 +6,21 @@ const CpuModel = std.Target.Cpu.Model;
66
77pub const Feature = enum {
88 audio,
9 cabac,
910 compound,
1011 duplex,
1112 hvx,
13 hvx_ieee_fp,
1214 hvx_length128b,
1315 hvx_length64b,
16 hvx_qfloat,
1417 hvxv60,
1518 hvxv62,
1619 hvxv65,
1720 hvxv66,
1821 hvxv67,
1922 hvxv68,
23 hvxv69,
2024 long_calls,
2125 mem_noshuf,
2226 memops,
......@@ -37,6 +41,7 @@ pub const Feature = enum {
3741 v66,
3842 v67,
3943 v68,
44 v69,
4045 zreg,
4146};
4247
......@@ -54,6 +59,11 @@ pub const all_features = blk: {
5459 .description = "Hexagon Audio extension instructions",
5560 .dependencies = featureSet(&[_]Feature{}),
5661 };
62 result[@enumToInt(Feature.cabac)] = .{
63 .llvm_name = "cabac",
64 .description = "Emit the CABAC instruction",
65 .dependencies = featureSet(&[_]Feature{}),
66 };
5767 result[@enumToInt(Feature.compound)] = .{
5868 .llvm_name = "compound",
5969 .description = "Use compound instructions",
......@@ -69,6 +79,11 @@ pub const all_features = blk: {
6979 .description = "Hexagon HVX instructions",
7080 .dependencies = featureSet(&[_]Feature{}),
7181 };
82 result[@enumToInt(Feature.hvx_ieee_fp)] = .{
83 .llvm_name = "hvx-ieee-fp",
84 .description = "Hexagon HVX IEEE floating point instructions",
85 .dependencies = featureSet(&[_]Feature{}),
86 };
7287 result[@enumToInt(Feature.hvx_length128b)] = .{
7388 .llvm_name = "hvx-length128b",
7489 .description = "Hexagon HVX 128B instructions",
......@@ -83,6 +98,11 @@ pub const all_features = blk: {
8398 .hvx,
8499 }),
85100 };
101 result[@enumToInt(Feature.hvx_qfloat)] = .{
102 .llvm_name = "hvx-qfloat",
103 .description = "Hexagon HVX QFloating point instructions",
104 .dependencies = featureSet(&[_]Feature{}),
105 };
86106 result[@enumToInt(Feature.hvxv60)] = .{
87107 .llvm_name = "hvxv60",
88108 .description = "Hexagon HVX instructions",
......@@ -126,6 +146,13 @@ pub const all_features = blk: {
126146 .hvxv67,
127147 }),
128148 };
149 result[@enumToInt(Feature.hvxv69)] = .{
150 .llvm_name = "hvxv69",
151 .description = "Hexagon HVX instructions",
152 .dependencies = featureSet(&[_]Feature{
153 .hvxv68,
154 }),
155 };
129156 result[@enumToInt(Feature.long_calls)] = .{
130157 .llvm_name = "long-calls",
131158 .description = "Use constant-extended calls",
......@@ -230,6 +257,11 @@ pub const all_features = blk: {
230257 .description = "Enable Hexagon V68 architecture",
231258 .dependencies = featureSet(&[_]Feature{}),
232259 };
260 result[@enumToInt(Feature.v69)] = .{
261 .llvm_name = "v69",
262 .description = "Enable Hexagon V69 architecture",
263 .dependencies = featureSet(&[_]Feature{}),
264 };
233265 result[@enumToInt(Feature.zreg)] = .{
234266 .llvm_name = "zreg",
235267 .description = "Hexagon ZReg extension instructions",
......@@ -248,6 +280,7 @@ pub const cpu = struct {
248280 .name = "generic",
249281 .llvm_name = "generic",
250282 .features = featureSet(&[_]Feature{
283 .cabac,
251284 .compound,
252285 .duplex,
253286 .memops,
......@@ -264,6 +297,7 @@ pub const cpu = struct {
264297 .name = "hexagonv5",
265298 .llvm_name = "hexagonv5",
266299 .features = featureSet(&[_]Feature{
300 .cabac,
267301 .compound,
268302 .duplex,
269303 .memops,
......@@ -278,6 +312,7 @@ pub const cpu = struct {
278312 .name = "hexagonv55",
279313 .llvm_name = "hexagonv55",
280314 .features = featureSet(&[_]Feature{
315 .cabac,
281316 .compound,
282317 .duplex,
283318 .memops,
......@@ -293,6 +328,7 @@ pub const cpu = struct {
293328 .name = "hexagonv60",
294329 .llvm_name = "hexagonv60",
295330 .features = featureSet(&[_]Feature{
331 .cabac,
296332 .compound,
297333 .duplex,
298334 .memops,
......@@ -309,6 +345,7 @@ pub const cpu = struct {
309345 .name = "hexagonv62",
310346 .llvm_name = "hexagonv62",
311347 .features = featureSet(&[_]Feature{
348 .cabac,
312349 .compound,
313350 .duplex,
314351 .memops,
......@@ -326,6 +363,7 @@ pub const cpu = struct {
326363 .name = "hexagonv65",
327364 .llvm_name = "hexagonv65",
328365 .features = featureSet(&[_]Feature{
366 .cabac,
329367 .compound,
330368 .duplex,
331369 .mem_noshuf,
......@@ -344,6 +382,7 @@ pub const cpu = struct {
344382 .name = "hexagonv66",
345383 .llvm_name = "hexagonv66",
346384 .features = featureSet(&[_]Feature{
385 .cabac,
347386 .compound,
348387 .duplex,
349388 .mem_noshuf,
......@@ -363,6 +402,7 @@ pub const cpu = struct {
363402 .name = "hexagonv67",
364403 .llvm_name = "hexagonv67",
365404 .features = featureSet(&[_]Feature{
405 .cabac,
366406 .compound,
367407 .duplex,
368408 .mem_noshuf,
......@@ -403,6 +443,29 @@ pub const cpu = struct {
403443 .name = "hexagonv68",
404444 .llvm_name = "hexagonv68",
405445 .features = featureSet(&[_]Feature{
446 .cabac,
447 .compound,
448 .duplex,
449 .mem_noshuf,
450 .memops,
451 .nvj,
452 .nvs,
453 .small_data,
454 .v5,
455 .v55,
456 .v60,
457 .v62,
458 .v65,
459 .v66,
460 .v67,
461 .v68,
462 }),
463 };
464 pub const hexagonv69 = CpuModel{
465 .name = "hexagonv69",
466 .llvm_name = "hexagonv69",
467 .features = featureSet(&[_]Feature{
468 .cabac,
406469 .compound,
407470 .duplex,
408471 .mem_noshuf,
......@@ -418,6 +481,7 @@ pub const cpu = struct {
418481 .v66,
419482 .v67,
420483 .v68,
484 .v69,
421485 }),
422486 };
423487};
lib/std/target/nvptx.zig+18
......@@ -19,6 +19,9 @@ pub const Feature = enum {
1919 ptx70,
2020 ptx71,
2121 ptx72,
22 ptx73,
23 ptx74,
24 ptx75,
2225 sm_20,
2326 sm_21,
2427 sm_30,
......@@ -117,6 +120,21 @@ pub const all_features = blk: {
117120 .description = "Use PTX version 7.2",
118121 .dependencies = featureSet(&[_]Feature{}),
119122 };
123 result[@enumToInt(Feature.ptx73)] = .{
124 .llvm_name = "ptx73",
125 .description = "Use PTX version 7.3",
126 .dependencies = featureSet(&[_]Feature{}),
127 };
128 result[@enumToInt(Feature.ptx74)] = .{
129 .llvm_name = "ptx74",
130 .description = "Use PTX version 7.4",
131 .dependencies = featureSet(&[_]Feature{}),
132 };
133 result[@enumToInt(Feature.ptx75)] = .{
134 .llvm_name = "ptx75",
135 .description = "Use PTX version 7.5",
136 .dependencies = featureSet(&[_]Feature{}),
137 };
120138 result[@enumToInt(Feature.sm_20)] = .{
121139 .llvm_name = "sm_20",
122140 .description = "Target SM 2.0",
lib/std/target/powerpc.zig+94
......@@ -29,14 +29,24 @@ pub const Feature = enum {
2929 frsqrte,
3030 frsqrtes,
3131 fsqrt,
32 fuse_add_logical,
3233 fuse_addi_load,
3334 fuse_addis_load,
35 fuse_arith_add,
36 fuse_back2back,
37 fuse_cmp,
38 fuse_logical,
39 fuse_logical_add,
40 fuse_sha3,
3441 fuse_store,
42 fuse_wideimm,
43 fuse_zeromove,
3544 fusion,
3645 hard_float,
3746 htm,
3847 icbt,
3948 invariant_function_descriptors,
49 isa_v206_instructions,
4050 isa_v207_instructions,
4151 isa_v30_instructions,
4252 isa_v31_instructions,
......@@ -235,6 +245,13 @@ pub const all_features = blk: {
235245 .fpu,
236246 }),
237247 };
248 result[@enumToInt(Feature.fuse_add_logical)] = .{
249 .llvm_name = "fuse-add-logical",
250 .description = "Target supports Add with Logical Operations fusion",
251 .dependencies = featureSet(&[_]Feature{
252 .fusion,
253 }),
254 };
238255 result[@enumToInt(Feature.fuse_addi_load)] = .{
239256 .llvm_name = "fuse-addi-load",
240257 .description = "Power8 Addi-Load fusion",
......@@ -249,6 +266,48 @@ pub const all_features = blk: {
249266 .fusion,
250267 }),
251268 };
269 result[@enumToInt(Feature.fuse_arith_add)] = .{
270 .llvm_name = "fuse-arith-add",
271 .description = "Target supports Arithmetic Operations with Add fusion",
272 .dependencies = featureSet(&[_]Feature{
273 .fusion,
274 }),
275 };
276 result[@enumToInt(Feature.fuse_back2back)] = .{
277 .llvm_name = "fuse-back2back",
278 .description = "Target supports general back to back fusion",
279 .dependencies = featureSet(&[_]Feature{
280 .fusion,
281 }),
282 };
283 result[@enumToInt(Feature.fuse_cmp)] = .{
284 .llvm_name = "fuse-cmp",
285 .description = "Target supports Comparison Operations fusion",
286 .dependencies = featureSet(&[_]Feature{
287 .fusion,
288 }),
289 };
290 result[@enumToInt(Feature.fuse_logical)] = .{
291 .llvm_name = "fuse-logical",
292 .description = "Target supports Logical Operations fusion",
293 .dependencies = featureSet(&[_]Feature{
294 .fusion,
295 }),
296 };
297 result[@enumToInt(Feature.fuse_logical_add)] = .{
298 .llvm_name = "fuse-logical-add",
299 .description = "Target supports Logical with Add Operations fusion",
300 .dependencies = featureSet(&[_]Feature{
301 .fusion,
302 }),
303 };
304 result[@enumToInt(Feature.fuse_sha3)] = .{
305 .llvm_name = "fuse-sha3",
306 .description = "Target supports SHA3 assist fusion",
307 .dependencies = featureSet(&[_]Feature{
308 .fusion,
309 }),
310 };
252311 result[@enumToInt(Feature.fuse_store)] = .{
253312 .llvm_name = "fuse-store",
254313 .description = "Target supports store clustering",
......@@ -256,6 +315,20 @@ pub const all_features = blk: {
256315 .fusion,
257316 }),
258317 };
318 result[@enumToInt(Feature.fuse_wideimm)] = .{
319 .llvm_name = "fuse-wideimm",
320 .description = "Target supports Wide-Immediate fusion",
321 .dependencies = featureSet(&[_]Feature{
322 .fusion,
323 }),
324 };
325 result[@enumToInt(Feature.fuse_zeromove)] = .{
326 .llvm_name = "fuse-zeromove",
327 .description = "Target supports move to SPR with branch fusion",
328 .dependencies = featureSet(&[_]Feature{
329 .fusion,
330 }),
331 };
259332 result[@enumToInt(Feature.fusion)] = .{
260333 .llvm_name = "fusion",
261334 .description = "Target supports instruction fusion",
......@@ -281,6 +354,11 @@ pub const all_features = blk: {
281354 .description = "Assume function descriptors are invariant",
282355 .dependencies = featureSet(&[_]Feature{}),
283356 };
357 result[@enumToInt(Feature.isa_v206_instructions)] = .{
358 .llvm_name = "isa-v206-instructions",
359 .description = "Enable instructions in ISA 2.06.",
360 .dependencies = featureSet(&[_]Feature{}),
361 };
284362 result[@enumToInt(Feature.isa_v207_instructions)] = .{
285363 .llvm_name = "isa-v207-instructions",
286364 .description = "Enable instructions in ISA 2.07.",
......@@ -707,9 +785,15 @@ pub const cpu = struct {
707785 .frsqrte,
708786 .frsqrtes,
709787 .fsqrt,
788 .fuse_add_logical,
789 .fuse_arith_add,
790 .fuse_logical,
791 .fuse_logical_add,
792 .fuse_sha3,
710793 .fuse_store,
711794 .htm,
712795 .icbt,
796 .isa_v206_instructions,
713797 .isel,
714798 .ldbrx,
715799 .lfiwax,
......@@ -817,6 +901,7 @@ pub const cpu = struct {
817901 .fuse_addis_load,
818902 .htm,
819903 .icbt,
904 .isa_v206_instructions,
820905 .isa_v207_instructions,
821906 .isel,
822907 .ldbrx,
......@@ -851,9 +936,15 @@ pub const cpu = struct {
851936 .frsqrte,
852937 .frsqrtes,
853938 .fsqrt,
939 .fuse_add_logical,
940 .fuse_arith_add,
941 .fuse_logical,
942 .fuse_logical_add,
943 .fuse_sha3,
854944 .fuse_store,
855945 .htm,
856946 .icbt,
947 .isa_v206_instructions,
857948 .isel,
858949 .ldbrx,
859950 .lfiwax,
......@@ -985,6 +1076,7 @@ pub const cpu = struct {
9851076 .frsqrte,
9861077 .frsqrtes,
9871078 .fsqrt,
1079 .isa_v206_instructions,
9881080 .isel,
9891081 .ldbrx,
9901082 .lfiwax,
......@@ -1019,6 +1111,7 @@ pub const cpu = struct {
10191111 .fuse_addis_load,
10201112 .htm,
10211113 .icbt,
1114 .isa_v206_instructions,
10221115 .isa_v207_instructions,
10231116 .isel,
10241117 .ldbrx,
......@@ -1055,6 +1148,7 @@ pub const cpu = struct {
10551148 .fsqrt,
10561149 .htm,
10571150 .icbt,
1151 .isa_v206_instructions,
10581152 .isel,
10591153 .ldbrx,
10601154 .lfiwax,
lib/std/target/riscv.zig+387-83
......@@ -10,22 +10,12 @@ pub const Feature = enum {
1010 c,
1111 d,
1212 e,
13 experimental_b,
14 experimental_v,
15 experimental_zba,
16 experimental_zbb,
17 experimental_zbc,
1813 experimental_zbe,
1914 experimental_zbf,
2015 experimental_zbm,
2116 experimental_zbp,
22 experimental_zbproposedc,
2317 experimental_zbr,
24 experimental_zbs,
2518 experimental_zbt,
26 experimental_zfh,
27 experimental_zvamo,
28 experimental_zvlsseg,
2919 f,
3020 m,
3121 no_rvc_hints,
......@@ -62,6 +52,46 @@ pub const Feature = enum {
6252 reserve_x8,
6353 reserve_x9,
6454 save_restore,
55 v,
56 zba,
57 zbb,
58 zbc,
59 zbkb,
60 zbkc,
61 zbkx,
62 zbs,
63 zdinx,
64 zfh,
65 zfhmin,
66 zfinx,
67 zhinx,
68 zhinxmin,
69 zk,
70 zkn,
71 zknd,
72 zkne,
73 zknh,
74 zkr,
75 zks,
76 zksed,
77 zksh,
78 zkt,
79 zve32f,
80 zve32x,
81 zve64d,
82 zve64f,
83 zve64x,
84 zvl1024b,
85 zvl128b,
86 zvl16384b,
87 zvl2048b,
88 zvl256b,
89 zvl32768b,
90 zvl32b,
91 zvl4096b,
92 zvl512b,
93 zvl64b,
94 zvl8192b,
6595};
6696
6797pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
......@@ -100,103 +130,36 @@ pub const all_features = blk: {
100130 .description = "Implements RV32E (provides 16 rather than 32 GPRs)",
101131 .dependencies = featureSet(&[_]Feature{}),
102132 };
103 result[@enumToInt(Feature.experimental_b)] = .{
104 .llvm_name = "experimental-b",
105 .description = "'B' (Bit Manipulation Instructions)",
106 .dependencies = featureSet(&[_]Feature{
107 .experimental_zba,
108 .experimental_zbb,
109 .experimental_zbc,
110 .experimental_zbe,
111 .experimental_zbf,
112 .experimental_zbm,
113 .experimental_zbp,
114 .experimental_zbr,
115 .experimental_zbs,
116 .experimental_zbt,
117 }),
118 };
119 result[@enumToInt(Feature.experimental_v)] = .{
120 .llvm_name = "experimental-v",
121 .description = "'V' (Vector Instructions)",
122 .dependencies = featureSet(&[_]Feature{}),
123 };
124 result[@enumToInt(Feature.experimental_zba)] = .{
125 .llvm_name = "experimental-zba",
126 .description = "'Zba' (Address calculation 'B' Instructions)",
127 .dependencies = featureSet(&[_]Feature{}),
128 };
129 result[@enumToInt(Feature.experimental_zbb)] = .{
130 .llvm_name = "experimental-zbb",
131 .description = "'Zbb' (Base 'B' Instructions)",
132 .dependencies = featureSet(&[_]Feature{}),
133 };
134 result[@enumToInt(Feature.experimental_zbc)] = .{
135 .llvm_name = "experimental-zbc",
136 .description = "'Zbc' (Carry-Less 'B' Instructions)",
137 .dependencies = featureSet(&[_]Feature{}),
138 };
139133 result[@enumToInt(Feature.experimental_zbe)] = .{
140134 .llvm_name = "experimental-zbe",
141 .description = "'Zbe' (Extract-Deposit 'B' Instructions)",
135 .description = "'Zbe' (Extract-Deposit 'Zb' Instructions)",
142136 .dependencies = featureSet(&[_]Feature{}),
143137 };
144138 result[@enumToInt(Feature.experimental_zbf)] = .{
145139 .llvm_name = "experimental-zbf",
146 .description = "'Zbf' (Bit-Field 'B' Instructions)",
140 .description = "'Zbf' (Bit-Field 'Zb' Instructions)",
147141 .dependencies = featureSet(&[_]Feature{}),
148142 };
149143 result[@enumToInt(Feature.experimental_zbm)] = .{
150144 .llvm_name = "experimental-zbm",
151 .description = "'Zbm' (Matrix 'B' Instructions)",
145 .description = "'Zbm' (Matrix 'Zb' Instructions)",
152146 .dependencies = featureSet(&[_]Feature{}),
153147 };
154148 result[@enumToInt(Feature.experimental_zbp)] = .{
155149 .llvm_name = "experimental-zbp",
156 .description = "'Zbp' (Permutation 'B' Instructions)",
157 .dependencies = featureSet(&[_]Feature{}),
158 };
159 result[@enumToInt(Feature.experimental_zbproposedc)] = .{
160 .llvm_name = "experimental-zbproposedc",
161 .description = "'Zbproposedc' (Proposed Compressed 'B' Instructions)",
150 .description = "'Zbp' (Permutation 'Zb' Instructions)",
162151 .dependencies = featureSet(&[_]Feature{}),
163152 };
164153 result[@enumToInt(Feature.experimental_zbr)] = .{
165154 .llvm_name = "experimental-zbr",
166 .description = "'Zbr' (Polynomial Reduction 'B' Instructions)",
167 .dependencies = featureSet(&[_]Feature{}),
168 };
169 result[@enumToInt(Feature.experimental_zbs)] = .{
170 .llvm_name = "experimental-zbs",
171 .description = "'Zbs' (Single-Bit 'B' Instructions)",
155 .description = "'Zbr' (Polynomial Reduction 'Zb' Instructions)",
172156 .dependencies = featureSet(&[_]Feature{}),
173157 };
174158 result[@enumToInt(Feature.experimental_zbt)] = .{
175159 .llvm_name = "experimental-zbt",
176 .description = "'Zbt' (Ternary 'B' Instructions)",
160 .description = "'Zbt' (Ternary 'Zb' Instructions)",
177161 .dependencies = featureSet(&[_]Feature{}),
178162 };
179 result[@enumToInt(Feature.experimental_zfh)] = .{
180 .llvm_name = "experimental-zfh",
181 .description = "'Zfh' (Half-Precision Floating-Point)",
182 .dependencies = featureSet(&[_]Feature{
183 .f,
184 }),
185 };
186 result[@enumToInt(Feature.experimental_zvamo)] = .{
187 .llvm_name = "experimental-zvamo",
188 .description = "'Zvamo' (Vector AMO Operations)",
189 .dependencies = featureSet(&[_]Feature{
190 .experimental_v,
191 }),
192 };
193 result[@enumToInt(Feature.experimental_zvlsseg)] = .{
194 .llvm_name = "experimental-zvlsseg",
195 .description = "'Zvlsseg' (Vector segment load/store instructions)",
196 .dependencies = featureSet(&[_]Feature{
197 .experimental_v,
198 }),
199 };
200163 result[@enumToInt(Feature.f)] = .{
201164 .llvm_name = "f",
202165 .description = "'F' (Single-Precision Floating-Point)",
......@@ -377,6 +340,268 @@ pub const all_features = blk: {
377340 .description = "Enable save/restore.",
378341 .dependencies = featureSet(&[_]Feature{}),
379342 };
343 result[@enumToInt(Feature.v)] = .{
344 .llvm_name = "v",
345 .description = "'V' (Vector Extension for Application Processors)",
346 .dependencies = featureSet(&[_]Feature{
347 .d,
348 .zvl128b,
349 }),
350 };
351 result[@enumToInt(Feature.zba)] = .{
352 .llvm_name = "zba",
353 .description = "'Zba' (Address Generation Instructions)",
354 .dependencies = featureSet(&[_]Feature{}),
355 };
356 result[@enumToInt(Feature.zbb)] = .{
357 .llvm_name = "zbb",
358 .description = "'Zbb' (Basic Bit-Manipulation)",
359 .dependencies = featureSet(&[_]Feature{}),
360 };
361 result[@enumToInt(Feature.zbc)] = .{
362 .llvm_name = "zbc",
363 .description = "'Zbc' (Carry-Less Multiplication)",
364 .dependencies = featureSet(&[_]Feature{}),
365 };
366 result[@enumToInt(Feature.zbkb)] = .{
367 .llvm_name = "zbkb",
368 .description = "'Zbkb' (Bitmanip instructions for Cryptography)",
369 .dependencies = featureSet(&[_]Feature{}),
370 };
371 result[@enumToInt(Feature.zbkc)] = .{
372 .llvm_name = "zbkc",
373 .description = "'Zbkc' (Carry-less multiply instructions for Cryptography)",
374 .dependencies = featureSet(&[_]Feature{}),
375 };
376 result[@enumToInt(Feature.zbkx)] = .{
377 .llvm_name = "zbkx",
378 .description = "'Zbkx' (Crossbar permutation instructions)",
379 .dependencies = featureSet(&[_]Feature{}),
380 };
381 result[@enumToInt(Feature.zbs)] = .{
382 .llvm_name = "zbs",
383 .description = "'Zbs' (Single-Bit Instructions)",
384 .dependencies = featureSet(&[_]Feature{}),
385 };
386 result[@enumToInt(Feature.zdinx)] = .{
387 .llvm_name = "zdinx",
388 .description = "'Zdinx' (Double in Integer)",
389 .dependencies = featureSet(&[_]Feature{
390 .zfinx,
391 }),
392 };
393 result[@enumToInt(Feature.zfh)] = .{
394 .llvm_name = "zfh",
395 .description = "'Zfh' (Half-Precision Floating-Point)",
396 .dependencies = featureSet(&[_]Feature{
397 .f,
398 }),
399 };
400 result[@enumToInt(Feature.zfhmin)] = .{
401 .llvm_name = "zfhmin",
402 .description = "'Zfhmin' (Half-Precision Floating-Point Minimal)",
403 .dependencies = featureSet(&[_]Feature{
404 .f,
405 }),
406 };
407 result[@enumToInt(Feature.zfinx)] = .{
408 .llvm_name = "zfinx",
409 .description = "'Zfinx' (Float in Integer)",
410 .dependencies = featureSet(&[_]Feature{}),
411 };
412 result[@enumToInt(Feature.zhinx)] = .{
413 .llvm_name = "zhinx",
414 .description = "'Zhinx' (Half Float in Integer)",
415 .dependencies = featureSet(&[_]Feature{
416 .zfinx,
417 }),
418 };
419 result[@enumToInt(Feature.zhinxmin)] = .{
420 .llvm_name = "zhinxmin",
421 .description = "'Zhinxmin' (Half Float in Integer Minimal)",
422 .dependencies = featureSet(&[_]Feature{
423 .zfinx,
424 }),
425 };
426 result[@enumToInt(Feature.zk)] = .{
427 .llvm_name = "zk",
428 .description = "'Zk' (Standard scalar cryptography extension)",
429 .dependencies = featureSet(&[_]Feature{
430 .zkn,
431 .zkr,
432 .zkt,
433 }),
434 };
435 result[@enumToInt(Feature.zkn)] = .{
436 .llvm_name = "zkn",
437 .description = "'Zkn' (NIST Algorithm Suite)",
438 .dependencies = featureSet(&[_]Feature{
439 .zbkb,
440 .zbkc,
441 .zbkx,
442 .zknd,
443 .zkne,
444 .zknh,
445 }),
446 };
447 result[@enumToInt(Feature.zknd)] = .{
448 .llvm_name = "zknd",
449 .description = "'Zknd' (NIST Suite: AES Decryption)",
450 .dependencies = featureSet(&[_]Feature{}),
451 };
452 result[@enumToInt(Feature.zkne)] = .{
453 .llvm_name = "zkne",
454 .description = "'Zkne' (NIST Suite: AES Encryption)",
455 .dependencies = featureSet(&[_]Feature{}),
456 };
457 result[@enumToInt(Feature.zknh)] = .{
458 .llvm_name = "zknh",
459 .description = "'Zknh' (NIST Suite: Hash Function Instructions)",
460 .dependencies = featureSet(&[_]Feature{}),
461 };
462 result[@enumToInt(Feature.zkr)] = .{
463 .llvm_name = "zkr",
464 .description = "'Zkr' (Entropy Source Extension)",
465 .dependencies = featureSet(&[_]Feature{}),
466 };
467 result[@enumToInt(Feature.zks)] = .{
468 .llvm_name = "zks",
469 .description = "'Zks' (ShangMi Algorithm Suite)",
470 .dependencies = featureSet(&[_]Feature{
471 .zbkb,
472 .zbkc,
473 .zbkx,
474 .zksed,
475 .zksh,
476 }),
477 };
478 result[@enumToInt(Feature.zksed)] = .{
479 .llvm_name = "zksed",
480 .description = "'Zksed' (ShangMi Suite: SM4 Block Cipher Instructions)",
481 .dependencies = featureSet(&[_]Feature{}),
482 };
483 result[@enumToInt(Feature.zksh)] = .{
484 .llvm_name = "zksh",
485 .description = "'Zksh' (ShangMi Suite: SM3 Hash Function Instructions)",
486 .dependencies = featureSet(&[_]Feature{}),
487 };
488 result[@enumToInt(Feature.zkt)] = .{
489 .llvm_name = "zkt",
490 .description = "'Zkt' (Data Independent Execution Latency)",
491 .dependencies = featureSet(&[_]Feature{}),
492 };
493 result[@enumToInt(Feature.zve32f)] = .{
494 .llvm_name = "zve32f",
495 .description = "'Zve32f' (Vector Extensions for Embedded Processors with maximal 32 EEW and F extension)",
496 .dependencies = featureSet(&[_]Feature{
497 .zve32x,
498 }),
499 };
500 result[@enumToInt(Feature.zve32x)] = .{
501 .llvm_name = "zve32x",
502 .description = "'Zve32x' (Vector Extensions for Embedded Processors with maximal 32 EEW)",
503 .dependencies = featureSet(&[_]Feature{
504 .zvl32b,
505 }),
506 };
507 result[@enumToInt(Feature.zve64d)] = .{
508 .llvm_name = "zve64d",
509 .description = "'Zve64d' (Vector Extensions for Embedded Processors with maximal 64 EEW, F and D extension)",
510 .dependencies = featureSet(&[_]Feature{
511 .zve64f,
512 }),
513 };
514 result[@enumToInt(Feature.zve64f)] = .{
515 .llvm_name = "zve64f",
516 .description = "'Zve64f' (Vector Extensions for Embedded Processors with maximal 64 EEW and F extension)",
517 .dependencies = featureSet(&[_]Feature{
518 .zve32f,
519 .zve64x,
520 }),
521 };
522 result[@enumToInt(Feature.zve64x)] = .{
523 .llvm_name = "zve64x",
524 .description = "'Zve64x' (Vector Extensions for Embedded Processors with maximal 64 EEW)",
525 .dependencies = featureSet(&[_]Feature{
526 .zve32x,
527 .zvl64b,
528 }),
529 };
530 result[@enumToInt(Feature.zvl1024b)] = .{
531 .llvm_name = "zvl1024b",
532 .description = "'Zvl' (Minimum Vector Length) 1024",
533 .dependencies = featureSet(&[_]Feature{
534 .zvl512b,
535 }),
536 };
537 result[@enumToInt(Feature.zvl128b)] = .{
538 .llvm_name = "zvl128b",
539 .description = "'Zvl' (Minimum Vector Length) 128",
540 .dependencies = featureSet(&[_]Feature{
541 .zvl64b,
542 }),
543 };
544 result[@enumToInt(Feature.zvl16384b)] = .{
545 .llvm_name = "zvl16384b",
546 .description = "'Zvl' (Minimum Vector Length) 16384",
547 .dependencies = featureSet(&[_]Feature{
548 .zvl8192b,
549 }),
550 };
551 result[@enumToInt(Feature.zvl2048b)] = .{
552 .llvm_name = "zvl2048b",
553 .description = "'Zvl' (Minimum Vector Length) 2048",
554 .dependencies = featureSet(&[_]Feature{
555 .zvl1024b,
556 }),
557 };
558 result[@enumToInt(Feature.zvl256b)] = .{
559 .llvm_name = "zvl256b",
560 .description = "'Zvl' (Minimum Vector Length) 256",
561 .dependencies = featureSet(&[_]Feature{
562 .zvl128b,
563 }),
564 };
565 result[@enumToInt(Feature.zvl32768b)] = .{
566 .llvm_name = "zvl32768b",
567 .description = "'Zvl' (Minimum Vector Length) 32768",
568 .dependencies = featureSet(&[_]Feature{
569 .zvl16384b,
570 }),
571 };
572 result[@enumToInt(Feature.zvl32b)] = .{
573 .llvm_name = "zvl32b",
574 .description = "'Zvl' (Minimum Vector Length) 32",
575 .dependencies = featureSet(&[_]Feature{}),
576 };
577 result[@enumToInt(Feature.zvl4096b)] = .{
578 .llvm_name = "zvl4096b",
579 .description = "'Zvl' (Minimum Vector Length) 4096",
580 .dependencies = featureSet(&[_]Feature{
581 .zvl2048b,
582 }),
583 };
584 result[@enumToInt(Feature.zvl512b)] = .{
585 .llvm_name = "zvl512b",
586 .description = "'Zvl' (Minimum Vector Length) 512",
587 .dependencies = featureSet(&[_]Feature{
588 .zvl256b,
589 }),
590 };
591 result[@enumToInt(Feature.zvl64b)] = .{
592 .llvm_name = "zvl64b",
593 .description = "'Zvl' (Minimum Vector Length) 64",
594 .dependencies = featureSet(&[_]Feature{
595 .zvl32b,
596 }),
597 };
598 result[@enumToInt(Feature.zvl8192b)] = .{
599 .llvm_name = "zvl8192b",
600 .description = "'Zvl' (Minimum Vector Length) 8192",
601 .dependencies = featureSet(&[_]Feature{
602 .zvl4096b,
603 }),
604 };
380605 const ti = @typeInfo(Feature);
381606 for (result) |*elem, i| {
382607 elem.index = i;
......@@ -443,6 +668,33 @@ pub const cpu = struct {
443668 .@"64bit",
444669 }),
445670 };
671 pub const sifive_e20 = CpuModel{
672 .name = "sifive_e20",
673 .llvm_name = "sifive-e20",
674 .features = featureSet(&[_]Feature{
675 .c,
676 .m,
677 }),
678 };
679 pub const sifive_e21 = CpuModel{
680 .name = "sifive_e21",
681 .llvm_name = "sifive-e21",
682 .features = featureSet(&[_]Feature{
683 .a,
684 .c,
685 .m,
686 }),
687 };
688 pub const sifive_e24 = CpuModel{
689 .name = "sifive_e24",
690 .llvm_name = "sifive-e24",
691 .features = featureSet(&[_]Feature{
692 .a,
693 .c,
694 .f,
695 .m,
696 }),
697 };
446698 pub const sifive_e31 = CpuModel{
447699 .name = "sifive_e31",
448700 .llvm_name = "sifive-e31",
......@@ -452,6 +704,16 @@ pub const cpu = struct {
452704 .m,
453705 }),
454706 };
707 pub const sifive_e34 = CpuModel{
708 .name = "sifive_e34",
709 .llvm_name = "sifive-e34",
710 .features = featureSet(&[_]Feature{
711 .a,
712 .c,
713 .f,
714 .m,
715 }),
716 };
455717 pub const sifive_e76 = CpuModel{
456718 .name = "sifive_e76",
457719 .llvm_name = "sifive-e76",
......@@ -462,6 +724,48 @@ pub const cpu = struct {
462724 .m,
463725 }),
464726 };
727 pub const sifive_s21 = CpuModel{
728 .name = "sifive_s21",
729 .llvm_name = "sifive-s21",
730 .features = featureSet(&[_]Feature{
731 .@"64bit",
732 .a,
733 .c,
734 .m,
735 }),
736 };
737 pub const sifive_s51 = CpuModel{
738 .name = "sifive_s51",
739 .llvm_name = "sifive-s51",
740 .features = featureSet(&[_]Feature{
741 .@"64bit",
742 .a,
743 .c,
744 .m,
745 }),
746 };
747 pub const sifive_s54 = CpuModel{
748 .name = "sifive_s54",
749 .llvm_name = "sifive-s54",
750 .features = featureSet(&[_]Feature{
751 .@"64bit",
752 .a,
753 .c,
754 .d,
755 .m,
756 }),
757 };
758 pub const sifive_s76 = CpuModel{
759 .name = "sifive_s76",
760 .llvm_name = "sifive-s76",
761 .features = featureSet(&[_]Feature{
762 .@"64bit",
763 .a,
764 .c,
765 .d,
766 .m,
767 }),
768 };
465769 pub const sifive_u54 = CpuModel{
466770 .name = "sifive_u54",
467771 .llvm_name = "sifive-u54",
lib/std/target/wasm.zig+6
......@@ -12,6 +12,7 @@ pub const Feature = enum {
1212 mutable_globals,
1313 nontrapping_fptoint,
1414 reference_types,
15 relaxed_simd,
1516 sign_ext,
1617 simd128,
1718 tail_call,
......@@ -61,6 +62,11 @@ pub const all_features = blk: {
6162 .description = "Enable reference types",
6263 .dependencies = featureSet(&[_]Feature{}),
6364 };
65 result[@enumToInt(Feature.relaxed_simd)] = .{
66 .llvm_name = "relaxed-simd",
67 .description = "Enable relaxed-simd instructions",
68 .dependencies = featureSet(&[_]Feature{}),
69 };
6470 result[@enumToInt(Feature.sign_ext)] = .{
6571 .llvm_name = "sign-ext",
6672 .description = "Enable sign extension operators",
lib/std/target/x86.zig+116-41
......@@ -24,6 +24,7 @@ pub const Feature = enum {
2424 avx512dq,
2525 avx512er,
2626 avx512f,
27 avx512fp16,
2728 avx512ifma,
2829 avx512pf,
2930 avx512vbmi,
......@@ -41,6 +42,7 @@ pub const Feature = enum {
4142 clwb,
4243 clzero,
4344 cmov,
45 crc32,
4446 cx16,
4547 cx8,
4648 enqcmd,
......@@ -130,11 +132,13 @@ pub const Feature = enum {
130132 sse4a,
131133 sse_unaligned_mem,
132134 ssse3,
135 tagged_globals,
133136 tbm,
134137 tsxldtrk,
135138 uintr,
136139 use_aa,
137140 use_glm_div_sqrt_costs,
141 use_slm_arith_costs,
138142 vaes,
139143 vpclmulqdq,
140144 vzeroupper,
......@@ -283,6 +287,15 @@ pub const all_features = blk: {
283287 .fma,
284288 }),
285289 };
290 result[@enumToInt(Feature.avx512fp16)] = .{
291 .llvm_name = "avx512fp16",
292 .description = "Support 16-bit floating point",
293 .dependencies = featureSet(&[_]Feature{
294 .avx512bw,
295 .avx512dq,
296 .avx512vl,
297 }),
298 };
286299 result[@enumToInt(Feature.avx512ifma)] = .{
287300 .llvm_name = "avx512ifma",
288301 .description = "Enable AVX-512 Integer Fused Multiple-Add",
......@@ -386,6 +399,11 @@ pub const all_features = blk: {
386399 .description = "Enable conditional move instructions",
387400 .dependencies = featureSet(&[_]Feature{}),
388401 };
402 result[@enumToInt(Feature.crc32)] = .{
403 .llvm_name = "crc32",
404 .description = "Enable SSE 4.2 CRC32 instruction",
405 .dependencies = featureSet(&[_]Feature{}),
406 };
389407 result[@enumToInt(Feature.cx16)] = .{
390408 .llvm_name = "cx16",
391409 .description = "64-bit with cmpxchg16b",
......@@ -867,6 +885,11 @@ pub const all_features = blk: {
867885 .sse3,
868886 }),
869887 };
888 result[@enumToInt(Feature.tagged_globals)] = .{
889 .llvm_name = "tagged-globals",
890 .description = "Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits.",
891 .dependencies = featureSet(&[_]Feature{}),
892 };
870893 result[@enumToInt(Feature.tbm)] = .{
871894 .llvm_name = "tbm",
872895 .description = "Enable TBM instructions",
......@@ -892,6 +915,11 @@ pub const all_features = blk: {
892915 .description = "Use Goldmont specific floating point div/sqrt costs",
893916 .dependencies = featureSet(&[_]Feature{}),
894917 };
918 result[@enumToInt(Feature.use_slm_arith_costs)] = .{
919 .llvm_name = "use-slm-arith-costs",
920 .description = "Use Silvermont specific arithmetic costs",
921 .dependencies = featureSet(&[_]Feature{}),
922 };
895923 result[@enumToInt(Feature.vaes)] = .{
896924 .llvm_name = "vaes",
897925 .description = "Promote selected AES instructions to AVX512/AVX registers",
......@@ -977,45 +1005,6 @@ pub const all_features = blk: {
9771005};
9781006
9791007pub const cpu = struct {
980 pub const _i386 = CpuModel{
981 .name = "_i386",
982 .llvm_name = "i386",
983 .features = featureSet(&[_]Feature{
984 .slow_unaligned_mem_16,
985 .vzeroupper,
986 .x87,
987 }),
988 };
989 pub const _i486 = CpuModel{
990 .name = "_i486",
991 .llvm_name = "i486",
992 .features = featureSet(&[_]Feature{
993 .slow_unaligned_mem_16,
994 .vzeroupper,
995 .x87,
996 }),
997 };
998 pub const _i586 = CpuModel{
999 .name = "_i586",
1000 .llvm_name = "i586",
1001 .features = featureSet(&[_]Feature{
1002 .cx8,
1003 .slow_unaligned_mem_16,
1004 .vzeroupper,
1005 .x87,
1006 }),
1007 };
1008 pub const _i686 = CpuModel{
1009 .name = "_i686",
1010 .llvm_name = "i686",
1011 .features = featureSet(&[_]Feature{
1012 .cmov,
1013 .cx8,
1014 .slow_unaligned_mem_16,
1015 .vzeroupper,
1016 .x87,
1017 }),
1018 };
10191008 pub const alderlake = CpuModel{
10201009 .name = "alderlake",
10211010 .llvm_name = "alderlake",
......@@ -1029,6 +1018,7 @@ pub const cpu = struct {
10291018 .clflushopt,
10301019 .clwb,
10311020 .cmov,
1021 .crc32,
10321022 .cx16,
10331023 .f16c,
10341024 .false_deps_popcnt,
......@@ -1281,6 +1271,7 @@ pub const cpu = struct {
12811271 .aes,
12821272 .branchfusion,
12831273 .cmov,
1274 .crc32,
12841275 .cx16,
12851276 .fast_11bytenop,
12861277 .fast_scalar_shift_masks,
......@@ -1309,6 +1300,7 @@ pub const cpu = struct {
13091300 .bmi,
13101301 .branchfusion,
13111302 .cmov,
1303 .crc32,
13121304 .cx16,
13131305 .f16c,
13141306 .fast_11bytenop,
......@@ -1342,6 +1334,7 @@ pub const cpu = struct {
13421334 .bmi,
13431335 .branchfusion,
13441336 .cmov,
1337 .crc32,
13451338 .cx16,
13461339 .f16c,
13471340 .fast_11bytenop,
......@@ -1378,6 +1371,7 @@ pub const cpu = struct {
13781371 .bmi2,
13791372 .branchfusion,
13801373 .cmov,
1374 .crc32,
13811375 .cx16,
13821376 .f16c,
13831377 .fast_11bytenop,
......@@ -1440,6 +1434,7 @@ pub const cpu = struct {
14401434 .bmi,
14411435 .bmi2,
14421436 .cmov,
1437 .crc32,
14431438 .cx16,
14441439 .ermsb,
14451440 .f16c,
......@@ -1504,6 +1499,7 @@ pub const cpu = struct {
15041499 .aes,
15051500 .bmi,
15061501 .cmov,
1502 .crc32,
15071503 .cx16,
15081504 .f16c,
15091505 .fast_15bytenop,
......@@ -1568,6 +1564,7 @@ pub const cpu = struct {
15681564 .bmi2,
15691565 .clflushopt,
15701566 .cmov,
1567 .crc32,
15711568 .cx16,
15721569 .ermsb,
15731570 .fast_15bytenop,
......@@ -1620,6 +1617,7 @@ pub const cpu = struct {
16201617 .clflushopt,
16211618 .clwb,
16221619 .cmov,
1620 .crc32,
16231621 .cx16,
16241622 .ermsb,
16251623 .false_deps_popcnt,
......@@ -1672,6 +1670,7 @@ pub const cpu = struct {
16721670 .clflushopt,
16731671 .clwb,
16741672 .cmov,
1673 .crc32,
16751674 .cx16,
16761675 .ermsb,
16771676 .false_deps_popcnt,
......@@ -1734,6 +1733,7 @@ pub const cpu = struct {
17341733 .bmi,
17351734 .bmi2,
17361735 .cmov,
1736 .crc32,
17371737 .cx16,
17381738 .ermsb,
17391739 .f16c,
......@@ -1770,6 +1770,7 @@ pub const cpu = struct {
17701770 .features = featureSet(&[_]Feature{
17711771 .@"64bit",
17721772 .cmov,
1773 .crc32,
17731774 .cx16,
17741775 .f16c,
17751776 .false_deps_popcnt,
......@@ -1799,6 +1800,7 @@ pub const cpu = struct {
17991800 .features = featureSet(&[_]Feature{
18001801 .@"64bit",
18011802 .cmov,
1803 .crc32,
18021804 .cx16,
18031805 .fxsr,
18041806 .macrofusion,
......@@ -1818,6 +1820,7 @@ pub const cpu = struct {
18181820 .@"64bit",
18191821 .avx,
18201822 .cmov,
1823 .crc32,
18211824 .cx16,
18221825 .false_deps_popcnt,
18231826 .fast_15bytenop,
......@@ -1871,6 +1874,7 @@ pub const cpu = struct {
18711874 .aes,
18721875 .clflushopt,
18731876 .cmov,
1877 .crc32,
18741878 .cx16,
18751879 .false_deps_popcnt,
18761880 .fast_movbe,
......@@ -1906,6 +1910,7 @@ pub const cpu = struct {
19061910 .aes,
19071911 .clflushopt,
19081912 .cmov,
1913 .crc32,
19091914 .cx16,
19101915 .fast_movbe,
19111916 .fsgsbase,
......@@ -1943,6 +1948,7 @@ pub const cpu = struct {
19431948 .bmi,
19441949 .bmi2,
19451950 .cmov,
1951 .crc32,
19461952 .cx16,
19471953 .ermsb,
19481954 .f16c,
......@@ -1973,6 +1979,45 @@ pub const cpu = struct {
19731979 .xsaveopt,
19741980 }),
19751981 };
1982 pub const @"i386" = CpuModel{
1983 .name = "i386",
1984 .llvm_name = "i386",
1985 .features = featureSet(&[_]Feature{
1986 .slow_unaligned_mem_16,
1987 .vzeroupper,
1988 .x87,
1989 }),
1990 };
1991 pub const @"i486" = CpuModel{
1992 .name = "i486",
1993 .llvm_name = "i486",
1994 .features = featureSet(&[_]Feature{
1995 .slow_unaligned_mem_16,
1996 .vzeroupper,
1997 .x87,
1998 }),
1999 };
2000 pub const @"i586" = CpuModel{
2001 .name = "i586",
2002 .llvm_name = "i586",
2003 .features = featureSet(&[_]Feature{
2004 .cx8,
2005 .slow_unaligned_mem_16,
2006 .vzeroupper,
2007 .x87,
2008 }),
2009 };
2010 pub const @"i686" = CpuModel{
2011 .name = "i686",
2012 .llvm_name = "i686",
2013 .features = featureSet(&[_]Feature{
2014 .cmov,
2015 .cx8,
2016 .slow_unaligned_mem_16,
2017 .vzeroupper,
2018 .x87,
2019 }),
2020 };
19762021 pub const icelake_client = CpuModel{
19772022 .name = "icelake_client",
19782023 .llvm_name = "icelake-client",
......@@ -1992,6 +2037,7 @@ pub const cpu = struct {
19922037 .bmi2,
19932038 .clflushopt,
19942039 .cmov,
2040 .crc32,
19952041 .cx16,
19962042 .ermsb,
19972043 .fast_15bytenop,
......@@ -2051,6 +2097,7 @@ pub const cpu = struct {
20512097 .clflushopt,
20522098 .clwb,
20532099 .cmov,
2100 .crc32,
20542101 .cx16,
20552102 .ermsb,
20562103 .fast_15bytenop,
......@@ -2098,6 +2145,7 @@ pub const cpu = struct {
20982145 .features = featureSet(&[_]Feature{
20992146 .@"64bit",
21002147 .cmov,
2148 .crc32,
21012149 .cx16,
21022150 .f16c,
21032151 .false_deps_popcnt,
......@@ -2203,6 +2251,7 @@ pub const cpu = struct {
22032251 .bmi,
22042252 .bmi2,
22052253 .cmov,
2254 .crc32,
22062255 .cx16,
22072256 .fast_gather,
22082257 .fast_movbe,
......@@ -2243,6 +2292,7 @@ pub const cpu = struct {
22432292 .bmi,
22442293 .bmi2,
22452294 .cmov,
2295 .crc32,
22462296 .cx16,
22472297 .fast_gather,
22482298 .fast_movbe,
......@@ -2285,6 +2335,7 @@ pub const cpu = struct {
22852335 .features = featureSet(&[_]Feature{
22862336 .@"64bit",
22872337 .cmov,
2338 .crc32,
22882339 .cx16,
22892340 .fxsr,
22902341 .macrofusion,
......@@ -2523,6 +2574,7 @@ pub const cpu = struct {
25232574 .bmi2,
25242575 .clflushopt,
25252576 .cmov,
2577 .crc32,
25262578 .cx16,
25272579 .ermsb,
25282580 .fast_15bytenop,
......@@ -2569,6 +2621,7 @@ pub const cpu = struct {
25692621 .@"64bit",
25702622 .avx,
25712623 .cmov,
2624 .crc32,
25722625 .cx16,
25732626 .false_deps_popcnt,
25742627 .fast_15bytenop,
......@@ -2600,11 +2653,10 @@ pub const cpu = struct {
26002653 .avx512bf16,
26012654 .avx512bitalg,
26022655 .avx512cd,
2603 .avx512dq,
2656 .avx512fp16,
26042657 .avx512ifma,
26052658 .avx512vbmi,
26062659 .avx512vbmi2,
2607 .avx512vl,
26082660 .avx512vnni,
26092661 .avx512vp2intersect,
26102662 .avx512vpopcntdq,
......@@ -2615,6 +2667,7 @@ pub const cpu = struct {
26152667 .clflushopt,
26162668 .clwb,
26172669 .cmov,
2670 .crc32,
26182671 .cx16,
26192672 .enqcmd,
26202673 .ermsb,
......@@ -2671,6 +2724,7 @@ pub const cpu = struct {
26712724 .features = featureSet(&[_]Feature{
26722725 .@"64bit",
26732726 .cmov,
2727 .crc32,
26742728 .cx16,
26752729 .false_deps_popcnt,
26762730 .fast_7bytenop,
......@@ -2690,6 +2744,7 @@ pub const cpu = struct {
26902744 .slow_pmulld,
26912745 .slow_two_mem_ops,
26922746 .sse4_2,
2747 .use_slm_arith_costs,
26932748 .vzeroupper,
26942749 .x87,
26952750 }),
......@@ -2710,6 +2765,7 @@ pub const cpu = struct {
27102765 .clflushopt,
27112766 .clwb,
27122767 .cmov,
2768 .crc32,
27132769 .cx16,
27142770 .ermsb,
27152771 .false_deps_popcnt,
......@@ -2757,6 +2813,7 @@ pub const cpu = struct {
27572813 .bmi2,
27582814 .clflushopt,
27592815 .cmov,
2816 .crc32,
27602817 .cx16,
27612818 .ermsb,
27622819 .f16c,
......@@ -2808,6 +2865,7 @@ pub const cpu = struct {
28082865 .clflushopt,
28092866 .clwb,
28102867 .cmov,
2868 .crc32,
28112869 .cx16,
28122870 .ermsb,
28132871 .false_deps_popcnt,
......@@ -2849,6 +2907,7 @@ pub const cpu = struct {
28492907 .features = featureSet(&[_]Feature{
28502908 .@"64bit",
28512909 .cmov,
2910 .crc32,
28522911 .cx16,
28532912 .false_deps_popcnt,
28542913 .fast_7bytenop,
......@@ -2868,6 +2927,7 @@ pub const cpu = struct {
28682927 .slow_pmulld,
28692928 .slow_two_mem_ops,
28702929 .sse4_2,
2930 .use_slm_arith_costs,
28712931 .vzeroupper,
28722932 .x87,
28732933 }),
......@@ -2893,6 +2953,7 @@ pub const cpu = struct {
28932953 .clflushopt,
28942954 .clwb,
28952955 .cmov,
2956 .crc32,
28962957 .cx16,
28972958 .ermsb,
28982959 .fast_15bytenop,
......@@ -2944,6 +3005,7 @@ pub const cpu = struct {
29443005 .clflushopt,
29453006 .clwb,
29463007 .cmov,
3008 .crc32,
29473009 .cx16,
29483010 .fast_movbe,
29493011 .fsgsbase,
......@@ -2979,6 +3041,7 @@ pub const cpu = struct {
29793041 .features = featureSet(&[_]Feature{
29803042 .@"64bit",
29813043 .cmov,
3044 .crc32,
29823045 .cx16,
29833046 .fxsr,
29843047 .macrofusion,
......@@ -3037,6 +3100,7 @@ pub const cpu = struct {
30373100 .features = featureSet(&[_]Feature{
30383101 .@"64bit",
30393102 .cmov,
3103 .crc32,
30403104 .cx16,
30413105 .false_deps_popcnt,
30423106 .fast_15bytenop,
......@@ -3065,6 +3129,7 @@ pub const cpu = struct {
30653129 .bmi,
30663130 .bmi2,
30673131 .cmov,
3132 .crc32,
30683133 .cx16,
30693134 .f16c,
30703135 .false_deps_lzcnt_tzcnt,
......@@ -3102,6 +3167,7 @@ pub const cpu = struct {
31023167 .bmi,
31033168 .bmi2,
31043169 .cmov,
3170 .crc32,
31053171 .cx16,
31063172 .false_deps_popcnt,
31073173 .fast_15bytenop,
......@@ -3156,13 +3222,16 @@ pub const cpu = struct {
31563222 .clflushopt,
31573223 .clzero,
31583224 .cmov,
3225 .crc32,
31593226 .cx16,
31603227 .f16c,
31613228 .fast_15bytenop,
31623229 .fast_bextr,
31633230 .fast_lzcnt,
31643231 .fast_movbe,
3232 .fast_scalar_fsqrt,
31653233 .fast_scalar_shift_masks,
3234 .fast_vector_fsqrt,
31663235 .fma,
31673236 .fsgsbase,
31683237 .fxsr,
......@@ -3202,13 +3271,16 @@ pub const cpu = struct {
32023271 .clwb,
32033272 .clzero,
32043273 .cmov,
3274 .crc32,
32053275 .cx16,
32063276 .f16c,
32073277 .fast_15bytenop,
32083278 .fast_bextr,
32093279 .fast_lzcnt,
32103280 .fast_movbe,
3281 .fast_scalar_fsqrt,
32113282 .fast_scalar_shift_masks,
3283 .fast_vector_fsqrt,
32123284 .fma,
32133285 .fsgsbase,
32143286 .fxsr,
......@@ -3249,14 +3321,17 @@ pub const cpu = struct {
32493321 .clwb,
32503322 .clzero,
32513323 .cmov,
3324 .crc32,
32523325 .cx16,
32533326 .f16c,
32543327 .fast_15bytenop,
32553328 .fast_bextr,
32563329 .fast_lzcnt,
32573330 .fast_movbe,
3331 .fast_scalar_fsqrt,
32583332 .fast_scalar_shift_masks,
32593333 .fast_variable_perlane_shuffle,
3334 .fast_vector_fsqrt,
32603335 .fma,
32613336 .fsgsbase,
32623337 .fsrm,
lib/std/zig/fmt.zig+13-1
......@@ -32,7 +32,18 @@ pub fn isValidId(bytes: []const u8) bool {
3232 else => return false,
3333 }
3434 }
35 return std.zig.Token.getKeyword(bytes) == null;
35 if (std.zig.Token.getKeyword(bytes) != null) return false;
36 if (bytes.len >= 2) switch (bytes[0]) {
37 'u', 'i' => {
38 for (bytes[1..]) |b| switch (b) {
39 '0'...'9' => continue,
40 else => break,
41 } else return false;
42 },
43 else => {},
44 };
45
46 return true;
3647}
3748
3849test "isValidId" {
......@@ -41,6 +52,7 @@ test "isValidId" {
4152 try std.testing.expect(!isValidId("a b c"));
4253 try std.testing.expect(!isValidId("3d"));
4354 try std.testing.expect(!isValidId("enum"));
55 try std.testing.expect(!isValidId("i386"));
4456}
4557
4658/// Print the string as escaped contents of a double quoted or single-quoted string.
lib/std/zig/system/x86.zig+3-3
......@@ -80,11 +80,11 @@ fn detectIntelProcessor(cpu: *Target.Cpu, family: u32, model: u32, brand_id: u32
8080 }
8181 switch (family) {
8282 3 => {
83 cpu.model = &Target.x86.cpu._i386;
83 cpu.model = &Target.x86.cpu.i386;
8484 return;
8585 },
8686 4 => {
87 cpu.model = &Target.x86.cpu._i486;
87 cpu.model = &Target.x86.cpu.i486;
8888 return;
8989 },
9090 5 => {
......@@ -229,7 +229,7 @@ fn detectAMDProcessor(cpu: *Target.Cpu, family: u32, model: u32) void {
229229 // This is very unscientific, and not necessarily correct.
230230 switch (family) {
231231 4 => {
232 cpu.model = &Target.x86.cpu._i486;
232 cpu.model = &Target.x86.cpu.i486;
233233 return;
234234 },
235235 5 => {
tools/update_cpu_features.zig+88-25
......@@ -50,6 +50,10 @@ const llvm_targets = [_]LlvmTarget{
5050 .td_name = "AArch64.td",
5151 .branch_quota = 2000,
5252 .feature_overrides = &.{
53 .{
54 .llvm_name = "v8a",
55 .extra_deps = &.{ "fp_armv8", "neon" },
56 },
5357 .{
5458 .llvm_name = "CONTEXTIDREL2",
5559 .zig_name = "contextidr_el2",
......@@ -57,19 +61,23 @@ const llvm_targets = [_]LlvmTarget{
5761 },
5862 .{
5963 .llvm_name = "neoversee1",
60 .zig_name = "neoverse_e1",
64 .flatten = true,
6165 },
6266 .{
6367 .llvm_name = "neoversen1",
64 .zig_name = "neoverse_n1",
68 .flatten = true,
6569 },
6670 .{
6771 .llvm_name = "neoversen2",
68 .zig_name = "neoverse_n2",
72 .flatten = true,
6973 },
7074 .{
7175 .llvm_name = "neoversev1",
72 .zig_name = "neoverse_v1",
76 .flatten = true,
77 },
78 .{
79 .llvm_name = "neoverse512tvb",
80 .flatten = true,
7381 },
7482 .{
7583 .llvm_name = "exynosm3",
......@@ -126,6 +134,10 @@ const llvm_targets = [_]LlvmTarget{
126134 .llvm_name = "a77",
127135 .flatten = true,
128136 },
137 .{
138 .llvm_name = "apple-a7",
139 .flatten = true,
140 },
129141 .{
130142 .llvm_name = "apple-a10",
131143 .flatten = true,
......@@ -134,10 +146,22 @@ const llvm_targets = [_]LlvmTarget{
134146 .llvm_name = "apple-a11",
135147 .flatten = true,
136148 },
149 .{
150 .llvm_name = "apple-a12",
151 .flatten = true,
152 },
153 .{
154 .llvm_name = "apple-a13",
155 .flatten = true,
156 },
137157 .{
138158 .llvm_name = "apple-a14",
139159 .flatten = true,
140160 },
161 .{
162 .llvm_name = "apple-a7-sysreg",
163 .flatten = true,
164 },
141165 .{
142166 .llvm_name = "carmel",
143167 .flatten = true,
......@@ -150,6 +174,10 @@ const llvm_targets = [_]LlvmTarget{
150174 .llvm_name = "cortex-x1",
151175 .flatten = true,
152176 },
177 .{
178 .llvm_name = "cortex-x2",
179 .flatten = true,
180 },
153181 .{
154182 .llvm_name = "falkor",
155183 .flatten = true,
......@@ -196,12 +224,9 @@ const llvm_targets = [_]LlvmTarget{
196224 .llvm_name = "tsv110",
197225 .flatten = true,
198226 },
199 },
200 .extra_features = &.{
201227 .{
202 .zig_name = "v8a",
203 .desc = "Support ARM v8a instructions",
204 .deps = &.{ "fp_armv8", "neon" },
228 .llvm_name = "ampere1",
229 .flatten = true,
205230 },
206231 },
207232 .extra_cpus = &.{
......@@ -309,6 +334,14 @@ const llvm_targets = [_]LlvmTarget{
309334 .llvm_name = "cortex-a78",
310335 .flatten = true,
311336 },
337 .{
338 .llvm_name = "cortex-a710",
339 .flatten = true,
340 },
341 .{
342 .llvm_name = "cortex-x1c",
343 .flatten = true,
344 },
312345 .{
313346 .llvm_name = "r5",
314347 .flatten = true,
......@@ -542,6 +575,10 @@ const llvm_targets = [_]LlvmTarget{
542575 .llvm_name = "armv8.7-a",
543576 .zig_name = "v8_7a",
544577 },
578 .{
579 .llvm_name = "armv8.8-a",
580 .zig_name = "v8_8a",
581 },
545582 .{
546583 .llvm_name = "armv8-a",
547584 .zig_name = "v8a",
......@@ -558,6 +595,22 @@ const llvm_targets = [_]LlvmTarget{
558595 .llvm_name = "armv8-r",
559596 .zig_name = "v8r",
560597 },
598 .{
599 .llvm_name = "armv9.1-a",
600 .zig_name = "v9_1a",
601 },
602 .{
603 .llvm_name = "armv9.2-a",
604 .zig_name = "v9_2a",
605 },
606 .{
607 .llvm_name = "armv9.3-a",
608 .zig_name = "v9_3a",
609 },
610 .{
611 .llvm_name = "armv9-a",
612 .zig_name = "v9a",
613 },
561614 .{
562615 .llvm_name = "v4t",
563616 .zig_name = "has_v4t",
......@@ -638,6 +691,26 @@ const llvm_targets = [_]LlvmTarget{
638691 .llvm_name = "v8.7a",
639692 .zig_name = "has_v8_7a",
640693 },
694 .{
695 .llvm_name = "v8.8a",
696 .zig_name = "has_v8_8a",
697 },
698 .{
699 .llvm_name = "v9a",
700 .zig_name = "has_v9a",
701 },
702 .{
703 .llvm_name = "v9.1a",
704 .zig_name = "has_v9_1a",
705 },
706 .{
707 .llvm_name = "v9.2a",
708 .zig_name = "has_v9_2a",
709 },
710 .{
711 .llvm_name = "v9.3a",
712 .zig_name = "has_v9_3a",
713 },
641714 },
642715 },
643716 .{
......@@ -695,6 +768,12 @@ const llvm_targets = [_]LlvmTarget{
695768 .zig_name = "riscv",
696769 .llvm_name = "RISCV",
697770 .td_name = "RISCV.td",
771 .feature_overrides = &.{
772 .{
773 .llvm_name = "sifive7",
774 .flatten = true,
775 },
776 },
698777 .extra_cpus = &.{
699778 .{
700779 .llvm_name = null,
......@@ -737,22 +816,6 @@ const llvm_targets = [_]LlvmTarget{
737816 .llvm_name = "64bit-mode",
738817 .omit = true,
739818 },
740 .{
741 .llvm_name = "i386",
742 .zig_name = "_i386",
743 },
744 .{
745 .llvm_name = "i486",
746 .zig_name = "_i486",
747 },
748 .{
749 .llvm_name = "i586",
750 .zig_name = "_i586",
751 },
752 .{
753 .llvm_name = "i686",
754 .zig_name = "_i686",
755 },
756819 .{
757820 .llvm_name = "lakemont",
758821 .extra_deps = &.{"soft_float"},