2 ms·
Though note that these methods are really just thin abstractions over intrinsics, since Rust doesn't want to stabilize intrinsics directly for reasons of compil
by kibwen 10y ago
Though note that these methods are really just thin abstractions over intrinsics, since Rust doesn't want to stabilize intrinsics directly for reasons of compiler backend portability. For example, the `count_ones` method currently resolves directly to LLVM's `ctpop` intrinsic, defined at https://github.com/rust-lang/rust/blob/master/src/libcore/intrinsics.rs#L548 https://github.com/rust-lang/rust/blob/master/src/libcore/in... .
- nirvdrum 10y agoFYI, when you're on a GitHub page you can press the 'y' key to have the URL changed to one that includes a particular blob reference. It helps prevent bit rot. Curently, your linked line doesn't point to the `ctpop` intrinsic. I think you wanted https://github.com/rust-lang/rust/blob/34fd68668152530dcd1d00865fa8514461b895d7/src/libcore/intrinsics.rs#L558 https://github.com/rust-lang/rust/blob/34fd68668152530dcd1d0...