From a22ff68e9ee0735811dfe95b34eafe65e53108fc Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 8 May 2016 18:48:05 -0700 Subject: [PATCH] jit-ir: Skip flushing when updating PC. --- Core/MIPS/IR/IRPassSimplify.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/IR/IRPassSimplify.cpp b/Core/MIPS/IR/IRPassSimplify.cpp index f6002fb46a..3ea09d11c5 100644 --- a/Core/MIPS/IR/IRPassSimplify.cpp +++ b/Core/MIPS/IR/IRPassSimplify.cpp @@ -273,7 +273,16 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out) { break; case IROp::Downcount: - out.Write(inst); + case IROp::SetPCConst: + goto doDefault; + + case IROp::SetPC: + if (gpr.IsImm(inst.src1)) { + out.Write(IROp::SetPCConst, out.AddConstant(gpr.GetImm(inst.src1))); + } else { + gpr.MapIn(inst.src1); + goto doDefault; + } break; // FP-only instructions don't need to flush immediates.