mirror of https://github.com/RPCS3/rpcs3.git
SPU LLVM: implement bisect helper (debugging tool)
Added two new settings: SPU LLVM Lower/Upper Bound By manipulating values, conditionally avoid compiling programs. It uses hash of the programs (64-bit start hash of SHA-1). Programs which aren't compiled run with interpreter.
This commit is contained in:
parent
18dbd788e6
commit
8053d2602a
|
@ -465,6 +465,29 @@ void spu_cache::initialize()
|
|||
const u32 start = func.lower_bound;
|
||||
const u32 size0 = ::size32(func.data);
|
||||
|
||||
be_t<u64> hash_start;
|
||||
{
|
||||
sha1_context ctx;
|
||||
u8 output[20];
|
||||
|
||||
sha1_starts(&ctx);
|
||||
sha1_update(&ctx, reinterpret_cast<const u8*>(func.data.data()), func.data.size() * 4);
|
||||
sha1_finish(&ctx, output);
|
||||
std::memcpy(&hash_start, output, sizeof(hash_start));
|
||||
}
|
||||
|
||||
// Check hash against allowed bounds
|
||||
const bool inverse_bounds = g_cfg.core.spu_llvm_lower_bound > g_cfg.core.spu_llvm_upper_bound;
|
||||
|
||||
if ((!inverse_bounds && (hash_start < g_cfg.core.spu_llvm_lower_bound || hash_start > g_cfg.core.spu_llvm_upper_bound)) ||
|
||||
(inverse_bounds && (hash_start < g_cfg.core.spu_llvm_lower_bound && hash_start > g_cfg.core.spu_llvm_upper_bound)))
|
||||
{
|
||||
spu_log.error("[Debug] Skipped function %s", fmt::base57(hash_start));
|
||||
g_progr_pdone++;
|
||||
result++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Initialize LS with function data only
|
||||
for (u32 i = 0, pos = start; i < size0; i++, pos += 4)
|
||||
{
|
||||
|
@ -8848,7 +8871,15 @@ struct spu_fast : public spu_recompiler_base
|
|||
// Install pointer carefully
|
||||
const bool added = !add_loc->compiled && add_loc->compiled.compare_and_swap_test(nullptr, fn);
|
||||
|
||||
if (added)
|
||||
// Check hash against allowed bounds
|
||||
const bool inverse_bounds = g_cfg.core.spu_llvm_lower_bound > g_cfg.core.spu_llvm_upper_bound;
|
||||
|
||||
if ((!inverse_bounds && (m_hash_start < g_cfg.core.spu_llvm_lower_bound || m_hash_start > g_cfg.core.spu_llvm_upper_bound)) ||
|
||||
(inverse_bounds && (m_hash_start < g_cfg.core.spu_llvm_lower_bound && m_hash_start > g_cfg.core.spu_llvm_upper_bound)))
|
||||
{
|
||||
spu_log.error("[Debug] Skipped function %s", fmt::base57(be_t<u64>{m_hash_start}));
|
||||
}
|
||||
else if (added)
|
||||
{
|
||||
// Send work to LLVM compiler thread
|
||||
g_fxo->get<spu_llvm_thread>()->registered.push(m_hash_start, add_loc);
|
||||
|
|
|
@ -52,6 +52,8 @@ struct cfg_root : cfg::node
|
|||
cfg::_bool hook_functions{ this, "Hook static functions" };
|
||||
cfg::set_entry load_libraries{ this, "Load libraries" };
|
||||
cfg::_bool hle_lwmutex{ this, "HLE lwmutex" }; // Force alternative lwmutex/lwcond implementation
|
||||
cfg::uint64 spu_llvm_lower_bound{ this, "SPU LLVM Lower Bound" };
|
||||
cfg::uint64 spu_llvm_upper_bound{ this, "SPU LLVM Upper Bound", 0xffff'ffff'ffff'ffff };
|
||||
|
||||
cfg::_int<10, 3000> clocks_scale{ this, "Clocks scale", 100, true }; // Changing this from 100 (percentage) may affect game speed in unexpected ways
|
||||
cfg::_enum<sleep_timers_accuracy_level> sleep_timers_accuracy{ this, "Sleep Timers Accuracy",
|
||||
|
|
Loading…
Reference in New Issue