Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ static guint16 sri_vector_methods [] = {
SN_ToVector128Unsafe,
SN_ToVector256,
SN_ToVector256Unsafe,
SN_WidenLower,
SN_WidenUpper,
SN_WithElement,
SN_Xor,
};
Expand Down Expand Up @@ -1264,6 +1266,27 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
ins->inst_c1 = arg0_type;
return ins;
}
case SN_WidenLower:
case SN_WidenUpper: {
#ifdef TARGET_ARM64
if (!is_element_type_primitive (fsig->params [0]))
return NULL;

int op = id == SN_WidenLower ? OP_XLOWER : OP_XUPPER;
MonoInst *lower_or_upper_half = emit_simd_ins_for_sig (cfg, klass, op, 0, arg0_type, fsig, args);

if (type_enum_is_float (arg0_type)) {
return emit_simd_ins (cfg, klass, OP_ARM64_FCVTL, lower_or_upper_half->dreg, -1);
} else {
int zero = alloc_ireg (cfg);
MONO_EMIT_NEW_ICONST (cfg, zero, 0);
op = type_enum_is_unsigned (arg0_type) ? OP_ARM64_USHLL : OP_ARM64_SSHLL;
return emit_simd_ins (cfg, klass, op, lower_or_upper_half->dreg, zero);
}
#else
return NULL;
#endif
}
case SN_WithLower:
case SN_WithUpper: {
if (!is_element_type_primitive (fsig->params [0]))
Expand Down
2 changes: 2 additions & 0 deletions src/mono/mono/mini/simd-methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ METHOD(ToVector128)
METHOD(ToVector128Unsafe)
METHOD(ToVector256)
METHOD(ToVector256Unsafe)
METHOD(WidenLower)
METHOD(WidenUpper)
METHOD(WithElement)
METHOD(WithLower)
METHOD(WithUpper)
Expand Down