qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 13/23] target/i386: Introduce DISAS_JUMP


From: Richard Henderson
Subject: Re: [PATCH v2 13/23] target/i386: Introduce DISAS_JUMP
Date: Wed, 21 Sep 2022 23:27:06 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 9/21/22 12:28, Paolo Bonzini wrote:
On Tue, Sep 6, 2022 at 12:09 PM Richard Henderson
<richard.henderson@linaro.org> wrote:

Drop the unused dest argument to gen_jr().
Remove most of the calls to gen_jr, and use DISAS_JUMP.
Remove some unused loads of eip for lcall and ljmp.

The only use outside i386_tr_tb_stop is here:

static void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
{
     target_ulong pc = s->cs_base + eip;

     if (translator_use_goto_tb(&s->base, pc))  {
         /* jump to same page: we can use a direct jump */
         tcg_gen_goto_tb(tb_num);
         gen_jmp_im(s, eip);
         tcg_gen_exit_tb(s->base.tb, tb_num);
         s->base.is_jmp = DISAS_NORETURN;
     } else {
         /* jump to another page */
         gen_jmp_im(s, eip);
         gen_jr(s);
     }
}

Should it set s->base.is_jmp = DISAS_JUMP instead, so that gen_jr() can be
inlined into i386_tr_tb_stop() and removed completely? If not,

It can't, because of conditional branches which do

   brcond something, L1
   gen_goto_tb
L1
   gen_goto_tb

The first gen_goto_tb can't just fall through, it needs to exit.


r~



reply via email to

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