diff options
| author | Jack O'Connor <[email protected]> | 2020-01-27 13:46:00 -0500 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2020-01-28 15:59:16 -0500 |
| commit | 37e153cc607ba5b975ce8bd7f2017f01624781bb (patch) | |
| tree | 20b39b41a9bfad9c6d45e2d92912bd9fc9d6703d /c/blake3_dispatch.c | |
| parent | d7a37fa54d67e67c19027928ae524292318c9021 (diff) | |
add NEON support to blake3_dispatch.c
Currently this requires setting the BLAKE3_USE_NEON preprocessor flag.
In the future we may enable this automatically on AArch32/64 or include
some kind of dynamic feature detection. (Though ARM makes this harder
than x86.)
As part of this, get rid of the IS_ARM flag. It wasn't being set
properly when I tried it on a Raspberry Pi.
Closes #30.
Diffstat (limited to 'c/blake3_dispatch.c')
| -rw-r--r-- | c/blake3_dispatch.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/c/blake3_dispatch.c b/c/blake3_dispatch.c index 4d033db..7daf43e 100644 --- a/c/blake3_dispatch.c +++ b/c/blake3_dispatch.c @@ -73,7 +73,7 @@ void blake3_hash_many_avx512(const uint8_t *const *inputs, size_t num_inputs, #endif #endif -#if defined(IS_ARM) && defined(BLAKE3_USE_NEON) +#if defined(BLAKE3_USE_NEON) void blake3_hash_many_neon(const uint8_t *const *inputs, size_t num_inputs, size_t blocks, const uint32_t key[8], uint64_t counter, bool increment_counter, @@ -191,10 +191,8 @@ static } g_cpu_features = features; return features; -#elif defined(IS_ARM) - /* How to detect NEON? */ - return 0; #else + /* How to detect NEON? */ return 0; #endif } @@ -275,6 +273,13 @@ void blake3_hash_many(const uint8_t *const *inputs, size_t num_inputs, } #endif #endif + +#if defined(BLAKE3_USE_NEON) + blake3_hash_many_neon(inputs, num_inputs, blocks, key, counter, + increment_counter, flags, flags_start, flags_end, out); + return; +#endif + blake3_hash_many_portable(inputs, num_inputs, blocks, key, counter, increment_counter, flags, flags_start, flags_end, out); |
