From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ky6xf-0005km-IG for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:39:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ky6xe-0005k1-0V for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:39:55 -0500 Received: from [199.232.76.173] (port=53830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ky6xd-0005jw-T6 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:39:53 -0500 Received: from hall.aurel32.net ([88.191.82.174]:56363) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ky6xd-0004Xk-Pm for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:39:54 -0500 Received: from p-jarno.univ-lyon1.fr ([134.214.4.132] helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Ky6xb-0000Eu-Lp for qemu-devel@nongnu.org; Thu, 06 Nov 2008 16:39:51 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1Ky2IX-0007pS-UJ for qemu-devel@nongnu.org; Thu, 06 Nov 2008 11:41:09 +0100 Date: Thu, 6 Nov 2008 11:41:09 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix Alpha ret instruction Message-ID: <20081106104109.GA30068@volta.aurel32.net> References: <20081105170355.E80362@stanley.csl.cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20081105170355.E80362@stanley.csl.cornell.edu> 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 Wed, Nov 05, 2008 at 05:07:41PM -0500, Vince Weaver wrote: > > Hopefully pine doesn't corrupt this patch, I've had problems recently. > > For an alpha "ret" instruction, of the type > ret $26 > > The return was being ignored. This is because in translate.c > register $26 (the return address) was being over-written with the current > PC before it could be jumped to. Thus the ret was ignored. > > This patch just re-orders things so the return address is processed > before it is over-written with the current PC. > Thanks, applied. > Index: target-alpha/translate.c > =================================================================== > --- target-alpha/translate.c (revision 5636) > +++ target-alpha/translate.c (working copy) > @@ -1634,12 +1634,13 @@ > break; > #endif > case 0x1A: > - if (ra != 31) > - tcg_gen_movi_i64(cpu_ir[ra], ctx->pc); > if (rb != 31) > tcg_gen_andi_i64(cpu_pc, cpu_ir[rb], ~3); > else > tcg_gen_movi_i64(cpu_pc, 0); > + if (ra != 31) > + tcg_gen_movi_i64(cpu_ir[ra], ctx->pc); > + > /* Those four jumps only differ by the branch prediction hint */ > switch (fn2) { > case 0x0: > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net