qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 30/37] target/i386: reimplement 0x0f 0x10-0x17, add AVX


From: Richard Henderson
Subject: Re: [PATCH v2 30/37] target/i386: reimplement 0x0f 0x10-0x17, add AVX
Date: Sat, 24 Sep 2022 21:16:44 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 9/20/22 17:25, Paolo Bonzini wrote:
These are mostly moves, and yet are a total pain.  The main issue
is that:

1) some instructions are selected by mod==11 (register operand)
vs. mod=00/01/10 (memory operand)

2) stores to memory are two-operand operations, while the 3-register
and load-from-memory versions operate on the entire contents of the
destination; this makes it easier to separate the gen_* function for
the store case

3) it's inefficient to load into xmm_T0 only to move the value out
again, so the gen_* function for the load case is separated too

The manual also has various mistakes in the operands here, for example
the store case of MOVHPS operates on a 128-bit source (albeit discarding
the bottom 64 bits) and therefore should be Mq,Vdq rather than Mq,Vq.
Likewise for the destination and source of MOVHLPS.

VUNPCK?PS and VUNPCK?PD are the same as VUNPCK?DQ and VUNPCK?QDQ,
but encoded as prefixes rather than separate operands.  The helpers
can be reused however.

For MOVSLDUP, MOVSHDUP and MOVDDUP I chose to reimplement them as
helpers.  I named the helper for MOVDDUP "movdldup" in preparation
for possible future introduction of MOVDHDUP and to clarify the
similarity with MOVSLDUP.

Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
---
  target/i386/ops_sse.h            |   7 ++
  target/i386/ops_sse_header.h     |   3 +
  target/i386/tcg/decode-new.c.inc | 126 ++++++++++++++++++++++++++++++
  target/i386/tcg/emit.c.inc       | 127 +++++++++++++++++++++++++++++++
  target/i386/tcg/translate.c      |   1 +
  5 files changed, 264 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

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