mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
SPU: fixup for duplicates in recompilers
Fixup for the edge case.
This commit is contained in:
parent
37dbbce194
commit
5f00b32867
2 changed files with 26 additions and 0 deletions
|
@ -47,6 +47,8 @@ void spu_recompiler::init()
|
||||||
|
|
||||||
spu_function_t spu_recompiler::compile(std::vector<u32>&& _func)
|
spu_function_t spu_recompiler::compile(std::vector<u32>&& _func)
|
||||||
{
|
{
|
||||||
|
const u32 start0 = _func[0];
|
||||||
|
|
||||||
const auto add_loc = m_spurt->add_empty(std::move(_func));
|
const auto add_loc = m_spurt->add_empty(std::move(_func));
|
||||||
|
|
||||||
if (!add_loc)
|
if (!add_loc)
|
||||||
|
@ -61,6 +63,17 @@ spu_function_t spu_recompiler::compile(std::vector<u32>&& _func)
|
||||||
|
|
||||||
const std::vector<u32>& func = add_loc->data;
|
const std::vector<u32>& func = add_loc->data;
|
||||||
|
|
||||||
|
if (func[0] != start0)
|
||||||
|
{
|
||||||
|
// Wait for the duplicate
|
||||||
|
while (!add_loc->compiled)
|
||||||
|
{
|
||||||
|
add_loc->compiled.wait(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return add_loc->compiled;
|
||||||
|
}
|
||||||
|
|
||||||
if (auto cache = g_fxo->get<spu_cache>(); cache && g_cfg.core.spu_cache && !add_loc->cached.exchange(1))
|
if (auto cache = g_fxo->get<spu_cache>(); cache && g_cfg.core.spu_cache && !add_loc->cached.exchange(1))
|
||||||
{
|
{
|
||||||
cache->add(func);
|
cache->add(func);
|
||||||
|
|
|
@ -4161,6 +4161,8 @@ public:
|
||||||
return compile_interpreter();
|
return compile_interpreter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const u32 start0 = _func[0];
|
||||||
|
|
||||||
const auto add_loc = m_spurt->add_empty(std::move(_func));
|
const auto add_loc = m_spurt->add_empty(std::move(_func));
|
||||||
|
|
||||||
if (!add_loc)
|
if (!add_loc)
|
||||||
|
@ -4170,6 +4172,17 @@ public:
|
||||||
|
|
||||||
const std::vector<u32>& func = add_loc->data;
|
const std::vector<u32>& func = add_loc->data;
|
||||||
|
|
||||||
|
if (func[0] != start0)
|
||||||
|
{
|
||||||
|
// Wait for the duplicate
|
||||||
|
while (!add_loc->compiled)
|
||||||
|
{
|
||||||
|
add_loc->compiled.wait(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return add_loc->compiled;
|
||||||
|
}
|
||||||
|
|
||||||
std::string log;
|
std::string log;
|
||||||
|
|
||||||
if (auto cache = g_fxo->get<spu_cache>(); cache && g_cfg.core.spu_cache && !add_loc->cached.exchange(1))
|
if (auto cache = g_fxo->get<spu_cache>(); cache && g_cfg.core.spu_cache && !add_loc->cached.exchange(1))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue