x86jit: Implement downcount in register.

This commit is contained in:
Unknown W. Brackets committed 2023-08-28 21:09:56 -07:00
1 parent 7f3e2e55b5
commit ee5381917a
4 files changed
+51 -22

No files matched your search

+5 -2
View File
@@ -46,8 +46,11 @@ void X64JitBackend::CompIR_Basic(IRInst inst) {
switch (inst.op) {
case IROp::Downcount:
//SUB(32, R(DOWNCOUNTREG), R(DOWNCOUNTREG), Imm32((s32)inst.constant));
SUB(32, MDisp(CTXREG, downcountOffset), Imm32((s32)inst.constant));
// As long as we don't care about flags, just use LEA.
if (jo.downcountInRegister)
LEA(32, DOWNCOUNTREG, MDisp(DOWNCOUNTREG, -(s32)inst.constant));
else
SUB(32, MDisp(CTXREG, downcountOffset), SImmAuto((s32)inst.constant));
break;
case IROp::SetConst: