• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
2
3define zeroext i1 @rettrue() nounwind {
4entry:
5; ELF64-LABEL: rettrue
6; ELF64: li 3, 1
7; ELF64: blr
8  ret i1 true
9}
10
11define zeroext i1 @retfalse() nounwind {
12entry:
13; ELF64-LABEL: retfalse
14; ELF64: li 3, 0
15; ELF64: blr
16  ret i1 false
17}
18
19define signext i1 @retstrue() nounwind {
20entry:
21; ELF64-LABEL: retstrue
22; ELF64: li 3, -1
23; ELF64: blr
24  ret i1 true
25}
26
27define signext i1 @retsfalse() nounwind {
28entry:
29; ELF64-LABEL: retsfalse
30; ELF64: li 3, 0
31; ELF64: blr
32  ret i1 false
33}
34
35define signext i8 @ret2(i8 signext %a) nounwind {
36entry:
37; ELF64-LABEL: ret2
38; ELF64: extsb
39; ELF64: blr
40  ret i8 %a
41}
42
43define zeroext i8 @ret3(i8 signext %a) nounwind {
44entry:
45; ELF64-LABEL: ret3
46; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
47; ELF64: blr
48  ret i8 %a
49}
50
51define signext i16 @ret4(i16 signext %a) nounwind {
52entry:
53; ELF64-LABEL: ret4
54; ELF64: extsh
55; ELF64: blr
56  ret i16 %a
57}
58
59define zeroext i16 @ret5(i16 signext %a) nounwind {
60entry:
61; ELF64-LABEL: ret5
62; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
63; ELF64: blr
64  ret i16 %a
65}
66
67define i16 @ret6(i16 %a) nounwind {
68entry:
69; ELF64-LABEL: ret6
70; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
71; ELF64: blr
72  ret i16 %a
73}
74
75define signext i32 @ret7(i32 signext %a) nounwind {
76entry:
77; ELF64-LABEL: ret7
78; ELF64: extsw
79; ELF64: blr
80  ret i32 %a
81}
82
83define zeroext i32 @ret8(i32 signext %a) nounwind {
84entry:
85; ELF64-LABEL: ret8
86; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
87; ELF64: blr
88  ret i32 %a
89}
90
91define i32 @ret9(i32 %a) nounwind {
92entry:
93; ELF64-LABEL: ret9
94; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
95; ELF64: blr
96  ret i32 %a
97}
98
99define i64 @ret10(i64 %a) nounwind {
100entry:
101; ELF64-LABEL: ret10
102; ELF64-NOT: exts
103; ELF64-NOT: clrldi
104; ELF64-NOT: rldicl
105; ELF64: blr
106  ret i64 %a
107}
108
109define float @ret11(float %a) nounwind {
110entry:
111; ELF64-LABEL: ret11
112; ELF64: blr
113  ret float %a
114}
115
116define double @ret12(double %a) nounwind {
117entry:
118; ELF64-LABEL: ret12
119; ELF64: blr
120  ret double %a
121}
122
123define i8 @ret13() nounwind {
124entry:
125; ELF64-LABEL: ret13
126; ELF64: li
127; ELF64: blr
128  ret i8 15;
129}
130
131define i16 @ret14() nounwind {
132entry:
133; ELF64-LABEL: ret14
134; ELF64: li
135; ELF64: blr
136  ret i16 -225;
137}
138
139define i32 @ret15() nounwind {
140entry:
141; ELF64-LABEL: ret15
142; ELF64: lis
143; ELF64: ori
144; ELF64: blr
145  ret i32 278135;
146}
147
148define i64 @ret16() nounwind {
149entry:
150; ELF64-LABEL: ret16
151; ELF64: li
152; ELF64: sldi
153; ELF64: oris
154; ELF64: ori
155; ELF64: blr
156  ret i64 27813515225;
157}
158
159define float @ret17() nounwind {
160entry:
161; ELF64-LABEL: ret17
162; ELF64: addis
163; ELF64: lfs
164; ELF64: blr
165  ret float 2.5;
166}
167
168define double @ret18() nounwind {
169entry:
170; ELF64-LABEL: ret18
171; ELF64: addis
172; ELF64: lfd
173; ELF64: blr
174  ret double 2.5e-33;
175}
176
177define zeroext i32 @ret19() nounwind {
178entry:
179; ELF64-LABEL: ret19
180; ELF64: li
181; ELF64: oris
182; ELF64: ori
183; ELF64: blr
184  ret i32 -1
185}
186
187define zeroext i16 @ret20() nounwind {
188entry:
189; ELF64-LABEL: ret20
190; ELF64: lis{{.*}}0
191; ELF64: ori{{.*}}32768
192; ELF64: blr
193  ret i16 32768
194}
195