SPU LLVM Recompiler (preview)

This commit is contained in:
Nekotekina 2018-05-02 21:49:19 +03:00
parent a975ecdc4f
commit 1ca51a023c
6 changed files with 2311 additions and 10 deletions

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@ protected:
SPUThread& m_spu;
u32 m_pos;
u32 m_size;
std::bitset<0x10000> m_block_info;
@ -35,4 +36,7 @@ public:
// Create recompiler instance (ASMJIT)
static std::unique_ptr<spu_recompiler_base> make_asmjit_recompiler(SPUThread& spu);
// Create recompiler instance (LLVM)
static std::unique_ptr<spu_recompiler_base> make_llvm_recompiler(SPUThread& spu);
};

View file

@ -536,6 +536,7 @@ SPUThread::SPUThread(const std::string& name, u32 index, lv2_spu_group* group)
if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
{
jit = spu_recompiler_base::make_llvm_recompiler(*this);
}
}

View file

@ -851,7 +851,18 @@ void Emulator::Load(bool add_only)
if (g_cfg.core.spu_debug)
{
fs::file log(Emu.GetCachePath() + "SPUJIT.log", fs::rewrite);
fs::file log;
if (g_cfg.core.spu_decoder == spu_decoder_type::asmjit)
{
log.open(Emu.GetCachePath() + "SPUJIT.log", fs::rewrite);
}
if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
{
log.open(Emu.GetCachePath() + "SPU.log", fs::rewrite);
}
log.write(fmt::format("SPU JIT Log\n\nTitle: %s\nTitle ID: %s\n\n", Emu.GetTitle(), Emu.GetTitleID()));
fs::create_dir(Emu.GetCachePath() + "SPU");
fs::remove_all(Emu.GetCachePath() + "SPU", false);

View file

@ -16,7 +16,7 @@
"precise": "This is extremely slow but may fix broken graphics in some games.",
"fast": "This is slower than the SPU Recompiler but significantly faster than the precise interpreter.\nGames rarely need this however.",
"ASMJIT": "This is the fastest option with very good compatibility.\nIf unsure, use this option.",
"LLVM": "This doesn't exist (yet)"
"LLVM": ""
},
"libraries": {
"auto": "Automatically selects the LLE libraries to load.\nWhile this option works fine in most cases, liblv2 is the preferred option.",

View file

@ -106,9 +106,6 @@
</item>
<item>
<widget class="QRadioButton" name="spu_llvm">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>LLVM Recompiler</string>
</property>