llvm.org GIT mirror llvm / e13dc30
[X86][AVX512] Added VPERMILPD/VPERMILPS intrinsics fast-isel generic IR tests Added PSHUFD tests as well git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274493 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 4 years ago
1 changed file(s) with 163 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
157157 %res0 = shufflevector <16 x float> %a1, <16 x float> undef, <16 x i32>
158158 %res1 = select <16 x i1> %arg0, <16 x float> %res0, <16 x float> zeroinitializer
159159 ret <16 x float> %res1
160 }
161
162 define <8 x double> @test_mm512_permute_pd(<8 x double> %a0) {
163 ; X32-LABEL: test_mm512_permute_pd:
164 ; X32: # BB#0:
165 ; X32-NEXT: vpermilpd {{.*#+}} zmm0 = zmm0[0,1,2,2,4,4,6,6]
166 ; X32-NEXT: retl
167 ;
168 ; X64-LABEL: test_mm512_permute_pd:
169 ; X64: # BB#0:
170 ; X64-NEXT: vpermilpd {{.*#+}} zmm0 = zmm0[0,1,2,2,4,4,6,6]
171 ; X64-NEXT: retq
172 %res = shufflevector <8 x double> %a0, <8 x double> undef, <8 x i32>
173 ret <8 x double> %res
174 }
175
176 define <8 x double> @test_mm512_mask_permute_pd(<8 x double> %a0, i8 %a1, <8 x double> %a2) {
177 ; X32-LABEL: test_mm512_mask_permute_pd:
178 ; X32: # BB#0:
179 ; X32-NEXT: movb {{[0-9]+}}(%esp), %al
180 ; X32-NEXT: kmovw %eax, %k1
181 ; X32-NEXT: vpermilpd {{.*#+}} zmm0 {%k1} = zmm1[0,1,2,2,4,4,6,6]
182 ; X32-NEXT: retl
183 ;
184 ; X64-LABEL: test_mm512_mask_permute_pd:
185 ; X64: # BB#0:
186 ; X64-NEXT: kmovw %edi, %k1
187 ; X64-NEXT: vpermilpd {{.*#+}} zmm0 {%k1} = zmm1[0,1,2,2,4,4,6,6]
188 ; X64-NEXT: retq
189 %arg1 = bitcast i8 %a1 to <8 x i1>
190 %res0 = shufflevector <8 x double> %a2, <8 x double> undef, <8 x i32>
191 %res1 = select <8 x i1> %arg1, <8 x double> %res0, <8 x double> %a0
192 ret <8 x double> %res1
193 }
194
195 define <8 x double> @test_mm512_maskz_permute_pd(i8 %a0, <8 x double> %a1) {
196 ; X32-LABEL: test_mm512_maskz_permute_pd:
197 ; X32: # BB#0:
198 ; X32-NEXT: movb {{[0-9]+}}(%esp), %al
199 ; X32-NEXT: kmovw %eax, %k1
200 ; X32-NEXT: vpermilpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0,1,2,2,4,4,6,6]
201 ; X32-NEXT: retl
202 ;
203 ; X64-LABEL: test_mm512_maskz_permute_pd:
204 ; X64: # BB#0:
205 ; X64-NEXT: kmovw %edi, %k1
206 ; X64-NEXT: vpermilpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0,1,2,2,4,4,6,6]
207 ; X64-NEXT: retq
208 %arg0 = bitcast i8 %a0 to <8 x i1>
209 %res0 = shufflevector <8 x double> %a1, <8 x double> undef, <8 x i32>
210 %res1 = select <8 x i1> %arg0, <8 x double> %res0, <8 x double> zeroinitializer
211 ret <8 x double> %res1
212 }
213
214 define <16 x float> @test_mm512_permute_ps(<16 x float> %a0) {
215 ; X32-LABEL: test_mm512_permute_ps:
216 ; X32: # BB#0:
217 ; X32-NEXT: vpermilps {{.*#+}} zmm0 = zmm0[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
218 ; X32-NEXT: retl
219 ;
220 ; X64-LABEL: test_mm512_permute_ps:
221 ; X64: # BB#0:
222 ; X64-NEXT: vpermilps {{.*#+}} zmm0 = zmm0[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
223 ; X64-NEXT: retq
224 %res = shufflevector <16 x float> %a0, <16 x float> undef, <16 x i32>
225 ret <16 x float> %res
226 }
227
228 define <16 x float> @test_mm512_mask_permute_ps(<16 x float> %a0, i16 %a1, <16 x float> %a2) {
229 ; X32-LABEL: test_mm512_mask_permute_ps:
230 ; X32: # BB#0:
231 ; X32-NEXT: movw {{[0-9]+}}(%esp), %ax
232 ; X32-NEXT: kmovw %eax, %k1
233 ; X32-NEXT: vpermilps {{.*#+}} zmm0 {%k1} = zmm1[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
234 ; X32-NEXT: retl
235 ;
236 ; X64-LABEL: test_mm512_mask_permute_ps:
237 ; X64: # BB#0:
238 ; X64-NEXT: kmovw %edi, %k1
239 ; X64-NEXT: vpermilps {{.*#+}} zmm0 {%k1} = zmm1[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
240 ; X64-NEXT: retq
241 %arg1 = bitcast i16 %a1 to <16 x i1>
242 %res0 = shufflevector <16 x float> %a2, <16 x float> undef, <16 x i32>
243 %res1 = select <16 x i1> %arg1, <16 x float> %res0, <16 x float> %a0
244 ret <16 x float> %res1
245 }
246
247 define <16 x float> @test_mm512_maskz_permute_ps(i16 %a0, <16 x float> %a1) {
248 ; X32-LABEL: test_mm512_maskz_permute_ps:
249 ; X32: # BB#0:
250 ; X32-NEXT: movw {{[0-9]+}}(%esp), %ax
251 ; X32-NEXT: kmovw %eax, %k1
252 ; X32-NEXT: vpermilps {{.*#+}} zmm0 {%k1} {z} = zmm0[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
253 ; X32-NEXT: retl
254 ;
255 ; X64-LABEL: test_mm512_maskz_permute_ps:
256 ; X64: # BB#0:
257 ; X64-NEXT: kmovw %edi, %k1
258 ; X64-NEXT: vpermilps {{.*#+}} zmm0 {%k1} {z} = zmm0[2,0,0,0,6,4,4,4,10,8,8,8,14,12,12,12]
259 ; X64-NEXT: retq
260 %arg0 = bitcast i16 %a0 to <16 x i1>
261 %res0 = shufflevector <16 x float> %a1, <16 x float> undef, <16 x i32>
262 %res1 = select <16 x i1> %arg0, <16 x float> %res0, <16 x float> zeroinitializer
263 ret <16 x float> %res1
264 }
265
266 define <8 x i64> @test_mm512_shuffle_epi32(<8 x i64> %a0) {
267 ; X32-LABEL: test_mm512_shuffle_epi32:
268 ; X32: # BB#0:
269 ; X32-NEXT: vpshufd {{.*#+}} zmm0 = zmm0[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
270 ; X32-NEXT: retl
271 ;
272 ; X64-LABEL: test_mm512_shuffle_epi32:
273 ; X64: # BB#0:
274 ; X64-NEXT: vpshufd {{.*#+}} zmm0 = zmm0[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
275 ; X64-NEXT: retq
276 %arg0 = bitcast <8 x i64> %a0 to <16 x i32>
277 %res0 = shufflevector <16 x i32> %arg0, <16 x i32> undef, <16 x i32>
278 %res1 = bitcast <16 x i32> %res0 to <8 x i64>
279 ret <8 x i64> %res1
280 }
281
282 define <8 x i64> @test_mm512_mask_shuffle_epi32(<8 x i64> %a0, i16 %a1, <8 x i64> %a2) {
283 ; X32-LABEL: test_mm512_mask_shuffle_epi32:
284 ; X32: # BB#0:
285 ; X32-NEXT: movw {{[0-9]+}}(%esp), %ax
286 ; X32-NEXT: kmovw %eax, %k1
287 ; X32-NEXT: vpshufd {{.*#+}} zmm0 {%k1} = zmm1[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
288 ; X32-NEXT: retl
289 ;
290 ; X64-LABEL: test_mm512_mask_shuffle_epi32:
291 ; X64: # BB#0:
292 ; X64-NEXT: kmovw %edi, %k1
293 ; X64-NEXT: vpshufd {{.*#+}} zmm0 {%k1} = zmm1[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
294 ; X64-NEXT: retq
295 %arg0 = bitcast <8 x i64> %a0 to <16 x i32>
296 %arg1 = bitcast i16 %a1 to <16 x i1>
297 %arg2 = bitcast <8 x i64> %a2 to <16 x i32>
298 %res0 = shufflevector <16 x i32> %arg2, <16 x i32> undef, <16 x i32>
299 %res1 = select <16 x i1> %arg1, <16 x i32> %res0, <16 x i32> %arg0
300 %res2 = bitcast <16 x i32> %res1 to <8 x i64>
301 ret <8 x i64> %res2
302 }
303
304 define <8 x i64> @test_mm512_maskz_shuffle_epi32(i16 %a0, <8 x i64> %a1) {
305 ; X32-LABEL: test_mm512_maskz_shuffle_epi32:
306 ; X32: # BB#0:
307 ; X32-NEXT: movw {{[0-9]+}}(%esp), %ax
308 ; X32-NEXT: kmovw %eax, %k1
309 ; X32-NEXT: vpshufd {{.*#+}} zmm0 {%k1} {z} = zmm0[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
310 ; X32-NEXT: retl
311 ;
312 ; X64-LABEL: test_mm512_maskz_shuffle_epi32:
313 ; X64: # BB#0:
314 ; X64-NEXT: kmovw %edi, %k1
315 ; X64-NEXT: vpshufd {{.*#+}} zmm0 {%k1} {z} = zmm0[1,0,0,0,5,4,4,4,9,8,8,8,13,12,12,12]
316 ; X64-NEXT: retq
317 %arg0 = bitcast i16 %a0 to <16 x i1>
318 %arg1 = bitcast <8 x i64> %a1 to <16 x i32>
319 %res0 = shufflevector <16 x i32> %arg1, <16 x i32> undef, <16 x i32>
320 %res1 = select <16 x i1> %arg0, <16 x i32> %res0, <16 x i32> zeroinitializer
321 %res2 = bitcast <16 x i32> %res1 to <8 x i64>
322 ret <8 x i64> %res2
160323 }
161324
162325 define <8 x i64> @test_mm512_unpackhi_epi32(<8 x i64> %a0, <8 x i64> %a1) {