diff --git a/src/frontend/A64/translate/impl/system.cpp b/src/frontend/A64/translate/impl/system.cpp index 6b4a7ed0..8d6db346 100644 --- a/src/frontend/A64/translate/impl/system.cpp +++ b/src/frontend/A64/translate/impl/system.cpp @@ -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()); return true; 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()); return true; case SystemRegisterEncoding::FPCR: