3 ms·
overflowing_add, like I was using above, is explicitly wrapping. I've found it very difficult to provoke rustc into emitting an ADC: the only case where it doe
by palmtree3000 6y ago
overflowing_add, like I was using above, is explicitly wrapping.
I've found it very difficult to provoke rustc into emitting an ADC: the only case where it does so AFAICT is when adding u128s, which are implemented using u64s. Not sure why, except that the shortest function I could think of to emulate ADC is kind of baroque, and it's possible the compiler can't figure it out.
I've mostly been using cpuprofiler[1] and Vtune to simultaneously profile my code and show the assembly. In theory they both provide timing information per-instruction, but I don't really trust it. For the 6 adc instructions above, it shows the number of clock ticks as ranging from 22 million to 3 billion, which doesn't make sense to me. But at least it shows me the assembly!
[1] https://docs.rs/cpuprofiler/0.0.4/cpuprofiler/index.html https://docs.rs/cpuprofiler/0.0.4/cpuprofiler/index.html
- secondcoming 6y agoThis will change your life! https://godbolt.org/z/fntvYa https://godbolt.org/z/fntvYa