Skip to content

Commit

Permalink
rustc_target: Add various aarch64 features
Browse files Browse the repository at this point in the history
Add various aarch64 features already supported by LLVM and Linux.

The features are marked as unstable using a newly added symbol, i.e.
aarch64_unstable_target_feature.

Additionally include some comment fixes to ensure consistency of
feature names with the Arm ARM and support for architecture version
target features up to v9.5a.

This commit adds compiler support for the following features:

- FEAT_CSSC
- FEAT_ECV
- FEAT_FAMINMAX
- FEAT_FLAGM2
- FEAT_FP8
- FEAT_FP8DOT2
- FEAT_FP8DOT4
- FEAT_FP8FMA
- FEAT_FPMR
- FEAT_HBC
- FEAT_LSE128
- FEAT_LSE2
- FEAT_LUT
- FEAT_MOPS
- FEAT_LRCPC3
- FEAT_SVE_B16B16
- FEAT_SVE2p1
- FEAT_WFxT
  • Loading branch information
mrkajetanp committed Aug 27, 2024
1 parent a628540 commit 012bb44
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions std/tests/run-time-detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
feature(stdarch_arm_feature_detection)
)]
#![cfg_attr(
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
feature(stdarch_aarch64_feature_detection)
)]
#![cfg_attr(
all(target_arch = "powerpc", target_os = "linux"),
feature(stdarch_powerpc_feature_detection)
Expand Down Expand Up @@ -36,42 +40,59 @@ fn aarch64_linux() {
println!("bf16: {}", is_aarch64_feature_detected!("bf16"));
println!("bti: {}", is_aarch64_feature_detected!("bti"));
println!("crc: {}", is_aarch64_feature_detected!("crc"));
println!("cssc: {}", is_aarch64_feature_detected!("cssc"));
println!("dit: {}", is_aarch64_feature_detected!("dit"));
println!("dotprod: {}", is_aarch64_feature_detected!("dotprod"));
println!("dpb2: {}", is_aarch64_feature_detected!("dpb2"));
println!("dpb: {}", is_aarch64_feature_detected!("dpb"));
println!("ecv: {}", is_aarch64_feature_detected!("ecv"));
println!("f32mm: {}", is_aarch64_feature_detected!("f32mm"));
println!("f64mm: {}", is_aarch64_feature_detected!("f64mm"));
println!("faminmax: {}", is_aarch64_feature_detected!("faminmax"));
println!("fcma: {}", is_aarch64_feature_detected!("fcma"));
println!("fhm: {}", is_aarch64_feature_detected!("fhm"));
println!("flagm2: {}", is_aarch64_feature_detected!("flagm2"));
println!("flagm: {}", is_aarch64_feature_detected!("flagm"));
println!("fp16: {}", is_aarch64_feature_detected!("fp16"));
println!("fp8: {}", is_aarch64_feature_detected!("fp8"));
println!("fp8dot2: {}", is_aarch64_feature_detected!("fp8dot2"));
println!("fp8dot4: {}", is_aarch64_feature_detected!("fp8dot4"));
println!("fp8fma: {}", is_aarch64_feature_detected!("fp8fma"));
println!("fpmr: {}", is_aarch64_feature_detected!("fpmr"));
println!("frintts: {}", is_aarch64_feature_detected!("frintts"));
println!("hbc: {}", is_aarch64_feature_detected!("hbc"));
println!("i8mm: {}", is_aarch64_feature_detected!("i8mm"));
println!("jsconv: {}", is_aarch64_feature_detected!("jsconv"));
println!("lse128: {}", is_aarch64_feature_detected!("lse128"));
println!("lse2: {}", is_aarch64_feature_detected!("lse2"));
println!("lse: {}", is_aarch64_feature_detected!("lse"));
println!("lut: {}", is_aarch64_feature_detected!("lut"));
println!("mops: {}", is_aarch64_feature_detected!("mops"));
println!("mte: {}", is_aarch64_feature_detected!("mte"));
println!("neon: {}", is_aarch64_feature_detected!("neon"));
println!("paca: {}", is_aarch64_feature_detected!("paca"));
println!("pacg: {}", is_aarch64_feature_detected!("pacg"));
println!("pmull: {}", is_aarch64_feature_detected!("pmull"));
println!("rand: {}", is_aarch64_feature_detected!("rand"));
println!("rcpc2: {}", is_aarch64_feature_detected!("rcpc2"));
println!("rcpc3: {}", is_aarch64_feature_detected!("rcpc3"));
println!("rcpc: {}", is_aarch64_feature_detected!("rcpc"));
println!("rdm: {}", is_aarch64_feature_detected!("rdm"));
println!("sb: {}", is_aarch64_feature_detected!("sb"));
println!("sha2: {}", is_aarch64_feature_detected!("sha2"));
println!("sha3: {}", is_aarch64_feature_detected!("sha3"));
println!("sm4: {}", is_aarch64_feature_detected!("sm4"));
println!("ssbs: {}", is_aarch64_feature_detected!("ssbs"));
println!("sve-b16b16: {}", is_aarch64_feature_detected!("sve-b16b16"));
println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes"));
println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm"));
println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3"));
println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4"));
println!("sve2: {}", is_aarch64_feature_detected!("sve2"));
println!("sve2p1: {}", is_aarch64_feature_detected!("sve2p1"));
println!("sve: {}", is_aarch64_feature_detected!("sve"));
println!("tme: {}", is_aarch64_feature_detected!("tme"));
println!("wfxt: {}", is_aarch64_feature_detected!("wfxt"));
// tidy-alphabetical-end
}

Expand Down

0 comments on commit 012bb44

Please sign in to comment.