From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym67d-00057L-6s for qemu-devel@nongnu.org; Sat, 25 Apr 2015 15:52:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym67a-0003QZ-1l for qemu-devel@nongnu.org; Sat, 25 Apr 2015 15:52:17 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:35677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym67Z-0003PO-RJ for qemu-devel@nongnu.org; Sat, 25 Apr 2015 15:52:13 -0400 Received: by pabtp1 with SMTP id tp1so83063139pab.2 for ; Sat, 25 Apr 2015 12:52:12 -0700 (PDT) Sender: Richard Henderson Message-ID: <553BEB3E.4020909@twiddle.net> Date: Sat, 25 Apr 2015 09:30:06 -1000 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Consult] tilegx: Is it a qemu's system bug? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang , Peter Maydell , Chris Metcalf , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Riku Voipio , "walt@tilera.com" Cc: qemu-devel On 04/25/2015 05:12 AM, Chen Gang wrote: > Hello All: > > I want to consult an issue I met below for the latest master branch, is > it a qemu's bug? (it is about ctz/cnttz instruction for tilegx) > > OP: > ld_i32 tmp0,env,$0xfffffffffffffffc > movi_i32 tmp1,$0x0 > brcond_i32 tmp0,tmp1,ne,$L0 > movi_i64 tmp3,$0x0 /* Initialize tmp3 */ > set_label $L1 > shr_i64 tmp2,r2,tmp3 You can't keep temporaries live across basic blocks. That is, across set_label, br, or brcond. In that case you'd have to use tcg_new_local_temp() instead. That said, you shouldn't open-code ctz but instead use a helper function and use ctz64(). r~