Stream: git-wasmtime

Topic: wasmtime / PR #15211 x64: add APX NDD lowering for unary ...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 23:44):

jlb6740 opened PR #15211 from jlb6740:apx-patch-unary-and-32bit to bytecodealliance:main:

Second of a series splitting https://github.com/bytecodealliance/wasmtime/pull/14696
into one PR per instruction class, following https://github.com/bytecodealliance/wasmtime/pull/14930.
Adds the APX NDD (new data destination) forms of the unary ops neg and not, which
use a VM encoding where the written operand takes the vvvv slot and ModRM.reg still
holds the opcode extension, plus the 32-bit RVM forms of add, sub, and, or and xor.
i8 and i16 lower through the 32-bit form, since they are already widened. has_apx is off by default, so nothing changes unless it's
enabled. More NDD patches to follow.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 23:44):

jlb6740 requested alexcrichton for a review on PR #15211.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 23:44):

jlb6740 removed the review request for wasmtime-compiler-reviewers from PR #15211.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 23:44):

jlb6740 requested wasmtime-compiler-reviewers for a review on PR #15211.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 01:44):

github-actions[bot] added the label cranelift on PR #15211.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 01:44):

github-actions[bot] added the label cranelift:area:x64 on PR #15211.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 15:29):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 15:29):

:speech_balloon: alexcrichton created PR review comment:

I might have missed this from earlier discussion, but why do these rules explicitly use put_in_gpr for all operands? Do APX instructions not support 8/16-bit memory load operands?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 15:29):

:speech_balloon: alexcrichton created PR review comment:

Personally I'd say it's probably fine to drop all of these tests. They're pretty verbose and I don't think it's worth adding individual tests for all instructions. The "oracles" here are opaque hex strings which can't really be reviewed or verified, so I think we'll be best to lean on other testing methods like differential fuzzing (should we enable that for a disassembler that supports apx) or CI-based runtest execution (e.g. QEMU with apx emulation or intel's emulator).

Actually, along those lines, we already have some tests executed through the Intel SDE, for example this job. Does the SDE support APX? If so can you add directives in CLIF runtests with test x86_64 has_apx to get full execution testing for the new instructions? That's probably the best possible testing we can hope for since our disasemblers don't support APX (or it's at least not wired up)

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 15:29):

:speech_balloon: alexcrichton created PR review comment:

Would it make sense to put these rules within the x64_not helper perhaps where applicable? That way other usages of x64_not would also benefit from these new lowering rules as well. This'd also apply to most of the other rules changed in this PR too.


Last updated: Nov 19 2026 at 20:05 UTC