mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-06 00:59:18 +00:00
SPU: fix minor UB in STQD/LQD instructions
This commit is contained in:
parent
2b4da18709
commit
15bd3b8724
@ -4359,7 +4359,7 @@ void spu_recompiler::AHI(spu_opcode_t op)
|
||||
void spu_recompiler::STQD(spu_opcode_t op)
|
||||
{
|
||||
c->mov(*addr, SPU_OFF_32(gpr, op.ra, &v128::_u32, 3));
|
||||
if (op.si10) c->add(*addr, op.si10 << 4);
|
||||
if (op.si10) c->add(*addr, op.si10 * 16);
|
||||
c->and_(*addr, 0x3fff0);
|
||||
|
||||
if (utils::has_ssse3())
|
||||
@ -4382,7 +4382,7 @@ void spu_recompiler::STQD(spu_opcode_t op)
|
||||
void spu_recompiler::LQD(spu_opcode_t op)
|
||||
{
|
||||
c->mov(*addr, SPU_OFF_32(gpr, op.ra, &v128::_u32, 3));
|
||||
if (op.si10) c->add(*addr, op.si10 << 4);
|
||||
if (op.si10) c->add(*addr, op.si10 * 16);
|
||||
c->and_(*addr, 0x3fff0);
|
||||
|
||||
if (utils::has_ssse3())
|
||||
|
@ -1516,13 +1516,13 @@ bool spu_interpreter::AHI(spu_thread& spu, spu_opcode_t op)
|
||||
|
||||
bool spu_interpreter::STQD(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu._ref<v128>((spu.gpr[op.ra]._s32[3] + (op.si10 << 4)) & 0x3fff0) = spu.gpr[op.rt];
|
||||
spu._ref<v128>((spu.gpr[op.ra]._s32[3] + (op.si10 * 16)) & 0x3fff0) = spu.gpr[op.rt];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool spu_interpreter::LQD(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu.gpr[op.rt] = spu._ref<v128>((spu.gpr[op.ra]._s32[3] + (op.si10 << 4)) & 0x3fff0);
|
||||
spu.gpr[op.rt] = spu._ref<v128>((spu.gpr[op.ra]._s32[3] + (op.si10 * 16)) & 0x3fff0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user