Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ static guint16 sri_vector_methods [] = {
SN_AsVector4,
SN_Ceiling,
SN_ConditionalSelect,
SN_ConvertToDouble,
SN_ConvertToInt32,
SN_ConvertToUInt32,
SN_Create,
SN_CreateScalar,
SN_CreateScalarUnsafe,
Expand Down Expand Up @@ -802,6 +805,33 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
return emit_simd_ins_for_sig (cfg, klass, OP_ARM64_BSL, -1, arg0_type, fsig, args);
#else
return NULL;
#endif
}
case SN_ConvertToDouble: {
#ifdef TARGET_ARM64
if ((arg0_type != MONO_TYPE_I8) && (arg0_type != MONO_TYPE_U8))
return NULL;
MonoClass *arg_class = mono_class_from_mono_type_internal (fsig->params [0]);
int size = mono_class_value_size (arg_class, NULL);
int op = -1;
if (size == 8)
op = arg0_type == MONO_TYPE_I8 ? OP_ARM64_SCVTF_SCALAR : OP_ARM64_UCVTF_SCALAR;
else
op = arg0_type == MONO_TYPE_I8 ? OP_ARM64_SCVTF : OP_ARM64_UCVTF;
return emit_simd_ins_for_sig (cfg, klass, op, -1, arg0_type, fsig, args);
#else
return NULL;
#endif
}
case SN_ConvertToInt32:
case SN_ConvertToUInt32: {
#ifdef TARGET_ARM64
if (arg0_type != MONO_TYPE_R4)
return NULL;
int op = id == SN_ConvertToInt32 ? OP_ARM64_FCVTZS : OP_ARM64_FCVTZU;
return emit_simd_ins_for_sig (cfg, klass, op, -1, arg0_type, fsig, args);
#else
return NULL;
#endif
}
case SN_Create: {
Expand Down