aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2023-06-10 14:22:03 +0200
committer lemon<lsof@mailbox.org>2023-06-10 14:22:03 +0200
commit5ac04c7a3ec11d939a3773876b6924e1ae39f1a5 (patch)
tree28712d39b25ee80bc971cced1d2cba8387694412 /common.h
parent22e20cf906fa3904eedfe34efc58a7b56116ce42 (diff)
isel skeleton
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/common.h b/common.h
index f45ce62..11741de 100644
--- a/common.h
+++ b/common.h
@@ -99,6 +99,7 @@ struct option {
struct {
bool p : 1, /* after parsing */
a : 1, /* after abi0 */
+ i : 1, /* after isel */
r : 1; /* after regalloc */
} dbg;
};
@@ -336,7 +337,7 @@ enum { BSNBIT = 8 * sizeof(uvlong) };
#define BSSIZE(nbit) ((nbit) / BSNBIT + ((nbit) % BSNBIT != 0))
static inline bool
-bstest(struct bitset *bs, uint i)
+bstest(const struct bitset *bs, uint i)
{
return bs[i / BSNBIT].u >> i % BSNBIT & 1;
}
@@ -359,6 +360,12 @@ bszero(struct bitset bs[/*siz*/], uint siz)
memset(bs, 0, siz * sizeof *bs);
}
+static inline void
+bscopy(struct bitset dst[/*siz*/], const struct bitset src[/*siz*/], uint siz)
+{
+ while (--siz) dst++->u = src++->u;
+}
+
static inline bool
bsiter(uint *i, struct bitset bs[/*siz*/], uint siz)
{