Skip to content

ISimdVector vector intrinsics fixes #113288

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

Merged
merged 13 commits into from
Mar 13, 2025
Merged

Conversation

lewing
Copy link
Member

@lewing lewing commented Mar 8, 2025

#104983 added filtering for explicit ISimdVector implementations. It appears it used the wrong namespace for System.Numerics.Vector<T> when removing the expanded interface and types from the method name. Fix the explicit interface implementation filtering and call SN Vector interpreter intrinsics.

@lewing lewing force-pushed the test-sn-vector-interp branch 3 times, most recently from 934ec82 to b6f4172 Compare March 11, 2025 16:42
@lewing lewing force-pushed the test-sn-vector-interp branch from b6f4172 to b3560ab Compare March 11, 2025 18:03
@lewing lewing marked this pull request as ready for review March 11, 2025 22:11
@Copilot Copilot AI review requested due to automatic review settings March 11, 2025 22:11
@lewing lewing force-pushed the test-sn-vector-interp branch from 418452e to ddb2b8f Compare March 12, 2025 18:38
@lewing
Copy link
Member Author

lewing commented Mar 12, 2025

@tannergooding I assume this was the intent of the original code? if so I'm happy to do the same change in jitimporter/CorInfoImpl.cs?

done

Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @steveisok, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

@lewing lewing requested a review from EgorBo March 12, 2025 19:16
@lewing lewing force-pushed the test-sn-vector-interp branch from 04516ad to 35bfdea Compare March 12, 2025 19:24
@EgorBo
Copy link
Member

EgorBo commented Mar 12, 2025

@MihuBot

@lewing lewing force-pushed the test-sn-vector-interp branch from 750fdc6 to f318510 Compare March 12, 2025 20:11
@jeffhandley jeffhandley requested a review from Copilot March 12, 2025 23:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the filtering for explicit ISimdVector implementations by addressing the incorrect namespace used for the Vector intrinsics. Key changes include adjusting the string slicing for processing method names and adding a new branch to handle the Runtime.Intrinsics.Vector namespace.

Comments suppressed due to low confidence (1)

src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:4442

  • Consider using an 'else if' here if the 'Numerics.Vector' branch is mutually exclusive, to prevent potential double processing of the method name.
if (partialMethodName.StartsWith("Runtime.Intrinsics.Vector"))

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Looks good to me and I agree with this capturing the original intent, but we should get signoff from a jit expert.

Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

LGTM. It's a bit unfortunate that we use magic constants here, any C++ compiler should be able to constant fold strlen("const"), but it's out of the scope of this PR

(strncmp(cmethod_name + 70, "256<T>,T>.", 10) == 0) ||
(strncmp(cmethod_name + 70, "512<T>,T>.", 10) == 0)) {
cmethod_name += 80;
if (strncmp(cmethod_name, "System.Runtime.Intrinsics.ISimdVector<System.", 45) == 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we duplicate this code block 3 times, maybe put it into some shared function?

Copy link
Member

@radekdoulik radekdoulik left a comment

Choose a reason for hiding this comment

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

Besides the code duplication it LGTM.

@lewing lewing merged commit ee74dc9 into dotnet:main Mar 13, 2025
173 of 177 checks passed
@lewing lewing deleted the test-sn-vector-interp branch March 13, 2025 14:59
Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

LGTM

(Sorry for the delay, was out last week)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants