1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64-LIN
4 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64-WIN
6 ; Though it is undefined, we want xor undef,undef to produce zero.
7 define <4 x i32> @test1() nounwind {
10 ; CHECK-NEXT: xorps %xmm0, %xmm0
11 ; CHECK-NEXT: ret{{[l|q]}}
12 %tmp = xor <4 x i32> undef, undef
16 ; Though it is undefined, we want xor undef,undef to produce zero.
17 define i32 @test2() nounwind{
20 ; CHECK-NEXT: xorl %eax, %eax
21 ; CHECK-NEXT: ret{{[l|q]}}
22 %tmp = xor i32 undef, undef
26 define i32 @test3(i32 %a, i32 %b) nounwind {
28 ; X86: # %bb.0: # %entry
29 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
31 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
35 ; X64-LIN-LABEL: test3:
36 ; X64-LIN: # %bb.0: # %entry
37 ; X64-LIN-NEXT: movl %esi, %eax
38 ; X64-LIN-NEXT: notl %eax
39 ; X64-LIN-NEXT: andl %edi, %eax
40 ; X64-LIN-NEXT: shrl %eax
43 ; X64-WIN-LABEL: test3:
44 ; X64-WIN: # %bb.0: # %entry
45 ; X64-WIN-NEXT: movl %edx, %eax
46 ; X64-WIN-NEXT: notl %eax
47 ; X64-WIN-NEXT: andl %ecx, %eax
48 ; X64-WIN-NEXT: shrl %eax
51 %tmp1not = xor i32 %b, -2
52 %tmp3 = and i32 %tmp1not, %a
53 %tmp4 = lshr i32 %tmp3, 1
57 define i32 @test4(i32 %a, i32 %b) nounwind {
59 ; X86: # %bb.0: # %entry
60 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
61 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
62 ; X86-NEXT: .p2align 4, 0x90
63 ; X86-NEXT: .LBB3_1: # %bb
64 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
65 ; X86-NEXT: xorl %ecx, %eax
66 ; X86-NEXT: movl %eax, %edx
68 ; X86-NEXT: andl %ecx, %edx
69 ; X86-NEXT: addl %edx, %edx
70 ; X86-NEXT: movl %edx, %ecx
71 ; X86-NEXT: jne .LBB3_1
72 ; X86-NEXT: # %bb.2: # %bb12
75 ; X64-LIN-LABEL: test4:
76 ; X64-LIN: # %bb.0: # %entry
77 ; X64-LIN-NEXT: movl %edi, %eax
78 ; X64-LIN-NEXT: .p2align 4, 0x90
79 ; X64-LIN-NEXT: .LBB3_1: # %bb
80 ; X64-LIN-NEXT: # =>This Inner Loop Header: Depth=1
81 ; X64-LIN-NEXT: xorl %esi, %eax
82 ; X64-LIN-NEXT: movl %eax, %ecx
83 ; X64-LIN-NEXT: notl %ecx
84 ; X64-LIN-NEXT: andl %esi, %ecx
85 ; X64-LIN-NEXT: addl %ecx, %ecx
86 ; X64-LIN-NEXT: movl %ecx, %esi
87 ; X64-LIN-NEXT: jne .LBB3_1
88 ; X64-LIN-NEXT: # %bb.2: # %bb12
91 ; X64-WIN-LABEL: test4:
92 ; X64-WIN: # %bb.0: # %entry
93 ; X64-WIN-NEXT: movl %ecx, %eax
94 ; X64-WIN-NEXT: .p2align 4, 0x90
95 ; X64-WIN-NEXT: .LBB3_1: # %bb
96 ; X64-WIN-NEXT: # =>This Inner Loop Header: Depth=1
97 ; X64-WIN-NEXT: xorl %edx, %eax
98 ; X64-WIN-NEXT: movl %eax, %ecx
99 ; X64-WIN-NEXT: notl %ecx
100 ; X64-WIN-NEXT: andl %edx, %ecx
101 ; X64-WIN-NEXT: addl %ecx, %ecx
102 ; X64-WIN-NEXT: movl %ecx, %edx
103 ; X64-WIN-NEXT: jne .LBB3_1
104 ; X64-WIN-NEXT: # %bb.2: # %bb12
109 %b_addr.0 = phi i32 [ %b, %entry ], [ %tmp8, %bb ]
110 %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp3, %bb ]
111 %tmp3 = xor i32 %a_addr.0, %b_addr.0
112 %tmp4not = xor i32 %tmp3, 2147483647
113 %tmp6 = and i32 %tmp4not, %b_addr.0
114 %tmp8 = shl i32 %tmp6, 1
115 %tmp10 = icmp eq i32 %tmp8, 0
116 br i1 %tmp10, label %bb12, label %bb
121 define i16 @test5(i16 %a, i16 %b) nounwind {
123 ; X86: # %bb.0: # %entry
124 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
125 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
126 ; X86-NEXT: .p2align 4, 0x90
127 ; X86-NEXT: .LBB4_1: # %bb
128 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
129 ; X86-NEXT: xorl %ecx, %eax
130 ; X86-NEXT: movl %eax, %edx
131 ; X86-NEXT: notl %edx
132 ; X86-NEXT: andl %ecx, %edx
133 ; X86-NEXT: addl %edx, %edx
134 ; X86-NEXT: testw %dx, %dx
135 ; X86-NEXT: movl %edx, %ecx
136 ; X86-NEXT: jne .LBB4_1
137 ; X86-NEXT: # %bb.2: # %bb12
138 ; X86-NEXT: # kill: def $ax killed $ax killed $eax
141 ; X64-LIN-LABEL: test5:
142 ; X64-LIN: # %bb.0: # %entry
143 ; X64-LIN-NEXT: movl %edi, %eax
144 ; X64-LIN-NEXT: .p2align 4, 0x90
145 ; X64-LIN-NEXT: .LBB4_1: # %bb
146 ; X64-LIN-NEXT: # =>This Inner Loop Header: Depth=1
147 ; X64-LIN-NEXT: xorl %esi, %eax
148 ; X64-LIN-NEXT: movl %eax, %ecx
149 ; X64-LIN-NEXT: notl %ecx
150 ; X64-LIN-NEXT: andl %esi, %ecx
151 ; X64-LIN-NEXT: addl %ecx, %ecx
152 ; X64-LIN-NEXT: testw %cx, %cx
153 ; X64-LIN-NEXT: movl %ecx, %esi
154 ; X64-LIN-NEXT: jne .LBB4_1
155 ; X64-LIN-NEXT: # %bb.2: # %bb12
156 ; X64-LIN-NEXT: # kill: def $ax killed $ax killed $eax
159 ; X64-WIN-LABEL: test5:
160 ; X64-WIN: # %bb.0: # %entry
161 ; X64-WIN-NEXT: # kill: def $dx killed $dx def $edx
162 ; X64-WIN-NEXT: movl %ecx, %eax
163 ; X64-WIN-NEXT: .p2align 4, 0x90
164 ; X64-WIN-NEXT: .LBB4_1: # %bb
165 ; X64-WIN-NEXT: # =>This Inner Loop Header: Depth=1
166 ; X64-WIN-NEXT: xorl %edx, %eax
167 ; X64-WIN-NEXT: movl %eax, %ecx
168 ; X64-WIN-NEXT: notl %ecx
169 ; X64-WIN-NEXT: andl %edx, %ecx
170 ; X64-WIN-NEXT: addl %ecx, %ecx
171 ; X64-WIN-NEXT: testw %cx, %cx
172 ; X64-WIN-NEXT: movl %ecx, %edx
173 ; X64-WIN-NEXT: jne .LBB4_1
174 ; X64-WIN-NEXT: # %bb.2: # %bb12
175 ; X64-WIN-NEXT: # kill: def $ax killed $ax killed $eax
180 %b_addr.0 = phi i16 [ %b, %entry ], [ %tmp8, %bb ]
181 %a_addr.0 = phi i16 [ %a, %entry ], [ %tmp3, %bb ]
182 %tmp3 = xor i16 %a_addr.0, %b_addr.0
183 %tmp4not = xor i16 %tmp3, 32767
184 %tmp6 = and i16 %tmp4not, %b_addr.0
185 %tmp8 = shl i16 %tmp6, 1
186 %tmp10 = icmp eq i16 %tmp8, 0
187 br i1 %tmp10, label %bb12, label %bb
192 define i8 @test6(i8 %a, i8 %b) nounwind {
194 ; X86: # %bb.0: # %entry
195 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
196 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
197 ; X86-NEXT: .p2align 4, 0x90
198 ; X86-NEXT: .LBB5_1: # %bb
199 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
200 ; X86-NEXT: xorb %cl, %al
201 ; X86-NEXT: movl %eax, %edx
203 ; X86-NEXT: andb %cl, %dl
204 ; X86-NEXT: addb %dl, %dl
205 ; X86-NEXT: movl %edx, %ecx
206 ; X86-NEXT: jne .LBB5_1
207 ; X86-NEXT: # %bb.2: # %bb12
210 ; X64-LIN-LABEL: test6:
211 ; X64-LIN: # %bb.0: # %entry
212 ; X64-LIN-NEXT: movl %edi, %eax
213 ; X64-LIN-NEXT: .p2align 4, 0x90
214 ; X64-LIN-NEXT: .LBB5_1: # %bb
215 ; X64-LIN-NEXT: # =>This Inner Loop Header: Depth=1
216 ; X64-LIN-NEXT: xorb %sil, %al
217 ; X64-LIN-NEXT: movl %eax, %ecx
218 ; X64-LIN-NEXT: notb %cl
219 ; X64-LIN-NEXT: andb %sil, %cl
220 ; X64-LIN-NEXT: addb %cl, %cl
221 ; X64-LIN-NEXT: movl %ecx, %esi
222 ; X64-LIN-NEXT: jne .LBB5_1
223 ; X64-LIN-NEXT: # %bb.2: # %bb12
224 ; X64-LIN-NEXT: # kill: def $al killed $al killed $eax
227 ; X64-WIN-LABEL: test6:
228 ; X64-WIN: # %bb.0: # %entry
229 ; X64-WIN-NEXT: movl %ecx, %eax
230 ; X64-WIN-NEXT: .p2align 4, 0x90
231 ; X64-WIN-NEXT: .LBB5_1: # %bb
232 ; X64-WIN-NEXT: # =>This Inner Loop Header: Depth=1
233 ; X64-WIN-NEXT: xorb %dl, %al
234 ; X64-WIN-NEXT: movl %eax, %ecx
235 ; X64-WIN-NEXT: notb %cl
236 ; X64-WIN-NEXT: andb %dl, %cl
237 ; X64-WIN-NEXT: addb %cl, %cl
238 ; X64-WIN-NEXT: movl %ecx, %edx
239 ; X64-WIN-NEXT: jne .LBB5_1
240 ; X64-WIN-NEXT: # %bb.2: # %bb12
245 %b_addr.0 = phi i8 [ %b, %entry ], [ %tmp8, %bb ]
246 %a_addr.0 = phi i8 [ %a, %entry ], [ %tmp3, %bb ]
247 %tmp3 = xor i8 %a_addr.0, %b_addr.0
248 %tmp4not = xor i8 %tmp3, 127
249 %tmp6 = and i8 %tmp4not, %b_addr.0
250 %tmp8 = shl i8 %tmp6, 1
251 %tmp10 = icmp eq i8 %tmp8, 0
252 br i1 %tmp10, label %bb12, label %bb
257 define i32 @test7(i32 %a, i32 %b) nounwind {
259 ; X86: # %bb.0: # %entry
260 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
261 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
262 ; X86-NEXT: .p2align 4, 0x90
263 ; X86-NEXT: .LBB6_1: # %bb
264 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
265 ; X86-NEXT: xorl %ecx, %eax
266 ; X86-NEXT: movl %eax, %edx
267 ; X86-NEXT: xorl $2147483646, %edx # imm = 0x7FFFFFFE
268 ; X86-NEXT: andl %ecx, %edx
269 ; X86-NEXT: addl %edx, %edx
270 ; X86-NEXT: movl %edx, %ecx
271 ; X86-NEXT: jne .LBB6_1
272 ; X86-NEXT: # %bb.2: # %bb12
275 ; X64-LIN-LABEL: test7:
276 ; X64-LIN: # %bb.0: # %entry
277 ; X64-LIN-NEXT: movl %edi, %eax
278 ; X64-LIN-NEXT: .p2align 4, 0x90
279 ; X64-LIN-NEXT: .LBB6_1: # %bb
280 ; X64-LIN-NEXT: # =>This Inner Loop Header: Depth=1
281 ; X64-LIN-NEXT: xorl %esi, %eax
282 ; X64-LIN-NEXT: movl %eax, %ecx
283 ; X64-LIN-NEXT: xorl $2147483646, %ecx # imm = 0x7FFFFFFE
284 ; X64-LIN-NEXT: andl %esi, %ecx
285 ; X64-LIN-NEXT: addl %ecx, %ecx
286 ; X64-LIN-NEXT: movl %ecx, %esi
287 ; X64-LIN-NEXT: jne .LBB6_1
288 ; X64-LIN-NEXT: # %bb.2: # %bb12
291 ; X64-WIN-LABEL: test7:
292 ; X64-WIN: # %bb.0: # %entry
293 ; X64-WIN-NEXT: movl %ecx, %eax
294 ; X64-WIN-NEXT: .p2align 4, 0x90
295 ; X64-WIN-NEXT: .LBB6_1: # %bb
296 ; X64-WIN-NEXT: # =>This Inner Loop Header: Depth=1
297 ; X64-WIN-NEXT: xorl %edx, %eax
298 ; X64-WIN-NEXT: movl %eax, %ecx
299 ; X64-WIN-NEXT: xorl $2147483646, %ecx # imm = 0x7FFFFFFE
300 ; X64-WIN-NEXT: andl %edx, %ecx
301 ; X64-WIN-NEXT: addl %ecx, %ecx
302 ; X64-WIN-NEXT: movl %ecx, %edx
303 ; X64-WIN-NEXT: jne .LBB6_1
304 ; X64-WIN-NEXT: # %bb.2: # %bb12
309 %b_addr.0 = phi i32 [ %b, %entry ], [ %tmp8, %bb ]
310 %a_addr.0 = phi i32 [ %a, %entry ], [ %tmp3, %bb ]
311 %tmp3 = xor i32 %a_addr.0, %b_addr.0
312 %tmp4not = xor i32 %tmp3, 2147483646
313 %tmp6 = and i32 %tmp4not, %b_addr.0
314 %tmp8 = shl i32 %tmp6, 1
315 %tmp10 = icmp eq i32 %tmp8, 0
316 br i1 %tmp10, label %bb12, label %bb
322 define i32 @test8(i32 %a) nounwind {
324 ; X86: # %bb.0: # %entry
325 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
326 ; X86-NEXT: notl %eax
329 ; X64-LIN-LABEL: test8:
330 ; X64-LIN: # %bb.0: # %entry
331 ; X64-LIN-NEXT: movl %edi, %eax
332 ; X64-LIN-NEXT: notl %eax
335 ; X64-WIN-LABEL: test8:
336 ; X64-WIN: # %bb.0: # %entry
337 ; X64-WIN-NEXT: movl %ecx, %eax
338 ; X64-WIN-NEXT: notl %eax
342 %t2 = add i32 %t1, -1
346 define i32 @test9(i32 %a) nounwind {
349 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
350 ; X86-NEXT: notl %eax
351 ; X86-NEXT: andl $4096, %eax # imm = 0x1000
354 ; X64-LIN-LABEL: test9:
356 ; X64-LIN-NEXT: movl %edi, %eax
357 ; X64-LIN-NEXT: notl %eax
358 ; X64-LIN-NEXT: andl $4096, %eax # imm = 0x1000
361 ; X64-WIN-LABEL: test9:
363 ; X64-WIN-NEXT: movl %ecx, %eax
364 ; X64-WIN-NEXT: notl %eax
365 ; X64-WIN-NEXT: andl $4096, %eax # imm = 0x1000
367 %1 = and i32 %a, 4096
368 %2 = xor i32 %1, 4096
373 define <4 x i32> @test10(<4 x i32> %a) nounwind {
376 ; X86-NEXT: andnps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
379 ; X64-LIN-LABEL: test10:
381 ; X64-LIN-NEXT: andnps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
384 ; X64-WIN-LABEL: test10:
386 ; X64-WIN-NEXT: movaps (%rcx), %xmm0
387 ; X64-WIN-NEXT: andnps __xmm@00001000000010000000100000001000(%rip), %xmm0
389 %1 = and <4 x i32> %a, <i32 4096, i32 4096, i32 4096, i32 4096>
390 %2 = xor <4 x i32> %1, <i32 4096, i32 4096, i32 4096, i32 4096>
394 define i32 @PR17487(i1 %tobool) {
395 ; X86-LABEL: PR17487:
397 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
399 ; X86-NEXT: xorl %eax, %eax
400 ; X86-NEXT: testb $1, %cl
404 ; X64-LIN-LABEL: PR17487:
406 ; X64-LIN-NEXT: movl %edi, %eax
407 ; X64-LIN-NEXT: andl $1, %eax
410 ; X64-WIN-LABEL: PR17487:
412 ; X64-WIN-NEXT: andb $1, %cl
413 ; X64-WIN-NEXT: movzbl %cl, %eax
415 %tmp = insertelement <2 x i1> undef, i1 %tobool, i32 1
416 %tmp1 = zext <2 x i1> %tmp to <2 x i64>
417 %tmp2 = xor <2 x i64> %tmp1, <i64 1, i64 1>
418 %tmp3 = extractelement <2 x i64> %tmp2, i32 1
419 %add = add nsw i64 0, %tmp3
420 %cmp6 = icmp ne i64 %add, 1
421 %conv7 = zext i1 %cmp6 to i32
425 define i32 @test11(i32 %b) {
428 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
429 ; X86-NEXT: movl $-2, %eax
430 ; X86-NEXT: roll %cl, %eax
433 ; X64-LIN-LABEL: test11:
435 ; X64-LIN-NEXT: movl %edi, %ecx
436 ; X64-LIN-NEXT: movl $-2, %eax
437 ; X64-LIN-NEXT: # kill: def $cl killed $cl killed $ecx
438 ; X64-LIN-NEXT: roll %cl, %eax
441 ; X64-WIN-LABEL: test11:
443 ; X64-WIN-NEXT: movl $-2, %eax
444 ; X64-WIN-NEXT: # kill: def $cl killed $cl killed $ecx
445 ; X64-WIN-NEXT: roll %cl, %eax
448 %neg = xor i32 %shl, -1
452 %struct.ref_s = type { %union.v, i16, i16 }
453 %union.v = type { i64 }
455 define ptr @test12(ptr %op, i64 %osbot, i64 %intval) {
458 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
459 ; X86-NEXT: notl %eax
460 ; X86-NEXT: leal (%eax,%eax,2), %eax
461 ; X86-NEXT: shll $2, %eax
462 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
465 ; X64-LIN-LABEL: test12:
467 ; X64-LIN-NEXT: notl %edx
468 ; X64-LIN-NEXT: movslq %edx, %rax
469 ; X64-LIN-NEXT: shlq $4, %rax
470 ; X64-LIN-NEXT: addq %rdi, %rax
473 ; X64-WIN-LABEL: test12:
475 ; X64-WIN-NEXT: notl %r8d
476 ; X64-WIN-NEXT: movslq %r8d, %rax
477 ; X64-WIN-NEXT: shlq $4, %rax
478 ; X64-WIN-NEXT: addq %rcx, %rax
480 %neg = shl i64 %intval, 32
481 %sext = xor i64 %neg, -4294967296
482 %idx.ext = ashr exact i64 %sext, 32
483 %add.ptr = getelementptr inbounds %struct.ref_s, ptr %op, i64 %idx.ext
487 define i32 @PR39657(ptr %p, i64 %x) {
488 ; X86-LABEL: PR39657:
490 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
491 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
492 ; X86-NEXT: notl %ecx
493 ; X86-NEXT: movl (%eax,%ecx,4), %eax
496 ; X64-LIN-LABEL: PR39657:
498 ; X64-LIN-NEXT: notq %rsi
499 ; X64-LIN-NEXT: movl (%rdi,%rsi,4), %eax
502 ; X64-WIN-LABEL: PR39657:
504 ; X64-WIN-NEXT: notq %rdx
505 ; X64-WIN-NEXT: movl (%rcx,%rdx,4), %eax
508 %mul = xor i64 %sh, -4
509 %add.ptr = getelementptr inbounds i8, ptr %p, i64 %mul
510 %load = load i32, ptr %add.ptr, align 4
514 define i32 @add_of_not(i32 %x, i32 %y) {
515 ; X86-LABEL: add_of_not:
517 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
518 ; X86-NEXT: notl %eax
519 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
522 ; X64-LIN-LABEL: add_of_not:
524 ; X64-LIN-NEXT: # kill: def $esi killed $esi def $rsi
525 ; X64-LIN-NEXT: # kill: def $edi killed $edi def $rdi
526 ; X64-LIN-NEXT: notl %esi
527 ; X64-LIN-NEXT: leal (%rsi,%rdi), %eax
530 ; X64-WIN-LABEL: add_of_not:
532 ; X64-WIN-NEXT: # kill: def $edx killed $edx def $rdx
533 ; X64-WIN-NEXT: # kill: def $ecx killed $ecx def $rcx
534 ; X64-WIN-NEXT: notl %edx
535 ; X64-WIN-NEXT: leal (%rdx,%rcx), %eax
542 define i32 @add_of_not_decrement(i32 %x, i32 %y) {
543 ; X86-LABEL: add_of_not_decrement:
545 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
546 ; X86-NEXT: notl %eax
547 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
550 ; X64-LIN-LABEL: add_of_not_decrement:
552 ; X64-LIN-NEXT: # kill: def $esi killed $esi def $rsi
553 ; X64-LIN-NEXT: # kill: def $edi killed $edi def $rdi
554 ; X64-LIN-NEXT: notl %esi
555 ; X64-LIN-NEXT: leal (%rsi,%rdi), %eax
558 ; X64-WIN-LABEL: add_of_not_decrement:
560 ; X64-WIN-NEXT: # kill: def $edx killed $edx def $rdx
561 ; X64-WIN-NEXT: # kill: def $ecx killed $ecx def $rcx
562 ; X64-WIN-NEXT: notl %edx
563 ; X64-WIN-NEXT: leal (%rdx,%rcx), %eax
570 define <4 x i32> @vec_add_of_not(<4 x i32> %x, <4 x i32> %y) {
571 ; X86-LABEL: vec_add_of_not:
573 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
574 ; X86-NEXT: pxor %xmm1, %xmm2
575 ; X86-NEXT: paddd %xmm2, %xmm0
578 ; X64-LIN-LABEL: vec_add_of_not:
580 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
581 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
582 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
585 ; X64-WIN-LABEL: vec_add_of_not:
587 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
588 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
589 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
591 %t0 = sub <4 x i32> %x, %y
592 %r = add <4 x i32> %t0, <i32 -1, i32 -1, i32 -1, i32 -1>
596 define <4 x i32> @vec_add_of_not_decrement(<4 x i32> %x, <4 x i32> %y) {
597 ; X86-LABEL: vec_add_of_not_decrement:
599 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
600 ; X86-NEXT: pxor %xmm1, %xmm2
601 ; X86-NEXT: paddd %xmm2, %xmm0
604 ; X64-LIN-LABEL: vec_add_of_not_decrement:
606 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
607 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
608 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
611 ; X64-WIN-LABEL: vec_add_of_not_decrement:
613 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
614 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
615 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
617 %t0 = sub <4 x i32> %x, %y
618 %r = sub <4 x i32> %t0, <i32 1, i32 1, i32 1, i32 1>
622 define <4 x i32> @vec_add_of_not_with_undef(<4 x i32> %x, <4 x i32> %y) {
623 ; X86-LABEL: vec_add_of_not_with_undef:
625 ; X86-NEXT: psubd %xmm1, %xmm0
626 ; X86-NEXT: pcmpeqd %xmm1, %xmm1
627 ; X86-NEXT: paddd %xmm1, %xmm0
630 ; X64-LIN-LABEL: vec_add_of_not_with_undef:
632 ; X64-LIN-NEXT: psubd %xmm1, %xmm0
633 ; X64-LIN-NEXT: pcmpeqd %xmm1, %xmm1
634 ; X64-LIN-NEXT: paddd %xmm1, %xmm0
637 ; X64-WIN-LABEL: vec_add_of_not_with_undef:
639 ; X64-WIN-NEXT: movdqa (%rcx), %xmm1
640 ; X64-WIN-NEXT: psubd (%rdx), %xmm1
641 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
642 ; X64-WIN-NEXT: paddd %xmm1, %xmm0
644 %t0 = sub <4 x i32> %x, %y
645 %r = add <4 x i32> %t0, <i32 -1, i32 undef, i32 -1, i32 -1>
649 define <4 x i32> @vec_add_of_not_with_undef_decrement(<4 x i32> %x, <4 x i32> %y) {
650 ; X86-LABEL: vec_add_of_not_with_undef_decrement:
652 ; X86-NEXT: psubd %xmm1, %xmm0
653 ; X86-NEXT: pcmpeqd %xmm1, %xmm1
654 ; X86-NEXT: psubd %xmm1, %xmm0
657 ; X64-LIN-LABEL: vec_add_of_not_with_undef_decrement:
659 ; X64-LIN-NEXT: psubd %xmm1, %xmm0
660 ; X64-LIN-NEXT: pcmpeqd %xmm1, %xmm1
661 ; X64-LIN-NEXT: psubd %xmm1, %xmm0
664 ; X64-WIN-LABEL: vec_add_of_not_with_undef_decrement:
666 ; X64-WIN-NEXT: movdqa (%rcx), %xmm0
667 ; X64-WIN-NEXT: psubd (%rdx), %xmm0
668 ; X64-WIN-NEXT: pcmpeqd %xmm1, %xmm1
669 ; X64-WIN-NEXT: psubd %xmm1, %xmm0
671 %t0 = sub <4 x i32> %x, %y
672 %r = add <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>