mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 16:01:42 +12:00
Minor optimization in SPU analyser
Reduce vector copy/allocation
This commit is contained in:
parent
4b381fbbb1
commit
7ea04d5d76
2 changed files with 10 additions and 7 deletions
|
@ -223,7 +223,7 @@ void spu_cache::initialize()
|
|||
}
|
||||
|
||||
// Call analyser
|
||||
std::vector<u32> func2 = compiler->block(ls.data(), func[0]);
|
||||
const std::vector<u32>& func2 = compiler->analyse(ls.data(), func[0]);
|
||||
|
||||
if (func2.size() != size0)
|
||||
{
|
||||
|
@ -758,6 +758,7 @@ void spu_runtime::handle_return(spu_thread* _spu)
|
|||
|
||||
spu_recompiler_base::spu_recompiler_base()
|
||||
{
|
||||
result.reserve(8192);
|
||||
}
|
||||
|
||||
spu_recompiler_base::~spu_recompiler_base()
|
||||
|
@ -808,7 +809,7 @@ void spu_recompiler_base::dispatch(spu_thread& spu, void*, u8* rip)
|
|||
}
|
||||
|
||||
// Compile
|
||||
spu.jit->make_function(spu.jit->block(spu._ptr<u32>(0), spu.pc));
|
||||
spu.jit->make_function(spu.jit->analyse(spu._ptr<u32>(0), spu.pc));
|
||||
|
||||
// Diagnostic
|
||||
if (g_cfg.core.spu_block_size == spu_block_size_type::giga)
|
||||
|
@ -870,11 +871,10 @@ void spu_recompiler_base::branch(spu_thread& spu, void*, u8* rip)
|
|||
atomic_storage<u64>::release(*reinterpret_cast<u64*>(rip), result);
|
||||
}
|
||||
|
||||
std::vector<u32> spu_recompiler_base::block(const be_t<u32>* ls, u32 entry_point)
|
||||
const std::vector<u32>& spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
|
||||
{
|
||||
// Result: addr + raw instruction data
|
||||
std::vector<u32> result;
|
||||
result.reserve(256);
|
||||
result.clear();
|
||||
result.push_back(entry_point);
|
||||
|
||||
// Initialize block entries
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue