https://bugs.llvm.org/show_bug.cgi?id=46075
Bug ID: 46075
Summary: Failure to produce vxorps to avoid latency on AVX
operations
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: gabrav...@gmail.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com
double f(double x, int i)
{
return x * i;
}
With `-O3 -mavx2`, Clang produces this :
f(double, int): # @f(double, int)
vcvtsi2sd xmm1, xmm1, edi
vmulsd xmm0, xmm1, xmm0
ret
GCC produces this :
f(double, int):
vmovsd xmm1, xmm0, xmm0
vxorps xmm0, xmm0, xmm0
vcvtsi2sd xmm0, xmm0, edi
vmulsd xmm0, xmm0, xmm1
ret
According to GCC developers on here :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57954, using `vxorps` avoids a
latency which is caused by non-zeroing an AVX register before using it. This
seems to affect literally all X86 processors (as GCC uses `vxorps` for them
all) and Clang uses `vxorps` for none.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs