-
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
Vector128.WithElement codegen regression in .NET 9.0 #108197
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
I guess in general, WithElement should be avoided to be used with a non-constant index as it's not really a SIMD way |
The improvements given from not inlining and trying to opportunistically find a constant end up more profitable in typical use-cases, so I don't think we want to go back to the .NET 8 behavior there. The proper fix here is to ensure the non-constant case is handled, much as it is for Developers have a workaround where they can do something like the following, which would also be faster if they know the index is definitively in bounds but is also definitively non-constant: public static Vector128<T> WithElementUnsafe<T>(Vector128<T> vector, int index, T value)
{
ref T address = ref Unsafe.As<Vector128<T>, T>(ref vector);
Unsafe.Add(ref address, index) = value;
return vector;
} |
Because there is workaround, setting this to .NET 10.
|
Hi @tannergooding, just checking in if this issue is on your list for now, if not, we have a new folk onboarding and I think this will be a good issue for him to get started with the contribution to dotnet. Regrading to the issue itself, the handling I'm looking at in |
Happy to let them pick it up, feel free to reach out with any questions.
We have various handling in place for I would expect that most of this handling is relegated to |
@Ruihan-Yin, please reassign this issue to the new member when ready. |
.NET 8.0:
.NET 9.0:
The text was updated successfully, but these errors were encountered: