-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Try Vector128 before Vector #89797
Try Vector128 before Vector #89797
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-encoding Issue Detailsnull
|
@@ -109,6 +109,10 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bu | |||
{ | |||
return GetIndexOfFirstNonAsciiByte_Intrinsified(pBuffer, bufferLength); | |||
} | |||
else if (Vector128.IsHardwareAccelerated) |
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.
The above Sse2
or AdvSimd
paths are the code paths that use Vector128
and are much more efficient than the associated Vector128
path.
I believe if it reaches this point, where we cannot use Vector512
, Vector256
, or Sse2/AdvSimd
, then the Vector
path itself will likely be as efficient and no need to call back into _Vector
.
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.
We would prefer the Vector128 path for wasm
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.
Ok, understood. Thanks for the context.
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.
LGTM. This just adds to the reasons why having a single shared implementation using the xplat APIs is goodness.
After #88532 The code prefers Vector512/Vector256/AdvSimd but then falls back to Vector rather than Vector128 which is implemented in the _Vector method
(I didn't actually check the Vector128 path closely)