Commit 88ad920b8adbce8b00085c51a61e57b5fbc83b0c

Authored by j_mayer
1 parent e14fe0a9

Fix PowerPC 64x64 bits multiplication overflow check.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3444 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 2 additions and 1 deletions
target-ppc/op_helper.c
... ... @@ -331,7 +331,8 @@ void do_mulldo (void)
331 331 uint64_t tl;
332 332  
333 333 muls64(&tl, &th, T0, T1);
334   - if (likely(th == 0)) {
  334 + /* If th != 0 && th != -1, then we had an overflow */
  335 + if (likely((th + 1) <= 1)) {
335 336 xer_ov = 0;
336 337 } else {
337 338 xer_ov = 1;
... ...