Add power9 and power8 target-features
This commit is contained in:
parent
e0b634ecae
commit
5fb4fabbfc
4 changed files with 36 additions and 1 deletions
|
|
@ -14,4 +14,17 @@ features! {
|
|||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8: "power8";
|
||||
without cfg check: true;
|
||||
/// Power8
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_altivec: "power8-altivec";
|
||||
/// Power8 altivec
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_vector: "power8-vector";
|
||||
/// Power8 vector
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_crypto: "power8-crypto";
|
||||
/// Power8 crypto
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9: "power9";
|
||||
without cfg check: true;
|
||||
/// Power9
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_altivec: "power9-altivec";
|
||||
/// Power9 altivec
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_vector: "power9-vector";
|
||||
/// Power9 vector
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,17 @@ features! {
|
|||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8: "power8";
|
||||
without cfg check: true;
|
||||
/// Power8
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_altivec: "power8-altivec";
|
||||
/// Power8 altivec
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_vector: "power8-vector";
|
||||
/// Power8 vector
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power8_crypto: "power8-crypto";
|
||||
/// Power8 crypto
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9: "power9";
|
||||
without cfg check: true;
|
||||
/// Power9
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_altivec: "power9-altivec";
|
||||
/// Power9 altivec
|
||||
@FEATURE: #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] power9_vector: "power9-vector";
|
||||
/// Power9 vector
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,15 @@ pub(crate) fn detect_features() -> cache::Initializer {
|
|||
// index of the bit to test like in ARM and Aarch64)
|
||||
enable_feature(&mut value, Feature::altivec, auxv.hwcap & 0x10000000 != 0);
|
||||
enable_feature(&mut value, Feature::vsx, auxv.hwcap & 0x00000080 != 0);
|
||||
enable_feature(&mut value, Feature::power8, auxv.hwcap2 & 0x80000000 != 0);
|
||||
let power8_features = auxv.hwcap2 & 0x80000000 != 0;
|
||||
enable_feature(&mut value, Feature::power8, power8_features);
|
||||
enable_feature(&mut value, Feature::power8_altivec, power8_features);
|
||||
enable_feature(&mut value, Feature::power8_crypto, power8_features);
|
||||
enable_feature(&mut value, Feature::power8_vector, power8_features);
|
||||
let power9_features = auxv.hwcap2 & 0x00800000 != 0;
|
||||
enable_feature(&mut value, Feature::power9, power9_features);
|
||||
enable_feature(&mut value, Feature::power9_altivec, power9_features);
|
||||
enable_feature(&mut value, Feature::power9_vector, power9_features);
|
||||
return value;
|
||||
}
|
||||
value
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@ fn powerpc64_linux_or_freebsd() {
|
|||
println!("altivec: {}", is_powerpc64_feature_detected!("altivec"));
|
||||
println!("vsx: {}", is_powerpc64_feature_detected!("vsx"));
|
||||
println!("power8: {}", is_powerpc64_feature_detected!("power8"));
|
||||
println!("power9: {}", is_powerpc64_feature_detected!("power9"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue