All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation
Date: Mon, 06 May 2019 01:07:14 +0900	[thread overview]
Message-ID: <87r29c51hp.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <3de96999-eba5-fa88-0c4d-a7b27d916081@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

WARNING: multiple messages have this Message-ID (diff)
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation
Date: Mon, 06 May 2019 01:07:14 +0900	[thread overview]
Message-ID: <87r29c51hp.wl-ysato@users.sourceforge.jp> (raw)
Message-ID: <20190505160714.Nkh7LA7jlnYGfEaMzXr7InefTgZYL-2RJg-33D0tOik@z> (raw)
In-Reply-To: <3de96999-eba5-fa88-0c4d-a7b27d916081@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


  reply	other threads:[~2019-05-05 16:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 14:33 [Qemu-devel] [PATCH RFC v8 00/12] Add RX archtecture support Yoshinori Sato
2019-05-02 14:33 ` Yoshinori Sato
2019-05-02 14:33 ` [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation Yoshinori Sato
2019-05-02 14:33   ` Yoshinori Sato
2019-05-03 18:43   ` Richard Henderson
2019-05-05 16:07     ` Yoshinori Sato [this message]
2019-05-05 16:07       ` Yoshinori Sato
2019-05-02 14:33 ` [Qemu-devel] [PATCH RFC v8 02/12] target/rx: TCG helper Yoshinori Sato
2019-05-02 14:33   ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 03/12] target/rx: CPU definition Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:45   ` Alex Bennée
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 04/12] target/rx: RX disassembler Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:54   ` Alex Bennée
2019-05-03 18:37   ` Richard Henderson
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 05/12] target/rx: Miscellaneous files Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 16:06   ` Alex Bennée
2019-05-05 16:06     ` Yoshinori Sato
2019-05-05 16:06       ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 06/12] hw/intc: RX62N interrupt controller (ICUa) Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:01   ` Alex Bennée
2019-05-03 15:50   ` Alex Bennée
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 07/12] hw/timer: RX62N internal timer modules Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:20   ` Alex Bennée
2019-05-05 16:06     ` Yoshinori Sato
2019-05-05 16:06       ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 08/12] hw/char: RX62N serical communication interface (SCI) Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:22   ` Alex Bennée
2019-05-05 16:07     ` Yoshinori Sato
2019-05-05 16:07       ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 09/12] hw/rx: RX Target hardware definition Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:38   ` Alex Bennée
2019-05-05 16:07     ` Yoshinori Sato
2019-05-05 16:07       ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 10/12] Add rx-softmmu Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 11/12] MAINTAINERS: Add RX Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-02 14:34 ` [Qemu-devel] [PATCH RFC v8 12/12] hw/registerfields.h: Add 8bit and 16bit register macros Yoshinori Sato
2019-05-02 14:34   ` Yoshinori Sato
2019-05-03 15:27   ` Alex Bennée
2019-05-03 18:39     ` Richard Henderson
2019-05-05 21:18       ` Alex Bennée
2019-05-05 21:18         ` Alex Bennée
2019-05-05 16:07     ` Yoshinori Sato
2019-05-05 16:07       ` Yoshinori Sato
2019-05-03 16:11 ` [Qemu-devel] [PATCH RFC v8 00/12] Add RX archtecture support Alex Bennée
2019-05-05 16:07   ` Yoshinori Sato
2019-05-05 16:07     ` Yoshinori Sato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r29c51hp.wl-ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.