-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -mfpu=neon
if $CC accepts it
#358
Conversation
This commit fixes a build issue on Raspberry Pi 4A, which uses an arm32 userland with an arm64 kernel. GCC generally requires this flag to use NEON intrinsics on arm32. On arm64, GCC doesn't recognize this flag, so `-mfpu=neon` won't be added to the command line.
@BurningEnlightenment could you review the CMake change? |
No, this is the wrong way to go about this. Not all arm32 CPUs support NEON therefore compiler support doesn't imply that the intended target indeed supports NEON (and since ARM doesn't support runtime CPU feature detection, we can't switch the implementation like we do for x86). If you, the user, know that your target CPU supports NEON you ought to configure this project with |
In this code path, we've already set |
The condition for non ARMv8 architectures includes the check EDIT: See #314 for some context on the current design. |
@rui314 do you have a use case where using a toolchain / commandline param is infeasible? |
The issue I'm addressing in this pull request is that BLAKE3's C implementation cannot be built out-of-the-box on the default Raspberry Pi OS (32-bit) running on a Raspberry Pi 4A, which is equipped with an ARMv8-A 64-bit processor. So the kernel is 64-bit and the userland is 32-bit. I didn't specify any optional parameters when using CMake (I simply ran
I encountered the same error even with I thought that the correct solution is to add the appropriate option to make GCC recognize NEON intrinsics when they are enabled in CMake. Unlike ARM64 GCC, ARM32 GCC needs |
Ah, I see. The |
It worked! |
@oconnor663 looks like we arrived at a solution--you may close this and review/merge #359 |
Merged #359. |
@oconnor663 I've reviewed two other CMake PRs which you may merge. EDIT: Here is the list of reviewed PRs: https://github.com/BLAKE3-team/BLAKE3/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved |
This commit fixes a build issue on Raspberry Pi 4A, which uses an arm32 userland with an arm64 kernel.
GCC generally requires this flag to use NEON intrinsics on arm32. On arm64, GCC doesn't recognize this flag, so
-mfpu=neon
won't be added to the command line.