1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX1
4 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx2 | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX2
6 define <8 x i32> @a(<8 x i32> %a) nounwind {
9 ; SSE-NEXT: pslld $16, %xmm0
10 ; SSE-NEXT: psrad $16, %xmm0
11 ; SSE-NEXT: pslld $16, %xmm1
12 ; SSE-NEXT: psrad $16, %xmm1
17 ; AVX1-NEXT: vpslld $16, %xmm0, %xmm1
18 ; AVX1-NEXT: vpsrad $16, %xmm1, %xmm1
19 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
20 ; AVX1-NEXT: vpslld $16, %xmm0, %xmm0
21 ; AVX1-NEXT: vpsrad $16, %xmm0, %xmm0
22 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
27 ; AVX2-NEXT: vpslld $16, %ymm0, %ymm0
28 ; AVX2-NEXT: vpsrad $16, %ymm0, %ymm0
30 %b = trunc <8 x i32> %a to <8 x i16>
31 %c = sext <8 x i16> %b to <8 x i32>
35 define <3 x i32> @b(<3 x i32> %a) nounwind {
38 ; SSE-NEXT: pslld $16, %xmm0
39 ; SSE-NEXT: psrad $16, %xmm0
44 ; AVX-NEXT: vpslld $16, %xmm0, %xmm0
45 ; AVX-NEXT: vpsrad $16, %xmm0, %xmm0
47 %b = trunc <3 x i32> %a to <3 x i16>
48 %c = sext <3 x i16> %b to <3 x i32>
52 define <1 x i32> @c(<1 x i32> %a) nounwind {
55 ; ALL-NEXT: movswl %di, %eax
57 %b = trunc <1 x i32> %a to <1 x i16>
58 %c = sext <1 x i16> %b to <1 x i32>
62 define <8 x i32> @d(<8 x i32> %a) nounwind {
65 ; SSE-NEXT: movaps {{.*#+}} xmm2 = [65535,0,65535,0,65535,0,65535,0]
66 ; SSE-NEXT: andps %xmm2, %xmm0
67 ; SSE-NEXT: andps %xmm2, %xmm1
72 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
77 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
78 ; AVX2-NEXT: vpblendw {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7],ymm0[8],ymm1[9],ymm0[10],ymm1[11],ymm0[12],ymm1[13],ymm0[14],ymm1[15]
80 %b = trunc <8 x i32> %a to <8 x i16>
81 %c = zext <8 x i16> %b to <8 x i32>
85 define <3 x i32> @e(<3 x i32> %a) nounwind {
88 ; SSE-NEXT: andps {{.*}}(%rip), %xmm0
93 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
94 ; AVX-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6,7]
96 %b = trunc <3 x i32> %a to <3 x i16>
97 %c = zext <3 x i16> %b to <3 x i32>
101 define <1 x i32> @f(<1 x i32> %a) nounwind {
104 ; ALL-NEXT: movzwl %di, %eax
106 %b = trunc <1 x i32> %a to <1 x i16>
107 %c = zext <1 x i16> %b to <1 x i32>