From 9295e8f445dae6431f8e7c543eb8c374742b136d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 9 Apr 2024 20:32:48 +0300 Subject: add constant value to some instructions --- src/regalloc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/regalloc.c') diff --git a/src/regalloc.c b/src/regalloc.c index 9c4d87e..f5157fe 100644 --- a/src/regalloc.c +++ b/src/regalloc.c @@ -447,7 +447,9 @@ static size_t do_call_saves(struct blk *b, struct vec *lifetimes, struct vec *rm continue; struct insn save = insn_create(SAVE, NOTYPE, - noclass(), r, imm_val(counter, I27)); + noclass(), r, + imm_val(counter, I27), 0); + insn_insert_before_call(b, save, call_pos + offset - 1); offset++; counter++; @@ -465,7 +467,9 @@ static size_t do_call_saves(struct blk *b, struct vec *lifetimes, struct vec *rm /* hmm, restore should maybe put r as its output to be * more consistent... */ struct insn restore = insn_create(RESTORE, NOTYPE, - noclass(), r, imm_val(counter, I27)); + noclass(), r, + imm_val(counter, I27), 0); + insn_insert_after_call(b, restore, call_pos - 1); counter++; offset++; -- cgit v1.3