From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KXhUd-0008DE-TV for qemu-devel@nongnu.org; Mon, 25 Aug 2008 15:12:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KXhUc-00088u-3E for qemu-devel@nongnu.org; Mon, 25 Aug 2008 15:12:47 -0400 Received: from [199.232.76.173] (port=51799 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KXhUb-00088j-V4 for qemu-devel@nongnu.org; Mon, 25 Aug 2008 15:12:45 -0400 Received: from csl.cornell.edu ([128.84.224.10]:1243 helo=vlsi.csl.cornell.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KXhUb-0006Wn-IZ for qemu-devel@nongnu.org; Mon, 25 Aug 2008 15:12:45 -0400 Received: from stanley.csl.cornell.edu (stanley.csl.cornell.edu [128.84.224.15]) by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id m7PJCYm0078690 for ; Mon, 25 Aug 2008 15:12:39 -0400 (EDT) Date: Mon, 25 Aug 2008 15:12:34 -0400 (EDT) From: Vince Weaver Message-ID: <20080825150914.G45325@stanley.csl.cornell.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Qemu-devel] SPARC sdiv patch 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 SPARC v9 manual specifies the sdiv instruction as computing Y concated with the *lower 32 bits* of r[rs1] / lower 32 bits of r[rs2] The current code does not ensure that only the lowest 32 bits of rs1 are used. The following patch fixes this. This fix allows the "gcc" SPEC 2000 benchmark complete successfully. The "udiv" helper might also need this fix. Vince --- target-sparc/op_helper.c.orig 2008-08-25 14:55:29.000000000 -0400 +++ target-sparc/op_helper.c 2008-08-25 15:04:51.000000000 -0400 @@ -2310,7 +2310,7 @@ int64_t x0; int32_t x1; - x0 = a | ((int64_t) (env->y) << 32); + x0 = (a &0xffffffff) | ((int64_t) (env->y) << 32); x1 = b; if (x1 == 0) {