1//! Run-time feature detection on PowerPC.
23#[doc = r" Check for the presence of a CPU feature at runtime."]
#[doc = r""]
#[doc =
r" When the feature is known to be enabled at compile time (e.g. via `-Ctarget-feature`)"]
#[doc = r" the macro expands to `true`."]
#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
#[macro_export]
macro_rules! is_powerpc_feature_detected {
("altivec") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("vsx") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power8") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power8-altivec") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power8-vector") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power8-crypto") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power9") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power9-altivec") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ("power9-vector") =>
{
compile_error!
(concat!
(r#"This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg("#,
stringify! (target_arch = "powerpc"), ")."))
}; ($t : tt,) => { crate :: is_powerpc_feature_detected ! ($t); };
($t : tt) =>
{
compile_error!
(concat!
(concat! ("unknown ", stringify! (powerpc)), concat!
(" target feature: ", $t)))
};
}
#[deny(unexpected_cfgs)]
#[deny(unfulfilled_lint_expectations)]
const _: () =
{
false;
;
false;
;
#[allow(unexpected_cfgs, reason = "power8")]
{ false };
false;
;
false;
;
false;
;
#[allow(unexpected_cfgs, reason = "power9")]
{ false };
false;
;
false;
;
};features! {
4 @TARGET: powerpc;
5 @CFG: target_arch = "powerpc";
6 @MACRO_NAME: is_powerpc_feature_detected;
7 @MACRO_ATTRS:
8/// Check for the presence of a CPU feature at runtime.
9 ///
10 /// When the feature is known to be enabled at compile time (e.g. via `-Ctarget-feature`)
11 /// the macro expands to `true`.
12#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
13@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] altivec: "altivec";
14/// Altivec
15@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] vsx: "vsx";
16/// VSX
17@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8: "power8";
18 without cfg check: true;
19/// Power8
20@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_altivec: "power8-altivec";
21/// Power8 altivec
22@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_vector: "power8-vector";
23/// Power8 vector
24@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_crypto: "power8-crypto";
25/// Power8 crypto
26@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9: "power9";
27 without cfg check: true;
28/// Power9
29@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_altivec: "power9-altivec";
30/// Power9 altivec
31@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_vector: "power9-vector";
32/// Power9 vector
33}