These don't need to be sdivs.

llvm-svn: 23661
This commit is contained in:
Chris Lattner 2005-10-07 15:27:12 +00:00
parent b27a4147d3
commit db5d47e4dd
1 changed files with 22 additions and 1 deletions

View File

@ -1,8 +1,29 @@
; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep blr
int %test(int %X) {
int %test1(int %X) {
%Y = and int %X, 15
%Z = div int %Y, 4
ret int %Z
}
int %test2(int %W) {
%X = and int %W, 15
%Y = sub int 16, %X
%Z = div int %Y, 4
ret int %Z
}
int %test3(int %W) {
%X = and int %W, 15
%Y = sub int 15, %X
%Z = div int %Y, 4
ret int %Z
}
int %test4(int %W) {
%X = and int %W, 2
%Y = sub int 5, %X
%Z = div int %Y, 2
ret int %Z
}