qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: branches are expensive


From: Jan Kiszka
Subject: [Qemu-devel] Re: branches are expensive
Date: Tue, 17 Mar 2009 12:32:43 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Avi Kivity wrote:
> Steffen Liebergeld wrote:
>> Hi,
>>
>> while measuring the execution of an ARM guest, I encountered that
>> branches are
>> extremely expensive in terms of executed host instructions. A single ARM
>> branch takes 148 to 152 host instructions. In my setup host and guest
>> use the
>> ARM instruction set architecture.
>>
>> My question is what makes branches so expensive? What code is run when
>> executing a branch? Other instructions are translated to 14 to 40
>> instructions.
>>   
> 
> I'm no tcg guru, but if branches are not chained, you'd need an
> expensive lookup to find the next translation block.  If branches are
> chained they'll probably be much faster.

That is probably the reason.

You can check to generated host code and compare it to the guest code
via -d in_asm,out_asm (or via the monitor: log in_asm,out_asm), logs
will be written /tmp/qemu.log by default. The ratio of direct (chained)
jumps is given via "info jit".

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux




reply via email to

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