From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQ1Ha-0005zP-AB for qemu-devel@nongnu.org; Tue, 18 Mar 2014 17:10:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQ1HU-0001ZN-Fm for qemu-devel@nongnu.org; Tue, 18 Mar 2014 17:10:46 -0400 Received: from mail-qa0-x236.google.com ([2607:f8b0:400d:c00::236]:38233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQ1HU-0001ZC-9h for qemu-devel@nongnu.org; Tue, 18 Mar 2014 17:10:40 -0400 Received: by mail-qa0-f54.google.com with SMTP id w8so7700687qac.27 for ; Tue, 18 Mar 2014 14:10:40 -0700 (PDT) Sender: Richard Henderson Message-ID: <5328B64B.9050404@twiddle.net> Date: Tue, 18 Mar 2014 14:10:35 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1395170635-21281-1-git-send-email-peter.maydell@linaro.org> <1395170635-21281-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1395170635-21281-3-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0 2/2] target-arm: A64: Add saturating accumulate ops (USQADD/SUQADD) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Peter Crosthwaite , patches@linaro.org, Michael Matz , Alexander Graf , Will Newton , Dirk Mueller , Laurent Desnogues , =?UTF-8?B?QWxleCBCZW5uw6ll?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall 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 r~