summaryrefslogtreecommitdiff
path: root/includes/compiler/BitVectors.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-12-14 00:16:59 +0000
committerAsh Wolf <ninji@wuffs.org>2022-12-14 00:16:59 +0000
commit25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22 (patch)
treec0ee632aa3752884b996c562622e2ece88216ea4 /includes/compiler/BitVectors.h
parent9d2728a5605f651934fe67a6fe6986b3e4a2c011 (diff)
downloadMWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.tar.gz
MWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.zip
haha it's been a while since i last committed, hasn't it
Diffstat (limited to '')
-rw-r--r--includes/compiler/BitVectors.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/includes/compiler/BitVectors.h b/includes/compiler/BitVectors.h
index 7849dcb..068fec0 100644
--- a/includes/compiler/BitVectors.h
+++ b/includes/compiler/BitVectors.h
@@ -3,4 +3,19 @@
#include "compiler/common.h"
+extern void bitvectorcopy(UInt32 *dst, UInt32 *src, int len);
+extern int bitvectorchanged(UInt32 *dst, UInt32 *src, int len);
+extern void bitvectorinitialize(UInt32 *vec, int len, UInt32 initval);
+extern void bitvectorintersect(UInt32 *dst, UInt32 *src, int len);
+extern void bitvectorunion(UInt32 *dst, UInt32 *src, int len);
+extern void bitvectordifference(UInt32 *dst, UInt32 *src, int len);
+extern void bitvectorcomplement(UInt32 *dst, UInt32 *src, int len);
+extern int bitvectorcount(UInt32 *vec, int len);
+extern int bitvectorisempty(UInt32 *vec, int len);
+extern int bitvectorintersectionisempty(UInt32 *a, UInt32 *b, int len);
+
+#define bitvectorgetbit(_bit, _vec) ((1 << ((_bit) & 31)) & (_vec)[(_bit) >> 5])
+#define bitvectorsetbit(_bit, _vec) ((_vec)[(_bit) >> 5] |= 1 << ((_bit) & 31))
+#define bitvectorclearbit(_bit, _vec) ((_vec)[(_bit) >> 5] &= ~(1 << ((_bit) & 31)))
+
#endif