[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] improve emulation correctness
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] improve emulation correctness |
Date: |
Mon, 28 Apr 2014 07:42:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 04/28/2014 06:05 AM, Dmitry Poletaev wrote:
> - env->cc_src = (eflags & ~(CC_C | CC_O)) |
> - (lshift(src ^ t0, 11 - (DATA_BITS - 1)) & CC_O) |
> + env->cc_src = (eflags & ~CC_C) |
> ((src >> (DATA_BITS - count)) & CC_C);
> + if (count == 1) {
> + env->cc_src |= (lshift(src ^ t0, 11 - (DATA_BITS - 1)) & CC_O);
> + }
This isn't what you described either, since you fail to clear the old value of
the O flag before oring in the new one. You wanted
if (count == 1) {
env->cc_src = (env->cc_src & ~CC_O)
| (lshift(src ^ t0, 11 - (DATA_BITS - 1)) & CC_O);
}
First off, do more testing before submitting patches.
Second, you've gotten an adequate description of why we're not going to take
patches to choose one particular undefined behaviour over another.
r~
- [Qemu-devel] [PATCH] improve emulation correctness, Dmitry Poletaev, 2014/04/25
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Richard Henderson, 2014/04/25
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Peter Maydell, 2014/04/25
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Michael Tokarev, 2014/04/27
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Peter Maydell, 2014/04/27
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Dmitry Poletaev, 2014/04/28
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Peter Maydell, 2014/04/28
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Dmitry Poletaev, 2014/04/28
- Re: [Qemu-devel] [PATCH] improve emulation correctness, Richard Henderson, 2014/04/28