]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
Fix PowerPC 64x64 bits multiplication overflow check.
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 25 Oct 2007 23:36:08 +0000 (23:36 +0000)
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 25 Oct 2007 23:36:08 +0000 (23:36 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3444 c046a42c-6fe2-441c-8c8c-71466251a162

target-ppc/op_helper.c

index 13c1fbb00f498d4ff43cca45204d51d2293722b8..06a5a561caed28b7c8d5add60cac724bf028bc11 100644 (file)
@@ -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;