From 88ad920b8adbce8b00085c51a61e57b5fbc83b0c Mon Sep 17 00:00:00 2001 From: j_mayer Date: Thu, 25 Oct 2007 23:36:08 +0000 Subject: Fix PowerPC 64x64 bits multiplication overflow check. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3444 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/op_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3