[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations.
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations. |
Date: |
Fri, 27 May 2011 16:41:40 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Richard Henderson wrote:
> On 05/26/2011 01:25 PM, Blue Swirl wrote:
> >> I don't see the point. The C99 implementation defined escape hatch
> >> exists for weird cpus. Which we won't be supporting as a QEMU host.
> >
> > Maybe not, but a compiler with this property could arrive. For
> > example, GCC developers could decide that since this weirdness is
> > allowed by the standard, it may be implemented as well.
>
> If you like, you can write a configure test for it. But, honestly,
> essentially every place in qemu that uses shifts on signed types
> would have to be audited. Really.
I agree, the chance of qemu ever working, or needing to work, on a non
two's complement machine is pretty remote!
> The C99 hook exists to efficiently support targets that don't have
> arithmetic shift operations. Honestly.
If you care, this should be portable without a configure test, as
constant folding should have the same behaviour:
(((int32_t)-3 >> 1 == (int32_t)-2)
? (int32_t)x >> (int32_t)y
: long_winded_portable_shift_right(x, y))
-- Jamie
- [Qemu-devel] [PATCH 6/6] Do constant folding for unary operations., (continued)
- [Qemu-devel] [PATCH 6/6] Do constant folding for unary operations., Kirill Batuzov, 2011/05/20
- [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Kirill Batuzov, 2011/05/20
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Richard Henderson, 2011/05/20
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Kirill Batuzov, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Richard Henderson, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Blue Swirl, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Richard Henderson, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Blue Swirl, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Richard Henderson, 2011/05/26
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations.,
Jamie Lokier <=
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Blue Swirl, 2011/05/27
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Richard Henderson, 2011/05/27
- Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations., Paolo Bonzini, 2011/05/27
[Qemu-devel] [PATCH 2/6] Add copy and constant propagation., Kirill Batuzov, 2011/05/20
[Qemu-devel] [PATCH 4/6] Do constant folding for boolean operations., Kirill Batuzov, 2011/05/20
[Qemu-devel] [PATCH 3/6] Do constant folding for basic arithmetic operations., Kirill Batuzov, 2011/05/20