-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Added floor and ceiling intrinsics for System.Runtime.Intrinsics.Vector128
and System.Numerics.Vector
#83592
Changes from 6 commits
b94e807
959d387
83b2b1d
0e1f773
8e78826
1b7fcef
8da9fb7
c2d1102
276b066
e8aae1d
f0209d8
c6ef7ac
9c75322
a1dec39
f7889d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1190,10 +1190,10 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi | |
return NULL; | ||
#endif | ||
// FIXME: This limitation could be removed once everything here are supported by mini JIT on arm64 | ||
#ifdef TARGET_ARM64 | ||
if (!(cfg->compile_aot && cfg->full_aot && !cfg->interp)) | ||
return NULL; | ||
#endif | ||
// #ifdef TARGET_ARM64 | ||
// if (!(cfg->compile_aot && cfg->full_aot && !cfg->interp)) | ||
// return NULL; | ||
// #endif | ||
|
||
int id = lookup_intrins (sri_vector_methods, sizeof (sri_vector_methods), cmethod); | ||
if (id == -1) { | ||
|
@@ -1220,6 +1220,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi | |
case SN_BitwiseAnd: | ||
case SN_BitwiseOr: | ||
case SN_Xor: | ||
case SN_Floor: | ||
case SN_Ceiling: | ||
break; | ||
default: | ||
return NULL; | ||
|
@@ -1325,8 +1327,14 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi | |
if (!type_enum_is_float (arg0_type)) | ||
return NULL; | ||
#ifdef TARGET_ARM64 | ||
int ceil_or_floor = id == SN_Ceiling ? INTRINS_AARCH64_ADV_SIMD_FRINTP : INTRINS_AARCH64_ADV_SIMD_FRINTM; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be implemented by handling OP_XOP_OVR_X_X in mini-arm64.c ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried like that firstly but INTRINS_AARCH64_ADV_SIMD_FRINTP and INTRINS_AARCH64_ADV_SIMD_FRINTM were not defined anywhere…I assume they are LLVM specific. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is okay for now. We probably need to clean it up later, such as unify the label names. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are defined in llvm-intrinsics-types.h. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, together with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A possible approach would be to use the llvm intrinsics in mini-arm64.c as well, they are just constants. If additional constants are needed to encode instructions that llvm doesn't have, they could be added after them, i.e. after INTRINS_NUM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to do this now or after we enable all intrinsics? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to do it now. I see we will need that included for other things, too. |
||
return emit_simd_ins_for_sig (cfg, klass, OP_XOP_OVR_X_X, ceil_or_floor, arg0_type, fsig, args); | ||
if (!COMPILE_LLVM(cfg)) { | ||
int ceil_or_floor = id == SN_Ceiling ? OP_CEIL : OP_FLOOR; | ||
return emit_simd_ins_for_sig (cfg, klass, OP_XUNOP, ceil_or_floor, arg0_type, fsig, args); | ||
} | ||
else { | ||
int ceil_or_floor = id == SN_Ceiling ? INTRINS_AARCH64_ADV_SIMD_FRINTP : INTRINS_AARCH64_ADV_SIMD_FRINTM; | ||
return emit_simd_ins_for_sig (cfg, klass, OP_XOP_OVR_X_X, ceil_or_floor, arg0_type, fsig, args); | ||
} | ||
#elif defined(TARGET_AMD64) | ||
if (!is_SIMD_feature_supported (cfg, MONO_CPU_X86_SSE41)) | ||
return NULL; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be removed before merge.