Received: from eggs.gnu.org ([208.118.235.92]:57192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEpd6-0008G2-9i for qemu-devel@nongnu.org; Thu, 20 Sep 2012 18:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEpd5-0003C2-9M for qemu-devel@nongnu.org; Thu, 20 Sep 2012 18:53:56 -0400 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:49219 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEpd5-0003Bw-1q for qemu-devel@nongnu.org; Thu, 20 Sep 2012 18:53:55 -0400 Date: Fri, 21 Sep 2012 02:53:41 +0400 (MSK) From: malc In-Reply-To: Message-ID: References: <5059FA36.1080301@twiddle.net> <505A011C.1020106@twiddle.net> <20120919175116.GC29951@hall.aurel32.net> <505A0895.8000008@twiddle.net> <505A22C8.6030409@twiddle.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [Qemu-devel] Shifts, ppc[64], xtensa List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: Peter Maydell , qemu-devel@nongnu.org, Aurelien Jarno , Richard Henderson On Thu, 20 Sep 2012, Max Filippov wrote: > On Wed, Sep 19, 2012 at 11:53 PM, Richard Henderson wrote: > > On 09/19/2012 11:30 AM, Peter Maydell wrote: > >> ...but on the other hand that ought to work for PPC too, so > >> presumably my analysis is wrong somewhere. > > > > It isn't. It's a target-xtensa bug. > > [..snip..] > > This code is generated when TB ends on LEND > (zero-overhead loop ending) with branching instruction. > So, in addition to 3 way branch there's extra looping code > generated by unconditional gen_check_loop_end(dc, 0); > at the end of disas_xtensa_insn. I was pretty sure that this > dead code would make no harm. --enable-debug-tcg says > nothing on x86_64 host. The following should fix that: It does, once the commit message is fixed i can apply it. > > -- >8 -- > From: Max Filippov > Date: Thu, 20 Sep 2012 04:07:20 +0400 > Subject: [PATCH] target-xtensa: don't emit extra gen_check_loop_end > > Unconditional gen_check_loop_end at the end of disas_xtensa_insn > can emit tcg_gen_goto_tb with slot id already used in the TB (e.g. when > TB ends at LEND with a branch). Not all tcg backends can handle that. > > Signed-off-by: Max Filippov > --- > target-xtensa/translate.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c > index 63b37b3..57a2b6f 100644 > --- a/target-xtensa/translate.c > +++ b/target-xtensa/translate.c > @@ -2502,7 +2502,9 @@ static void disas_xtensa_insn(DisasContext *dc) > break; > } > > - gen_check_loop_end(dc, 0); > + if (dc->is_jmp == DISAS_NEXT) { > + gen_check_loop_end(dc, 0); > + } > dc->pc = dc->next_pc; > > return; > -- mailto:av1474@comtv.ru