Skip to content

Commit

Permalink
Ensure get_common_simd_info handles non-generic input parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Jul 3, 2024
1 parent 8778938 commit 6713a79
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mono/mono/mini/interp/transform-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,14 @@ emit_common_simd_operations (TransformData *td, int id, int atype, int vector_si
static gboolean
get_common_simd_info (MonoClass *vector_klass, MonoMethodSignature *csignature, MonoTypeEnum *atype, int *vector_size, int *arg_size, int *scalar_arg)
{
if (!m_class_is_simd_type (vector_klass) && csignature->param_count)
vector_klass = mono_class_from_mono_type_internal (csignature->params [0]);
if (!m_class_is_simd_type (vector_klass) && csignature->param_count) {
if (csignature->params [0]->type == MONO_TYPE_GENERICINST) {
vector_klass = mono_class_from_mono_type_internal (csignature->params [0]);
} else {
g_assert(csignature->ret->type == MONO_TYPE_GENERICINST);
vector_klass = mono_class_from_mono_type_internal (csignature->ret);
}
}
if (!m_class_is_simd_type (vector_klass))
return FALSE;

Expand Down

0 comments on commit 6713a79

Please sign in to comment.