darmie opened PR #13964 from darmie:x64-vpdpbusd-upstream to bytecodealliance:main:
Adds AVX-VNNI
vpdpbusd(VEX.128.66.0F38.W0 50 /r) to the x64 backend plus ahas_avx_vnniISA flag with host detection, and folds the signed×unsigned i8 widening dot-accumulate tree into a single instruction. This is the x64 version of the aarch64sdotfold.The rule matches
iadd(iadd_pairwise(... swiden(imul(swiden a, uwiden b)) ...), acc)and lowers it tox64_vpdpbusd acc b a:asign-extended,bzero-extended, which is exactly whatvpdpbusdcomputes. Only the mixed u8×i8 form is matched; signed×signed (thesdotpattern) would needvpdpbssdand is left alone. Unmatched patterns keep the widening chain.Tested with a
compilefiletest (; check: vpdpbusd) and runtests (including ab > 127case so the unsigned reading is observable), and executed on Alder Lake AVX-VNNI hardware. VEX.128 only; EVEX/256-bit are follow-ups.
darmie requested cfallin for a review on PR #13964.
darmie requested wasmtime-compiler-reviewers for a review on PR #13964.
darmie updated PR #13964.
darmie requested wasmtime-core-reviewers for a review on PR #13964.
darmie updated PR #13964.
github-actions[bot] added the label cranelift on PR #13964.
github-actions[bot] added the label cranelift:area:x64 on PR #13964.
github-actions[bot] added the label cranelift:meta on PR #13964.
github-actions[bot] added the label isle on PR #13964.
github-actions[bot] added the label wasmtime:api on PR #13964.
github-actions[bot] added the label wasmtime:config on PR #13964.
github-actions[bot] commented on PR #13964:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "cranelift:meta", "isle", "wasmtime:api", "wasmtime:config"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
github-actions[bot] commented on PR #13964:
Label Messager: wasmtime:config
It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:
[ ] If you added a new
Configmethod, you wrote extensive documentation for
it.<details>
Our documentation should be of the following form:
```text
Short, simple summary sentence.More details. These details can be multiple paragraphs. There should be
information about not just the method, but its parameters and results as
well.Is this method fallible? If so, when can it return an error?
Can this method panic? If so, when does it panic?
Example
Optional example here.
```</details>
[ ] If you added a new
Configmethod, or modified an existing one, you
ensured that this configuration is exercised by the fuzz targets.<details>
For example, if you expose a new strategy for allocating the next instance
slot inside the pooling allocator, you should ensure that at least one of our
fuzz targets exercises that new strategy.Often, all that is required of you is to ensure that there is a knob for this
configuration option in [wasmtime_fuzzing::Config][fuzzing-config] (or one
of its nestedstructs).Rarely, this may require authoring a new fuzz target to specifically test this
configuration. See [our docs on fuzzing][fuzzing-docs] for more details.</details>
[ ] If you are enabling a configuration option by default, make sure that it
has been fuzzed for at least two weeks before turning it on by default.[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html
<details>
To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.
To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.</details>
darmie commented on PR #13964:
Thanks! A couple of clarifications on the auto-applied labels and checklist:
wasmtime:config/wasmtime:api: this PR doesn't add or change any publicConfigmethod or configuration option. Theconfig.rsandengine.rsedits are internal host-feature-detection plumbing (detect_host_feature, and the flag→feature-name map incheck_compatible_with_native_host), required whenever a new Cranelift x86 ISA setting is added (herehas_avx_vnni) so a serialized module's ISA flags can be checked against the host at load time. Without it, loading any cached module errors withdon't know how to test for target-specific flag "has_avx_vnni" at runtime. So the Config-documentation, Config-fuzzing, and default-enablement items don't apply.Testing the new lowering: the
vpdpbusdfold has a compile filetest (isa/x64/simd-vpdpbusd.clif) and an executed runtest (runtests/simd-vpdpbusd.clif), including ab > 127case so the unsigned reading is observable; the runtest runs under the Intel-SDE CI job on emulated AVX-VNNI. One thing worth flagging directly: the assembler-x64 fuzz roundtrip skipsvpdpbusd, because the bundled capstone (0.14) doesn't disassemble AVX-VNNI and so has no reference to compare against; the encoding is instead verified by that executed runtest. Happy to take a different approach to the disassembler gap if you'd prefer.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #13964 cranelift(x64): fold the u8×i8 dot-accumulate tree to vpdpbusd (AVX-VNNI) to the merge queue
github-merge-queue[bot] removed PR #13964 cranelift(x64): fold the u8×i8 dot-accumulate tree to vpdpbusd (AVX-VNNI) from the merge queue
alexcrichton added PR #13964 cranelift(x64): fold the u8×i8 dot-accumulate tree to vpdpbusd (AVX-VNNI) to the merge queue
:check: alexcrichton merged PR #13964.
alexcrichton removed PR #13964 cranelift(x64): fold the u8×i8 dot-accumulate tree to vpdpbusd (AVX-VNNI) from the merge queue
Last updated: Jul 29 2026 at 05:03 UTC