qemu-devel
[Top][All Lists]
Advanced

[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 16:41:29 +0100

On 17 September 2012 16:34, Richard Henderson <address@hidden> wrote:
> On 09/17/2012 02:43 AM, Peter Maydell 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.
>
> I don't think that ought to be true.
>
> In particular, I've just posted a patch to cure the Sparc TCG
> backend from producing an illegal insn in the face of a shift
> with a count of 64.
>
> I'd much rather we simply had an undefined result.

Variously:
 * I didn't really want to have to audit all the TCG backends
   to see if they were taking advantage of the 'undefined behaviour'
   clause
 * the C standard says 'undefined behaviour', not 'unknown value',
   for out of range shifts
 * the TCG spec doesn't currently have the concept of 'unknown
   value' at all and I wasn't sure it was worth introducing it

which all added up to 'not really worth it to save one insn'.

Of these, the first is the most significant. If you want to wade
through architecture manuals for 8 architectures, be my guest :-)

-- PMM



reply via email to

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