aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/ir.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-16 09:19:14 +0100
committerlemon <lsof@mailbox.org>2025-11-16 09:19:14 +0100
commitdfda5c86b24284aca09da6055ef721ff7a18cd7b (patch)
tree6a3f563d639f8ec380c6b5040593087f3b9516df /ir/ir.h
parent9abe27f6712852bd6a98d04baeca6d81470cc61c (diff)
factor type stuff into type.h
Diffstat (limited to 'ir/ir.h')
-rw-r--r--ir/ir.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/ir/ir.h b/ir/ir.h
index f453c51..613ef2a 100644
--- a/ir/ir.h
+++ b/ir/ir.h
@@ -1,4 +1,5 @@
#include "../common.h"
+#include "../type.h"
enum irclass {
KXXX,
@@ -137,6 +138,19 @@ enum { USERJUMP = 0xFFFF };
struct use { struct block *blk; ushort u; };
enum { MAXREGS = 64 };
+/** register set **/
+typedef uvlong regset;
+#define rsset(pS, r) (*(pS) |= 1ull << (r))
+#define rsclr(pS, r) (*(pS) &=~ (1ull << (r)))
+#define rstest(S, r) ((S) >> (r) & 1)
+static inline bool
+rsiter(int *i, uvlong rs)
+{
+ uvlong mask = -(1ull << *i);
+ if ((rs & mask) == 0) return 0;
+ *i = lowestsetbit(rs & mask);
+ return 1;
+}
struct function {
struct arena **arena;