aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-ppc/op_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 13c1fbb00f..06a5a561ca 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -331,7 +331,8 @@ void do_mulldo (void)
uint64_t tl;
muls64(&tl, &th, T0, T1);
- if (likely(th == 0)) {
+ /* If th != 0 && th != -1, then we had an overflow */
+ if (likely((th + 1) <= 1)) {
xer_ov = 0;
} else {
xer_ov = 1;