From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Khoaf-0001Ui-Om for qemu-devel@nongnu.org; Mon, 22 Sep 2008 12:48:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Khoae-0001UP-CX for qemu-devel@nongnu.org; Mon, 22 Sep 2008 12:48:49 -0400 Received: from [199.232.76.173] (port=44713 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khoae-0001UM-40 for qemu-devel@nongnu.org; Mon, 22 Sep 2008 12:48:48 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:46429) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Khoad-0007Cg-HW for qemu-devel@nongnu.org; Mon, 22 Sep 2008 12:48:47 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [5281] Use the new concat_i32_i64 op for std and stda Date: Mon, 22 Sep 2008 17:47:13 +0100 References: <20080921211908.GB22151@networkno.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809221747.13762.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: Blue Swirl On Monday 22 September 2008, Blue Swirl wrote: > On 9/22/08, Thiemo Seufer wrote: > > Blue Swirl wrote: > > > On 9/21/08, Paul Brook wrote: > > > > > Like these patches? > > > > > > > > > > +static inline void tcg_gen_concat_i64_i64(TCGv dest, TCGv low, > > > > > TCGv high) +{ > > > > > + TCGv tmp = tcg_temp_new(TCG_TYPE_I64); > > > > > + tcg_gen_shli_i64(tmp, high, 32); > > > > > + tcg_gen_or_i64(dest, low, tmp); > > > > > + tcg_temp_free(tmp); > > > > > +} > > > > > > > > This should use concat_i32_i64 on 32-bit hosts. > > > > > > > > Ok with that change, the rename I suggested in my previous mail, > > > > and if you add documentation to tcg/README. > > > > > > Updated. I'll run a couple of tests. > > > > I noticed I could also use the complement ("split"?) to those > > instructions in the mips backend. Maybe the same is true for > > sparc. > > Currently I'm using the following: > tcg_gen_trunc_i64_tl(cpu_tmp0, cpu_tmp64); > tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, 0xffffffffULL); > gen_movl_TN_reg(rd + 1, cpu_tmp0); > tcg_gen_shri_i64(cpu_tmp64, cpu_tmp64, 32); > tcg_gen_trunc_i64_tl(cpu_val, cpu_tmp64); > tcg_gen_andi_tl(cpu_val, cpu_val, 0xffffffffULL); > > On a 32 bit host a much more efficient method could be used if wrapped in > an op. Which bits would be more efficient? Note that the final andi is superfluous. Paul