Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kaxe6-0002zG-BY for qemu-devel@nongnu.org; Wed, 03 Sep 2008 15:04:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kaxe2-0002xN-6i for qemu-devel@nongnu.org; Wed, 03 Sep 2008 15:04:01 -0400 Received: from [199.232.76.173] (port=54961 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kaxe2-0002xJ-4Z for qemu-devel@nongnu.org; Wed, 03 Sep 2008 15:03:58 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:37594) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kaxe1-0000Tz-55 for qemu-devel@nongnu.org; Wed, 03 Sep 2008 15:03:57 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id 23DDFE997892 for ; Wed, 3 Sep 2008 21:02:54 +0200 (CEST) Received: from [91.18.103.131] (helo=[10.0.1.1]) by smtp06.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.109 #226) id 1Kaxau-0004dk-00 for qemu-devel@nongnu.org; Wed, 03 Sep 2008 21:00:45 +0200 Message-Id: <67BC3D0E-6819-426A-BD93-ADE75621E6E4@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} to TCG Date: Wed, 3 Sep 2008 21:00:23 +0200 References: <1F0A98C0-A1DE-4548-8A4D-9E15EDC72686@web.de> <5FBA68BE-2F96-41D9-B032-BCA4A96557A7@web.de> <16A6085C-BD53-4AB5-8E39-0CA993CE12FF@web.de> <8E69B597-ADAC-4E4B-A675-45FEDDAF65BF@web.de> <20080902232051.GS4681@volta.aurel32.net> <20080903050757.GX4681@volta.aurel32.net> <20080903112840.GC17474@networkno.de> <7F235F5C-A1C9-4617-8C8D-900778862BBD@web.de> Sender: andreas.faerber@web.de 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 Am 03.09.2008 um 20:26 schrieb Blue Swirl: > On 9/3/08, Andreas F=E4rber wrote: >> Here's what I've pieced together: >> >> - for ppc64 just use i64 op >> - for ppc on 32-bit host use 2x i32 move, w/ TCGV_HIGH and w/o >> - for ppc on 64-bit host use i32 move + i64 shift + i32 move >> >> static always_inline void gen_op_load_gpr64(TCGv t, int reg) { >> #if defined(TARGET_PPC64) >> tcg_gen_mov_i64(t, cpu_gpr[reg]); >> #else >> #if TCG_TARGET_REG_BITS =3D=3D 32 >> tcg_gen_mov_i32(TCGV_HIGH(t), cpu_gprh[reg]); >> #else >> tcg_gen_mov_i32(t, cpu_gprh[reg]); >> tcg_gen_shli_i64(t, t, 32); >> #endif >> tcg_gen_mov_i32(t, cpu_gpr[reg]); >> #endif >> } > > 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 =3D 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 } static always_inline void gen_store_gpr64(int reg, TCGv t) { #if defined(TARGET_PPC64) tcg_gen_mov_i64(cpu_gpr[reg], t); #else tcg_gen_trunc_i64_i32(cpu_gpr[reg], t); TCGv tmp =3D tcg_temp_local_new(TCG_TYPE_I64); tcg_gen_shri_i64(tmp, t, 32); tcg_gen_trunc_i64_i32(cpu_gprh[reg], tmp); tcg_temp_free(tmp); #endif } Andreas