mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
Fixup SPU Interpreters
This commit is contained in:
parent
e1d3cf57c8
commit
f17400092d
2 changed files with 38 additions and 50 deletions
|
@ -2129,6 +2129,41 @@ u8* spu_thread::map_ls(utils::shm& shm, void* ptr)
|
||||||
return ls;
|
return ls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void spu_thread::init_spu_decoder()
|
||||||
|
{
|
||||||
|
ensure(!jit);
|
||||||
|
|
||||||
|
#if !defined(ARCH_X64) && !defined(ARCH_ARM64)
|
||||||
|
#error "Unimplemented"
|
||||||
|
#else
|
||||||
|
const spu_decoder_type spu_decoder = g_cfg.core.spu_decoder;
|
||||||
|
|
||||||
|
#if defined(ARCH_X64)
|
||||||
|
if (spu_decoder == spu_decoder_type::asmjit)
|
||||||
|
{
|
||||||
|
jit = spu_recompiler_base::make_asmjit_recompiler();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (spu_decoder == spu_decoder_type::llvm)
|
||||||
|
{
|
||||||
|
#if defined(ARCH_X64)
|
||||||
|
jit = spu_recompiler_base::make_fast_llvm_recompiler();
|
||||||
|
#elif defined(ARCH_ARM64)
|
||||||
|
jit = spu_recompiler_base::make_llvm_recompiler();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (spu_decoder == spu_decoder_type::_static || spu_decoder == spu_decoder_type::dynamic)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmt::throw_exception("Unsupported spu decoder '%s'", g_cfg.core.spu_decoder);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
spu_thread::spu_thread(lv2_spu_group* group, u32 index, std::string_view name, u32 lv2_id, bool is_isolated, u32 option)
|
spu_thread::spu_thread(lv2_spu_group* group, u32 index, std::string_view name, u32 lv2_id, bool is_isolated, u32 option)
|
||||||
: cpu_thread(idm::last_id())
|
: cpu_thread(idm::last_id())
|
||||||
, group(group)
|
, group(group)
|
||||||
|
@ -2140,31 +2175,7 @@ spu_thread::spu_thread(lv2_spu_group* group, u32 index, std::string_view name, u
|
||||||
, lv2_id(lv2_id)
|
, lv2_id(lv2_id)
|
||||||
, spu_tname(make_single<std::string>(name))
|
, spu_tname(make_single<std::string>(name))
|
||||||
{
|
{
|
||||||
#if defined(ARCH_X64)
|
init_spu_decoder();
|
||||||
if (g_cfg.core.spu_decoder == spu_decoder_type::asmjit)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_asmjit_recompiler();
|
|
||||||
}
|
|
||||||
else if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_fast_llvm_recompiler();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Unsupported spu decoder '%s'", g_cfg.core.spu_decoder);
|
|
||||||
}
|
|
||||||
#elif defined(ARCH_ARM64)
|
|
||||||
if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_llvm_recompiler();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Unsupported spu decoder '%s'", g_cfg.core.spu_decoder);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#error "Unimplemented"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (g_cfg.core.mfc_debug)
|
if (g_cfg.core.mfc_debug)
|
||||||
{
|
{
|
||||||
|
@ -2226,31 +2237,7 @@ spu_thread::spu_thread(utils::serial& ar, lv2_spu_group* group)
|
||||||
, lv2_id(ar)
|
, lv2_id(ar)
|
||||||
, spu_tname(make_single<std::string>(ar.operator std::string()))
|
, spu_tname(make_single<std::string>(ar.operator std::string()))
|
||||||
{
|
{
|
||||||
#if defined(ARCH_X64)
|
init_spu_decoder();
|
||||||
if (g_cfg.core.spu_decoder == spu_decoder_type::asmjit)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_asmjit_recompiler();
|
|
||||||
}
|
|
||||||
else if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_fast_llvm_recompiler();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Unsupported spu decoder '%s'", g_cfg.core.spu_decoder);
|
|
||||||
}
|
|
||||||
#elif defined(ARCH_ARM64)
|
|
||||||
if (g_cfg.core.spu_decoder == spu_decoder_type::llvm)
|
|
||||||
{
|
|
||||||
jit = spu_recompiler_base::make_llvm_recompiler();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Unsupported spu decoder '%s'", g_cfg.core.spu_decoder);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#error "Unimplemented"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (g_cfg.core.mfc_debug)
|
if (g_cfg.core.mfc_debug)
|
||||||
{
|
{
|
||||||
|
|
|
@ -638,6 +638,7 @@ public:
|
||||||
virtual ~spu_thread() override;
|
virtual ~spu_thread() override;
|
||||||
void cleanup();
|
void cleanup();
|
||||||
void cpu_init();
|
void cpu_init();
|
||||||
|
void init_spu_decoder();
|
||||||
|
|
||||||
static const u32 id_base = 0x02000000; // TODO (used to determine thread type)
|
static const u32 id_base = 0x02000000; // TODO (used to determine thread type)
|
||||||
static const u32 id_step = 1;
|
static const u32 id_step = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue