On Sunday 17 April 2005 09:59, Jonas Maebe wrote:
> 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).

Unfortunately it's not that simple. The push instruction may cause an 
exception. Whatever optimizations you apply you've got to make sure that the 
guest state is still consistent when the exception occurs.

Paul


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

Reply via email to