You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[wasi] Enable PackedSimd intrinsics and ILLink substitutions
The mono interpreter only emitted wasm packed-simd intrinsic opcodes when
HOST_BROWSER was defined. On WASI the interpreter returned FALSE for every
PackedSimd method, so calls fell through to the C# method body which
recursively calls itself, producing a stack overflow (observed with
ConvertNarrowingSaturateUnsigned and other PackedSimd intrinsics).
Additionally, WasiApp.targets did not inject the ILLink substitutions that
fold PackedSimd.IsSupported to a constant, so even with WasmEnableSIMD=false
the simd code paths survived trimming and the call sites still recursed.
Changes:
* src/mono/mono/mini/interp/interp-simd.h, interp-simd.c, interp-nosimd.c,
transform-simd.c: extend the HOST_BROWSER gates around the wasm
packed-simd intrinsic tables and emission to also cover HOST_WASI. The
mono-wasm-simd static library is already built with -msimd128 for both
hosts in cmake.
* src/mono/wasi/build/WasiApp.targets: add _ExtraTrimmerArgs for the
WasmIntrinsics.xml / NoWasmIntrinsics.xml substitutions, mirroring
BrowserWasmApp.targets, and uncomment the -msimd128 clang flag when
WasmEnableSIMD=true.
* src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk/
Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk.pkgproj: package the two
ILLink.Substitutions.*.xml files next to WasiApp.targets in the WASI
SDK so $(MSBuildThisFileDirectory) resolves at app build time.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk/Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk.pkgproj
0 commit comments