-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improve count vectorization: replace popcnt implementation with vector counting
#4614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Stephan T. Lavavej (StephanTLavavej)
merged 27 commits into
microsoft:main
from
AlexGuteniev:count_is_not_find
Apr 26, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b1aacab
`count` vectorization: replace `popcnt` implementation with vector co…
AlexGuteniev 6f134e8
Don't do extra reduce in the end
AlexGuteniev 35d61ac
As the SSE branch has no masked tail, can reduce in a single pace
AlexGuteniev ce8d8a5
Reduce as infrequently as possible
AlexGuteniev af456db
missing range coverage
AlexGuteniev c232f62
test counting zeros
AlexGuteniev 498408c
compare with expected in new coverage
AlexGuteniev 48efb24
separate _Count_traits_N and reuse reduce
AlexGuteniev 403ef98
formatting
AlexGuteniev 983e93a
Stand away from overflows!
AlexGuteniev 64b6fe6
sizes are bytes
AlexGuteniev 85263d8
counting overflow better coverage
AlexGuteniev 0a92efc
fewer ops to reduce
AlexGuteniev d816df0
Comments cleanup
AlexGuteniev dedc0cc
reduce 1-byte with `sad` instruction
AlexGuteniev 015d4f7
Simplify `_Count_traits_8::_Reduce_avx()` by reusing `_Reduce_sse()`.
StephanTLavavej 7e39a04
Fix `_Count_traits_4::_Max_count`.
StephanTLavavej 8d4aab5
Add detailed comments explaining each `_Max_count`.
StephanTLavavej 50d610a
For clarity, scope `__m128i _Count_vector` to each iteration of the S…
StephanTLavavej c06d4ff
For the AVX2 loop, scope `__m256i _Count_vector` separately for the m…
StephanTLavavej 3f95815
Fix comment typo.
StephanTLavavej 22b561b
Change test_count_zero() to test more lengths.
StephanTLavavej e587698
Restore popcnt approach
AlexGuteniev 87749d2
Get my bounds back
AlexGuteniev 2e1d6c7
typos
AlexGuteniev fc6dcbd
restore SSE4.2 comment
AlexGuteniev c5dd5c2
Clarify comments.
StephanTLavavej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.