Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lo3EO-0005pG-8Q for qemu-devel@nongnu.org; Sun, 29 Mar 2009 18:11:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lo3EN-0005of-FR for qemu-devel@nongnu.org; Sun, 29 Mar 2009 18:11:51 -0400 Received: from [199.232.76.173] (port=58543 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lo3EN-0005oX-BE for qemu-devel@nongnu.org; Sun, 29 Mar 2009 18:11:51 -0400 Received: from hall.aurel32.net ([88.191.82.174]:57136) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lo3EN-0000de-25 for qemu-devel@nongnu.org; Sun, 29 Mar 2009 18:11:51 -0400 Date: Mon, 30 Mar 2009 00:11:49 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [6936] target-mips: optimize gen_compute_branch() Message-ID: <20090329221149.GC12026@hall.aurel32.net> References: <49CFDC9E.6080405@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <49CFDC9E.6080405@mail.berlios.de> 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: Stefan Weil Cc: qemu-devel@nongnu.org On Sun, Mar 29, 2009 at 10:39:58PM +0200, Stefan Weil wrote: > Aurelien Jarno schrieb: > > Revision: 6936 > > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6936 > > Author: aurel32 > > Date: 2009-03-29 01:18:52 +0000 (Sun, 29 Mar 2009) > > Log Message: > > ----------- > > target-mips: optimize gen_compute_branch() > > > > Signed-off-by: Aurelien Jarno > > > > Modified Paths: > > -------------- > > trunk/target-mips/cpu.h > > trunk/target-mips/machine.c > > trunk/target-mips/translate.c > > > > Modified: trunk/target-mips/cpu.h > > =================================================================== > > --- trunk/target-mips/cpu.h 2009-03-29 01:18:43 UTC (rev 6935) > > +++ trunk/target-mips/cpu.h 2009-03-29 01:18:52 UTC (rev 6936) > > @@ -443,7 +443,7 @@ > > #define MIPS_HFLAG_BL 0x0C00 /* Likely branch */ > > #define MIPS_HFLAG_BR 0x1000 /* branch to register (can't link TB) */ > > target_ulong btarget; /* Jump / branch target */ > > - int bcond; /* Branch condition (if needed) */ > > + target_ulong bcond; /* Branch condition (if needed) */ > > > > int SYNCI_Step; /* Address step size for SYNCI */ > > int CCRes; /* Cycle count resolution/divisor */ > > > > Modified: trunk/target-mips/machine.c > > =================================================================== > > --- trunk/target-mips/machine.c 2009-03-29 01:18:43 UTC (rev 6935) > > +++ trunk/target-mips/machine.c 2009-03-29 01:18:52 UTC (rev 6936) > > @@ -91,7 +91,8 @@ > > qemu_put_sbe32s(f, &env->error_code); > > qemu_put_be32s(f, &env->hflags); > > qemu_put_betls(f, &env->btarget); > > - qemu_put_sbe32s(f, &env->bcond); > > + i = env->bcond; > > + qemu_put_sbe32s(f, &i); > > > > bcond is now target_ulong (32 or 64 bit target), i is int. > Are the upper 32 bits of bcond not needed? No they are not used as this variable only contains 0 or 1, so saving only the lower 32 bits is fine. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net