Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mono] Intrinsify Vector conversion methods #66597

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 @@ -859,7 +859,10 @@ static guint16 sri_vector_methods [] = {
SN_ConditionalSelect,
SN_ConvertToDouble,
SN_ConvertToInt32,
SN_ConvertToInt64,
SN_ConvertToSingle,
SN_ConvertToUInt32,
SN_ConvertToUInt64,
SN_Create,
SN_CreateScalar,
SN_CreateScalarUnsafe,
Expand Down Expand Up @@ -1049,6 +1052,33 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
return emit_simd_ins_for_sig (cfg, klass, op, -1, arg0_type, fsig, args);
#else
return NULL;
#endif
}
case SN_ConvertToInt64:
case SN_ConvertToUInt64: {
#ifdef TARGET_ARM64
if (arg0_type != MONO_TYPE_R8)
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 (id == SN_ConvertToInt64)
op = size == 8 ? OP_ARM64_FCVTZS_SCALAR : OP_ARM64_FCVTZS;
else
op = size == 8 ? OP_ARM64_FCVTZU_SCALAR : OP_ARM64_FCVTZU;
return emit_simd_ins_for_sig (cfg, klass, op, -1, arg0_type, fsig, args);
#else
return NULL;
#endif
}
case SN_ConvertToSingle: {
#ifdef TARGET_ARM64
if ((arg0_type != MONO_TYPE_I4) && (arg0_type != MONO_TYPE_U4))
return NULL;
int op = arg0_type == MONO_TYPE_I4 ? 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_Create: {
Expand Down