Created
March 27, 2014 19:37
-
-
Save takikawa/9816339 to your computer and use it in GitHub Desktop.
This file contains 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
/* from libxcb, see license there */ | |
int xcb_popcount(uint32_t mask) | |
{ | |
uint32_t y; | |
y = (mask >> 1) & 033333333333; | |
y = mask - y - ((y >> 1) & 033333333333); | |
return ((y + (y >> 3)) & 030707070707) % 077; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment