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=CHECK,X86,SSE,X86-SSE
3 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX1,X86-AVX1
4 ; RUN: llc < %s -fast-isel -mtriple=i386-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX512,X86-AVX512
5 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,X64,SSE,X64-SSE
6 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX1,X64-AVX1
7 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX512,X64-AVX512
9 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/sse42-builtins.c
11 define i32 @test_mm_cmpestra(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
12 ; X86-SSE-LABEL: test_mm_cmpestra:
14 ; X86-SSE-NEXT: pushl %ebx
15 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
16 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
17 ; X86-SSE-NEXT: xorl %ebx, %ebx
18 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
19 ; X86-SSE-NEXT: seta %bl
20 ; X86-SSE-NEXT: movl %ebx, %eax
21 ; X86-SSE-NEXT: popl %ebx
24 ; X86-AVX-LABEL: test_mm_cmpestra:
26 ; X86-AVX-NEXT: pushl %ebx
27 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
28 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
29 ; X86-AVX-NEXT: xorl %ebx, %ebx
30 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
31 ; X86-AVX-NEXT: seta %bl
32 ; X86-AVX-NEXT: movl %ebx, %eax
33 ; X86-AVX-NEXT: popl %ebx
36 ; X64-SSE-LABEL: test_mm_cmpestra:
38 ; X64-SSE-NEXT: movl %esi, %edx
39 ; X64-SSE-NEXT: movl %edi, %eax
40 ; X64-SSE-NEXT: xorl %esi, %esi
41 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
42 ; X64-SSE-NEXT: seta %sil
43 ; X64-SSE-NEXT: movl %esi, %eax
46 ; X64-AVX-LABEL: test_mm_cmpestra:
48 ; X64-AVX-NEXT: movl %esi, %edx
49 ; X64-AVX-NEXT: movl %edi, %eax
50 ; X64-AVX-NEXT: xorl %esi, %esi
51 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
52 ; X64-AVX-NEXT: seta %sil
53 ; X64-AVX-NEXT: movl %esi, %eax
55 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
56 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
57 %res = call i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
60 declare i32 @llvm.x86.sse42.pcmpestria128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
62 define i32 @test_mm_cmpestrc(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
63 ; X86-SSE-LABEL: test_mm_cmpestrc:
65 ; X86-SSE-NEXT: pushl %ebx
66 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
67 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
68 ; X86-SSE-NEXT: xorl %ebx, %ebx
69 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
70 ; X86-SSE-NEXT: setb %bl
71 ; X86-SSE-NEXT: movl %ebx, %eax
72 ; X86-SSE-NEXT: popl %ebx
75 ; X86-AVX-LABEL: test_mm_cmpestrc:
77 ; X86-AVX-NEXT: pushl %ebx
78 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
79 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
80 ; X86-AVX-NEXT: xorl %ebx, %ebx
81 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
82 ; X86-AVX-NEXT: setb %bl
83 ; X86-AVX-NEXT: movl %ebx, %eax
84 ; X86-AVX-NEXT: popl %ebx
87 ; X64-SSE-LABEL: test_mm_cmpestrc:
89 ; X64-SSE-NEXT: movl %esi, %edx
90 ; X64-SSE-NEXT: movl %edi, %eax
91 ; X64-SSE-NEXT: xorl %esi, %esi
92 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
93 ; X64-SSE-NEXT: setb %sil
94 ; X64-SSE-NEXT: movl %esi, %eax
97 ; X64-AVX-LABEL: test_mm_cmpestrc:
99 ; X64-AVX-NEXT: movl %esi, %edx
100 ; X64-AVX-NEXT: movl %edi, %eax
101 ; X64-AVX-NEXT: xorl %esi, %esi
102 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
103 ; X64-AVX-NEXT: setb %sil
104 ; X64-AVX-NEXT: movl %esi, %eax
106 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
107 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
108 %res = call i32 @llvm.x86.sse42.pcmpestric128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
111 declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
113 define i32 @test_mm_cmpestri(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
114 ; X86-SSE-LABEL: test_mm_cmpestri:
116 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
117 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
118 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
119 ; X86-SSE-NEXT: movl %ecx, %eax
122 ; X86-AVX-LABEL: test_mm_cmpestri:
124 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
125 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
126 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
127 ; X86-AVX-NEXT: movl %ecx, %eax
130 ; X64-SSE-LABEL: test_mm_cmpestri:
132 ; X64-SSE-NEXT: movl %esi, %edx
133 ; X64-SSE-NEXT: movl %edi, %eax
134 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
135 ; X64-SSE-NEXT: movl %ecx, %eax
138 ; X64-AVX-LABEL: test_mm_cmpestri:
140 ; X64-AVX-NEXT: movl %esi, %edx
141 ; X64-AVX-NEXT: movl %edi, %eax
142 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
143 ; X64-AVX-NEXT: movl %ecx, %eax
145 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
146 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
147 %res = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
150 declare i32 @llvm.x86.sse42.pcmpestri128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
152 define <2 x i64> @test_mm_cmpestrm(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
153 ; X86-SSE-LABEL: test_mm_cmpestrm:
155 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
156 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
157 ; X86-SSE-NEXT: pcmpestrm $7, %xmm1, %xmm0
160 ; X86-AVX-LABEL: test_mm_cmpestrm:
162 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
163 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
164 ; X86-AVX-NEXT: vpcmpestrm $7, %xmm1, %xmm0
167 ; X64-SSE-LABEL: test_mm_cmpestrm:
169 ; X64-SSE-NEXT: movl %esi, %edx
170 ; X64-SSE-NEXT: movl %edi, %eax
171 ; X64-SSE-NEXT: pcmpestrm $7, %xmm1, %xmm0
174 ; X64-AVX-LABEL: test_mm_cmpestrm:
176 ; X64-AVX-NEXT: movl %esi, %edx
177 ; X64-AVX-NEXT: movl %edi, %eax
178 ; X64-AVX-NEXT: vpcmpestrm $7, %xmm1, %xmm0
180 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
181 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
182 %res = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
183 %bc = bitcast <16 x i8> %res to <2 x i64>
186 declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
188 define i32 @test_mm_cmpestro(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
189 ; X86-SSE-LABEL: test_mm_cmpestro:
191 ; X86-SSE-NEXT: pushl %ebx
192 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
193 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
194 ; X86-SSE-NEXT: xorl %ebx, %ebx
195 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
196 ; X86-SSE-NEXT: seto %bl
197 ; X86-SSE-NEXT: movl %ebx, %eax
198 ; X86-SSE-NEXT: popl %ebx
201 ; X86-AVX-LABEL: test_mm_cmpestro:
203 ; X86-AVX-NEXT: pushl %ebx
204 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
205 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
206 ; X86-AVX-NEXT: xorl %ebx, %ebx
207 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
208 ; X86-AVX-NEXT: seto %bl
209 ; X86-AVX-NEXT: movl %ebx, %eax
210 ; X86-AVX-NEXT: popl %ebx
213 ; X64-SSE-LABEL: test_mm_cmpestro:
215 ; X64-SSE-NEXT: movl %esi, %edx
216 ; X64-SSE-NEXT: movl %edi, %eax
217 ; X64-SSE-NEXT: xorl %esi, %esi
218 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
219 ; X64-SSE-NEXT: seto %sil
220 ; X64-SSE-NEXT: movl %esi, %eax
223 ; X64-AVX-LABEL: test_mm_cmpestro:
225 ; X64-AVX-NEXT: movl %esi, %edx
226 ; X64-AVX-NEXT: movl %edi, %eax
227 ; X64-AVX-NEXT: xorl %esi, %esi
228 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
229 ; X64-AVX-NEXT: seto %sil
230 ; X64-AVX-NEXT: movl %esi, %eax
232 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
233 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
234 %res = call i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
237 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
239 define i32 @test_mm_cmpestrs(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
240 ; X86-SSE-LABEL: test_mm_cmpestrs:
242 ; X86-SSE-NEXT: pushl %ebx
243 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
244 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
245 ; X86-SSE-NEXT: xorl %ebx, %ebx
246 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
247 ; X86-SSE-NEXT: sets %bl
248 ; X86-SSE-NEXT: movl %ebx, %eax
249 ; X86-SSE-NEXT: popl %ebx
252 ; X86-AVX-LABEL: test_mm_cmpestrs:
254 ; X86-AVX-NEXT: pushl %ebx
255 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
256 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
257 ; X86-AVX-NEXT: xorl %ebx, %ebx
258 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
259 ; X86-AVX-NEXT: sets %bl
260 ; X86-AVX-NEXT: movl %ebx, %eax
261 ; X86-AVX-NEXT: popl %ebx
264 ; X64-SSE-LABEL: test_mm_cmpestrs:
266 ; X64-SSE-NEXT: movl %esi, %edx
267 ; X64-SSE-NEXT: movl %edi, %eax
268 ; X64-SSE-NEXT: xorl %esi, %esi
269 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
270 ; X64-SSE-NEXT: sets %sil
271 ; X64-SSE-NEXT: movl %esi, %eax
274 ; X64-AVX-LABEL: test_mm_cmpestrs:
276 ; X64-AVX-NEXT: movl %esi, %edx
277 ; X64-AVX-NEXT: movl %edi, %eax
278 ; X64-AVX-NEXT: xorl %esi, %esi
279 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
280 ; X64-AVX-NEXT: sets %sil
281 ; X64-AVX-NEXT: movl %esi, %eax
283 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
284 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
285 %res = call i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
288 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
290 define i32 @test_mm_cmpestrz(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
291 ; X86-SSE-LABEL: test_mm_cmpestrz:
293 ; X86-SSE-NEXT: pushl %ebx
294 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx
295 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
296 ; X86-SSE-NEXT: xorl %ebx, %ebx
297 ; X86-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
298 ; X86-SSE-NEXT: sete %bl
299 ; X86-SSE-NEXT: movl %ebx, %eax
300 ; X86-SSE-NEXT: popl %ebx
303 ; X86-AVX-LABEL: test_mm_cmpestrz:
305 ; X86-AVX-NEXT: pushl %ebx
306 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx
307 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
308 ; X86-AVX-NEXT: xorl %ebx, %ebx
309 ; X86-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
310 ; X86-AVX-NEXT: sete %bl
311 ; X86-AVX-NEXT: movl %ebx, %eax
312 ; X86-AVX-NEXT: popl %ebx
315 ; X64-SSE-LABEL: test_mm_cmpestrz:
317 ; X64-SSE-NEXT: movl %esi, %edx
318 ; X64-SSE-NEXT: movl %edi, %eax
319 ; X64-SSE-NEXT: xorl %esi, %esi
320 ; X64-SSE-NEXT: pcmpestri $7, %xmm1, %xmm0
321 ; X64-SSE-NEXT: sete %sil
322 ; X64-SSE-NEXT: movl %esi, %eax
325 ; X64-AVX-LABEL: test_mm_cmpestrz:
327 ; X64-AVX-NEXT: movl %esi, %edx
328 ; X64-AVX-NEXT: movl %edi, %eax
329 ; X64-AVX-NEXT: xorl %esi, %esi
330 ; X64-AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
331 ; X64-AVX-NEXT: sete %sil
332 ; X64-AVX-NEXT: movl %esi, %eax
334 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
335 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
336 %res = call i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %arg0, i32 %a1, <16 x i8> %arg2, i32 %a3, i8 7)
339 declare i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
341 define <2 x i64> @test_mm_cmpgt_epi64(<2 x i64> %a0, <2 x i64> %a1) {
342 ; SSE-LABEL: test_mm_cmpgt_epi64:
344 ; SSE-NEXT: pcmpgtq %xmm1, %xmm0
345 ; SSE-NEXT: ret{{[l|q]}}
347 ; AVX1-LABEL: test_mm_cmpgt_epi64:
349 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm0
350 ; AVX1-NEXT: ret{{[l|q]}}
352 ; AVX512-LABEL: test_mm_cmpgt_epi64:
354 ; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
355 ; AVX512-NEXT: vpmovm2q %k0, %xmm0
356 ; AVX512-NEXT: ret{{[l|q]}}
357 %cmp = icmp sgt <2 x i64> %a0, %a1
358 %res = sext <2 x i1> %cmp to <2 x i64>
362 define i32 @test_mm_cmpistra(<2 x i64> %a0, <2 x i64> %a1) {
363 ; SSE-LABEL: test_mm_cmpistra:
365 ; SSE-NEXT: xorl %eax, %eax
366 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
368 ; SSE-NEXT: ret{{[l|q]}}
370 ; AVX-LABEL: test_mm_cmpistra:
372 ; AVX-NEXT: xorl %eax, %eax
373 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
375 ; AVX-NEXT: ret{{[l|q]}}
376 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
377 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
378 %res = call i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
381 declare i32 @llvm.x86.sse42.pcmpistria128(<16 x i8>, <16 x i8>, i8) nounwind readnone
383 define i32 @test_mm_cmpistrc(<2 x i64> %a0, <2 x i64> %a1) {
384 ; SSE-LABEL: test_mm_cmpistrc:
386 ; SSE-NEXT: xorl %eax, %eax
387 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
389 ; SSE-NEXT: ret{{[l|q]}}
391 ; AVX-LABEL: test_mm_cmpistrc:
393 ; AVX-NEXT: xorl %eax, %eax
394 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
396 ; AVX-NEXT: ret{{[l|q]}}
397 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
398 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
399 %res = call i32 @llvm.x86.sse42.pcmpistric128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
402 declare i32 @llvm.x86.sse42.pcmpistric128(<16 x i8>, <16 x i8>, i8) nounwind readnone
404 define i32 @test_mm_cmpistri(<2 x i64> %a0, <2 x i64> %a1) {
405 ; SSE-LABEL: test_mm_cmpistri:
407 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
408 ; SSE-NEXT: movl %ecx, %eax
409 ; SSE-NEXT: ret{{[l|q]}}
411 ; AVX-LABEL: test_mm_cmpistri:
413 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
414 ; AVX-NEXT: movl %ecx, %eax
415 ; AVX-NEXT: ret{{[l|q]}}
416 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
417 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
418 %res = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
421 declare i32 @llvm.x86.sse42.pcmpistri128(<16 x i8>, <16 x i8>, i8) nounwind readnone
423 define <2 x i64> @test_mm_cmpistrm(<2 x i64> %a0, <2 x i64> %a1) {
424 ; SSE-LABEL: test_mm_cmpistrm:
426 ; SSE-NEXT: pcmpistrm $7, %xmm1, %xmm0
427 ; SSE-NEXT: ret{{[l|q]}}
429 ; AVX-LABEL: test_mm_cmpistrm:
431 ; AVX-NEXT: vpcmpistrm $7, %xmm1, %xmm0
432 ; AVX-NEXT: ret{{[l|q]}}
433 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
434 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
435 %res = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
436 %bc = bitcast <16 x i8> %res to <2 x i64>
439 declare <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8>, <16 x i8>, i8) nounwind readnone
441 define i32 @test_mm_cmpistro(<2 x i64> %a0, <2 x i64> %a1) {
442 ; SSE-LABEL: test_mm_cmpistro:
444 ; SSE-NEXT: xorl %eax, %eax
445 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
447 ; SSE-NEXT: ret{{[l|q]}}
449 ; AVX-LABEL: test_mm_cmpistro:
451 ; AVX-NEXT: xorl %eax, %eax
452 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
454 ; AVX-NEXT: ret{{[l|q]}}
455 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
456 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
457 %res = call i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
460 declare i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8>, <16 x i8>, i8) nounwind readnone
462 define i32 @test_mm_cmpistrs(<2 x i64> %a0, <2 x i64> %a1) {
463 ; SSE-LABEL: test_mm_cmpistrs:
465 ; SSE-NEXT: xorl %eax, %eax
466 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
468 ; SSE-NEXT: ret{{[l|q]}}
470 ; AVX-LABEL: test_mm_cmpistrs:
472 ; AVX-NEXT: xorl %eax, %eax
473 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
475 ; AVX-NEXT: ret{{[l|q]}}
476 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
477 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
478 %res = call i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
481 declare i32 @llvm.x86.sse42.pcmpistris128(<16 x i8>, <16 x i8>, i8) nounwind readnone
483 define i32 @test_mm_cmpistrz(<2 x i64> %a0, <2 x i64> %a1) {
484 ; SSE-LABEL: test_mm_cmpistrz:
486 ; SSE-NEXT: xorl %eax, %eax
487 ; SSE-NEXT: pcmpistri $7, %xmm1, %xmm0
489 ; SSE-NEXT: ret{{[l|q]}}
491 ; AVX-LABEL: test_mm_cmpistrz:
493 ; AVX-NEXT: xorl %eax, %eax
494 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
496 ; AVX-NEXT: ret{{[l|q]}}
497 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
498 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
499 %res = call i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %arg0, <16 x i8> %arg1, i8 7)
502 declare i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8>, <16 x i8>, i8) nounwind readnone
504 define i32 @test_mm_crc32_u8(i32 %a0, i8 %a1) {
505 ; X86-LABEL: test_mm_crc32_u8:
507 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
508 ; X86-NEXT: crc32b {{[0-9]+}}(%esp), %eax
511 ; X64-LABEL: test_mm_crc32_u8:
513 ; X64-NEXT: movl %edi, %eax
514 ; X64-NEXT: crc32b %sil, %eax
516 %res = call i32 @llvm.x86.sse42.crc32.32.8(i32 %a0, i8 %a1)
519 declare i32 @llvm.x86.sse42.crc32.32.8(i32, i8) nounwind readnone
521 define i32 @test_mm_crc32_u16(i32 %a0, i16 %a1) {
522 ; X86-LABEL: test_mm_crc32_u16:
524 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
525 ; X86-NEXT: crc32w {{[0-9]+}}(%esp), %eax
528 ; X64-LABEL: test_mm_crc32_u16:
530 ; X64-NEXT: movl %edi, %eax
531 ; X64-NEXT: crc32w %si, %eax
533 %res = call i32 @llvm.x86.sse42.crc32.32.16(i32 %a0, i16 %a1)
536 declare i32 @llvm.x86.sse42.crc32.32.16(i32, i16) nounwind readnone
538 define i32 @test_mm_crc32_u32(i32 %a0, i32 %a1) {
539 ; X86-LABEL: test_mm_crc32_u32:
541 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
542 ; X86-NEXT: crc32l {{[0-9]+}}(%esp), %eax
545 ; X64-LABEL: test_mm_crc32_u32:
547 ; X64-NEXT: movl %edi, %eax
548 ; X64-NEXT: crc32l %esi, %eax
550 %res = call i32 @llvm.x86.sse42.crc32.32.32(i32 %a0, i32 %a1)
553 declare i32 @llvm.x86.sse42.crc32.32.32(i32, i32) nounwind readnone