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: 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
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>
109 define <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
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>
123 define <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
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>
145 define <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
156 ; CHECK-WIN-LABEL: h:
157 ; CHECK-WIN: # %bb.0:
158 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
159 ; CHECK-WIN-NEXT: movl (%rcx), %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>
170 define <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
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>
187 define void @__OpenCL_math_kernel4_kernel() nounwind {
188 ; CHECK-LABEL: __OpenCL_math_kernel4_kernel:
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]