Repository navigation
Add wasm32 simd128 dedup - #25
Merged
Merged
Conversation
Share one implementation over a small per-arch v128 module and a const-generated 256-entry shuffle table, replacing the hand-written UNIQSHUF_NEON table and wasm per-half compaction. Use a lane shift (vext / i32x4_shuffle) for the preceding-element rotation. Dedup microbench: ~1.2x on NEON, ~1.15x throughput on wasm (wasmtime). Microbenchmark: append_unique_vals, append_unique_vals_2 and append_filtered_vals over 64Ki non-decreasing u32x8 vectors (mean run lengths 1-30), best of 200 runs.
Use to_bitmask() and a generic lane shift; both lower to addv / ext on NEON. wide's swizzle is single-register, so NEON keeps vqtbl2q_u8.
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.
LLM-written wasm32 simd128 intrinsics for dedup. Second (large -160 line) commit merges NEON and wasm32 simd128 paths delivering speedups in both paths in a microbenchmark. Discussed with @RagnarGrootKoerkamp but touches lots of your code @imartayan.