Skip to content

Commit e3a5705

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 7bbaa88 commit e3a5705

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

compiler/rustc_target/src/target_features.rs

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

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

Lines changed: 13 additions & 0 deletions
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)