Skip to content

Commit

Permalink
[mono][interp] Don't emit intrinsics for unsupported vector types
Browse files Browse the repository at this point in the history
  • Loading branch information
BrzVlad committed Feb 21, 2023
1 parent 8ffac07 commit 629cd94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mono/mono/mini/interp/transform-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ emit_sri_vector128 (TransformData *td, MonoMethod *cmethod, MonoMethodSignature
vector_klass = mono_class_from_mono_type_internal (csignature->params [0]);
if (!m_class_is_simd_type (vector_klass))
return FALSE;

MonoType *arg_type = mono_class_get_context (vector_klass)->class_inst->type_argv [0];
if (!mono_type_is_primitive (arg_type))
return FALSE;
MonoTypeEnum atype = arg_type->type;
if (atype == MONO_TYPE_BOOLEAN)
return FALSE;
int vector_size = mono_class_value_size (vector_klass, NULL);
int arg_size = mono_class_value_size (mono_class_from_mono_type_internal (arg_type), NULL);
g_assert (vector_size == SIZEOF_V128);
Expand Down Expand Up @@ -280,7 +285,11 @@ emit_sri_vector128_t (TransformData *td, MonoMethod *cmethod, MonoMethodSignatur
// First argument is always vector
MonoClass *vector_klass = cmethod->klass;
MonoType *arg_type = mono_class_get_context (vector_klass)->class_inst->type_argv [0];
if (!mono_type_is_primitive (arg_type))
return FALSE;
MonoTypeEnum atype = arg_type->type;
if (atype == MONO_TYPE_BOOLEAN)
return FALSE;
int vector_size = mono_class_value_size (vector_klass, NULL);
int arg_size = mono_class_value_size (mono_class_from_mono_type_internal (arg_type), NULL);
g_assert (vector_size == SIZEOF_V128);
Expand Down

0 comments on commit 629cd94

Please sign in to comment.