summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
Diffstat (limited to 'lisc')
-rw-r--r--lisc/lisc.h14
-rw-r--r--lisc/spill.c4
-rw-r--r--lisc/util.c17
3 files changed, 4 insertions, 31 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 1c3f3f5..bdd0a9d 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -11,7 +11,8 @@ typedef unsigned int uint;
 typedef unsigned short ushort;
 typedef unsigned long ulong;
 
-typedef struct Bits Bits;
+#define BIT(n) (1ul << (n))
+
 typedef struct BSet BSet;
 typedef struct Ref Ref;
 typedef struct OpDesc OpDesc;
@@ -95,16 +96,6 @@ struct BSet {
 	ulong *t;
 };
 
-struct Bits {
-	ulong t[BITS];
-};
-
-#define BIT(n)     (1ul << (n))
-#define BZERO(b)   ((b) = (Bits){{0}})
-#define BGET(b, n) (1&((b).t[n/NBit]>>(n%NBit)))
-#define BSET(b, n) ((b).t[n/NBit] |= BIT(n%NBit))
-#define BCLR(b, n) ((b).t[n/NBit] &= ~BIT(n%NBit))
-
 struct Ref {
 	uint16_t type:2;
 	uint16_t val:14;
@@ -467,7 +458,6 @@ void freeall(void);
 Blk *bnew(void);
 void emit(int, int, Ref, Ref, Ref);
 void emiti(Ins);
-int bcnt(Bits *);
 void idup(Ins **, Ins *, ulong);
 Ins *icpy(Ins *, Ins *, ulong);
 void *vnew(ulong, size_t);
diff --git a/lisc/spill.c b/lisc/spill.c
index 3a7bc35..6f67319 100644
--- a/lisc/spill.c
+++ b/lisc/spill.c
@@ -290,8 +290,8 @@ dopm(Blk *b, Ins *i, BSet *v)
 		i--;
 		t = i->to.val;
 		if (!req(i->to, R))
-		if (BGET(*v, t)) {
-			BCLR(*v, t);
+		if (bshas(v, t)) {
+			bsclr(v, t);
 			store(i->to, tmp[t].slot);
 		}
 		bsset(v, i->arg[0].val);
diff --git a/lisc/util.c b/lisc/util.c
index 4f09d93..07b1c20 100644
--- a/lisc/util.c
+++ b/lisc/util.c
@@ -108,23 +108,6 @@ emiti(Ins i)
 	emit(i.op, i.cls, i.to, i.arg[0], i.arg[1]);
 }
 
-int
-bcnt(Bits *b)
-{
-	int z, i, j;
-	ulong tmp;
-
-	i = 0;
-	for (z=0; z<BITS; z++) {
-		tmp = b->t[z];
-		for (j=0; j<64; j++) {
-			i += 1 & tmp;
-			tmp >>= 1;
-		}
-	}
-	return i;
-}
-
 void
 idup(Ins **pd, Ins *s, ulong n)
 {