Skip to content

With LLVM 20 the SIMD intrinsic wasm32::u8x16_sub_sat is compiled to a function call #137419

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
hkratz opened this issue Feb 22, 2025 · 3 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-SIMD Area: SIMD (Single Instruction Multiple Data) C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/

Comments

@hkratz
Copy link
Contributor

hkratz commented Feb 22, 2025

The WASM SIMD intrinsic std::arch::wasm32::u8x16_sub_sat used to be compiled to the WASM instruction i8x16.sub_sat_u. Since the switch LLVM 20 (bisected) it is compiled to call llvm.wasm.sub.sat.unsigned.v16i8

Other intrinsics (e.g. saturated integer addition) do not seem to be affected.

Godbolt

@hkratz hkratz added the C-bug Category: This is a bug. label Feb 22, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 22, 2025
@hkratz
Copy link
Contributor Author

hkratz commented Feb 22, 2025

@rustbot label +A-llvm +A-SIMD +O-WASM

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ A-SIMD Area: SIMD (Single Instruction Multiple Data) labels Feb 22, 2025
@nikic
Copy link
Contributor

nikic commented Feb 22, 2025

This is already fixed in stdarch (rust-lang/stdarch#1719), but needs the update to be pulled in.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 24, 2025
Update stdarch

Update stdarch to fix rust-lang#137419. (This also pulls in a lot of other changes though).

r? `@Amanieu`
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 1, 2025
@hanna-kruppe
Copy link
Contributor

Fixed (by #136831?), see original godbolt link

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-SIMD Area: SIMD (Single Instruction Multiple Data) C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants