https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95784
--- Comment #2 from Gabriel Ravier <gabravier at gmail dot com> --- cmov is so slow that : - 1 movzx - 1 setcc - 1 sal - 1 sar - 1 and - 1 test is worth avoiding it ? From what I can see, the dependencies for the LLVM version for the first cmov are : - The left operand, which the preceding cmp already depends on - EFLAGS from the cmp - The 0 from the xor And the dependencies for the second cmov are : - The left operand from the preceding mov - The right operand, which the preceding cmov already depends on - EFLAGS, which the preceding cmov already depends on And I can't see how the dependencies for the second cmov can slow it down so much that doing all the extra computing is worth it.