qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 05/13] target-ppc: add modulo word operations


From: Nikunj A Dadhania
Subject: Re: [Qemu-devel] [RFC v2 05/13] target-ppc: add modulo word operations
Date: Mon, 25 Jul 2016 22:01:26 +0530
User-agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu)

Richard Henderson <address@hidden> writes:
> On 07/23/2016 02:14 PM, Nikunj A Dadhania wrote:
[...]
> Basically, we check for the offending cases and modify the divisor prior to 
> the 
> division.  For unsigned:
>
>       a / (b == 0 ? 1 : b)
>
> For signed:
>
>       a / ((a == INT_MAX & b == -1) | (b == 0) ? : b)

So when we change the divisor to 1, undefined result is set as "a". Hope
that should be fine and doesnt break anything :-)

Regards,
Nikunj




reply via email to

[Prev in Thread] Current Thread [Next in Thread]