https://bugs.llvm.org/show_bug.cgi?id=34686
Bug ID: 34686
Summary: [X86][SSE] extra pshufhw generated in simple shuffle
code
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: c...@cooper.edu
CC: llvm-bugs@lists.llvm.org
Trunk turns these two shuffles into three (The commented out line is equivalent
and generates the same 3 shuffles):
#include <emmintrin.h>
__m128i m(__m128i i) {
const __m128i a = _mm_shufflelo_epi16(i, 0x14);
return _mm_shuffle_epi32(a, 0x44);
// return _mm_unpacklo_epi64(a, a);
}
clang -S -O3 test.c -o -
m:
pshufd $196, %xmm0, %xmm0 # xmm0 = xmm0[0,1,0,3]
pshuflw $20, %xmm0, %xmm0 # xmm0 = xmm0[0,1,1,0,4,5,6,7]
pshufhw $20, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2,3,4,5,5,4]
retq
This can be observed at all optimization levels above 0.
I'd expect the same output that gcc generates:
gcc -S -O3 test.c -o -
m:
pshuflw $20, %xmm0, %xmm0
pshufd $68, %xmm0, %xmm0
ret
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs