1 | #![allow (dead_code)] |
2 | |
3 | use cfg_if::cfg_if; |
4 | |
5 | // Export the macros for all supported architectures. |
6 | #[macro_use ] |
7 | mod x86; |
8 | #[macro_use ] |
9 | mod arm; |
10 | #[macro_use ] |
11 | mod aarch64; |
12 | #[macro_use ] |
13 | mod riscv; |
14 | #[macro_use ] |
15 | mod powerpc; |
16 | #[macro_use ] |
17 | mod powerpc64; |
18 | #[macro_use ] |
19 | mod mips; |
20 | #[macro_use ] |
21 | mod mips64; |
22 | #[macro_use ] |
23 | mod loongarch; |
24 | |
25 | cfg_if! { |
26 | if #[cfg(any(target_arch = "x86" , target_arch = "x86_64" ))] { |
27 | #[stable(feature = "simd_x86" , since = "1.27.0" )] |
28 | pub use x86::*; |
29 | } else if #[cfg(target_arch = "arm" )] { |
30 | #[unstable(feature = "stdarch_arm_feature_detection" , issue = "111190" )] |
31 | pub use arm::*; |
32 | } else if #[cfg(any(target_arch = "aarch64" , target_arch = "arm64ec" ))] { |
33 | #[stable(feature = "simd_aarch64" , since = "1.60.0" )] |
34 | pub use aarch64::*; |
35 | } else if #[cfg(any(target_arch = "riscv32" , target_arch = "riscv64" ))] { |
36 | #[unstable(feature = "stdarch_riscv_feature_detection" , issue = "111192" )] |
37 | pub use riscv::*; |
38 | } else if #[cfg(target_arch = "powerpc" )] { |
39 | #[unstable(feature = "stdarch_powerpc_feature_detection" , issue = "111191" )] |
40 | pub use powerpc::*; |
41 | } else if #[cfg(target_arch = "powerpc64" )] { |
42 | #[unstable(feature = "stdarch_powerpc_feature_detection" , issue = "111191" )] |
43 | pub use powerpc64::*; |
44 | } else if #[cfg(target_arch = "mips" )] { |
45 | #[unstable(feature = "stdarch_mips_feature_detection" , issue = "111188" )] |
46 | pub use mips::*; |
47 | } else if #[cfg(target_arch = "mips64" )] { |
48 | #[unstable(feature = "stdarch_mips_feature_detection" , issue = "111188" )] |
49 | pub use mips64::*; |
50 | } else if #[cfg(target_arch = "loongarch64" )] { |
51 | #[unstable(feature = "stdarch_loongarch_feature_detection" , issue = "117425" )] |
52 | pub use loongarch::*; |
53 | } else { |
54 | // Unimplemented architecture: |
55 | #[doc(hidden)] |
56 | pub(crate) enum Feature { |
57 | Null |
58 | } |
59 | #[doc(hidden)] |
60 | #[unstable(feature = "stdarch_internal" , issue = "none" )] |
61 | pub mod __is_feature_detected {} |
62 | |
63 | impl Feature { |
64 | #[doc(hidden)] |
65 | pub(crate) fn from_str(_s: &str) -> Result<Feature, ()> { Err(()) } |
66 | #[doc(hidden)] |
67 | pub(crate) fn to_str(self) -> &'static str { "" } |
68 | } |
69 | } |
70 | } |
71 | |