[API Implementation]: Expose general purpose Crc32 APIs#61558
[API Implementation]: Expose general purpose Crc32 APIs#61558dakersnar merged 60 commits intodotnet:mainfrom
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
gfoidl
left a comment
There was a problem hiding this comment.
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 <gue@korporal.at>
Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: Günther Foidl <gue@korporal.at>
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
dakersnar
left a comment
There was a problem hiding this comment.
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