From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LjXJT-0003DD-D3 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 07:18:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjXJO-00033X-PQ for qemu-devel@nongnu.org; Tue, 17 Mar 2009 07:18:26 -0400 Received: from [199.232.76.173] (port=37675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjXJO-00033H-B9 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 07:18:22 -0400 Received: from mx1.redhat.com ([66.187.233.31]:34236) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LjXJO-0004S6-16 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 07:18:22 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2HBILi5001010 for ; Tue, 17 Mar 2009 07:18:21 -0400 Message-ID: <49BF86FC.4060206@redhat.com> Date: Tue, 17 Mar 2009 13:18:20 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] branches are expensive References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 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. -- error compiling committee.c: too many arguments to function