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
10 changes: 7 additions & 3 deletions src/mono/mono/mini/interp/transform-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ emit_vector_create (TransformData *td, MonoMethodSignature *csignature, MonoClas
static gboolean
emit_sri_vector128 (TransformData *td, MonoMethod *cmethod, MonoMethodSignature *csignature)
{
if (csignature->hasthis)
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an inline comment explaining that the early return based on 'hasthis' in this function is intended to avoid extra intrinsic lookups and improve performance.

Copilot uses AI. Check for mistakes.

return FALSE;

#ifdef HOST_BROWSER
if (emit_sri_packedsimd (td, cmethod, csignature))
return TRUE;
Expand Down Expand Up @@ -1076,6 +1079,9 @@ lookup_packedsimd_intrinsic (const char *name, MonoType *arg1)
static gboolean
emit_sri_packedsimd (TransformData *td, MonoMethod *cmethod, MonoMethodSignature *csignature)
{
if (csignature->hasthis)
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, add a comment here to clarify that the early exit for methods with 'this' pointers prevents redundant lookup operations for intrinsic resolution.

Copilot uses AI. Check for mistakes.

return FALSE;

const char *cmethod_name = cmethod->name;
int id = lookup_intrins (sri_packedsimd_methods, sizeof (sri_packedsimd_methods), cmethod_name);
MonoClass *vector_klass;
Expand Down Expand Up @@ -1122,9 +1128,7 @@ emit_sri_packedsimd (TransformData *td, MonoMethod *cmethod, MonoMethodSignature
if (!is_packedsimd) {
// transform the method name from the Vector(128|) name to the packed simd name
// FIXME: This is a hack, but it works for now.
if (csignature->hasthis) {
return FALSE;
}

int scalar_arg = -1;
for (int i = 0; i < csignature->param_count; i++) {
if (csignature->params [i]->type != MONO_TYPE_GENERICINST)
Expand Down
Loading