]> git.proxmox.com Git - rustc.git/blob - src/stdarch/crates/std_detect/src/detect/arch/powerpc64.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / stdarch / crates / std_detect / src / detect / arch / powerpc64.rs
1 //! Run-time feature detection on PowerPC64.
2
3 /// Checks if `powerpc64` feature is enabled.
4 #[macro_export]
5 #[unstable(feature = "stdsimd", issue = "27731")]
6 #[allow_internal_unstable(stdsimd_internal,stdsimd)]
7 macro_rules! is_powerpc64_feature_detected {
8 ("altivec") => {
9 cfg!(target_feature = "altivec") ||
10 $crate::detect::check_for($crate::detect::Feature::altivec)
11 };
12 ("vsx") => {
13 cfg!(target_feature = "vsx") ||
14 $crate::detect::check_for($crate::detect::Feature::vsx)
15 };
16 ("power8") => {
17 cfg!(target_feature = "power8") ||
18 $crate::detect::check_for($crate::detect::Feature::power8)
19 };
20 ($t:tt,) => {
21 is_powerpc64_feature_detected!($t);
22 };
23 ($t:tt) => { compile_error!(concat!("unknown powerpc64 target feature: ", $t)) };
24 }
25
26
27 /// PowerPC64 CPU Feature enum. Each variant denotes a position in a bitset
28 /// for a particular feature.
29 ///
30 /// PLEASE: do not use this, it is an implementation detail subject to change.
31 #[doc(hidden)]
32 #[allow(non_camel_case_types)]
33 #[repr(u8)]
34 #[unstable(feature = "stdsimd_internal", issue = "0")]
35 pub enum Feature {
36 /// Altivec
37 altivec,
38 /// VSX
39 vsx,
40 /// Power8
41 power8,
42 }