[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] target-arm: convert shl and shr helpers to
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] target-arm: convert shl and shr helpers to TCG |
Date: |
Mon, 17 Sep 2012 14:50:49 +0100 |
On 17 September 2012 14:36, Laurent Desnogues
<address@hidden> wrote:
> On Mon, Sep 17, 2012 at 11:43 AM, Peter Maydell
> <address@hidden> wrote:
>> The TCG shift operations are undefined behaviour (not merely
>> undefined result) if the shift is >= 32, so we must avoid
>> doing that even if we're going to throw away the answer.
>
> That's odd that it doesn't just state that the result is undefined.
> I wonder what "undefined behavior" means. I understand
> what undefined behavior (as opposed tu undefined result)
> means for divisions by 0, but not for a shift larger than data
> type width.
Well, it means anything the implementation likes :-)
The only concrete example I could come up with was the old
pre-286 behaviour where the 8086 didn't mask the shift
count at all, so a variable shift by a large amount would
be implemented as that many one-bit-per-cycle shifts and
could take an extremely long time.
-- PMM
Re: [Qemu-devel] [PATCH 3/5] target-arm: convert shl and shr helpers to TCG, Richard Henderson, 2012/09/17
[Qemu-devel] [PATCH 5/5] target-arm: mark a few integer helpers const and pure, Aurelien Jarno, 2012/09/16
[Qemu-devel] [PATCH 4/5] target-arm: optimize helper_sar, Aurelien Jarno, 2012/09/16