qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH RFC v8 01/12] target/rx: TCG translation
Date: Fri, 3 May 2019 11:43:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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!


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]