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