qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.0 2/2] target-arm: A64: Add saturating acc


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH for-2.0 2/2] target-arm: A64: Add saturating accumulate ops (USQADD/SUQADD)
Date: Tue, 18 Mar 2014 14:10:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 03/18/2014 12:23 PM, Peter Maydell wrote:
> +#define USATACC(bits, shift) \
> +    do { \
> +        va = (int##bits##_t)((a >> shift) & ((1 << bits) - 1));         \
> +        vb = (uint##bits##_t)((b >> shift) & ((1 << bits) - 1));        \

The masking seems redundant with the cast.
Perhaps better to use extract32/sextract32?

> +        r |= (uint32_t) (vr & ((1 << bits) - 1)) << shift;              \

Perhaps better with deposit32?  That implies an unnecessary mask of R, but
perhaps the compiler can clean that up...


Otherwise I don't actually see anything wrong,

Reviewed-by: Richard Henderson <address@hidden>


r~



reply via email to

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