-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[WIP] Helpers to support Intrinsics in SpanHelpers.Char #22875
Conversation
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
ee2897e
to
b4351bc
Compare
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
private static unsafe nint UnalignedCountVector128(ref char searchSpace) | ||
{ | ||
const int elementsPerByte = sizeof(ushort) / sizeof(byte); |
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.
Nit: search/repleace elementsPerByte => ElementsPerByte
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static ref char Add(ref char source, nint elementOffset) | ||
=> ref Unsafe.Add(ref source, (IntPtr)elementOffset); |
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 helper is just to avoid a cast at the call site?
Could we just include the helpers in the first PR that uses them? It always makes me nervous when we first check in helpers, with a promise that they'll all be used later, as a) it not-infrequently ends up happening that the thing that was going to use them either doesn't materialize or doesn't use all of them, and b) it not-infrequently happens that bugs in the helpers are discovered only when actually used in those subsequent things. |
5c55d3e
to
8afe70a
Compare
Not fussed about this PR being merged; however its 6 PRs that use it so its serving as a common base for me to rebase on. |
Will close as have feedback for other PRs |
Common helper methods to support the PRs (will base them on this PR)