From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzUfo-0000pY-CM for qemu-devel@nongnu.org; Mon, 10 Nov 2008 06:11:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzUfn-0000oX-Mw for qemu-devel@nongnu.org; Mon, 10 Nov 2008 06:11:11 -0500 Received: from [199.232.76.173] (port=48674 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzUfn-0000o9-IO for qemu-devel@nongnu.org; Mon, 10 Nov 2008 06:11:11 -0500 Received: from hall.aurel32.net ([88.191.82.174]:56858) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzUfm-0006PZ-S3 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 06:11:11 -0500 Received: from aurel32 by hall.aurel32.net with local (Exim 4.63) (envelope-from ) id 1KzUfi-0003Zs-Ia for qemu-devel@nongnu.org; Mon, 10 Nov 2008 12:11:06 +0100 Date: Mon, 10 Nov 2008 12:11:06 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [patch] Alpha : fix cmpbge instruction Message-ID: <20081110111106.GA20280@hall.aurel32.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: Aurelien Jarno Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Nov 10, 2008 at 01:48:28AM -0500, Vince Weaver wrote: > Hello > > The cmpbge instruction should compare all 8 bytes of one 64-bit value with > another. However, we were looping with a < 7 condition which was skipping > the top byte. So if we were doing a compare where the top byte was > important, we could get the wrong result (this notably breaks the strlen() > function with certain sized strings). > > Attached is a patch Thanks, applied. > Index: target-alpha/op_helper.c > =================================================================== > --- target-alpha/op_helper.c (revision 5666) > +++ target-alpha/op_helper.c (working copy) > @@ -330,7 +330,7 @@ > int i; > > res = 0; > - for (i = 0; i < 7; i++) { > + for (i = 0; i < 8; i++) { > opa = op1 >> (i * 8); > opb = op2 >> (i * 8); > if (opa >= opb) > > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net