https://bugs.llvm.org/show_bug.cgi?id=47642
Bug ID: 47642
Summary: Suboptimal codegen for vector init constructor
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
typedef int __v4si __attribute__ ((__vector_size__ (16)));
__v4si
foo (__v4si x, int f)
{
__v4si y = { f, f + 1 , f + 2, f + 3};
return y;
}
Clang -O3:
foo(int __vector(4), int): # @foo(int __vector(4),
int)
lea eax, [rdi + 1]
lea ecx, [rdi + 2]
lea edx, [rdi + 3]
movd xmm0, edx
movd xmm1, ecx
punpckldq xmm1, xmm0 # xmm1 =
xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd xmm0, edi
movd xmm2, eax
punpckldq xmm0, xmm2 # xmm0 =
xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq xmm0, xmm1 # xmm0 = xmm0[0],xmm1[0]
ret
GCC -O3:
foo(int __vector(4), int):
movd xmm1, edi
pshufd xmm0, xmm1, 0
paddd xmm0, XMMWORD PTR .LC0[rip]
ret
.LC0:
.long 0
.long 1
.long 2
.long 3
https://godbolt.org/z/TP4c4s
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs