Skip to content

Commit 6d31b6d

Browse files
Rollup merge of rust-lang#128192 - mrkajetanp:feature-detect, r=Amanieu
rustc_target: Add various aarch64 features Add various aarch64 features already supported by LLVM and Linux. Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM. Compiler support for features added to stdarch by rust-lang/stdarch#1614. Tracking issue for unstable aarch64 features is rust-lang#127764. List of added features: - FEAT_CSSC - FEAT_ECV - FEAT_FAMINMAX - FEAT_FLAGM2 - FEAT_FP8 - FEAT_FP8DOT2 - FEAT_FP8DOT4 - FEAT_FP8FMA - FEAT_HBC - FEAT_LSE128 - FEAT_LSE2 - FEAT_LUT - FEAT_MOPS - FEAT_LRCPC3 - FEAT_SVE_B16B16 - FEAT_SVE2p1 - FEAT_WFxT - FEAT_SME - FEAT_SME_F16F16 - FEAT_SME_F64F64 - FEAT_SME_F8F16 - FEAT_SME_F8F32 - FEAT_SME_FA64 - FEAT_SME_I16I64 - FEAT_SME_LUTv2 - FEAT_SME2 - FEAT_SME2p1 - FEAT_SSVE_FP8DOT2 - FEAT_SSVE_FP8DOT4 - FEAT_SSVE_FP8FMA FEAT_FPMR is added in the first commit and then removed in a separate one to highlight it being removed from upstream LLVM 19. The intention is for it to be detectable at runtime through stdarch but not have a corresponding Rust compile-time feature.
2 parents b1a56b5 + 4f6b814 commit 6d31b6d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Diff for: std/tests/run-time-detect.rs

