qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/11] target/i386: cleanup PAUSE helpers


From: Paolo Bonzini
Subject: Re: [PATCH 04/11] target/i386: cleanup PAUSE helpers
Date: Tue, 4 Jun 2024 16:08:37 +0200

On Tue, Jun 4, 2024 at 12:59 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 6/4/24 02:18, Paolo Bonzini wrote:
> > Use decode.c's support for intercepts, doing the check in TCG-generated
> > code rather than the helper.  This is cleaner because it allows removing
> > the eip_addend argument to helper_pause(), even though it adds a bit of
> > bloat for opcode 0x90's new decoding function.
> >
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >   target/i386/helper.h                 |  2 +-
> >   target/i386/tcg/helper-tcg.h         |  1 -
> >   target/i386/tcg/misc_helper.c        | 10 +---------
> >   target/i386/tcg/sysemu/misc_helper.c |  2 +-
> >   target/i386/tcg/decode-new.c.inc     | 15 ++++++++++++++-
> >   target/i386/tcg/emit.c.inc           | 20 ++++++++------------
> >   6 files changed, 25 insertions(+), 25 deletions(-)
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> > +static void decode_90(DisasContext *s, CPUX86State *env, X86OpEntry 
> > *entry, uint8_t *b)
> > +{
> > +    static X86OpEntry pause = X86_OP_ENTRY0(PAUSE, svm(PAUSE));
> > +    static X86OpEntry nop = X86_OP_ENTRY0(NOP);
> > +    static X86OpEntry xchg_ax = X86_OP_ENTRY2(XCHG, 0,v, LoBits,v);
> > +
> > +    if (REX_B(s)) {
> > +        *entry = xchg_ax;
> > +    } else {
> > +        *entry = (s->prefix & PREFIX_REPZ) ? pause : nop;
> > +    }
> > +}
>
> Thanks.  I had wished for this
> from the beginning, but since it wasn't wrong, I didn't mention it.

Yeah, I was still making up my mind on the style. Using set_cc_op()
for BMI instructions was also silly, I'll fix it soon.

Basically I want to get to a point where the common code and the
helpers are all set for implementing APX, then we'll see.

Paolo




reply via email to

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