From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLGR-00042I-PW for qemu-devel@nongnu.org; Tue, 28 May 2013 10:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhLGL-0002gf-2G for qemu-devel@nongnu.org; Tue, 28 May 2013 10:52:39 -0400 Received: from mail-qa0-x235.google.com ([2607:f8b0:400d:c00::235]:47284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLGK-0002gV-Um for qemu-devel@nongnu.org; Tue, 28 May 2013 10:52:32 -0400 Received: by mail-qa0-f53.google.com with SMTP id bs12so1543581qab.5 for ; Tue, 28 May 2013 07:52:32 -0700 (PDT) Sender: Richard Henderson Message-ID: <51A4C4A7.8020505@twiddle.net> Date: Tue, 28 May 2013 07:52:23 -0700 From: Richard Henderson MIME-Version: 1.0 References: <5141F36E.10004@huawei.com> <519DCEC8.8060000@huawei.com> <519DD0BF.4090702@huawei.com> <519E43EE.6090702@twiddle.net> <519F2A8F.6090903@huawei.com> <519F9D11.9020603@twiddle.net> <51A346EC.2080005@huawei.com> <51A3AA3A.4050406@twiddle.net> <51A459F8.5030706@huawei.com> In-Reply-To: <51A459F8.5030706@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] tcg/aarch64: implement new TCG target for aarch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana Cc: Peter Maydell , Jani Kokkonen , qemu-devel@nongnu.org On 05/28/2013 12:17 AM, Claudio Fontana wrote: >> > if (type == TCG_TYPE_I32) { >> > value = (uint32_t)value; >> > ext = 0; >> > } else if (value <= 0xffffffff) { >> > ext = 0; >> > } else { >> > ext = 0x80000000; >> > } > The check for type is probably unnecessary, since we don't gain anything (we still have to check something once), so I'd rather use a uint64_t parameter and then just check for value < 0xffffffff. > The check for type is necessary, because we don't guarantee that the high bits of value are zero, sign-extended, or indeed garbage, for TYPE_I32. r~