HLE: Add mechanics for sliced replacements.

This commit is contained in:
Unknown W. Brackets
2023-12-16 09:08:58 -08:00
parent 5311997753
commit 053831bf4d
12 changed files with 75 additions and 6 deletions
+7
View File
@@ -220,6 +220,13 @@ void RiscVJitBackend::CompIR_System(IRInst inst) {
QuickCallFunction(GetReplacementFunc(inst.constant)->replaceFunc, SCRATCH2);
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
LoadStaticRegisters();
regs_.Map(inst);
SRAIW(regs_.R(inst.dest), X10, 31);
// Absolute value trick: if neg, abs(x) == (x ^ -1) + 1.
XOR(X10, X10, regs_.R(inst.dest));
SUBW(X10, X10, regs_.R(inst.dest));
SUB(DOWNCOUNTREG, DOWNCOUNTREG, X10);
break;