llvm.org GIT mirror llvm / 12d2fa1
[X86] Add nonsplat increment/decrement constant vector with min/max test (PR39859) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352281 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 1 year, 4 months ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
532532 ; SSE41-NEXT: retq
533533 %a = add <4 x i32> %x,
534534 %c = icmp ugt <4 x i32> %x,
535 %r = select <4 x i1> %c, <4 x i32> , <4 x i32> %a
536 ret <4 x i32> %r
537 }
538
539 define <4 x i32> @unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat(<4 x i32> %x) {
540 ; SSE2-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat:
541 ; SSE2: # %bb.0:
542 ; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [43,44,45,46]
543 ; SSE2-NEXT: paddd %xmm0, %xmm1
544 ; SSE2-NEXT: pxor {{.*}}(%rip), %xmm0
545 ; SSE2-NEXT: pcmpgtd {{.*}}(%rip), %xmm0
546 ; SSE2-NEXT: por %xmm1, %xmm0
547 ; SSE2-NEXT: retq
548 ;
549 ; SSE41-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat:
550 ; SSE41: # %bb.0:
551 ; SSE41-NEXT: movdqa {{.*#+}} xmm1 = [43,44,45,46]
552 ; SSE41-NEXT: paddd %xmm0, %xmm1
553 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [4294967252,4294967251,4294967250,4294967249]
554 ; SSE41-NEXT: pminud %xmm0, %xmm2
555 ; SSE41-NEXT: pcmpeqd %xmm2, %xmm0
556 ; SSE41-NEXT: pcmpeqd %xmm2, %xmm2
557 ; SSE41-NEXT: pxor %xmm2, %xmm0
558 ; SSE41-NEXT: por %xmm1, %xmm0
559 ; SSE41-NEXT: retq
560 %a = add <4 x i32> %x,
561 %c = icmp ugt <4 x i32> %x,
535562 %r = select <4 x i1> %c, <4 x i32> , <4 x i32> %a
536563 ret <4 x i32> %r
537564 }