diff --git a/Source/Core/Core/Src/PowerPC/JitArm32/Jit.h b/Source/Core/Core/Src/PowerPC/JitArm32/Jit.h index 3abad77027..8c8c080800 100644 --- a/Source/Core/Core/Src/PowerPC/JitArm32/Jit.h +++ b/Source/Core/Core/Src/PowerPC/JitArm32/Jit.h @@ -172,6 +172,7 @@ public: // LoadStore void icbi(UGeckoInstruction _inst); + void dcbst(UGeckoInstruction _inst); void lbz(UGeckoInstruction _inst); void lhz(UGeckoInstruction _inst); void lha(UGeckoInstruction _inst); diff --git a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_LoadStore.cpp index 130c877ccf..e019d3e353 100644 --- a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_LoadStore.cpp @@ -615,6 +615,21 @@ void JitArm::lwzx(UGeckoInstruction inst) SetJumpTarget(DoNotLoad); //// u32 temp = Memory::Read_U32(_inst.RA ? (m_GPR[_inst.RA] + m_GPR[_inst.RB]) : m_GPR[_inst.RB]); } + +void JitArm::dcbst(UGeckoInstruction inst) +{ + INSTRUCTION_START + JITDISABLE(LoadStore) + + // If the dcbst instruction is preceded by dcbt, it is flushing a prefetched + // memory location. Do not invalidate the JIT cache in this case as the memory + // will be the same. + // dcbt = 0x7c00022c + if ((Memory::ReadUnchecked_U32(js.compilerPC - 4) & 0x7c00022c) != 0x7c00022c) + { + Default(inst); return; + } +} void JitArm::icbi(UGeckoInstruction inst) { Default(inst); diff --git a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Tables.cpp b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Tables.cpp index 467834d9d7..570bde105c 100644 --- a/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Tables.cpp +++ b/Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Tables.cpp @@ -212,7 +212,7 @@ static GekkoOPTemplate table31[] = {824, &JitArm::Default}, //"srawix", OPTYPE_INTEGER, FL_OUT_A | FL_IN_B | FL_IN_S | FL_RC_BIT}}, {24, &JitArm::Default}, //"slwx", OPTYPE_INTEGER, FL_OUT_A | FL_IN_B | FL_IN_S | FL_RC_BIT}}, - {54, &JitArm::Default}, //"dcbst", OPTYPE_DCACHE, 0, 4}}, + {54, &JitArm::dcbst}, //"dcbst", OPTYPE_DCACHE, 0, 4}}, {86, &JitArm::Default}, //"dcbf", OPTYPE_DCACHE, 0, 4}}, {246, &JitArm::Default}, //"dcbtst", OPTYPE_DCACHE, 0, 1}}, {278, &JitArm::Default}, //"dcbt", OPTYPE_DCACHE, 0, 1}},