Skip to main content

std_detect/detect/arch/
mod.rs

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