Skip to content

Try Vector128 before Vector - #89797

Merged
stephentoub merged 1 commit into
dotnet:mainfrom
lewing:vector128
Aug 4, 2023
Merged

Try Vector128 before Vector#89797
stephentoub merged 1 commit into
dotnet:mainfrom
lewing:vector128

Conversation

@lewing

@lewinglewing commented Aug 1, 2023

Copy link
Copy Markdown
Member

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)

@ghost

ghost commented Aug 1, 2023

Copy link
Copy Markdown

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

Issue Details

null

Author:lewing
Assignees:lewing
Labels:

area-System.Text.Encoding

Milestone:-

@lewing
lewing marked this pull request as ready for review August 1, 2023 17:24
@lewing
lewing requested review from anthonycanino and kgAugust 1, 2023 17:27
kg
kg approved these changes Aug 1, 2023
{
return GetIndexOfFirstNonAsciiByte_Intrinsified(pBuffer, bufferLength);
}
else if (Vector128.IsHardwareAccelerated)

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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.

@tannergoodingtannergooding left a comment

Copy link
Copy Markdown
Member

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.

@stephentoub
stephentoub merged commit 3be370e into dotnet:mainAug 4, 2023
@lewing
lewing deleted the vector128 branch August 5, 2023 01:30
@ghostghost locked as resolved and limited conversation to collaborators Sep 4, 2023
Sign up for freeto 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.

6 participants

@lewing@kg@stephentoub@tannergooding@anthonycanino@eiriktsarpalis