From 5b8e3fbacdbce2548863841b4d9b43e3365d1755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 10 Oct 2025 10:20:15 +0200 Subject: [PATCH] zlib-rs: properly guard AVX512 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the runtime checker returns true if those target features are enabled, so guard the tests which assert on the runtime check being true accordingly. Signed-off-by: Fabian Grünbichler --- zlib-rs/src/adler32/avx2.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zlib-rs/src/adler32/avx2.rs b/zlib-rs/src/adler32/avx2.rs index 04b14a49..7ea869f7 100644 --- a/zlib-rs/src/adler32/avx2.rs +++ b/zlib-rs/src/adler32/avx2.rs @@ -145,7 +145,11 @@ unsafe fn helper_32_bytes(mut adler0: u32, mut adler1: u32, src: &[__m256i]) -> } #[cfg(test)] -#[cfg(target_feature = "avx2")] +#[cfg(all( + target_feature = "avx2", + target_feature = "bmi1", + target_feature = "bmi2" +))] mod test { use super::*;