From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LjYSO-0003B9-DP for qemu-devel@nongnu.org; Tue, 17 Mar 2009 08:31:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjYSJ-00037I-Hm for qemu-devel@nongnu.org; Tue, 17 Mar 2009 08:31:43 -0400 Received: from [199.232.76.173] (port=52022 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjYSJ-000376-9H for qemu-devel@nongnu.org; Tue, 17 Mar 2009 08:31:39 -0400 Received: from main.gmane.org ([80.91.229.2]:54175 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LjYSI-0004pO-KW for qemu-devel@nongnu.org; Tue, 17 Mar 2009 08:31:38 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LjYSF-0008En-NB for qemu-devel@nongnu.org; Tue, 17 Mar 2009 12:31:35 +0000 Received: from 141.76.6.219 ([141.76.6.219]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2009 12:31:35 +0000 Received: from usenet by 141.76.6.219 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2009 12:31:35 +0000 From: Steffen Liebergeld Date: Tue, 17 Mar 2009 12:31:24 +0000 (UTC) Message-ID: References: <49BF86FC.4060206@redhat.com> <49BF8A5B.7070706@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: news Subject: [Qemu-devel] Re: branches are expensive 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 Hi, Jan Kiszka schrieb: > 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". The radio is quite bad. Do you have any documentation on when Qemu does the chaining and more important, when it does not. For example are unconditional jumps always chained, or only in one direction (forward or backward). Many thanks. Steffen