4 ms·
Yes. Rust 1.34.0 (and presumably earlier as well) generates an unrolled SIMD-loop for the iterator option: https://rust.godbolt.org/z/c6uZCv https://rust.godbol
by timerol 7y ago
Yes. Rust 1.34.0 (and presumably earlier as well) generates an unrolled SIMD-loop for the iterator option: https://rust.godbolt.org/z/c6uZCv https://rust.godbolt.org/z/c6uZCv
- ohazi 7y agoUnrelated: Haven't used compiler explorer in a while and just got the "new privacy policy" overlay. What a delightfully clear, complete, and readable privacy policy.
- gameswithgo 7y agoIt will with integers, but not floating point. All compilers will use simd registers and instructions for floating point but its only using the 1 lane there. its not really vectorized. rust has no way to pass ffast-math flag (unless that changed recently) which will enable this for C/C++
- steveklabnik 7y agoThe rust approach to this kind of this is not to use global flags to control this kind of behavior, but to use wrapping types to get the behavior on the spots where you want it: https://crates.io/crates/fast-floats https://crates.io/crates/fast-floats