From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjQqQ-0008G0-CZ for qemu-devel@nongnu.org; Mon, 03 Jun 2013 05:14:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjQqP-0004xQ-7O for qemu-devel@nongnu.org; Mon, 03 Jun 2013 05:14:26 -0400 Sender: Paolo Bonzini Message-ID: <51AC5E64.3080002@redhat.com> Date: Mon, 03 Jun 2013 11:14:12 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1370186269-24353-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1370186269-24353-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] softfloat: Fix shift128Right for shift counts 64..127 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-trivial@nongnu.org, Anthony Liguori , qemu-devel@nongnu.org, patches@linaro.org Il 02/06/2013 17:17, Peter Maydell ha scritto: > shift128Right would give the wrong result for a shift count > between 64 and 127. This was never noticed because all of > our uses of this function are guaranteed not to use shift > counts in this range. > > Signed-off-by: Peter Maydell > --- > Found by code inspection. This contribution can be licensed > under either the softfloat-2a or -2b license. > > fpu/softfloat-macros.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h > index b5164af..9b09545 100644 > --- a/fpu/softfloat-macros.h > +++ b/fpu/softfloat-macros.h > @@ -168,7 +168,7 @@ INLINE void > z0 = a0>>count; > } > else { > - z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0; > + z1 = (count < 128) ? (a0 >> (count & 63)) : 0; > z0 = 0; > } > *z1Ptr = z1; > Reviewed-by: Paolo Bonzini