From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWoMD-00052o-Bh for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:20:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWoM4-0004QI-B4 for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:19:53 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:47530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWoM4-0004Pz-6m for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:19:44 -0400 Received: by mail-qg0-f49.google.com with SMTP id q107so6231571qgd.36 for ; Wed, 24 Sep 2014 08:19:38 -0700 (PDT) Sender: Richard Henderson Message-ID: <5422E106.2020208@twiddle.net> Date: Wed, 24 Sep 2014 08:19:34 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1411419461-24390-1-git-send-email-rth@twiddle.net> <1411419461-24390-10-git-send-email-rth@twiddle.net> <54227EDD.7060205@huawei.com> In-Reply-To: <54227EDD.7060205@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 09/11] tcg-aarch64: Use 32-bit loads for qemu_ld_i32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org On 09/24/2014 01:20 AM, Claudio Fontana wrote: >> @@ -1118,7 +1119,8 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGMemOp memop, >> tcg_out_ldst_r(s, I3312_LDRB, data_r, addr_r, off_r); >> break; >> case MO_SB: >> - tcg_out_ldst_r(s, I3312_LDRSBX, data_r, addr_r, off_r); >> + tcg_out_ldst_r(s, type ? I3312_LDRSBX : I3312_LDRSBW, >> + data_r, addr_r, off_r); > > > since we are using the enum type TCGType, why do we check type as "type ?" > > I would have expected the conditional to be something like > > type == TCG_TYPE_I32 ? I3312_LDRSBW : I3312_LDRSBX > > It's pretty obvious what is happening but it might spare someone a lookup into the header file > to test that type 0 is indeed TCG_TYPE_I32. We assert the boolean-ish nature of TCGType at the start of the file, and use it for the "ext" variable throughout. Would it help if the variable weren't named "type"? r~