Skip to content

Fix BLAKE3 NEON rot8 build on armv7 - #28

Merged
Coralesoft merged 1 commit into
mainfrom
fix/issue-27-blake3-armv7-rot8
May 14, 2026
Merged

Fix BLAKE3 NEON rot8 build on armv7#28
Coralesoft merged 1 commit into
mainfrom
fix/issue-27-blake3-armv7-rot8

Conversation

@Coralesoft

Copy link
Copy Markdown
Collaborator

Summary

Fixes the armv7 NEON build of blake3_simd.cpp.

rot8_neon used vqtbl1q_u8, which is AArch64-only. armv7 NEON only supports VTBL with 8-byte inputs.

Replace it with the BLAKE3 reference approach: Clang __builtin_shufflevector, GCC 4.7+ __builtin_shuffle, and a vsriq_n_u32 fallback.

On AArch64, Clang and GCC still lower this to TBL, with bit-identical output to the previous path.

The remaining cpu-features.h item in #27 is a separate upstream-inherited CMake gap and will be handled separately.

Verification

  • Clean cross-compile on armv7-linux-gnueabihf and aarch64-linux-gnu with LLVM 22.
  • Clean host build.
  • cryptest.exe v passed.
  • cryptest.exe v 88 BLAKE3 KATs passed: 5/5.

Refs: #27

rot8_neon used vqtbl1q_u8, which is only available on AArch64. That broke armv7 NEON builds at the call site.

Use the BLAKE3 reference approach instead: Clang shufflevector, GCC 4.7+ shuffle, and a vsriq_n_u32 fallback.

Refs: #27
@Coralesoft
Coralesoft marked this pull request as ready for review May 14, 2026 11:32
@Coralesoft
Coralesoft merged commit baf1e2c into main May 14, 2026
39 checks passed
@Coralesoft
Coralesoft deleted the fix/issue-27-blake3-armv7-rot8 branch May 14, 2026 11:32
This was referenced May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant