Received: from eggs.gnu.org ([2001:4830:134:3::10]:50872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVraq-0007ki-D0 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 22:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVral-0001uW-CV for qemu-devel@nongnu.org; Fri, 05 Aug 2016 22:44:07 -0400 Sender: Richard Henderson References: <1469922783.5978.331.camel@kernel.crashing.org> From: Richard Henderson Message-ID: <4925580c-8864-ed8c-aa48-e3644a058976@twiddle.net> Date: Sat, 6 Aug 2016 08:13:55 +0530 MIME-Version: 1.0 In-Reply-To: <1469922783.5978.331.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TCG and branches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel On 07/31/2016 05:23 AM, Benjamin Herrenschmidt wrote: > The first obvious thing that comes to mind is to avoid stopping the > TB on a non-taken conditional branch. The reason that can't be done > today, from my limited understanding of things, is because we only > support index 0 and 1 today for gen_goto_tb(). Correct. > Now I haven't completely figured out how TB linkage works under the > hood but do you know of any fundamental reason why we have that limit ? > > Could we, for example, have a limit of, for example, 8 and only break > the TB after a branch if we have less than 2 left ? We do borrow low bits of a pointer (to a TranslationBlock) in implementing exit_tb. See TB_EXIT_MASK and the large block comment just above its definition in tcg/tcg.h. However, increasing the alignment of TranslationBlock ought to be trivial, giving you as many bits as required. With that, I see no reason in principal that this wouldn't work. Such a change would need some measurement to see how often this occurs, and how much this helps the actual runtime performance. r~