From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCvnc-0008RT-8C for qemu-devel@nongnu.org; Fri, 23 Aug 2013 14:09:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCvnT-0003IJ-RG for qemu-devel@nongnu.org; Fri, 23 Aug 2013 14:09:28 -0400 Received: from mail-gh0-x230.google.com ([2607:f8b0:4002:c05::230]:46652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCvnT-0003Hs-N5 for qemu-devel@nongnu.org; Fri, 23 Aug 2013 14:09:19 -0400 Received: by mail-gh0-f176.google.com with SMTP id z17so224530ghb.7 for ; Fri, 23 Aug 2013 11:09:18 -0700 (PDT) Sender: Richard Henderson Message-ID: <5217A54A.6040300@twiddle.net> Date: Fri, 23 Aug 2013 11:09:14 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1377274359-8707-1-git-send-email-peter.maydell@linaro.org> <1377274359-8707-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1377274359-8707-2-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] target-arm: Use sextract32() in branch decode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org On 08/23/2013 09:12 AM, Peter Maydell wrote: > - offset = (((int32_t)insn << 8) >> 8); > - val += (offset << 2) + 4; > + offset = sextract32(insn << 2, 0, 26); > + val += offset + 4; I read this incorrectly at first, considering the shift of insn, and I wonder if it's really the best way to write this because of that. What about just changing the one line to sextract(insn, 0, 24)? The second line by itself ought not trigger a warning from clang, because the << 2 never changes the sign bit. If it still does, perhaps just multiply by 4 instead... It's a stupid warning. When was the last ones-compliment machine built? r~