[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions
From: |
Al Viro |
Subject: |
Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions |
Date: |
Fri, 4 Jul 2014 00:22:08 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Jul 04, 2014 at 12:05:37AM +0100, Peter Maydell wrote:
> On 3 July 2014 23:47, Al Viro <address@hidden> wrote:
> > How can that be correct? Suppose a = b = 0. We get
> > tcg_gen_eqv_i64(tmp, va, vb); -> tmp = -1
> > tcg_gen_mov_i64(tmp2, va); -> tmp2 = 0
> > tcg_gen_add_i64(vc, va, vb); -> c = 0
> > tcg_gen_xor_i64(tmp2, tmp2, vc);-> tmp2 = 0
> > tcg_gen_and_i64(tmp, tmp, tmp2);-> tmp = -1
>
> tmp2 here is 0, so the result of this AND is 0, not -1...
Doh. Misread it as tcg_gen_add_i64, sorry.
Hmm... So it's ((a ^ ~b) & (a ^ c) < 0 as overflow condition, IOW
MSB(a) == MSB(b) && MSB(c) != MSB(a). OK, that works; might deserve
a comment, though...
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, (continued)
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Richard Henderson, 2014/07/02
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/02
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Richard Henderson, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Peter Maydell, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions,
Al Viro <=
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/03
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Richard Henderson, 2014/07/04
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/04
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/04
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/05
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/05
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/05
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Richard Henderson, 2014/07/07
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Al Viro, 2014/07/07
- Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions, Richard Henderson, 2014/07/07