From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mo1pc-0006AV-F4 for qemu-devel@nongnu.org; Wed, 16 Sep 2009 17:14:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mo1pW-00065H-WE for qemu-devel@nongnu.org; Wed, 16 Sep 2009 17:14:27 -0400 Received: from [199.232.76.173] (port=49962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mo1pW-00065E-PZ for qemu-devel@nongnu.org; Wed, 16 Sep 2009 17:14:22 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:38898) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mo1pW-0008KE-Cd for qemu-devel@nongnu.org; Wed, 16 Sep 2009 17:14:22 -0400 From: Andreas Schwab References: <20090909120628.J4195@stanley.csl.cornell.edu> <20090916195242.GE770@volta.aurel32.net> <20090916163826.M50839@stanley.csl.cornell.edu> Date: Wed, 16 Sep 2009 23:14:17 +0200 In-Reply-To: <20090916163826.M50839@stanley.csl.cornell.edu> (Vince Weaver's message of "Wed, 16 Sep 2009 16:45:20 -0400 (EDT)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH] Fix extlh instruction on Alpha List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vince Weaver Cc: qemu-devel@nongnu.org, Aurelien Jarno Vince Weaver writes: > The code is attempting the following: > > tmp1=rb&0x7; > tmp1=temp1<<3; > > if (tmp1!=0) { > tmp1=64-tmp1; > rc=ra< } > else { > rc=ra; > } > > The problem with the original code is that in the case of tmp1 being 0, > the shift left by 64 would result in 0, instead of the identity. > > I tried to avoid the jump but couldn't. Am I missing something? Instead of tmp1 = 64 - tmp1 use tmp1 = -tmp1 & 0x3f. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."