[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [6936] target-mips: optimize gen_compute_branch()
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [6936] target-mips: optimize gen_compute_branch() |
Date: |
Mon, 30 Mar 2009 00:11:49 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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 <address@hidden>
> >
> > 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
address@hidden http://www.aurel32.net