From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czoup-0000wT-Sl for qemu-devel@nongnu.org; Sun, 16 Apr 2017 14:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czouo-0000w3-CB for qemu-devel@nongnu.org; Sun, 16 Apr 2017 14:28:51 -0400 Date: Sun, 16 Apr 2017 14:28:43 -0400 From: "Emilio G. Cota" Message-ID: <20170416182843.GA30160@flamenco> References: <1491959850-30756-1-git-send-email-cota@braap.org> <1491959850-30756-6-git-send-email-cota@braap.org> <73257eb8-edfd-ae0b-a5fa-b1194de568d8@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73257eb8-edfd-ae0b-a5fa-b1194de568d8@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 05/10] tcg: add jr opcode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Peter Maydell , Eduardo Habkost , Peter Crosthwaite , Stefan Weil , Alexander Graf , alex.bennee@linaro.org, qemu-arm@nongnu.org, Pranith Kumar , Paolo Bonzini , Aurelien Jarno On Sat, Apr 15, 2017 at 04:40:35 -0700, Richard Henderson wrote: > On 04/11/2017 06:17 PM, Emilio G. Cota wrote: > >This will be used by TCG targets to implement a fast path > >for indirect branches. > > > >I only have implemented and tested this on an i386 host, so > >make this opcode optional and mark it as not implemented by > >other TCG backends. > > I don't think this is quite the right abstraction. In particular, if we can > always return a valid address from the helper, we can eliminate a > conditional branch. > > I think this should work as follows: (snip) Yes that's much better. In fact in the cover letter I forgot to mention that the code by the paper authors does something similar to avoid the branch. I went with the design with a branch because (1) I wasn't sure that exporting tb_ret_addr would get your approval and (2) my knowledge of TCG backend code is shamefully poor. Will work on a v2. Thanks for the feedback! Emilio