qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for bytecode (virtual machine)
Date: Mon, 19 Sep 2011 11:20:30 +0100

On Mon, Sep 19, 2011 at 9:40 AM, David Gilbert <address@hidden> wrote:
> On 18 September 2011 16:13, Stefan Weil <address@hidden> wrote:
>> Am 18.09.2011 17:02, schrieb Mulyadi Santosa:
>>>
>>> Hi :)
>>>
>>> On Sun, Sep 18, 2011 at 02:59, Stefan Weil <address@hidden> wrote:
>>>>
>>>> Hello,
>>>>
>>>> these patches add a new code generator (TCG target) to qemu.
>>>
>>> I personally congrats you for your hard work. So, here's a question
>>> from who are not so keen with Qemu internals: what is the biggest
>>> advantage of using TCI instead of directly using TCG?
>>
>> TCG with native code support is much faster (6x to 10x),
>> so for emulation on a supported host, TCI has no advantage
>> for normal users.
>
> Is it possible to dynamically switch between the two?
>
> The two cases I'm thinking of are:
>  1) Using the interpreter to execute one or two instructions in an exception
> handling case
>  2) Avoiding TCG code generation on the first few runs of a piece of
> code that might only be init code, and only bothering with TCG for hotter
> code.

The tricky thing with using the interpeter for lesser run code is that
it has a bunch of machinery in front of it which probably makes it
relatively similar to actually emitting native code.  The interesting
benchmark would be to translate blocks but never cache them for future
executions - compare this with TCI to see how much difference there is
between executing with interpretation vs translation.  If the
interpreter is almost as expensive as the translator then it's not
worth it.

Stefan



reply via email to

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