News for hackers. Stuff that matters.
Re:Three Optimization Tips for C++ by thwest on Wednesday May 07, 2014 @11:41PM (#7713847)
bool b = x < y;
Re:Three Optimization Tips for C++ by nkurz on Thursday May 08, 2014 @05:15AM (#7714494)
It's a matter of semantics, but this does not contradict the parent. Under-the-hood in assembly, this is split into two operations: a comparison (cmp), and then a second operation that sets 'b'. This could be done with a branch (jl), a conditional move (cmovl), or a conditional set (setl). You can see the various solutions used by different compilers with mattgodbolt's GCC explorer: http://gcc.godbolt.org/#%7B%22version%22%3A3%2C%22filterAsm%...
Re:Three Optimization Tips for C++ by thwest on Monday May 12, 2014 @04:12PM (#7735137)
Oh interesting. Thanks.