Repository navigation
Reworked v_popcount implementation - #14232
Merged
Merged
Conversation
terfendail
force-pushed
the
popcount_rework
branch
4 times, most recently
from
April 3, 2019 12:26
9ed727e to
a0efeb5
Compare
Contributor
Author
Performance for SSE2 baseline
Performance for SSE3 baseline
Performance for SSE4_2 baseline
Performance for AVX2 baseline
|
alalek
reviewed
Apr 3, 2019
| result += v_reduce_sum(t); | ||
| v_uint64 t = vx_setzero_u64(); | ||
| for(; i <= n - v_uint8::nlanes; i += v_uint8::nlanes) | ||
| t += v_popcount(v_reinterpret_as_u64(vx_load(a + i))); |
Contributor
Author
There was a problem hiding this comment.
Yes, u64 could use _mm_sad_epu8 intrinsic that produce u64 results(technically it produce 16-bit results but scatter them as u64)
That's the actual reason of performance gain for SSE2/SSE3, but it doesn't affect SSE42 for some reason. AVX2 isn't affected because it actually already use this intrinsic thus producing slightly incorrect result
Contributor
There was a problem hiding this comment.
using CV_POPCNT_U64 should increase performance when SSE4.2 is enabled
8 of 9 tasks
terfendail
force-pushed
the
popcount_rework
branch
3 times, most recently
from
May 15, 2019 07:07
eb6d74b to
49f0b53
Compare
terfendail
force-pushed
the
popcount_rework
branch
from
May 15, 2019 16:39
49f0b53 to
7a55f2a
Compare
Contributor
Author
Performance for SSE2 baseline
Performance for SSE3 baseline
Performance for SSE4_2 baseline
Performance for AVX2 baseline
|
opencv-pushbot
pushed a commit
that referenced
this pull request
May 15, 2019
Merged
SavyaSanchi-Sharma
pushed a commit
to SavyaSanchi-Sharma/opencv
that referenced
this pull request
Jul 30, 2026
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 pullrequest changes
Reworked v_popcount implementation to provide number of bits in a single lane
TODO: