SPU Analyzer: Fix register origin for Reduced Loop

This commit is contained in:
Elad
2026-04-02 21:00:25 +03:00
parent ff4444b18e
commit 13de8233b0
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -6194,7 +6194,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
{ {
const auto arg = reduced_loop->find_reg(reg); const auto arg = reduced_loop->find_reg(reg);
if (arg && reg != op_rt) if (arg && arg->regs.count() != 0)
{ {
if (reg_first == reg) if (reg_first == reg)
{ {
@@ -6217,6 +6217,12 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
} }
} }
if (type & spu_itype::memory || type == spu_itype::RDCH || type == spu_itype::RCHCNT)
{
// Register external origin
org.add_register_origin(s_reg_max);
}
*ensure(reduced_loop->find_reg(op_rt)) = org; *ensure(reduced_loop->find_reg(op_rt)) = org;
} }
+1 -1
View File
@@ -364,7 +364,7 @@ public:
struct origin_t struct origin_t
{ {
std::bitset<s_reg_max> regs{}; std::bitset<s_reg_max + 1> regs{};
u32 modified = 0; u32 modified = 0;
spu_itype_t mod1_type = spu_itype::UNK; spu_itype_t mod1_type = spu_itype::UNK;
spu_itype_t mod2_type = spu_itype::UNK; spu_itype_t mod2_type = spu_itype::UNK;