Add SIMDE support for portable SIMD on non-x86 platforms#124
Open
wszqkzqk wants to merge 1 commit intomborgerding:masterfrom
Open
Add SIMDE support for portable SIMD on non-x86 platforms#124wszqkzqk wants to merge 1 commit intomborgerding:masterfrom
wszqkzqk wants to merge 1 commit intomborgerding:masterfrom
Conversation
This commit adds optional SIMDE (SIMD Everywhere) support to enable SIMD vectorization on non-x86 platforms such as ARM, RISC-V, LoongArch, WebAssembly, and others. Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds optional support for SIMDE (SIMD Everywhere). This allows the existing SSE-optimized codebase to compile and run with hardware acceleration on non-x86 architectures (such as ARM64/NEON, RISC-V, POWER, and WASM) without rewriting the core algorithm.
Features
xmmintrin.husage is preserved unlessKISSFFT_USE_SIMDEis explicitly enabled._mm_mallocis replaced with portable aligned allocation strategies (C11aligned_alloc, POSIXposix_memalign, or MSVC_aligned_malloc) only when building in SIMDE mode.SIMDE_ENABLE_NATIVE_ALIASES. Instead, it usessimde_prefixed intrinsics to prevent conflicts with system headers.Build
CMake:
Makefile:
Testing
I've verified that standard x86 builds (
KISSFFT_DATATYPE=simd) compile with-msseand behave identically tomasterand SIMDE builds compile successfully and passtest/tsimd.I've also verified it on LoongArch64. Tests were performed on LoongArch64 (Arch Linux for Loong64, Loongson 3C5000L).
Benchmark Results (nfft=1800)
~3.57x faster on Loongson 3C5000L.
With ctest:
With Makefile: