[Bug target/82680] New: Use cmpXXss and cmpXXsd for setcc boolean compare
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Oct 23 15:50:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list