diff options
author | Mat M <mathew1800@gmail.com> | 2016-05-18 14:32:36 +0200 |
---|---|---|
committer | Mat M <mathew1800@gmail.com> | 2016-05-18 14:32:36 +0200 |
commit | 7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0 (patch) | |
tree | 438014cb26c451bf0c97534bb767dcc7ba171d90 | |
parent | Update ACT:U and create ACT:A (#1809) (diff) | |
parent | Fix read-after-write in SMUAD, SMLAD, SMUSD, SMLSD (diff) | |
download | yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar.gz yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar.bz2 yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar.lz yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar.xz yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.tar.zst yuzu-7a7488a0bb30abe41f182ed5fc66c4c9fe1a94f0.zip |
-rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 8d4b26815..cfc67287f 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -5527,28 +5527,32 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { // SMUAD and SMLAD if (BIT(op2, 1) == 0) { - RD = (product1 + product2); + u32 rd_val = (product1 + product2); if (inst_cream->Ra != 15) { - RD += cpu->Reg[inst_cream->Ra]; + rd_val += cpu->Reg[inst_cream->Ra]; if (ARMul_AddOverflowQ(product1 + product2, cpu->Reg[inst_cream->Ra])) cpu->Cpsr |= (1 << 27); } + RD = rd_val; + if (ARMul_AddOverflowQ(product1, product2)) cpu->Cpsr |= (1 << 27); } // SMUSD and SMLSD else { - RD = (product1 - product2); + u32 rd_val = (product1 - product2); if (inst_cream->Ra != 15) { - RD += cpu->Reg[inst_cream->Ra]; + rd_val += cpu->Reg[inst_cream->Ra]; if (ARMul_AddOverflowQ(product1 - product2, cpu->Reg[inst_cream->Ra])) cpu->Cpsr |= (1 << 27); } + + RD = rd_val; } } |