summaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-25 23:36:08 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-25 23:36:08 +0000
commit88ad920b8adbce8b00085c51a61e57b5fbc83b0c (patch)
treef91ba4ab84694dd9f3a3122e61f0db1b4b124e12 /target-ppc
parente14fe0a921631ab6cf1f404ad6243a716cb84366 (diff)
downloadqemu-88ad920b8adbce8b00085c51a61e57b5fbc83b0c.zip
Fix PowerPC 64x64 bits multiplication overflow check.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3444 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-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;