glasm: Fix register allocation when moving immediate on GLASM

This commit is contained in:
ReinUsesLisp 2021-05-10 03:47:31 -03:00 committed by ameerj
parent 0839e46736
commit deda89372f
3 changed files with 92 additions and 45 deletions

View file

@ -99,8 +99,12 @@ public:
Register LongDefine(IR::Inst& inst);
[[nodiscard]] Value Peek(const IR::Value& value);
Value Consume(const IR::Value& value);
void Unref(IR::Inst& inst);
[[nodiscard]] Register AllocReg();
[[nodiscard]] Register AllocLongReg();
@ -123,9 +127,13 @@ private:
static constexpr size_t NUM_REGS = 4096;
static constexpr size_t NUM_ELEMENTS = 4;
Value MakeImm(const IR::Value& value);
Register Define(IR::Inst& inst, bool is_long);
Value Consume(IR::Inst& inst);
Value PeekInst(IR::Inst& inst);
Value ConsumeInst(IR::Inst& inst);
Id Alloc(bool is_long);