From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzQZm-0006ZI-Lq for qemu-devel@nongnu.org; Mon, 10 Nov 2008 01:48:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzQZk-0006Xa-14 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 01:48:41 -0500 Received: from [199.232.76.173] (port=58045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzQZj-0006XX-Rf for qemu-devel@nongnu.org; Mon, 10 Nov 2008 01:48:39 -0500 Received: from csl.cornell.edu ([128.84.224.10]:4148 helo=vlsi.csl.cornell.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzQZj-00080a-LF for qemu-devel@nongnu.org; Mon, 10 Nov 2008 01:48:39 -0500 Received: from cacao.csl.cornell.edu (cacao.csl.cornell.edu [128.84.224.47]) by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id mAA6mSQh013500 for ; Mon, 10 Nov 2008 01:48:33 -0500 (EST) Date: Mon, 10 Nov 2008 01:48:28 -0500 (EST) From: Vince Weaver Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qemu-devel] [patch] Alpha : fix cmpbge instruction 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 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 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)