1#[expect(dead_code, reason = "stubs for rustc_target")]
6pub(super) enum Stability {
7 Stable,
8 Unstable(()),
9 InternalOnly { reason: &'static str, target_modifier: bool, hard_error: bool },
10}
11use Stability::*;
12
13type ImpliedFeatures = &'static [&'static str];
14static ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
15 ("aclass", Unstable(sym::arm_target_feature), &[]),
17 ("acquire-release", Unstable(sym::arm_target_feature), &[]),
18 ("aes", Unstable(sym::arm_target_feature), &["neon"]),
19 (
20 "atomics-32",
21 Stability::InternalOnly {
22 reason: "unsound because it changes the ABI of atomic operations",
23 target_modifier: true,
24 hard_error: false,
25 },
26 &[],
27 ),
28 ("bf16", Unstable(sym::arm_target_feature), &["neon"]),
29 ("crc", Unstable(sym::arm_target_feature), &[]),
30 ("d32", Unstable(sym::arm_target_feature), &[]),
31 ("dotprod", Unstable(sym::arm_target_feature), &["neon"]),
32 ("dsp", Unstable(sym::arm_target_feature), &[]),
33 ("fp-armv8", Unstable(sym::arm_target_feature), &["vfp4"]),
34 ("fp16", Unstable(sym::arm_target_feature), &["neon"]),
35 ("fp64", Unstable(sym::arm_target_feature), &[]),
36 ("fpregs", Unstable(sym::arm_target_feature), &[]),
37 ("i8mm", Unstable(sym::arm_target_feature), &["neon"]),
38 ("mclass", Unstable(sym::arm_target_feature), &[]),
39 ("mve", Unstable(sym::arm_target_feature), &["v8.1m.main", "dsp", "fpregs"]),
40 ("mve.fp", Unstable(sym::arm_target_feature), &["mve"]),
41 ("neon", Unstable(sym::arm_target_feature), &["vfp3"]),
42 ("rclass", Unstable(sym::arm_target_feature), &[]),
43 ("sha2", Unstable(sym::arm_target_feature), &["neon"]),
44 ("soft-float", Unstable(sym::arm_target_feature), &[]),
49 ("thumb-mode", Unstable(sym::arm_target_feature), &[]),
53 ("thumb2", Unstable(sym::arm_target_feature), &[]),
54 ("trustzone", Unstable(sym::arm_target_feature), &[]),
55 ("v5te", Unstable(sym::arm_target_feature), &[]),
56 ("v6", Unstable(sym::arm_target_feature), &["v5te"]),
57 ("v6k", Unstable(sym::arm_target_feature), &["v6"]),
58 ("v6m", Unstable(sym::arm_target_feature), &["v6"]),
59 ("v6t2", Unstable(sym::arm_target_feature), &["v6k", "v8m", "thumb2"]),
60 ("v7", Unstable(sym::arm_target_feature), &["v6t2"]),
61 ("v8", Unstable(sym::arm_target_feature), &["v7", "acquire-release"]),
62 ("v8.1m.main", Unstable(sym::arm_target_feature), &["v8m.main"]),
63 ("v8m", Unstable(sym::arm_target_feature), &["v6m"]),
64 ("v8m.main", Unstable(sym::arm_target_feature), &["v7"]),
65 ("vfp2", Unstable(sym::arm_target_feature), &["vfp2sp", "fp64"]),
66 ("vfp2sp", Unstable(sym::arm_target_feature), &["fpregs"]),
67 ("vfp3", Unstable(sym::arm_target_feature), &["vfp2", "d32"]),
68 ("vfp4", Unstable(sym::arm_target_feature), &["vfp3"]),
69 ("virtualization", Unstable(sym::arm_target_feature), &[]),
70 ];
72static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
73 ("aes", Stable, &["neon"]),
76 ("bf16", Stable, &[]),
78 ("bti", Stable, &[]),
80 ("crc", Stable, &[]),
82 ("cssc", Unstable(sym::aarch64_unstable_target_feature), &[]),
84 ("dit", Stable, &[]),
86 ("dotprod", Stable, &["neon"]),
88 ("dpb", Stable, &[]),
90 ("dpb2", Stable, &["dpb"]),
92 ("ecv", Unstable(sym::aarch64_unstable_target_feature), &[]),
94 ("f32mm", Stable, &["sve"]),
96 ("f64mm", Stable, &["sve"]),
98 ("faminmax", Unstable(sym::aarch64_unstable_target_feature), &[]),
100 ("fcma", Stable, &["neon"]),
102 ("fhm", Stable, &["fp16"]),
104 ("flagm", Stable, &[]),
106 ("flagm2", Unstable(sym::aarch64_unstable_target_feature), &[]),
108 (
110 "fp-armv8",
111 Stability::InternalOnly {
112 reason: "unsound because it changes the ABI of float types",
113 target_modifier: true,
114 hard_error: false,
115 },
116 &[],
117 ),
118 ("fp8", Unstable(sym::aarch64_unstable_target_feature), &["faminmax", "lut", "bf16"]),
120 ("fp8dot2", Unstable(sym::aarch64_unstable_target_feature), &["fp8dot4"]),
122 ("fp8dot4", Unstable(sym::aarch64_unstable_target_feature), &["fp8fma"]),
124 ("fp8fma", Unstable(sym::aarch64_unstable_target_feature), &["fp8"]),
126 ("fp16", Stable, &["neon"]),
129 ("frintts", Stable, &[]),
131 ("hbc", Unstable(sym::aarch64_unstable_target_feature), &[]),
133 ("i8mm", Stable, &[]),
135 ("jsconv", Stable, &["neon"]),
138 ("lor", Stable, &[]),
140 ("lse", Stable, &[]),
142 ("lse2", Unstable(sym::aarch64_unstable_target_feature), &[]),
144 ("lse128", Unstable(sym::aarch64_unstable_target_feature), &["lse"]),
146 ("lut", Unstable(sym::aarch64_unstable_target_feature), &[]),
148 ("mops", Unstable(sym::aarch64_unstable_target_feature), &[]),
150 ("mte", Stable, &[]),
152 ("neon", Stable, &[]),
154 ("outline-atomics", Unstable(sym::aarch64_unstable_target_feature), &[]),
158 ("paca", Stable, &[]),
160 ("pacg", Stable, &[]),
162 ("pan", Stable, &[]),
164 ("pauth-lr", Unstable(sym::aarch64_unstable_target_feature), &[]),
166 ("pmuv3", Stable, &[]),
168 ("rand", Stable, &[]),
170 ("ras", Stable, &[]),
172 ("rcpc", Stable, &[]),
174 ("rcpc2", Stable, &["rcpc"]),
176 ("rcpc3", Unstable(sym::aarch64_unstable_target_feature), &["rcpc2"]),
178 ("rdm", Stable, &["neon"]),
180 (
181 "reserve-x18",
182 InternalOnly {
183 reason: "use `-Zfixed-x18` compiler flag instead",
184 target_modifier: false,
187 hard_error: false,
188 },
189 &[],
190 ),
191 ("sb", Stable, &[]),
193 ("sha2", Stable, &["neon"]),
195 ("sha3", Stable, &["sha2"]),
197 ("sm4", Stable, &["neon"]),
199 ("sme", Unstable(sym::aarch64_unstable_target_feature), &["bf16"]),
201 ("sme-b16b16", Unstable(sym::aarch64_unstable_target_feature), &["bf16", "sme2", "sve-b16b16"]),
203 ("sme-f8f16", Unstable(sym::aarch64_unstable_target_feature), &["sme-f8f32"]),
205 ("sme-f8f32", Unstable(sym::aarch64_unstable_target_feature), &["sme2", "fp8"]),
207 ("sme-f16f16", Unstable(sym::aarch64_unstable_target_feature), &["sme2"]),
209 ("sme-f64f64", Unstable(sym::aarch64_unstable_target_feature), &["sme"]),
211 ("sme-fa64", Unstable(sym::aarch64_unstable_target_feature), &["sme", "sve2"]),
213 ("sme-i16i64", Unstable(sym::aarch64_unstable_target_feature), &["sme"]),
215 ("sme-lutv2", Unstable(sym::aarch64_unstable_target_feature), &[]),
217 ("sme2", Unstable(sym::aarch64_unstable_target_feature), &["sme"]),
219 ("sme2p1", Unstable(sym::aarch64_unstable_target_feature), &["sme2"]),
221 ("spe", Stable, &[]),
223 ("ssbs", Stable, &[]),
225 ("ssve-fp8dot2", Unstable(sym::aarch64_unstable_target_feature), &["ssve-fp8dot4"]),
227 ("ssve-fp8dot4", Unstable(sym::aarch64_unstable_target_feature), &["ssve-fp8fma"]),
229 ("ssve-fp8fma", Unstable(sym::aarch64_unstable_target_feature), &["sme2", "fp8"]),
231 ("sve", Stable, &["neon", "fp16"]),
239 ("sve-b16b16", Unstable(sym::aarch64_unstable_target_feature), &["bf16"]),
241 ("sve2", Stable, &["sve"]),
243 ("sve2-aes", Stable, &["sve2", "aes"]),
245 ("sve2-bitperm", Stable, &["sve2"]),
247 ("sve2-sha3", Stable, &["sve2", "sha3"]),
249 ("sve2-sm4", Stable, &["sve2", "sm4"]),
251 ("sve2p1", Unstable(sym::aarch64_unstable_target_feature), &["sve2"]),
253 ("tme", Stable, &[]),
255 (
256 "v8.1a",
257 Unstable(sym::aarch64_ver_target_feature),
258 &["crc", "lse", "rdm", "pan", "lor", "vh"],
259 ),
260 ("v8.2a", Unstable(sym::aarch64_ver_target_feature), &["v8.1a", "ras", "dpb"]),
261 (
262 "v8.3a",
263 Unstable(sym::aarch64_ver_target_feature),
264 &["v8.2a", "rcpc", "paca", "pacg", "jsconv"],
265 ),
266 ("v8.4a", Unstable(sym::aarch64_ver_target_feature), &["v8.3a", "dotprod", "dit", "flagm"]),
267 ("v8.5a", Unstable(sym::aarch64_ver_target_feature), &["v8.4a", "ssbs", "sb", "dpb2", "bti"]),
268 ("v8.6a", Unstable(sym::aarch64_ver_target_feature), &["v8.5a", "bf16", "i8mm"]),
269 ("v8.7a", Unstable(sym::aarch64_ver_target_feature), &["v8.6a", "wfxt"]),
270 ("v8.8a", Unstable(sym::aarch64_ver_target_feature), &["v8.7a", "hbc", "mops"]),
271 ("v8.9a", Unstable(sym::aarch64_ver_target_feature), &["v8.8a", "cssc"]),
272 ("v9.1a", Unstable(sym::aarch64_ver_target_feature), &["v9a", "v8.6a"]),
273 ("v9.2a", Unstable(sym::aarch64_ver_target_feature), &["v9.1a", "v8.7a"]),
274 ("v9.3a", Unstable(sym::aarch64_ver_target_feature), &["v9.2a", "v8.8a"]),
275 ("v9.4a", Unstable(sym::aarch64_ver_target_feature), &["v9.3a", "v8.9a"]),
276 ("v9.5a", Unstable(sym::aarch64_ver_target_feature), &["v9.4a"]),
277 ("v9a", Unstable(sym::aarch64_ver_target_feature), &["v8.5a"]),
278 ("vh", Stable, &[]),
280 ("wfxt", Unstable(sym::aarch64_unstable_target_feature), &[]),
282 ];
284static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
285 ("adx", Stable, &[]),
287 ("aes", Stable, &["sse2"]),
288 ("amx-avx512", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
289 ("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
290 ("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
291 ("amx-fp8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
292 ("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
293 ("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
294 ("amx-movrs", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
295 ("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
296 ("apxf", Unstable(sym::apx_target_feature), &[]),
297 ("avx", Stable, &["sse4.2"]),
298 ("avx2", Stable, &["avx"]),
299 (
300 "avx10.1",
301 Unstable(sym::avx10_target_feature),
302 &[
303 "avx512bf16",
304 "avx512bitalg",
305 "avx512bw",
306 "avx512cd",
307 "avx512dq",
308 "avx512f",
309 "avx512fp16",
310 "avx512ifma",
311 "avx512vbmi",
312 "avx512vbmi2",
313 "avx512vl",
314 "avx512vnni",
315 "avx512vpopcntdq",
316 ],
317 ),
318 (
319 "avx10.2",
320 Unstable(sym::avx10_target_feature),
321 &["avx10.1", "avxvnni", "avxvnniint8", "avxvnniint16"],
322 ),
323 ("avx512bf16", Stable, &["avx512bw"]),
324 ("avx512bitalg", Stable, &["avx512bw"]),
325 ("avx512bw", Stable, &["avx512f"]),
326 ("avx512cd", Stable, &["avx512f"]),
327 ("avx512dq", Stable, &["avx512f"]),
328 ("avx512f", Stable, &["avx2", "fma", "f16c"]),
329 ("avx512fp16", Stable, &["avx512bw"]),
330 ("avx512ifma", Stable, &["avx512f"]),
331 ("avx512vbmi", Stable, &["avx512bw"]),
332 ("avx512vbmi2", Stable, &["avx512bw"]),
333 ("avx512vl", Stable, &["avx512f"]),
334 ("avx512vnni", Stable, &["avx512f"]),
335 ("avx512vp2intersect", Stable, &["avx512f"]),
336 ("avx512vpopcntdq", Stable, &["avx512f"]),
337 ("avxifma", Stable, &["avx2"]),
338 ("avxneconvert", Stable, &["avx2"]),
339 ("avxvnni", Stable, &["avx2"]),
340 ("avxvnniint8", Stable, &["avx2"]),
341 ("avxvnniint16", Stable, &["avx2"]),
342 ("bmi1", Stable, &[]),
343 ("bmi2", Stable, &[]),
344 ("clflushopt", Unstable(sym::clflushopt_target_feature), &[]),
345 ("cmpxchg16b", Stable, &[]),
346 ("ermsb", Unstable(sym::ermsb_target_feature), &[]),
347 ("f16c", Stable, &["avx"]),
348 ("fma", Stable, &["avx"]),
349 ("fma4", Unstable(sym::fma4_target_feature), &["avx", "sse4a"]),
350 ("fxsr", Stable, &[]),
351 ("gfni", Stable, &["sse2"]),
352 ("kl", Stable, &["sse2"]),
353 ("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
354 ("lzcnt", Stable, &[]),
355 ("movbe", Stable, &[]),
356 ("movdir64b", Unstable(sym::movdir64b_target_feature), &[]),
357 ("movdiri", Unstable(sym::movdiri_target_feature), &[]),
358 ("movrs", Unstable(sym::movrs_target_feature), &[]),
359 ("pclmulqdq", Stable, &["sse2"]),
360 ("popcnt", Stable, &[]),
361 ("prfchw", Unstable(sym::prfchw_target_feature), &[]),
362 ("rdrand", Stable, &[]),
363 ("rdseed", Stable, &[]),
364 (
365 "retpoline-external-thunk",
366 Stability::InternalOnly {
367 reason: "use `-Zretpoline-external-thunk` compiler flag instead",
368 target_modifier: false,
371 hard_error: false,
372 },
373 &[],
374 ),
375 (
376 "retpoline-indirect-branches",
377 Stability::InternalOnly {
378 reason: "use `-Zretpoline` compiler flag instead",
379 target_modifier: false,
382 hard_error: false,
383 },
384 &[],
385 ),
386 (
387 "retpoline-indirect-calls",
388 Stability::InternalOnly {
389 reason: "use `-Zretpoline` compiler flag instead",
390 target_modifier: false,
393 hard_error: false,
394 },
395 &[],
396 ),
397 ("rtm", Unstable(sym::rtm_target_feature), &[]),
398 ("sha", Stable, &["sse2"]),
399 ("sha512", Stable, &["avx2"]),
400 ("sm3", Stable, &["avx"]),
401 ("sm4", Stable, &["avx2"]),
402 (
403 "soft-float",
404 Stability::InternalOnly {
405 reason: "use a soft-float target instead",
406 target_modifier: true,
407 hard_error: false,
408 },
409 &[],
410 ),
411 ("sse", Stable, &[]),
412 ("sse2", Stable, &["sse"]),
413 ("sse3", Stable, &["sse2"]),
414 ("sse4.1", Stable, &["ssse3"]),
415 ("sse4.2", Stable, &["sse4.1"]),
416 ("sse4a", Stable, &["sse3"]),
417 ("ssse3", Stable, &["sse3"]),
418 ("tbm", Stable, &[]),
419 ("vaes", Stable, &["avx2", "aes"]),
420 ("vpclmulqdq", Stable, &["avx", "pclmulqdq"]),
421 ("widekl", Stable, &["kl"]),
422 ("x87", Unstable(sym::x87_target_feature), &[]),
423 ("xop", Unstable(sym::xop_target_feature), &["fma4", "avx", "sse4a"]),
424 ("xsave", Stable, &[]),
425 ("xsavec", Stable, &["xsave"]),
426 ("xsaveopt", Stable, &["xsave"]),
427 ("xsaves", Stable, &["xsave"]),
428 ];
430const HEXAGON_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
431 ("audio", Unstable(sym::hexagon_target_feature), &[]),
433 ("hvx", Unstable(sym::hexagon_target_feature), &[]),
434 ("hvx-ieee-fp", Unstable(sym::hexagon_target_feature), &["hvx"]),
435 ("hvx-length64b", Unstable(sym::hexagon_target_feature), &["hvx"]),
436 ("hvx-length128b", Unstable(sym::hexagon_target_feature), &["hvx"]),
437 ("hvx-qfloat", Unstable(sym::hexagon_target_feature), &["hvx"]),
438 ("hvxv60", Unstable(sym::hexagon_target_feature), &["hvx"]),
439 ("hvxv62", Unstable(sym::hexagon_target_feature), &["hvxv60"]),
440 ("hvxv65", Unstable(sym::hexagon_target_feature), &["hvxv62"]),
441 ("hvxv66", Unstable(sym::hexagon_target_feature), &["hvxv65", "zreg"]),
442 ("hvxv67", Unstable(sym::hexagon_target_feature), &["hvxv66"]),
443 ("hvxv68", Unstable(sym::hexagon_target_feature), &["hvxv67"]),
444 ("hvxv69", Unstable(sym::hexagon_target_feature), &["hvxv68"]),
445 ("hvxv71", Unstable(sym::hexagon_target_feature), &["hvxv69"]),
446 ("hvxv73", Unstable(sym::hexagon_target_feature), &["hvxv71"]),
447 ("hvxv75", Unstable(sym::hexagon_target_feature), &["hvxv73"]),
448 ("hvxv79", Unstable(sym::hexagon_target_feature), &["hvxv75"]),
449 ("v60", Unstable(sym::hexagon_target_feature), &[]),
450 ("v62", Unstable(sym::hexagon_target_feature), &["v60"]),
451 ("v65", Unstable(sym::hexagon_target_feature), &["v62"]),
452 ("v66", Unstable(sym::hexagon_target_feature), &["v65"]),
453 ("v67", Unstable(sym::hexagon_target_feature), &["v66"]),
454 ("v68", Unstable(sym::hexagon_target_feature), &["v67"]),
455 ("v69", Unstable(sym::hexagon_target_feature), &["v68"]),
456 ("v71", Unstable(sym::hexagon_target_feature), &["v69"]),
457 ("v73", Unstable(sym::hexagon_target_feature), &["v71"]),
458 ("v75", Unstable(sym::hexagon_target_feature), &["v73"]),
459 ("v79", Unstable(sym::hexagon_target_feature), &["v75"]),
460 ("zreg", Unstable(sym::hexagon_target_feature), &[]),
461 ];
463static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
464 ("altivec", Unstable(sym::powerpc_target_feature), &[]),
468 (
469 "hard-float",
470 InternalOnly {
471 reason: "unsupported ABI-configuration feature",
472 target_modifier: true,
473 hard_error: false,
474 },
475 &[],
476 ),
477 ("msync", Unstable(sym::powerpc_target_feature), &[]),
478 ("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
479 ("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),
480 ("power8-crypto", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
481 ("power8-vector", Unstable(sym::powerpc_target_feature), &["vsx", "power8-altivec"]),
482 ("power9-altivec", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
483 ("power9-vector", Unstable(sym::powerpc_target_feature), &["power8-vector", "power9-altivec"]),
484 ("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
485 ("quadword-atomics", Unstable(sym::powerpc_target_feature), &[]),
486 (
487 "spe",
488 InternalOnly {
489 reason: "unsupported ABI-configuration feature",
490 target_modifier: true,
491 hard_error: false,
492 },
493 &[],
494 ),
495 ("vsx", Unstable(sym::powerpc_target_feature), &["altivec"]),
496 ];
498const MIPS_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
499 ("fp64", Unstable(sym::mips_target_feature), &[]),
501 ("msa", Unstable(sym::mips_target_feature), &[]),
504 ("virt", Unstable(sym::mips_target_feature), &[]),
505 ];
507const NVPTX_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
508 ("sm_70", Unstable(sym::nvptx_target_feature), &[]),
510 ("sm_72", Unstable(sym::nvptx_target_feature), &["sm_70"]),
511 ("sm_75", Unstable(sym::nvptx_target_feature), &["sm_72"]),
512 ("sm_80", Unstable(sym::nvptx_target_feature), &["sm_75"]),
513 ("sm_86", Unstable(sym::nvptx_target_feature), &["sm_80"]),
514 ("sm_87", Unstable(sym::nvptx_target_feature), &["sm_86"]),
515 ("sm_89", Unstable(sym::nvptx_target_feature), &["sm_87"]),
516 ("sm_90", Unstable(sym::nvptx_target_feature), &["sm_89"]),
517 ("sm_90a", Unstable(sym::nvptx_target_feature), &["sm_90"]),
518 ("sm_100", Unstable(sym::nvptx_target_feature), &["sm_90"]),
521 ("sm_100a", Unstable(sym::nvptx_target_feature), &["sm_100"]),
522 ("sm_101", Unstable(sym::nvptx_target_feature), &["sm_100"]),
523 ("sm_101a", Unstable(sym::nvptx_target_feature), &["sm_101"]),
524 ("sm_120", Unstable(sym::nvptx_target_feature), &["sm_101"]),
525 ("sm_120a", Unstable(sym::nvptx_target_feature), &["sm_120"]),
526 ("ptx70", Unstable(sym::nvptx_target_feature), &[]),
529 ("ptx71", Unstable(sym::nvptx_target_feature), &["ptx70"]),
530 ("ptx72", Unstable(sym::nvptx_target_feature), &["ptx71"]),
531 ("ptx73", Unstable(sym::nvptx_target_feature), &["ptx72"]),
532 ("ptx74", Unstable(sym::nvptx_target_feature), &["ptx73"]),
533 ("ptx75", Unstable(sym::nvptx_target_feature), &["ptx74"]),
534 ("ptx76", Unstable(sym::nvptx_target_feature), &["ptx75"]),
535 ("ptx77", Unstable(sym::nvptx_target_feature), &["ptx76"]),
536 ("ptx78", Unstable(sym::nvptx_target_feature), &["ptx77"]),
537 ("ptx80", Unstable(sym::nvptx_target_feature), &["ptx78"]),
538 ("ptx81", Unstable(sym::nvptx_target_feature), &["ptx80"]),
539 ("ptx82", Unstable(sym::nvptx_target_feature), &["ptx81"]),
540 ("ptx83", Unstable(sym::nvptx_target_feature), &["ptx82"]),
541 ("ptx84", Unstable(sym::nvptx_target_feature), &["ptx83"]),
542 ("ptx85", Unstable(sym::nvptx_target_feature), &["ptx84"]),
543 ("ptx86", Unstable(sym::nvptx_target_feature), &["ptx85"]),
544 ("ptx87", Unstable(sym::nvptx_target_feature), &["ptx86"]),
545 ];
547static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
548 ("a", Stable, &["zaamo", "zalrsc"]),
550 ("b", Stable, &["zba", "zbb", "zbs"]),
551 ("c", Stable, &["zca"]),
552 ("d", Stable, &["f"]),
553 ("e", Unstable(sym::riscv_target_feature), &[]), ("f", Stable, &["zicsr"]),
555 (
556 "forced-atomics",
557 Stability::InternalOnly {
558 reason: "unsound because it changes the ABI of atomic operations",
559 target_modifier: true,
560 hard_error: false,
561 },
562 &[],
563 ),
564 ("m", Stable, &["zmmul"]),
572 ("relax", Unstable(sym::riscv_target_feature), &[]),
573 (
574 "rva23u64",
575 Unstable(sym::riscv_target_feature),
576 &[
577 "m",
578 "a",
579 "f",
580 "d",
581 "c",
582 "b",
583 "v",
584 "zicsr",
585 "zicntr",
586 "zihpm",
587 "ziccif",
588 "ziccrse",
589 "ziccamoa",
590 "zicclsm",
591 "zic64b",
592 "za64rs",
593 "zihintpause",
594 "zba",
595 "zbb",
596 "zbs",
597 "zicbom",
598 "zicbop",
599 "zicboz",
600 "zfhmin",
601 "zkt",
602 "zvfhmin",
603 "zvbb",
604 "zvkt",
605 "zihintntl",
606 "zicond",
607 "zimop",
608 "zcmop",
609 "zcb",
610 "zfa",
611 "zawrs",
612 "supm",
613 ],
614 ),
615 ("supm", Unstable(sym::riscv_target_feature), &[]),
616 ("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]),
617 ("unaligned-vector-mem", Unstable(sym::riscv_target_feature), &[]),
618 ("v", Unstable(sym::riscv_target_feature), &["zvl128b", "zve64d"]),
619 ("za64rs", Stable, &["za128rs"]), ("za128rs", Stable, &[]),
621 ("zaamo", Stable, &[]),
622 ("zabha", Stable, &["zaamo"]),
623 ("zacas", Stable, &["zaamo"]),
624 ("zalrsc", Stable, &[]),
625 ("zama16b", Stable, &[]),
626 ("zawrs", Stable, &[]),
627 ("zba", Stable, &[]),
628 ("zbb", Stable, &[]),
629 ("zbc", Stable, &["zbkc"]), ("zbkb", Stable, &[]),
631 ("zbkc", Stable, &[]),
632 ("zbkx", Stable, &[]),
633 ("zbs", Stable, &[]),
634 ("zca", Stable, &[]),
635 ("zcb", Stable, &["zca"]),
636 ("zcmop", Stable, &["zca"]),
637 ("zdinx", Unstable(sym::riscv_target_feature), &["zfinx"]),
638 ("zfa", Unstable(sym::riscv_target_feature), &["f"]),
639 ("zfbfmin", Unstable(sym::riscv_target_feature), &["f"]), ("zfh", Unstable(sym::riscv_target_feature), &["zfhmin"]),
641 ("zfhmin", Unstable(sym::riscv_target_feature), &["f"]),
642 ("zfinx", Unstable(sym::riscv_target_feature), &["zicsr"]),
643 ("zhinx", Unstable(sym::riscv_target_feature), &["zhinxmin"]),
644 ("zhinxmin", Unstable(sym::riscv_target_feature), &["zfinx"]),
645 ("zic64b", Stable, &[]),
646 ("zicbom", Stable, &[]),
647 ("zicbop", Stable, &[]),
648 ("zicboz", Stable, &[]),
649 ("ziccamoa", Stable, &[]),
650 ("ziccif", Stable, &[]),
651 ("zicclsm", Stable, &[]),
652 ("ziccrse", Stable, &[]),
653 ("zicntr", Stable, &["zicsr"]),
654 ("zicond", Stable, &[]),
655 ("zicsr", Stable, &[]),
656 ("zifencei", Stable, &[]),
657 ("zihintntl", Stable, &[]),
658 ("zihintpause", Stable, &[]),
659 ("zihpm", Stable, &["zicsr"]),
660 ("zimop", Stable, &[]),
661 ("zk", Stable, &["zkn", "zkr", "zkt"]),
662 ("zkn", Stable, &["zbkb", "zbkc", "zbkx", "zkne", "zknd", "zknh"]),
663 ("zknd", Stable, &["zkne_or_zknd"]),
664 ("zkne", Stable, &["zkne_or_zknd"]),
665 ("zkne_or_zknd", Unstable(sym::riscv_target_feature), &[]), ("zknh", Stable, &[]),
667 ("zkr", Stable, &[]),
668 ("zks", Stable, &["zbkb", "zbkc", "zbkx", "zksed", "zksh"]),
669 ("zksed", Stable, &[]),
670 ("zksh", Stable, &[]),
671 ("zkt", Stable, &[]),
672 ("zmmul", Unstable(sym::riscv_target_feature), &[]),
673 ("ztso", Stable, &[]),
674 ("zvbb", Unstable(sym::riscv_target_feature), &["zvkb"]), ("zvbc", Unstable(sym::riscv_target_feature), &["zve64x"]),
676 ("zve32f", Unstable(sym::riscv_target_feature), &["zve32x", "f"]),
677 ("zve32x", Unstable(sym::riscv_target_feature), &["zvl32b", "zicsr"]),
678 ("zve64d", Unstable(sym::riscv_target_feature), &["zve64f", "d"]),
679 ("zve64f", Unstable(sym::riscv_target_feature), &["zve32f", "zve64x"]),
680 ("zve64x", Unstable(sym::riscv_target_feature), &["zve32x", "zvl64b"]),
681 ("zvfbfmin", Unstable(sym::riscv_target_feature), &["zve32f"]),
682 ("zvfbfwma", Unstable(sym::riscv_target_feature), &["zfbfmin", "zvfbfmin"]),
683 ("zvfh", Unstable(sym::riscv_target_feature), &["zvfhmin", "zve32f", "zfhmin"]), ("zvfhmin", Unstable(sym::riscv_target_feature), &["zve32f"]),
685 ("zvkb", Unstable(sym::riscv_target_feature), &["zve32x"]),
686 ("zvkg", Unstable(sym::riscv_target_feature), &["zve32x"]),
687 ("zvkn", Unstable(sym::riscv_target_feature), &["zvkned", "zvknhb", "zvkb", "zvkt"]),
688 ("zvknc", Unstable(sym::riscv_target_feature), &["zvkn", "zvbc"]),
689 ("zvkned", Unstable(sym::riscv_target_feature), &["zve32x"]),
690 ("zvkng", Unstable(sym::riscv_target_feature), &["zvkn", "zvkg"]),
691 ("zvknha", Unstable(sym::riscv_target_feature), &["zve32x"]),
692 ("zvknhb", Unstable(sym::riscv_target_feature), &["zvknha", "zve64x"]), ("zvks", Unstable(sym::riscv_target_feature), &["zvksed", "zvksh", "zvkb", "zvkt"]),
694 ("zvksc", Unstable(sym::riscv_target_feature), &["zvks", "zvbc"]),
695 ("zvksed", Unstable(sym::riscv_target_feature), &["zve32x"]),
696 ("zvksg", Unstable(sym::riscv_target_feature), &["zvks", "zvkg"]),
697 ("zvksh", Unstable(sym::riscv_target_feature), &["zve32x"]),
698 ("zvkt", Unstable(sym::riscv_target_feature), &[]),
699 ("zvl32b", Unstable(sym::riscv_target_feature), &[]),
700 ("zvl64b", Unstable(sym::riscv_target_feature), &["zvl32b"]),
701 ("zvl128b", Unstable(sym::riscv_target_feature), &["zvl64b"]),
702 ("zvl256b", Unstable(sym::riscv_target_feature), &["zvl128b"]),
703 ("zvl512b", Unstable(sym::riscv_target_feature), &["zvl256b"]),
704 ("zvl1024b", Unstable(sym::riscv_target_feature), &["zvl512b"]),
705 ("zvl2048b", Unstable(sym::riscv_target_feature), &["zvl1024b"]),
706 ("zvl4096b", Unstable(sym::riscv_target_feature), &["zvl2048b"]),
707 ("zvl8192b", Unstable(sym::riscv_target_feature), &["zvl4096b"]),
708 ("zvl16384b", Unstable(sym::riscv_target_feature), &["zvl8192b"]),
709 ("zvl32768b", Unstable(sym::riscv_target_feature), &["zvl16384b"]),
710 ("zvl65536b", Unstable(sym::riscv_target_feature), &["zvl32768b"]),
711 ];
713static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
714 ("atomics", Unstable(sym::wasm_target_feature), &[]),
716 ("bulk-memory", Stable, &[]),
717 ("exception-handling", Unstable(sym::wasm_target_feature), &[]),
718 ("extended-const", Stable, &[]),
719 ("gc", Unstable(sym::wasm_target_feature), &["reference-types"]),
720 ("multivalue", Stable, &[]),
721 ("mutable-globals", Stable, &[]),
722 ("nontrapping-fptoint", Stable, &[]),
723 ("reference-types", Stable, &[]),
724 ("relaxed-simd", Stable, &["simd128"]),
725 ("sign-ext", Stable, &[]),
726 ("simd128", Stable, &[]),
727 ("tail-call", Stable, &[]),
728 ("wide-arithmetic", Stable, &[]),
729 ];
731const BPF_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
732 ("alu32", Unstable(sym::bpf_target_feature), &[]),
733 ("allows-misaligned-mem-access", Unstable(sym::bpf_target_feature), &[]),
734];
735static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
736 ("2e3", Unstable(sym::csky_target_feature), &["e2"]),
738 ("3e3r1", Unstable(sym::csky_target_feature), &[]),
739 ("3e3r2", Unstable(sym::csky_target_feature), &["3e3r1", "doloop"]),
740 ("3e3r3", Unstable(sym::csky_target_feature), &["doloop"]),
741 ("3e7", Unstable(sym::csky_target_feature), &["2e3"]),
742 ("7e10", Unstable(sym::csky_target_feature), &["3e7"]),
743 ("10e60", Unstable(sym::csky_target_feature), &["7e10"]),
744 ("cache", Unstable(sym::csky_target_feature), &[]),
745 ("doloop", Unstable(sym::csky_target_feature), &[]),
746 ("dsp1e2", Unstable(sym::csky_target_feature), &[]),
747 ("dspe60", Unstable(sym::csky_target_feature), &[]),
748 ("e1", Unstable(sym::csky_target_feature), &["elrw"]),
749 ("e2", Unstable(sym::csky_target_feature), &["e2"]),
750 ("edsp", Unstable(sym::csky_target_feature), &[]),
751 ("elrw", Unstable(sym::csky_target_feature), &[]),
752 ("float1e2", Unstable(sym::csky_target_feature), &[]),
753 ("float1e3", Unstable(sym::csky_target_feature), &[]),
754 ("float3e4", Unstable(sym::csky_target_feature), &[]),
755 ("float7e60", Unstable(sym::csky_target_feature), &[]),
756 ("floate1", Unstable(sym::csky_target_feature), &[]),
757 ("hard-tp", Unstable(sym::csky_target_feature), &[]),
758 ("high-registers", Unstable(sym::csky_target_feature), &[]),
759 ("hwdiv", Unstable(sym::csky_target_feature), &[]),
760 ("mp", Unstable(sym::csky_target_feature), &["2e3"]),
761 ("mp1e2", Unstable(sym::csky_target_feature), &["3e7"]),
762 ("nvic", Unstable(sym::csky_target_feature), &[]),
763 ("trust", Unstable(sym::csky_target_feature), &[]),
764 ("vdsp2e60f", Unstable(sym::csky_target_feature), &[]),
765 ("vdspv1", Unstable(sym::csky_target_feature), &[]),
766 ("vdspv2", Unstable(sym::csky_target_feature), &[]),
767 ("fdivdu", Unstable(sym::csky_target_feature), &[]),
771 ("fpuv2_df", Unstable(sym::csky_target_feature), &[]),
772 ("fpuv2_sf", Unstable(sym::csky_target_feature), &[]),
773 ("fpuv3_df", Unstable(sym::csky_target_feature), &[]),
774 ("fpuv3_hf", Unstable(sym::csky_target_feature), &[]),
775 ("fpuv3_hi", Unstable(sym::csky_target_feature), &[]),
776 ("fpuv3_sf", Unstable(sym::csky_target_feature), &[]),
777 ("hard-float", Unstable(sym::csky_target_feature), &[]),
778 ("hard-float-abi", Unstable(sym::csky_target_feature), &[]),
779 ];
781static LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
782 ("32s", Unstable(sym::loongarch_target_feature), &[]),
784 ("d", Stable, &["f"]),
785 ("div32", Stable, &[]),
786 ("f", Stable, &[]),
787 ("frecipe", Stable, &[]),
788 ("lam-bh", Stable, &[]),
789 ("lamcas", Stable, &[]),
790 ("lasx", Stable, &["lsx"]),
791 ("lbt", Stable, &[]),
792 ("ld-seq-sa", Stable, &[]),
793 ("lsx", Stable, &["d"]),
794 ("lvz", Stable, &[]),
795 ("relax", Unstable(sym::loongarch_target_feature), &[]),
796 ("scq", Stable, &[]),
797 ("ual", Unstable(sym::loongarch_target_feature), &[]),
798 ];
800const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
801 ("backchain", Unstable(sym::s390x_target_feature), &[]),
804 ("concurrent-functions", Unstable(sym::s390x_target_feature), &[]),
805 ("deflate-conversion", Unstable(sym::s390x_target_feature), &[]),
806 ("enhanced-sort", Unstable(sym::s390x_target_feature), &[]),
807 ("guarded-storage", Unstable(sym::s390x_target_feature), &[]),
808 ("high-word", Unstable(sym::s390x_target_feature), &[]),
809 ("message-security-assist-extension3", Unstable(sym::s390x_target_feature), &[]),
811 ("message-security-assist-extension4", Unstable(sym::s390x_target_feature), &[]),
812 ("message-security-assist-extension5", Unstable(sym::s390x_target_feature), &[]),
813 (
814 "message-security-assist-extension8",
815 Unstable(sym::s390x_target_feature),
816 &["message-security-assist-extension3"],
817 ),
818 (
819 "message-security-assist-extension9",
820 Unstable(sym::s390x_target_feature),
821 &["message-security-assist-extension3", "message-security-assist-extension4"],
822 ),
823 ("message-security-assist-extension12", Unstable(sym::s390x_target_feature), &[]),
824 ("miscellaneous-extensions-2", Stable, &[]),
825 ("miscellaneous-extensions-3", Stable, &[]),
826 ("miscellaneous-extensions-4", Stable, &[]),
827 ("nnp-assist", Stable, &["vector"]),
828 (
829 "soft-float",
830 InternalOnly {
831 reason: "unsupported ABI-configuration feature",
832 target_modifier: true,
833 hard_error: false,
834 },
835 &[],
836 ),
837 ("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
838 ("vector", Stable, &[]),
839 ("vector-enhancements-1", Stable, &["vector"]),
840 ("vector-enhancements-2", Stable, &["vector-enhancements-1"]),
841 ("vector-enhancements-3", Stable, &["vector-enhancements-2"]),
842 ("vector-packed-decimal", Stable, &["vector"]),
843 ("vector-packed-decimal-enhancement", Stable, &["vector-packed-decimal"]),
844 ("vector-packed-decimal-enhancement-2", Stable, &["vector-packed-decimal-enhancement"]),
845 ("vector-packed-decimal-enhancement-3", Stable, &["vector-packed-decimal-enhancement-2"]),
846 ];
848const SPARC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
849 ("leoncasa", Unstable(sym::sparc_target_feature), &[]),
851 (
852 "soft-float",
853 InternalOnly {
854 reason: "unsupported ABI-configuration feature",
855 target_modifier: true,
856 hard_error: false,
857 },
858 &[],
859 ),
860 ("v8plus", Unstable(sym::sparc_target_feature), &[]),
861 ("v9", Unstable(sym::sparc_target_feature), &[]),
864 ];
866static M68K_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
867 ("isa-68000", Unstable(sym::m68k_target_feature), &[]),
869 ("isa-68010", Unstable(sym::m68k_target_feature), &["isa-68000"]),
870 ("isa-68020", Unstable(sym::m68k_target_feature), &["isa-68010"]),
871 ("isa-68030", Unstable(sym::m68k_target_feature), &["isa-68020"]),
872 ("isa-68040", Unstable(sym::m68k_target_feature), &["isa-68030", "isa-68882"]),
873 ("isa-68060", Unstable(sym::m68k_target_feature), &["isa-68040"]),
874 ("isa-68881", Unstable(sym::m68k_target_feature), &[]),
876 ("isa-68882", Unstable(sym::m68k_target_feature), &["isa-68881"]),
877 ];
879static AVR_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
880 ("addsubiw", Unstable(sym::avr_target_feature), &[]),
882 ("break", Unstable(sym::avr_target_feature), &[]),
883 ("eijmpcall", Unstable(sym::avr_target_feature), &[]),
884 ("elpm", Unstable(sym::avr_target_feature), &[]),
885 ("elpmx", Unstable(sym::avr_target_feature), &[]),
886 ("ijmpcall", Unstable(sym::avr_target_feature), &[]),
887 ("jmpcall", Unstable(sym::avr_target_feature), &[]),
888 ("lowbytefirst", Unstable(sym::avr_target_feature), &[]),
889 ("lpm", Unstable(sym::avr_target_feature), &[]),
890 ("lpmx", Unstable(sym::avr_target_feature), &[]),
891 ("movw", Unstable(sym::avr_target_feature), &[]),
892 ("mul", Unstable(sym::avr_target_feature), &[]),
893 ("rmw", Unstable(sym::avr_target_feature), &[]),
894 ("spm", Unstable(sym::avr_target_feature), &[]),
895 ("spmx", Unstable(sym::avr_target_feature), &[]),
896 (
897 "sram",
898 InternalOnly {
899 reason: "devices that have no SRAM are unsupported",
900 target_modifier: false,
902 hard_error: false,
903 },
904 &[],
905 ),
906 ("tinyencoding", Unstable(sym::avr_target_feature), &[]),
907 ];
909const XTENSA_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
910 ("bool", Unstable(sym::xtensa_target_feature), &[]),
911 ("fp", Unstable(sym::xtensa_target_feature), &["bool", "coprocessor"]),
912 ("coprocessor", Unstable(sym::xtensa_target_feature), &[]),
913 ("highpriinterrupts", Unstable(sym::xtensa_target_feature), &["interrupt"]),
914 ("interrupt", Unstable(sym::xtensa_target_feature), &["exception"]),
915 (
916 "windowed",
917 InternalOnly {
918 reason: "windowed changes the Xtensa calling convention",
919 target_modifier: false,
921 hard_error: false,
922 },
923 &["exception"],
924 ),
925 ("loop", Unstable(sym::xtensa_target_feature), &[]),
926 ("sext", Unstable(sym::xtensa_target_feature), &[]),
927 ("nsa", Unstable(sym::xtensa_target_feature), &[]),
928 ("mul32", Unstable(sym::xtensa_target_feature), &[]),
929 ("mul32high", Unstable(sym::xtensa_target_feature), &["mul32"]),
930 ("div32", Unstable(sym::xtensa_target_feature), &[]),
931 ("mac16", Unstable(sym::xtensa_target_feature), &[]),
932 ("s32c1i", Unstable(sym::xtensa_target_feature), &[]),
933 ("threadptr", Unstable(sym::xtensa_target_feature), &[]),
934 ("extendedl32r", Unstable(sym::xtensa_target_feature), &[]),
935 ("debug", Unstable(sym::xtensa_target_feature), &["exception"]),
936 ("exception", Unstable(sym::xtensa_target_feature), &[]),
937 ("rvector", Unstable(sym::xtensa_target_feature), &["exception"]),
938 ("prid", Unstable(sym::xtensa_target_feature), &[]),
939 ("regprotect", Unstable(sym::xtensa_target_feature), &[]),
940 ("miscsr", Unstable(sym::xtensa_target_feature), &[]),
941];
942pub(super) const TARGET_FEATURE_IMPLICATIONS_RAW: &[&[(&str, Stability, ImpliedFeatures)]] = &[
943 ARM_FEATURES,
944 AARCH64_FEATURES,
945 X86_FEATURES,
946 HEXAGON_FEATURES,
947 POWERPC_FEATURES,
948 MIPS_FEATURES,
949 NVPTX_FEATURES,
950 RISCV_FEATURES,
951 WASM_FEATURES,
952 BPF_FEATURES,
953 CSKY_FEATURES,
954 LOONGARCH_FEATURES,
955 IBMZ_FEATURES,
956 SPARC_FEATURES,
957 M68K_FEATURES,
958 AVR_FEATURES,
959 XTENSA_FEATURES,
960];
961
962#[expect(non_upper_case_globals, reason = "stubs for rustc_target")]
963mod sym {
964 pub(in super::super) const aarch64_unstable_target_feature: () = ();
965 pub(in super::super) const aarch64_ver_target_feature: () = ();
966 pub(in super::super) const apx_target_feature: () = ();
967 pub(in super::super) const arm_target_feature: () = ();
968 pub(in super::super) const avr_target_feature: () = ();
969 pub(in super::super) const avx10_target_feature: () = ();
970 pub(in super::super) const bpf_target_feature: () = ();
971 pub(in super::super) const clflushopt_target_feature: () = ();
972 pub(in super::super) const csky_target_feature: () = ();
973 pub(in super::super) const ermsb_target_feature: () = ();
974 pub(in super::super) const fma4_target_feature: () = ();
975 pub(in super::super) const hexagon_target_feature: () = ();
976 pub(in super::super) const lahfsahf_target_feature: () = ();
977 pub(in super::super) const loongarch_target_feature: () = ();
978 pub(in super::super) const m68k_target_feature: () = ();
979 pub(in super::super) const mips_target_feature: () = ();
980 pub(in super::super) const movdir64b_target_feature: () = ();
981 pub(in super::super) const movdiri_target_feature: () = ();
982 pub(in super::super) const movrs_target_feature: () = ();
983 pub(in super::super) const nvptx_target_feature: () = ();
984 pub(in super::super) const powerpc_target_feature: () = ();
985 pub(in super::super) const prfchw_target_feature: () = ();
986 pub(in super::super) const riscv_target_feature: () = ();
987 pub(in super::super) const rtm_target_feature: () = ();
988 pub(in super::super) const s390x_target_feature: () = ();
989 pub(in super::super) const sparc_target_feature: () = ();
990 pub(in super::super) const wasm_target_feature: () = ();
991 pub(in super::super) const x86_amx_intrinsics: () = ();
992 pub(in super::super) const x87_target_feature: () = ();
993 pub(in super::super) const xop_target_feature: () = ();
994 pub(in super::super) const xtensa_target_feature: () = ();
995}
996