Fixed compat module.

This commit is contained in:
Kirill Kuzminykh
2026-01-07 15:48:01 +03:00
parent afb04d2f42
commit 55f6fbdee9
2 changed files with 21 additions and 17 deletions
+12 -10
View File
@@ -6,18 +6,20 @@ pub use alloc::vec::Vec;
// `no_std` feature must be enabled
pub use num_traits::Float;
// `no_std` feature must be enabled
cpufeatures::new!(cpuid_sse41, "sse4.1");
cpufeatures::new!(cpuid_avx2, "avx2");
cfg_if::cfg_if! {
if #[cfg(target_arch = "x86_64")] {
// `no_std` feature must be enabled
cpufeatures::new!(cpuid_sse41, "sse4.1");
cpufeatures::new!(cpuid_avx2, "avx2");
#[cfg(target_arch = "x86_64")]
pub fn has_avx2() -> bool {
cpuid_avx2::get()
}
pub fn has_sse41() -> bool {
cpuid_sse41::get()
}
#[cfg(target_arch = "x86_64")]
pub fn has_sse41() -> bool {
cpuid_sse41::get()
pub fn has_avx2() -> bool {
cpuid_avx2::get()
}
}
}
#[cfg(target_arch = "aarch64")]
+9 -7
View File
@@ -3,14 +3,16 @@ pub use std::boxed::Box;
pub use std::vec;
pub use std::vec::Vec;
#[cfg(target_arch = "x86_64")]
pub fn has_avx2() -> bool {
std::is_x86_feature_detected!("avx2")
}
cfg_if::cfg_if! {
if #[cfg(target_arch = "x86_64")] {
pub fn has_sse41() -> bool {
std::is_x86_feature_detected!("sse4.1")
}
#[cfg(target_arch = "x86_64")]
pub fn has_sse41() -> bool {
std::is_x86_feature_detected!("sse4.1")
pub fn has_avx2() -> bool {
std::is_x86_feature_detected!("avx2")
}
}
}
#[cfg(target_arch = "aarch64")]