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). */
| 92 | (Original code public domain). |
| 93 | */ |
| 94 | static 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 | |
| 102 | static inline uint my_count_bits(ulonglong x) |
no outgoing calls
no test coverage detected