1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefix=AVX512VL --check-prefix=AVX512VL-X64
3 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefix=AVX512VL --check-prefix=AVX512VL-X86
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512F --check-prefix=AVX512F-X64
5 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512F --check-prefix=AVX512F-X86
7 ; Function Attrs: norecurse nounwind readnone
8 define zeroext i8 @TEST_mm_test_epi64_mask(<2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
9 ; AVX512VL-LABEL: TEST_mm_test_epi64_mask:
10 ; AVX512VL: # %bb.0: # %entry
11 ; AVX512VL-NEXT: vptestmq %xmm0, %xmm1, %k0
12 ; AVX512VL-NEXT: kmovw %k0, %eax
13 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
14 ; AVX512VL-NEXT: ret{{[l|q]}}
16 ; AVX512F-LABEL: TEST_mm_test_epi64_mask:
17 ; AVX512F: # %bb.0: # %entry
18 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
19 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
20 ; AVX512F-NEXT: vptestmq %zmm0, %zmm1, %k0
21 ; AVX512F-NEXT: kshiftlw $14, %k0, %k0
22 ; AVX512F-NEXT: kshiftrw $14, %k0, %k0
23 ; AVX512F-NEXT: kmovw %k0, %eax
24 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
25 ; AVX512F-NEXT: vzeroupper
26 ; AVX512F-NEXT: ret{{[l|q]}}
28 %and.i.i = and <2 x i64> %__B, %__A
29 %0 = icmp ne <2 x i64> %and.i.i, zeroinitializer
30 %1 = shufflevector <2 x i1> %0, <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3>
31 %2 = bitcast <8 x i1> %1 to i8
35 ; Function Attrs: norecurse nounwind readnone
36 define zeroext i8 @TEST_mm_test_epi32_mask(<2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
37 ; AVX512VL-LABEL: TEST_mm_test_epi32_mask:
38 ; AVX512VL: # %bb.0: # %entry
39 ; AVX512VL-NEXT: vptestmd %xmm0, %xmm1, %k0
40 ; AVX512VL-NEXT: kmovw %k0, %eax
41 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
42 ; AVX512VL-NEXT: ret{{[l|q]}}
44 ; AVX512F-LABEL: TEST_mm_test_epi32_mask:
45 ; AVX512F: # %bb.0: # %entry
46 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
47 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
48 ; AVX512F-NEXT: vptestmd %zmm0, %zmm1, %k0
49 ; AVX512F-NEXT: kshiftlw $12, %k0, %k0
50 ; AVX512F-NEXT: kshiftrw $12, %k0, %k0
51 ; AVX512F-NEXT: kmovw %k0, %eax
52 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
53 ; AVX512F-NEXT: vzeroupper
54 ; AVX512F-NEXT: ret{{[l|q]}}
56 %and.i.i = and <2 x i64> %__B, %__A
57 %0 = bitcast <2 x i64> %and.i.i to <4 x i32>
58 %1 = icmp ne <4 x i32> %0, zeroinitializer
59 %2 = shufflevector <4 x i1> %1, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
60 %3 = bitcast <8 x i1> %2 to i8
64 ; Function Attrs: norecurse nounwind readnone
65 define zeroext i8 @TEST_mm256_test_epi64_mask(<4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
66 ; AVX512VL-LABEL: TEST_mm256_test_epi64_mask:
67 ; AVX512VL: # %bb.0: # %entry
68 ; AVX512VL-NEXT: vptestmq %ymm0, %ymm1, %k0
69 ; AVX512VL-NEXT: kmovw %k0, %eax
70 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
71 ; AVX512VL-NEXT: vzeroupper
72 ; AVX512VL-NEXT: ret{{[l|q]}}
74 ; AVX512F-LABEL: TEST_mm256_test_epi64_mask:
75 ; AVX512F: # %bb.0: # %entry
76 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
77 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
78 ; AVX512F-NEXT: vptestmq %zmm0, %zmm1, %k0
79 ; AVX512F-NEXT: kshiftlw $12, %k0, %k0
80 ; AVX512F-NEXT: kshiftrw $12, %k0, %k0
81 ; AVX512F-NEXT: kmovw %k0, %eax
82 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
83 ; AVX512F-NEXT: vzeroupper
84 ; AVX512F-NEXT: ret{{[l|q]}}
86 %and.i.i = and <4 x i64> %__B, %__A
87 %0 = icmp ne <4 x i64> %and.i.i, zeroinitializer
88 %1 = shufflevector <4 x i1> %0, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
89 %2 = bitcast <8 x i1> %1 to i8
93 ; Function Attrs: norecurse nounwind readnone
94 define zeroext i8 @TEST_mm256_test_epi32_mask(<4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
95 ; AVX512VL-LABEL: TEST_mm256_test_epi32_mask:
96 ; AVX512VL: # %bb.0: # %entry
97 ; AVX512VL-NEXT: vptestmd %ymm0, %ymm1, %k0
98 ; AVX512VL-NEXT: kmovw %k0, %eax
99 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
100 ; AVX512VL-NEXT: vzeroupper
101 ; AVX512VL-NEXT: ret{{[l|q]}}
103 ; AVX512F-LABEL: TEST_mm256_test_epi32_mask:
104 ; AVX512F: # %bb.0: # %entry
105 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
106 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
107 ; AVX512F-NEXT: vptestmd %zmm0, %zmm1, %k0
108 ; AVX512F-NEXT: kmovw %k0, %eax
109 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
110 ; AVX512F-NEXT: vzeroupper
111 ; AVX512F-NEXT: ret{{[l|q]}}
113 %and.i.i = and <4 x i64> %__B, %__A
114 %0 = bitcast <4 x i64> %and.i.i to <8 x i32>
115 %1 = icmp ne <8 x i32> %0, zeroinitializer
116 %2 = bitcast <8 x i1> %1 to i8
120 ; Function Attrs: norecurse nounwind readnone
121 define zeroext i8 @TEST_mm_mask_test_epi64_mask(i8 %__U, <2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
122 ; AVX512VL-X64-LABEL: TEST_mm_mask_test_epi64_mask:
123 ; AVX512VL-X64: # %bb.0: # %entry
124 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
125 ; AVX512VL-X64-NEXT: vptestmq %xmm0, %xmm1, %k0 {%k1}
126 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
127 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
128 ; AVX512VL-X64-NEXT: retq
130 ; AVX512VL-X86-LABEL: TEST_mm_mask_test_epi64_mask:
131 ; AVX512VL-X86: # %bb.0: # %entry
132 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
133 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
134 ; AVX512VL-X86-NEXT: vptestmq %xmm0, %xmm1, %k0 {%k1}
135 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
136 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
137 ; AVX512VL-X86-NEXT: retl
139 ; AVX512F-X64-LABEL: TEST_mm_mask_test_epi64_mask:
140 ; AVX512F-X64: # %bb.0: # %entry
141 ; AVX512F-X64-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
142 ; AVX512F-X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
143 ; AVX512F-X64-NEXT: kmovw %edi, %k1
144 ; AVX512F-X64-NEXT: vptestmq %zmm0, %zmm1, %k0 {%k1}
145 ; AVX512F-X64-NEXT: kshiftlw $14, %k0, %k0
146 ; AVX512F-X64-NEXT: kshiftrw $14, %k0, %k0
147 ; AVX512F-X64-NEXT: kmovw %k0, %eax
148 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
149 ; AVX512F-X64-NEXT: vzeroupper
150 ; AVX512F-X64-NEXT: retq
152 ; AVX512F-X86-LABEL: TEST_mm_mask_test_epi64_mask:
153 ; AVX512F-X86: # %bb.0: # %entry
154 ; AVX512F-X86-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
155 ; AVX512F-X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
156 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
157 ; AVX512F-X86-NEXT: kmovw %eax, %k1
158 ; AVX512F-X86-NEXT: vptestmq %zmm0, %zmm1, %k0 {%k1}
159 ; AVX512F-X86-NEXT: kshiftlw $14, %k0, %k0
160 ; AVX512F-X86-NEXT: kshiftrw $14, %k0, %k0
161 ; AVX512F-X86-NEXT: kmovw %k0, %eax
162 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
163 ; AVX512F-X86-NEXT: vzeroupper
164 ; AVX512F-X86-NEXT: retl
166 %and.i.i = and <2 x i64> %__B, %__A
167 %0 = icmp ne <2 x i64> %and.i.i, zeroinitializer
168 %1 = bitcast i8 %__U to <8 x i1>
169 %2 = shufflevector <8 x i1> %1, <8 x i1> undef, <2 x i32> <i32 0, i32 1>
170 %3 = and <2 x i1> %0, %2
171 %4 = shufflevector <2 x i1> %3, <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3>
172 %5 = bitcast <8 x i1> %4 to i8
176 ; Function Attrs: norecurse nounwind readnone
177 define zeroext i8 @TEST_mm_mask_test_epi32_mask(i8 %__U, <2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
178 ; AVX512VL-X64-LABEL: TEST_mm_mask_test_epi32_mask:
179 ; AVX512VL-X64: # %bb.0: # %entry
180 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
181 ; AVX512VL-X64-NEXT: vptestmd %xmm0, %xmm1, %k0 {%k1}
182 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
183 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
184 ; AVX512VL-X64-NEXT: retq
186 ; AVX512VL-X86-LABEL: TEST_mm_mask_test_epi32_mask:
187 ; AVX512VL-X86: # %bb.0: # %entry
188 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
189 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
190 ; AVX512VL-X86-NEXT: vptestmd %xmm0, %xmm1, %k0 {%k1}
191 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
192 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
193 ; AVX512VL-X86-NEXT: retl
195 ; AVX512F-X64-LABEL: TEST_mm_mask_test_epi32_mask:
196 ; AVX512F-X64: # %bb.0: # %entry
197 ; AVX512F-X64-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
198 ; AVX512F-X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
199 ; AVX512F-X64-NEXT: kmovw %edi, %k1
200 ; AVX512F-X64-NEXT: vptestmd %zmm0, %zmm1, %k0 {%k1}
201 ; AVX512F-X64-NEXT: kshiftlw $12, %k0, %k0
202 ; AVX512F-X64-NEXT: kshiftrw $12, %k0, %k0
203 ; AVX512F-X64-NEXT: kmovw %k0, %eax
204 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
205 ; AVX512F-X64-NEXT: vzeroupper
206 ; AVX512F-X64-NEXT: retq
208 ; AVX512F-X86-LABEL: TEST_mm_mask_test_epi32_mask:
209 ; AVX512F-X86: # %bb.0: # %entry
210 ; AVX512F-X86-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
211 ; AVX512F-X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
212 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
213 ; AVX512F-X86-NEXT: kmovw %eax, %k1
214 ; AVX512F-X86-NEXT: vptestmd %zmm0, %zmm1, %k0 {%k1}
215 ; AVX512F-X86-NEXT: kshiftlw $12, %k0, %k0
216 ; AVX512F-X86-NEXT: kshiftrw $12, %k0, %k0
217 ; AVX512F-X86-NEXT: kmovw %k0, %eax
218 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
219 ; AVX512F-X86-NEXT: vzeroupper
220 ; AVX512F-X86-NEXT: retl
222 %and.i.i = and <2 x i64> %__B, %__A
223 %0 = bitcast <2 x i64> %and.i.i to <4 x i32>
224 %1 = icmp ne <4 x i32> %0, zeroinitializer
225 %2 = bitcast i8 %__U to <8 x i1>
226 %3 = shufflevector <8 x i1> %2, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
227 %4 = and <4 x i1> %1, %3
228 %5 = shufflevector <4 x i1> %4, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
229 %6 = bitcast <8 x i1> %5 to i8
234 ; Function Attrs: norecurse nounwind readnone
235 define zeroext i8 @TEST_mm256_mask_test_epi64_mask(i8 %__U, <4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
236 ; AVX512VL-X64-LABEL: TEST_mm256_mask_test_epi64_mask:
237 ; AVX512VL-X64: # %bb.0: # %entry
238 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
239 ; AVX512VL-X64-NEXT: vptestmq %ymm0, %ymm1, %k0 {%k1}
240 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
241 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
242 ; AVX512VL-X64-NEXT: vzeroupper
243 ; AVX512VL-X64-NEXT: retq
245 ; AVX512VL-X86-LABEL: TEST_mm256_mask_test_epi64_mask:
246 ; AVX512VL-X86: # %bb.0: # %entry
247 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
248 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
249 ; AVX512VL-X86-NEXT: vptestmq %ymm0, %ymm1, %k0 {%k1}
250 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
251 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
252 ; AVX512VL-X86-NEXT: vzeroupper
253 ; AVX512VL-X86-NEXT: retl
255 ; AVX512F-X64-LABEL: TEST_mm256_mask_test_epi64_mask:
256 ; AVX512F-X64: # %bb.0: # %entry
257 ; AVX512F-X64-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
258 ; AVX512F-X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
259 ; AVX512F-X64-NEXT: kmovw %edi, %k1
260 ; AVX512F-X64-NEXT: vptestmq %zmm0, %zmm1, %k0 {%k1}
261 ; AVX512F-X64-NEXT: kshiftlw $12, %k0, %k0
262 ; AVX512F-X64-NEXT: kshiftrw $12, %k0, %k0
263 ; AVX512F-X64-NEXT: kmovw %k0, %eax
264 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
265 ; AVX512F-X64-NEXT: vzeroupper
266 ; AVX512F-X64-NEXT: retq
268 ; AVX512F-X86-LABEL: TEST_mm256_mask_test_epi64_mask:
269 ; AVX512F-X86: # %bb.0: # %entry
270 ; AVX512F-X86-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
271 ; AVX512F-X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
272 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
273 ; AVX512F-X86-NEXT: kmovw %eax, %k1
274 ; AVX512F-X86-NEXT: vptestmq %zmm0, %zmm1, %k0 {%k1}
275 ; AVX512F-X86-NEXT: kshiftlw $12, %k0, %k0
276 ; AVX512F-X86-NEXT: kshiftrw $12, %k0, %k0
277 ; AVX512F-X86-NEXT: kmovw %k0, %eax
278 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
279 ; AVX512F-X86-NEXT: vzeroupper
280 ; AVX512F-X86-NEXT: retl
282 %and.i.i = and <4 x i64> %__B, %__A
283 %0 = icmp ne <4 x i64> %and.i.i, zeroinitializer
284 %1 = bitcast i8 %__U to <8 x i1>
285 %2 = shufflevector <8 x i1> %1, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
286 %3 = and <4 x i1> %0, %2
287 %4 = shufflevector <4 x i1> %3, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
288 %5 = bitcast <8 x i1> %4 to i8
292 ; Function Attrs: norecurse nounwind readnone
293 define zeroext i8 @TEST_mm256_mask_test_epi32_mask(i8 %__U, <4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
294 ; AVX512VL-X64-LABEL: TEST_mm256_mask_test_epi32_mask:
295 ; AVX512VL-X64: # %bb.0: # %entry
296 ; AVX512VL-X64-NEXT: vptestmd %ymm0, %ymm1, %k0
297 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
298 ; AVX512VL-X64-NEXT: andb %dil, %al
299 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
300 ; AVX512VL-X64-NEXT: vzeroupper
301 ; AVX512VL-X64-NEXT: retq
303 ; AVX512VL-X86-LABEL: TEST_mm256_mask_test_epi32_mask:
304 ; AVX512VL-X86: # %bb.0: # %entry
305 ; AVX512VL-X86-NEXT: vptestmd %ymm0, %ymm1, %k0
306 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
307 ; AVX512VL-X86-NEXT: andb {{[0-9]+}}(%esp), %al
308 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
309 ; AVX512VL-X86-NEXT: vzeroupper
310 ; AVX512VL-X86-NEXT: retl
312 ; AVX512F-X64-LABEL: TEST_mm256_mask_test_epi32_mask:
313 ; AVX512F-X64: # %bb.0: # %entry
314 ; AVX512F-X64-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
315 ; AVX512F-X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
316 ; AVX512F-X64-NEXT: vptestmd %zmm0, %zmm1, %k0
317 ; AVX512F-X64-NEXT: kmovw %k0, %eax
318 ; AVX512F-X64-NEXT: andb %dil, %al
319 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
320 ; AVX512F-X64-NEXT: vzeroupper
321 ; AVX512F-X64-NEXT: retq
323 ; AVX512F-X86-LABEL: TEST_mm256_mask_test_epi32_mask:
324 ; AVX512F-X86: # %bb.0: # %entry
325 ; AVX512F-X86-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
326 ; AVX512F-X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
327 ; AVX512F-X86-NEXT: vptestmd %zmm0, %zmm1, %k0
328 ; AVX512F-X86-NEXT: kmovw %k0, %eax
329 ; AVX512F-X86-NEXT: andb {{[0-9]+}}(%esp), %al
330 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
331 ; AVX512F-X86-NEXT: vzeroupper
332 ; AVX512F-X86-NEXT: retl
334 %and.i.i = and <4 x i64> %__B, %__A
335 %0 = bitcast <4 x i64> %and.i.i to <8 x i32>
336 %1 = icmp ne <8 x i32> %0, zeroinitializer
337 %2 = bitcast i8 %__U to <8 x i1>
338 %3 = and <8 x i1> %1, %2
339 %4 = bitcast <8 x i1> %3 to i8
343 ; Function Attrs: norecurse nounwind readnone
344 define zeroext i8 @TEST_mm_testn_epi64_mask(<2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
345 ; AVX512VL-LABEL: TEST_mm_testn_epi64_mask:
346 ; AVX512VL: # %bb.0: # %entry
347 ; AVX512VL-NEXT: vptestnmq %xmm0, %xmm1, %k0
348 ; AVX512VL-NEXT: kmovw %k0, %eax
349 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
350 ; AVX512VL-NEXT: ret{{[l|q]}}
352 ; AVX512F-LABEL: TEST_mm_testn_epi64_mask:
353 ; AVX512F: # %bb.0: # %entry
354 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
355 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
356 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm1, %k0
357 ; AVX512F-NEXT: kshiftlw $14, %k0, %k0
358 ; AVX512F-NEXT: kshiftrw $14, %k0, %k0
359 ; AVX512F-NEXT: kmovw %k0, %eax
360 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
361 ; AVX512F-NEXT: vzeroupper
362 ; AVX512F-NEXT: ret{{[l|q]}}
364 %and.i.i = and <2 x i64> %__B, %__A
365 %0 = icmp eq <2 x i64> %and.i.i, zeroinitializer
366 %1 = shufflevector <2 x i1> %0, <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3>
367 %2 = bitcast <8 x i1> %1 to i8
371 ; Function Attrs: norecurse nounwind readnone
372 define zeroext i8 @TEST_mm_testn_epi32_mask(<2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
373 ; AVX512VL-LABEL: TEST_mm_testn_epi32_mask:
374 ; AVX512VL: # %bb.0: # %entry
375 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm1, %k0
376 ; AVX512VL-NEXT: kmovw %k0, %eax
377 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
378 ; AVX512VL-NEXT: ret{{[l|q]}}
380 ; AVX512F-LABEL: TEST_mm_testn_epi32_mask:
381 ; AVX512F: # %bb.0: # %entry
382 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
383 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
384 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm1, %k0
385 ; AVX512F-NEXT: kshiftlw $12, %k0, %k0
386 ; AVX512F-NEXT: kshiftrw $12, %k0, %k0
387 ; AVX512F-NEXT: kmovw %k0, %eax
388 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
389 ; AVX512F-NEXT: vzeroupper
390 ; AVX512F-NEXT: ret{{[l|q]}}
392 %and.i.i = and <2 x i64> %__B, %__A
393 %0 = bitcast <2 x i64> %and.i.i to <4 x i32>
394 %1 = icmp eq <4 x i32> %0, zeroinitializer
395 %2 = shufflevector <4 x i1> %1, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
396 %3 = bitcast <8 x i1> %2 to i8
400 ; Function Attrs: norecurse nounwind readnone
401 define zeroext i8 @TEST_mm256_testn_epi64_mask(<4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
402 ; AVX512VL-LABEL: TEST_mm256_testn_epi64_mask:
403 ; AVX512VL: # %bb.0: # %entry
404 ; AVX512VL-NEXT: vptestnmq %ymm0, %ymm1, %k0
405 ; AVX512VL-NEXT: kmovw %k0, %eax
406 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
407 ; AVX512VL-NEXT: vzeroupper
408 ; AVX512VL-NEXT: ret{{[l|q]}}
410 ; AVX512F-LABEL: TEST_mm256_testn_epi64_mask:
411 ; AVX512F: # %bb.0: # %entry
412 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
413 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
414 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm1, %k0
415 ; AVX512F-NEXT: kshiftlw $12, %k0, %k0
416 ; AVX512F-NEXT: kshiftrw $12, %k0, %k0
417 ; AVX512F-NEXT: kmovw %k0, %eax
418 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
419 ; AVX512F-NEXT: vzeroupper
420 ; AVX512F-NEXT: ret{{[l|q]}}
422 %and.i.i = and <4 x i64> %__B, %__A
423 %0 = icmp eq <4 x i64> %and.i.i, zeroinitializer
424 %1 = shufflevector <4 x i1> %0, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
425 %2 = bitcast <8 x i1> %1 to i8
429 ; Function Attrs: norecurse nounwind readnone
430 define zeroext i8 @TEST_mm256_testn_epi32_mask(<4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
431 ; AVX512VL-LABEL: TEST_mm256_testn_epi32_mask:
432 ; AVX512VL: # %bb.0: # %entry
433 ; AVX512VL-NEXT: vptestnmd %ymm0, %ymm1, %k0
434 ; AVX512VL-NEXT: kmovw %k0, %eax
435 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
436 ; AVX512VL-NEXT: vzeroupper
437 ; AVX512VL-NEXT: ret{{[l|q]}}
439 ; AVX512F-LABEL: TEST_mm256_testn_epi32_mask:
440 ; AVX512F: # %bb.0: # %entry
441 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
442 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
443 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm1, %k0
444 ; AVX512F-NEXT: kmovw %k0, %eax
445 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
446 ; AVX512F-NEXT: vzeroupper
447 ; AVX512F-NEXT: ret{{[l|q]}}
449 %and.i.i = and <4 x i64> %__B, %__A
450 %0 = bitcast <4 x i64> %and.i.i to <8 x i32>
451 %1 = icmp eq <8 x i32> %0, zeroinitializer
452 %2 = bitcast <8 x i1> %1 to i8
456 ; Function Attrs: norecurse nounwind readnone
457 define zeroext i8 @TEST_mm_mask_testn_epi64_mask(i8 %__U, <2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
458 ; AVX512VL-X64-LABEL: TEST_mm_mask_testn_epi64_mask:
459 ; AVX512VL-X64: # %bb.0: # %entry
460 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
461 ; AVX512VL-X64-NEXT: vptestnmq %xmm0, %xmm1, %k0 {%k1}
462 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
463 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
464 ; AVX512VL-X64-NEXT: retq
466 ; AVX512VL-X86-LABEL: TEST_mm_mask_testn_epi64_mask:
467 ; AVX512VL-X86: # %bb.0: # %entry
468 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
469 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
470 ; AVX512VL-X86-NEXT: vptestnmq %xmm0, %xmm1, %k0 {%k1}
471 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
472 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
473 ; AVX512VL-X86-NEXT: retl
475 ; AVX512F-X64-LABEL: TEST_mm_mask_testn_epi64_mask:
476 ; AVX512F-X64: # %bb.0: # %entry
477 ; AVX512F-X64-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
478 ; AVX512F-X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
479 ; AVX512F-X64-NEXT: kmovw %edi, %k1
480 ; AVX512F-X64-NEXT: vptestnmq %zmm0, %zmm1, %k0 {%k1}
481 ; AVX512F-X64-NEXT: kshiftlw $14, %k0, %k0
482 ; AVX512F-X64-NEXT: kshiftrw $14, %k0, %k0
483 ; AVX512F-X64-NEXT: kmovw %k0, %eax
484 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
485 ; AVX512F-X64-NEXT: vzeroupper
486 ; AVX512F-X64-NEXT: retq
488 ; AVX512F-X86-LABEL: TEST_mm_mask_testn_epi64_mask:
489 ; AVX512F-X86: # %bb.0: # %entry
490 ; AVX512F-X86-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
491 ; AVX512F-X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
492 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
493 ; AVX512F-X86-NEXT: kmovw %eax, %k1
494 ; AVX512F-X86-NEXT: vptestnmq %zmm0, %zmm1, %k0 {%k1}
495 ; AVX512F-X86-NEXT: kshiftlw $14, %k0, %k0
496 ; AVX512F-X86-NEXT: kshiftrw $14, %k0, %k0
497 ; AVX512F-X86-NEXT: kmovw %k0, %eax
498 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
499 ; AVX512F-X86-NEXT: vzeroupper
500 ; AVX512F-X86-NEXT: retl
502 %and.i.i = and <2 x i64> %__B, %__A
503 %0 = icmp eq <2 x i64> %and.i.i, zeroinitializer
504 %1 = bitcast i8 %__U to <8 x i1>
505 %2 = shufflevector <8 x i1> %1, <8 x i1> undef, <2 x i32> <i32 0, i32 1>
506 %3 = and <2 x i1> %0, %2
507 %4 = shufflevector <2 x i1> %3, <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3>
508 %5 = bitcast <8 x i1> %4 to i8
512 ; Function Attrs: norecurse nounwind readnone
513 define zeroext i8 @TEST_mm_mask_testn_epi32_mask(i8 %__U, <2 x i64> %__A, <2 x i64> %__B) local_unnamed_addr #0 {
514 ; AVX512VL-X64-LABEL: TEST_mm_mask_testn_epi32_mask:
515 ; AVX512VL-X64: # %bb.0: # %entry
516 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
517 ; AVX512VL-X64-NEXT: vptestnmd %xmm0, %xmm1, %k0 {%k1}
518 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
519 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
520 ; AVX512VL-X64-NEXT: retq
522 ; AVX512VL-X86-LABEL: TEST_mm_mask_testn_epi32_mask:
523 ; AVX512VL-X86: # %bb.0: # %entry
524 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
525 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
526 ; AVX512VL-X86-NEXT: vptestnmd %xmm0, %xmm1, %k0 {%k1}
527 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
528 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
529 ; AVX512VL-X86-NEXT: retl
531 ; AVX512F-X64-LABEL: TEST_mm_mask_testn_epi32_mask:
532 ; AVX512F-X64: # %bb.0: # %entry
533 ; AVX512F-X64-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
534 ; AVX512F-X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
535 ; AVX512F-X64-NEXT: kmovw %edi, %k1
536 ; AVX512F-X64-NEXT: vptestnmd %zmm0, %zmm1, %k0 {%k1}
537 ; AVX512F-X64-NEXT: kshiftlw $12, %k0, %k0
538 ; AVX512F-X64-NEXT: kshiftrw $12, %k0, %k0
539 ; AVX512F-X64-NEXT: kmovw %k0, %eax
540 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
541 ; AVX512F-X64-NEXT: vzeroupper
542 ; AVX512F-X64-NEXT: retq
544 ; AVX512F-X86-LABEL: TEST_mm_mask_testn_epi32_mask:
545 ; AVX512F-X86: # %bb.0: # %entry
546 ; AVX512F-X86-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
547 ; AVX512F-X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
548 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
549 ; AVX512F-X86-NEXT: kmovw %eax, %k1
550 ; AVX512F-X86-NEXT: vptestnmd %zmm0, %zmm1, %k0 {%k1}
551 ; AVX512F-X86-NEXT: kshiftlw $12, %k0, %k0
552 ; AVX512F-X86-NEXT: kshiftrw $12, %k0, %k0
553 ; AVX512F-X86-NEXT: kmovw %k0, %eax
554 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
555 ; AVX512F-X86-NEXT: vzeroupper
556 ; AVX512F-X86-NEXT: retl
558 %and.i.i = and <2 x i64> %__B, %__A
559 %0 = bitcast <2 x i64> %and.i.i to <4 x i32>
560 %1 = icmp eq <4 x i32> %0, zeroinitializer
561 %2 = bitcast i8 %__U to <8 x i1>
562 %3 = shufflevector <8 x i1> %2, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
563 %4 = and <4 x i1> %1, %3
564 %5 = shufflevector <4 x i1> %4, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
565 %6 = bitcast <8 x i1> %5 to i8
570 ; Function Attrs: norecurse nounwind readnone
571 define zeroext i8 @TEST_mm256_mask_testn_epi64_mask(i8 %__U, <4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
572 ; AVX512VL-X64-LABEL: TEST_mm256_mask_testn_epi64_mask:
573 ; AVX512VL-X64: # %bb.0: # %entry
574 ; AVX512VL-X64-NEXT: kmovw %edi, %k1
575 ; AVX512VL-X64-NEXT: vptestnmq %ymm0, %ymm1, %k0 {%k1}
576 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
577 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
578 ; AVX512VL-X64-NEXT: vzeroupper
579 ; AVX512VL-X64-NEXT: retq
581 ; AVX512VL-X86-LABEL: TEST_mm256_mask_testn_epi64_mask:
582 ; AVX512VL-X86: # %bb.0: # %entry
583 ; AVX512VL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
584 ; AVX512VL-X86-NEXT: kmovw %eax, %k1
585 ; AVX512VL-X86-NEXT: vptestnmq %ymm0, %ymm1, %k0 {%k1}
586 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
587 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
588 ; AVX512VL-X86-NEXT: vzeroupper
589 ; AVX512VL-X86-NEXT: retl
591 ; AVX512F-X64-LABEL: TEST_mm256_mask_testn_epi64_mask:
592 ; AVX512F-X64: # %bb.0: # %entry
593 ; AVX512F-X64-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
594 ; AVX512F-X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
595 ; AVX512F-X64-NEXT: kmovw %edi, %k1
596 ; AVX512F-X64-NEXT: vptestnmq %zmm0, %zmm1, %k0 {%k1}
597 ; AVX512F-X64-NEXT: kshiftlw $12, %k0, %k0
598 ; AVX512F-X64-NEXT: kshiftrw $12, %k0, %k0
599 ; AVX512F-X64-NEXT: kmovw %k0, %eax
600 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
601 ; AVX512F-X64-NEXT: vzeroupper
602 ; AVX512F-X64-NEXT: retq
604 ; AVX512F-X86-LABEL: TEST_mm256_mask_testn_epi64_mask:
605 ; AVX512F-X86: # %bb.0: # %entry
606 ; AVX512F-X86-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
607 ; AVX512F-X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
608 ; AVX512F-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
609 ; AVX512F-X86-NEXT: kmovw %eax, %k1
610 ; AVX512F-X86-NEXT: vptestnmq %zmm0, %zmm1, %k0 {%k1}
611 ; AVX512F-X86-NEXT: kshiftlw $12, %k0, %k0
612 ; AVX512F-X86-NEXT: kshiftrw $12, %k0, %k0
613 ; AVX512F-X86-NEXT: kmovw %k0, %eax
614 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
615 ; AVX512F-X86-NEXT: vzeroupper
616 ; AVX512F-X86-NEXT: retl
618 %and.i.i = and <4 x i64> %__B, %__A
619 %0 = icmp eq <4 x i64> %and.i.i, zeroinitializer
620 %1 = bitcast i8 %__U to <8 x i1>
621 %2 = shufflevector <8 x i1> %1, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
622 %3 = and <4 x i1> %0, %2
623 %4 = shufflevector <4 x i1> %3, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
624 %5 = bitcast <8 x i1> %4 to i8
628 ; Function Attrs: norecurse nounwind readnone
629 define zeroext i8 @TEST_mm256_mask_testn_epi32_mask(i8 %__U, <4 x i64> %__A, <4 x i64> %__B) local_unnamed_addr #0 {
630 ; AVX512VL-X64-LABEL: TEST_mm256_mask_testn_epi32_mask:
631 ; AVX512VL-X64: # %bb.0: # %entry
632 ; AVX512VL-X64-NEXT: vptestnmd %ymm0, %ymm1, %k0
633 ; AVX512VL-X64-NEXT: kmovw %k0, %eax
634 ; AVX512VL-X64-NEXT: andb %dil, %al
635 ; AVX512VL-X64-NEXT: # kill: def $al killed $al killed $eax
636 ; AVX512VL-X64-NEXT: vzeroupper
637 ; AVX512VL-X64-NEXT: retq
639 ; AVX512VL-X86-LABEL: TEST_mm256_mask_testn_epi32_mask:
640 ; AVX512VL-X86: # %bb.0: # %entry
641 ; AVX512VL-X86-NEXT: vptestnmd %ymm0, %ymm1, %k0
642 ; AVX512VL-X86-NEXT: kmovw %k0, %eax
643 ; AVX512VL-X86-NEXT: andb {{[0-9]+}}(%esp), %al
644 ; AVX512VL-X86-NEXT: # kill: def $al killed $al killed $eax
645 ; AVX512VL-X86-NEXT: vzeroupper
646 ; AVX512VL-X86-NEXT: retl
648 ; AVX512F-X64-LABEL: TEST_mm256_mask_testn_epi32_mask:
649 ; AVX512F-X64: # %bb.0: # %entry
650 ; AVX512F-X64-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
651 ; AVX512F-X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
652 ; AVX512F-X64-NEXT: vptestnmd %zmm0, %zmm1, %k0
653 ; AVX512F-X64-NEXT: kmovw %k0, %eax
654 ; AVX512F-X64-NEXT: andb %dil, %al
655 ; AVX512F-X64-NEXT: # kill: def $al killed $al killed $eax
656 ; AVX512F-X64-NEXT: vzeroupper
657 ; AVX512F-X64-NEXT: retq
659 ; AVX512F-X86-LABEL: TEST_mm256_mask_testn_epi32_mask:
660 ; AVX512F-X86: # %bb.0: # %entry
661 ; AVX512F-X86-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
662 ; AVX512F-X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
663 ; AVX512F-X86-NEXT: vptestnmd %zmm0, %zmm1, %k0
664 ; AVX512F-X86-NEXT: kmovw %k0, %eax
665 ; AVX512F-X86-NEXT: andb {{[0-9]+}}(%esp), %al
666 ; AVX512F-X86-NEXT: # kill: def $al killed $al killed $eax
667 ; AVX512F-X86-NEXT: vzeroupper
668 ; AVX512F-X86-NEXT: retl
670 %and.i.i = and <4 x i64> %__B, %__A
671 %0 = bitcast <4 x i64> %and.i.i to <8 x i32>
672 %1 = icmp eq <8 x i32> %0, zeroinitializer
673 %2 = bitcast i8 %__U to <8 x i1>
674 %3 = and <8 x i1> %1, %2
675 %4 = bitcast <8 x i1> %3 to i8