From d313c6e49bfb32ae24745e90eebe833da20efa1a Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 22 Jun 2023 21:54:08 +0200 Subject: change RMORE -> RADDR; use RXXX (RNONE) for special args,also undef --- ir.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'ir.h') diff --git a/ir.h b/ir.h index a8b3356..0ebe68b 100644 --- a/ir.h +++ b/ir.h @@ -59,13 +59,13 @@ struct call { }; enum refkind { - RNONE, - RTMP, /* reference to another instruction's result */ - RREG, /* machine register */ - RICON, /* small integer constants */ - RXCON, /* other constants (incl. external symbols) */ - RMORE, /* Ocall -> calltab idx, Ophi -> phitab idx, else -> addrtab idx */ - RTYPE, /* irtype */ + RXXX, /* used for empty ref (zeros), undef, and the special args of call,phi,etc */ + RTMP, /* reference to another instruction's result */ + RREG, /* machine register */ + RICON, /* small integer constants */ + RXCON, /* other constants (incl. external symbols) */ + RADDR, /* target-specific addressing mode */ + RTYPE, /* irtype */ }; union ref { @@ -78,6 +78,14 @@ struct addr { int shift, disp; }; +#define insrescls(ins) (oiscmp((ins).op) ? KI4 : (ins).cls) +#define NOREF ((union ref) {0}) +#define UNDREF ((union ref) {{ 0, -1 }}) +#define ZEROREF ((union ref) {{ RICON, 0 }}) +#define mkref(t, x) ((union ref) {{ (t), (x) }}) +#define mktyperef(t) ((union ref) {{ RTYPE, (t).bits }}) +#define ref2type(r) ((union irtype) {.bits = (r).i}) + enum op { Oxxx, #define _(o,...) O##o, @@ -195,13 +203,6 @@ extern struct calltab {vec_of(struct call);} calltab; extern struct phitab {vec_of(union ref *);} phitab; extern struct dattab {vec_of(struct irdat);} dattab; extern struct addr addrht[]; -#define insrescls(ins) (oiscmp((ins).op) ? KI4 : (ins).cls) -#define NOREF ((union ref) {0}) -#define UNDREF ((union ref) {{ 0, -1 }}) -#define ZEROREF ((union ref) {{ RICON, 0 }}) -#define mkref(t, x) ((union ref) {{ (t), (x) }}) -#define mktyperef(t) ((union ref) {{ RTYPE, (t).bits }}) -#define ref2type(r) ((union irtype) {.bits = (r).i}) #define mkinstr(O, C, ...) ((struct instr) { .op = (O), .cls = (C), .reg=0, __VA_ARGS__ }) #define mkarginstr(ty, x) mkinstr(Oarg, 0, mktyperef(ty), (x)) void irinit(struct function *); -- cgit v1.2.3