Skip to content

Commit f463f88

Browse files
Fabian-Gruenbichlerfolkertdev
authored andcommitted
zlib-rs: adapt neon CPU feature check to avx2 one
if the "neon" target feature is enabled, skip runtime detection. this allows running and passing the "neon" adler32 tests without requiring the "std" feature. Signed-off-by: Fabian Grünbichler <[email protected]>
1 parent bbf2574 commit f463f88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

zlib-rs/src/cpu_features.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ pub fn is_enabled_pclmulqdq() -> bool {
8181
#[inline(always)]
8282
pub fn is_enabled_neon() -> bool {
8383
#[cfg(target_arch = "aarch64")]
84-
#[cfg(feature = "std")]
85-
return std::arch::is_aarch64_feature_detected!("neon");
84+
{
85+
#[cfg(target_feature = "neon")]
86+
return true;
87+
88+
#[cfg(feature = "std")]
89+
return std::arch::is_aarch64_feature_detected!("neon");
90+
}
8691

8792
false
8893
}

0 commit comments

Comments
 (0)