PPU Analyzer: Unuse per-instruction compilation on fallback

This commit is contained in:
Elad Ashkenazi 2024-05-30 09:28:14 +03:00
parent e75eec7392
commit 8fa23436f9

View file

@ -929,6 +929,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
} }
} }
bool used_fallback = false;
if (func_queue.empty() && segs[0].size >= 4u) if (func_queue.empty() && segs[0].size >= 4u)
{ {
// Fallback, identify functions using callers (no jumptable detection, tail calls etc) // Fallback, identify functions using callers (no jumptable detection, tail calls etc)
@ -955,6 +956,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
{ {
ppu_log.trace("Enqueued PPU function 0x%x using a caller at 0x%x", target, iaddr); ppu_log.trace("Enqueued PPU function 0x%x using a caller at 0x%x", target, iaddr);
add_func(target, 0, 0); add_func(target, 0, 0);
used_fallback = true;
} }
} }
} }
@ -2053,6 +2055,11 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
{ {
if (block.attr & ppu_attr::no_size && block.size > 4) if (block.attr & ppu_attr::no_size && block.size > 4)
{ {
if (used_fallback)
{
continue;
}
ppu_log.warning("Block 0x%x will be compiled on per-instruction basis (size=0x%x)", block.addr, block.size); ppu_log.warning("Block 0x%x will be compiled on per-instruction basis (size=0x%x)", block.addr, block.size);
for (u32 addr = block.addr; addr < block.addr + block.size; addr += 4) for (u32 addr = block.addr; addr < block.addr + block.size; addr += 4)