ppu interpreter: Improve SRD/SLD

This commit is contained in:
Eladash 2019-08-01 08:10:42 +03:00 committed by Ivan
parent a560498cd4
commit 6d0f2ae58a
1 changed files with 2 additions and 2 deletions

View File

@ -3266,7 +3266,7 @@ bool ppu_interpreter::CNTLZW(ppu_thread& ppu, ppu_opcode_t op)
bool ppu_interpreter::SLD(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::SLD(ppu_thread& ppu, ppu_opcode_t op)
{ {
const u32 n = ppu.gpr[op.rb]; const u32 n = ppu.gpr[op.rb] & 0x7f;
ppu.gpr[op.ra] = UNLIKELY(n & 0x40) ? 0 : ppu.gpr[op.rs] << n; ppu.gpr[op.ra] = UNLIKELY(n & 0x40) ? 0 : ppu.gpr[op.rs] << n;
if (UNLIKELY(op.rc)) ppu_cr_set<s64>(ppu, 0, ppu.gpr[op.ra], 0); if (UNLIKELY(op.rc)) ppu_cr_set<s64>(ppu, 0, ppu.gpr[op.ra], 0);
return true; return true;
@ -3985,7 +3985,7 @@ bool ppu_interpreter::SRW(ppu_thread& ppu, ppu_opcode_t op)
bool ppu_interpreter::SRD(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::SRD(ppu_thread& ppu, ppu_opcode_t op)
{ {
const u32 n = ppu.gpr[op.rb]; const u32 n = ppu.gpr[op.rb] & 0x7f;
ppu.gpr[op.ra] = UNLIKELY(n & 0x40) ? 0 : ppu.gpr[op.rs] >> n; ppu.gpr[op.ra] = UNLIKELY(n & 0x40) ? 0 : ppu.gpr[op.rs] >> n;
if (UNLIKELY(op.rc)) ppu_cr_set<s64>(ppu, 0, ppu.gpr[op.ra], 0); if (UNLIKELY(op.rc)) ppu_cr_set<s64>(ppu, 0, ppu.gpr[op.ra], 0);
return true; return true;