diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-09 20:32:48 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-09 20:32:48 +0300 |
| commit | 9295e8f445dae6431f8e7c543eb8c374742b136d (patch) | |
| tree | d85bbc15fb8d23089d4f5eeae44eececaaa9a2ee /include | |
| parent | 0f8532d4e7315b86e160abf4ced461e7678b5587 (diff) | |
| download | qbt-9295e8f445dae6431f8e7c543eb8c374742b136d.tar.gz qbt-9295e8f445dae6431f8e7c543eb8c374742b136d.zip | |
add constant value to some instructions
Diffstat (limited to 'include')
| -rw-r--r-- | include/qbt/nodes.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/qbt/nodes.h b/include/qbt/nodes.h index 718a83a..b8c601b 100644 --- a/include/qbt/nodes.h +++ b/include/qbt/nodes.h @@ -133,6 +133,7 @@ struct insn { struct val out; struct val in[2]; enum insn_flags flags; + long long v; }; static inline void set_insn_flags(struct insn *i, enum insn_flags flags) @@ -261,13 +262,15 @@ static inline bool same_val(struct val v1, struct val v2) static inline struct insn insn_create(enum insn_type o, enum val_type t, struct val r, struct val a0, - struct val a1) + struct val a1, + long long v) { return (struct insn) { .type = o, .vtype = t, .out = r, - .in = {a0, a1} + .in = {a0, a1}, + .v = v, }; } @@ -275,7 +278,7 @@ int64_t idalloc(struct fn *f, const char *id); int64_t idmatch(struct fn *f, const char *id); void insadd(struct blk *b, enum insn_type o, enum val_type t, struct val r, - struct val a0, struct val a1); + struct val a0, struct val a1, long long v); void finish_block(struct blk *b, enum insn_type cmp, struct val a0, struct val a1, const char *label); |
