Skip to content

Commit eacfa36

Browse files
committed
SPU/DisAsm: Fix constant propagation with non-GPR-writing instructions
1 parent fdbb0b0 commit eacfa36

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

rpcs3/Emu/Cell/SPUDisAsm.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc, u32 TTL) c
104104

105105
//const auto flag = g_spu_iflag.decode(opcode);
106106

107-
// TODO: It detects spurious register modifications
108-
if (u32 dst = type & spu_itype::_quadrop ? +op0.rt4 : +op0.rt; dst == reg)
107+
if (u32 dst = type & spu_itype::_quadrop ? +op0.rt4 : +op0.rt; dst == reg && !(type & spu_itype::zregmod))
109108
{
110109
// Note: It's not 100% reliable because it won't detect branch targets within [i, dump_pc] range (e.g. if-else statement for command's value)
111110
switch (type)
@@ -183,15 +182,6 @@ std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc, u32 TTL) c
183182

184183
return { true, reg_val | v128::from32p(op0.i16) };
185184
}
186-
case spu_itype::STQA:
187-
case spu_itype::STQD:
188-
case spu_itype::STQR:
189-
case spu_itype::STQX:
190-
case spu_itype::WRCH:
191-
{
192-
// Do not modify RT
193-
break;
194-
}
195185
case spu_itype::SHLQBYI:
196186
{
197187
if (op0.si7)

0 commit comments

Comments
 (0)