Received: from eggs.gnu.org ([209.51.188.92]:53465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNJfZ-0003RR-La for qemu-devel@nongnu.org; Sun, 05 May 2019 12:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNJfY-0006WR-O1 for qemu-devel@nongnu.org; Sun, 05 May 2019 12:07:17 -0400 Received: from mail01.asahi-net.or.jp ([202.224.55.13]:45829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNJfY-0006Vn-Fz for qemu-devel@nongnu.org; Sun, 05 May 2019 12:07:16 -0400 Date: Mon, 06 May 2019 01:07:14 +0900 Message-ID: <87r29c51hp.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato In-Reply-To: <3de96999-eba5-fa88-0c4d-a7b27d916081@linaro.org> References: <20190502143409.59600-1-ysato@users.sourceforge.jp> <20190502143409.59600-2-ysato@users.sourceforge.jp> <3de96999-eba5-fa88-0c4d-a7b27d916081@linaro.org> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org On Sat, 04 May 2019 03:43:23 +0900, Richard Henderson wrote: > > On 5/2/19 7:33 AM, Yoshinori Sato wrote: > > +/* conditional branch helper */ > > +static void rx_bcnd_main(DisasContext *ctx, int cd, int dst) > > +{ > > + DisasCompare dc; > > + TCGLabel *t, *done; > > + > > + switch (cd) { > > + case 0 ... 13: > > + dc.temp = tcg_temp_new(); > > + psw_cond(&dc, cd); > > + t = gen_new_label(); > > + done = gen_new_label(); > > + tcg_gen_brcondi_i32(dc.cond, dc.value, 0, t); > > + gen_goto_tb(ctx, 0, ctx->base.pc_next); > > + tcg_gen_br(done); > > + gen_set_label(t); > > + gen_goto_tb(ctx, 1, ctx->pc + dst); > > + gen_set_label(done); > > + tcg_temp_free(dc.temp); > > + break; > > + case 14: > > + /* always true case */ > > + gen_goto_tb(ctx, 0, ctx->pc + dst); > > + break; > > + case 15: > > + /* always false case */ > > + /* Nothing do */ > > + break; > > + } > > + ctx->base.is_jmp = DISAS_JUMP; > > +} > > Do not set is_jmp to DISAS_JUMP here. We have already set is_jmp to > DISAS_NORETURN in gen_goto_tb. For case 15, we do not need to exit the TB in > order to treat the never-taken branch as a nop. > > This assignment means that we will emit *another* exit from the TB in > rx_tr_tb_stop, which will be unreachable code. > > This is the only bug I see in this revision. Thanks for your patience! > OK. I did not notice it because it was never used. Too many thanks. > > r~ > -- Yosinori Sato