qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 38/48] target-arm: fix neon vrshl instruction


From: Nathan Froyd
Subject: Re: [Qemu-devel] [PATCH 38/48] target-arm: fix neon vrshl instruction
Date: Fri, 26 Mar 2010 10:26:05 -0700
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Fri, Mar 26, 2010 at 04:06:58PM +0000, Riku Voipio wrote:
> +uint32_t HELPER(neon_rshl_u32)(uint32_t val, uint32_t shiftop)
> +{
> +    int8_t shift = (int8_t)shiftop;
> +    if (shift >= 32 || shift < -32) {
> +        val = 0;
> +    } else if (shift == -32) {
> +        val >>= shift - 1;
           ^^^^^^^^^^^^^^^^^

This looks wrong.  Compare the equivalent case for 64-bit:

>  uint64_t HELPER(neon_rshl_u64)(uint64_t val, uint64_t shiftop)
>      } else if (shift == -64) {
>          /* Rounding a 1-bit result just preserves that bit.  */
>          val >>= 63;

Bonus points for factoring out the duplicated 32/64-bit code.

-Nathan




reply via email to

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