This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[WIP] Intrinsicify SpanHelpers.Char #22187
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6bb19c3
Prepare SpanHelpers.Char for intrinsics
benaadams aa80e6c
Intrinsicify SpanHelpers.IndexOf(char)
benaadams 88a25d2
Intrinsicify SpanHelpers.SequenceCompareTo(char)
benaadams 981cc45
Intrinsicify SpanHelpers.IndexOfAny(char,char)
benaadams e02e9ab
Intrinsicify SpanHelpers.IndexOfAny(char,char,char)
benaadams 733a137
Intrinsicify SpanHelpers.IndexOfAny(char,char,char,char)
benaadams 991ced6
Intrinsicify SpanHelpers.IndexOfAny(char,char,char,char,char)
benaadams 6ac7daf
Optimize .IndexOfAny
benaadams eebbd2f
Optimize .IndexOfAny(4,5) for short lengths
benaadams 07a282a
Reduce sign extensions
benaadams c7836d5
Align buffers so String.wcslen can use it
benaadams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does the prolog/epilog code have critical perf impact? I suggest doing vector-level OR to avoid the long latency
MoveMask
.Btw, only Windows has callee-saved SIMD registers, so vector-level OR should improve more on Linux.
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.
#22187 (comment)
The issue is the push and pops are a fixed cost; so it adds 64 bytes of write to stack and 64 bytes of read from stack even if the string is only 8 bytes long, so it has a significant impact for short lengths.
For longer lengths ( > 512 bytes) it gets amortized; but its use to check for invalid chars on short lengths quite often (html chars in a element name, special chars in a file search pattern etc)
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.
Doesn't mean there isn't scope for a follow up 😉