Skip to content

Commit

Permalink
[mono] Fix some asserts caused by dotnet#78182.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Nov 13, 2022
1 parent cc712fd commit ce13eec
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ get_vector_t_elem_type (MonoType *vector_type)
}

static gboolean
type_is_unsigned (MonoType *type) {
type_is_unsigned (MonoType *type)
{
MonoClass *klass = mono_class_from_mono_type_internal (type);
MonoType *etype = mono_class_get_context (klass)->class_inst->type_argv [0];
return type_enum_is_unsigned (etype->type);
Expand All @@ -705,7 +706,8 @@ type_enum_is_unsigned (MonoTypeEnum type)
}

static gboolean
type_is_float (MonoType *type) {
type_is_float (MonoType *type)
{
MonoClass *klass = mono_class_from_mono_type_internal (type);
MonoType *etype = mono_class_get_context (klass)->class_inst->type_argv [0];
return type_enum_is_float (etype->type);
Expand Down Expand Up @@ -2145,12 +2147,14 @@ emit_sys_numerics_vector_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig
klass = cmethod->klass;
type = m_class_get_byval_arg (klass);
etype = mono_class_get_context (klass)->class_inst->type_argv [0];

if (!MONO_TYPE_IS_VECTOR_PRIMITIVE (etype))
return NULL;

size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL);
g_assert (size);
len = register_size / size;

if (!MONO_TYPE_IS_VECTOR_PRIMITIVE (etype))
return NULL;

if (cfg->verbose_level > 1) {
char *name = mono_method_full_name (cmethod, TRUE);
Expand Down Expand Up @@ -4193,13 +4197,14 @@ emit_vector256_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fs

klass = cmethod->klass;
etype = mono_class_get_context (klass)->class_inst->type_argv [0];
size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL);
g_assert (size);
len = 32 / size;

if (!MONO_TYPE_IS_VECTOR_PRIMITIVE (etype))
return NULL;

size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL);
g_assert (size);
len = 32 / size;

if (cfg->verbose_level > 1) {
char *name = mono_method_full_name (cmethod, TRUE);
printf (" SIMD intrinsic %s\n", name);
Expand Down

0 comments on commit ce13eec

Please sign in to comment.