xref: /llvm-project/llvm/test/CodeGen/X86/sse42-intrinsics-fast-isel.ll (revision 12fa608af44a80de8b655a8a984cd095908e7e80)
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
10
11; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/sse42-builtins.c
12
13define i32 @test_mm_cmpestra(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
14; X86-SSE-LABEL: test_mm_cmpestra:
15; X86-SSE:       # %bb.0:
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
24; X86-SSE-NEXT:    retl
25;
26; X86-AVX-LABEL: test_mm_cmpestra:
27; X86-AVX:       # %bb.0:
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
36; X86-AVX-NEXT:    retl
37;
38; X64-SSE-LABEL: test_mm_cmpestra:
39; X64-SSE:       # %bb.0:
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
46; X64-SSE-NEXT:    retq
47;
48; X64-AVX-LABEL: test_mm_cmpestra:
49; X64-AVX:       # %bb.0:
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
56; X64-AVX-NEXT:    retq
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)
60  ret i32 %res
61}
62declare i32 @llvm.x86.sse42.pcmpestria128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
63
64define i32 @test_mm_cmpestrc(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
65; X86-SSE-LABEL: test_mm_cmpestrc:
66; X86-SSE:       # %bb.0:
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
75; X86-SSE-NEXT:    retl
76;
77; X86-AVX-LABEL: test_mm_cmpestrc:
78; X86-AVX:       # %bb.0:
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
87; X86-AVX-NEXT:    retl
88;
89; X64-SSE-LABEL: test_mm_cmpestrc:
90; X64-SSE:       # %bb.0:
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
97; X64-SSE-NEXT:    retq
98;
99; X64-AVX-LABEL: test_mm_cmpestrc:
100; X64-AVX:       # %bb.0:
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
107; X64-AVX-NEXT:    retq
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)
111  ret i32 %res
112}
113declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
114
115define i32 @test_mm_cmpestri(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
116; X86-SSE-LABEL: test_mm_cmpestri:
117; X86-SSE:       # %bb.0:
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
122; X86-SSE-NEXT:    retl
123;
124; X86-AVX-LABEL: test_mm_cmpestri:
125; X86-AVX:       # %bb.0:
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
130; X86-AVX-NEXT:    retl
131;
132; X64-SSE-LABEL: test_mm_cmpestri:
133; X64-SSE:       # %bb.0:
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
138; X64-SSE-NEXT:    retq
139;
140; X64-AVX-LABEL: test_mm_cmpestri:
141; X64-AVX:       # %bb.0:
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
146; X64-AVX-NEXT:    retq
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)
150  ret i32 %res
151}
152declare i32 @llvm.x86.sse42.pcmpestri128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
153
154define <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:
156; X86-SSE:       # %bb.0:
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
160; X86-SSE-NEXT:    retl
161;
162; X86-AVX-LABEL: test_mm_cmpestrm:
163; X86-AVX:       # %bb.0:
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
167; X86-AVX-NEXT:    retl
168;
169; X64-SSE-LABEL: test_mm_cmpestrm:
170; X64-SSE:       # %bb.0:
171; X64-SSE-NEXT:    movl %esi, %edx
172; X64-SSE-NEXT:    movl %edi, %eax
173; X64-SSE-NEXT:    pcmpestrm $7, %xmm1, %xmm0
174; X64-SSE-NEXT:    retq
175;
176; X64-AVX-LABEL: test_mm_cmpestrm:
177; X64-AVX:       # %bb.0:
178; X64-AVX-NEXT:    movl %esi, %edx
179; X64-AVX-NEXT:    movl %edi, %eax
180; X64-AVX-NEXT:    vpcmpestrm $7, %xmm1, %xmm0
181; X64-AVX-NEXT:    retq
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>
186  ret <2 x i64> %bc
187}
188declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
189
190define i32 @test_mm_cmpestro(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
191; X86-SSE-LABEL: test_mm_cmpestro:
192; X86-SSE:       # %bb.0:
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
201; X86-SSE-NEXT:    retl
202;
203; X86-AVX-LABEL: test_mm_cmpestro:
204; X86-AVX:       # %bb.0:
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
213; X86-AVX-NEXT:    retl
214;
215; X64-SSE-LABEL: test_mm_cmpestro:
216; X64-SSE:       # %bb.0:
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
223; X64-SSE-NEXT:    retq
224;
225; X64-AVX-LABEL: test_mm_cmpestro:
226; X64-AVX:       # %bb.0:
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
233; X64-AVX-NEXT:    retq
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)
237  ret i32 %res
238}
239declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
240
241define i32 @test_mm_cmpestrs(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
242; X86-SSE-LABEL: test_mm_cmpestrs:
243; X86-SSE:       # %bb.0:
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
252; X86-SSE-NEXT:    retl
253;
254; X86-AVX-LABEL: test_mm_cmpestrs:
255; X86-AVX:       # %bb.0:
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
264; X86-AVX-NEXT:    retl
265;
266; X64-SSE-LABEL: test_mm_cmpestrs:
267; X64-SSE:       # %bb.0:
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
274; X64-SSE-NEXT:    retq
275;
276; X64-AVX-LABEL: test_mm_cmpestrs:
277; X64-AVX:       # %bb.0:
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
284; X64-AVX-NEXT:    retq
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)
288  ret i32 %res
289}
290declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
291
292define i32 @test_mm_cmpestrz(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
293; X86-SSE-LABEL: test_mm_cmpestrz:
294; X86-SSE:       # %bb.0:
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
303; X86-SSE-NEXT:    retl
304;
305; X86-AVX-LABEL: test_mm_cmpestrz:
306; X86-AVX:       # %bb.0:
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
315; X86-AVX-NEXT:    retl
316;
317; X64-SSE-LABEL: test_mm_cmpestrz:
318; X64-SSE:       # %bb.0:
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
325; X64-SSE-NEXT:    retq
326;
327; X64-AVX-LABEL: test_mm_cmpestrz:
328; X64-AVX:       # %bb.0:
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
335; X64-AVX-NEXT:    retq
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)
339  ret i32 %res
340}
341declare i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
342
343define <2 x i64> @test_mm_cmpgt_epi64(<2 x i64> %a0, <2 x i64> %a1) {
344; SSE-LABEL: test_mm_cmpgt_epi64:
345; SSE:       # %bb.0:
346; SSE-NEXT:    pcmpgtq %xmm1, %xmm0
347; SSE-NEXT:    ret{{[l|q]}}
348;
349; AVX1-LABEL: test_mm_cmpgt_epi64:
350; AVX1:       # %bb.0:
351; AVX1-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0
352; AVX1-NEXT:    ret{{[l|q]}}
353;
354; AVX512-LABEL: test_mm_cmpgt_epi64:
355; AVX512:       # %bb.0:
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>
361  ret <2 x i64> %res
362}
363
364define i32 @test_mm_cmpistra(<2 x i64> %a0, <2 x i64> %a1) {
365; SSE-LABEL: test_mm_cmpistra:
366; SSE:       # %bb.0:
367; SSE-NEXT:    xorl %eax, %eax
368; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
369; SSE-NEXT:    seta %al
370; SSE-NEXT:    ret{{[l|q]}}
371;
372; AVX-LABEL: test_mm_cmpistra:
373; AVX:       # %bb.0:
374; AVX-NEXT:    xorl %eax, %eax
375; AVX-NEXT:    vpcmpistri $7, %xmm1, %xmm0
376; AVX-NEXT:    seta %al
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)
381  ret i32 %res
382}
383declare i32 @llvm.x86.sse42.pcmpistria128(<16 x i8>, <16 x i8>, i8) nounwind readnone
384
385define i32 @test_mm_cmpistrc(<2 x i64> %a0, <2 x i64> %a1) {
386; SSE-LABEL: test_mm_cmpistrc:
387; SSE:       # %bb.0:
388; SSE-NEXT:    xorl %eax, %eax
389; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
390; SSE-NEXT:    setb %al
391; SSE-NEXT:    ret{{[l|q]}}
392;
393; AVX-LABEL: test_mm_cmpistrc:
394; AVX:       # %bb.0:
395; AVX-NEXT:    xorl %eax, %eax
396; AVX-NEXT:    vpcmpistri $7, %xmm1, %xmm0
397; AVX-NEXT:    setb %al
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)
402  ret i32 %res
403}
404declare i32 @llvm.x86.sse42.pcmpistric128(<16 x i8>, <16 x i8>, i8) nounwind readnone
405
406define i32 @test_mm_cmpistri(<2 x i64> %a0, <2 x i64> %a1) {
407; SSE-LABEL: test_mm_cmpistri:
408; SSE:       # %bb.0:
409; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
410; SSE-NEXT:    movl %ecx, %eax
411; SSE-NEXT:    ret{{[l|q]}}
412;
413; AVX-LABEL: test_mm_cmpistri:
414; AVX:       # %bb.0:
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)
421  ret i32 %res
422}
423declare i32 @llvm.x86.sse42.pcmpistri128(<16 x i8>, <16 x i8>, i8) nounwind readnone
424
425define <2 x i64> @test_mm_cmpistrm(<2 x i64> %a0, <2 x i64> %a1) {
426; SSE-LABEL: test_mm_cmpistrm:
427; SSE:       # %bb.0:
428; SSE-NEXT:    pcmpistrm $7, %xmm1, %xmm0
429; SSE-NEXT:    ret{{[l|q]}}
430;
431; AVX-LABEL: test_mm_cmpistrm:
432; AVX:       # %bb.0:
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>
439  ret <2 x i64> %bc
440}
441declare <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8>, <16 x i8>, i8) nounwind readnone
442
443define i32 @test_mm_cmpistro(<2 x i64> %a0, <2 x i64> %a1) {
444; SSE-LABEL: test_mm_cmpistro:
445; SSE:       # %bb.0:
446; SSE-NEXT:    xorl %eax, %eax
447; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
448; SSE-NEXT:    seto %al
449; SSE-NEXT:    ret{{[l|q]}}
450;
451; AVX-LABEL: test_mm_cmpistro:
452; AVX:       # %bb.0:
453; AVX-NEXT:    xorl %eax, %eax
454; AVX-NEXT:    vpcmpistri $7, %xmm1, %xmm0
455; AVX-NEXT:    seto %al
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)
460  ret i32 %res
461}
462declare i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8>, <16 x i8>, i8) nounwind readnone
463
464define i32 @test_mm_cmpistrs(<2 x i64> %a0, <2 x i64> %a1) {
465; SSE-LABEL: test_mm_cmpistrs:
466; SSE:       # %bb.0:
467; SSE-NEXT:    xorl %eax, %eax
468; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
469; SSE-NEXT:    sets %al
470; SSE-NEXT:    ret{{[l|q]}}
471;
472; AVX-LABEL: test_mm_cmpistrs:
473; AVX:       # %bb.0:
474; AVX-NEXT:    xorl %eax, %eax
475; AVX-NEXT:    vpcmpistri $7, %xmm1, %xmm0
476; AVX-NEXT:    sets %al
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)
481  ret i32 %res
482}
483declare i32 @llvm.x86.sse42.pcmpistris128(<16 x i8>, <16 x i8>, i8) nounwind readnone
484
485define i32 @test_mm_cmpistrz(<2 x i64> %a0, <2 x i64> %a1) {
486; SSE-LABEL: test_mm_cmpistrz:
487; SSE:       # %bb.0:
488; SSE-NEXT:    xorl %eax, %eax
489; SSE-NEXT:    pcmpistri $7, %xmm1, %xmm0
490; SSE-NEXT:    sete %al
491; SSE-NEXT:    ret{{[l|q]}}
492;
493; AVX-LABEL: test_mm_cmpistrz:
494; AVX:       # %bb.0:
495; AVX-NEXT:    xorl %eax, %eax
496; AVX-NEXT:    vpcmpistri $7, %xmm1, %xmm0
497; AVX-NEXT:    sete %al
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)
502  ret i32 %res
503}
504declare i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8>, <16 x i8>, i8) nounwind readnone
505