BitOperations arm64 intrinsic for LeadingZeroCount, TrailingZeroCount and Log2#34486
Conversation
|
I couldn't figure out the best area label to add to this PR. Please help me learn by adding exactly one area label. |
|
Please take a look @dotnet/jit-contrib , @tannergooding |
|
The For these arm64-specific libraries changes, I think you need to trigger the runtime AzDO pipeline manually, as the default PR testing does not include libraries arm64 testing. |
|
@BruceForstall - Triggered one just now at https://dev.azure.com/dnceng/public/_build/results?buildId=587055&view=results |
b628d47 to
a2effc7
Compare
|
I was seeing I have rebased my changes and triggered another pipeline run. |
|
Jobs are failing with following errors. Do i need to add a package reference or something inside @tannergooding , @echesakovMSFT |
|
What about |
Yes. It converts |
echesakov
left a comment
There was a problem hiding this comment.
Looks good with comments regarding redundant casts to int
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
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
@kunalspathak My understanding that you need to update Intrinsics.Shims.cs simiralrly as it's been done for |
I believe that is the case, but CC. @GrabYourPitchforks since I think he "owns" System.Utf8String.Experimental. |
That seemed to have solved the problem (atleast on my local machine). Thanks! |
@BruceForstall - This measurements were taken on ARM64 machine manually for MicroBenchmarks. Changes are here: dotnet/performance#1264 |
given this:
It seems like |
Ah yes. |
Use arm64 intrinsics for BitOperations's
LeadingZeroCount,TrailingZeroCountandLog2methods.Below are the performance improvement details of each API.
I didn't include
PopCount()as part of this PR because it needs special handling ofCreateScalarin JIT. Once #34485 is fixed, I will send a separate PR for itPopCount().Contributes to #33308 and #33495 .