-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Vectorize {Last}IndexOf{Any} and {Last}IndexOfAnyExcept without code duplication #73768
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9d01665
Vectorize LastIndexOf
adamsitnik 14224a3
use structs to get performant code without code duplication
adamsitnik d05cf56
use it in all possible places
adamsitnik 22f71ff
vectorize LastIndexOfAny(value0, value1)
adamsitnik bbc64e0
vectorize LastIndexOfAnyExcept(value0, value1)
adamsitnik f265d28
simplify it to make it easier to add 3 and 4 values overloads
adamsitnik b0f259c
vectorize LastIndexOfAny and LastIndexOfAnyExcept for 3 values
adamsitnik 7dc03c3
rename (I am not convinced it's the best name yet)
adamsitnik 628d429
vectorize Contains
adamsitnik 114ca88
hide the implementation details
adamsitnik 95a1b62
address review from Jan, don't cast Span to ROS. Introduce new helper…
adamsitnik ab8df3d
vectorize IndexOf(value)
adamsitnik bb13957
rename IndexOf used only by strlen to IndexOfNullByte and optimize it…
adamsitnik bbb7e4c
vectorize IndexOfAny<T>(value0, value1) and IndexOfAnyExcept<T>(value…
adamsitnik 9186b8f
vectorize IndexOfAny<T>(value0, value1, value2) and IndexOfAnyExcept<…
adamsitnik 5a39d21
vectorize IndexOfAny<T>(value0, value1, value2, value3) and IndexOfAn…
adamsitnik 9099ef9
vectorize IndexOfAny<T>(value0, value1, value2, value3, value4)
adamsitnik 5661793
remove dead code
adamsitnik 8cb8208
use built-in helpers
adamsitnik ec447c7
Revert "address review from Jan, don't cast Span to ROS. Introduce ne…
adamsitnik 62f16c1
add/remove special handling of some types
adamsitnik 26c188d
fix NativeAOT build
adamsitnik 2af01e3
address code review feedback
adamsitnik b305c54
perform manual loop unrolling in order to avoid perf regression for s…
adamsitnik f954ac5
Merge remote-tracking branch 'upstream/main' into vectorizeLastIndexOf
adamsitnik 846e4fc
restore Vector<T> code path as Vector128 is not accelerated by Mono x…
adamsitnik 8a74f28
remove redundant for loop that was left here by mistake
adamsitnik fab3143
apply manual loop unrolling to LastIndexOfAny methods
adamsitnik 4274f54
vectorize LastIndexOf(4) and LastIndexOfAnyExcept(4)
adamsitnik 59c867f
Apply suggestions from code review
adamsitnik 3049470
Merge remote-tracking branch 'upstream/main' into vectorizeLastIndexOf
adamsitnik afc09bd
fix the build
adamsitnik efdff0e
fix the NativeAOT build
adamsitnik 5831e09
Merge remote-tracking branch 'upstream/main' into vectorizeLastIndexOf
adamsitnik 7f003da
optimize Except methods for small inputs
adamsitnik 0dc257f
address code review feedback:
adamsitnik 0c6b01d
reduce the regression for IndexOfAnyExcept(3) and LastIndexOfAnyExcep…
adamsitnik 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
This is not inlineable when
Tis generic variable due to current generic inlining limitations. It means that this change to just forward Span to ReadOnlySpan will come with some perf regression in some situations.(Just pointing it out. I will leave it up to you whether to take this regression for simplicity. Either way is fine with me.)