-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
BitOperations arm64 intrinsic for LeadingZeroCount, TrailingZeroCount and Log2 #34486
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 |
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.
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
,TrailingZeroCount
andLog2
methods.Below are the performance improvement details of each API.
I didn't include
PopCount()
as part of this PR because it needs special handling ofCreateScalar
in JIT. Once #34485 is fixed, I will send a separate PR for itPopCount()
.Contributes to #33308 and #33495 .