qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] performance improvement (softmmu, x86, GCC 3)
Date: Tue, 03 Aug 2004 23:21:26 +0200	[thread overview]
Message-ID: <411001D6.6030107@bellard.org> (raw)
In-Reply-To: <20040728142443.29737.qmail@web52502.mail.yahoo.com>

I am trying your patch and will include it if no performance loss on my 
benchmarks with gcc 3.2.

BTW, it could be possible to go a little faster by coding in assembler 
the unaligned access case of the C helpers which are called by the 
inline functions in softmmu_header.h.

Fabrice.

Piotr Krysik wrote:
> Hi!
> 
> I'm attaching a small patch to enable assembly 
> implementation of ld, lds and st (from 
> softmmu_header.h) for GCC 3.3 and GCC 3.4 when 
> running softmmu x86 guest on x86 host.
> 
> With my simple benchmark (dd if=/dev/zero bs=1M 
> count=16 | gzip -9 on Linux guest) this patch 
> improves performance by about 8% (QEMU compiled 
> with GCC 3.3 on Pentium II Debian host).
> 
> 
> Regards,
> 
> Piotrek
> 
> 
> PS. I also considered removing "%ecx" from register 
> constraints of st (softmmu_header.h, line 224) and 
> explicitly saving ecx before calling __st (line 198), 
> but performance gain was much smaller. I suspect that 
> gcse optimization and asm blocks under GCC 3.3 and 
> GCC 3.4 don't mix well in QEMU.
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
> http://promotions.yahoo.com/new_mail
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ru qemu-0.6.0/Makefile.target qemu-0.6.0-gcc3/Makefile.target
> --- qemu-0.6.0/Makefile.target	2004-07-10 20:20:09.000000000 +0200
> +++ qemu-0.6.0-gcc3/Makefile.target	2004-07-28 13:05:31.000000000 +0200
> @@ -73,7 +73,7 @@
>  CFLAGS+=-fomit-frame-pointer
>  OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
>  ifeq ($(HAVE_GCC3_OPTIONS),yes)
> -OP_CFLAGS+= -falign-functions=0
> +OP_CFLAGS+= -falign-functions=0 -fno-gcse
>  else
>  OP_CFLAGS+= -malign-functions=0
>  endif
> diff -ru qemu-0.6.0/target-i386/op.c qemu-0.6.0-gcc3/target-i386/op.c
> --- qemu-0.6.0/target-i386/op.c	2004-07-10 20:20:09.000000000 +0200
> +++ qemu-0.6.0-gcc3/target-i386/op.c	2004-07-28 13:08:00.000000000 +0200
> @@ -20,11 +20,9 @@
>  
>  /* XXX: must use this define because the soft mmu macros have huge
>     register constraints so they cannot be used in any C code. gcc 3.3
> -   does not seem to be able to handle some constraints in rol
> -   operations, so we disable it. */
> -#if !(__GNUC__ == 3 && __GNUC_MINOR__ == 3)
> +   does not seem to be able to handle some constraints in rol unless we
> +   disable gcse optimization. */
>  #define ASM_SOFTMMU
> -#endif
>  #include "exec.h"
>  
>  /* n must be a constant to be efficient */
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

      parent reply	other threads:[~2004-08-03 21:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-28 14:24 [Qemu-devel] [patch] performance improvement (softmmu, x86, GCC 3) Piotr Krysik
2004-07-31  5:00 ` André Braga
2004-08-04 12:50   ` Piotr Krysik
2004-08-04 17:21     ` André Braga
2004-08-05  1:43       ` Piotr Krysik
2004-08-03 21:21 ` Fabrice Bellard [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=411001D6.6030107@bellard.org \
    --to=fabrice@bellard.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).