Skip to content

Commit

Permalink
[wasm] Fix type check for PackedSimd.Splat (dotnet#81100)
Browse files Browse the repository at this point in the history
The Splat's 1st parameter is not Vector128'1, but element type.

Fixes this assertion:

    converting llvm method System.Runtime.Intrinsics.Vector128`1<sbyte> System.Runtime.Intrinsics.Wasm.PackedSimd:Splat (sbyte)
    * Assertion at D:\git\wa-local\src\mono\mono\mini\simd-intrinsics.c:690, condition `vector_type->type == MONO_TYPE_GENERICINST' not met
  • Loading branch information
radekdoulik authored Jan 25, 2023
1 parent e58174b commit 2df6ea4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -4406,7 +4406,8 @@ emit_wasm_supported_intrinsics (
}

if (feature == MONO_CPU_WASM_SIMD) {
if (!is_element_type_primitive (fsig->params [0]))
if (id != SN_Splat && !is_element_type_primitive (fsig->params [0]) ||
id == SN_Splat && !MONO_TYPE_IS_VECTOR_PRIMITIVE(fsig->params [0]))
return NULL;

switch (id) {
Expand Down

0 comments on commit 2df6ea4

Please sign in to comment.