From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLd6C-00054T-Nn for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:56:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLd6A-0006ri-PM for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:56:04 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:62623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLd6A-0006rE-J1 for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:56:02 -0400 Received: by mail-wi0-f169.google.com with SMTP id hq4so4194082wib.4 for ; Tue, 09 Oct 2012 09:56:01 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5074571E.60700@redhat.com> Date: Tue, 09 Oct 2012 18:55:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1349786252-12343-1-git-send-email-yeongkyoon.lee@samsung.com> <20121009142610.GA14078@ohm.aurel32.net> <20121009161956.GG14078@ohm.aurel32.net> In-Reply-To: <20121009161956.GG14078@ohm.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 0/3] tcg: enhance code generation quality for qemu_ld/st IRs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org, Yeongkyoon Lee Il 09/10/2012 18:19, Aurelien Jarno ha scritto: >>> > > >> > >> > Instead of calling the MMU helper with an additional argument (7), and >> > then jump back (8) to the next code (4), what about pushing the address >> > of the next code (4) on the stack and use a jmp instead of the call. In >> > that case you don't need the extra argument to the helpers. >> > > Maybe it wasn't very clear. This is based on the fact that call is > basically push %rip + jmp. Therefore we can fake the return address by > putting the value we want, here the address of the next code. This mean > that we don't need to pass the extra argument to the helper for the > return address, as GET_PC() would work correctly (it basically reads the > return address on the stack). > > For other architectures, it might not be a push, but rather a move to > link register, basically put the return address where the calling > convention asks for. > > OTOH I just realized it only works if the end of the slow path (moving > the value from the return address to the correct register). It might be > something doable. Branch predictors will not oldschool tricks like this one. :) Paolo