From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5V4G-0000za-QP for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5V4F-0008SB-SC for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:21:00 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:35181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5V4F-0008S1-Ja for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:20:59 -0400 Date: Thu, 18 Jun 2015 10:20:57 +0200 From: Aurelien Jarno Message-ID: <20150618082057.GD3379@aurel32.net> References: <20150617124158.3316.54954.stgit@PASHA-ISP> <20150617124205.3316.81361.stgit@PASHA-ISP> <55816DAE.8090701@redhat.com> <000901d0a986$139ca850$3ad5f8f0$@Dovgaluk@ispras.ru> <55827E67.90803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55827E67.90803@redhat.com> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH v2 1/3] softmmu: add helper function to pass through retaddr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: rth7680@gmail.com, leon.alrae@imgtec.com, qemu-devel@nongnu.org, Pavel Dovgaluk On 2015-06-18 10:16, Paolo Bonzini wrote: > > > On 18/06/2015 07:17, Pavel Dovgaluk wrote: > >>> > > > >>> > > static inline RES_TYPE > >>> > > -glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) > >>> > > +glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, > >>> > > + target_ulong ptr, > >>> > > + uintptr_t retaddr) > >> > > >> > Would it make sense to call these helper_cpu_ld##USUFFIX##MEMSUFFIX? > > I don't want to use 'helper' prefix, because helper functions are > > usually called directly from TB. > > True, but in the end these have the same functionality as helpers, just > they're indirectly called from other helpers. Not fully. The idea is that the helpers are non-inline functions handling the slow path. The cpu_ld##USUFFIX##MEMSUFFIX are inline functions handling the fast path, and calling the helpers for the slow path. That allows for example GCC to optimize the fast path when the cpu_ld functions are used in a loop. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net