mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Improve spu_thread::is_exec_code
This commit is contained in:
parent
a626ccfcad
commit
7c0d8fc29c
1 changed files with 24 additions and 5 deletions
|
@ -4034,10 +4034,10 @@ bool spu_thread::is_exec_code(u32 addr, std::span<const u8> ls_ptr, u32 base_add
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 addr0 = spu_branch_target(addr);
|
const u32 addr0 = spu_branch_target(addr);
|
||||||
const u32 op = read_from_ptr<be_t<u32>>(ls_ptr, addr0 - base_addr);
|
const spu_opcode_t op{read_from_ptr<be_t<u32>>(ls_ptr, addr0 - base_addr)};
|
||||||
const auto type = s_spu_itype.decode(op);
|
const auto type = s_spu_itype.decode(op.opcode);
|
||||||
|
|
||||||
if (type == spu_itype::UNK || !op)
|
if (type == spu_itype::UNK || !op.opcode)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4054,11 +4054,30 @@ bool spu_thread::is_exec_code(u32 addr, std::span<const u8> ls_ptr, u32 base_add
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto results = op_branch_targets(addr, spu_opcode_t{op});
|
auto results = op_branch_targets(addr, op);
|
||||||
|
|
||||||
if (results[0] == umax)
|
if (results[0] == umax)
|
||||||
{
|
{
|
||||||
break;
|
switch (type)
|
||||||
|
{
|
||||||
|
case spu_itype::BIZ:
|
||||||
|
case spu_itype::BINZ:
|
||||||
|
case spu_itype::BIHZ:
|
||||||
|
case spu_itype::BIHNZ:
|
||||||
|
{
|
||||||
|
results[0] = addr + 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (results[0] == umax)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (usz res_i = 1; res_i < results.size(); res_i++)
|
for (usz res_i = 1; res_i < results.size(); res_i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue