qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Profiling Qemu for speed?


From: Jonas Maebe
Subject: Re: [Qemu-devel] Profiling Qemu for speed?
Date: Sun, 17 Apr 2005 10:59:56 +0200


On 17 Apr 2005, at 10:21, John R. Hogerhuis wrote:

One thought would be to have a peephole optimizer that looks back over
the just translated basic block (or a state machine that matches such
sequences as an on-line algorithm) and match against common, known
primitive sequences, and replaces them with optimized versions.

Another thing I've thought about is checking what sequences of instructions often appear in x86 programs (such as e.g. "push %ebp; movl %esp, %ebp") and then creating C-functions which emulate such an antire block, so they can be optimized as a whole by gcc. That would give a similar performance gain on all supported targets, and not just on the one you created the peephole optimizer for (+ less work to debug).

The only possible downside is that you can't jump to a particular instruction in such a block (the same goes for several kinds of peephole optimizations though). I don't know yet how Qemu exactly keeps track of the translations it has already performed, whether it supports multiple existing translations of the same instruction and/or whether it can already automatically invalidate the old block in case it turns out it needs to be splitted and thus re-translated (I guess it should at least some of these things, since it theory an x86 could jump into the middle of an instruction in order to reinterpret the bytes as another instruction stream).


Jonas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]