summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp12
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) {
5527 5527
5528 // SMUAD and SMLAD 5528 // SMUAD and SMLAD
5529 if (BIT(op2, 1) == 0) { 5529 if (BIT(op2, 1) == 0) {
5530 RD = (product1 + product2); 5530 u32 rd_val = (product1 + product2);
5531 5531
5532 if (inst_cream->Ra != 15) { 5532 if (inst_cream->Ra != 15) {
5533 RD += cpu->Reg[inst_cream->Ra]; 5533 rd_val += cpu->Reg[inst_cream->Ra];
5534 5534
5535 if (ARMul_AddOverflowQ(product1 + product2, cpu->Reg[inst_cream->Ra])) 5535 if (ARMul_AddOverflowQ(product1 + product2, cpu->Reg[inst_cream->Ra]))
5536 cpu->Cpsr |= (1 << 27); 5536 cpu->Cpsr |= (1 << 27);
5537 } 5537 }
5538 5538
5539 RD = rd_val;
5540
5539 if (ARMul_AddOverflowQ(product1, product2)) 5541 if (ARMul_AddOverflowQ(product1, product2))
5540 cpu->Cpsr |= (1 << 27); 5542 cpu->Cpsr |= (1 << 27);
5541 } 5543 }
5542 // SMUSD and SMLSD 5544 // SMUSD and SMLSD
5543 else { 5545 else {
5544 RD = (product1 - product2); 5546 u32 rd_val = (product1 - product2);
5545 5547
5546 if (inst_cream->Ra != 15) { 5548 if (inst_cream->Ra != 15) {
5547 RD += cpu->Reg[inst_cream->Ra]; 5549 rd_val += cpu->Reg[inst_cream->Ra];
5548 5550
5549 if (ARMul_AddOverflowQ(product1 - product2, cpu->Reg[inst_cream->Ra])) 5551 if (ARMul_AddOverflowQ(product1 - product2, cpu->Reg[inst_cream->Ra]))
5550 cpu->Cpsr |= (1 << 27); 5552 cpu->Cpsr |= (1 << 27);
5551 } 5553 }
5554
5555 RD = rd_val;
5552 } 5556 }
5553 } 5557 }
5554 5558