Skip to content

Commit 762d241

Browse files
committed
Ensure the right class handle is passed down to LLVM so overload resolution can function
1 parent f85e513 commit 762d241

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mono/mono/mini/simd-intrinsics.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
27062706
if (COMPILE_LLVM (cfg)) {
27072707
if ((get_xconst_int_elem (cfg, args [1], MONO_TYPE_U8, 0) == 0x300000002) &&
27082708
(get_xconst_int_elem (cfg, args [1], MONO_TYPE_U8, 1) == 0x100000000)) {
2709+
etype = m_class_get_byval_arg (mono_defaults.uint64_class);
2710+
klass = create_class_instance ("System.Runtime.Intrinsics", "Vector128`1", new_etype);
27092711
new_args [1] = args [0];
27102712
EMIT_NEW_ICONST (cfg, new_args [2], 1);
27112713
MonoInst* ins = emit_simd_ins (cfg, klass, OP_ARM64_EXT, new_args [0]->dreg, new_args [1]->dreg);
@@ -2732,6 +2734,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
27322734
}
27332735
}
27342736
}
2737+
etype = m_class_get_byval_arg (mono_defaults.byte_class);
2738+
klass = create_class_instance ("System.Runtime.Intrinsics", "Vector128`1", new_etype);
27352739
new_args [1] = emit_xconst_v128 (cfg, klass, vec_cns);
27362740
return emit_simd_ins_for_sig (cfg, klass, OP_XOP_OVR_X_X_X, INTRINS_AARCH64_ADV_SIMD_TBL1, 0, fsig, new_args);
27372741
#elif defined(TARGET_AMD64)
@@ -2789,6 +2793,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
27892793
if (!is_SIMD_feature_supported (cfg, MONO_CPU_X86_SSSE3)) {
27902794
return NULL;
27912795
}
2796+
etype = m_class_get_byval_arg (mono_defaults.byte_class);
2797+
klass = create_class_instance ("System.Runtime.Intrinsics", "Vector128`1", new_etype);
27922798
new_args [1] = emit_xconst_v128 (cfg, klass, vec_cns);
27932799
return emit_simd_ins_for_sig (cfg, klass, OP_XOP_X_X_X, INTRINS_SSE_PSHUFB, 0, fsig, new_args);
27942800
}
@@ -2798,6 +2804,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
27982804
// down into a TYP_INT or TYP_UINT based shuffle, but that's additional complexity for no
27992805
// real benefit since shuffle gets its own port rather than using the fp specific ports.
28002806
arg0_type = MONO_TYPE_R8;
2807+
etype = m_class_get_byval_arg (mono_defaults.double_class);
2808+
klass = create_class_instance ("System.Runtime.Intrinsics", "Vector128`1", new_etype);
28012809
}
28022810
if ((arg0_type == MONO_TYPE_R4) || (arg0_type == MONO_TYPE_R8)) {
28032811
int opcode = (arg0_type == MONO_TYPE_R4) ? OP_SSE_SHUFPS : OP_SSE2_SHUFPD;

0 commit comments

Comments
 (0)