mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-10 07:24:54 +01:00
SPU/misc: Remove outdated Instruction statistics
This commit is contained in:
parent
16b05c930f
commit
188151fa99
|
|
@ -1176,108 +1176,6 @@ void spu_cache::initialize(bool build_existing_cache)
|
|||
if ((g_cfg.core.spu_decoder == spu_decoder_type::asmjit || g_cfg.core.spu_decoder == spu_decoder_type::llvm) && !func_list.empty())
|
||||
{
|
||||
spu_log.success("SPU Runtime: Built %u functions.", func_list.size());
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
std::string dump;
|
||||
dump.reserve(10'000'000);
|
||||
|
||||
std::map<std::span<u8>, spu_program*, span_less<u8>> sorted;
|
||||
|
||||
for (auto&& f : func_list)
|
||||
{
|
||||
// Interpret as a byte string
|
||||
std::span<u8> data = {reinterpret_cast<u8*>(f.data.data()), f.data.size() * sizeof(u32)};
|
||||
|
||||
sorted[data] = &f;
|
||||
}
|
||||
|
||||
std::unordered_set<u32> depth_n;
|
||||
|
||||
u32 n_max = 0;
|
||||
|
||||
for (auto&& [bytes, f] : sorted)
|
||||
{
|
||||
{
|
||||
sha1_context ctx;
|
||||
u8 output[20];
|
||||
|
||||
sha1_starts(&ctx);
|
||||
sha1_update(&ctx, bytes.data(), bytes.size());
|
||||
sha1_finish(&ctx, output);
|
||||
fmt::append(dump, "\n\t[%s] ", fmt::base57(output));
|
||||
}
|
||||
|
||||
u32 depth_m = 0;
|
||||
|
||||
for (auto&& [data, f2] : sorted)
|
||||
{
|
||||
u32 depth = 0;
|
||||
|
||||
if (f2 == f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < bytes.size(); i++)
|
||||
{
|
||||
if (i < data.size() && data[i] == bytes[i])
|
||||
{
|
||||
depth++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
depth_n.emplace(depth);
|
||||
depth_m = std::max(depth, depth_m);
|
||||
}
|
||||
|
||||
fmt::append(dump, "c=%06d,d=%06d ", depth_n.size(), depth_m);
|
||||
|
||||
bool sk = false;
|
||||
|
||||
for (u32 i = 0; i < std::min<usz>(bytes.size(), std::max<usz>(256, depth_m)); i++)
|
||||
{
|
||||
if (depth_m == i)
|
||||
{
|
||||
dump += '|';
|
||||
sk = true;
|
||||
}
|
||||
|
||||
fmt::append(dump, "%02x", bytes[i]);
|
||||
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
if (sk)
|
||||
{
|
||||
sk = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
dump += ' ';
|
||||
}
|
||||
|
||||
dump += ' ';
|
||||
}
|
||||
}
|
||||
|
||||
fmt::append(dump, "\n\t%49s", "");
|
||||
|
||||
for (u32 i = 0; i < std::min<usz>(f->data.size(), std::max<usz>(64, utils::aligned_div<u32>(depth_m, 4))); i++)
|
||||
{
|
||||
fmt::append(dump, "%-10s", g_spu_iname.decode(std::bit_cast<be_t<u32>>(f->data[i])));
|
||||
}
|
||||
|
||||
n_max = std::max(n_max, ::size32(depth_n));
|
||||
|
||||
depth_n.clear();
|
||||
}
|
||||
|
||||
spu_log.notice("SPU Cache Dump (max_c=%d): %s", n_max, dump);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize global cache instance
|
||||
|
|
|
|||
|
|
@ -2802,12 +2802,9 @@ public:
|
|||
std::string& llvm_log = function_log;
|
||||
raw_string_ostream out(llvm_log);
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
fmt::append(llvm_log, "LLVM IR at 0x%x:\n", func.entry_point);
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
}
|
||||
fmt::append(llvm_log, "LLVM IR at 0x%x:\n", func.entry_point);
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
|
||||
if (verifyModule(*_module, &out))
|
||||
{
|
||||
|
|
@ -3274,12 +3271,9 @@ public:
|
|||
std::string llvm_log;
|
||||
raw_string_ostream out(llvm_log);
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
fmt::append(llvm_log, "LLVM IR (interpreter):\n");
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
}
|
||||
fmt::append(llvm_log, "LLVM IR (interpreter):\n");
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
|
||||
if (verifyModule(*_module, &out))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue