All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/4] target-ppc: create TCG slots for registers based on CPU
Date: Sun, 29 Mar 2009 16:57:49 +0200	[thread overview]
Message-ID: <20090329145749.GD12026@hall.aurel32.net> (raw)
In-Reply-To: <20090329144250.GC12026@hall.aurel32.net>

On Sun, Mar 29, 2009 at 04:42:50PM +0200, Aurelien Jarno wrote:
> On Sun, Mar 29, 2009 at 03:34:53PM +0200, Aurelien Jarno wrote:
> > On Sat, Mar 28, 2009 at 05:18:34PM -0700, Nathan Froyd wrote:
> > > On Sat, Mar 28, 2009 at 11:54:43PM +0100, Aurelien Jarno wrote:
> > > > On Sat, Mar 28, 2009 at 02:30:13PM -0700, Nathan Froyd wrote:
> > > > > I am not a TCG expert, but there are several loops in TCG over all
> > > > > globals and it seems like those loops would go faster if they didn't
> > > > > have to consider registers that would never be touched.  If this patch
> > > > > series makes no difference in TCG's performance, then I'd be glad to
> > > > > have an explanation of why that's the case.
> > > > 
> > > > Do you actually have run a benchmark with those changes? TCG is
> > > > sometimes a bit strange, and some optimizations does not change the
> > > > execution speed, while others improve it a lot. It is very difficult to
> > > > predict what will give a gain or not.
> > > > 
> > > > Suggestions of benchmarks: gzip/bzip2 on a big file using user emulation
> > > > or a compilation in system emulation.
> > > 
> > > Benchmarking?  Pffft. ;)
> > > 
> > > A benchmarking session with qemu-ppc and bzip2/bunzip2 on ~400MB files
> > > and a 603e emulated CPU suggests that these changes are not terribly
> > > beneficial (maybe 1% improvement, if that).  I don't imagine that a
> > > similarly stressful benchmark in system emulation would be much
> > > different.  Consider the patch series withdrawn.
> > > 
> > 
> > I have done a few profiling on qemu-system-ppc and qemu-system-mips. You
> > are actually right that the loop on the TCG variables lists takes time. 
> > This is mainly due to the call of save_globals() for TCG functions marked 
> > as TCG_OPF_CALL_CLOBBER.
> > 
> > However it looks like it should be better to address this comment first
> > before trying to reduce the number of TCG variables:
> > 
> >             /* XXX: for load/store we could do that only for the slow path
> >                (i.e. when a memory callback is called) */
> > 
> 
> Thinking a bit more I think we should avoid mapping FPU registers as
> global TCG variables. Those variables are mostly modified by helpers
> (except for move and load/store), and they will be written back to 
> memory before the call to the helper. This means TCG can't delay the 
> memory accesses, so there is very few (or no) difference in the
> generated code if the FPU register is accessed through a global TCG 
> variable or through tcg_gen_ld_tl().
> 
> I have done the test with qemu-system-mips, and I have found a gain 
> around 1% in speed.
> 

My measurements were wrong, the gain is around 9%.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2009-03-29 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-28 21:30 [Qemu-devel] [PATCH 0/4] target-ppc: create TCG slots for registers based on CPU Nathan Froyd
2009-03-28 21:30 ` [Qemu-devel] [PATCH 1/4] move PPC insn flags to cpu.h Nathan Froyd
2009-03-28 22:58   ` Aurelien Jarno
2009-03-28 23:07     ` Nathan Froyd
2009-03-28 23:14       ` Aurelien Jarno
2009-03-28 21:30 ` [Qemu-devel] [PATCH 2/4] move ppc_def_t definition " Nathan Froyd
2009-03-28 21:30 ` [Qemu-devel] [PATCH 3/4] pass the cpu definition to ppc_translate_init Nathan Froyd
2009-03-28 21:30 ` [Qemu-devel] [PATCH 4/4] create TCG slots for registers based on CPU Nathan Froyd
2009-03-28 22:54 ` [Qemu-devel] [PATCH 0/4] target-ppc: " Aurelien Jarno
2009-03-29  0:18   ` Nathan Froyd
2009-03-29 13:34     ` Aurelien Jarno
2009-03-29 14:42       ` Aurelien Jarno
2009-03-29 14:57         ` Aurelien Jarno [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090329145749.GD12026@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.