From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcI3e-0008CW-OQ for qemu-devel@nongnu.org; Tue, 14 May 2013 12:26:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcI3Y-0006a0-I1 for qemu-devel@nongnu.org; Tue, 14 May 2013 12:26:34 -0400 Received: from mail-yh0-x235.google.com ([2607:f8b0:4002:c01::235]:33275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcI3Y-0006Zw-DQ for qemu-devel@nongnu.org; Tue, 14 May 2013 12:26:28 -0400 Received: by mail-yh0-f53.google.com with SMTP id z12so138752yhz.26 for ; Tue, 14 May 2013 09:26:27 -0700 (PDT) Sender: Richard Henderson Message-ID: <519265AF.8070505@twiddle.net> Date: Tue, 14 May 2013 09:26:23 -0700 From: Richard Henderson MIME-Version: 1.0 References: <5141F36E.10004@huawei.com> <5187A863.7080903@huawei.com> <5187AFC0.3090201@redhat.com> <5190E923.1030200@huawei.com> <5190EBC5.9080901@huawei.com> <519143B8.1030109@twiddle.net> <519244B7.4090207@huawei.com> <51925552.9040601@twiddle.net> In-Reply-To: <51925552.9040601@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] tcg/aarch64: implement new TCG target for aarch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana Cc: Paolo Bonzini , qemu-devel@nongnu.org, Peter Maydell On 05/14/2013 08:16 AM, Richard Henderson wrote: > On 05/14/2013 07:05 AM, Claudio Fontana wrote: >>> Conditional branch range is +-1MB. You'll never see a TB that large. You >>> don't need to emit a branch-across-branch. >> >> Is there maybe a way to do it right even in the corner case where we have >> a huge list of hundreds of thousands of instructions without jumps and then a conditional jump? >> Are we _guaranteed_ to never see that large a TB with some kind of define, >> similarly to MAX_CODE_GEN_BUFFER_SIZE? > > There are three mechanisms that all limit TB size: > (1) OPC_MAX_SIZE, limiting the number of opcodes emitted, > (2) CF_COUNT_MASK, limiting the number of instructions translated, > (3) Instruction pointer crossing a page boundary, where we end a TB > and re-verify the page protection bits of the new page. > > Nr 1 is probably the most significant, since it most directly relates to > the number of output instructions, and thus the resulting TB size. BTW, for comparison, tcg/s390/tcg-target.c works well enough with just 16 bits on the relative branch insns; eight times smaller than your 19 bits. r~