From 782d4e9df0363ca9f64d8b92a3d6952d552f13a5 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 14 Jun 2023 15:05:43 +0200 Subject: add spilling for function calls, misc fixes --- common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 3628c89..a486426 100644 --- a/common.h +++ b/common.h @@ -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 -- cgit v1.2.3