Repository navigation
Use PCMPISTRM for the intersection and difference comparison on SSE4.2+ in Stable Simd - #380
Merged
Merged
Conversation
Dr-Emann
force-pushed
the
stable_simd_pcmpistrm
branch
from
October 9, 2026 17:22
ea864db to
3efbae2
Compare
Dr-Emann
force-pushed
the
stable_simd_pcmpistrm
branch
from
October 9, 2026 19:05
3efbae2 to
b21d9fd
Compare
Dr-Emann
force-pushed
the
stable_simd_pcmpistrm
branch
2 times, most recently
from
October 9, 2026 19:56
9c10d41 to
51fde93
Compare
Merged
Kerollmops
approved these changes
Oct 21, 2026
Kerollmops
left a comment
Member
There was a problem hiding this comment.
Impressive changes thank you! And all that without unsafe, great 👍
I was wondering if it would be hard to do the same for ARMv8 architecture or if this function is not necessarily impacted by the PCMPESTRM instruction equivalent? I suppose it's not.
Dr-Emann
force-pushed
the
stable_simd_pcmpistrm
branch
from
October 22, 2026 03:23
51fde93 to
a7f51ff
Compare
Member
Author
|
I don't believe there's any equivalent operation on ARM/aarch64. |
Following CRoaring, compare a vector of `lhs` against a vector of `rhs` with the SSE4.2 PCMPISTRM instruction via a `fearless_simd::kernel!`. PCMPISTRM treats a zero lane as the end of the string, so the slower PCMPESTRM is used while either current vector may start with a zero (only possible at the start of the sorted arrays). Other SIMD levels keep the portable all-pairs comparison. Compared with the portable comparison, `and`, `and_len` and `sub` are 4-13% faster with default flags and 3-21% faster with `-C target-cpu=native`. Using PCMPESTRM throughout was 0-12% slower.
Dr-Emann
force-pushed
the
stable_simd_pcmpistrm
branch
from
October 23, 2026 00:14
a7f51ff to
1edc9af
Compare
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.
Look ma, no unsafe!
Following CRoaring, compare a vector of
lhsagainst a vector ofrhswith the SSE4.2 PCMPISTRM instruction via afearless_simd::kernel!. PCMPISTRM treats a zero lane as the end of the string, so the slower PCMPESTRM is used while either current vector may start with a zero (only possible at the start of the sorted arrays). Other SIMD levels keep the portable all-pairs comparison.Compared with the portable comparison,
and,and_lenandsubare 4-13% faster with default flags and 3-21% faster with-C target-cpu=native. Using PCMPESTRM throughout was 0-12% slower.