]> granicus.if.org Git - llvm/commitdiff
[X86] Add urem vector test for non-uniform pow2 constants
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 26 Jul 2017 11:07:45 +0000 (11:07 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 26 Jul 2017 11:07:45 +0000 (11:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309104 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/urem-power-of-two.ll

index e57f35ddcc15e5cf7635fdc72b4df55eefc8ab7f..72f96776babf05f831a89fb207c4d5c8c885a61e 100644 (file)
@@ -101,15 +101,15 @@ define i8 @and_pow_2(i8 %x, i8 %y) {
   ret i8 %urem
 }
 
-; A vector splat constant divisor should get the same treatment as a scalar.
+; A vector constant divisor should get the same treatment as a scalar.
 
-define <4 x i32> @vec_const_pow_2(<4 x i32> %x) {
-; X86-LABEL: vec_const_pow_2:
+define <4 x i32> @vec_const_uniform_pow_2(<4 x i32> %x) {
+; X86-LABEL: vec_const_uniform_pow_2:
 ; X86:       # BB#0:
 ; X86-NEXT:    andps {{\.LCPI.*}}, %xmm0
 ; X86-NEXT:    retl
 ;
-; X64-LABEL: vec_const_pow_2:
+; X64-LABEL: vec_const_uniform_pow_2:
 ; X64:       # BB#0:
 ; X64-NEXT:    andps {{.*}}(%rip), %xmm0
 ; X64-NEXT:    retq
@@ -117,3 +117,16 @@ define <4 x i32> @vec_const_pow_2(<4 x i32> %x) {
   ret <4 x i32> %urem
 }
 
+define <4 x i32> @vec_const_nonuniform_pow_2(<4 x i32> %x) {
+; X86-LABEL: vec_const_nonuniform_pow_2:
+; X86:       # BB#0:
+; X86-NEXT:    andps {{\.LCPI.*}}, %xmm0
+; X86-NEXT:    retl
+;
+; X64-LABEL: vec_const_nonuniform_pow_2:
+; X64:       # BB#0:
+; X64-NEXT:    andps {{.*}}(%rip), %xmm0
+; X64-NEXT:    retq
+  %urem = urem <4 x i32> %x, <i32 2, i32 4, i32 8, i32 16>
+  ret <4 x i32> %urem
+}