[llvm] r352281 - [X86] Add nonsplat increment/decrement constant vector with min/max test (PR39859)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 26 08:27:48 PST 2019


Author: rksimon
Date: Sat Jan 26 08:27:48 2019
New Revision: 352281

URL: http://llvm.org/viewvc/llvm-project?rev=352281&view=rev
Log:
[X86] Add nonsplat increment/decrement constant vector with min/max test (PR39859)

Modified:
    llvm/trunk/test/CodeGen/X86/sat-add.ll

Modified: llvm/trunk/test/CodeGen/X86/sat-add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sat-add.ll?rev=352281&r1=352280&r2=352281&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sat-add.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sat-add.ll Sat Jan 26 08:27:48 2019
@@ -537,6 +537,33 @@ define <4 x i32> @unsigned_sat_constant_
   ret <4 x i32> %r
 }
 
+define <4 x i32> @unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat(<4 x i32> %x) {
+; SSE2-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat:
+; SSE2:       # %bb.0:
+; SSE2-NEXT:    movdqa {{.*#+}} xmm1 = [43,44,45,46]
+; SSE2-NEXT:    paddd %xmm0, %xmm1
+; SSE2-NEXT:    pxor {{.*}}(%rip), %xmm0
+; SSE2-NEXT:    pcmpgtd {{.*}}(%rip), %xmm0
+; SSE2-NEXT:    por %xmm1, %xmm0
+; SSE2-NEXT:    retq
+;
+; SSE41-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat:
+; SSE41:       # %bb.0:
+; SSE41-NEXT:    movdqa {{.*#+}} xmm1 = [43,44,45,46]
+; SSE41-NEXT:    paddd %xmm0, %xmm1
+; SSE41-NEXT:    movdqa {{.*#+}} xmm2 = [4294967252,4294967251,4294967250,4294967249]
+; SSE41-NEXT:    pminud %xmm0, %xmm2
+; SSE41-NEXT:    pcmpeqd %xmm2, %xmm0
+; SSE41-NEXT:    pcmpeqd %xmm2, %xmm2
+; SSE41-NEXT:    pxor %xmm2, %xmm0
+; SSE41-NEXT:    por %xmm1, %xmm0
+; SSE41-NEXT:    retq
+  %a = add <4 x i32> %x, <i32 43, i32 44, i32 45, i32 46>
+  %c = icmp ugt <4 x i32> %x, <i32 -44, i32 -45, i32 -46, i32 -47>
+  %r = select <4 x i1> %c, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> %a
+  ret <4 x i32> %r
+}
+
 define <2 x i64> @unsigned_sat_constant_v2i64_using_min(<2 x i64> %x) {
 ; SSE2-LABEL: unsigned_sat_constant_v2i64_using_min:
 ; SSE2:       # %bb.0:




More information about the llvm-commits mailing list