mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-08 01:59:41 +00:00
Add option to the JIT viewer to find a random block with VFPU instructions.
For inspection of jit results.
This commit is contained in:
parent
502cbc170a
commit
490deb9b5c
@ -27,6 +27,7 @@
|
||||
#include "UI/DevScreens.h"
|
||||
#include "UI/GameSettingsScreen.h"
|
||||
#include "Common/LogManager.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/MIPS/MIPSTables.h"
|
||||
#include "Core/MIPS/JitCommon/JitCommon.h"
|
||||
@ -264,6 +265,7 @@ void JitCompareScreen::CreateViews() {
|
||||
|
||||
leftColumn->Add(new Choice("Current"))->OnClick.Handle(this, &JitCompareScreen::OnCurrentBlock);
|
||||
leftColumn->Add(new Choice("Random"))->OnClick.Handle(this, &JitCompareScreen::OnRandomBlock);
|
||||
leftColumn->Add(new Choice("Random VFPU"))->OnClick.Handle(this, &JitCompareScreen::OnRandomVFPUBlock);
|
||||
leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
blockName_ = leftColumn->Add(new TextView("no block"));
|
||||
}
|
||||
@ -347,6 +349,33 @@ UI::EventReturn JitCompareScreen::OnRandomBlock(UI::EventParams &e) {
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn JitCompareScreen::OnRandomVFPUBlock(UI::EventParams &e) {
|
||||
JitBlockCache *blockCache = MIPSComp::jit->GetBlockCache();
|
||||
int numBlocks = blockCache->GetNumBlocks();
|
||||
if (numBlocks > 0) {
|
||||
bool anyVFPU = false;
|
||||
int tries = 0;
|
||||
while (!anyVFPU && tries < 10000) {
|
||||
currentBlock_ = rand() % numBlocks;
|
||||
const JitBlock *b = blockCache->GetBlock(currentBlock_);
|
||||
for (u32 addr = b->originalAddress; addr <= b->originalAddress + b->originalSize; addr += 4) {
|
||||
MIPSOpcode opcode = Memory::Read_Instruction(addr);
|
||||
if (MIPSGetInfo(opcode) & IS_VFPU) {
|
||||
char temp[256];
|
||||
MIPSDisAsm(opcode, addr, temp);
|
||||
INFO_LOG(HLE, "Stopping VFPU instruction: %s", temp)
|
||||
anyVFPU = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
tries++;
|
||||
}
|
||||
}
|
||||
UpdateDisasm();
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
||||
UI::EventReturn JitCompareScreen::OnCurrentBlock(UI::EventParams &e) {
|
||||
JitBlockCache *blockCache = MIPSComp::jit->GetBlockCache();
|
||||
std::vector<int> blockNum;
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
private:
|
||||
void UpdateDisasm();
|
||||
UI::EventReturn OnRandomBlock(UI::EventParams &e);
|
||||
UI::EventReturn OnRandomVFPUBlock(UI::EventParams &e);
|
||||
UI::EventReturn OnCurrentBlock(UI::EventParams &e);
|
||||
|
||||
int currentBlock_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user