[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC v2 05/13] target-ppc: add modulo word operations
From: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-ppc] [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
- [Qemu-ppc] [RFC v2 02/13] target-ppc: Introduce POWER ISA 3.0 flag, (continued)
[Qemu-ppc] [RFC v2 06/13] target-ppc: add modulo dword operations, Nikunj A Dadhania, 2016/07/23
[Qemu-ppc] [RFC v2 08/13] target-ppc: add cnttzw[.] instruction, Nikunj A Dadhania, 2016/07/23
[Qemu-ppc] [RFC v2 09/13] target-ppc: add cmpeqb instruction, Nikunj A Dadhania, 2016/07/23
[Qemu-ppc] [RFC v2 10/13] target-ppc: add setb instruction, Nikunj A Dadhania, 2016/07/23
[Qemu-ppc] [RFC v2 07/13] target-ppc: add cnttzd[.] instruction, Nikunj A Dadhania, 2016/07/23
[Qemu-ppc] [RFC v2 11/13] target-ppc: add maddld instruction, Nikunj A Dadhania, 2016/07/23