-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[API Implementation]: Expose general purpose Crc32 APIs #61558
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsCloses #2036 Proposed APInamespace System.Numerics
{
public static class BitOperations
{
public static uint Crc32(uint crc, byte data);
public static uint Crc32(uint crc, ushort data);
public static uint Crc32(uint crc, uint data);
public static uint Crc32(uint crc, ulong data);
}
} Current state of implementation
/cc @tannergooding
|
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
There is no implementation which returns `uint32_t`. See https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#techs=MMX,SSE,SSE2,SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2,FMA,AVX_VNNI,AVX_512,KNC,AMX,SVML,Other&text=crc
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
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.
Some note -- not for implementation of algorithm though.
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime.Extensions/tests/System/Numerics/BitOperationsTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Günther Foidl <[email protected]>
Co-authored-by: Günther Foidl <[email protected]>
Co-authored-by: Günther Foidl <[email protected]>
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime.Extensions/tests/System/Numerics/BitOperationsTests.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
Show resolved
Hide resolved
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.
Couple clarifying questions, but overall LGTM
Thank you for the contribution @deeprobin ! |
I don't think the test is the issue, I think the issue is the Crc32C implementation in clr. These were implemented previously (I think it was Tanner). Tanner can you locate where and what the issue is? /cc @tannergooding |
Proposal implementation of #2036 (closes #2036)
Proposed API
Current state of implementation
Usage of Hardware Intrinsics
Software Fallback
/cc @tannergooding