Home | History | Annotate | Download | only in cutils

Lines Matching refs:bitmask

28  * Bitmask Operations
31 * Additionally no bounds checking is done on the bitmask array.
54 static inline void bitmask_init(unsigned int *bitmask, int num_bits)
56 memset(bitmask, 0, BITS_TO_WORDS(num_bits)*sizeof(unsigned int));
59 static inline int bitmask_ffz(unsigned int *bitmask, int num_bits)
65 bit = ffs(~bitmask[i]);
78 static inline int bitmask_weight(unsigned int *bitmask, int num_bits)
84 weight += __builtin_popcount(bitmask[i]);
88 static inline void bitmask_set(unsigned int *bitmask, int bit)
90 bitmask[BIT_WORD(bit)] |= BIT_MASK(bit);
93 static inline void bitmask_clear(unsigned int *bitmask, int bit)
95 bitmask[BIT_WORD(bit)] &= ~BIT_MASK(bit);
98 static inline bool bitmask_test(unsigned int *bitmask, int bit)
100 return bitmask[BIT_WORD(bit)] & BIT_MASK(bit);