• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-linux -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,CHECK-LIN
3; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,CHECK-WIN
4
5define <8 x i32> @a(<8 x i16> %a) nounwind {
6; CHECK-LIN-LABEL: a:
7; CHECK-LIN:       # %bb.0:
8; CHECK-LIN-NEXT:    punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
9; CHECK-LIN-NEXT:    psrad $16, %xmm2
10; CHECK-LIN-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
11; CHECK-LIN-NEXT:    psrad $16, %xmm1
12; CHECK-LIN-NEXT:    movdqa %xmm2, %xmm0
13; CHECK-LIN-NEXT:    retq
14;
15; CHECK-WIN-LABEL: a:
16; CHECK-WIN:       # %bb.0:
17; CHECK-WIN-NEXT:    movdqa (%rcx), %xmm1
18; CHECK-WIN-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
19; CHECK-WIN-NEXT:    psrad $16, %xmm0
20; CHECK-WIN-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
21; CHECK-WIN-NEXT:    psrad $16, %xmm1
22; CHECK-WIN-NEXT:    retq
23  %c = sext <8 x i16> %a to <8 x i32>
24  ret <8 x i32> %c
25}
26
27define <3 x i32> @b(<3 x i16> %a) nounwind {
28; CHECK-LIN-LABEL: b:
29; CHECK-LIN:       # %bb.0:
30; CHECK-LIN-NEXT:    pxor %xmm0, %xmm0
31; CHECK-LIN-NEXT:    pinsrw $1, %edi, %xmm0
32; CHECK-LIN-NEXT:    pinsrw $3, %esi, %xmm0
33; CHECK-LIN-NEXT:    pinsrw $5, %edx, %xmm0
34; CHECK-LIN-NEXT:    psrad $16, %xmm0
35; CHECK-LIN-NEXT:    retq
36;
37; CHECK-WIN-LABEL: b:
38; CHECK-WIN:       # %bb.0:
39; CHECK-WIN-NEXT:    # kill: def $r8w killed $r8w def $r8d
40; CHECK-WIN-NEXT:    # kill: def $dx killed $dx def $edx
41; CHECK-WIN-NEXT:    # kill: def $cx killed $cx def $ecx
42; CHECK-WIN-NEXT:    pxor %xmm0, %xmm0
43; CHECK-WIN-NEXT:    pinsrw $1, %ecx, %xmm0
44; CHECK-WIN-NEXT:    pinsrw $3, %edx, %xmm0
45; CHECK-WIN-NEXT:    pinsrw $5, %r8d, %xmm0
46; CHECK-WIN-NEXT:    psrad $16, %xmm0
47; CHECK-WIN-NEXT:    retq
48  %c = sext <3 x i16> %a to <3 x i32>
49  ret <3 x i32> %c
50}
51
52define <1 x i32> @c(<1 x i16> %a) nounwind {
53; CHECK-LIN-LABEL: c:
54; CHECK-LIN:       # %bb.0:
55; CHECK-LIN-NEXT:    movswl %di, %eax
56; CHECK-LIN-NEXT:    retq
57;
58; CHECK-WIN-LABEL: c:
59; CHECK-WIN:       # %bb.0:
60; CHECK-WIN-NEXT:    movswl %cx, %eax
61; CHECK-WIN-NEXT:    retq
62  %c = sext <1 x i16> %a to <1 x i32>
63  ret <1 x i32> %c
64}
65
66define <8 x i32> @d(<8 x i16> %a) nounwind {
67; CHECK-LIN-LABEL: d:
68; CHECK-LIN:       # %bb.0:
69; CHECK-LIN-NEXT:    movdqa %xmm0, %xmm1
70; CHECK-LIN-NEXT:    pxor %xmm2, %xmm2
71; CHECK-LIN-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
72; CHECK-LIN-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
73; CHECK-LIN-NEXT:    retq
74;
75; CHECK-WIN-LABEL: d:
76; CHECK-WIN:       # %bb.0:
77; CHECK-WIN-NEXT:    movdqa (%rcx), %xmm1
78; CHECK-WIN-NEXT:    pxor %xmm2, %xmm2
79; CHECK-WIN-NEXT:    movdqa %xmm1, %xmm0
80; CHECK-WIN-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
81; CHECK-WIN-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
82; CHECK-WIN-NEXT:    retq
83  %c = zext <8 x i16> %a to <8 x i32>
84  ret <8 x i32> %c
85}
86
87define <3 x i32> @e(<3 x i16> %a) nounwind {
88; CHECK-LIN-LABEL: e:
89; CHECK-LIN:       # %bb.0:
90; CHECK-LIN-NEXT:    movzwl %di, %eax
91; CHECK-LIN-NEXT:    movd %eax, %xmm0
92; CHECK-LIN-NEXT:    pinsrw $2, %esi, %xmm0
93; CHECK-LIN-NEXT:    pinsrw $4, %edx, %xmm0
94; CHECK-LIN-NEXT:    retq
95;
96; CHECK-WIN-LABEL: e:
97; CHECK-WIN:       # %bb.0:
98; CHECK-WIN-NEXT:    # kill: def $r8w killed $r8w def $r8d
99; CHECK-WIN-NEXT:    # kill: def $dx killed $dx def $edx
100; CHECK-WIN-NEXT:    movzwl %cx, %eax
101; CHECK-WIN-NEXT:    movd %eax, %xmm0
102; CHECK-WIN-NEXT:    pinsrw $2, %edx, %xmm0
103; CHECK-WIN-NEXT:    pinsrw $4, %r8d, %xmm0
104; CHECK-WIN-NEXT:    retq
105  %c = zext <3 x i16> %a to <3 x i32>
106  ret <3 x i32> %c
107}
108
109define <1 x i32> @f(<1 x i16> %a) nounwind {
110; CHECK-LIN-LABEL: f:
111; CHECK-LIN:       # %bb.0:
112; CHECK-LIN-NEXT:    movzwl %di, %eax
113; CHECK-LIN-NEXT:    retq
114;
115; CHECK-WIN-LABEL: f:
116; CHECK-WIN:       # %bb.0:
117; CHECK-WIN-NEXT:    movzwl %cx, %eax
118; CHECK-WIN-NEXT:    retq
119  %c = zext <1 x i16> %a to <1 x i32>
120  ret <1 x i32> %c
121}
122
123define <8 x i16> @g(<8 x i32> %a) nounwind {
124; CHECK-LIN-LABEL: g:
125; CHECK-LIN:       # %bb.0:
126; CHECK-LIN-NEXT:    movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
127; CHECK-LIN-NEXT:    pshufb %xmm2, %xmm1
128; CHECK-LIN-NEXT:    pshufb %xmm2, %xmm0
129; CHECK-LIN-NEXT:    punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
130; CHECK-LIN-NEXT:    retq
131;
132; CHECK-WIN-LABEL: g:
133; CHECK-WIN:       # %bb.0:
134; CHECK-WIN-NEXT:    movdqa (%rcx), %xmm0
135; CHECK-WIN-NEXT:    movdqa (%rdx), %xmm1
136; CHECK-WIN-NEXT:    movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
137; CHECK-WIN-NEXT:    pshufb %xmm2, %xmm1
138; CHECK-WIN-NEXT:    pshufb %xmm2, %xmm0
139; CHECK-WIN-NEXT:    punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
140; CHECK-WIN-NEXT:    retq
141  %c = trunc <8 x i32> %a to <8 x i16>
142  ret <8 x i16> %c
143}
144
145define <3 x i16> @h(<3 x i32> %a) nounwind {
146; CHECK-LIN-LABEL: h:
147; CHECK-LIN:       # %bb.0:
148; CHECK-LIN-NEXT:    movd %xmm0, %eax
149; CHECK-LIN-NEXT:    pextrw $2, %xmm0, %edx
150; CHECK-LIN-NEXT:    pextrw $4, %xmm0, %ecx
151; CHECK-LIN-NEXT:    # kill: def $ax killed $ax killed $eax
152; CHECK-LIN-NEXT:    # kill: def $dx killed $dx killed $edx
153; CHECK-LIN-NEXT:    # kill: def $cx killed $cx killed $ecx
154; CHECK-LIN-NEXT:    retq
155;
156; CHECK-WIN-LABEL: h:
157; CHECK-WIN:       # %bb.0:
158; CHECK-WIN-NEXT:    movdqa (%rcx), %xmm0
159; CHECK-WIN-NEXT:    movd %xmm0, %eax
160; CHECK-WIN-NEXT:    pextrw $2, %xmm0, %edx
161; CHECK-WIN-NEXT:    pextrw $4, %xmm0, %ecx
162; CHECK-WIN-NEXT:    # kill: def $ax killed $ax killed $eax
163; CHECK-WIN-NEXT:    # kill: def $dx killed $dx killed $edx
164; CHECK-WIN-NEXT:    # kill: def $cx killed $cx killed $ecx
165; CHECK-WIN-NEXT:    retq
166  %c = trunc <3 x i32> %a to <3 x i16>
167  ret <3 x i16> %c
168}
169
170define <1 x i16> @i(<1 x i32> %a) nounwind {
171; CHECK-LIN-LABEL: i:
172; CHECK-LIN:       # %bb.0:
173; CHECK-LIN-NEXT:    movl %edi, %eax
174; CHECK-LIN-NEXT:    # kill: def $ax killed $ax killed $eax
175; CHECK-LIN-NEXT:    retq
176;
177; CHECK-WIN-LABEL: i:
178; CHECK-WIN:       # %bb.0:
179; CHECK-WIN-NEXT:    movl %ecx, %eax
180; CHECK-WIN-NEXT:    # kill: def $ax killed $ax killed $eax
181; CHECK-WIN-NEXT:    retq
182  %c = trunc <1 x i32> %a to <1 x i16>
183  ret <1 x i16> %c
184}
185
186; PR6438
187define void @__OpenCL_math_kernel4_kernel() nounwind {
188; CHECK-LABEL: __OpenCL_math_kernel4_kernel:
189; CHECK:       # %bb.0:
190; CHECK-NEXT:    retq
191  %tmp12.i = and <4 x i32> zeroinitializer, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i32>> [#uses=1]
192  %cmp13.i = icmp eq <4 x i32> %tmp12.i, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i1>> [#uses=2]
193  %cmp.ext14.i = sext <4 x i1> %cmp13.i to <4 x i32> ; <<4 x i32>> [#uses=0]
194  %tmp2110.i = and <4 x i1> %cmp13.i, zeroinitializer ; <<4 x i1>> [#uses=0]
195  ret void
196}
197