From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjEKl-0007O8-Lo for qemu-devel@nongnu.org; Sun, 02 Jun 2013 15:52:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjEKk-0007VP-RA for qemu-devel@nongnu.org; Sun, 02 Jun 2013 15:52:55 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:37287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjEKk-0007VE-Kp for qemu-devel@nongnu.org; Sun, 02 Jun 2013 15:52:54 -0400 Received: by mail-wi0-f177.google.com with SMTP id hr14so2064830wib.4 for ; Sun, 02 Jun 2013 12:52:53 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51ABA28A.5020104@redhat.com> Date: Sun, 02 Jun 2013 21:52:42 +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> <51AB588A.9030406@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 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: Peter Maydell Cc: qemu-devel@nongnu.org, Richard Henderson Il 02/06/2013 16:50, Peter Maydell ha scritto: > On 2 June 2013 15:36, Paolo Bonzini wrote: >> This should work: >> >> int64_t h; >> if (!n) { >> return a; >> } >> h = a.hi >> n; > > This is undefined for n >= 64. Yes, it has to be a.hi >> (n & 63). > I would suggest looking at fpu/softfloat-macros.h:shift128Right() > except that that has at least one clearly dubious thing in it > (a check for "count < 64" in an else case that can't be reached > if count < 64)... It's a bit different in that I want an arithmetic right shift. Paolo