Re:How Rust 1.26 more than tripled the speed of my code
by nonsince on Monday May 14, 2018 @10:44AM
(#17065954)
If you use `-C target-cpu=native` (Rust's equivalent of `-march=native`) you get code that uses `mulxq` in order to avoid `pushf`/`popf`. https://gist.github.com/Vurich/5cb83c773e90fc7a463ccb58e1dad...
[ Parent
| on HN ]
Re:How Rust 1.26 more than tripled the speed of my code
by pbsd on Monday May 14, 2018 @10:51AM
(#17066015)
It's still doing it, but now it uses `lahf` + `sahf` instead to (re)store the flags. These are better than pushf + popf for sure, but they cannot be used in general code because some early x86_64 chips forgot to implement them.