File tree Expand file tree Collapse file tree 10 files changed +53
-16
lines changed
library/std_detect/src/detect/arch Expand file tree Collapse file tree 10 files changed +53
-16
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,18 @@ features! {
55 @CFG : any( target_arch = "aarch64" , target_arch = "arm64ec" ) ;
66 @MACRO_NAME : is_aarch64_feature_detected;
77 @MACRO_ATTRS :
8- /// This macro tests, at runtime, whether an `aarch64` feature is enabled on aarch64 platforms.
9- /// Currently most features are only supported on linux-based platforms.
8+ /// This macro tests whether an `aarch64` feature is enabled on aarch64 platforms.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
1013 ///
1114 /// This macro takes one argument which is a string literal of the feature being tested for.
1215 /// The feature names are mostly taken from their FEAT_* definitions in the [ARM Architecture
1316 /// Reference Manual][docs].
1417 ///
18+ /// Currently most features are only supported on linux-based platforms.
19+ ///
1520 /// ## Supported arguments
1621 ///
1722 /// * `"aes"` - FEAT_AES & FEAT_PMULL
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "arm" ;
66 @MACRO_NAME : is_arm_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `arm` feature is enabled.
8+ /// Checks whether an `arm` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_arm_feature_detection" , issue = "111190" ) ]
1014 @NO_RUNTIME_DETECTION : "v7" ;
1115 @NO_RUNTIME_DETECTION : "vfp2" ;
Original file line number Diff line number Diff line change @@ -5,7 +5,12 @@ features! {
55 @CFG : any( target_arch = "loongarch32" , target_arch = "loongarch64" ) ;
66 @MACRO_NAME : is_loongarch_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `loongarch` feature is enabled.
8+ /// Checks whether a `loongarch` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
13+ ///
914 /// Supported arguments are:
1015 ///
1116 /// * `"32s"`
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "mips" ;
66 @MACRO_NAME : is_mips_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `mips` feature is enabled.
8+ /// Checks whether a `mips` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_mips_feature_detection" , issue = "111188" ) ]
1014 @FEATURE : #[ unstable( feature = "stdarch_mips_feature_detection" , issue = "111188" ) ] msa: "msa" ;
1115 /// MIPS SIMD Architecture (MSA)
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "mips64" ;
66 @MACRO_NAME : is_mips64_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `mips64` feature is enabled.
8+ /// Checks whether a `mips64` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_mips_feature_detection" , issue = "111188" ) ]
1014 @FEATURE : #[ unstable( feature = "stdarch_mips_feature_detection" , issue = "111188" ) ] msa: "msa" ;
1115 /// MIPS SIMD Architecture (MSA)
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "powerpc" ;
66 @MACRO_NAME : is_powerpc_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `powerpc` feature is enabled.
8+ /// Checks a if `powerpc` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_powerpc_feature_detection" , issue = "111191" ) ]
1014 @FEATURE : #[ unstable( feature = "stdarch_powerpc_feature_detection" , issue = "111191" ) ] altivec: "altivec" ;
1115 /// Altivec
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "powerpc64" ;
66 @MACRO_NAME : is_powerpc64_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `powerpc` feature is enabled.
8+ /// Checks whether a `powerpc` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_powerpc_feature_detection" , issue = "111191" ) ]
1014 @FEATURE : #[ unstable( feature = "stdarch_powerpc_feature_detection" , issue = "111191" ) ] altivec: "altivec" ;
1115 /// Altivec
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ features! {
55 @CFG : any( target_arch = "riscv32" , target_arch = "riscv64" ) ;
66 @MACRO_NAME : is_riscv_feature_detected;
77 @MACRO_ATTRS :
8- /// A macro to test at *runtime* whether instruction sets are available on
9- /// RISC-V platforms.
8+ /// A macro to test whether instruction sets are available on RISC-V platforms.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
1013 ///
1114 /// RISC-V standard defined the base sets and the extension sets.
1215 /// The base sets are RV32I, RV64I, RV32E or RV128I. Any RISC-V platform
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ features! {
55 @CFG : target_arch = "s390x" ;
66 @MACRO_NAME : is_s390x_feature_detected;
77 @MACRO_ATTRS :
8- /// Checks if `s390x` feature is enabled.
8+ /// Checks whether a `s390x` feature is enabled.
9+ ///
10+ /// If the feature has been statically enabled for the whole crate (e.g. with
11+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
12+ /// runtime check.
913 #[ unstable( feature = "stdarch_s390x_feature_detection" , issue = "135413" ) ]
1014 @FEATURE : #[ unstable( feature = "stdarch_s390x_feature_detection" , issue = "135413" ) ] concurrent_functions: "concurrent-functions" ;
1115 /// s390x concurrent-functions facility
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ features! {
2020 @CFG : any( target_arch = "x86" , target_arch = "x86_64" ) ;
2121 @MACRO_NAME : is_x86_feature_detected;
2222 @MACRO_ATTRS :
23- /// A macro to test at *runtime* whether a CPU feature is available on
23+ /// A macro to test at whether a CPU feature is available on
2424 /// x86/x86-64 platforms.
2525 ///
26- /// This macro is provided in the standard library and will detect at runtime
27- /// whether the specified CPU feature is detected. This does **not** resolve at
28- /// compile time unless the specified feature is already enabled for the entire
29- /// crate. Runtime detection currently relies mostly on the `cpuid` instruction.
26+ /// If the feature has been statically enabled for the whole crate (e.g. with
27+ /// `-Ctarget-feature`), this macro expands to `true`. Otherwise it performs a
28+ /// runtime check. Runtime detection currently relies mostly on the `cpuid`
29+ /// instruction.
3030 ///
3131 /// This macro only takes one argument which is a string literal of the feature
3232 /// being tested for. The feature names supported are the lowercase versions of
You can’t perform that action at this time.
0 commit comments