[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
- [PATCH 01/11] target/i386: fix pushed value of EFLAGS.RF, (continued)
- [PATCH 01/11] target/i386: fix pushed value of EFLAGS.RF, Paolo Bonzini, 2024/06/04
- [PATCH 02/11] target/i386: fix implementation of ICEBP, Paolo Bonzini, 2024/06/04
- [PATCH 03/11] target/i386: cleanup HLT helpers, Paolo Bonzini, 2024/06/04
- [PATCH 05/11] target/i386: implement DR7.GD, Paolo Bonzini, 2024/06/04
- [PATCH 04/11] target/i386: cleanup PAUSE helpers, Paolo Bonzini, 2024/06/04
- [PATCH 06/11] target/i386: disable/enable breakpoints on vmentry/vmexit, Paolo Bonzini, 2024/06/04
- [PATCH 07/11] target/i386: fix INHIBIT_IRQ/TF/RF handling for VMRUN, Paolo Bonzini, 2024/06/04
- [PATCH 09/11] target/i386: fix TF/RF handling for HLT, Paolo Bonzini, 2024/06/04
- [PATCH 08/11] target/i386: fix INHIBIT_IRQ/TF/RF handling for PAUSE, Paolo Bonzini, 2024/06/04