4 ms·
Yeah true. But doesn’t Rust provide an equivalent to C’s intrinsic functions like popcount?
by mkchoi212 6y ago
Yeah true. But doesn’t Rust provide an equivalent to C’s intrinsic functions like popcount?
- MaulingMonkey 6y agoYes: https://doc.rust-lang.org/core/intrinsics/fn.ctpop.html https://doc.rust-lang.org/core/intrinsics/fn.ctpop.html https://doc.rust-lang.org/std/?search=count_ones https://doc.rust-lang.org/std/?search=count_ones There are still use cases for raw assembly untouched by the optimizer - e.g. constant time cryptography functions designed to thwart timing attacks might desire control over the exact instruction stream. Although, most of that can be tackled with out-of-line assembly - as one must do with x64 MSVC for example.