2005-08-18 19:38:57 +00:00
|
|
|
; All of these routines should be perform optimal load of constants.
|
|
|
|
; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep lis | wc -l | grep 5 &&
|
|
|
|
; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep ori | wc -l | grep 3 &&
|
|
|
|
; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep 'li ' | wc -l | grep 4
|
2005-08-18 19:32:46 +00:00
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f1() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 1
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f2() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int -1
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f3() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 0
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f4() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 32767
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f5() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 65535
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f6() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 65536
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f7() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 131071
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f8() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int 2147483647
|
|
|
|
}
|
|
|
|
|
2005-08-18 20:06:09 +00:00
|
|
|
int %f9() {
|
2005-08-18 19:32:46 +00:00
|
|
|
entry:
|
|
|
|
ret int -2147483648
|
|
|
|
}
|