Skip to content
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

Optimize BitOperations.PopCount() with arm64 intrinsics #35636

Merged
merged 6 commits into from
May 8, 2020

Conversation

kunalspathak
Copy link
Member

@kunalspathak kunalspathak commented Apr 29, 2020

Optimize BitOperations.PopCount() using arm64 hardware intrinsic.

G_M3674_IG02:
        0F000410          movi    v16.2s, #0x00
        4E041C10          ins     v16.s[0], w0
        FD000FB0          str     d16, [fp,#24]
        FD400FB0          ldr     d16, [fp,#24]
        0E205A10          cnt     v16.8b, v16.8b
        0E31BA10          addv    b16, v16.8b
        0E013E00          umov    w0, v16.b[0]

Without optimization: 5.0038669 secs.
With optimization: 1.8343483 secs.

Contributes to #33308
Fixes: #33495

@ghost
Copy link

ghost commented May 6, 2020

Tagging subscribers to this area: @tannergooding
Notify danmosemsft if you want to be subscribed.

@kunalspathak kunalspathak force-pushed the popcount branch 2 times, most recently from add4a36 to df22000 Compare May 7, 2020 00:35
@kunalspathak kunalspathak marked this pull request as ready for review May 7, 2020 00:38
Copy link
Contributor

@echesakov echesakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tannergooding Do you mind taking a look?

Co-authored-by: Tanner Gooding <[email protected]>
@kunalspathak kunalspathak merged commit 83712df into dotnet:master May 8, 2020
@kunalspathak kunalspathak deleted the popcount branch May 14, 2020 20:15
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize System.Numerics.BitOperations using arm64 intrinsics
7 participants