This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Provide C++20-style bit functions
ClosedPublic

Authored by kazu on Feb 16 2023, 12:13 AM.

Details

Summary

Tihs patches adds APInt::count{l,r}_{zero,one} and APInt::popcount to
be consistent with those functions in ADT/bit.h.

Once this patch lands, I'll take care of the migration.

For now, I am intentionally leaving isPowerOf2 as is.

Diff Detail

Event Timeline

kazu created this revision.Feb 16 2023, 12:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 12:13 AM
kazu requested review of this revision.Feb 16 2023, 12:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 12:13 AM
kazu edited the summary of this revision. (Show Details)Feb 16 2023, 12:14 AM
MaskRay accepted this revision.Feb 16 2023, 10:42 AM
This revision is now accepted and ready to land.Feb 16 2023, 10:42 AM
dblaikie accepted this revision.Feb 16 2023, 11:18 AM

Sounds OK to me

This revision was automatically updated to reflect the committed changes.