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: movd %edi, %xmm0
407 ; X64-LIN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
408 ; X64-LIN-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
409 ; X64-LIN-NEXT: pextrw $4, %xmm0, %eax
412 ; X64-WIN-LABEL: PR17487:
414 ; X64-WIN-NEXT: movzbl %cl, %eax
415 ; X64-WIN-NEXT: movd %eax, %xmm0
416 ; X64-WIN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
417 ; X64-WIN-NEXT: pand __xmm@00000000000000010000000000000001(%rip), %xmm0
418 ; X64-WIN-NEXT: pextrw $4, %xmm0, %eax
420 %tmp = insertelement <2 x i1> undef, i1 %tobool, i32 1
421 %tmp1 = zext <2 x i1> %tmp to <2 x i64>
422 %tmp2 = xor <2 x i64> %tmp1, <i64 1, i64 1>
423 %tmp3 = extractelement <2 x i64> %tmp2, i32 1
424 %add = add nsw i64 0, %tmp3
425 %cmp6 = icmp ne i64 %add, 1
426 %conv7 = zext i1 %cmp6 to i32
430 define i32 @test11(i32 %b) {
433 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
434 ; X86-NEXT: movl $-2, %eax
435 ; X86-NEXT: roll %cl, %eax
438 ; X64-LIN-LABEL: test11:
440 ; X64-LIN-NEXT: movl %edi, %ecx
441 ; X64-LIN-NEXT: movl $-2, %eax
442 ; X64-LIN-NEXT: # kill: def $cl killed $cl killed $ecx
443 ; X64-LIN-NEXT: roll %cl, %eax
446 ; X64-WIN-LABEL: test11:
448 ; X64-WIN-NEXT: movl $-2, %eax
449 ; X64-WIN-NEXT: # kill: def $cl killed $cl killed $ecx
450 ; X64-WIN-NEXT: roll %cl, %eax
453 %neg = xor i32 %shl, -1
457 %struct.ref_s = type { %union.v, i16, i16 }
458 %union.v = type { i64 }
460 define ptr @test12(ptr %op, i64 %osbot, i64 %intval) {
463 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
464 ; X86-NEXT: notl %eax
465 ; X86-NEXT: leal (%eax,%eax,2), %eax
466 ; X86-NEXT: shll $2, %eax
467 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
470 ; X64-LIN-LABEL: test12:
472 ; X64-LIN-NEXT: notl %edx
473 ; X64-LIN-NEXT: movslq %edx, %rax
474 ; X64-LIN-NEXT: shlq $4, %rax
475 ; X64-LIN-NEXT: addq %rdi, %rax
478 ; X64-WIN-LABEL: test12:
480 ; X64-WIN-NEXT: notl %r8d
481 ; X64-WIN-NEXT: movslq %r8d, %rax
482 ; X64-WIN-NEXT: shlq $4, %rax
483 ; X64-WIN-NEXT: addq %rcx, %rax
485 %neg = shl i64 %intval, 32
486 %sext = xor i64 %neg, -4294967296
487 %idx.ext = ashr exact i64 %sext, 32
488 %add.ptr = getelementptr inbounds %struct.ref_s, ptr %op, i64 %idx.ext
492 define i32 @PR39657(ptr %p, i64 %x) {
493 ; X86-LABEL: PR39657:
495 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
496 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
497 ; X86-NEXT: notl %ecx
498 ; X86-NEXT: movl (%eax,%ecx,4), %eax
501 ; X64-LIN-LABEL: PR39657:
503 ; X64-LIN-NEXT: notq %rsi
504 ; X64-LIN-NEXT: movl (%rdi,%rsi,4), %eax
507 ; X64-WIN-LABEL: PR39657:
509 ; X64-WIN-NEXT: notq %rdx
510 ; X64-WIN-NEXT: movl (%rcx,%rdx,4), %eax
513 %mul = xor i64 %sh, -4
514 %add.ptr = getelementptr inbounds i8, ptr %p, i64 %mul
515 %load = load i32, ptr %add.ptr, align 4
519 define i32 @add_of_not(i32 %x, i32 %y) {
520 ; X86-LABEL: add_of_not:
522 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
523 ; X86-NEXT: notl %eax
524 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
527 ; X64-LIN-LABEL: add_of_not:
529 ; X64-LIN-NEXT: # kill: def $esi killed $esi def $rsi
530 ; X64-LIN-NEXT: # kill: def $edi killed $edi def $rdi
531 ; X64-LIN-NEXT: notl %esi
532 ; X64-LIN-NEXT: leal (%rsi,%rdi), %eax
535 ; X64-WIN-LABEL: add_of_not:
537 ; X64-WIN-NEXT: # kill: def $edx killed $edx def $rdx
538 ; X64-WIN-NEXT: # kill: def $ecx killed $ecx def $rcx
539 ; X64-WIN-NEXT: notl %edx
540 ; X64-WIN-NEXT: leal (%rdx,%rcx), %eax
547 define i32 @add_of_not_decrement(i32 %x, i32 %y) {
548 ; X86-LABEL: add_of_not_decrement:
550 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
551 ; X86-NEXT: notl %eax
552 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
555 ; X64-LIN-LABEL: add_of_not_decrement:
557 ; X64-LIN-NEXT: # kill: def $esi killed $esi def $rsi
558 ; X64-LIN-NEXT: # kill: def $edi killed $edi def $rdi
559 ; X64-LIN-NEXT: notl %esi
560 ; X64-LIN-NEXT: leal (%rsi,%rdi), %eax
563 ; X64-WIN-LABEL: add_of_not_decrement:
565 ; X64-WIN-NEXT: # kill: def $edx killed $edx def $rdx
566 ; X64-WIN-NEXT: # kill: def $ecx killed $ecx def $rcx
567 ; X64-WIN-NEXT: notl %edx
568 ; X64-WIN-NEXT: leal (%rdx,%rcx), %eax
575 define <4 x i32> @vec_add_of_not(<4 x i32> %x, <4 x i32> %y) {
576 ; X86-LABEL: vec_add_of_not:
578 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
579 ; X86-NEXT: pxor %xmm1, %xmm2
580 ; X86-NEXT: paddd %xmm2, %xmm0
583 ; X64-LIN-LABEL: vec_add_of_not:
585 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
586 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
587 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
590 ; X64-WIN-LABEL: vec_add_of_not:
592 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
593 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
594 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
596 %t0 = sub <4 x i32> %x, %y
597 %r = add <4 x i32> %t0, <i32 -1, i32 -1, i32 -1, i32 -1>
601 define <4 x i32> @vec_add_of_not_decrement(<4 x i32> %x, <4 x i32> %y) {
602 ; X86-LABEL: vec_add_of_not_decrement:
604 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
605 ; X86-NEXT: pxor %xmm1, %xmm2
606 ; X86-NEXT: paddd %xmm2, %xmm0
609 ; X64-LIN-LABEL: vec_add_of_not_decrement:
611 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
612 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
613 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
616 ; X64-WIN-LABEL: vec_add_of_not_decrement:
618 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
619 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
620 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
622 %t0 = sub <4 x i32> %x, %y
623 %r = sub <4 x i32> %t0, <i32 1, i32 1, i32 1, i32 1>
627 define <4 x i32> @vec_add_of_not_with_undef(<4 x i32> %x, <4 x i32> %y) {
628 ; X86-LABEL: vec_add_of_not_with_undef:
630 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
631 ; X86-NEXT: pxor %xmm1, %xmm2
632 ; X86-NEXT: paddd %xmm2, %xmm0
635 ; X64-LIN-LABEL: vec_add_of_not_with_undef:
637 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
638 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
639 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
642 ; X64-WIN-LABEL: vec_add_of_not_with_undef:
644 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
645 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
646 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
648 %t0 = sub <4 x i32> %x, %y
649 %r = add <4 x i32> %t0, <i32 -1, i32 undef, i32 -1, i32 -1>
653 define <4 x i32> @vec_add_of_not_with_undef_decrement(<4 x i32> %x, <4 x i32> %y) {
654 ; X86-LABEL: vec_add_of_not_with_undef_decrement:
656 ; X86-NEXT: pcmpeqd %xmm2, %xmm2
657 ; X86-NEXT: pxor %xmm1, %xmm2
658 ; X86-NEXT: paddd %xmm2, %xmm0
661 ; X64-LIN-LABEL: vec_add_of_not_with_undef_decrement:
663 ; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
664 ; X64-LIN-NEXT: pxor %xmm1, %xmm2
665 ; X64-LIN-NEXT: paddd %xmm2, %xmm0
668 ; X64-WIN-LABEL: vec_add_of_not_with_undef_decrement:
670 ; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
671 ; X64-WIN-NEXT: pxor (%rdx), %xmm0
672 ; X64-WIN-NEXT: paddd (%rcx), %xmm0
674 %t0 = sub <4 x i32> %x, %y
675 %r = sub <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>