All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/17] target/i386/tcg: implement APX
@ 2026-09-23 17:30 Paolo Bonzini
  2026-09-23 17:30 ` [PATCH 01/17] target/i386/tcg: generalize zero- and sign-extension Paolo Bonzini
                   ` (17 more replies)
  0 siblings, 18 replies; 35+ messages in thread
From: Paolo Bonzini @ 2026-09-23 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: chang.seok.bae, zhao1.liu

This series implements APX support; the main reason to do this is actually
to have some initial infrastructure for EVEX, without requiring all the
complexity of AVX512 but introducing the required changes in the
emulator.  It also forces some changes that (hopefully) make
QEMU's decoder align a bit more with what Intel processors actually do.

This series was tested with Zhao Liu's https://github.com/trueptolemy/apx-test.
The failures were analyzed by AI but the fixes had to be redone anyway.
Other than for a couple typos, the LLM tended to fix the symptom rather
than be general, which is exactly the opposite of what I wanted.  For
example, for the MUL/IMUL/DIV/IDIV assertion failure it wanted to modify
the decoding tables instead of weakening

  assert(e->s0 == e->s1);

to this:

  assert(e->op1 == X86_TYPE_None || e->s0 == e->s1);

Changing the decoding tables probably is a more common failure mode, indeed,
but not the right approach in the context of this series.  Other than that,
the AGENTS.md from the AI policy discussion worked fine and the LLM was very
keen on helping me not stray from the righteous path.

The issues detected by apx-test and fixed here are as follows:

- MUL/IMUL/DIV/IDIV caused an assertion failure

- INC/DEC did not allow 0x66 as a prefix

- CMOV/CFCMOV's implicit zero-upper behavior was missing

- IMUL's use of sextT0 conflicted with the zero-upper modifier (see also
  patches 1-3)

- MOVBE's register-to-register implementation was missing (see also
  patch 4)

- REX2 incorrectly allowed a 0x0F byte following the prefix (patch 8)

On top of this, the fix between APX and MPX was not correctly resolved,
which is now fixed, and PUSH2/POP2 use a single MO_128 access.

I also included a couple recommendations from Chang Seok Bae.  Thanks!

Paolo


Paolo Bonzini (17):
  target/i386/tcg: generalize zero- and sign-extension
  target/i386/tcg: use standard operand order for BSF and BSR
  target/i386/tcg: use zextT1 for CMPXCHG
  target/i386/tcg: unify MOVBE and BSWAP generators
  target/i386/tcg: add APX support to XSAVE/XRSTOR
  target/i386/tcg: add definition for REX2 prefix
  target/i386/tcg: mark XSAVE* as not allowing REX2
  target/i386/tcg: treat 0x0F as a prefix
  target/i386/tcg: decode REX2 prefix
  target/i386/tcg: implement JMPABS instruction
  target/i386/tcg: extend VEX.vvvv parsing for APX
  target/i386/tcg: decode EVEX prefix
  target/i386/tcg: add decode functionality for APX
  target/i386/tcg: implement CCMP/CTEST
  target/i386/tcg: decode APX instructions
  target/i386: extract computation of no-autoenable features
  target/i386/tcg: mark APX as supported

 configs/targets/x86_64-bsd-user.mak      |   2 +-
 configs/targets/x86_64-linux-user.mak    |   2 +-
 target/i386/cpu.h                        |   8 +
 target/i386/helper.h                     |   1 +
 target/i386/tcg/decode-new.h             |  32 +-
 target/i386/tcg/tcg-cpu.h                |  18 +-
 target/i386/tcg/cc_helper_template.h.inc |  11 +
 target/i386/cpu.c                        |  45 +-
 target/i386/helper.c                     |  11 +
 target/i386/tcg/cc_helper.c              |  14 +
 target/i386/tcg/excp_helper.c            |   5 +
 target/i386/tcg/fpu_helper.c             |  59 +-
 target/i386/tcg/tcg-cpu.c                |   5 +-
 target/i386/tcg/translate.c              | 112 ++-
 target/i386/tcg/decode-new.c.inc         | 823 +++++++++++++++++++----
 target/i386/tcg/emit.c.inc               | 255 ++++++-
 16 files changed, 1210 insertions(+), 193 deletions(-)

-- 
2.55.0



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-09-29  8:09 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23 17:30 [PATCH v2 00/17] target/i386/tcg: implement APX Paolo Bonzini
2026-09-23 17:30 ` [PATCH 01/17] target/i386/tcg: generalize zero- and sign-extension Paolo Bonzini
2026-09-23 19:34   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 02/17] target/i386/tcg: use standard operand order for BSF and BSR Paolo Bonzini
2026-09-23 19:36   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 03/17] target/i386/tcg: use zextT1 for CMPXCHG Paolo Bonzini
2026-09-23 19:36   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 04/17] target/i386/tcg: unify MOVBE and BSWAP generators Paolo Bonzini
2026-09-23 19:39   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 05/17] target/i386/tcg: add APX support to XSAVE/XRSTOR Paolo Bonzini
2026-09-23 17:30 ` [PATCH 06/17] target/i386/tcg: add definition for REX2 prefix Paolo Bonzini
2026-09-23 19:41   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 07/17] target/i386/tcg: mark XSAVE* as not allowing REX2 Paolo Bonzini
2026-09-23 19:42   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 08/17] target/i386/tcg: treat 0x0F as a prefix Paolo Bonzini
2026-09-23 19:51   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 09/17] target/i386/tcg: decode REX2 prefix Paolo Bonzini
2026-09-23 19:57   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 10/17] target/i386/tcg: implement JMPABS instruction Paolo Bonzini
2026-09-23 22:30   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 11/17] target/i386/tcg: extend VEX.vvvv parsing for APX Paolo Bonzini
2026-09-23 22:39   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 12/17] target/i386/tcg: decode EVEX prefix Paolo Bonzini
2026-09-23 23:28   ` Richard Henderson
2026-09-23 17:30 ` [PATCH 13/17] target/i386/tcg: add decode functionality for APX Paolo Bonzini
2026-09-24 15:17   ` Richard Henderson
2026-09-28 10:34     ` Zhao Liu
2026-09-28 12:16     ` Paolo Bonzini
2026-09-29  7:50       ` Richard Henderson
2026-09-29  8:08         ` Paolo Bonzini
2026-09-23 17:30 ` [PATCH 14/17] target/i386/tcg: implement CCMP/CTEST Paolo Bonzini
2026-09-23 17:30 ` [PATCH 15/17] target/i386/tcg: decode APX instructions Paolo Bonzini
2026-09-23 17:30 ` [PATCH 16/17] target/i386: extract computation of no-autoenable features Paolo Bonzini
2026-09-23 17:30 ` [PATCH 17/17] target/i386/tcg: mark APX as supported Paolo Bonzini
2026-09-28 10:57 ` [PATCH v2 00/17] target/i386/tcg: implement APX Zhao Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.