2022-02-17 12:49:50 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
|
|
// Export the macros for all supported architectures.
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod x86;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod arm;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod aarch64;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod riscv;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod powerpc;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod powerpc64;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod mips;
|
|
|
|
|
#[macro_use]
|
|
|
|
|
mod mips64;
|
2023-10-25 15:09:45 +08:00
|
|
|
#[macro_use]
|
|
|
|
|
mod loongarch;
|
2025-01-12 17:35:47 +01:00
|
|
|
#[macro_use]
|
|
|
|
|
mod s390x;
|
2022-02-17 12:49:50 +00:00
|
|
|
|
2025-08-10 14:25:43 -07:00
|
|
|
cfg_select! {
|
|
|
|
|
any(target_arch = "x86", target_arch = "x86_64") => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[stable(feature = "simd_x86", since = "1.27.0")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use x86::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "arm" => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_arm_feature_detection", issue = "111190")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use arm::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
any(target_arch = "aarch64", target_arch = "arm64ec") => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[stable(feature = "simd_aarch64", since = "1.60.0")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use aarch64::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
any(target_arch = "riscv32", target_arch = "riscv64") => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use riscv::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "powerpc" => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use powerpc::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "powerpc64" => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use powerpc64::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "mips" => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use mips::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "mips64" => {
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub use mips64::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
any(target_arch = "loongarch32", target_arch = "loongarch64") => {
|
2025-01-06 15:49:57 +08:00
|
|
|
#[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")]
|
2023-10-25 15:09:45 +08:00
|
|
|
pub use loongarch::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
target_arch = "s390x" => {
|
2025-01-12 17:35:47 +01:00
|
|
|
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
|
|
|
|
|
pub use s390x::*;
|
2025-08-10 14:25:43 -07:00
|
|
|
}
|
|
|
|
|
_ => {
|
2022-02-17 12:49:50 +00:00
|
|
|
// Unimplemented architecture:
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
|
pub(crate) enum Feature {
|
|
|
|
|
Null
|
|
|
|
|
}
|
|
|
|
|
#[doc(hidden)]
|
2023-05-04 12:01:06 +01:00
|
|
|
#[unstable(feature = "stdarch_internal", issue = "none")]
|
2022-02-17 12:49:50 +00:00
|
|
|
pub mod __is_feature_detected {}
|
|
|
|
|
|
|
|
|
|
impl Feature {
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
|
pub(crate) fn from_str(_s: &str) -> Result<Feature, ()> { Err(()) }
|
|
|
|
|
#[doc(hidden)]
|
|
|
|
|
pub(crate) fn to_str(self) -> &'static str { "" }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|