qemu-devel
[Top][All Lists]
Advanced

[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: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations.
Date: Fri, 20 May 2011 11:37:29 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

On 05/20/2011 05:39 AM, Kirill Batuzov wrote:
> +    case INDEX_op_sar_i32:
> +#if TCG_TARGET_REG_BITS == 64
> +        x &= 0xffffffff;
> +        y &= 0xffffffff;
> +#endif
> +        r = x & 0x80000000;
> +        x &= ~0x80000000;
> +        x >>= y;
> +        r |= r - (r >> y);
> +        x |= r;
> +        return x;
> +

Any reason you're emulating the 32-bit shift by
hand, rather than letting the compiler do it?  I.e.

  x = (int32_t)x >> (int32_t)y;


r~



reply via email to

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