diff options
| author | 2023-06-14 09:58:50 +0200 | |
|---|---|---|
| committer | 2023-06-14 10:00:47 +0200 | |
| commit | 8d8cf6584bf4081b54cd91fcaa42578cbd794440 (patch) | |
| tree | fe9d36de11813a80e30fd71adce19ade0dd9d111 /ir.h | |
| parent | 023692751f66866dfc72c48d288f33875faa65f0 (diff) | |
simpler handling of large constants in IR
Diffstat (limited to 'ir.h')
| -rw-r--r-- | ir.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -36,10 +36,8 @@ struct xcon { union { const char *sym; int dat; - int i4; - vlong i8; - float fs; - double fd; + vlong i; + double f; }; }; @@ -197,6 +195,12 @@ void irfini(struct function *); union irtype mkirtype(union type); union ref mkintcon(enum irclass, vlong); union ref mkfltcon(enum irclass, double); +#define iscon(r) in_range((r).t, RICON, RXCON) +#define concls(r) ((r).t == RICON ? KI4 : conht[(r).i].cls) +#define isintcon(r) (iscon(r) && kisint(concls(r))) +#define isfltcon(r) ((r).t == RXCON && kisflt(conht[(r).i].cls)) +#define intconval(r) ((r).t == RICON ? (r).i : conht[(r).i].i) +#define fltconval(r) (conht[(r).i].f) union ref mksymref(const char *); union ref mkdatref(uint siz, uint align, const void *, uint n, bool deref); struct instr mkalloca(uint siz, uint align); |