From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQIqd-0004RV-Nc for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:00:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQIqZ-0002Ov-Hl for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:00:39 -0500 Received: from out1134-249.mail.aliyun.com ([42.120.134.249]:48073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQIqZ-0002Of-2A for qemu-devel@nongnu.org; Tue, 24 Feb 2015 12:00:35 -0500 Message-ID: <54ECB002.8070907@sunrus.com.cn> Date: Wed, 25 Feb 2015 01:08:18 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54EC2DEE.8050809@sunrus.com.cn> <54EC88D6.3060402@ezchip.com> <54EC9B47.1040006@sunrus.com.cn> <54ECA9F3.3060903@redhat.com> In-Reply-To: <54ECA9F3.3060903@redhat.com> 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: Richard Henderson , Peter Maydell , Chris Metcalf Cc: "walt@tilera.com" , Riku Voipio , qemu-devel On 2/25/15 00:42, Richard Henderson wrote: > 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. > OK, thanks, what you said above sounds reasonable to me, I shall use tcg temporary variable for zero register, when I send patch v2. Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed