diff options
| author | 2023-06-14 15:05:43 +0200 | |
|---|---|---|
| committer | 2023-06-14 15:05:43 +0200 | |
| commit | 782d4e9df0363ca9f64d8b92a3d6952d552f13a5 (patch) | |
| tree | 8c71e107a8c0b54f53c2c94d053ad4cc1b7a441d /common.h | |
| parent | 8d8cf6584bf4081b54cd91fcaa42578cbd794440 (diff) | |
add spilling for function calls, misc fixes
Diffstat (limited to 'common.h')
| -rw-r--r-- | common.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -62,7 +62,7 @@ popcnt(uvlong x) { return __builtin_popcountll(x); #else uint n = 0; - while (x) x >>= 1, ++n; + while (x) n += x&1, x >>= 1; return n; #endif } @@ -375,13 +375,13 @@ bstest(const struct bitset *bs, uint i) static inline void bsset(struct bitset *bs, uint i) { - bs[i / BSNBIT].u |= 1 << i % BSNBIT; + bs[i / BSNBIT].u |= 1ull << i % BSNBIT; } static inline void bsclr(struct bitset *bs, uint i) { - bs[i / BSNBIT].u &= ~(1 << i % BSNBIT); + bs[i / BSNBIT].u &= ~(1ull << i % BSNBIT); } static inline void |