Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BsLOI-0003eO-5g for qemu-devel@nongnu.org; Wed, 04 Aug 2004 09:01:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BsLOC-0003XZ-6w for qemu-devel@nongnu.org; Wed, 04 Aug 2004 09:01:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BsLOB-0003XR-Ae for qemu-devel@nongnu.org; Wed, 04 Aug 2004 09:01:03 -0400 Received: from [206.190.39.133] (helo=web52508.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1BsLKF-0006Tr-CM for qemu-devel@nongnu.org; Wed, 04 Aug 2004 08:56:59 -0400 Message-ID: <20040804125018.64462.qmail@web52508.mail.yahoo.com> Date: Wed, 4 Aug 2004 05:50:18 -0700 (PDT) From: Piotr Krysik Subject: Re: [Qemu-devel] [patch] performance improvement (softmmu, x86, GCC 3) In-Reply-To: <2ad73a04073022005f5a1af6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1184793830-1091623818=:63437" 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 --0-1184793830-1091623818=:63437 Content-Type: text/plain; charset=us-ascii Hi, The "ecx thing" and disabling GCSE are not mutually exclusive, but I didn't try to run/benchmark QEMU with both. I'm not GCC guru, but I believe that it should not significantly impact QEMU performance. If you are willing to do some tests I could send you the "ecx" patch. And yes, I tried different combinations of -fno-gcse suboptions, but none worked. To get more information about the problem, I used compiler -da flag to trace GCC optimizations of op_rolb_kernel_T0_T1_cc. I discovered that GCSE step is introducing transformation that cannot be optimized later. GCC insists on using copy of T0 value, instead of using register ebx globally reserved for T0 (and as there are no free register it gives error). The strangest thing I noticed is that if I inline stXXXX function by hand instead of using inline directive, problem disappears. Piotrek Andr韂raga wrote: Awesome ;) I haven't dug into the code, so could you please tell me if the ecx thing you mentioned in the bottom of your message and disabling GCSE are mutually exclusive? Have you tried to narrow the problem down to one or more of the separate GCSE flags, instead of the broader -f[no-]gcse one? -- "A year spent in artificial intelligence is enough to make one believe in God" Alan J. Perlis On Wed, 28 Jul 2004 07:24:42 -0700 (PDT), 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. > _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1184793830-1091623818=:63437 Content-Type: text/html; charset=us-ascii
Hi,
 
The "ecx thing" and disabling GCSE are not mutually
exclusive, but I didn't try to run/benchmark QEMU with
both. I'm not GCC guru, but I believe that it should not
significantly impact QEMU performance. If you are willing
to do some tests I could send you the "ecx" patch.
 
And yes, I tried different combinations of -fno-gcse
suboptions, but none worked.
 
To get more information about the problem, I used
compiler -da flag to trace GCC optimizations of
op_rolb_kernel_T0_T1_cc. I discovered that GCSE step
is introducing transformation that cannot be optimized
later. GCC insists on using copy of T0 value, instead of
using register ebx globally reserved for T0 (and as there
are no free register it gives error). The strangest thing
I noticed is that if I inline stXXXX function by hand instead
of using inline directive, problem disappears.
 

Piotrek


Andr韂raga <meianoite@gmail.com> wrote:
Awesome ;)

I haven't dug into the code, so could you please tell me if the ecx
thing you mentioned in the bottom of your message and disabling GCSE
are mutually exclusive? Have you tried to narrow the problem down to
one or more of the separate GCSE flags, instead of the broader
-f[no-]gcse one?



--
"A year spent in artificial intelligence is enough to make one believe in God"
Alan J. Perlis

On Wed, 28 Jul 2004 07:24:42 -0700 (PDT), 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.
>


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --0-1184793830-1091623818=:63437--