summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-03-24 20:42:29 -0400
committerLioncash <mathew1800@gmail.com>2018-03-24 20:48:05 -0400
commit89df65aa253064623e313cc102c6b6e371b2ea99 (patch)
treecd6533547266567c4d4621b169061dc37241230f /Source/Core
parent328ac424c0e3a99c618237458b1ae6a55fa691e2 (diff)
Interpreter_Integer: Correct precedence of overflow check in nego
The overflow check needs to occur before the condition register update due to the fact that the summary overflow (SO) bit is used in the updating of the condition register. If we set any overflow bits after updating the CR, then we can potentially incorrectly report that an overflow did not happen (in the case the SO bit wasn't set previously).
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
index 5c184e4ecc..71c27599e0 100644
--- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
+++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
@@ -591,11 +591,11 @@ void Interpreter::negx(UGeckoInstruction inst)
rGPR[inst.RD] = (~a) + 1;
- if (inst.Rc)
- Helper_UpdateCR0(rGPR[inst.RD]);
-
if (inst.OE)
PowerPC::SetXER_OV(a == 0x80000000);
+
+ if (inst.Rc)
+ Helper_UpdateCR0(rGPR[inst.RD]);
}
void Interpreter::subfx(UGeckoInstruction inst)