Regarding the proposed Binray Literals Deprecation

Ali Çehreli acehreli at yahoo.com
Wed Sep 14 12:36:09 UTC 2022


On 9/14/22 01:43, Patrick Schluter wrote:

 > `core.bitop.popcnt(check) == 4` would be simpler and most modern CPU's
 > have an instruction for that.

That will give total number of bits set. Steve's function determines 
whether 5 neighboring bits are set consecutively, anywhere in the 
"register".

And that 4 is a red herring that made me think I found a bug. No, the 
function finds 5 consecutive bits set by 4 shifts. :)

Ali



More information about the Digitalmars-d mailing list