diff options
| author | 2023-06-10 14:22:03 +0200 | |
|---|---|---|
| committer | 2023-06-10 14:22:03 +0200 | |
| commit | 5ac04c7a3ec11d939a3773876b6924e1ae39f1a5 (patch) | |
| tree | 28712d39b25ee80bc971cced1d2cba8387694412 /common.h | |
| parent | 22e20cf906fa3904eedfe34efc58a7b56116ce42 (diff) | |
isel skeleton
Diffstat (limited to 'common.h')
| -rw-r--r-- | common.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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) { |