Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BppPl-0000OI-IR for qemu-devel@nongnu.org; Wed, 28 Jul 2004 10:28:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BppPl-0000O6-19 for qemu-devel@nongnu.org; Wed, 28 Jul 2004 10:28:17 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BppPk-0000O3-Ta for qemu-devel@nongnu.org; Wed, 28 Jul 2004 10:28:16 -0400 Received: from [206.190.39.123] (helo=web52502.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1BppMU-0008GO-JZ for qemu-devel@nongnu.org; Wed, 28 Jul 2004 10:24:54 -0400 Message-ID: <20040728142443.29737.qmail@web52502.mail.yahoo.com> Date: Wed, 28 Jul 2004 07:24:42 -0700 (PDT) From: Piotr Krysik MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-565479123-1091024682=:29718" Subject: [Qemu-devel] [patch] performance improvement (softmmu, x86, GCC 3) 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-565479123-1091024682=:29718 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline 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 --0-565479123-1091024682=:29718 Content-Type: text/x-patch; name="gcc3-no-gcse.diff" Content-Description: gcc3-no-gcse.diff Content-Disposition: inline; filename="gcc3-no-gcse.diff" 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 */ --0-565479123-1091024682=:29718--