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
5 define <8 x i32> @a(<8 x i16> %a) nounwind {
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
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>
27 define <3 x i32> @b(<3 x i16> %a) nounwind {
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
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>
52 define <1 x i32> @c(<1 x i16> %a) nounwind {
55 ; CHECK-LIN-NEXT: movswl %di, %eax
56 ; CHECK-LIN-NEXT: retq
60 ; CHECK-WIN-NEXT: movswl %cx, %eax
61 ; CHECK-WIN-NEXT: retq
62 %c = sext <1 x i16> %a to <1 x i32>
66 define <8 x i32> @d(<8 x i16> %a) nounwind {
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
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>
87 define <3 x i32> @e(<3 x i16> %a) nounwind {
90 ; CHECK-LIN-NEXT: pxor %xmm0, %xmm0
91 ; CHECK-LIN-NEXT: pinsrw $0, %edi, %xmm0
92 ; CHECK-LIN-NEXT: pinsrw $2, %esi, %xmm0
93 ; CHECK-LIN-NEXT: pinsrw $4, %edx, %xmm0
94 ; CHECK-LIN-NEXT: retq
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: # kill: def $cx killed $cx def $ecx
101 ; CHECK-WIN-NEXT: pxor %xmm0, %xmm0
102 ; CHECK-WIN-NEXT: pinsrw $0, %ecx, %xmm0
103 ; CHECK-WIN-NEXT: pinsrw $2, %edx, %xmm0
104 ; CHECK-WIN-NEXT: pinsrw $4, %r8d, %xmm0
105 ; CHECK-WIN-NEXT: retq
106 %c = zext <3 x i16> %a to <3 x i32>
110 define <1 x i32> @f(<1 x i16> %a) nounwind {
111 ; CHECK-LIN-LABEL: f:
112 ; CHECK-LIN: # %bb.0:
113 ; CHECK-LIN-NEXT: movzwl %di, %eax
114 ; CHECK-LIN-NEXT: retq
116 ; CHECK-WIN-LABEL: f:
117 ; CHECK-WIN: # %bb.0:
118 ; CHECK-WIN-NEXT: movzwl %cx, %eax
119 ; CHECK-WIN-NEXT: retq
120 %c = zext <1 x i16> %a to <1 x i32>
124 define <8 x i16> @g(<8 x i32> %a) nounwind {
125 ; CHECK-LIN-LABEL: g:
126 ; CHECK-LIN: # %bb.0:
127 ; CHECK-LIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
128 ; CHECK-LIN-NEXT: pshufb %xmm2, %xmm1
129 ; CHECK-LIN-NEXT: pshufb %xmm2, %xmm0
130 ; CHECK-LIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
131 ; CHECK-LIN-NEXT: retq
133 ; CHECK-WIN-LABEL: g:
134 ; CHECK-WIN: # %bb.0:
135 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
136 ; CHECK-WIN-NEXT: movdqa (%rdx), %xmm1
137 ; CHECK-WIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
138 ; CHECK-WIN-NEXT: pshufb %xmm2, %xmm1
139 ; CHECK-WIN-NEXT: pshufb %xmm2, %xmm0
140 ; CHECK-WIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
141 ; CHECK-WIN-NEXT: retq
142 %c = trunc <8 x i32> %a to <8 x i16>
146 define <3 x i16> @h(<3 x i32> %a) nounwind {
147 ; CHECK-LIN-LABEL: h:
148 ; CHECK-LIN: # %bb.0:
149 ; CHECK-LIN-NEXT: movd %xmm0, %eax
150 ; CHECK-LIN-NEXT: pextrw $2, %xmm0, %edx
151 ; CHECK-LIN-NEXT: pextrw $4, %xmm0, %ecx
152 ; CHECK-LIN-NEXT: # kill: def $ax killed $ax killed $eax
153 ; CHECK-LIN-NEXT: # kill: def $dx killed $dx killed $edx
154 ; CHECK-LIN-NEXT: # kill: def $cx killed $cx killed $ecx
155 ; CHECK-LIN-NEXT: retq
157 ; CHECK-WIN-LABEL: h:
158 ; CHECK-WIN: # %bb.0:
159 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
160 ; CHECK-WIN-NEXT: movd %xmm0, %eax
161 ; CHECK-WIN-NEXT: pextrw $2, %xmm0, %edx
162 ; CHECK-WIN-NEXT: pextrw $4, %xmm0, %ecx
163 ; CHECK-WIN-NEXT: # kill: def $ax killed $ax killed $eax
164 ; CHECK-WIN-NEXT: # kill: def $dx killed $dx killed $edx
165 ; CHECK-WIN-NEXT: # kill: def $cx killed $cx killed $ecx
166 ; CHECK-WIN-NEXT: retq
167 %c = trunc <3 x i32> %a to <3 x i16>
171 define <1 x i16> @i(<1 x i32> %a) nounwind {
172 ; CHECK-LIN-LABEL: i:
173 ; CHECK-LIN: # %bb.0:
174 ; CHECK-LIN-NEXT: movl %edi, %eax
175 ; CHECK-LIN-NEXT: # kill: def $ax killed $ax killed $eax
176 ; CHECK-LIN-NEXT: retq
178 ; CHECK-WIN-LABEL: i:
179 ; CHECK-WIN: # %bb.0:
180 ; CHECK-WIN-NEXT: movl %ecx, %eax
181 ; CHECK-WIN-NEXT: # kill: def $ax killed $ax killed $eax
182 ; CHECK-WIN-NEXT: retq
183 %c = trunc <1 x i32> %a to <1 x i16>
188 define void @__OpenCL_math_kernel4_kernel() nounwind {
189 ; CHECK-LABEL: __OpenCL_math_kernel4_kernel:
192 %tmp12.i = and <4 x i32> zeroinitializer, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i32>> [#uses=1]
193 %cmp13.i = icmp eq <4 x i32> %tmp12.i, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i1>> [#uses=2]
194 %cmp.ext14.i = sext <4 x i1> %cmp13.i to <4 x i32> ; <<4 x i32>> [#uses=0]
195 %tmp2110.i = and <4 x i1> %cmp13.i, zeroinitializer ; <<4 x i1>> [#uses=0]