Received: from eggs.gnu.org ([2001:4830:134:3::10]:35302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym1zi-0007Jg-55 for qemu-devel@nongnu.org; Sat, 25 Apr 2015 11:27:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym1kD-0004FM-4s for qemu-devel@nongnu.org; Sat, 25 Apr 2015 11:11:52 -0400 Received: from blu004-omc1s15.hotmail.com ([65.55.116.26]:49665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym1kD-0004FI-1c for qemu-devel@nongnu.org; Sat, 25 Apr 2015 11:11:49 -0400 Message-ID: Date: Sat, 25 Apr 2015 23:12:02 +0800 From: Chen Gang MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [Consult] tilegx: Is it a qemu's system bug? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , "rth@twiddle.net" , Chris Metcalf , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Riku Voipio , "walt@tilera.com" Cc: qemu-devel 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 movi_i64 tmp4,$0x1 and_i64 tmp2,tmp2,tmp4 movi_i64 tmp4,$0x1 brcond_i64 tmp2,tmp4,eq,$L2 movi_i64 tmp4,$0x1 add_i64 tmp3,tmp3,tmp4 movi_i64 tmp4,$0x40 brcond_i64 tmp3,tmp4,ne,$L1 set_label $L2 mov_i64 tmp4,tmp3 set_label $L0 exit_tb $0x7ffff2690013 OP after optimization and liveness analysis: ld_i32 tmp0,env,$0xfffffffffffffffc movi_i32 tmp1,$0x0 brcond_i32 tmp0,tmp1,ne,$L0 set_label $L1 /* Skip tmp3 initialization */ shr_i64 tmp2,r2,tmp3 /* So I guess, qemu can not find tmp3 in shr_i64, so report assertion */ movi_i64 tmp4,$0x1 and_i64 tmp2,tmp2,tmp4 movi_i64 tmp4,$0x1 brcond_i64 tmp2,tmp4,eq,$L2 movi_i64 tmp4,$0x1 add_i64 tmp3,tmp3,tmp4 movi_i64 tmp4,$0x40 brcond_i64 tmp3,tmp4,ne,$L1 set_label $L2 set_label $L0 exit_tb $0x7ffff2690013 /* begin: I add related printing log in tcg_reg_alloc_op() before assertion */ opc == 12 /* ld_i32 */ ===============ts->val_type: 1========================. opc == 5 /* movi_i32 */ opc == 34 /* brcond_i32 */ ===============ts->val_type: 1========================. ===============ts->val_type: 3========================. opc == 1 /* set_label */ opc == 84 /* shr_i64 */ ============opc = INDEX_op_shr_i64 ==================== ===============ts->val_type: 2========================. ===============ts->val_type: 0========================. /* end: I add related printing log in tcg_reg_alloc_op() before assertion */ qemu-tilegx: /upstream/qemu/tcg/tcg.c:1982: tcg_reg_alloc_op: Assertion `ts->val_type == 1' failed. Welcome any ideas, suggestions and completions. Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed