From mboxrd@z Thu Jan 1 00:00:00 1970 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA11EC004C9 for ; Sun, 5 May 2019 16:11:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA0132082F for ; Sun, 5 May 2019 16:11:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA0132082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:43273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNJjF-0005wF-Qf for qemu-devel@archiver.kernel.org; Sun, 05 May 2019 12:11:05 -0400 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 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.vps.ablenet.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail01.asahi-net.or.jp (Postfix) with ESMTPA id 3C16D113E46; Mon, 6 May 2019 01:07:15 +0900 (JST) Received: from yo-satoh-debian.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 011F4240085; Mon, 6 May 2019 01:07:14 +0900 (JST) Date: Mon, 06 May 2019 01:07:14 +0900 Message-ID: <87r29c51hp.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Richard Henderson 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> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.13 Subject: Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190505160714.Nkh7LA7jlnYGfEaMzXr7InefTgZYL-2RJg-33D0tOik@z> 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