logoalt Hacker News

delta_p_delta_xtoday at 5:17 PM1 replyview on HN

Even at a higher level of abstraction, the compiler seems to pull through: https://godbolt.org/z/1nvE34YTe


Replies

btdmastertoday at 7:23 PM

It emits a cmp/jmp still when arithmetic would be fine though which is the difference highlighted in the article and examples in this thread. It's nice that it simplifies down to assembly, but the assembly is somewhat questionable (especially that xor eax eax branch target on the other side).