Lol -- "Like cttz, but extra-unsafe (...)" https://doc.rust-lang.org/std/intrinsics/fn.cttz_nonzero.html …
-
-
Not sure what people would think of adding methods to numbers that don't directly map to LLVM intrinsics. I'm guessing folks might not be into it? Although from a user perspective, it kind of makes sense that if you can count zeros, you can also count ones. API symmetry!
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
with ` -C target-cpu=native` it'll use the tzcnt instruction (on whatever machine godbolt runs at least)
-
Woahhhh! Had no idea that was a thing; makes a lot of sense tho!pic.twitter.com/bhhFtXXqAv
- 6 more replies
New conversation -
-
-
I wouldn't worry too much about single-digit instruction counts if this is for use in a relatively high-level library where you're only doing a few of these per syscall, which is 4-6 orders of magnitude slower. http://ithare.com/infographics-operation-costs-in-cpu-clock-cycles/ …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.