summary refs log tree commit diff
path: root/lisc/lisc.h
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-25 15:20:27 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-26 10:31:21 -0500
commit987b3def3394583321fee4543df9db76b9299bc6 (patch)
treedb0f28f28e2218f5e8cffe6fb2ec908a94e4c2cf /lisc/lisc.h
parent3e104e532b49038f94ec9770bbe3e765472cf613 (diff)
downloadroux-987b3def3394583321fee4543df9db76b9299bc6.tar.gz
start conversion to dynamic bitsets
Diffstat (limited to 'lisc/lisc.h')
-rw-r--r--lisc/lisc.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 19cc639..441f2cb 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -9,7 +9,7 @@ typedef unsigned short ushort;
 typedef unsigned long ulong;
 
 typedef struct Bits Bits;
-typedef struct Bitset BSet;
+typedef struct BSet BSet;
 typedef struct Ref Ref;
 typedef struct OpDesc OpDesc;
 typedef struct Ins Ins;
@@ -85,6 +85,11 @@ enum {
 	NBit    = 64,
 };
 
+struct BSet {
+	uint nt;
+	ulong *t;
+};
+
 struct Bits {
 	ulong t[BITS];
 };
@@ -336,7 +341,7 @@ struct Blk {
 
 	Blk **pred;
 	uint npred;
-	Bits in, out, gen;
+	BSet in[1], out[1], gen[1];
 	int nlive[2];
 	int loop;
 	char name[NString];
@@ -468,6 +473,18 @@ Ref newtmp(char *, Fn *);
 Ref getcon(int64_t, Fn *);
 void addcon(Con *, Con *);
 
+void bsinit(BSet *, uint);
+void bszero(BSet *);
+uint bscount(BSet *);
+int bshas(BSet *, uint);
+void bsset(BSet *, uint);
+void bsclr(BSet *, uint);
+void bscopy(BSet *, BSet *);
+void bsunion(BSet *, BSet *);
+void bsinter(BSet *, BSet *);
+void bsdiff(BSet *, BSet *);
+int bsiter(BSet *, uint *);
+
 /* parse.c */
 extern OpDesc opdesc[NOp];
 void parse(FILE *, void (Dat *), void (Fn *));
@@ -487,7 +504,7 @@ void ssa(Fn *);
 void copy(Fn *);
 
 /* live.c */
-Bits liveon(Blk *, Blk *);
+void liveon(BSet *, Blk *, Blk *);
 void filllive(Fn *);
 
 /* isel.c */