idle skipping seems to work!

This commit is contained in:
2026-06-03 10:07:11 +02:00
parent cb8bb634ae
commit 204f0e13b0
5 changed files with 185 additions and 149 deletions
+5 -5
View File
@@ -38,7 +38,7 @@ void JIT::InvalidateBlock(const u32 paddr) {
blockCache[index] = {};
}
std::optional<u32> JIT::FetchInstruction(s64 vaddr) {
std::optional<Instruction> JIT::FetchInstruction(s64 vaddr) {
u32 paddr = 0;
if (Core::IsAddressError(0b11, vaddr)) [[unlikely]] {
@@ -62,7 +62,7 @@ std::optional<u32> JIT::FetchInstruction(s64 vaddr) {
return std::nullopt;
}
const u32 instr = Core::GetMem().Read<u32>(paddr);
const Instruction instr = Core::GetMem().Read<u32>(paddr);
info("{}", Disassembler::GetInstance().DisassembleSimple(paddr, instr).full);
@@ -169,12 +169,12 @@ u32 JIT::Step() {
blockPC = blockNextPC;
blockNextPC += 4;
if (InstrEndsBlock(instruction.value())) {
const auto delay_instruction = FetchInstruction(blockPC); // get instruction in delay slot
if (instruction.value().EndsBlock()) {
auto delay_instruction = FetchInstruction(blockPC); // get instruction in delay slot
if (!delay_instruction)
return 0;
if (InstrEndsBlock(delay_instruction.value())) {
if (delay_instruction.value().EndsBlock()) {
Util::Error::GetInstance().Throw({Util::Error::Severity::NON_FATAL},
{Util::Error::Type::JIT_BRANCH_INSIDE_DELAY_SLOT}, blockPC, {},
"[JIT]: Unhandled case of branch from delay slot!");