diff --git a/Core/MIPS/IR/IRInst.cpp b/Core/MIPS/IR/IRInst.cpp index 376f9951b2..191ab8b2f7 100644 --- a/Core/MIPS/IR/IRInst.cpp +++ b/Core/MIPS/IR/IRInst.cpp @@ -1,6 +1,7 @@ #include "Common/CommonFuncs.h" #include "Core/MIPS/IR/IRInst.h" #include "Core/MIPS/MIPSDebugInterface.h" +#include "Core/HLE/ReplaceTables.h" // Legend // ====================== @@ -13,6 +14,7 @@ // 2 = FPR register, Vec2 (uncommon) // v = Vec4Init constant, chosen by immediate // s = Shuffle immediate (4 2-bit fields, choosing a xyzw shuffle) +// r = Replacement function (in constant field) static const IRMeta irMeta[] = { { IROp::Nop, "Nop", "" }, @@ -165,7 +167,7 @@ static const IRMeta irMeta[] = { { IROp::Break, "Break", "", IRFLAG_EXIT }, { IROp::SetPC, "SetPC", "_G" }, { IROp::SetPCConst, "SetPC", "_C" }, - { IROp::CallReplacement, "CallRepl", "GC", IRFLAG_BARRIER }, + { IROp::CallReplacement, "CallRepl", "Gr", IRFLAG_BARRIER }, { IROp::Breakpoint, "Breakpoint", "_C", IRFLAG_BARRIER }, { IROp::MemoryCheck, "MemoryCheck", "IGC", IRFLAG_BARRIER }, @@ -306,6 +308,16 @@ void DisassembleParam(char *buf, int bufSize, u8 param, char type, u32 constant) case 's': snprintf(buf, bufSize, "%c%c%c%c", xyzw[param & 3], xyzw[(param >> 2) & 3], xyzw[(param >> 4) & 3], xyzw[(param >> 6) & 3]); break; + case 'r': + { + const ReplacementTableEntry *entry = GetReplacementFunc(constant); + if (entry) { + snprintf(buf, bufSize, "%s", entry->name); + } else { + snprintf(buf, bufSize, "(unkn. repl %d)", constant); + } + break; + } case '_': case '\0': buf[0] = 0; diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 4b909c2d03..f864191b10 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -188,7 +188,7 @@ static const MIPSInstruction tableSpecial[64] = // 000000 ..... ..... ..... .... INSTR("jalr", JITFUNC(Comp_JumpReg), Dis_JumpRegType, Int_JumpRegType, IS_JUMP|IN_RS|OUT_RD|DELAYSLOT), INSTR("movz", JITFUNC(Comp_RType3), Dis_RType3, Int_RType3, OUT_RD|IN_RS|IN_RT|IS_CONDMOVE|CONDTYPE_EQ), INSTR("movn", JITFUNC(Comp_RType3), Dis_RType3, Int_RType3, OUT_RD|IN_RS|IN_RT|IS_CONDMOVE|CONDTYPE_NE), - INSTR("syscall", JITFUNC(Comp_Syscall), Dis_Syscall, Int_Syscall, IN_MEM|IN_OTHER|OUT_MEM|OUT_OTHER), + INSTR("syscall", JITFUNC(Comp_Syscall), Dis_Syscall, Int_Syscall, IN_MEM|IN_OTHER|OUT_MEM|OUT_OTHER|IS_SYSCALL), INSTR("break", JITFUNC(Comp_Break), Dis_Generic, Int_Break, 0), INVALID, INSTR("sync", JITFUNC(Comp_DoNothing), Dis_Generic, Int_Sync, 0), diff --git a/Core/MIPS/MIPSTables.h b/Core/MIPS/MIPSTables.h index 9c53a07ea0..905c69d6be 100644 --- a/Core/MIPS/MIPSTables.h +++ b/Core/MIPS/MIPSTables.h @@ -92,6 +92,8 @@ #define OUT_VD 0x100000000000ULL +#define IS_SYSCALL 0x200000000000ULL + #ifndef CDECL #define CDECL #endif diff --git a/UI/JitCompareScreen.cpp b/UI/JitCompareScreen.cpp index 0792a05141..540fe47849 100644 --- a/UI/JitCompareScreen.cpp +++ b/UI/JitCompareScreen.cpp @@ -9,6 +9,13 @@ #include "Core/MIPS/JitCommon/JitState.h" JitCompareScreen::JitCompareScreen() : UIDialogScreenWithBackground() { + JitBlockCacheDebugInterface *blockCacheDebug = MIPSComp::jit->GetBlockCacheDebugInterface(); + // The only defaults that make sense. + if (blockCacheDebug->SupportsProfiling()) { + listSort_ = ListSort::TIME_SPENT; + } else { + listSort_ = ListSort::BLOCK_LENGTH_DESC; + } FillBlockList(); } @@ -166,12 +173,15 @@ void JitCompareScreen::FillBlockList() { case ListType::FPU_BLOCKS: case ListType::VFPU_BLOCKS: { - const int flags = listType_ == ListType::FPU_BLOCKS ? IS_FPU : IS_VFPU; + const uint64_t flags = listType_ == ListType::FPU_BLOCKS ? IS_FPU : IS_VFPU; + // const uint64_t antiFlags = IS_SYSCALL; + const uint64_t antiFlags = 0; JitBlockMeta meta = blockCacheDebug->GetBlockMeta(i); if (meta.valid) { for (u32 addr = meta.addr; addr < meta.addr + meta.sizeInBytes; addr += 4) { MIPSOpcode opcode = Memory::Read_Instruction(addr); - if (MIPSGetInfo(opcode) & flags) { + MIPSInfo info = MIPSGetInfo(opcode); + if ((info & flags) && !(info & antiFlags)) { blockList_.push_back(i); break; } diff --git a/UI/JitCompareScreen.h b/UI/JitCompareScreen.h index b416f5b874..b3af60d9ff 100644 --- a/UI/JitCompareScreen.h +++ b/UI/JitCompareScreen.h @@ -46,7 +46,7 @@ private: }; ViewMode viewMode_ = ViewMode::BLOCK_LIST; ListType listType_ = ListType::ALL_BLOCKS; - ListSort listSort_ = ListSort::BLOCK_LENGTH_DESC; + ListSort listSort_ = ListSort::TIME_SPENT; int currentBlock_ = -1; // For DISASM mode int64_t sumTotalNanos_ = 0;