1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=SSE,X86-SSE
3 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+sse4.2,-crc32 | FileCheck %s --check-prefixes=SSE,X86-SSE
4 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,X86-AVX,AVX1
5 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=AVX,X86-AVX,AVX512
6 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=SSE,X64-SSE
7 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+sse4.2,-crc32 | FileCheck %s --check-prefixes=SSE,X64-SSE
8 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,X64-AVX,AVX1
9 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=AVX,X64-AVX,AVX512
11 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/sse42-builtins.c
13 define i32 @test_mm_cmpestra(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
14 ; X86-SSE-LABEL: test_mm_cmpestra:
16 ; X86-SSE-NEXT: pushl %ebx
17 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
18 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
19 ; X86-SSE-NEXT: xorl %ebx, %ebx
20 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
21 ; X86-SSE-NEXT: seta %bl
22 ; X86-SSE-NEXT: movl %ebx, %eax
23 ; X86-SSE-NEXT: popl %ebx
26 ; X86-AVX-LABEL: test_mm_cmpestra:
28 ; X86-AVX-NEXT: pushl %ebx
29 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
30 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
31 ; X86-AVX-NEXT: xorl %ebx, %ebx
32 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
33 ; X86-AVX-NEXT: seta %bl
34 ; X86-AVX-NEXT: movl %ebx, %eax
35 ; X86-AVX-NEXT: popl %ebx
38 ; X64-SSE-LABEL: test_mm_cmpestra:
40 ; X64-SSE-NEXT: movl %esi, %edx
41 ; X64-SSE-NEXT: movl %edi, %eax
42 ; X64-SSE-NEXT: xorl %esi, %esi
43 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
44 ; X64-SSE-NEXT: seta %sil
45 ; X64-SSE-NEXT: movl %esi, %eax
48 ; X64-AVX-LABEL: test_mm_cmpestra:
50 ; X64-AVX-NEXT: movl %esi, %edx
51 ; X64-AVX-NEXT: movl %edi, %eax
52 ; X64-AVX-NEXT: xorl %esi, %esi
53 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
54 ; X64-AVX-NEXT: seta %sil
55 ; X64-AVX-NEXT: movl %esi, %eax
57 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
58 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
59 %res = call i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
62 declare i32 @llvm.x86.sse42.pcmpestria128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
64 define i32 @test_mm_cmpestrc(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
65 ; X86-SSE-LABEL: test_mm_cmpestrc:
67 ; X86-SSE-NEXT: pushl %ebx
68 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
69 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
70 ; X86-SSE-NEXT: xorl %ebx, %ebx
71 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
72 ; X86-SSE-NEXT: setb %bl
73 ; X86-SSE-NEXT: movl %ebx, %eax
74 ; X86-SSE-NEXT: popl %ebx
77 ; X86-AVX-LABEL: test_mm_cmpestrc:
79 ; X86-AVX-NEXT: pushl %ebx
80 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
81 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
82 ; X86-AVX-NEXT: xorl %ebx, %ebx
83 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
84 ; X86-AVX-NEXT: setb %bl
85 ; X86-AVX-NEXT: movl %ebx, %eax
86 ; X86-AVX-NEXT: popl %ebx
89 ; X64-SSE-LABEL: test_mm_cmpestrc:
91 ; X64-SSE-NEXT: movl %esi, %edx
92 ; X64-SSE-NEXT: movl %edi, %eax
93 ; X64-SSE-NEXT: xorl %esi, %esi
94 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
95 ; X64-SSE-NEXT: setb %sil
96 ; X64-SSE-NEXT: movl %esi, %eax
99 ; X64-AVX-LABEL: test_mm_cmpestrc:
101 ; X64-AVX-NEXT: movl %esi, %edx
102 ; X64-AVX-NEXT: movl %edi, %eax
103 ; X64-AVX-NEXT: xorl %esi, %esi
104 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
105 ; X64-AVX-NEXT: setb %sil
106 ; X64-AVX-NEXT: movl %esi, %eax
108 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
109 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
110 %res = call i32 @llvm.x86.sse42.pcmpestric128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
113 declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
115 define i32 @test_mm_cmpestri(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
116 ; X86-SSE-LABEL: test_mm_cmpestri:
118 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
119 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
120 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
121 ; X86-SSE-NEXT: movl %ecx, %eax
124 ; X86-AVX-LABEL: test_mm_cmpestri:
126 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
127 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
128 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
129 ; X86-AVX-NEXT: movl %ecx, %eax
132 ; X64-SSE-LABEL: test_mm_cmpestri:
134 ; X64-SSE-NEXT: movl %esi, %edx
135 ; X64-SSE-NEXT: movl %edi, %eax
136 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
137 ; X64-SSE-NEXT: movl %ecx, %eax
140 ; X64-AVX-LABEL: test_mm_cmpestri:
142 ; X64-AVX-NEXT: movl %esi, %edx
143 ; X64-AVX-NEXT: movl %edi, %eax
144 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
145 ; X64-AVX-NEXT: movl %ecx, %eax
147 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
148 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
149 %res = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
152 declare i32 @llvm.x86.sse42.pcmpestri128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
154 define <2 x i64> @test_mm_cmpestrm(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
155 ; X86-SSE-LABEL: test_mm_cmpestrm:
157 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
158 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
159 ; X86-SSE-NEXT: pcmpestrm $7, %xmm1, %xmm0
162 ; X86-AVX-LABEL: test_mm_cmpestrm:
164 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
165 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
166 ; X86-AVX-NEXT: vpcmpestrm $7, %xmm1, %xmm0
169 ; X64-SSE-LABEL: test_mm_cmpestrm:
171 ; X64-SSE-NEXT: movl %esi, %edx
172 ; X64-SSE-NEXT: movl %edi, %eax
173 ; X64-SSE-NEXT: pcmpestrm $7, %xmm1, %xmm0
176 ; X64-AVX-LABEL: test_mm_cmpestrm:
178 ; X64-AVX-NEXT: movl %esi, %edx
179 ; X64-AVX-NEXT: movl %edi, %eax
180 ; X64-AVX-NEXT: vpcmpestrm $7, %xmm1, %xmm0
182 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
183 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
184 %res = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
185 %bc = bitcast <16 x i8> %res to <2 x i64>
188 declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
190 define i32 @test_mm_cmpestro(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
191 ; X86-SSE-LABEL: test_mm_cmpestro:
193 ; X86-SSE-NEXT: pushl %ebx
194 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
195 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
196 ; X86-SSE-NEXT: xorl %ebx, %ebx
197 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
198 ; X86-SSE-NEXT: seto %bl
199 ; X86-SSE-NEXT: movl %ebx, %eax
200 ; X86-SSE-NEXT: popl %ebx
203 ; X86-AVX-LABEL: test_mm_cmpestro:
205 ; X86-AVX-NEXT: pushl %ebx
206 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
207 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
208 ; X86-AVX-NEXT: xorl %ebx, %ebx
209 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
210 ; X86-AVX-NEXT: seto %bl
211 ; X86-AVX-NEXT: movl %ebx, %eax
212 ; X86-AVX-NEXT: popl %ebx
215 ; X64-SSE-LABEL: test_mm_cmpestro:
217 ; X64-SSE-NEXT: movl %esi, %edx
218 ; X64-SSE-NEXT: movl %edi, %eax
219 ; X64-SSE-NEXT: xorl %esi, %esi
220 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
221 ; X64-SSE-NEXT: seto %sil
222 ; X64-SSE-NEXT: movl %esi, %eax
225 ; X64-AVX-LABEL: test_mm_cmpestro:
227 ; X64-AVX-NEXT: movl %esi, %edx
228 ; X64-AVX-NEXT: movl %edi, %eax
229 ; X64-AVX-NEXT: xorl %esi, %esi
230 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
231 ; X64-AVX-NEXT: seto %sil
232 ; X64-AVX-NEXT: movl %esi, %eax
234 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
235 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
236 %res = call i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
239 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
241 define i32 @test_mm_cmpestrs(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
242 ; X86-SSE-LABEL: test_mm_cmpestrs:
244 ; X86-SSE-NEXT: pushl %ebx
245 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
246 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
247 ; X86-SSE-NEXT: xorl %ebx, %ebx
248 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
249 ; X86-SSE-NEXT: sets %bl
250 ; X86-SSE-NEXT: movl %ebx, %eax
251 ; X86-SSE-NEXT: popl %ebx
254 ; X86-AVX-LABEL: test_mm_cmpestrs:
256 ; X86-AVX-NEXT: pushl %ebx
257 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
258 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
259 ; X86-AVX-NEXT: xorl %ebx, %ebx
260 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
261 ; X86-AVX-NEXT: sets %bl
262 ; X86-AVX-NEXT: movl %ebx, %eax
263 ; X86-AVX-NEXT: popl %ebx
266 ; X64-SSE-LABEL: test_mm_cmpestrs:
268 ; X64-SSE-NEXT: movl %esi, %edx
269 ; X64-SSE-NEXT: movl %edi, %eax
270 ; X64-SSE-NEXT: xorl %esi, %esi
271 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
272 ; X64-SSE-NEXT: sets %sil
273 ; X64-SSE-NEXT: movl %esi, %eax
276 ; X64-AVX-LABEL: test_mm_cmpestrs:
278 ; X64-AVX-NEXT: movl %esi, %edx
279 ; X64-AVX-NEXT: movl %edi, %eax
280 ; X64-AVX-NEXT: xorl %esi, %esi
281 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
282 ; X64-AVX-NEXT: sets %sil
283 ; X64-AVX-NEXT: movl %esi, %eax
285 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
286 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
287 %res = call i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
290 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
292 define i32 @test_mm_cmpestrz(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
293 ; X86-SSE-LABEL: test_mm_cmpestrz:
295 ; X86-SSE-NEXT: pushl %ebx
296 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
297 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
298 ; X86-SSE-NEXT: xorl %ebx, %ebx
299 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
300 ; X86-SSE-NEXT: sete %bl
301 ; X86-SSE-NEXT: movl %ebx, %eax
302 ; X86-SSE-NEXT: popl %ebx
305 ; X86-AVX-LABEL: test_mm_cmpestrz:
307 ; X86-AVX-NEXT: pushl %ebx
308 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
309 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
310 ; X86-AVX-NEXT: xorl %ebx, %ebx
311 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
312 ; X86-AVX-NEXT: sete %bl
313 ; X86-AVX-NEXT: movl %ebx, %eax
314 ; X86-AVX-NEXT: popl %ebx
317 ; X64-SSE-LABEL: test_mm_cmpestrz:
319 ; X64-SSE-NEXT: movl %esi, %edx
320 ; X64-SSE-NEXT: movl %edi, %eax
321 ; X64-SSE-NEXT: xorl %esi, %esi
322 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
323 ; X64-SSE-NEXT: sete %sil
324 ; X64-SSE-NEXT: movl %esi, %eax
327 ; X64-AVX-LABEL: test_mm_cmpestrz:
329 ; X64-AVX-NEXT: movl %esi, %edx
330 ; X64-AVX-NEXT: movl %edi, %eax
331 ; X64-AVX-NEXT: xorl %esi, %esi
332 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
333 ; X64-AVX-NEXT: sete %sil
334 ; X64-AVX-NEXT: movl %esi, %eax
336 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
337 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
338 %res = call i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
341 declare i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
343 define <2 x i64> @test_mm_cmpgt_epi64(<2 x i64> %a0, <2 x i64> %a1) {
344 ; SSE-LABEL: test_mm_cmpgt_epi64:
346 ; SSE-NEXT: pcmpgtq %xmm1, %xmm0
347 ; SSE-NEXT: ret{{[l|q]}}
349 ; AVX1-LABEL: test_mm_cmpgt_epi64:
351 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm0
352 ; AVX1-NEXT: ret{{[l|q]}}
354 ; AVX512-LABEL: test_mm_cmpgt_epi64:
356 ; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
357 ; AVX512-NEXT: vpmovm2q %k0, %xmm0
358 ; AVX512-NEXT: ret{{[l|q]}}
359 %cmp = icmp sgt <2 x i64> %a0, %a1
360 %res = sext <2 x i1> %cmp to <2 x i64>
364 define i32 @test_mm_cmpistra(<2 x i64> %a0, <2 x i64> %a1) {
365 ; SSE-LABEL: test_mm_cmpistra:
367 ; SSE-NEXT: xorl %eax, %eax
368 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
370 ; SSE-NEXT: ret{{[l|q]}}
372 ; AVX-LABEL: test_mm_cmpistra:
374 ; AVX-NEXT: xorl %eax, %eax
375 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
377 ; AVX-NEXT: ret{{[l|q]}}
378 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
379 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
380 %res = call i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
383 declare i32 @llvm.x86.sse42.pcmpistria128(<16 x i8>, <16 x i8>, i8) nounwind readnone
385 define i32 @test_mm_cmpistrc(<2 x i64> %a0, <2 x i64> %a1) {
386 ; SSE-LABEL: test_mm_cmpistrc:
388 ; SSE-NEXT: xorl %eax, %eax
389 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
391 ; SSE-NEXT: ret{{[l|q]}}
393 ; AVX-LABEL: test_mm_cmpistrc:
395 ; AVX-NEXT: xorl %eax, %eax
396 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
398 ; AVX-NEXT: ret{{[l|q]}}
399 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
400 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
401 %res = call i32 @llvm.x86.sse42.pcmpistric128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
404 declare i32 @llvm.x86.sse42.pcmpistric128(<16 x i8>, <16 x i8>, i8) nounwind readnone
406 define i32 @test_mm_cmpistri(<2 x i64> %a0, <2 x i64> %a1) {
407 ; SSE-LABEL: test_mm_cmpistri:
409 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
410 ; SSE-NEXT: movl %ecx, %eax
411 ; SSE-NEXT: ret{{[l|q]}}
413 ; AVX-LABEL: test_mm_cmpistri:
415 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
416 ; AVX-NEXT: movl %ecx, %eax
417 ; AVX-NEXT: ret{{[l|q]}}
418 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
419 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
420 %res = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
423 declare i32 @llvm.x86.sse42.pcmpistri128(<16 x i8>, <16 x i8>, i8) nounwind readnone
425 define <2 x i64> @test_mm_cmpistrm(<2 x i64> %a0, <2 x i64> %a1) {
426 ; SSE-LABEL: test_mm_cmpistrm:
428 ; SSE-NEXT: pcmpistrm $7, %xmm1, %xmm0
429 ; SSE-NEXT: ret{{[l|q]}}
431 ; AVX-LABEL: test_mm_cmpistrm:
433 ; AVX-NEXT: vpcmpistrm $7, %xmm1, %xmm0
434 ; AVX-NEXT: ret{{[l|q]}}
435 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
436 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
437 %res = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
438 %bc = bitcast <16 x i8> %res to <2 x i64>
441 declare <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8>, <16 x i8>, i8) nounwind readnone
443 define i32 @test_mm_cmpistro(<2 x i64> %a0, <2 x i64> %a1) {
444 ; SSE-LABEL: test_mm_cmpistro:
446 ; SSE-NEXT: xorl %eax, %eax
447 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
449 ; SSE-NEXT: ret{{[l|q]}}
451 ; AVX-LABEL: test_mm_cmpistro:
453 ; AVX-NEXT: xorl %eax, %eax
454 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
456 ; AVX-NEXT: ret{{[l|q]}}
457 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
458 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
459 %res = call i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
462 declare i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8>, <16 x i8>, i8) nounwind readnone
464 define i32 @test_mm_cmpistrs(<2 x i64> %a0, <2 x i64> %a1) {
465 ; SSE-LABEL: test_mm_cmpistrs:
467 ; SSE-NEXT: xorl %eax, %eax
468 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
470 ; SSE-NEXT: ret{{[l|q]}}
472 ; AVX-LABEL: test_mm_cmpistrs:
474 ; AVX-NEXT: xorl %eax, %eax
475 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
477 ; AVX-NEXT: ret{{[l|q]}}
478 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
479 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
480 %res = call i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
483 declare i32 @llvm.x86.sse42.pcmpistris128(<16 x i8>, <16 x i8>, i8) nounwind readnone
485 define i32 @test_mm_cmpistrz(<2 x i64> %a0, <2 x i64> %a1) {
486 ; SSE-LABEL: test_mm_cmpistrz:
488 ; SSE-NEXT: xorl %eax, %eax
489 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
491 ; SSE-NEXT: ret{{[l|q]}}
493 ; AVX-LABEL: test_mm_cmpistrz:
495 ; AVX-NEXT: xorl %eax, %eax
496 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
498 ; AVX-NEXT: ret{{[l|q]}}
499 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
500 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
501 %res = call i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
504 declare i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8>, <16 x i8>, i8) nounwind readnone