On Wed, Sep 23, 2026 at 07:30:04PM +0200, Paolo Bonzini wrote:
> Date: Wed, 23 Sep 2026 19:30:04 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH v2 00/17] target/i386/tcg: implement APX
> X-Mailer: git-send-email 2.55.0
> 
> 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.

About the APX testing, I'd also like to acknowledge Chang’s help :-).
He discussed many things of the APX TCG and offered a lot of insightful
advice.

> 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.

Maybe off-topic, for AI usage, I have a qemu prompt for AI use of my
own:

https://github.com/trueptolemy/review-prompts/tree/qemu-v0.1-06-08-2026/qemu

(Such prompts and skills also respect the policies in AGENTS.md.)

>From my personal experience, at least it is effective to catch annoying
compatibility issues. I'm also considering "upstreaming" it (which I
think would require some refinement) - i.e., contributing it to the
masoncl/review-prompts project, which should be helpful for any future
qemu-sashiko work.

> 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!

Tested-by: Zhao Liu <[email protected]>

Thanks,
Zhao


Reply via email to