From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKXPG-0008K6-RH for qemu-devel@nongnu.org; Thu, 12 May 2011 11:02:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKXPF-0004ey-NI for qemu-devel@nongnu.org; Thu, 12 May 2011 11:02:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKXPF-0004en-E1 for qemu-devel@nongnu.org; Thu, 12 May 2011 11:02:25 -0400 Message-ID: <4DCBF66E.6090000@redhat.com> Date: Thu, 12 May 2011 18:02:06 +0300 From: Avi Kivity MIME-Version: 1.0 References: <201105102228.37340.paul@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TCG: AREG0 removal planning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Paul Brook , qemu-devel On 05/11/2011 08:25 PM, Blue Swirl wrote: > > > > I think a useful, and incremental goal is elimination of global cpu_env state > > in C code (i.e eliminate HELPER_CFLAGS and dyngen-exec.h). > > We already have much of the infrastructure for this - op_helper v.s. helper.c > > and code_gen_prologue for transition in/out of "generated code" state. > > > > In practice generated code probably accesses CPUState often enough that a > > dedicated register isn't a bad idea. My guess is that eliminating it from C > > code gets us almost all of the useful benefit. Removing it from the code > > generator (i.e. TCG_AREG0) may be more pain that it's worth. > > I don't think moving the helpers from op_helper.c to helper.c will be > a performance win if AREG0 is not eliminated. The code gets to use one > register more, but AREG0 needs to be moved to a function argument > register in most cases and AREG0 has to be restored. I think the > benefit should come from generated code getting one more available > register. If you use a callee-saved register then you don't need to restore it. Looks like that's already the case, at least on x86. -- error compiling committee.c: too many arguments to function