1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop | FileCheck %s --check-prefix=XOP
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=AVX512,AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefixes=AVX512,AVX512VL
13 define <2 x i64> @bitselect_v2i64_rr(<2 x i64>, <2 x i64>) {
14 ; SSE-LABEL: bitselect_v2i64_rr:
16 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
17 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
18 ; SSE-NEXT: orps %xmm1, %xmm0
21 ; XOP-LABEL: bitselect_v2i64_rr:
23 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1, %xmm0
26 ; AVX-LABEL: bitselect_v2i64_rr:
28 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
29 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
30 ; AVX-NEXT: vorps %xmm0, %xmm1, %xmm0
33 ; AVX512F-LABEL: bitselect_v2i64_rr:
35 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
36 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
37 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [18446744069414584319,18446744060824649725]
38 ; AVX512F-NEXT: vpternlogq $216, %zmm2, %zmm1, %zmm0
39 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
40 ; AVX512F-NEXT: vzeroupper
43 ; AVX512VL-LABEL: bitselect_v2i64_rr:
45 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
47 %3 = and <2 x i64> %0, <i64 4294967296, i64 12884901890>
48 %4 = and <2 x i64> %1, <i64 -4294967297, i64 -12884901891>
49 %5 = or <2 x i64> %4, %3
53 define <2 x i64> @bitselect_v2i64_rm(<2 x i64>, ptr nocapture readonly) {
54 ; SSE-LABEL: bitselect_v2i64_rm:
56 ; SSE-NEXT: movaps (%rdi), %xmm1
57 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
58 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
59 ; SSE-NEXT: orps %xmm1, %xmm0
62 ; XOP-LABEL: bitselect_v2i64_rm:
64 ; XOP-NEXT: vmovdqa (%rdi), %xmm1
65 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1, %xmm0
68 ; AVX-LABEL: bitselect_v2i64_rm:
70 ; AVX-NEXT: vmovaps (%rdi), %xmm1
71 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
72 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
73 ; AVX-NEXT: vorps %xmm0, %xmm1, %xmm0
76 ; AVX512F-LABEL: bitselect_v2i64_rm:
78 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
79 ; AVX512F-NEXT: vmovdqa (%rdi), %xmm1
80 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [18446744065119617022,18446744073709551612]
81 ; AVX512F-NEXT: vpternlogq $184, %zmm1, %zmm2, %zmm0
82 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
83 ; AVX512F-NEXT: vzeroupper
86 ; AVX512VL-LABEL: bitselect_v2i64_rm:
88 ; AVX512VL-NEXT: vmovdqa (%rdi), %xmm1
89 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
91 %3 = load <2 x i64>, ptr %1
92 %4 = and <2 x i64> %0, <i64 8589934593, i64 3>
93 %5 = and <2 x i64> %3, <i64 -8589934594, i64 -4>
94 %6 = or <2 x i64> %5, %4
98 define <2 x i64> @bitselect_v2i64_mr(ptr nocapture readonly, <2 x i64>) {
99 ; SSE-LABEL: bitselect_v2i64_mr:
101 ; SSE-NEXT: movaps (%rdi), %xmm1
102 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
103 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
104 ; SSE-NEXT: orps %xmm1, %xmm0
107 ; XOP-LABEL: bitselect_v2i64_mr:
109 ; XOP-NEXT: vmovdqa (%rdi), %xmm1
110 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1, %xmm0
113 ; AVX-LABEL: bitselect_v2i64_mr:
115 ; AVX-NEXT: vmovaps (%rdi), %xmm1
116 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
117 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
118 ; AVX-NEXT: vorps %xmm0, %xmm1, %xmm0
121 ; AVX512F-LABEL: bitselect_v2i64_mr:
123 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
124 ; AVX512F-NEXT: vmovdqa (%rdi), %xmm1
125 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [12884901890,4294967296]
126 ; AVX512F-NEXT: vpternlogq $184, %zmm1, %zmm2, %zmm0
127 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
128 ; AVX512F-NEXT: vzeroupper
131 ; AVX512VL-LABEL: bitselect_v2i64_mr:
133 ; AVX512VL-NEXT: vmovdqa (%rdi), %xmm1
134 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
135 ; AVX512VL-NEXT: retq
136 %3 = load <2 x i64>, ptr %0
137 %4 = and <2 x i64> %3, <i64 12884901890, i64 4294967296>
138 %5 = and <2 x i64> %1, <i64 -12884901891, i64 -4294967297>
139 %6 = or <2 x i64> %4, %5
143 define <2 x i64> @bitselect_v2i64_mm(ptr nocapture readonly, ptr nocapture readonly) {
144 ; SSE-LABEL: bitselect_v2i64_mm:
146 ; SSE-NEXT: movaps (%rdi), %xmm1
147 ; SSE-NEXT: movaps (%rsi), %xmm0
148 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
149 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
150 ; SSE-NEXT: orps %xmm1, %xmm0
153 ; XOP-LABEL: bitselect_v2i64_mm:
155 ; XOP-NEXT: vmovdqa (%rsi), %xmm0
156 ; XOP-NEXT: vmovdqa {{.*#+}} xmm1 = [18446744073709551612,18446744065119617022]
157 ; XOP-NEXT: vpcmov %xmm1, (%rdi), %xmm0, %xmm0
160 ; AVX-LABEL: bitselect_v2i64_mm:
162 ; AVX-NEXT: vmovaps (%rdi), %xmm0
163 ; AVX-NEXT: vmovaps (%rsi), %xmm1
164 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
165 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
166 ; AVX-NEXT: vorps %xmm0, %xmm1, %xmm0
169 ; AVX512F-LABEL: bitselect_v2i64_mm:
171 ; AVX512F-NEXT: vmovdqa (%rdi), %xmm1
172 ; AVX512F-NEXT: vmovdqa (%rsi), %xmm0
173 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [18446744073709551612,18446744065119617022]
174 ; AVX512F-NEXT: vpternlogq $226, %zmm1, %zmm2, %zmm0
175 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
176 ; AVX512F-NEXT: vzeroupper
179 ; AVX512VL-LABEL: bitselect_v2i64_mm:
181 ; AVX512VL-NEXT: vmovdqa (%rsi), %xmm1
182 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm0 = [18446744073709551612,18446744065119617022]
183 ; AVX512VL-NEXT: vpternlogq $202, (%rdi), %xmm1, %xmm0
184 ; AVX512VL-NEXT: retq
185 %3 = load <2 x i64>, ptr %0
186 %4 = load <2 x i64>, ptr %1
187 %5 = and <2 x i64> %3, <i64 3, i64 8589934593>
188 %6 = and <2 x i64> %4, <i64 -4, i64 -8589934594>
189 %7 = or <2 x i64> %6, %5
193 define <2 x i64> @bitselect_v2i64_broadcast_rrr(<2 x i64> %a0, <2 x i64> %a1, i64 %a2) {
194 ; SSE-LABEL: bitselect_v2i64_broadcast_rrr:
196 ; SSE-NEXT: movq %rdi, %xmm2
197 ; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
198 ; SSE-NEXT: pand %xmm2, %xmm0
199 ; SSE-NEXT: pandn %xmm1, %xmm2
200 ; SSE-NEXT: por %xmm2, %xmm0
203 ; XOP-LABEL: bitselect_v2i64_broadcast_rrr:
205 ; XOP-NEXT: vmovq %rdi, %xmm2
206 ; XOP-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
207 ; XOP-NEXT: vpcmov %xmm2, %xmm1, %xmm0, %xmm0
210 ; AVX1-LABEL: bitselect_v2i64_broadcast_rrr:
212 ; AVX1-NEXT: vmovq %rdi, %xmm2
213 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
214 ; AVX1-NEXT: vpand %xmm2, %xmm0, %xmm0
215 ; AVX1-NEXT: vpandn %xmm1, %xmm2, %xmm1
216 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
219 ; AVX2-LABEL: bitselect_v2i64_broadcast_rrr:
221 ; AVX2-NEXT: vmovq %rdi, %xmm2
222 ; AVX2-NEXT: vpbroadcastq %xmm2, %xmm2
223 ; AVX2-NEXT: vpand %xmm2, %xmm0, %xmm0
224 ; AVX2-NEXT: vpandn %xmm1, %xmm2, %xmm1
225 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
228 ; AVX512F-LABEL: bitselect_v2i64_broadcast_rrr:
230 ; AVX512F-NEXT: vmovq %rdi, %xmm2
231 ; AVX512F-NEXT: vpbroadcastq %xmm2, %xmm2
232 ; AVX512F-NEXT: vpand %xmm2, %xmm0, %xmm0
233 ; AVX512F-NEXT: vpandn %xmm1, %xmm2, %xmm1
234 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
237 ; AVX512VL-LABEL: bitselect_v2i64_broadcast_rrr:
239 ; AVX512VL-NEXT: vpbroadcastq %rdi, %xmm2
240 ; AVX512VL-NEXT: vpternlogq $226, %xmm1, %xmm2, %xmm0
241 ; AVX512VL-NEXT: retq
242 %1 = insertelement <2 x i64> undef, i64 %a2, i32 0
243 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> zeroinitializer
244 %3 = xor <2 x i64> %1, <i64 -1, i64 undef>
245 %4 = shufflevector <2 x i64> %3, <2 x i64> undef, <2 x i32> zeroinitializer
246 %5 = and <2 x i64> %a0, %2
247 %6 = and <2 x i64> %a1, %4
248 %7 = or <2 x i64> %5, %6
252 define <2 x i64> @bitselect_v2i64_broadcast_rrm(<2 x i64> %a0, <2 x i64> %a1, ptr %p2) {
253 ; SSE-LABEL: bitselect_v2i64_broadcast_rrm:
255 ; SSE-NEXT: movq {{.*#+}} xmm2 = mem[0],zero
256 ; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
257 ; SSE-NEXT: pand %xmm2, %xmm0
258 ; SSE-NEXT: pandn %xmm1, %xmm2
259 ; SSE-NEXT: por %xmm2, %xmm0
262 ; XOP-LABEL: bitselect_v2i64_broadcast_rrm:
264 ; XOP-NEXT: vmovddup {{.*#+}} xmm2 = mem[0,0]
265 ; XOP-NEXT: vpcmov %xmm2, %xmm1, %xmm0, %xmm0
268 ; AVX-LABEL: bitselect_v2i64_broadcast_rrm:
270 ; AVX-NEXT: vmovddup {{.*#+}} xmm2 = mem[0,0]
271 ; AVX-NEXT: vandps %xmm2, %xmm0, %xmm0
272 ; AVX-NEXT: vandnps %xmm1, %xmm2, %xmm1
273 ; AVX-NEXT: vorps %xmm1, %xmm0, %xmm0
276 ; AVX512F-LABEL: bitselect_v2i64_broadcast_rrm:
278 ; AVX512F-NEXT: vmovddup {{.*#+}} xmm2 = mem[0,0]
279 ; AVX512F-NEXT: vandps %xmm2, %xmm0, %xmm0
280 ; AVX512F-NEXT: vandnps %xmm1, %xmm2, %xmm1
281 ; AVX512F-NEXT: vorps %xmm1, %xmm0, %xmm0
284 ; AVX512VL-LABEL: bitselect_v2i64_broadcast_rrm:
286 ; AVX512VL-NEXT: vpternlogq $228, (%rdi){1to2}, %xmm1, %xmm0
287 ; AVX512VL-NEXT: retq
288 %a2 = load i64, ptr %p2
289 %1 = insertelement <2 x i64> undef, i64 %a2, i32 0
290 %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <2 x i32> zeroinitializer
291 %3 = xor <2 x i64> %1, <i64 -1, i64 undef>
292 %4 = shufflevector <2 x i64> %3, <2 x i64> undef, <2 x i32> zeroinitializer
293 %5 = and <2 x i64> %a0, %2
294 %6 = and <2 x i64> %a1, %4
295 %7 = or <2 x i64> %5, %6
303 define <4 x i64> @bitselect_v4i64_rr(<4 x i64>, <4 x i64>) {
304 ; SSE-LABEL: bitselect_v4i64_rr:
306 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
307 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
308 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
309 ; SSE-NEXT: orps %xmm3, %xmm1
310 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
311 ; SSE-NEXT: orps %xmm2, %xmm0
314 ; XOP-LABEL: bitselect_v4i64_rr:
316 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm1, %ymm0
319 ; AVX-LABEL: bitselect_v4i64_rr:
321 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
322 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
323 ; AVX-NEXT: vorps %ymm0, %ymm1, %ymm0
326 ; AVX512F-LABEL: bitselect_v4i64_rr:
328 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
329 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
330 ; AVX512F-NEXT: vmovdqa {{.*#+}} ymm2 = [18446744069414584319,18446744060824649725,18446744060824649725,18446744060824649725]
331 ; AVX512F-NEXT: vpternlogq $216, %zmm2, %zmm1, %zmm0
332 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
335 ; AVX512VL-LABEL: bitselect_v4i64_rr:
337 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm0
338 ; AVX512VL-NEXT: retq
339 %3 = and <4 x i64> %0, <i64 4294967296, i64 12884901890, i64 12884901890, i64 12884901890>
340 %4 = and <4 x i64> %1, <i64 -4294967297, i64 -12884901891, i64 -12884901891, i64 -12884901891>
341 %5 = or <4 x i64> %4, %3
345 define <4 x i64> @bitselect_v4i64_rm(<4 x i64>, ptr nocapture readonly) {
346 ; SSE-LABEL: bitselect_v4i64_rm:
348 ; SSE-NEXT: movaps {{.*#+}} xmm2 = [18446744065119617022,18446744073709551612]
349 ; SSE-NEXT: movaps 16(%rdi), %xmm4
350 ; SSE-NEXT: andps %xmm2, %xmm4
351 ; SSE-NEXT: movaps (%rdi), %xmm5
352 ; SSE-NEXT: andps %xmm2, %xmm5
353 ; SSE-NEXT: movaps %xmm2, %xmm3
354 ; SSE-NEXT: andnps %xmm0, %xmm3
355 ; SSE-NEXT: orps %xmm5, %xmm3
356 ; SSE-NEXT: andnps %xmm1, %xmm2
357 ; SSE-NEXT: orps %xmm4, %xmm2
358 ; SSE-NEXT: movaps %xmm3, %xmm0
359 ; SSE-NEXT: movaps %xmm2, %xmm1
362 ; XOP-LABEL: bitselect_v4i64_rm:
364 ; XOP-NEXT: vmovdqa (%rdi), %ymm1
365 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm1, %ymm0
368 ; AVX-LABEL: bitselect_v4i64_rm:
370 ; AVX-NEXT: vmovaps (%rdi), %ymm1
371 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
372 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
373 ; AVX-NEXT: vorps %ymm0, %ymm1, %ymm0
376 ; AVX512F-LABEL: bitselect_v4i64_rm:
378 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
379 ; AVX512F-NEXT: vmovdqa (%rdi), %ymm1
380 ; AVX512F-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [18446744065119617022,18446744073709551612,18446744065119617022,18446744073709551612]
381 ; AVX512F-NEXT: # ymm2 = mem[0,1,0,1]
382 ; AVX512F-NEXT: vpternlogq $184, %zmm1, %zmm2, %zmm0
383 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
386 ; AVX512VL-LABEL: bitselect_v4i64_rm:
388 ; AVX512VL-NEXT: vmovdqa (%rdi), %ymm1
389 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm0
390 ; AVX512VL-NEXT: retq
391 %3 = load <4 x i64>, ptr %1
392 %4 = and <4 x i64> %0, <i64 8589934593, i64 3, i64 8589934593, i64 3>
393 %5 = and <4 x i64> %3, <i64 -8589934594, i64 -4, i64 -8589934594, i64 -4>
394 %6 = or <4 x i64> %5, %4
398 define <4 x i64> @bitselect_v4i64_mr(ptr nocapture readonly, <4 x i64>) {
399 ; SSE-LABEL: bitselect_v4i64_mr:
401 ; SSE-NEXT: movaps {{.*#+}} xmm2 = [12884901890,4294967296]
402 ; SSE-NEXT: movaps 16(%rdi), %xmm4
403 ; SSE-NEXT: andps %xmm2, %xmm4
404 ; SSE-NEXT: movaps (%rdi), %xmm5
405 ; SSE-NEXT: andps %xmm2, %xmm5
406 ; SSE-NEXT: movaps %xmm2, %xmm3
407 ; SSE-NEXT: andnps %xmm0, %xmm3
408 ; SSE-NEXT: orps %xmm5, %xmm3
409 ; SSE-NEXT: andnps %xmm1, %xmm2
410 ; SSE-NEXT: orps %xmm4, %xmm2
411 ; SSE-NEXT: movaps %xmm3, %xmm0
412 ; SSE-NEXT: movaps %xmm2, %xmm1
415 ; XOP-LABEL: bitselect_v4i64_mr:
417 ; XOP-NEXT: vmovdqa (%rdi), %ymm1
418 ; XOP-NEXT: vpcmov {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm1, %ymm0
421 ; AVX-LABEL: bitselect_v4i64_mr:
423 ; AVX-NEXT: vmovaps (%rdi), %ymm1
424 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
425 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
426 ; AVX-NEXT: vorps %ymm0, %ymm1, %ymm0
429 ; AVX512F-LABEL: bitselect_v4i64_mr:
431 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
432 ; AVX512F-NEXT: vmovdqa (%rdi), %ymm1
433 ; AVX512F-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [12884901890,4294967296,12884901890,4294967296]
434 ; AVX512F-NEXT: # ymm2 = mem[0,1,0,1]
435 ; AVX512F-NEXT: vpternlogq $184, %zmm1, %zmm2, %zmm0
436 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
439 ; AVX512VL-LABEL: bitselect_v4i64_mr:
441 ; AVX512VL-NEXT: vmovdqa (%rdi), %ymm1
442 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm0
443 ; AVX512VL-NEXT: retq
444 %3 = load <4 x i64>, ptr %0
445 %4 = and <4 x i64> %3, <i64 12884901890, i64 4294967296, i64 12884901890, i64 4294967296>
446 %5 = and <4 x i64> %1, <i64 -12884901891, i64 -4294967297, i64 -12884901891, i64 -4294967297>
447 %6 = or <4 x i64> %4, %5
451 define <4 x i64> @bitselect_v4i64_mm(ptr nocapture readonly, ptr nocapture readonly) {
452 ; SSE-LABEL: bitselect_v4i64_mm:
454 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [18446744073709551612,18446744065119617022]
455 ; SSE-NEXT: movaps 16(%rsi), %xmm2
456 ; SSE-NEXT: andps %xmm1, %xmm2
457 ; SSE-NEXT: movaps (%rsi), %xmm3
458 ; SSE-NEXT: andps %xmm1, %xmm3
459 ; SSE-NEXT: movaps %xmm1, %xmm0
460 ; SSE-NEXT: andnps (%rdi), %xmm0
461 ; SSE-NEXT: orps %xmm3, %xmm0
462 ; SSE-NEXT: andnps 16(%rdi), %xmm1
463 ; SSE-NEXT: orps %xmm2, %xmm1
466 ; XOP-LABEL: bitselect_v4i64_mm:
468 ; XOP-NEXT: vmovdqa (%rsi), %ymm0
469 ; XOP-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
470 ; XOP-NEXT: # ymm1 = mem[0,1,0,1]
471 ; XOP-NEXT: vpcmov %ymm1, (%rdi), %ymm0, %ymm0
474 ; AVX-LABEL: bitselect_v4i64_mm:
476 ; AVX-NEXT: vmovaps (%rdi), %ymm0
477 ; AVX-NEXT: vmovaps (%rsi), %ymm1
478 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
479 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
480 ; AVX-NEXT: vorps %ymm0, %ymm1, %ymm0
483 ; AVX512F-LABEL: bitselect_v4i64_mm:
485 ; AVX512F-NEXT: vmovdqa (%rdi), %ymm1
486 ; AVX512F-NEXT: vmovdqa (%rsi), %ymm0
487 ; AVX512F-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
488 ; AVX512F-NEXT: # ymm2 = mem[0,1,0,1]
489 ; AVX512F-NEXT: vpternlogq $226, %zmm1, %zmm2, %zmm0
490 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
493 ; AVX512VL-LABEL: bitselect_v4i64_mm:
495 ; AVX512VL-NEXT: vmovdqa (%rsi), %ymm1
496 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm0 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
497 ; AVX512VL-NEXT: # ymm0 = mem[0,1,0,1]
498 ; AVX512VL-NEXT: vpternlogq $202, (%rdi), %ymm1, %ymm0
499 ; AVX512VL-NEXT: retq
500 %3 = load <4 x i64>, ptr %0
501 %4 = load <4 x i64>, ptr %1
502 %5 = and <4 x i64> %3, <i64 3, i64 8589934593, i64 3, i64 8589934593>
503 %6 = and <4 x i64> %4, <i64 -4, i64 -8589934594, i64 -4, i64 -8589934594>
504 %7 = or <4 x i64> %6, %5
508 define <4 x i64> @bitselect_v4i64_broadcast_rrr(<4 x i64> %a0, <4 x i64> %a1, i64 %a2) {
509 ; SSE-LABEL: bitselect_v4i64_broadcast_rrr:
511 ; SSE-NEXT: movq %rdi, %xmm4
512 ; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm4[0,1,0,1]
513 ; SSE-NEXT: pand %xmm4, %xmm1
514 ; SSE-NEXT: pand %xmm4, %xmm0
515 ; SSE-NEXT: movdqa %xmm4, %xmm5
516 ; SSE-NEXT: pandn %xmm3, %xmm5
517 ; SSE-NEXT: por %xmm5, %xmm1
518 ; SSE-NEXT: pandn %xmm2, %xmm4
519 ; SSE-NEXT: por %xmm4, %xmm0
522 ; XOP-LABEL: bitselect_v4i64_broadcast_rrr:
524 ; XOP-NEXT: vmovq %rdi, %xmm2
525 ; XOP-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
526 ; XOP-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2
527 ; XOP-NEXT: vpcmov %ymm2, %ymm1, %ymm0, %ymm0
530 ; AVX1-LABEL: bitselect_v4i64_broadcast_rrr:
532 ; AVX1-NEXT: vmovq %rdi, %xmm2
533 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
534 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2
535 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
536 ; AVX1-NEXT: vandnps %ymm1, %ymm2, %ymm1
537 ; AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
540 ; AVX2-LABEL: bitselect_v4i64_broadcast_rrr:
542 ; AVX2-NEXT: vmovq %rdi, %xmm2
543 ; AVX2-NEXT: vpbroadcastq %xmm2, %ymm2
544 ; AVX2-NEXT: vpand %ymm2, %ymm0, %ymm0
545 ; AVX2-NEXT: vpandn %ymm1, %ymm2, %ymm1
546 ; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0
549 ; AVX512F-LABEL: bitselect_v4i64_broadcast_rrr:
551 ; AVX512F-NEXT: vmovq %rdi, %xmm2
552 ; AVX512F-NEXT: vpbroadcastq %xmm2, %ymm2
553 ; AVX512F-NEXT: vpand %ymm2, %ymm0, %ymm0
554 ; AVX512F-NEXT: vpandn %ymm1, %ymm2, %ymm1
555 ; AVX512F-NEXT: vpor %ymm1, %ymm0, %ymm0
558 ; AVX512VL-LABEL: bitselect_v4i64_broadcast_rrr:
560 ; AVX512VL-NEXT: vpbroadcastq %rdi, %ymm2
561 ; AVX512VL-NEXT: vpternlogq $226, %ymm1, %ymm2, %ymm0
562 ; AVX512VL-NEXT: retq
563 %1 = insertelement <4 x i64> undef, i64 %a2, i32 0
564 %2 = shufflevector <4 x i64> %1, <4 x i64> undef, <4 x i32> zeroinitializer
565 %3 = xor <4 x i64> %1, <i64 -1, i64 undef, i64 undef, i64 undef>
566 %4 = shufflevector <4 x i64> %3, <4 x i64> undef, <4 x i32> zeroinitializer
567 %5 = and <4 x i64> %a0, %2
568 %6 = and <4 x i64> %a1, %4
569 %7 = or <4 x i64> %5, %6
573 define <4 x i64> @bitselect_v4i64_broadcast_rrm(<4 x i64> %a0, <4 x i64> %a1, ptr %p2) {
574 ; SSE-LABEL: bitselect_v4i64_broadcast_rrm:
576 ; SSE-NEXT: movq {{.*#+}} xmm4 = mem[0],zero
577 ; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm4[0,1,0,1]
578 ; SSE-NEXT: pand %xmm4, %xmm1
579 ; SSE-NEXT: pand %xmm4, %xmm0
580 ; SSE-NEXT: movdqa %xmm4, %xmm5
581 ; SSE-NEXT: pandn %xmm3, %xmm5
582 ; SSE-NEXT: por %xmm5, %xmm1
583 ; SSE-NEXT: pandn %xmm2, %xmm4
584 ; SSE-NEXT: por %xmm4, %xmm0
587 ; XOP-LABEL: bitselect_v4i64_broadcast_rrm:
589 ; XOP-NEXT: vbroadcastsd (%rdi), %ymm2
590 ; XOP-NEXT: vpcmov %ymm2, %ymm1, %ymm0, %ymm0
593 ; AVX-LABEL: bitselect_v4i64_broadcast_rrm:
595 ; AVX-NEXT: vbroadcastsd (%rdi), %ymm2
596 ; AVX-NEXT: vandps %ymm2, %ymm0, %ymm0
597 ; AVX-NEXT: vandnps %ymm1, %ymm2, %ymm1
598 ; AVX-NEXT: vorps %ymm1, %ymm0, %ymm0
601 ; AVX512F-LABEL: bitselect_v4i64_broadcast_rrm:
603 ; AVX512F-NEXT: vbroadcastsd (%rdi), %ymm2
604 ; AVX512F-NEXT: vandps %ymm2, %ymm0, %ymm0
605 ; AVX512F-NEXT: vandnps %ymm1, %ymm2, %ymm1
606 ; AVX512F-NEXT: vorps %ymm1, %ymm0, %ymm0
609 ; AVX512VL-LABEL: bitselect_v4i64_broadcast_rrm:
611 ; AVX512VL-NEXT: vpternlogq $228, (%rdi){1to4}, %ymm1, %ymm0
612 ; AVX512VL-NEXT: retq
613 %a2 = load i64, ptr %p2
614 %1 = insertelement <4 x i64> undef, i64 %a2, i32 0
615 %2 = shufflevector <4 x i64> %1, <4 x i64> undef, <4 x i32> zeroinitializer
616 %3 = xor <4 x i64> %1, <i64 -1, i64 undef, i64 undef, i64 undef>
617 %4 = shufflevector <4 x i64> %3, <4 x i64> undef, <4 x i32> zeroinitializer
618 %5 = and <4 x i64> %a0, %2
619 %6 = and <4 x i64> %a1, %4
620 %7 = or <4 x i64> %5, %6
628 define <8 x i64> @bitselect_v8i64_rr(<8 x i64>, <8 x i64>) {
629 ; SSE-LABEL: bitselect_v8i64_rr:
631 ; SSE-NEXT: movaps {{.*#+}} xmm8 = [18446744060824649725,18446744060824649725]
632 ; SSE-NEXT: andps %xmm8, %xmm7
633 ; SSE-NEXT: movaps {{.*#+}} xmm9 = [18446744069414584319,18446744060824649725]
634 ; SSE-NEXT: andps %xmm9, %xmm6
635 ; SSE-NEXT: andps %xmm8, %xmm5
636 ; SSE-NEXT: andps %xmm9, %xmm4
637 ; SSE-NEXT: movaps %xmm9, %xmm10
638 ; SSE-NEXT: andnps %xmm0, %xmm10
639 ; SSE-NEXT: orps %xmm4, %xmm10
640 ; SSE-NEXT: movaps %xmm8, %xmm4
641 ; SSE-NEXT: andnps %xmm1, %xmm4
642 ; SSE-NEXT: orps %xmm5, %xmm4
643 ; SSE-NEXT: andnps %xmm2, %xmm9
644 ; SSE-NEXT: orps %xmm6, %xmm9
645 ; SSE-NEXT: andnps %xmm3, %xmm8
646 ; SSE-NEXT: orps %xmm7, %xmm8
647 ; SSE-NEXT: movaps %xmm10, %xmm0
648 ; SSE-NEXT: movaps %xmm4, %xmm1
649 ; SSE-NEXT: movaps %xmm9, %xmm2
650 ; SSE-NEXT: movaps %xmm8, %xmm3
653 ; XOP-LABEL: bitselect_v8i64_rr:
655 ; XOP-NEXT: vmovdqa {{.*#+}} ymm4 = [18446744069414584319,18446744060824649725,18446744060824649725,18446744060824649725]
656 ; XOP-NEXT: vpcmov %ymm4, %ymm0, %ymm2, %ymm0
657 ; XOP-NEXT: vpcmov %ymm4, %ymm1, %ymm3, %ymm1
660 ; AVX-LABEL: bitselect_v8i64_rr:
662 ; AVX-NEXT: vmovaps {{.*#+}} ymm4 = [18446744069414584319,18446744060824649725,18446744060824649725,18446744060824649725]
663 ; AVX-NEXT: vandps %ymm4, %ymm3, %ymm3
664 ; AVX-NEXT: vandps %ymm4, %ymm2, %ymm2
665 ; AVX-NEXT: vandnps %ymm0, %ymm4, %ymm0
666 ; AVX-NEXT: vorps %ymm0, %ymm2, %ymm0
667 ; AVX-NEXT: vandnps %ymm1, %ymm4, %ymm1
668 ; AVX-NEXT: vorps %ymm1, %ymm3, %ymm1
671 ; AVX512-LABEL: bitselect_v8i64_rr:
673 ; AVX512-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %zmm1, %zmm0
675 %3 = and <8 x i64> %0, <i64 4294967296, i64 12884901890, i64 12884901890, i64 12884901890, i64 4294967296, i64 12884901890, i64 12884901890, i64 12884901890>
676 %4 = and <8 x i64> %1, <i64 -4294967297, i64 -12884901891, i64 -12884901891, i64 -12884901891, i64 -4294967297, i64 -12884901891, i64 -12884901891, i64 -12884901891>
677 %5 = or <8 x i64> %4, %3
681 define <8 x i64> @bitselect_v8i64_rm(<8 x i64>, ptr nocapture readonly) {
682 ; SSE-LABEL: bitselect_v8i64_rm:
684 ; SSE-NEXT: movaps {{.*#+}} xmm4 = [18446744065119617022,18446744073709551612]
685 ; SSE-NEXT: movaps 48(%rdi), %xmm8
686 ; SSE-NEXT: andps %xmm4, %xmm8
687 ; SSE-NEXT: movaps 32(%rdi), %xmm9
688 ; SSE-NEXT: andps %xmm4, %xmm9
689 ; SSE-NEXT: movaps 16(%rdi), %xmm7
690 ; SSE-NEXT: andps %xmm4, %xmm7
691 ; SSE-NEXT: movaps (%rdi), %xmm6
692 ; SSE-NEXT: andps %xmm4, %xmm6
693 ; SSE-NEXT: movaps %xmm4, %xmm5
694 ; SSE-NEXT: andnps %xmm0, %xmm5
695 ; SSE-NEXT: orps %xmm6, %xmm5
696 ; SSE-NEXT: movaps %xmm4, %xmm6
697 ; SSE-NEXT: andnps %xmm1, %xmm6
698 ; SSE-NEXT: orps %xmm7, %xmm6
699 ; SSE-NEXT: movaps %xmm4, %xmm7
700 ; SSE-NEXT: andnps %xmm2, %xmm7
701 ; SSE-NEXT: orps %xmm9, %xmm7
702 ; SSE-NEXT: andnps %xmm3, %xmm4
703 ; SSE-NEXT: orps %xmm8, %xmm4
704 ; SSE-NEXT: movaps %xmm5, %xmm0
705 ; SSE-NEXT: movaps %xmm6, %xmm1
706 ; SSE-NEXT: movaps %xmm7, %xmm2
707 ; SSE-NEXT: movaps %xmm4, %xmm3
710 ; XOP-LABEL: bitselect_v8i64_rm:
712 ; XOP-NEXT: vmovdqa (%rdi), %ymm2
713 ; XOP-NEXT: vmovdqa 32(%rdi), %ymm3
714 ; XOP-NEXT: vbroadcastf128 {{.*#+}} ymm4 = [18446744065119617022,18446744073709551612,18446744065119617022,18446744073709551612]
715 ; XOP-NEXT: # ymm4 = mem[0,1,0,1]
716 ; XOP-NEXT: vpcmov %ymm4, %ymm0, %ymm2, %ymm0
717 ; XOP-NEXT: vpcmov %ymm4, %ymm1, %ymm3, %ymm1
720 ; AVX-LABEL: bitselect_v8i64_rm:
722 ; AVX-NEXT: vbroadcastf128 {{.*#+}} ymm2 = [18446744065119617022,18446744073709551612,18446744065119617022,18446744073709551612]
723 ; AVX-NEXT: # ymm2 = mem[0,1,0,1]
724 ; AVX-NEXT: vandps 32(%rdi), %ymm2, %ymm3
725 ; AVX-NEXT: vandps (%rdi), %ymm2, %ymm4
726 ; AVX-NEXT: vandnps %ymm0, %ymm2, %ymm0
727 ; AVX-NEXT: vorps %ymm0, %ymm4, %ymm0
728 ; AVX-NEXT: vandnps %ymm1, %ymm2, %ymm1
729 ; AVX-NEXT: vorps %ymm1, %ymm3, %ymm1
732 ; AVX512-LABEL: bitselect_v8i64_rm:
734 ; AVX512-NEXT: vmovdqa64 (%rdi), %zmm1
735 ; AVX512-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %zmm1, %zmm0
737 %3 = load <8 x i64>, ptr %1
738 %4 = and <8 x i64> %0, <i64 8589934593, i64 3, i64 8589934593, i64 3, i64 8589934593, i64 3, i64 8589934593, i64 3>
739 %5 = and <8 x i64> %3, <i64 -8589934594, i64 -4, i64 -8589934594, i64 -4, i64 -8589934594, i64 -4, i64 -8589934594, i64 -4>
740 %6 = or <8 x i64> %5, %4
744 define <8 x i64> @bitselect_v8i64_mr(ptr nocapture readonly, <8 x i64>) {
745 ; SSE-LABEL: bitselect_v8i64_mr:
747 ; SSE-NEXT: movaps {{.*#+}} xmm4 = [12884901890,4294967296]
748 ; SSE-NEXT: movaps 48(%rdi), %xmm8
749 ; SSE-NEXT: andps %xmm4, %xmm8
750 ; SSE-NEXT: movaps 32(%rdi), %xmm9
751 ; SSE-NEXT: andps %xmm4, %xmm9
752 ; SSE-NEXT: movaps 16(%rdi), %xmm7
753 ; SSE-NEXT: andps %xmm4, %xmm7
754 ; SSE-NEXT: movaps (%rdi), %xmm6
755 ; SSE-NEXT: andps %xmm4, %xmm6
756 ; SSE-NEXT: movaps %xmm4, %xmm5
757 ; SSE-NEXT: andnps %xmm0, %xmm5
758 ; SSE-NEXT: orps %xmm6, %xmm5
759 ; SSE-NEXT: movaps %xmm4, %xmm6
760 ; SSE-NEXT: andnps %xmm1, %xmm6
761 ; SSE-NEXT: orps %xmm7, %xmm6
762 ; SSE-NEXT: movaps %xmm4, %xmm7
763 ; SSE-NEXT: andnps %xmm2, %xmm7
764 ; SSE-NEXT: orps %xmm9, %xmm7
765 ; SSE-NEXT: andnps %xmm3, %xmm4
766 ; SSE-NEXT: orps %xmm8, %xmm4
767 ; SSE-NEXT: movaps %xmm5, %xmm0
768 ; SSE-NEXT: movaps %xmm6, %xmm1
769 ; SSE-NEXT: movaps %xmm7, %xmm2
770 ; SSE-NEXT: movaps %xmm4, %xmm3
773 ; XOP-LABEL: bitselect_v8i64_mr:
775 ; XOP-NEXT: vmovdqa (%rdi), %ymm2
776 ; XOP-NEXT: vmovdqa 32(%rdi), %ymm3
777 ; XOP-NEXT: vbroadcastf128 {{.*#+}} ymm4 = [12884901890,4294967296,12884901890,4294967296]
778 ; XOP-NEXT: # ymm4 = mem[0,1,0,1]
779 ; XOP-NEXT: vpcmov %ymm4, %ymm0, %ymm2, %ymm0
780 ; XOP-NEXT: vpcmov %ymm4, %ymm1, %ymm3, %ymm1
783 ; AVX-LABEL: bitselect_v8i64_mr:
785 ; AVX-NEXT: vbroadcastf128 {{.*#+}} ymm2 = [12884901890,4294967296,12884901890,4294967296]
786 ; AVX-NEXT: # ymm2 = mem[0,1,0,1]
787 ; AVX-NEXT: vandps 32(%rdi), %ymm2, %ymm3
788 ; AVX-NEXT: vandps (%rdi), %ymm2, %ymm4
789 ; AVX-NEXT: vandnps %ymm0, %ymm2, %ymm0
790 ; AVX-NEXT: vorps %ymm0, %ymm4, %ymm0
791 ; AVX-NEXT: vandnps %ymm1, %ymm2, %ymm1
792 ; AVX-NEXT: vorps %ymm1, %ymm3, %ymm1
795 ; AVX512-LABEL: bitselect_v8i64_mr:
797 ; AVX512-NEXT: vmovdqa64 (%rdi), %zmm1
798 ; AVX512-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %zmm1, %zmm0
800 %3 = load <8 x i64>, ptr %0
801 %4 = and <8 x i64> %3, <i64 12884901890, i64 4294967296, i64 12884901890, i64 4294967296, i64 12884901890, i64 4294967296, i64 12884901890, i64 4294967296>
802 %5 = and <8 x i64> %1, <i64 -12884901891, i64 -4294967297, i64 -12884901891, i64 -4294967297, i64 -12884901891, i64 -4294967297, i64 -12884901891, i64 -4294967297>
803 %6 = or <8 x i64> %4, %5
807 define <8 x i64> @bitselect_v8i64_mm(ptr nocapture readonly, ptr nocapture readonly) {
808 ; SSE-LABEL: bitselect_v8i64_mm:
810 ; SSE-NEXT: movaps {{.*#+}} xmm3 = [18446744073709551612,18446744065119617022]
811 ; SSE-NEXT: movaps 48(%rsi), %xmm4
812 ; SSE-NEXT: andps %xmm3, %xmm4
813 ; SSE-NEXT: movaps 32(%rsi), %xmm5
814 ; SSE-NEXT: andps %xmm3, %xmm5
815 ; SSE-NEXT: movaps 16(%rsi), %xmm2
816 ; SSE-NEXT: andps %xmm3, %xmm2
817 ; SSE-NEXT: movaps (%rsi), %xmm1
818 ; SSE-NEXT: andps %xmm3, %xmm1
819 ; SSE-NEXT: movaps %xmm3, %xmm0
820 ; SSE-NEXT: andnps (%rdi), %xmm0
821 ; SSE-NEXT: orps %xmm1, %xmm0
822 ; SSE-NEXT: movaps %xmm3, %xmm1
823 ; SSE-NEXT: andnps 16(%rdi), %xmm1
824 ; SSE-NEXT: orps %xmm2, %xmm1
825 ; SSE-NEXT: movaps %xmm3, %xmm2
826 ; SSE-NEXT: andnps 32(%rdi), %xmm2
827 ; SSE-NEXT: orps %xmm5, %xmm2
828 ; SSE-NEXT: andnps 48(%rdi), %xmm3
829 ; SSE-NEXT: orps %xmm4, %xmm3
832 ; XOP-LABEL: bitselect_v8i64_mm:
834 ; XOP-NEXT: vmovdqa (%rsi), %ymm0
835 ; XOP-NEXT: vmovdqa 32(%rsi), %ymm1
836 ; XOP-NEXT: vbroadcastf128 {{.*#+}} ymm2 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
837 ; XOP-NEXT: # ymm2 = mem[0,1,0,1]
838 ; XOP-NEXT: vpcmov %ymm2, (%rdi), %ymm0, %ymm0
839 ; XOP-NEXT: vpcmov %ymm2, 32(%rdi), %ymm1, %ymm1
842 ; AVX-LABEL: bitselect_v8i64_mm:
844 ; AVX-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
845 ; AVX-NEXT: # ymm1 = mem[0,1,0,1]
846 ; AVX-NEXT: vandps 32(%rsi), %ymm1, %ymm2
847 ; AVX-NEXT: vandps (%rsi), %ymm1, %ymm0
848 ; AVX-NEXT: vandnps (%rdi), %ymm1, %ymm3
849 ; AVX-NEXT: vorps %ymm3, %ymm0, %ymm0
850 ; AVX-NEXT: vandnps 32(%rdi), %ymm1, %ymm1
851 ; AVX-NEXT: vorps %ymm1, %ymm2, %ymm1
854 ; AVX512-LABEL: bitselect_v8i64_mm:
856 ; AVX512-NEXT: vmovdqa64 (%rsi), %zmm1
857 ; AVX512-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 = [18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022,18446744073709551612,18446744065119617022]
858 ; AVX512-NEXT: # zmm0 = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
859 ; AVX512-NEXT: vpternlogq $202, (%rdi), %zmm1, %zmm0
861 %3 = load <8 x i64>, ptr %0
862 %4 = load <8 x i64>, ptr %1
863 %5 = and <8 x i64> %3, <i64 3, i64 8589934593, i64 3, i64 8589934593, i64 3, i64 8589934593, i64 3, i64 8589934593>
864 %6 = and <8 x i64> %4, <i64 -4, i64 -8589934594, i64 -4, i64 -8589934594, i64 -4, i64 -8589934594, i64 -4, i64 -8589934594>
865 %7 = or <8 x i64> %6, %5
869 define <8 x i64> @bitselect_v8i64_broadcast_rrr(<8 x i64> %a0, <8 x i64> %a1, i64 %a2) {
870 ; SSE-LABEL: bitselect_v8i64_broadcast_rrr:
872 ; SSE-NEXT: movq %rdi, %xmm8
873 ; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm8[0,1,0,1]
874 ; SSE-NEXT: pand %xmm8, %xmm3
875 ; SSE-NEXT: pand %xmm8, %xmm2
876 ; SSE-NEXT: pand %xmm8, %xmm1
877 ; SSE-NEXT: pand %xmm8, %xmm0
878 ; SSE-NEXT: movdqa %xmm8, %xmm9
879 ; SSE-NEXT: pandn %xmm7, %xmm9
880 ; SSE-NEXT: por %xmm9, %xmm3
881 ; SSE-NEXT: movdqa %xmm8, %xmm7
882 ; SSE-NEXT: pandn %xmm6, %xmm7
883 ; SSE-NEXT: por %xmm7, %xmm2
884 ; SSE-NEXT: movdqa %xmm8, %xmm6
885 ; SSE-NEXT: pandn %xmm5, %xmm6
886 ; SSE-NEXT: por %xmm6, %xmm1
887 ; SSE-NEXT: pandn %xmm4, %xmm8
888 ; SSE-NEXT: por %xmm8, %xmm0
891 ; XOP-LABEL: bitselect_v8i64_broadcast_rrr:
893 ; XOP-NEXT: vmovq %rdi, %xmm4
894 ; XOP-NEXT: vpshufd {{.*#+}} xmm4 = xmm4[0,1,0,1]
895 ; XOP-NEXT: vinsertf128 $1, %xmm4, %ymm4, %ymm4
896 ; XOP-NEXT: vpcmov %ymm4, %ymm2, %ymm0, %ymm0
897 ; XOP-NEXT: vpcmov %ymm4, %ymm3, %ymm1, %ymm1
900 ; AVX1-LABEL: bitselect_v8i64_broadcast_rrr:
902 ; AVX1-NEXT: vmovq %rdi, %xmm4
903 ; AVX1-NEXT: vpshufd {{.*#+}} xmm4 = xmm4[0,1,0,1]
904 ; AVX1-NEXT: vinsertf128 $1, %xmm4, %ymm4, %ymm4
905 ; AVX1-NEXT: vandps %ymm4, %ymm1, %ymm1
906 ; AVX1-NEXT: vandps %ymm4, %ymm0, %ymm0
907 ; AVX1-NEXT: vandnps %ymm3, %ymm4, %ymm3
908 ; AVX1-NEXT: vorps %ymm3, %ymm1, %ymm1
909 ; AVX1-NEXT: vandnps %ymm2, %ymm4, %ymm2
910 ; AVX1-NEXT: vorps %ymm2, %ymm0, %ymm0
913 ; AVX2-LABEL: bitselect_v8i64_broadcast_rrr:
915 ; AVX2-NEXT: vmovq %rdi, %xmm4
916 ; AVX2-NEXT: vpbroadcastq %xmm4, %ymm4
917 ; AVX2-NEXT: vpand %ymm4, %ymm1, %ymm1
918 ; AVX2-NEXT: vpand %ymm4, %ymm0, %ymm0
919 ; AVX2-NEXT: vpandn %ymm3, %ymm4, %ymm3
920 ; AVX2-NEXT: vpor %ymm3, %ymm1, %ymm1
921 ; AVX2-NEXT: vpandn %ymm2, %ymm4, %ymm2
922 ; AVX2-NEXT: vpor %ymm2, %ymm0, %ymm0
925 ; AVX512-LABEL: bitselect_v8i64_broadcast_rrr:
927 ; AVX512-NEXT: vpbroadcastq %rdi, %zmm2
928 ; AVX512-NEXT: vpternlogq $226, %zmm1, %zmm2, %zmm0
930 %1 = insertelement <8 x i64> undef, i64 %a2, i32 0
931 %2 = shufflevector <8 x i64> %1, <8 x i64> undef, <8 x i32> zeroinitializer
932 %3 = xor <8 x i64> %1, <i64 -1, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef>
933 %4 = shufflevector <8 x i64> %3, <8 x i64> undef, <8 x i32> zeroinitializer
934 %5 = and <8 x i64> %a0, %2
935 %6 = and <8 x i64> %a1, %4
936 %7 = or <8 x i64> %5, %6
940 define <8 x i64> @bitselect_v8i64_broadcast_rrm(<8 x i64> %a0, <8 x i64> %a1, ptr %p2) {
941 ; SSE-LABEL: bitselect_v8i64_broadcast_rrm:
943 ; SSE-NEXT: movq {{.*#+}} xmm8 = mem[0],zero
944 ; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm8[0,1,0,1]
945 ; SSE-NEXT: pand %xmm8, %xmm3
946 ; SSE-NEXT: pand %xmm8, %xmm2
947 ; SSE-NEXT: pand %xmm8, %xmm1
948 ; SSE-NEXT: pand %xmm8, %xmm0
949 ; SSE-NEXT: movdqa %xmm8, %xmm9
950 ; SSE-NEXT: pandn %xmm7, %xmm9
951 ; SSE-NEXT: por %xmm9, %xmm3
952 ; SSE-NEXT: movdqa %xmm8, %xmm7
953 ; SSE-NEXT: pandn %xmm6, %xmm7
954 ; SSE-NEXT: por %xmm7, %xmm2
955 ; SSE-NEXT: movdqa %xmm8, %xmm6
956 ; SSE-NEXT: pandn %xmm5, %xmm6
957 ; SSE-NEXT: por %xmm6, %xmm1
958 ; SSE-NEXT: pandn %xmm4, %xmm8
959 ; SSE-NEXT: por %xmm8, %xmm0
962 ; XOP-LABEL: bitselect_v8i64_broadcast_rrm:
964 ; XOP-NEXT: vbroadcastsd (%rdi), %ymm4
965 ; XOP-NEXT: vpcmov %ymm4, %ymm2, %ymm0, %ymm0
966 ; XOP-NEXT: vpcmov %ymm4, %ymm3, %ymm1, %ymm1
969 ; AVX-LABEL: bitselect_v8i64_broadcast_rrm:
971 ; AVX-NEXT: vbroadcastsd (%rdi), %ymm4
972 ; AVX-NEXT: vandps %ymm4, %ymm1, %ymm1
973 ; AVX-NEXT: vandps %ymm4, %ymm0, %ymm0
974 ; AVX-NEXT: vandnps %ymm3, %ymm4, %ymm3
975 ; AVX-NEXT: vorps %ymm3, %ymm1, %ymm1
976 ; AVX-NEXT: vandnps %ymm2, %ymm4, %ymm2
977 ; AVX-NEXT: vorps %ymm2, %ymm0, %ymm0
980 ; AVX512-LABEL: bitselect_v8i64_broadcast_rrm:
982 ; AVX512-NEXT: vpternlogq $228, (%rdi){1to8}, %zmm1, %zmm0
984 %a2 = load i64, ptr %p2
985 %1 = insertelement <8 x i64> undef, i64 %a2, i32 0
986 %2 = shufflevector <8 x i64> %1, <8 x i64> undef, <8 x i32> zeroinitializer
987 %3 = xor <8 x i64> %1, <i64 -1, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef>
988 %4 = shufflevector <8 x i64> %3, <8 x i64> undef, <8 x i32> zeroinitializer
989 %5 = and <8 x i64> %a0, %2
990 %6 = and <8 x i64> %a1, %4
991 %7 = or <8 x i64> %5, %6
995 ; Check that mask registers don't get canonicalized.
996 define <4 x i1> @bitselect_v4i1_loop(<4 x i32> %a0, <4 x i32> %a1) {
997 ; SSE-LABEL: bitselect_v4i1_loop:
998 ; SSE: # %bb.0: # %bb
999 ; SSE-NEXT: pxor %xmm2, %xmm2
1000 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
1001 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [12,12,12,12]
1002 ; SSE-NEXT: pcmpeqd %xmm1, %xmm2
1003 ; SSE-NEXT: pcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1004 ; SSE-NEXT: pand %xmm0, %xmm1
1005 ; SSE-NEXT: pandn %xmm2, %xmm0
1006 ; SSE-NEXT: por %xmm1, %xmm0
1009 ; XOP-LABEL: bitselect_v4i1_loop:
1010 ; XOP: # %bb.0: # %bb
1011 ; XOP-NEXT: vpxor %xmm2, %xmm2, %xmm2
1012 ; XOP-NEXT: vpcomneqd %xmm2, %xmm0, %xmm0
1013 ; XOP-NEXT: vpcomeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm2
1014 ; XOP-NEXT: vpcomeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1015 ; XOP-NEXT: vblendvps %xmm0, %xmm2, %xmm1, %xmm0
1018 ; AVX1-LABEL: bitselect_v4i1_loop:
1019 ; AVX1: # %bb.0: # %bb
1020 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1021 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1022 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm2
1023 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1024 ; AVX1-NEXT: vblendvps %xmm0, %xmm1, %xmm2, %xmm0
1027 ; AVX2-LABEL: bitselect_v4i1_loop:
1028 ; AVX2: # %bb.0: # %bb
1029 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1030 ; AVX2-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1031 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [12,12,12,12]
1032 ; AVX2-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm2
1033 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm3 = [15,15,15,15]
1034 ; AVX2-NEXT: vpcmpeqd %xmm3, %xmm1, %xmm1
1035 ; AVX2-NEXT: vblendvps %xmm0, %xmm1, %xmm2, %xmm0
1038 ; AVX512F-LABEL: bitselect_v4i1_loop:
1039 ; AVX512F: # %bb.0: # %bb
1040 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1041 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1042 ; AVX512F-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %k1
1043 ; AVX512F-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %k2
1044 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0 {%k2}
1045 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k1 {%k1}
1046 ; AVX512F-NEXT: korw %k0, %k1, %k1
1047 ; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1048 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1049 ; AVX512F-NEXT: vzeroupper
1050 ; AVX512F-NEXT: retq
1052 ; AVX512VL-LABEL: bitselect_v4i1_loop:
1053 ; AVX512VL: # %bb.0: # %bb
1054 ; AVX512VL-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %k1
1055 ; AVX512VL-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %k2
1056 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm0, %k0 {%k2}
1057 ; AVX512VL-NEXT: vptestmd %xmm0, %xmm0, %k1 {%k1}
1058 ; AVX512VL-NEXT: korw %k0, %k1, %k1
1059 ; AVX512VL-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1060 ; AVX512VL-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1061 ; AVX512VL-NEXT: retq
1063 %tmp = icmp ne <4 x i32> %a0, zeroinitializer
1064 %tmp2 = icmp eq <4 x i32> %a1, <i32 12, i32 12, i32 12, i32 12>
1065 %tmp3 = icmp eq <4 x i32> %a1, <i32 15, i32 15, i32 15, i32 15>
1066 %tmp4 = select <4 x i1> %tmp, <4 x i1> %tmp2, <4 x i1> %tmp3
1070 ; Regression reported on 057db2002bb3d79429db3c5fe436c8cefc50cb25
1071 @d = external global <2 x i64>, align 16
1072 define void @constantfold_andn_mask() nounwind {
1073 ; SSE-LABEL: constantfold_andn_mask:
1074 ; SSE: # %bb.0: # %entry
1075 ; SSE-NEXT: pushq %rax
1076 ; SSE-NEXT: callq use@PLT
1077 ; SSE-NEXT: movdqu (%rax), %xmm1
1078 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1079 ; SSE-NEXT: pand %xmm2, %xmm0
1080 ; SSE-NEXT: pavgb %xmm2, %xmm0
1081 ; SSE-NEXT: pandn %xmm1, %xmm0
1082 ; SSE-NEXT: pand %xmm2, %xmm1
1083 ; SSE-NEXT: pandn %xmm0, %xmm2
1084 ; SSE-NEXT: por %xmm1, %xmm2
1085 ; SSE-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1086 ; SSE-NEXT: xorq d@GOTPCREL(%rip), %rax
1087 ; SSE-NEXT: movdqa %xmm2, (%rax)
1088 ; SSE-NEXT: popq %rax
1091 ; XOP-LABEL: constantfold_andn_mask:
1092 ; XOP: # %bb.0: # %entry
1093 ; XOP-NEXT: pushq %rax
1094 ; XOP-NEXT: callq use@PLT
1095 ; XOP-NEXT: vmovdqu (%rax), %xmm1
1096 ; XOP-NEXT: vbroadcastss {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1097 ; XOP-NEXT: vpand %xmm2, %xmm1, %xmm3
1098 ; XOP-NEXT: vpand %xmm2, %xmm0, %xmm0
1099 ; XOP-NEXT: vpavgb %xmm2, %xmm0, %xmm0
1100 ; XOP-NEXT: vpandn %xmm1, %xmm0, %xmm0
1101 ; XOP-NEXT: vpandn %xmm0, %xmm2, %xmm0
1102 ; XOP-NEXT: vpor %xmm0, %xmm3, %xmm0
1103 ; XOP-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1104 ; XOP-NEXT: xorq d@GOTPCREL(%rip), %rax
1105 ; XOP-NEXT: vmovdqa %xmm0, (%rax)
1106 ; XOP-NEXT: popq %rax
1109 ; AVX1-LABEL: constantfold_andn_mask:
1110 ; AVX1: # %bb.0: # %entry
1111 ; AVX1-NEXT: pushq %rax
1112 ; AVX1-NEXT: callq use@PLT
1113 ; AVX1-NEXT: vmovdqu (%rax), %xmm1
1114 ; AVX1-NEXT: vbroadcastss {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1115 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm3
1116 ; AVX1-NEXT: vpand %xmm2, %xmm0, %xmm0
1117 ; AVX1-NEXT: vpavgb %xmm2, %xmm0, %xmm0
1118 ; AVX1-NEXT: vpandn %xmm1, %xmm0, %xmm0
1119 ; AVX1-NEXT: vpandn %xmm0, %xmm2, %xmm0
1120 ; AVX1-NEXT: vpor %xmm0, %xmm3, %xmm0
1121 ; AVX1-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1122 ; AVX1-NEXT: xorq d@GOTPCREL(%rip), %rax
1123 ; AVX1-NEXT: vmovdqa %xmm0, (%rax)
1124 ; AVX1-NEXT: popq %rax
1127 ; AVX2-LABEL: constantfold_andn_mask:
1128 ; AVX2: # %bb.0: # %entry
1129 ; AVX2-NEXT: pushq %rax
1130 ; AVX2-NEXT: callq use@PLT
1131 ; AVX2-NEXT: vmovdqu (%rax), %xmm1
1132 ; AVX2-NEXT: vpbroadcastw {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1133 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm3
1134 ; AVX2-NEXT: vpand %xmm2, %xmm0, %xmm0
1135 ; AVX2-NEXT: vpavgb %xmm2, %xmm0, %xmm0
1136 ; AVX2-NEXT: vpandn %xmm1, %xmm0, %xmm0
1137 ; AVX2-NEXT: vpandn %xmm0, %xmm2, %xmm0
1138 ; AVX2-NEXT: vpor %xmm0, %xmm3, %xmm0
1139 ; AVX2-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1140 ; AVX2-NEXT: xorq d@GOTPCREL(%rip), %rax
1141 ; AVX2-NEXT: vmovdqa %xmm0, (%rax)
1142 ; AVX2-NEXT: popq %rax
1145 ; AVX512F-LABEL: constantfold_andn_mask:
1146 ; AVX512F: # %bb.0: # %entry
1147 ; AVX512F-NEXT: pushq %rax
1148 ; AVX512F-NEXT: callq use@PLT
1149 ; AVX512F-NEXT: vmovdqu (%rax), %xmm1
1150 ; AVX512F-NEXT: vpbroadcastw {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1151 ; AVX512F-NEXT: vpand %xmm2, %xmm0, %xmm0
1152 ; AVX512F-NEXT: vpavgb %xmm2, %xmm0, %xmm0
1153 ; AVX512F-NEXT: vpandn %xmm1, %xmm0, %xmm0
1154 ; AVX512F-NEXT: vpternlogq $184, %zmm1, %zmm2, %zmm0
1155 ; AVX512F-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1156 ; AVX512F-NEXT: xorq d@GOTPCREL(%rip), %rax
1157 ; AVX512F-NEXT: vmovdqa %xmm0, (%rax)
1158 ; AVX512F-NEXT: popq %rax
1159 ; AVX512F-NEXT: vzeroupper
1160 ; AVX512F-NEXT: retq
1162 ; AVX512VL-LABEL: constantfold_andn_mask:
1163 ; AVX512VL: # %bb.0: # %entry
1164 ; AVX512VL-NEXT: pushq %rax
1165 ; AVX512VL-NEXT: callq use@PLT
1166 ; AVX512VL-NEXT: vmovdqu (%rax), %xmm1
1167 ; AVX512VL-NEXT: vpbroadcastw {{.*#+}} xmm2 = [31,248,31,248,31,248,31,248,31,248,31,248,31,248,31,248]
1168 ; AVX512VL-NEXT: vpand %xmm2, %xmm0, %xmm0
1169 ; AVX512VL-NEXT: vpavgb %xmm2, %xmm0, %xmm0
1170 ; AVX512VL-NEXT: vpandn %xmm1, %xmm0, %xmm0
1171 ; AVX512VL-NEXT: vpternlogq $216, %xmm2, %xmm1, %xmm0
1172 ; AVX512VL-NEXT: movabsq $87960930222080, %rax # imm = 0x500000000000
1173 ; AVX512VL-NEXT: xorq d@GOTPCREL(%rip), %rax
1174 ; AVX512VL-NEXT: vmovdqa %xmm0, (%rax)
1175 ; AVX512VL-NEXT: popq %rax
1176 ; AVX512VL-NEXT: retq
1178 %call = call noundef <2 x i64> @use()
1179 %_msret = load <2 x i64>, ptr undef, align 8
1180 %i = bitcast <2 x i64> %_msret to <16 x i8>
1181 %i1 = bitcast <2 x i64> %call to <16 x i8>
1182 %i2 = and <16 x i8> %i, <i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8>
1183 %i3 = and <16 x i8> %i1, <i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8>
1184 %i4 = call <16 x i8> @llvm.x86.sse2.pavg.b(<16 x i8> <i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8, i8 31, i8 -8>, <16 x i8> %i3)
1185 %i5 = bitcast <16 x i8> %i2 to <2 x i64>
1186 %i6 = bitcast <16 x i8> %i4 to <2 x i64>
1187 %i7 = and <2 x i64> %_msret, <i64 567462211834873824, i64 567462211834873824>
1188 %i8 = xor <2 x i64> zeroinitializer, <i64 -1, i64 -1>
1189 %i9 = xor <2 x i64> %i6, <i64 -1, i64 -1>
1190 %i10 = and <2 x i64> %i8, %i5
1191 %i11 = and <2 x i64> %i7, %i9
1192 %i12 = or <2 x i64> zeroinitializer, %i10
1193 %i13 = or <2 x i64> %i12, %i11
1194 store <2 x i64> %i13, ptr inttoptr (i64 xor (i64 ptrtoint (ptr @d to i64), i64 87960930222080) to ptr), align 16
1198 declare <2 x i64> @use()
1199 declare <16 x i8> @llvm.x86.sse2.pavg.b(<16 x i8>, <16 x i8>)