From b8cdcb1f84cf794c7072bbfaacac71f6a5857e3c Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 31 Mar 2020 12:36:41 -0400 Subject: automatically fall back to the pure Rust build There are two scenarios where compiling AVX-512 C or assembly code might not work: 1. There might not be a C compiler installed at all. Most commonly this is either in cross-compiling situations, or with the Windows GNU target. 2. The installed C compiler might not support e.g. -mavx512f, because it's too old. In both of these cases, print a relevant warning, and then automatically fall back to using the pure Rust intrinsics build. Note that this only affects x86 targets. Other targets always use pure Rust, unless the "neon" feature is enabled. --- benches/bench.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'benches') diff --git a/benches/bench.rs b/benches/bench.rs index a6cd97a..782e06e 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -69,7 +69,7 @@ fn bench_single_compression_sse41(b: &mut Bencher) { } #[bench] -#[cfg(not(feature = "pure"))] +#[cfg(blake3_avx512_ffi)] fn bench_single_compression_avx512(b: &mut Bencher) { if let Some(platform) = Platform::avx512() { bench_single_compression_fn(b, platform); @@ -119,7 +119,7 @@ fn bench_many_chunks_avx2(b: &mut Bencher) { } #[bench] -#[cfg(not(feature = "pure"))] +#[cfg(blake3_avx512_ffi)] fn bench_many_chunks_avx512(b: &mut Bencher) { if let Some(platform) = Platform::avx512() { bench_many_chunks_fn(b, platform); @@ -178,7 +178,7 @@ fn bench_many_parents_avx2(b: &mut Bencher) { } #[bench] -#[cfg(not(feature = "pure"))] +#[cfg(blake3_avx512_ffi)] fn bench_many_parents_avx512(b: &mut Bencher) { if let Some(platform) = Platform::avx512() { bench_many_parents_fn(b, platform); -- cgit v1.2.3