2007-04-16 17:36:08 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi
|
2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep blr
|
2005-10-07 06:10:03 +00:00
|
|
|
|
2005-10-07 15:27:12 +00:00
|
|
|
int %test1(int %X) {
|
2005-10-07 06:10:03 +00:00
|
|
|
%Y = and int %X, 15
|
|
|
|
%Z = div int %Y, 4
|
|
|
|
ret int %Z
|
|
|
|
}
|
2005-10-07 15:27:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|