Skip to content
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

Merged
merged 1 commit into from
Aug 4, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bu
{
return GetIndexOfFirstNonAsciiByte_Intrinsified(pBuffer, bufferLength);
}
else if (Vector128.IsHardwareAccelerated)
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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.

{
return GetIndexOfFirstNonAsciiByte_Vector(pBuffer, bufferLength);
}
else
{
return GetIndexOfFirstNonAsciiByte_Default(pBuffer, bufferLength);
Expand Down