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
69 changes: 35 additions & 34 deletions src/mono/mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -2594,43 +2594,49 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
*op = MINT_CEQ_I4;
}
}
}
else if (in_corlib &&
} else if (in_corlib &&
!strcmp ("System.Runtime.CompilerServices", klass_name_space) &&
!strcmp ("RuntimeFeature", klass_name)) {
// NOTE: on the interpreter, use the C# code in System.Private.CoreLib for IsDynamicCodeSupported
// and always return false for IsDynamicCodeCompiled
if (!strcmp (tm, "get_IsDynamicCodeCompiled"))
*op = MINT_LDC_I4_0;
} else if (in_corlib && (!strncmp ("System.Runtime.Intrinsics", klass_name_space, 25))) {
if (klass_name_space[25] == '\0' &&
!strncmp ("Vector", klass_name, 6) &&
!strcmp (tm, "get_IsHardwareAccelerated")) {
*op = MINT_LDC_I4_0;
} else if (klass_name_space[25] == '.') {
if (!strncmp ("Arm", klass_name_space + 26, 3) ||
!strncmp ("X86", klass_name_space + 26, 3)) {
if (!strcmp (tm, "get_IsSupported"))
*op = MINT_LDC_I4_0;
else
interp_generate_void_throw (td, MONO_JIT_ICALL_mono_throw_platform_not_supported);
} else if (!strncmp ("Wasm", klass_name_space + 26, 4)) {
if (!strcmp (tm, "get_IsSupported")) {
*op = MINT_LDC_I4_0;
}
#if defined(TARGET_WASM)
} else if (in_corlib &&
!strncmp ("System.Runtime.Intrinsics.Wasm", klass_name_space, 30) &&
!strcmp (klass_name, "WasmBase")) {
if (!strcmp (tm, "get_IsSupported")) {
*op = MINT_LDC_I4_1;
} else if (!strcmp (tm, "LeadingZeroCount")) {
if (csignature->params [0]->type == MONO_TYPE_U4 || csignature->params [0]->type == MONO_TYPE_I4)
*op = MINT_CLZ_I4;
else if (csignature->params [0]->type == MONO_TYPE_U8 || csignature->params [0]->type == MONO_TYPE_I8)
*op = MINT_CLZ_I8;
} else if (!strcmp (tm, "TrailingZeroCount")) {
if (csignature->params [0]->type == MONO_TYPE_U4 || csignature->params [0]->type == MONO_TYPE_I4)
*op = MINT_CTZ_I4;
else if (csignature->params [0]->type == MONO_TYPE_U8 || csignature->params [0]->type == MONO_TYPE_I8)
*op = MINT_CTZ_I8;
}
if (!strcmp (klass_name, "WasmBase")) {
if (!strcmp (tm, "get_IsSupported")) {
// override the value set above
*op = MINT_LDC_I4_1;
} else if (!strcmp (tm, "LeadingZeroCount")) {
if (csignature->params [0]->type == MONO_TYPE_U4 || csignature->params [0]->type == MONO_TYPE_I4)
*op = MINT_CLZ_I4;
else if (csignature->params [0]->type == MONO_TYPE_U8 || csignature->params [0]->type == MONO_TYPE_I8)
*op = MINT_CLZ_I8;
} else if (!strcmp (tm, "TrailingZeroCount")) {
if (csignature->params [0]->type == MONO_TYPE_U4 || csignature->params [0]->type == MONO_TYPE_I4)
*op = MINT_CTZ_I4;
else if (csignature->params [0]->type == MONO_TYPE_U8 || csignature->params [0]->type == MONO_TYPE_I8)
*op = MINT_CTZ_I8;
}
}
#endif
} else if (in_corlib &&
(!strncmp ("System.Runtime.Intrinsics.Arm", klass_name_space, 29) ||
!strncmp ("System.Runtime.Intrinsics.PackedSimd", klass_name_space, 36) ||
!strncmp ("System.Runtime.Intrinsics.X86", klass_name_space, 29) ||
!strncmp ("System.Runtime.Intrinsics.Wasm", klass_name_space, 30)) &&
!strcmp (tm, "get_IsSupported")) {
*op = MINT_LDC_I4_0;
} else if (in_corlib &&
(!strncmp ("System.Runtime.Intrinsics.Arm", klass_name_space, 29) ||
!strncmp ("System.Runtime.Intrinsics.X86", klass_name_space, 29))) {
interp_generate_void_throw (td, MONO_JIT_ICALL_mono_throw_platform_not_supported);
}
}
} else if (in_corlib && !strncmp ("System.Numerics", klass_name_space, 15)) {
if (!strcmp ("Vector", klass_name) &&
!strcmp (tm, "get_IsHardwareAccelerated")) {
Expand Down Expand Up @@ -2683,11 +2689,6 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
*op = MINT_LOG2_I8;
}
}
} else if (in_corlib &&
(!strncmp ("System.Runtime.Intrinsics", klass_name_space, 25) &&
!strncmp ("Vector", klass_name, 6) &&
!strcmp (tm, "get_IsHardwareAccelerated"))) {
*op = MINT_LDC_I4_0;
} else if ((target_method->klass == mono_defaults.double_class) || (target_method->klass == mono_defaults.single_class)) {
MonoGenericContext *method_context = mono_method_get_context (target_method);
bool isDouble = target_method->klass == mono_defaults.double_class;
Expand Down
Loading