https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95784
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- I wouldn't be surprised if a version with a branch is faster even with each of the branches mispredicted. cmovs are weird beasts but since they are not dependent on each other their latency at least shouldn't add up here so LLVMs two cmovs shouldnt be worse off than GCCs one cmov. You'd need to compare against a variant without any cmov.