xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/fast-isel-conversion.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; FIXME: FastISel currently returns false if it hits code that uses VSX
2*9880d681SAndroid Build Coastguard Worker; registers and with -fast-isel-abort=1 turned on the test case will then fail.
3*9880d681SAndroid Build Coastguard Worker; When fastisel better supports VSX fix up this test case.
4*9880d681SAndroid Build Coastguard Worker;
5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
6*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx | FileCheck %s --check-prefix=ELF64LE
7*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=970 -mattr=-vsx | FileCheck %s --check-prefix=PPC970
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker;; Tests for 970 don't use -fast-isel-abort=1 because we intentionally punt
10*9880d681SAndroid Build Coastguard Worker;; to SelectionDAG in some cases.
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Test sitofp
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_single_i64(i64 %a, float %b) nounwind {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_single_i64
17*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_single_i64
18*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_single_i64
19*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
20*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i64 %a to float
21*9880d681SAndroid Build Coastguard Worker; ELF64: std
22*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
23*9880d681SAndroid Build Coastguard Worker; ELF64: fcfids
24*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
25*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
26*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfids
27*9880d681SAndroid Build Coastguard Worker; PPC970: std
28*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
29*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
30*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
31*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
32*9880d681SAndroid Build Coastguard Worker  ret void
33*9880d681SAndroid Build Coastguard Worker}
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_single_i32(i32 %a, float %b) nounwind {
36*9880d681SAndroid Build Coastguard Workerentry:
37*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_single_i32
38*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_single_i32
39*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_single_i32
40*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
41*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i32 %a to float
42*9880d681SAndroid Build Coastguard Worker; ELF64: std
43*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65524 = -16 + 4
44*9880d681SAndroid Build Coastguard Worker; ELF64: ori {{[0-9]+}}, {{[0-9]+}}, 65524
45*9880d681SAndroid Build Coastguard Worker; ELF64: lfiwax
46*9880d681SAndroid Build Coastguard Worker; ELF64: fcfids
47*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
48*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65520 = -16 + 0
49*9880d681SAndroid Build Coastguard Worker; ELF64LE: ori {{[0-9]+}}, {{[0-9]+}}, 65520
50*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfiwax
51*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfids
52*9880d681SAndroid Build Coastguard Worker; PPC970: std
53*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
54*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
55*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
56*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
57*9880d681SAndroid Build Coastguard Worker  ret void
58*9880d681SAndroid Build Coastguard Worker}
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_single_i16(i16 %a, float %b) nounwind {
61*9880d681SAndroid Build Coastguard Workerentry:
62*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_single_i16
63*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_single_i16
64*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_single_i16
65*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
66*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i16 %a to float
67*9880d681SAndroid Build Coastguard Worker; ELF64: extsh
68*9880d681SAndroid Build Coastguard Worker; ELF64: std
69*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
70*9880d681SAndroid Build Coastguard Worker; ELF64: fcfids
71*9880d681SAndroid Build Coastguard Worker; ELF64LE: extsh
72*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
73*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
74*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfids
75*9880d681SAndroid Build Coastguard Worker; PPC970: extsh
76*9880d681SAndroid Build Coastguard Worker; PPC970: std
77*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
78*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
79*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
80*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
81*9880d681SAndroid Build Coastguard Worker  ret void
82*9880d681SAndroid Build Coastguard Worker}
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_single_i8(i8 %a) nounwind {
85*9880d681SAndroid Build Coastguard Workerentry:
86*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_single_i8
87*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_single_i8
88*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_single_i8
89*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
90*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i8 %a to float
91*9880d681SAndroid Build Coastguard Worker; ELF64: extsb
92*9880d681SAndroid Build Coastguard Worker; ELF64: std
93*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
94*9880d681SAndroid Build Coastguard Worker; ELF64: fcfids
95*9880d681SAndroid Build Coastguard Worker; ELF64LE: extsb
96*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
97*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
98*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfids
99*9880d681SAndroid Build Coastguard Worker; PPC970: extsb
100*9880d681SAndroid Build Coastguard Worker; PPC970: std
101*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
102*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
103*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
104*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
105*9880d681SAndroid Build Coastguard Worker  ret void
106*9880d681SAndroid Build Coastguard Worker}
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i32(i32 %a, double %b) nounwind {
109*9880d681SAndroid Build Coastguard Workerentry:
110*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i32
111*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_double_i32
112*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_double_i32
113*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
114*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i32 %a to double
115*9880d681SAndroid Build Coastguard Worker; ELF64: std
116*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65524 = -16 + 4
117*9880d681SAndroid Build Coastguard Worker; ELF64: ori {{[0-9]+}}, {{[0-9]+}}, 65524
118*9880d681SAndroid Build Coastguard Worker; ELF64: lfiwax
119*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
120*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
121*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65520 = -16 + 0
122*9880d681SAndroid Build Coastguard Worker; ELF64LE: ori {{[0-9]+}}, {{[0-9]+}}, 65520
123*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfiwax
124*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfid
125*9880d681SAndroid Build Coastguard Worker; PPC970: std
126*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
127*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
128*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
129*9880d681SAndroid Build Coastguard Worker  ret void
130*9880d681SAndroid Build Coastguard Worker}
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i64(i64 %a, double %b) nounwind {
133*9880d681SAndroid Build Coastguard Workerentry:
134*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i64
135*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_double_i64
136*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_double_i64
137*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
138*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i64 %a to double
139*9880d681SAndroid Build Coastguard Worker; ELF64: std
140*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
141*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
142*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
143*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
144*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfid
145*9880d681SAndroid Build Coastguard Worker; PPC970: std
146*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
147*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
148*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
149*9880d681SAndroid Build Coastguard Worker  ret void
150*9880d681SAndroid Build Coastguard Worker}
151*9880d681SAndroid Build Coastguard Worker
152*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i16(i16 %a, double %b) nounwind {
153*9880d681SAndroid Build Coastguard Workerentry:
154*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i16
155*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_double_i16
156*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_double_i16
157*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
158*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i16 %a to double
159*9880d681SAndroid Build Coastguard Worker; ELF64: extsh
160*9880d681SAndroid Build Coastguard Worker; ELF64: std
161*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
162*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
163*9880d681SAndroid Build Coastguard Worker; ELF64LE: extsh
164*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
165*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
166*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfid
167*9880d681SAndroid Build Coastguard Worker; PPC970: extsh
168*9880d681SAndroid Build Coastguard Worker; PPC970: std
169*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
170*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
171*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
172*9880d681SAndroid Build Coastguard Worker  ret void
173*9880d681SAndroid Build Coastguard Worker}
174*9880d681SAndroid Build Coastguard Worker
175*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i8(i8 %a, double %b) nounwind {
176*9880d681SAndroid Build Coastguard Workerentry:
177*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i8
178*9880d681SAndroid Build Coastguard Worker; ELF64LE: sitofp_double_i8
179*9880d681SAndroid Build Coastguard Worker; PPC970: sitofp_double_i8
180*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
181*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i8 %a to double
182*9880d681SAndroid Build Coastguard Worker; ELF64: extsb
183*9880d681SAndroid Build Coastguard Worker; ELF64: std
184*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
185*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
186*9880d681SAndroid Build Coastguard Worker; ELF64LE: extsb
187*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
188*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
189*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfid
190*9880d681SAndroid Build Coastguard Worker; PPC970: extsb
191*9880d681SAndroid Build Coastguard Worker; PPC970: std
192*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
193*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
194*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
195*9880d681SAndroid Build Coastguard Worker  ret void
196*9880d681SAndroid Build Coastguard Worker}
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard Worker; Test uitofp
199*9880d681SAndroid Build Coastguard Worker
200*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_single_i64(i64 %a, float %b) nounwind {
201*9880d681SAndroid Build Coastguard Workerentry:
202*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_single_i64
203*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_single_i64
204*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_single_i64
205*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
206*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i64 %a to float
207*9880d681SAndroid Build Coastguard Worker; ELF64: std
208*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
209*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidus
210*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
211*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
212*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidus
213*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fcfidus
214*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
215*9880d681SAndroid Build Coastguard Worker  ret void
216*9880d681SAndroid Build Coastguard Worker}
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_single_i32(i32 %a, float %b) nounwind {
219*9880d681SAndroid Build Coastguard Workerentry:
220*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_single_i32
221*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_single_i32
222*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_single_i32
223*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
224*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i32 %a to float
225*9880d681SAndroid Build Coastguard Worker; ELF64: std
226*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65524 = -16 + 4
227*9880d681SAndroid Build Coastguard Worker; ELF64: ori {{[0-9]+}}, {{[0-9]+}}, 65524
228*9880d681SAndroid Build Coastguard Worker; ELF64: lfiwzx
229*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidus
230*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
231*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65520 = -16 + 0
232*9880d681SAndroid Build Coastguard Worker; ELF64LE: ori {{[0-9]+}}, {{[0-9]+}}, 65520
233*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfiwzx
234*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidus
235*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: lfiwzx
236*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fcfidus
237*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
238*9880d681SAndroid Build Coastguard Worker  ret void
239*9880d681SAndroid Build Coastguard Worker}
240*9880d681SAndroid Build Coastguard Worker
241*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_single_i16(i16 %a, float %b) nounwind {
242*9880d681SAndroid Build Coastguard Workerentry:
243*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_single_i16
244*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_single_i16
245*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_single_i16
246*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
247*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i16 %a to float
248*9880d681SAndroid Build Coastguard Worker; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
249*9880d681SAndroid Build Coastguard Worker; ELF64: std
250*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
251*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidus
252*9880d681SAndroid Build Coastguard Worker; ELF64LE: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
253*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
254*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
255*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidus
256*9880d681SAndroid Build Coastguard Worker; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
257*9880d681SAndroid Build Coastguard Worker; PPC970: std
258*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
259*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
260*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
261*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
262*9880d681SAndroid Build Coastguard Worker  ret void
263*9880d681SAndroid Build Coastguard Worker}
264*9880d681SAndroid Build Coastguard Worker
265*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_single_i8(i8 %a) nounwind {
266*9880d681SAndroid Build Coastguard Workerentry:
267*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_single_i8
268*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_single_i8
269*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_single_i8
270*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca float, align 4
271*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i8 %a to float
272*9880d681SAndroid Build Coastguard Worker; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
273*9880d681SAndroid Build Coastguard Worker; ELF64: std
274*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
275*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidus
276*9880d681SAndroid Build Coastguard Worker; ELF64LE: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
277*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
278*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
279*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidus
280*9880d681SAndroid Build Coastguard Worker; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
281*9880d681SAndroid Build Coastguard Worker; PPC970: std
282*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
283*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
284*9880d681SAndroid Build Coastguard Worker; PPC970: frsp
285*9880d681SAndroid Build Coastguard Worker  store float %conv, float* %b.addr, align 4
286*9880d681SAndroid Build Coastguard Worker  ret void
287*9880d681SAndroid Build Coastguard Worker}
288*9880d681SAndroid Build Coastguard Worker
289*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_double_i64(i64 %a, double %b) nounwind {
290*9880d681SAndroid Build Coastguard Workerentry:
291*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_double_i64
292*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_double_i64
293*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_double_i64
294*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
295*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i64 %a to double
296*9880d681SAndroid Build Coastguard Worker; ELF64: std
297*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
298*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidu
299*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
300*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
301*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidu
302*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fcfidu
303*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
304*9880d681SAndroid Build Coastguard Worker  ret void
305*9880d681SAndroid Build Coastguard Worker}
306*9880d681SAndroid Build Coastguard Worker
307*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_double_i32(i32 %a, double %b) nounwind {
308*9880d681SAndroid Build Coastguard Workerentry:
309*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_double_i32
310*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_double_i32
311*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_double_i32
312*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
313*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i32 %a to double
314*9880d681SAndroid Build Coastguard Worker; ELF64: std
315*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65524 = -16 + 4
316*9880d681SAndroid Build Coastguard Worker; ELF64: ori {{[0-9]+}}, {{[0-9]+}}, 65524
317*9880d681SAndroid Build Coastguard Worker; ELF64: lfiwzx
318*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidu
319*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
320*9880d681SAndroid Build Coastguard Worker; stack offset used to load the float: 65520 = -16 + 0
321*9880d681SAndroid Build Coastguard Worker; ELF64LE: ori {{[0-9]+}}, {{[0-9]+}}, 65520
322*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfiwzx
323*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidu
324*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: lfiwzx
325*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fcfidu
326*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
327*9880d681SAndroid Build Coastguard Worker  ret void
328*9880d681SAndroid Build Coastguard Worker}
329*9880d681SAndroid Build Coastguard Worker
330*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_double_i16(i16 %a, double %b) nounwind {
331*9880d681SAndroid Build Coastguard Workerentry:
332*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_double_i16
333*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_double_i16
334*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_double_i16
335*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
336*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i16 %a to double
337*9880d681SAndroid Build Coastguard Worker; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
338*9880d681SAndroid Build Coastguard Worker; ELF64: std
339*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
340*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidu
341*9880d681SAndroid Build Coastguard Worker; ELF64LE: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
342*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
343*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
344*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidu
345*9880d681SAndroid Build Coastguard Worker; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
346*9880d681SAndroid Build Coastguard Worker; PPC970: std
347*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
348*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
349*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
350*9880d681SAndroid Build Coastguard Worker  ret void
351*9880d681SAndroid Build Coastguard Worker}
352*9880d681SAndroid Build Coastguard Worker
353*9880d681SAndroid Build Coastguard Workerdefine void @uitofp_double_i8(i8 %a, double %b) nounwind {
354*9880d681SAndroid Build Coastguard Workerentry:
355*9880d681SAndroid Build Coastguard Worker; ELF64: uitofp_double_i8
356*9880d681SAndroid Build Coastguard Worker; ELF64LE: uitofp_double_i8
357*9880d681SAndroid Build Coastguard Worker; PPC970: uitofp_double_i8
358*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
359*9880d681SAndroid Build Coastguard Worker  %conv = uitofp i8 %a to double
360*9880d681SAndroid Build Coastguard Worker; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
361*9880d681SAndroid Build Coastguard Worker; ELF64: std
362*9880d681SAndroid Build Coastguard Worker; ELF64: lfd
363*9880d681SAndroid Build Coastguard Worker; ELF64: fcfidu
364*9880d681SAndroid Build Coastguard Worker; ELF64LE: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
365*9880d681SAndroid Build Coastguard Worker; ELF64LE: std
366*9880d681SAndroid Build Coastguard Worker; ELF64LE: lfd
367*9880d681SAndroid Build Coastguard Worker; ELF64LE: fcfidu
368*9880d681SAndroid Build Coastguard Worker; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
369*9880d681SAndroid Build Coastguard Worker; PPC970: std
370*9880d681SAndroid Build Coastguard Worker; PPC970: lfd
371*9880d681SAndroid Build Coastguard Worker; PPC970: fcfid
372*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
373*9880d681SAndroid Build Coastguard Worker  ret void
374*9880d681SAndroid Build Coastguard Worker}
375*9880d681SAndroid Build Coastguard Worker
376*9880d681SAndroid Build Coastguard Worker; Test fptosi
377*9880d681SAndroid Build Coastguard Worker
378*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_float_i32(float %a) nounwind {
379*9880d681SAndroid Build Coastguard Workerentry:
380*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_float_i32
381*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptosi_float_i32
382*9880d681SAndroid Build Coastguard Worker; PPC970: fptosi_float_i32
383*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 4
384*9880d681SAndroid Build Coastguard Worker  %conv = fptosi float %a to i32
385*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwz
386*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
387*9880d681SAndroid Build Coastguard Worker; ELF64: lwa
388*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiwz
389*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
390*9880d681SAndroid Build Coastguard Worker; ELF64LE: lwa
391*9880d681SAndroid Build Coastguard Worker; PPC970: fctiwz
392*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
393*9880d681SAndroid Build Coastguard Worker; PPC970: lwa
394*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 4
395*9880d681SAndroid Build Coastguard Worker  ret void
396*9880d681SAndroid Build Coastguard Worker}
397*9880d681SAndroid Build Coastguard Worker
398*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_float_i64(float %a) nounwind {
399*9880d681SAndroid Build Coastguard Workerentry:
400*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_float_i64
401*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptosi_float_i64
402*9880d681SAndroid Build Coastguard Worker; PPC970: fptosi_float_i64
403*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 4
404*9880d681SAndroid Build Coastguard Worker  %conv = fptosi float %a to i64
405*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
406*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
407*9880d681SAndroid Build Coastguard Worker; ELF64: ld
408*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctidz
409*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
410*9880d681SAndroid Build Coastguard Worker; ELF64LE: ld
411*9880d681SAndroid Build Coastguard Worker; PPC970: fctidz
412*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
413*9880d681SAndroid Build Coastguard Worker; PPC970: ld
414*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 4
415*9880d681SAndroid Build Coastguard Worker  ret void
416*9880d681SAndroid Build Coastguard Worker}
417*9880d681SAndroid Build Coastguard Worker
418*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_double_i32(double %a) nounwind {
419*9880d681SAndroid Build Coastguard Workerentry:
420*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_double_i32
421*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptosi_double_i32
422*9880d681SAndroid Build Coastguard Worker; PPC970: fptosi_double_i32
423*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 8
424*9880d681SAndroid Build Coastguard Worker  %conv = fptosi double %a to i32
425*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwz
426*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
427*9880d681SAndroid Build Coastguard Worker; ELF64: lwa
428*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiwz
429*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
430*9880d681SAndroid Build Coastguard Worker; ELF64LE: lwa
431*9880d681SAndroid Build Coastguard Worker; PPC970: fctiwz
432*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
433*9880d681SAndroid Build Coastguard Worker; PPC970: lwa
434*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 8
435*9880d681SAndroid Build Coastguard Worker  ret void
436*9880d681SAndroid Build Coastguard Worker}
437*9880d681SAndroid Build Coastguard Worker
438*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_double_i64(double %a) nounwind {
439*9880d681SAndroid Build Coastguard Workerentry:
440*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_double_i64
441*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptosi_double_i64
442*9880d681SAndroid Build Coastguard Worker; PPC970: fptosi_double_i64
443*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 8
444*9880d681SAndroid Build Coastguard Worker  %conv = fptosi double %a to i64
445*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
446*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
447*9880d681SAndroid Build Coastguard Worker; ELF64: ld
448*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctidz
449*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
450*9880d681SAndroid Build Coastguard Worker; ELF64LE: ld
451*9880d681SAndroid Build Coastguard Worker; PPC970: fctidz
452*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
453*9880d681SAndroid Build Coastguard Worker; PPC970: ld
454*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 8
455*9880d681SAndroid Build Coastguard Worker  ret void
456*9880d681SAndroid Build Coastguard Worker}
457*9880d681SAndroid Build Coastguard Worker
458*9880d681SAndroid Build Coastguard Worker; Test fptoui
459*9880d681SAndroid Build Coastguard Worker
460*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_float_i32(float %a) nounwind {
461*9880d681SAndroid Build Coastguard Workerentry:
462*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_float_i32
463*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptoui_float_i32
464*9880d681SAndroid Build Coastguard Worker; PPC970: fptoui_float_i32
465*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 4
466*9880d681SAndroid Build Coastguard Worker  %conv = fptoui float %a to i32
467*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwuz
468*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
469*9880d681SAndroid Build Coastguard Worker; ELF64: lwz
470*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiwuz
471*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
472*9880d681SAndroid Build Coastguard Worker; ELF64LE: lwz
473*9880d681SAndroid Build Coastguard Worker; PPC970: fctidz
474*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
475*9880d681SAndroid Build Coastguard Worker; PPC970: lwz
476*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 4
477*9880d681SAndroid Build Coastguard Worker  ret void
478*9880d681SAndroid Build Coastguard Worker}
479*9880d681SAndroid Build Coastguard Worker
480*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_float_i64(float %a) nounwind {
481*9880d681SAndroid Build Coastguard Workerentry:
482*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_float_i64
483*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptoui_float_i64
484*9880d681SAndroid Build Coastguard Worker; PPC970: fptoui_float_i64
485*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 4
486*9880d681SAndroid Build Coastguard Worker  %conv = fptoui float %a to i64
487*9880d681SAndroid Build Coastguard Worker; ELF64: fctiduz
488*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
489*9880d681SAndroid Build Coastguard Worker; ELF64: ld
490*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiduz
491*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
492*9880d681SAndroid Build Coastguard Worker; ELF64LE: ld
493*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fctiduz
494*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 4
495*9880d681SAndroid Build Coastguard Worker  ret void
496*9880d681SAndroid Build Coastguard Worker}
497*9880d681SAndroid Build Coastguard Worker
498*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_double_i32(double %a) nounwind {
499*9880d681SAndroid Build Coastguard Workerentry:
500*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_double_i32
501*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptoui_double_i32
502*9880d681SAndroid Build Coastguard Worker; PPC970: fptoui_double_i32
503*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 8
504*9880d681SAndroid Build Coastguard Worker  %conv = fptoui double %a to i32
505*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwuz
506*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
507*9880d681SAndroid Build Coastguard Worker; ELF64: lwz
508*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiwuz
509*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
510*9880d681SAndroid Build Coastguard Worker; ELF64LE: lwz
511*9880d681SAndroid Build Coastguard Worker; PPC970: fctidz
512*9880d681SAndroid Build Coastguard Worker; PPC970: stfd
513*9880d681SAndroid Build Coastguard Worker; PPC970: lwz
514*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 8
515*9880d681SAndroid Build Coastguard Worker  ret void
516*9880d681SAndroid Build Coastguard Worker}
517*9880d681SAndroid Build Coastguard Worker
518*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_double_i64(double %a) nounwind {
519*9880d681SAndroid Build Coastguard Workerentry:
520*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_double_i64
521*9880d681SAndroid Build Coastguard Worker; ELF64LE: fptoui_double_i64
522*9880d681SAndroid Build Coastguard Worker; PPC970: fptoui_double_i64
523*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 8
524*9880d681SAndroid Build Coastguard Worker  %conv = fptoui double %a to i64
525*9880d681SAndroid Build Coastguard Worker; ELF64: fctiduz
526*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
527*9880d681SAndroid Build Coastguard Worker; ELF64: ld
528*9880d681SAndroid Build Coastguard Worker; ELF64LE: fctiduz
529*9880d681SAndroid Build Coastguard Worker; ELF64LE: stfd
530*9880d681SAndroid Build Coastguard Worker; ELF64LE: ld
531*9880d681SAndroid Build Coastguard Worker; PPC970-NOT: fctiduz
532*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 8
533*9880d681SAndroid Build Coastguard Worker  ret void
534*9880d681SAndroid Build Coastguard Worker}
535