-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Intrinsicify SpanHelpers.IndexOf(char) #22505
Intrinsicify SpanHelpers.IndexOf(char) #22505
Conversation
Some kind of COM issue? Windows_NT x64 Checked Build and Test (Jit - TieredCompilation=0 EnableIncompleteISAClass=1 FeatureSIMD=0)
|
e6b92b3
to
dc6a029
Compare
Rebased for merge conflict |
dc6a029
to
1d5b30d
Compare
@tannergooding @GrabYourPitchforks Could you please review this? |
af21a24
to
b5db6e1
Compare
b5db6e1
to
09aecea
Compare
Broke something 😢 |
Still an issue on the alignment crossing pages; not seeing it though. Still looking. @GrabYourPitchforks you'll be happy to know your test |
Still looking, but I believe the error is in this line in if ((((nint)Unsafe.AsPointer(ref searchSpace) + (nint)offset) & (nint)(Vector256<ushort>.Count - 1)) != 0) This essentially treats I believe this line should instead read: if (((nint)Unsafe.AsPointer(ref Unsafe.Add(ref searchSpace, (IntPtr)offset)) & (nint)(Vector256<byte>.Count - 1)) != 0) That performs |
Ah-ah! Could also cast the return of AsPointer to (char*) prior to the add? |
Btw, nice test :) |
Thanks - glad the test proved fruitful! :) |
Anyone fancy merging? Then I can update the other PRs that depend on the methods in this PR |
Thanks for the work @benaadams, and sorry for the delay in getting this merged. |
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Helpers to support Intrinsics in SpanHelpers.Char * Intrinsicify SpanHelpers.IndexOf(char) * Feedback * fix * Fix assert * Improve comment warning * fix * fix * Fix * Fix Commit migrated from dotnet/coreclr@5676801
Based on #22875 which is first commit
and Vectorize wcslen
From #22187
Will follow up after with the other methods as they depend on the helper methods at the bottom of this one.
/cc @CarolEidt @fiigii @tannergooding @jkotas
Resolves #22762