irjit: Consistently dirty vfpuctrl in IR.

This commit is contained in:
Unknown W. Brackets 2023-08-06 08:36:19 -07:00
parent a29a35b91a
commit a32889d3ca
2 changed files with 28 additions and 0 deletions

View File

@ -716,6 +716,20 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts
break;
case IROp::SetCtrlVFPU:
gpr.MapDirty(IRREG_VFPU_CTRL_BASE + inst.dest);
goto doDefault;
case IROp::SetCtrlVFPUReg:
if (gpr.IsImm(inst.src1)) {
out.Write(IROp::SetCtrlVFPU, inst.dest, out.AddConstant(gpr.GetImm(inst.src1)));
} else {
gpr.MapDirtyIn(IRREG_VFPU_CTRL_BASE + inst.dest, inst.src1);
out.Write(inst);
}
break;
case IROp::SetCtrlVFPUFReg:
gpr.MapDirty(IRREG_VFPU_CTRL_BASE + inst.dest);
goto doDefault;
case IROp::FCvtWS:
@ -777,6 +791,18 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts
gpr.MapDirtyIn(inst.dest, IRREG_VFPU_CTRL_BASE + inst.src1);
goto doDefault;
case IROp::FCmpVfpuBit:
gpr.MapDirty(IRREG_VFPU_CC);
goto doDefault;
case IROp::FCmovVfpuCC:
gpr.MapIn(IRREG_VFPU_CC);
goto doDefault;
case IROp::FCmpVfpuAggregate:
gpr.MapDirtyIn(IRREG_VFPU_CC, IRREG_VFPU_CC);
goto doDefault;
case IROp::CallReplacement:
case IROp::Break:
case IROp::Syscall:

View File

@ -1,4 +1,5 @@
#include <cstring>
#include "Common/Log.h"
#include "Core/MIPS/IR/IRRegCache.h"
#include "Core/MIPS/IR/IRInst.h"
@ -7,6 +8,7 @@ void IRRegCache::Flush(IRReg rd) {
return;
}
if (reg_[rd].isImm) {
_assert_((rd > 0 && rd < 32) || (rd >= IRTEMP_0 && rd < IRREG_VFPU_CTRL_BASE));
ir_->WriteSetConstant(rd, reg_[rd].immVal);
reg_[rd].isImm = false;
}