+34
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
55
feature(stdarch_arm_feature_detection)
66
)]
7+
#![cfg_attr(
8+
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
9+
feature(stdarch_aarch64_feature_detection)
10+
)]
711
#![cfg_attr(
812
all(target_arch = "powerpc", target_os = "linux"),
913
feature(stdarch_powerpc_feature_detection)
@@ -36,42 +40,72 @@ fn aarch64_linux() {
3640
println!("bf16: {}", is_aarch64_feature_detected!("bf16"));
3741
println!("bti: {}", is_aarch64_feature_detected!("bti"));
3842
println!("crc: {}", is_aarch64_feature_detected!("crc"));
43+
println!("cssc: {}", is_aarch64_feature_detected!("cssc"));
3944
println!("dit: {}", is_aarch64_feature_detected!("dit"));
4045
println!("dotprod: {}", is_aarch64_feature_detected!("dotprod"));
4146
println!("dpb2: {}", is_aarch64_feature_detected!("dpb2"));
4247
println!("dpb: {}", is_aarch64_feature_detected!("dpb"));
48+
println!("ecv: {}", is_aarch64_feature_detected!("ecv"));
4349
println!("f32mm: {}", is_aarch64_feature_detected!("f32mm"));
4450
println!("f64mm: {}", is_aarch64_feature_detected!("f64mm"));
51+
println!("faminmax: {}", is_aarch64_feature_detected!("faminmax"));
4552
println!("fcma: {}", is_aarch64_feature_detected!("fcma"));
4653
println!("fhm: {}", is_aarch64_feature_detected!("fhm"));
54+
println!("flagm2: {}", is_aarch64_feature_detected!("flagm2"));
4755
println!("flagm: {}", is_aarch64_feature_detected!("flagm"));
4856
println!("fp16: {}", is_aarch64_feature_detected!("fp16"));
57+
println!("fp8: {}", is_aarch64_feature_detected!("fp8"));
58+
println!("fp8dot2: {}", is_aarch64_feature_detected!("fp8dot2"));
59+
println!("fp8dot4: {}", is_aarch64_feature_detected!("fp8dot4"));
60+
println!("fp8fma: {}", is_aarch64_feature_detected!("fp8fma"));
61+
println!("fpmr: {}", is_aarch64_feature_detected!("fpmr"));
4962
println!("frintts: {}", is_aarch64_feature_detected!("frintts"));
63+
println!("hbc: {}", is_aarch64_feature_detected!("hbc"));
5064
println!("i8mm: {}", is_aarch64_feature_detected!("i8mm"));
5165
println!("jsconv: {}", is_aarch64_feature_detected!("jsconv"));
66+
println!("lse128: {}", is_aarch64_feature_detected!("lse128"));
5267
println!("lse2: {}", is_aarch64_feature_detected!("lse2"));
5368
println!("lse: {}", is_aarch64_feature_detected!("lse"));
69+
println!("lut: {}", is_aarch64_feature_detected!("lut"));
70+
println!("mops: {}", is_aarch64_feature_detected!("mops"));
5471
println!("mte: {}", is_aarch64_feature_detected!("mte"));
5572
println!("neon: {}", is_aarch64_feature_detected!("neon"));
5673
println!("paca: {}", is_aarch64_feature_detected!("paca"));
5774
println!("pacg: {}", is_aarch64_feature_detected!("pacg"));
5875
println!("pmull: {}", is_aarch64_feature_detected!("pmull"));
5976
println!("rand: {}", is_aarch64_feature_detected!("rand"));
6077
println!("rcpc2: {}", is_aarch64_feature_detected!("rcpc2"));
78+
println!("rcpc3: {}", is_aarch64_feature_detected!("rcpc3"));
6179
println!("rcpc: {}", is_aarch64_feature_detected!("rcpc"));
6280
println!("rdm: {}", is_aarch64_feature_detected!("rdm"));
6381
println!("sb: {}", is_aarch64_feature_detected!("sb"));
6482
println!("sha2: {}", is_aarch64_feature_detected!("sha2"));
6583
println!("sha3: {}", is_aarch64_feature_detected!("sha3"));
6684
println!("sm4: {}", is_aarch64_feature_detected!("sm4"));
85+
println!("sme-f16f16: {}", is_aarch64_feature_detected!("sme-f16f16"));
86+
println!("sme-f64f64: {}", is_aarch64_feature_detected!("sme-f64f64"));
87+
println!("sme-f8f16: {}", is_aarch64_feature_detected!("sme-f8f16"));
88+
println!("sme-f8f32: {}", is_aarch64_feature_detected!("sme-f8f32"));
89+
println!("sme-fa64: {}", is_aarch64_feature_detected!("sme-fa64"));
90+
println!("sme-i16i64: {}", is_aarch64_feature_detected!("sme-i16i64"));
91+
println!("sme-lutv2: {}", is_aarch64_feature_detected!("sme-lutv2"));
92+
println!("sme2: {}", is_aarch64_feature_detected!("sme2"));
93+
println!("sme2p1: {}", is_aarch64_feature_detected!("sme2p1"));
94+
println!("sme: {}", is_aarch64_feature_detected!("sme"));
6795
println!("ssbs: {}", is_aarch64_feature_detected!("ssbs"));
96+
println!("ssve-fp8dot2: {}", is_aarch64_feature_detected!("ssve-fp8dot2"));
97+
println!("ssve-fp8dot4: {}", is_aarch64_feature_detected!("ssve-fp8dot4"));
98+
println!("ssve-fp8fma: {}", is_aarch64_feature_detected!("ssve-fp8fma"));
99+
println!("sve-b16b16: {}", is_aarch64_feature_detected!("sve-b16b16"));
68100
println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes"));
69101
println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm"));
70102
println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3"));
71103
println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4"));
72104
println!("sve2: {}", is_aarch64_feature_detected!("sve2"));
105+
println!("sve2p1: {}", is_aarch64_feature_detected!("sve2p1"));
73106
println!("sve: {}", is_aarch64_feature_detected!("sve"));
74107
println!("tme: {}", is_aarch64_feature_detected!("tme"));
108+
println!("wfxt: {}", is_aarch64_feature_detected!("wfxt"));
75109
// tidy-alphabetical-end
76110
}
77111

0 commit comments

Comments
 (0)