X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2Fdivide-by-constant.ll;h=9543d6c4d74988bf71390f3c315e2b8df9d33fe4;hb=2fef79ea9688940ab1b71f2d7b635e66bf301386;hp=98ae1d51db2101c29ebcf90b07a745bd0e7feb96;hpb=b4dc0233c9f70e8cf946822811f233bb613a02e9;p=oota-llvm.git diff --git a/test/CodeGen/X86/divide-by-constant.ll b/test/CodeGen/X86/divide-by-constant.ll index 98ae1d51db2..9543d6c4d74 100644 --- a/test/CodeGen/X86/divide-by-constant.ll +++ b/test/CodeGen/X86/divide-by-constant.ll @@ -7,7 +7,7 @@ entry: %div = udiv i16 %x, 33 ret i16 %div ; CHECK-LABEL: test1: -; CHECK: imull $63551, %eax, %eax +; CHECK: imull $63551, %eax ; CHECK-NEXT: shrl $21, %eax ; CHECK-NEXT: ret } @@ -18,7 +18,7 @@ entry: ret i16 %div ; CHECK-LABEL: test2: -; CHECK: imull $43691, %eax, %eax +; CHECK: imull $43691, %eax ; CHECK-NEXT: shrl $17, %eax ; CHECK-NEXT: ret } @@ -30,7 +30,8 @@ entry: ; CHECK-LABEL: test3: ; CHECK: movzbl 8(%esp), %eax -; CHECK-NEXT: imull $171, %eax, %eax +; CHECK-NEXT: imull $171, %eax +; CHECK-NEXT: andl $65024, %eax ; CHECK-NEXT: shrl $9, %eax ; CHECK-NEXT: ret } @@ -40,7 +41,7 @@ entry: %div = sdiv i16 %x, 33 ; [#uses=1] ret i16 %div ; CHECK-LABEL: test4: -; CHECK: imull $1986, %eax, % +; CHECK: imull $1986, %eax } define i32 @test5(i32 %A) nounwind { @@ -56,9 +57,10 @@ entry: %div = sdiv i16 %x, 10 ret i16 %div ; CHECK-LABEL: test6: -; CHECK: imull $26215, %eax, %ecx -; CHECK: sarl $18, %ecx -; CHECK: shrl $15, %eax +; CHECK: imull $26215, %eax +; CHECK: movl %eax, %ecx +; CHECK: shrl $31, %ecx +; CHECK: sarl $18, %eax } define i32 @test7(i32 %x) nounwind { @@ -92,3 +94,35 @@ define i8 @test9(i8 %x) nounwind { ; CHECK: shrl $11 ; CHECK: ret } + +define i32 @testsize1(i32 %x) minsize nounwind { +entry: + %div = sdiv i32 %x, 32 + ret i32 %div +; CHECK-LABEL: testsize1: +; CHECK: divl +} + +define i32 @testsize2(i32 %x) minsize nounwind { +entry: + %div = sdiv i32 %x, 33 + ret i32 %div +; CHECK-LABEL: testsize2: +; CHECK: divl +} + +define i32 @testsize3(i32 %x) minsize nounwind { +entry: + %div = udiv i32 %x, 32 + ret i32 %div +; CHECK-LABEL: testsize3: +; CHECK: shrl +} + +define i32 @testsize4(i32 %x) minsize nounwind { +entry: + %div = udiv i32 %x, 33 + ret i32 %div +; CHECK-LABEL: testsize4: +; CHECK: divl +}