From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkKJf-0005d9-7P for qemu-devel@nongnu.org; Tue, 13 May 2014 17:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkKJW-0001Vw-5q for qemu-devel@nongnu.org; Tue, 13 May 2014 17:32:51 -0400 Received: from mail-yk0-x22a.google.com ([2607:f8b0:4002:c07::22a]:65416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkKJW-0001Vq-1e for qemu-devel@nongnu.org; Tue, 13 May 2014 17:32:42 -0400 Received: by mail-yk0-f170.google.com with SMTP id 10so854699ykt.1 for ; Tue, 13 May 2014 14:32:41 -0700 (PDT) Message-ID: <53728F74.1000302@gmail.com> Date: Tue, 13 May 2014 16:32:36 -0500 From: Tom Musta MIME-Version: 1.0 References: <5372870A.5010107@gmail.com> <53728A80.1070107@twiddle.net> In-Reply-To: <53728A80.1070107@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Bug in PPC TCG for rlwimi ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Peter Maydell Cc: QEMU Developers On 5/13/2014 4:11 PM, Richard Henderson wrote: > On 05/13/2014 02:09 PM, Peter Maydell wrote: >> Dumping the TCG opcodes would probably help here (-d op)... > > Use -d op if you suspect a bug in the translator. > Use -d op_opt if you suspect a bug in the out_asm. > > > r~ > It is big endian. Here is the -d op output. What does the "mov_i32 tmp0,r4" op mean when r4 is an i64? IN: 0x00000fffa87a2ae4: rlwimi r4,r4,8,16,23 OP: ld_i32 tmp0,env,$0xfffffffffffffffc movi_i32 tmp1,$0x0 brcond_i32 tmp0,tmp1,ne,$0x0 ---- 0xfffa87a2ae4 mov_i32 tmp0,r4 movi_i32 tmp1,$0x8 rotl_i32 tmp0,tmp0,tmp1 movi_i64 tmp3,$0xffffffff and_i64 tmp2,tmp0,tmp3 movi_i64 tmp4,$0xff00 and_i64 tmp2,tmp2,tmp4 movi_i64 tmp4,$0xffffffffffff00ff and_i64 tmp3,r4,tmp4 or_i64 r4,tmp2,tmp3 goto_tb $0x0 movi_i64 nip,$0xfffa87a2ae8 exit_tb $0xfffa88bdc30 set_label $0x0 exit_tb $0xfffa88bdc33 The op_opt output is this: OP after optimization and liveness analysis: ld_i32 tmp0,env,$0xfffffffffffffffc movi_i32 tmp1,$0x0 brcond_i32 tmp0,tmp1,ne,$0x0 ---- 0xfff7efa2ae4 mov_i32 tmp0,r4 movi_i32 tmp1,$0x8 rotl_i32 tmp0,tmp0,tmp1 nopn $0x2,$0x2 mov_i64 tmp2,tmp0 movi_i64 tmp4,$0xff00 and_i64 tmp2,tmp2,tmp4 movi_i64 tmp4,$0xffffffffffff00ff and_i64 tmp3,r4,tmp4 or_i64 r4,tmp2,tmp3 goto_tb $0x0 movi_i64 nip,$0xfff7efa2ae8 exit_tb $0xfff7f0bdc30 set_label $0x0 exit_tb $0xfff7f0bdc33 end OUT: [size=136] 0x603638c0: lwz r14,-4(r27) 0x603638c4: cmpwi cr7,r14,0 0x603638c8: bne- cr7,0x60363934 0x603638cc: lwz r14,32(r27) 0x603638d0: mr r15,r14 0x603638d4: rotlwi r15,r15,8 0x603638d8: andi. r15,r15,65280 0x603638dc: lis r0,-1 0x603638e0: ori r0,r0,255 0x603638e4: and r14,r14,r0 0x603638e8: or r14,r15,r14 0x603638ec: std r14,32(r27) 0x603638f0: .long 0x0 0x603638f4: .long 0x0 0x603638f8: .long 0x0 0x603638fc: .long 0x0 0x60363900: .long 0x0 0x60363904: .long 0x0 0x60363908: .long 0x0