system: Ensure value of CNTPCT_EL0 is accurate
Since we currently only update the host's tick count at the end of a block, we force an end-of-block before executing a MRS %, CNTPCT_ELO instruction.
This commit is contained in:
parent
84affdb260
commit
3f602129f4
1 changed files with 5 additions and 0 deletions
|
@ -105,6 +105,11 @@ bool TranslatorVisitor::MRS(Imm<1> o0, Imm<3> op1, Imm<4> CRn, Imm<4> CRm, Imm<3
|
||||||
X(32, Rt, ir.GetCTR());
|
X(32, Rt, ir.GetCTR());
|
||||||
return true;
|
return true;
|
||||||
case SystemRegisterEncoding::CNTPCT_EL0:
|
case SystemRegisterEncoding::CNTPCT_EL0:
|
||||||
|
// HACK: Ensure that this is the first instruction in the block it's emitted in, so the cycle count is most up-to-date.
|
||||||
|
if (!ir.block.empty()) {
|
||||||
|
ir.SetTerm(IR::Term::LinkBlock{*ir.current_location});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
X(64, Rt, ir.GetCNTPCT());
|
X(64, Rt, ir.GetCNTPCT());
|
||||||
return true;
|
return true;
|
||||||
case SystemRegisterEncoding::FPCR:
|
case SystemRegisterEncoding::FPCR:
|
||||||
|
|
Loading…
Reference in a new issue