Skip to content

Commit 9a69447

Browse files
committed
rustc_target: Add SME aarch64 features
Add SME aarch64 features already supported by LLVM and Linux. This commit adds compiler support for the following features: - 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
1 parent c8f3f91 commit 9a69447

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

compiler/rustc_target/src/target_features.rs

+26
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,36 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Stability)] = &[
186186
("sha3", Stable),
187187
// FEAT_SM3 & FEAT_SM4
188188
("sm4", Stable),
189+
// FEAT_SME
190+
("sme", Unstable(sym::aarch64_unstable_target_feature)),
191+
// FEAT_SME_F16F16
192+
("sme-f16f16", Unstable(sym::aarch64_unstable_target_feature)),
193+
// FEAT_SME_F64F64
194+
("sme-f64f64", Unstable(sym::aarch64_unstable_target_feature)),
195+
// FEAT_SME_F8F16
196+
("sme-f8f16", Unstable(sym::aarch64_unstable_target_feature)),
197+
// FEAT_SME_F8F32
198+
("sme-f8f32", Unstable(sym::aarch64_unstable_target_feature)),
199+
// FEAT_SME_FA64
200+
("sme-fa64", Unstable(sym::aarch64_unstable_target_feature)),
201+
// FEAT_SME_I16I64
202+
("sme-i16i64", Unstable(sym::aarch64_unstable_target_feature)),
203+
// FEAT_SME_LUTv2
204+
("sme-lutv2", Unstable(sym::aarch64_unstable_target_feature)),
205+
// FEAT_SME2
206+
("sme2", Unstable(sym::aarch64_unstable_target_feature)),
207+
// FEAT_SME2p1
208+
("sme2p1", Unstable(sym::aarch64_unstable_target_feature)),
189209
// FEAT_SPE
190210
("spe", Stable),
191211
// FEAT_SSBS & FEAT_SSBS2
192212
("ssbs", Stable),
213+
// FEAT_SSVE_FP8FDOT2
214+
("ssve-fp8dot2", Unstable(sym::aarch64_unstable_target_feature)),
215+
// FEAT_SSVE_FP8FDOT4
216+
("ssve-fp8dot4", Unstable(sym::aarch64_unstable_target_feature)),
217+
// FEAT_SSVE_FP8FMA
218+
("ssve-fp8fma", Unstable(sym::aarch64_unstable_target_feature)),
193219
// FEAT_SVE
194220
("sve", Stable),
195221
// FEAT_SVE_B16B16 (SVE or SME Instructions)

library/std/tests/run-time-detect.rs

+13
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,20 @@ fn aarch64_linux() {
8282
println!("sha2: {}", is_aarch64_feature_detected!("sha2"));
8383
println!("sha3: {}", is_aarch64_feature_detected!("sha3"));
8484
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"));
8595
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"));
8699
println!("sve-b16b16: {}", is_aarch64_feature_detected!("sve-b16b16"));
87100
println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes"));
88101
println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm"));

0 commit comments

Comments
 (0)