News for hackers. Stuff that matters.
Re:GCC 13 and the State of Gccrs by Thiez on Tuesday April 25, 2023 @12:57PM (#35703274)
A binary number is a power of two iff only a single bit is set, so pretty trivial to implement.
Re:GCC 13 and the State of Gccrs by tialaramex on Tuesday April 25, 2023 @01:13PM (#35703555)
Sure, it's literally self.count_ones() == 1 -- so we just implement count_ones() and ah, well, we could do all this by hand but turns out (fill in name of CPU) has a CPU instruction specifically for this. Rust calls the intrinsic we're about to go write intrinsics::ctpop()

Now we're writing per-ISA intrinsics, what was our goal again? Maybe I was too oblique, this stuff is all rabbit holes is what I was getting at. We're lucky these people even re-surface periodically with work and a blog post.

Re:GCC 13 and the State of Gccrs by barsonme on Friday April 28, 2023 @11:39PM (#35749803)
* * *