Skip to content
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

remove unnecessary & ~0x7 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion popcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ inline int select64_broadword(uint64 x, int k) {

// Phase 2: compare each byte sum with the residual
const uint64 residual_step_8 = residual * ONES_STEP_8;
const int place = ( LEQ_STEP_8( byte_sums, residual_step_8 ) * ONES_STEP_8 >> 53 ) & ~0x7;
const int place = ( LEQ_STEP_8( byte_sums, residual_step_8 ) * ONES_STEP_8 >> 53 );

// Phase 3: Locate the relevant byte and make 8 copies with incremental masks
const int byte_rank = residual - ( ( ( byte_sums << 8 ) >> place ) & 0xFF );
Expand Down