From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uj8st-0002ao-Ib for qemu-devel@nongnu.org; Sun, 02 Jun 2013 10:03:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uj8ss-0001EZ-PV for qemu-devel@nongnu.org; Sun, 02 Jun 2013 10:03:47 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:43139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uj8ss-0001EQ-Jl for qemu-devel@nongnu.org; Sun, 02 Jun 2013 10:03:46 -0400 Received: by mail-wi0-f175.google.com with SMTP id hn14so1930940wib.8 for ; Sun, 02 Jun 2013 07:03:45 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51AB50B4.6030001@redhat.com> Date: Sun, 02 Jun 2013 16:03:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1369948629-2833-1-git-send-email-pbonzini@redhat.com> <1369948629-2833-11-git-send-email-pbonzini@redhat.com> <51A921BF.7040908@twiddle.net> In-Reply-To: <51A921BF.7040908@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/21] memory: make section size a 128-bit integer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Il 01/06/2013 00:18, Richard Henderson ha scritto: > On 05/30/2013 02:16 PM, Paolo Bonzini wrote: >> +static inline Int128 int128_rshift(Int128 a, int n) >> +{ >> + return (Int128) { (a.lo >> n) | (a.hi << (64 - n)), (a.hi >> n) }; >> +} > > Produces wrong results for n == 0, since (a.hi << 64) is undefined. Good catch, I'm adding an if (!n) { return a; } before. Paolo