From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQJSo-0007Ac-MH for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:40:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQJSj-0005tJ-9N for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:40:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQJSi-0005sn-G5 for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:40:01 -0500 Message-ID: <54ECA9F3.3060903@redhat.com> Date: Tue, 24 Feb 2015 06:42:27 -1000 From: Richard Henderson MIME-Version: 1.0 References: <54EC2DEE.8050809@sunrus.com.cn> <54EC88D6.3060402@ezchip.com> <54EC9B47.1040006@sunrus.com.cn> In-Reply-To: <54EC9B47.1040006@sunrus.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Execute _start and reach to __libc_start_main successfully List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang S , Peter Maydell , Chris Metcalf Cc: "walt@tilera.com" , Riku Voipio , qemu-devel On 02/24/2015 05:39 AM, Chen Gang S wrote: > After read through target-arm/translate-a64.c, I guess, the main reason > is: the zero register (r31) shares with the sp register (also r31). > > - So it uses cpu_reg() and cpu_reg_sp() for them. > > - For each zero register access, it will new a tcg temporary variable > for it, and release it after finish decoding one insn (so it will not > overwrite sp register.). > > For tilegx, zero register (r63) does not share with other registers (sp > is r54), so we needn't use wrap functions for it. Perhaps aarch64 is confusing for you. But Alpha also has zero registers, and also uses wrapper functions. See load_gpr and dest_gpr. The very most important reason to use a wrapper, and thus a tcg temporary that keeps getting re-initialized to zero, is that the tcg optimizer gets to see that zero and optimize the code accordingly. r~