microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
9.89k stars 1.45k forks source link

Clean up ARM64 `popcount` #4695

Closed AlexGuteniev closed 1 week ago

AlexGuteniev commented 1 month ago

It is both way simpler (don't need to use another intrinsics set) and better for codegen (as the previous version is only for 64-bits and does not take advantage of smaller parameter size).

I have not tested on actual ARM64 and ARM64EC.

Resolves #4683 Resolves #2129 Resolves llvm/llvm-project#50830

AlexGuteniev commented 1 month ago

Honestly, what I'm doing for ARM64EC here is uneducated guess. This needs to be checked by an ARM64EC expert.

StephanTLavavej commented 2 weeks ago

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

StephanTLavavej commented 1 week ago

Thanks for greatly simplifying this code! :heart_eyes_cat: :sparkles: :tada: