diff options
Diffstat (limited to 'common.h')
| -rw-r--r-- | common.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -484,6 +484,14 @@ bsunion(struct bitset dst[/*siz*/], const struct bitset src[/*siz*/], uint siz) while (siz--) dst++->u |= src++->u; } +static inline uint +bscount(struct bitset bs[/*siz*/], uint siz) +{ + uint n = 0; + while (siz--) n += popcnt(bs++->u); + return n; +} + static inline bool bsiter(uint *i, struct bitset bs[/*siz*/], uint siz) { |