From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EA4Cw-0000Uy-Lz for qemu-devel@nongnu.org; Tue, 30 Aug 2005 07:23:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EA4Cs-0000SY-Lr for qemu-devel@nongnu.org; Tue, 30 Aug 2005 07:23:12 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EA4Cp-0000LY-Vm for qemu-devel@nongnu.org; Tue, 30 Aug 2005 07:23:08 -0400 Received: from [65.74.133.11] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EA49z-0007yn-Uj for qemu-devel@nongnu.org; Tue, 30 Aug 2005 07:20:12 -0400 From: Paul Brook Subject: Re: [Qemu-devel] qemu optimization Date: Tue, 30 Aug 2005 12:17:39 +0100 References: <20050829180505.84705.qmail@web50512.mail.yahoo.com> <20050829215912.GA2422@jbrown.mylinuxbox.org> <1125386989.30257.65.camel@aragorn> In-Reply-To: <1125386989.30257.65.camel@aragorn> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508301217.40302.paul@codesourcery.com> 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, jhoger@pobox.com > > Without them, there is no native code run by qemu - everything is > > translated. > > Yep. But even in that situation, there will always be room for > improvement in how the dynamic code generator works. > > I wonder, has anyone tried doing a peephole optimizer? Translate key > instruction sequences to macro instructions? There have got to be a few > such high-traffic sequences that run all the time in Windows or Linux > that could be implemented in the dynamically generated dynamic code > generator. You might want to look at my hand-coded backed for qemu. The intention is that this will eventually replace dyngen/gcc altogether. Currently everything except the experimental m68k target uses a mixture of the old and the micro-ops. One of the differences is that most of the semantics and guest CPU state accesses are explicit, so it should be possible to use conventional optimisation techniques (including peepholes). Source and patches can be found at https://nowt.dyndns.org As proof-of-concept I also implemented a simple register propagation pass, and got a 15% speedup on the nbench benchmark. Paul