https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82680
Bug ID: 82680 Summary: Use cmpXXss and cmpXXsd for setcc boolean compare Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ubizjak at gmail dot com Target Milestone: --- Both, ICC and clang use cmpXXss and cmpXXsd instructions for setcc boolean compare: int g(double x, double y) { return x == y; } ICC: cmpeqsd %xmm1, %xmm0 movd %xmm0, %eax negl %eax ret clang: cmpeqsd %xmm1, %xmm0 movq %xmm0, %rax andl $1, %eax retq gcc w/ -ffast-math: xorl %eax, %eax comisd %xmm1, %xmm0 sete %al ret Versions with direct moves avoid partial register stalls.