| 59 | */ |
| 60 | template <typename Key> |
| 61 | static unsigned tzcount(Key key) |
| 62 | { |
| 63 | if (key.none()) |
| 64 | return key.size(); |
| 65 | Key mask = 0xFFFFFFFFFFFFFFFFull; |
| 66 | for (unsigned count = 0; ; count += 64) |
| 67 | { |
| 68 | uint64_t key64 = (key & mask).to_ullong(); |
| 69 | if (key64 != 0) |
| 70 | return count + __builtin_ctzll(key64); |
| 71 | key >>= 64; |
| 72 | } |
| 73 | } |
| 74 | template <> |
| 75 | unsigned tzcount<Key128>(Key128 key) |
| 76 | { |