Skip to content

Fix Emscripten build with SIMD - #95

Merged
marton78 merged 7 commits into
masterfrom
fix-emscripten-build
Apr 22, 2026
Merged

Fix Emscripten build with SIMD#95
marton78 merged 7 commits into
masterfrom
fix-emscripten-build

Conversation

@marton78

Copy link
Copy Markdown
Owner

Add !defined(SIMD_SZ) guard to NEON and Altivec headers, matching the guard already present in pf_sse1_float.h. This prevents redefinition errors when multiple SIMD backends match (e.g. Emscripten with -msimd128 enabling SSE while __arm__ and PFFFT_ENABLE_NEON are also defined).

Fixes #94

@marton78
marton78 force-pushed the fix-emscripten-build branch from 2eccc75 to a1546d0 Compare April 22, 2026 08:03
marton78 and others added 6 commits April 22, 2026 10:25
Applies fully qualified namespace syntax throughout the codebase to ensure
std:: references are unambiguous, especially in contexts where user namespaces
may define conflicting std symbols.

Fixes #65

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add !defined(SIMD_SZ) guard to pf_neon_float.h and pf_altivec_float.h,
matching the guard already present in pf_sse1_float.h. This prevents
redefinition errors when multiple SIMD backends match (e.g. Emscripten
with -msimd128 enabling SSE while __arm__ and PFFFT_ENABLE_NEON are
also defined).

Fixes #94

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detect Emscripten in CMake and pass -msimd128, which activates
Emscripten's NEON-to-WASM-SIMD compatibility layer (arm_neon.h mapped
to wasm_simd128 intrinsics). This lets the existing NEON code path
produce WASM SIMD output without source changes.

Also fix ctest for cross-compiled targets:
- Use target names in add_test() so CMake prepends
  CMAKE_CROSSCOMPILING_EMULATOR (node) when running .js outputs
- Add -sALLOW_MEMORY_GROWTH=1 for test_pffastconv to prevent OOM
  in benchmark mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fft_cpp_11 with ctest

These executables were built but never registered as tests, so ctest
never ran them. Uses bare target names so CMAKE_CROSSCOMPILING_EMULATOR
is applied automatically (needed for Emscripten/node).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marton78
marton78 force-pushed the fix-emscripten-build branch from a1546d0 to 8c4b979 Compare April 22, 2026 09:22
@marton78 marton78 changed the title Fix SIMD header mutual exclusion for NEON and Altivec Fix Emscripten build with SIMD Apr 22, 2026
@marton78
marton78 merged commit e9241f8 into master Apr 22, 2026
6 of 8 checks passed
@marton78
marton78 deleted the fix-emscripten-build branch April 22, 2026 09:40
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.

Emscripten master v4sf_union

1 participant