From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcLA1-0003cA-9u for qemu-devel@nongnu.org; Sun, 07 Sep 2008 10:22:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcLA0-0003bh-Id for qemu-devel@nongnu.org; Sun, 07 Sep 2008 10:22:40 -0400 Received: from [199.232.76.173] (port=45886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcLA0-0003bT-4n for qemu-devel@nongnu.org; Sun, 07 Sep 2008 10:22:40 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:41501) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KcL9z-0001Iw-LX for qemu-devel@nongnu.org; Sun, 07 Sep 2008 10:22:40 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} to TCG Date: Sun, 7 Sep 2008 15:22:31 +0100 References: <1F0A98C0-A1DE-4548-8A4D-9E15EDC72686@web.de> <67BC3D0E-6819-426A-BD93-ADE75621E6E4@web.de> In-Reply-To: <67BC3D0E-6819-426A-BD93-ADE75621E6E4@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809071522.32415.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andreas =?iso-8859-1?q?F=E4rber?= > > Can't you use extu_i32_i64 followed by shift and then or? I think you > > should not use TCGV_HIGH outside tcg directory, it's an implementation > > detail. > > Thanks for the suggestion! You mean like this? > > static always_inline void gen_load_gpr64(TCGv t, int reg) { > #if defined(TARGET_PPC64) > tcg_gen_mov_i64(t, cpu_gpr[reg]); > #else > tcg_gen_extu_i32_i64(t, cpu_gprh[reg]); > tcg_gen_shli_i64(t, t, 32); > TCGv tmp = tcg_temp_local_new(TCG_TYPE_I64); > tcg_gen_extu_i32_i64(tmp, cpu_gpr[reg]); > tcg_gen_or_i64(t, t, tmp); > tcg_temp_free(tmp); > #endif > } It's probably worth making a separate helper function for concatenating two 32-bit operands into a 64-bit operand so that it can be implemented natively. I doubt whether the TCG code is smart enough to DTRT there. Paul