diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index 700099737d29c1..29261cf8a2638d 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -560,6 +560,7 @@ type_to_extract_op (MonoTypeEnum type) } static guint16 sri_vector_methods [] = { + SN_Abs, SN_As, SN_AsByte, SN_AsDouble, @@ -635,6 +636,23 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi MonoTypeEnum arg0_type = fsig->param_count > 0 ? get_underlying_type (fsig->params [0]) : MONO_TYPE_VOID; switch (id) { + case SN_Abs: { +#ifdef TARGET_ARM64 + switch (arg0_type) { + case MONO_TYPE_U1: + case MONO_TYPE_U2: + case MONO_TYPE_U4: + case MONO_TYPE_U8: + case MONO_TYPE_U: + return NULL; + } + gboolean is_float = arg0_type == MONO_TYPE_R4 || arg0_type == MONO_TYPE_R8; + int iid = is_float ? INTRINS_AARCH64_ADV_SIMD_FABS : INTRINS_AARCH64_ADV_SIMD_ABS; + return emit_simd_ins_for_sig (cfg, klass, OP_XOP_OVR_X_X, iid, arg0_type, fsig, args); +#else + return NULL; +#endif +} case SN_As: case SN_AsByte: case SN_AsDouble: