NicolasStigler opened PR #15179 from NicolasStigler:main to bytecodealliance:main:
Fixes #3296
Why
The x64 backend had no lowering for
ssub_satoni32x4ori64x2. Since x86 has no packed signed saturating-subtraction instruction for those lane widths and there was no legalization fallback, these operations failed with an ISLE lowering error.What changed
- Add SSE2-based lowerings for
i32x4andi64x2signed saturating subtraction.- Detect subtraction overflow per lane and select the appropriate
MINorMAXsaturation value.- Update x64 fuzzgen so it no longer excludes
ssub_satfor these types.- Extend and rename the regression test to cover AArch64, x86_64, x86_64 with AVX, and both RISC-V 64-bit configurations.
Testing
cargo +1.97.0 fmt --all -- --checkcargo +1.97.0 test -p cranelift-codegencargo +1.97.0 test -p cranelift-filetestscargo +1.97.0 test -p cranelift-tools --test filetestscargo +1.97.0 test -p cranelift-tools --test logged-filetestscargo +1.97.0 check -p cranelift-fuzzgen- Ran the regression test, both x64 reproducers, and the original multi-target reproducer with
clif-util; all passed.- Confirmed the x64 lowerings use SSE2 instructions. x64 runtests ran natively; AArch64, RISC-V 64-bit, and s390x targets were compile-only.
NicolasStigler removed the review request for wasmtime-compiler-reviewers from PR #15179.
NicolasStigler requested cfallin for a review on PR #15179.
NicolasStigler requested wasmtime-compiler-reviewers for a review on PR #15179.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin has enabled auto merge for PR #15179.
cfallin added PR #15179 cranelift: x64: implement packed signed saturating subtraction - #3296 to the merge queue.
:check: cfallin merged PR #15179.
cfallin removed PR #15179 cranelift: x64: implement packed signed saturating subtraction - #3296 from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC