- check_popcount64(0, 0);
-
- for (i = 0; i < 1000; i++) {
- uint32_t x = 0;
- int j;
-
- shuffle(bits, ARRAY_SIZE(bits)/2);
- for (j = 0; j < 32; j++) {
- x |= bits[j];
- check_popcount(x, j + 1);
- }
- assert(x == UINT32_MAX);
-
- shuffle(bits, ARRAY_SIZE(bits)/2);
- for (j = 31; j >= 0; j--) {
- x &= ~bits[j];
- check_popcount(x, j);
- }
- assert(x == 0);
- }