The metrics histogram update code unconditionally included <immintrin.h> and used __attribute__((target("avx"))) SSE/AVX intrinsics, which only exist on x86-64. This prevented the project from compiling on ARM64.
Guard the x86-64 SIMD implementation and the <immintrin.h> include with an architecture check.
Add an AArch64 NEON implementation that processes two buckets per iteration, matching the AVX path.
Fix the AArch64 assembly .size directive in src/cpu_work.cpp so the project actually builds on ARM64 Linux.
Keep a portable scalar fallback for other architectures.
I verified the full project builds and the test suite passes on an aarch64 host.
Closes #3
The metrics histogram update code unconditionally included `<immintrin.h>` and used `__attribute__((target("avx")))` SSE/AVX intrinsics, which only exist on x86-64. This prevented the project from compiling on ARM64.
- Guard the x86-64 SIMD implementation and the `<immintrin.h>` include with an architecture check.
- Add an AArch64 NEON implementation that processes two buckets per iteration, matching the AVX path.
- Fix the AArch64 assembly `.size` directive in `src/cpu_work.cpp` so the project actually builds on ARM64 Linux.
- Keep a portable scalar fallback for other architectures.
I verified the full project builds and the test suite passes on an aarch64 host.
The metrics histogram update code unconditionally included <immintrin.h>
and used __attribute__((target("avx"))) SSE/AVX intrinsics, which only
exist on x86-64. This prevented the project from compiling on ARM64.
Guard the x86-64 SIMD implementation and the <immintrin.h> include with
an architecture check, and add a portable scalar fallback for non-x86-64
platforms (e.g., ARM64). A thin wrapper function keeps the call sites
unchanged and preserves the AVX fast path on x86-64.
Closes#3
weaselbot
requested review from andrew 2026-06-26 14:50:12 +00:00
andrew
requested changes 2026-06-26 15:01:25 +00:00
Replace the scalar ARM fallback in update_histogram_buckets with a NEON
implementation that processes two buckets per iteration, matching the
existing AVX path. The wrapper now dispatches to the SIMD path on both
x86-64 and AArch64 and falls back to scalar code on other architectures.
The GNU assembler expects `.size symbol, .-symbol`. The previous
`.size spend_cpu_cycles, spend_cpu_cycles` expression is not a constant
and breaks compilation on AArch64 Linux. Use the correct form so the
project builds on ARM64.
weaselbot
changed title from Support building on ARM by providing scalar histogram fallback to Support building on ARM with NEON histogram intrinsics2026-06-26 15:08:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #3
The metrics histogram update code unconditionally included
<immintrin.h>and used__attribute__((target("avx")))SSE/AVX intrinsics, which only exist on x86-64. This prevented the project from compiling on ARM64.<immintrin.h>include with an architecture check..sizedirective insrc/cpu_work.cppso the project actually builds on ARM64 Linux.I verified the full project builds and the test suite passes on an aarch64 host.
The metrics histogram update code unconditionally included <immintrin.h> and used __attribute__((target("avx"))) SSE/AVX intrinsics, which only exist on x86-64. This prevented the project from compiling on ARM64. Guard the x86-64 SIMD implementation and the <immintrin.h> include with an architecture check, and add a portable scalar fallback for non-x86-64 platforms (e.g., ARM64). A thin wrapper function keeps the call sites unchanged and preserves the AVX fast path on x86-64. Closes #3You should have access to github now. Please write use simd intrinsics for arm implementation.
Support building on ARM by providing scalar histogram fallbackto Support building on ARM with NEON histogram intrinsicsYou should now have the pre-commit dependencies installed. Make sure the pre-commit passes