xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/constants.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; All of these routines should be perform optimal load of constants.
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 | \
3*9880d681SAndroid Build Coastguard Worker; RUN:   grep lis | count 5
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 | \
5*9880d681SAndroid Build Coastguard Worker; RUN:   grep ori | count 3
6*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 | \
7*9880d681SAndroid Build Coastguard Worker; RUN:   grep "li " | count 4
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine i32 @f1() {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker	ret i32 1
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine i32 @f2() {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker	ret i32 -1
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdefine i32 @f3() {
20*9880d681SAndroid Build Coastguard Workerentry:
21*9880d681SAndroid Build Coastguard Worker	ret i32 0
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerdefine i32 @f4() {
25*9880d681SAndroid Build Coastguard Workerentry:
26*9880d681SAndroid Build Coastguard Worker	ret i32 32767
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdefine i32 @f5() {
30*9880d681SAndroid Build Coastguard Workerentry:
31*9880d681SAndroid Build Coastguard Worker	ret i32 65535
32*9880d681SAndroid Build Coastguard Worker}
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerdefine i32 @f6() {
35*9880d681SAndroid Build Coastguard Workerentry:
36*9880d681SAndroid Build Coastguard Worker	ret i32 65536
37*9880d681SAndroid Build Coastguard Worker}
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerdefine i32 @f7() {
40*9880d681SAndroid Build Coastguard Workerentry:
41*9880d681SAndroid Build Coastguard Worker	ret i32 131071
42*9880d681SAndroid Build Coastguard Worker}
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Workerdefine i32 @f8() {
45*9880d681SAndroid Build Coastguard Workerentry:
46*9880d681SAndroid Build Coastguard Worker	ret i32 2147483647
47*9880d681SAndroid Build Coastguard Worker}
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Workerdefine i32 @f9() {
50*9880d681SAndroid Build Coastguard Workerentry:
51*9880d681SAndroid Build Coastguard Worker	ret i32 -2147483648
52*9880d681SAndroid Build Coastguard Worker}
53