From b3762f81b1a276f06bace301d56c9e8f6538058d Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 16 Dec 2025 18:33:59 +0100 Subject: bitset: better implementation of bsiter() and stuff Also changed the type to size_t for portability --- ir/optmem.c | 2 +- ir/regalloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ir') diff --git a/ir/optmem.c b/ir/optmem.c index 35544b2..f9ad245 100644 --- a/ir/optmem.c +++ b/ir/optmem.c @@ -228,7 +228,7 @@ mem2reg(struct function *fn) FREQUIRE(FNUSE); - if (fn->nblk <= 64 * countof(bsbuf[0])) { + if (fn->nblk <= BSNBIT * countof(bsbuf[0])) { sb.sealed = bsbuf[0]; sb.marked = bsbuf[1]; memset(bsbuf[0], 0, BSSIZE(fn->nblk) * sizeof *bsbuf[0]); diff --git a/ir/regalloc.c b/ir/regalloc.c index 29d9f88..691793e 100644 --- a/ir/regalloc.c +++ b/ir/regalloc.c @@ -194,7 +194,7 @@ allocstk(struct rega *ra) for (int i = 0; i < BSSIZE(MAXSPILL); ++i) { if (ra->freestk[i].u != 0) { - s = i*64 + lowestsetbit(ra->freestk[i].u); + s = i*BSNBIT + lowestsetbit(ra->freestk[i].u); break; } } -- cgit v1.2.3