MCPcopy Create free account
hub / github.com/MariaDB/server / my_count_bits_uint32

Function my_count_bits_uint32

include/my_bit.h:94–99  ·  view source on GitHub ↗

Count bits in 32bit integer Algorithm by Sean Anderson, according to: http://graphics.stanford.edu/~seander/bithacks.html under "Counting bits set, in parallel" (Original code public domain). */

Source from the content-addressed store, hash-verified

92 (Original code public domain).
93*/
94static inline uint my_count_bits_uint32(uint32 v)
95{
96 v = v - ((v >> 1) & 0x55555555);
97 v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
98 return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
99}
100
101
102static inline uint my_count_bits(ulonglong x)

Callers 2

fix_length_and_decMethod · 0.85
my_count_bitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected