Page MenuHomePhabricator

Establish the <bit> header

Authored by mclow.lists on Aug 15 2018, 3:24 PM.



In C++20, we're going to have a header named <bit> for bit manipulations.
See and for more info.

This doesn't do any of that.
It just creates the header, and pulls some existing internal routines into it.
Later diffs will rename the existing routines, and implement the features from P0553 and P0556.

This is just moving stuff around. NFC intended.

Diff Detail

Event Timeline

mclow.lists created this revision.Aug 15 2018, 3:24 PM
ldionne accepted this revision.Aug 15 2018, 7:16 PM


This revision is now accepted and ready to land.Aug 15 2018, 7:16 PM
lebedev.ri added inline comments.

Pretty sure this is the other way around here.

// Search from MSB to LSB for first set bit.
craig.topper added inline comments.

How does this work on pre-Haswell X86 CPUs? Doesn't MSVC just blindly emit the popcnt instruction when it sees this?

craig.topper added inline comments.Aug 15 2018, 11:40 PM

I don't think __popcnt64 exists in MSVC when targeting 32-bit mode.

mclow.lists closed this revision.Aug 16 2018, 2:36 PM

landed as revision 339943

vitalybuka reopened this revision.Aug 16 2018, 4:58 PM
vitalybuka added a subscriber: vitalybuka.

Reverted r339971 as it breaks sanitizer bots

This revision is now accepted and ready to land.Aug 16 2018, 4:58 PM
tra added a subscriber: tra.Aug 16 2018, 5:21 PM

It appears that libcxx/include/CMakeLists.txt needs to be updated to include bit file into the file set.

mclow.lists closed this revision.Sep 19 2018, 10:09 AM

Landed as r339943