diff options
| author | Jack O'Connor <[email protected]> | 2024-08-15 16:22:55 -0700 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2024-08-15 16:54:56 -0700 |
| commit | 47f9283a937092ba212ad7f3df6183dd7bf1c447 (patch) | |
| tree | fa20a3483f011c7b60d56877bd268163d4a57935 /c | |
| parent | bb2c530bb04786a53d51442b74880775bf92e37c (diff) | |
mark blake3_xof_many_avx512 Unix-only in Rust and C
Diffstat (limited to 'c')
| -rw-r--r-- | c/blake3_c_rust_bindings/src/lib.rs | 1 | ||||
| -rw-r--r-- | c/blake3_c_rust_bindings/src/test.rs | 1 | ||||
| -rw-r--r-- | c/blake3_dispatch.c | 2 | ||||
| -rw-r--r-- | c/blake3_impl.h | 2 |
4 files changed, 5 insertions, 1 deletions
diff --git a/c/blake3_c_rust_bindings/src/lib.rs b/c/blake3_c_rust_bindings/src/lib.rs index ac7880a..31b7731 100644 --- a/c/blake3_c_rust_bindings/src/lib.rs +++ b/c/blake3_c_rust_bindings/src/lib.rs @@ -291,6 +291,7 @@ pub mod ffi { flags_end: u8, out: *mut u8, ); + #[cfg(unix)] pub fn blake3_xof_many_avx512( cv: *const u32, block: *const u8, diff --git a/c/blake3_c_rust_bindings/src/test.rs b/c/blake3_c_rust_bindings/src/test.rs index ec11219..da88367 100644 --- a/c/blake3_c_rust_bindings/src/test.rs +++ b/c/blake3_c_rust_bindings/src/test.rs @@ -425,6 +425,7 @@ fn test_xof_many_portable() { } #[test] +#[cfg(unix)] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn test_xof_many_avx512() { if !crate::avx512_detected() { diff --git a/c/blake3_dispatch.c b/c/blake3_dispatch.c index 725f7ee..a90c757 100644 --- a/c/blake3_dispatch.c +++ b/c/blake3_dispatch.c @@ -230,7 +230,7 @@ void blake3_xof_many(const uint32_t cv[8], uint8_t out[64], size_t outblocks) { #if defined(IS_X86) const enum cpu_feature features = get_cpu_features(); -#if !defined(BLAKE3_NO_AVX512) +#if defined(__unix__) && !defined(BLAKE3_NO_AVX512) if (features & AVX512VL) { blake3_xof_many_avx512(cv, block, block_len, counter, flags, out, outblocks); return; diff --git a/c/blake3_impl.h b/c/blake3_impl.h index 66a1707..abd7546 100644 --- a/c/blake3_impl.h +++ b/c/blake3_impl.h @@ -288,12 +288,14 @@ void blake3_hash_many_avx512(const uint8_t *const *inputs, size_t num_inputs, uint8_t flags, uint8_t flags_start, uint8_t flags_end, uint8_t *out); +#if defined(__unix__) void blake3_xof_many_avx512(const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags, uint8_t* out, size_t outblocks); #endif #endif +#endif #if BLAKE3_USE_NEON == 1 void blake3_hash_many_neon(const uint8_t *const *inputs, size_t num_inputs, |
