-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] Initial SIMD support #70086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] Initial SIMD support #70086
Conversation
The llvm code generator works nicely with them.
So that C#
WasmBase.Constant(0xff11ff22ff33ff44, 0xff55ff66ff77ff88)
is compiled into wasm code
v128.const 0xff11ff22ff33ff44ff55ff66ff77ff88 [SIMD]
This will need more work, as it crashes clang during 'WebAssembly
Instruction Selection' pass:
WasmApp.Native.targets(353,5): error : 3. Running pass 'WebAssembly Instruction Selection' on function '@corlib_System_Runtime_Intrinsics_Wasm_WasmBase_Shuffle_System_Runtime_Intrinsics_Vector128_1_byte_System_Runtime_Intrinsics_Vector128_1_byte_System_Runtime_Intrinsics_Vector128_1_byte'
Also add "experimental" to the property comment
|
What does |
Exception Handling |
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsAdd initial SIMD support for wasm. This is subset of the original draft PR without the public API additions. I left the underlying parts of new Add Add test to build and run a simple app with SIMD enabled. Example of the produced code: The C# code: And comparison to the non SIMD version: Measurements of the bench-sample (aot and aot + SIMD are relevant here): browser-bench/Release configuration .NET7 May 19th *1 .NET7 May 13th + emscripten 3.1.9 + SIMD Chrome Version 101.0.4951.67 (Official Build) (64-bit)
|
radical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build, and test changes look good.
|
Are there benchmarks in |
These ones should see improvements https://github.com/dotnet/performance/blob/main/src/benchmarks/micro/libraries/System.Numerics.Vectors/Perf_VectorOfT.cs But they should be running already with bigger sets of instructions. |
Add initial SIMD support for wasm. This is subset of the original draft PR without the public API additions. I left the underlying parts of new
WasmBaseclass implementation here as well to not loose it.Add
WasmSIMDproperty to enable SIMD in AOT builds. With the property enabled, the apps built with AOT get SIMD intrinsics inlined for parts ofS.R.I.Vector128andS.R.I.Vector128<T>API.Add test to build and run a simple app with SIMD enabled.
Example of the produced code:
The C# code:
And comparison to the non SIMD version:
Measurements of the bench-sample (aot and aot + SIMD are relevant here):
browser-bench/Release configuration
.NET7 May 19th
*1 .NET7 May 13th + emscripten 3.1.9 + SIMD
Chrome Version 101.0.4951.67 (Official Build) (64-bit)