1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown -ppc-vsr-nums-as-vr \
3 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names < %s | FileCheck %s
4 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown -ppc-vsr-nums-as-vr \
5 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names < %s | FileCheck %s \
6 ; RUN: -check-prefix=CHECK-P8
8 ; Function Attrs: norecurse nounwind readnone
9 define fp128 @loadConstant() {
10 ; CHECK-LABEL: loadConstant:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: addis r3, r2, .LCPI0_0@toc@ha
13 ; CHECK-NEXT: addi r3, r3, .LCPI0_0@toc@l
14 ; CHECK-NEXT: lxv v2, 0(r3)
17 ; CHECK-P8-LABEL: loadConstant:
18 ; CHECK-P8: # %bb.0: # %entry
19 ; CHECK-P8-NEXT: addis r3, r2, .LCPI0_0@toc@ha
20 ; CHECK-P8-NEXT: addi r3, r3, .LCPI0_0@toc@l
21 ; CHECK-P8-NEXT: lvx v2, 0, r3
24 ret fp128 0xL00000000000000004001400000000000
27 ; Function Attrs: norecurse nounwind readnone
28 define fp128 @loadConstant2(fp128 %a, fp128 %b) {
29 ; CHECK-LABEL: loadConstant2:
30 ; CHECK: # %bb.0: # %entry
31 ; CHECK-NEXT: xsaddqp v2, v2, v3
32 ; CHECK-NEXT: addis r3, r2, .LCPI1_0@toc@ha
33 ; CHECK-NEXT: addi r3, r3, .LCPI1_0@toc@l
34 ; CHECK-NEXT: lxv v3, 0(r3)
35 ; CHECK-NEXT: xsaddqp v2, v2, v3
38 ; CHECK-P8-LABEL: loadConstant2:
39 ; CHECK-P8: # %bb.0: # %entry
40 ; CHECK-P8-NEXT: mflr r0
41 ; CHECK-P8-NEXT: std r0, 16(r1)
42 ; CHECK-P8-NEXT: stdu r1, -32(r1)
43 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
44 ; CHECK-P8-NEXT: .cfi_offset lr, 16
45 ; CHECK-P8-NEXT: bl __addkf3
47 ; CHECK-P8-NEXT: addis r3, r2, .LCPI1_0@toc@ha
48 ; CHECK-P8-NEXT: addi r3, r3, .LCPI1_0@toc@l
49 ; CHECK-P8-NEXT: lvx v3, 0, r3
50 ; CHECK-P8-NEXT: bl __addkf3
52 ; CHECK-P8-NEXT: addi r1, r1, 32
53 ; CHECK-P8-NEXT: ld r0, 16(r1)
54 ; CHECK-P8-NEXT: mtlr r0
57 %add = fadd fp128 %a, %b
58 %add1 = fadd fp128 %add, 0xL00000000000000004001400000000000
62 ; Test passing float128 by value.
63 ; Function Attrs: norecurse nounwind readnone
64 define signext i32 @fp128Param(fp128 %a) {
65 ; CHECK-LABEL: fp128Param:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: xscvqpswz v2, v2
68 ; CHECK-NEXT: mfvsrwz r3, v2
69 ; CHECK-NEXT: extsw r3, r3
72 ; CHECK-P8-LABEL: fp128Param:
73 ; CHECK-P8: # %bb.0: # %entry
74 ; CHECK-P8-NEXT: mflr r0
75 ; CHECK-P8-NEXT: std r0, 16(r1)
76 ; CHECK-P8-NEXT: stdu r1, -32(r1)
77 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
78 ; CHECK-P8-NEXT: .cfi_offset lr, 16
79 ; CHECK-P8-NEXT: bl __fixkfsi
81 ; CHECK-P8-NEXT: extsw r3, r3
82 ; CHECK-P8-NEXT: addi r1, r1, 32
83 ; CHECK-P8-NEXT: ld r0, 16(r1)
84 ; CHECK-P8-NEXT: mtlr r0
87 %conv = fptosi fp128 %a to i32
91 ; Test float128 as return value.
92 ; Function Attrs: norecurse nounwind readnone
93 define fp128 @fp128Return(fp128 %a, fp128 %b) {
94 ; CHECK-LABEL: fp128Return:
95 ; CHECK: # %bb.0: # %entry
96 ; CHECK-NEXT: xsaddqp v2, v2, v3
99 ; CHECK-P8-LABEL: fp128Return:
100 ; CHECK-P8: # %bb.0: # %entry
101 ; CHECK-P8-NEXT: mflr r0
102 ; CHECK-P8-NEXT: std r0, 16(r1)
103 ; CHECK-P8-NEXT: stdu r1, -32(r1)
104 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
105 ; CHECK-P8-NEXT: .cfi_offset lr, 16
106 ; CHECK-P8-NEXT: bl __addkf3
108 ; CHECK-P8-NEXT: addi r1, r1, 32
109 ; CHECK-P8-NEXT: ld r0, 16(r1)
110 ; CHECK-P8-NEXT: mtlr r0
113 %add = fadd fp128 %a, %b
117 ; array of float128 types
118 ; Function Attrs: norecurse nounwind readonly
119 define fp128 @fp128Array(fp128* nocapture readonly %farray,
120 ; CHECK-LABEL: fp128Array:
121 ; CHECK: # %bb.0: # %entry
122 ; CHECK-NEXT: sldi r4, r4, 4
123 ; CHECK-NEXT: lxv v2, 0(r3)
124 ; CHECK-NEXT: add r3, r3, r4
125 ; CHECK-NEXT: lxv v3, -16(r3)
126 ; CHECK-NEXT: xsaddqp v2, v2, v3
129 ; CHECK-P8-LABEL: fp128Array:
130 ; CHECK-P8: # %bb.0: # %entry
131 ; CHECK-P8-NEXT: mflr r0
132 ; CHECK-P8-NEXT: std r0, 16(r1)
133 ; CHECK-P8-NEXT: stdu r1, -32(r1)
134 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
135 ; CHECK-P8-NEXT: .cfi_offset lr, 16
136 ; CHECK-P8-NEXT: sldi r4, r4, 4
137 ; CHECK-P8-NEXT: lvx v2, 0, r3
138 ; CHECK-P8-NEXT: add r4, r3, r4
139 ; CHECK-P8-NEXT: addi r4, r4, -16
140 ; CHECK-P8-NEXT: lvx v3, 0, r4
141 ; CHECK-P8-NEXT: bl __addkf3
143 ; CHECK-P8-NEXT: addi r1, r1, 32
144 ; CHECK-P8-NEXT: ld r0, 16(r1)
145 ; CHECK-P8-NEXT: mtlr r0
147 i32 signext %loopcnt, fp128* nocapture readnone %sum) {
149 %0 = load fp128, fp128* %farray, align 16
150 %sub = add nsw i32 %loopcnt, -1
151 %idxprom = sext i32 %sub to i64
152 %arrayidx1 = getelementptr inbounds fp128, fp128* %farray, i64 %idxprom
153 %1 = load fp128, fp128* %arrayidx1, align 16
154 %add = fadd fp128 %0, %1
158 ; Up to 12 qualified floating-point arguments can be passed in v2-v13.
159 ; Function to test passing 13 float128 parameters.
160 ; Function Attrs: norecurse nounwind readnone
161 define fp128 @maxVecParam(fp128 %p1, fp128 %p2, fp128 %p3, fp128 %p4, fp128 %p5,
162 ; CHECK-LABEL: maxVecParam:
163 ; CHECK: # %bb.0: # %entry
164 ; CHECK-NEXT: xsaddqp v2, v2, v3
165 ; CHECK-NEXT: lxv v0, 224(r1)
166 ; CHECK-NEXT: xsaddqp v2, v2, v4
167 ; CHECK-NEXT: xsaddqp v2, v2, v5
168 ; CHECK-NEXT: xsaddqp v2, v2, v6
169 ; CHECK-NEXT: xsaddqp v2, v2, v7
170 ; CHECK-NEXT: xsaddqp v2, v2, v8
171 ; CHECK-NEXT: xsaddqp v2, v2, v9
172 ; CHECK-NEXT: xsaddqp v2, v2, v10
173 ; CHECK-NEXT: xsaddqp v2, v2, v11
174 ; CHECK-NEXT: xsaddqp v2, v2, v12
175 ; CHECK-NEXT: xsaddqp v2, v2, v13
176 ; CHECK-NEXT: xssubqp v2, v2, v0
179 ; CHECK-P8-LABEL: maxVecParam:
180 ; CHECK-P8: # %bb.0: # %entry
181 ; CHECK-P8-NEXT: mflr r0
182 ; CHECK-P8-NEXT: std r0, 16(r1)
183 ; CHECK-P8-NEXT: stdu r1, -224(r1)
184 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 224
185 ; CHECK-P8-NEXT: .cfi_offset lr, 16
186 ; CHECK-P8-NEXT: .cfi_offset v21, -176
187 ; CHECK-P8-NEXT: .cfi_offset v22, -160
188 ; CHECK-P8-NEXT: .cfi_offset v23, -144
189 ; CHECK-P8-NEXT: .cfi_offset v24, -128
190 ; CHECK-P8-NEXT: .cfi_offset v25, -112
191 ; CHECK-P8-NEXT: .cfi_offset v26, -96
192 ; CHECK-P8-NEXT: .cfi_offset v27, -80
193 ; CHECK-P8-NEXT: .cfi_offset v28, -64
194 ; CHECK-P8-NEXT: .cfi_offset v29, -48
195 ; CHECK-P8-NEXT: .cfi_offset v30, -32
196 ; CHECK-P8-NEXT: .cfi_offset v31, -16
197 ; CHECK-P8-NEXT: li r3, 48
198 ; CHECK-P8-NEXT: stvx v21, r1, r3 # 16-byte Folded Spill
199 ; CHECK-P8-NEXT: li r3, 64
200 ; CHECK-P8-NEXT: vmr v21, v4
201 ; CHECK-P8-NEXT: stvx v22, r1, r3 # 16-byte Folded Spill
202 ; CHECK-P8-NEXT: li r3, 80
203 ; CHECK-P8-NEXT: vmr v22, v5
204 ; CHECK-P8-NEXT: stvx v23, r1, r3 # 16-byte Folded Spill
205 ; CHECK-P8-NEXT: li r3, 96
206 ; CHECK-P8-NEXT: vmr v23, v6
207 ; CHECK-P8-NEXT: stvx v24, r1, r3 # 16-byte Folded Spill
208 ; CHECK-P8-NEXT: li r3, 112
209 ; CHECK-P8-NEXT: vmr v24, v7
210 ; CHECK-P8-NEXT: stvx v25, r1, r3 # 16-byte Folded Spill
211 ; CHECK-P8-NEXT: li r3, 128
212 ; CHECK-P8-NEXT: vmr v25, v8
213 ; CHECK-P8-NEXT: stvx v26, r1, r3 # 16-byte Folded Spill
214 ; CHECK-P8-NEXT: li r3, 144
215 ; CHECK-P8-NEXT: vmr v26, v9
216 ; CHECK-P8-NEXT: stvx v27, r1, r3 # 16-byte Folded Spill
217 ; CHECK-P8-NEXT: li r3, 160
218 ; CHECK-P8-NEXT: vmr v27, v10
219 ; CHECK-P8-NEXT: stvx v28, r1, r3 # 16-byte Folded Spill
220 ; CHECK-P8-NEXT: li r3, 176
221 ; CHECK-P8-NEXT: vmr v28, v11
222 ; CHECK-P8-NEXT: stvx v29, r1, r3 # 16-byte Folded Spill
223 ; CHECK-P8-NEXT: li r3, 192
224 ; CHECK-P8-NEXT: stvx v30, r1, r3 # 16-byte Folded Spill
225 ; CHECK-P8-NEXT: li r3, 208
226 ; CHECK-P8-NEXT: vmr v30, v12
227 ; CHECK-P8-NEXT: stvx v31, r1, r3 # 16-byte Folded Spill
228 ; CHECK-P8-NEXT: addi r3, r1, 448
229 ; CHECK-P8-NEXT: vmr v31, v13
230 ; CHECK-P8-NEXT: lvx v29, 0, r3
231 ; CHECK-P8-NEXT: bl __addkf3
233 ; CHECK-P8-NEXT: vmr v3, v21
234 ; CHECK-P8-NEXT: bl __addkf3
236 ; CHECK-P8-NEXT: vmr v3, v22
237 ; CHECK-P8-NEXT: bl __addkf3
239 ; CHECK-P8-NEXT: vmr v3, v23
240 ; CHECK-P8-NEXT: bl __addkf3
242 ; CHECK-P8-NEXT: vmr v3, v24
243 ; CHECK-P8-NEXT: bl __addkf3
245 ; CHECK-P8-NEXT: vmr v3, v25
246 ; CHECK-P8-NEXT: bl __addkf3
248 ; CHECK-P8-NEXT: vmr v3, v26
249 ; CHECK-P8-NEXT: bl __addkf3
251 ; CHECK-P8-NEXT: vmr v3, v27
252 ; CHECK-P8-NEXT: bl __addkf3
254 ; CHECK-P8-NEXT: vmr v3, v28
255 ; CHECK-P8-NEXT: bl __addkf3
257 ; CHECK-P8-NEXT: vmr v3, v30
258 ; CHECK-P8-NEXT: bl __addkf3
260 ; CHECK-P8-NEXT: vmr v3, v31
261 ; CHECK-P8-NEXT: bl __addkf3
263 ; CHECK-P8-NEXT: vmr v3, v29
264 ; CHECK-P8-NEXT: bl __subkf3
266 ; CHECK-P8-NEXT: li r3, 208
267 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
268 ; CHECK-P8-NEXT: li r3, 192
269 ; CHECK-P8-NEXT: lvx v30, r1, r3 # 16-byte Folded Reload
270 ; CHECK-P8-NEXT: li r3, 176
271 ; CHECK-P8-NEXT: lvx v29, r1, r3 # 16-byte Folded Reload
272 ; CHECK-P8-NEXT: li r3, 160
273 ; CHECK-P8-NEXT: lvx v28, r1, r3 # 16-byte Folded Reload
274 ; CHECK-P8-NEXT: li r3, 144
275 ; CHECK-P8-NEXT: lvx v27, r1, r3 # 16-byte Folded Reload
276 ; CHECK-P8-NEXT: li r3, 128
277 ; CHECK-P8-NEXT: lvx v26, r1, r3 # 16-byte Folded Reload
278 ; CHECK-P8-NEXT: li r3, 112
279 ; CHECK-P8-NEXT: lvx v25, r1, r3 # 16-byte Folded Reload
280 ; CHECK-P8-NEXT: li r3, 96
281 ; CHECK-P8-NEXT: lvx v24, r1, r3 # 16-byte Folded Reload
282 ; CHECK-P8-NEXT: li r3, 80
283 ; CHECK-P8-NEXT: lvx v23, r1, r3 # 16-byte Folded Reload
284 ; CHECK-P8-NEXT: li r3, 64
285 ; CHECK-P8-NEXT: lvx v22, r1, r3 # 16-byte Folded Reload
286 ; CHECK-P8-NEXT: li r3, 48
287 ; CHECK-P8-NEXT: lvx v21, r1, r3 # 16-byte Folded Reload
288 ; CHECK-P8-NEXT: addi r1, r1, 224
289 ; CHECK-P8-NEXT: ld r0, 16(r1)
290 ; CHECK-P8-NEXT: mtlr r0
292 fp128 %p6, fp128 %p7, fp128 %p8, fp128 %p9, fp128 %p10,
293 fp128 %p11, fp128 %p12, fp128 %p13) {
295 %add = fadd fp128 %p1, %p2
296 %add1 = fadd fp128 %add, %p3
297 %add2 = fadd fp128 %add1, %p4
298 %add3 = fadd fp128 %add2, %p5
299 %add4 = fadd fp128 %add3, %p6
300 %add5 = fadd fp128 %add4, %p7
301 %add6 = fadd fp128 %add5, %p8
302 %add7 = fadd fp128 %add6, %p9
303 %add8 = fadd fp128 %add7, %p10
304 %add9 = fadd fp128 %add8, %p11
305 %add10 = fadd fp128 %add9, %p12
306 %sub = fsub fp128 %add10, %p13
310 ; Passing a mix of float128 and other type parameters.
311 ; Function Attrs: norecurse nounwind readnone
312 define fp128 @mixParam_01(fp128 %a, i32 signext %i, fp128 %b) {
313 ; CHECK-LABEL: mixParam_01:
314 ; CHECK: # %bb.0: # %entry
315 ; CHECK-NEXT: xsaddqp v2, v2, v3
316 ; CHECK-NEXT: mtvsrwa v3, r5
317 ; CHECK-NEXT: xscvsdqp v3, v3
318 ; CHECK-NEXT: xsaddqp v2, v2, v3
321 ; CHECK-P8-LABEL: mixParam_01:
322 ; CHECK-P8: # %bb.0: # %entry
323 ; CHECK-P8-NEXT: mflr r0
324 ; CHECK-P8-NEXT: std r0, 16(r1)
325 ; CHECK-P8-NEXT: stdu r1, -80(r1)
326 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
327 ; CHECK-P8-NEXT: .cfi_offset lr, 16
328 ; CHECK-P8-NEXT: .cfi_offset r30, -16
329 ; CHECK-P8-NEXT: .cfi_offset v31, -32
330 ; CHECK-P8-NEXT: li r3, 48
331 ; CHECK-P8-NEXT: std r30, 64(r1) # 8-byte Folded Spill
332 ; CHECK-P8-NEXT: mr r30, r5
333 ; CHECK-P8-NEXT: stvx v31, r1, r3 # 16-byte Folded Spill
334 ; CHECK-P8-NEXT: bl __addkf3
336 ; CHECK-P8-NEXT: mr r3, r30
337 ; CHECK-P8-NEXT: vmr v31, v2
338 ; CHECK-P8-NEXT: bl __floatsikf
340 ; CHECK-P8-NEXT: vmr v3, v2
341 ; CHECK-P8-NEXT: vmr v2, v31
342 ; CHECK-P8-NEXT: bl __addkf3
344 ; CHECK-P8-NEXT: li r3, 48
345 ; CHECK-P8-NEXT: ld r30, 64(r1) # 8-byte Folded Reload
346 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
347 ; CHECK-P8-NEXT: addi r1, r1, 80
348 ; CHECK-P8-NEXT: ld r0, 16(r1)
349 ; CHECK-P8-NEXT: mtlr r0
352 %add = fadd fp128 %a, %b
353 %conv = sitofp i32 %i to fp128
354 %add1 = fadd fp128 %add, %conv
357 ; Function Attrs: norecurse nounwind readnone
358 define fastcc fp128 @mixParam_01f(fp128 %a, i32 signext %i, fp128 %b) {
359 ; CHECK-LABEL: mixParam_01f:
360 ; CHECK: # %bb.0: # %entry
361 ; CHECK-NEXT: xsaddqp v2, v2, v3
362 ; CHECK-NEXT: mtvsrwa v3, r3
363 ; CHECK-NEXT: xscvsdqp v3, v3
364 ; CHECK-NEXT: xsaddqp v2, v2, v3
367 ; CHECK-P8-LABEL: mixParam_01f:
368 ; CHECK-P8: # %bb.0: # %entry
369 ; CHECK-P8-NEXT: mflr r0
370 ; CHECK-P8-NEXT: std r0, 16(r1)
371 ; CHECK-P8-NEXT: stdu r1, -80(r1)
372 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
373 ; CHECK-P8-NEXT: .cfi_offset lr, 16
374 ; CHECK-P8-NEXT: .cfi_offset r30, -16
375 ; CHECK-P8-NEXT: .cfi_offset v31, -32
376 ; CHECK-P8-NEXT: li r4, 48
377 ; CHECK-P8-NEXT: std r30, 64(r1) # 8-byte Folded Spill
378 ; CHECK-P8-NEXT: mr r30, r3
379 ; CHECK-P8-NEXT: stvx v31, r1, r4 # 16-byte Folded Spill
380 ; CHECK-P8-NEXT: bl __addkf3
382 ; CHECK-P8-NEXT: mr r3, r30
383 ; CHECK-P8-NEXT: vmr v31, v2
384 ; CHECK-P8-NEXT: bl __floatsikf
386 ; CHECK-P8-NEXT: vmr v3, v2
387 ; CHECK-P8-NEXT: vmr v2, v31
388 ; CHECK-P8-NEXT: bl __addkf3
390 ; CHECK-P8-NEXT: li r3, 48
391 ; CHECK-P8-NEXT: ld r30, 64(r1) # 8-byte Folded Reload
392 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
393 ; CHECK-P8-NEXT: addi r1, r1, 80
394 ; CHECK-P8-NEXT: ld r0, 16(r1)
395 ; CHECK-P8-NEXT: mtlr r0
398 %add = fadd fp128 %a, %b
399 %conv = sitofp i32 %i to fp128
400 %add1 = fadd fp128 %add, %conv
404 ; Function Attrs: norecurse nounwind
405 define fp128 @mixParam_02(fp128 %p1, double %p2, i64* nocapture %p3,
406 ; CHECK-LABEL: mixParam_02:
407 ; CHECK: # %bb.0: # %entry
408 ; CHECK-NEXT: lwz r3, 96(r1)
409 ; CHECK-NEXT: add r4, r7, r9
410 ; CHECK-NEXT: xscpsgndp v3, f1, f1
411 ; CHECK-NEXT: add r4, r4, r10
412 ; CHECK-NEXT: xscvdpqp v3, v3
413 ; CHECK-NEXT: add r3, r4, r3
414 ; CHECK-NEXT: clrldi r3, r3, 32
415 ; CHECK-NEXT: std r3, 0(r6)
416 ; CHECK-NEXT: lxv v4, 0(r8)
417 ; CHECK-NEXT: xsaddqp v2, v4, v2
418 ; CHECK-NEXT: xsaddqp v2, v2, v3
421 ; CHECK-P8-LABEL: mixParam_02:
422 ; CHECK-P8: # %bb.0: # %entry
423 ; CHECK-P8-NEXT: mflr r0
424 ; CHECK-P8-NEXT: std r0, 16(r1)
425 ; CHECK-P8-NEXT: stdu r1, -80(r1)
426 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
427 ; CHECK-P8-NEXT: .cfi_offset lr, 16
428 ; CHECK-P8-NEXT: .cfi_offset f31, -8
429 ; CHECK-P8-NEXT: .cfi_offset v31, -32
430 ; CHECK-P8-NEXT: li r3, 48
431 ; CHECK-P8-NEXT: add r4, r7, r9
432 ; CHECK-P8-NEXT: vmr v4, v2
433 ; CHECK-P8-NEXT: stfd f31, 72(r1) # 8-byte Folded Spill
434 ; CHECK-P8-NEXT: stvx v31, r1, r3 # 16-byte Folded Spill
435 ; CHECK-P8-NEXT: lwz r3, 176(r1)
436 ; CHECK-P8-NEXT: add r4, r4, r10
437 ; CHECK-P8-NEXT: fmr f31, f1
438 ; CHECK-P8-NEXT: add r3, r4, r3
439 ; CHECK-P8-NEXT: clrldi r3, r3, 32
440 ; CHECK-P8-NEXT: std r3, 0(r6)
441 ; CHECK-P8-NEXT: lvx v3, 0, r8
442 ; CHECK-P8-NEXT: vmr v2, v3
443 ; CHECK-P8-NEXT: vmr v3, v4
444 ; CHECK-P8-NEXT: bl __addkf3
446 ; CHECK-P8-NEXT: fmr f1, f31
447 ; CHECK-P8-NEXT: vmr v31, v2
448 ; CHECK-P8-NEXT: bl __extenddfkf2
450 ; CHECK-P8-NEXT: vmr v3, v2
451 ; CHECK-P8-NEXT: vmr v2, v31
452 ; CHECK-P8-NEXT: bl __addkf3
454 ; CHECK-P8-NEXT: li r3, 48
455 ; CHECK-P8-NEXT: lfd f31, 72(r1) # 8-byte Folded Reload
456 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
457 ; CHECK-P8-NEXT: addi r1, r1, 80
458 ; CHECK-P8-NEXT: ld r0, 16(r1)
459 ; CHECK-P8-NEXT: mtlr r0
461 i16 signext %p4, fp128* nocapture readonly %p5,
462 i32 signext %p6, i8 zeroext %p7, i32 zeroext %p8) {
464 %conv = sext i16 %p4 to i32
465 %add = add nsw i32 %conv, %p6
466 %conv1 = zext i8 %p7 to i32
467 %add2 = add nsw i32 %add, %conv1
468 %add3 = add i32 %add2, %p8
469 %conv4 = zext i32 %add3 to i64
470 store i64 %conv4, i64* %p3, align 8
471 %0 = load fp128, fp128* %p5, align 16
472 %add5 = fadd fp128 %0, %p1
473 %conv6 = fpext double %p2 to fp128
474 %add7 = fadd fp128 %add5, %conv6
478 ; Function Attrs: norecurse nounwind
479 define fastcc fp128 @mixParam_02f(fp128 %p1, double %p2, i64* nocapture %p3,
480 ; CHECK-LABEL: mixParam_02f:
481 ; CHECK: # %bb.0: # %entry
482 ; CHECK-NEXT: add r4, r4, r6
483 ; CHECK-NEXT: xscpsgndp v3, f1, f1
484 ; CHECK-NEXT: add r4, r4, r7
485 ; CHECK-NEXT: xscvdpqp v3, v3
486 ; CHECK-NEXT: add r4, r4, r8
487 ; CHECK-NEXT: clrldi r4, r4, 32
488 ; CHECK-NEXT: std r4, 0(r3)
489 ; CHECK-NEXT: lxv v4, 0(r5)
490 ; CHECK-NEXT: xsaddqp v2, v4, v2
491 ; CHECK-NEXT: xsaddqp v2, v2, v3
494 ; CHECK-P8-LABEL: mixParam_02f:
495 ; CHECK-P8: # %bb.0: # %entry
496 ; CHECK-P8-NEXT: mflr r0
497 ; CHECK-P8-NEXT: std r0, 16(r1)
498 ; CHECK-P8-NEXT: stdu r1, -80(r1)
499 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
500 ; CHECK-P8-NEXT: .cfi_offset lr, 16
501 ; CHECK-P8-NEXT: .cfi_offset f31, -8
502 ; CHECK-P8-NEXT: .cfi_offset v31, -32
503 ; CHECK-P8-NEXT: add r4, r4, r6
504 ; CHECK-P8-NEXT: vmr v4, v2
505 ; CHECK-P8-NEXT: li r9, 48
506 ; CHECK-P8-NEXT: stfd f31, 72(r1) # 8-byte Folded Spill
507 ; CHECK-P8-NEXT: add r4, r4, r7
508 ; CHECK-P8-NEXT: stvx v31, r1, r9 # 16-byte Folded Spill
509 ; CHECK-P8-NEXT: fmr f31, f1
510 ; CHECK-P8-NEXT: add r4, r4, r8
511 ; CHECK-P8-NEXT: clrldi r4, r4, 32
512 ; CHECK-P8-NEXT: std r4, 0(r3)
513 ; CHECK-P8-NEXT: lvx v3, 0, r5
514 ; CHECK-P8-NEXT: vmr v2, v3
515 ; CHECK-P8-NEXT: vmr v3, v4
516 ; CHECK-P8-NEXT: bl __addkf3
518 ; CHECK-P8-NEXT: fmr f1, f31
519 ; CHECK-P8-NEXT: vmr v31, v2
520 ; CHECK-P8-NEXT: bl __extenddfkf2
522 ; CHECK-P8-NEXT: vmr v3, v2
523 ; CHECK-P8-NEXT: vmr v2, v31
524 ; CHECK-P8-NEXT: bl __addkf3
526 ; CHECK-P8-NEXT: li r3, 48
527 ; CHECK-P8-NEXT: lfd f31, 72(r1) # 8-byte Folded Reload
528 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
529 ; CHECK-P8-NEXT: addi r1, r1, 80
530 ; CHECK-P8-NEXT: ld r0, 16(r1)
531 ; CHECK-P8-NEXT: mtlr r0
533 i16 signext %p4, fp128* nocapture readonly %p5,
534 i32 signext %p6, i8 zeroext %p7, i32 zeroext %p8) {
536 %conv = sext i16 %p4 to i32
537 %add = add nsw i32 %conv, %p6
538 %conv1 = zext i8 %p7 to i32
539 %add2 = add nsw i32 %add, %conv1
540 %add3 = add i32 %add2, %p8
541 %conv4 = zext i32 %add3 to i64
542 store i64 %conv4, i64* %p3, align 8
543 %0 = load fp128, fp128* %p5, align 16
544 %add5 = fadd fp128 %0, %p1
545 %conv6 = fpext double %p2 to fp128
546 %add7 = fadd fp128 %add5, %conv6
550 ; Passing a mix of float128 and vector parameters.
551 ; Function Attrs: norecurse nounwind
552 define void @mixParam_03(fp128 %f1, double* nocapture %d1, <4 x i32> %vec1,
553 ; CHECK-LABEL: mixParam_03:
554 ; CHECK: # %bb.0: # %entry
555 ; CHECK-NEXT: ld r3, 104(r1)
556 ; CHECK-NEXT: stxv v2, 0(r9)
557 ; CHECK-NEXT: stxv v3, 0(r3)
558 ; CHECK-NEXT: mtvsrwa v3, r10
559 ; CHECK-NEXT: lxv v2, 0(r9)
560 ; CHECK-NEXT: xscvsdqp v3, v3
561 ; CHECK-NEXT: xsaddqp v2, v2, v3
562 ; CHECK-NEXT: xscvqpdp v2, v2
563 ; CHECK-NEXT: stxsd v2, 0(r5)
566 ; CHECK-P8-LABEL: mixParam_03:
567 ; CHECK-P8: # %bb.0: # %entry
568 ; CHECK-P8-NEXT: mflr r0
569 ; CHECK-P8-NEXT: std r0, 16(r1)
570 ; CHECK-P8-NEXT: stdu r1, -80(r1)
571 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
572 ; CHECK-P8-NEXT: .cfi_offset lr, 16
573 ; CHECK-P8-NEXT: .cfi_offset r30, -16
574 ; CHECK-P8-NEXT: .cfi_offset v31, -32
575 ; CHECK-P8-NEXT: ld r4, 184(r1)
576 ; CHECK-P8-NEXT: li r3, 48
577 ; CHECK-P8-NEXT: stvx v2, 0, r9
578 ; CHECK-P8-NEXT: std r30, 64(r1) # 8-byte Folded Spill
579 ; CHECK-P8-NEXT: mr r30, r5
580 ; CHECK-P8-NEXT: stvx v31, r1, r3 # 16-byte Folded Spill
581 ; CHECK-P8-NEXT: mr r3, r10
582 ; CHECK-P8-NEXT: stvx v3, 0, r4
583 ; CHECK-P8-NEXT: lvx v31, 0, r9
584 ; CHECK-P8-NEXT: bl __floatsikf
586 ; CHECK-P8-NEXT: vmr v3, v2
587 ; CHECK-P8-NEXT: vmr v2, v31
588 ; CHECK-P8-NEXT: bl __addkf3
590 ; CHECK-P8-NEXT: bl __trunckfdf2
592 ; CHECK-P8-NEXT: li r3, 48
593 ; CHECK-P8-NEXT: stfd f1, 0(r30)
594 ; CHECK-P8-NEXT: ld r30, 64(r1) # 8-byte Folded Reload
595 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
596 ; CHECK-P8-NEXT: addi r1, r1, 80
597 ; CHECK-P8-NEXT: ld r0, 16(r1)
598 ; CHECK-P8-NEXT: mtlr r0
600 fp128* nocapture %f2, i32 signext %i1, i8 zeroext %c1,
601 <4 x i32>* nocapture %vec2) {
603 store fp128 %f1, fp128* %f2, align 16
604 store <4 x i32> %vec1, <4 x i32>* %vec2, align 16
605 %0 = load fp128, fp128* %f2, align 16
606 %conv = sitofp i32 %i1 to fp128
607 %add = fadd fp128 %0, %conv
608 %conv1 = fptrunc fp128 %add to double
609 store double %conv1, double* %d1, align 8
613 ; Function Attrs: norecurse nounwind
614 define fastcc void @mixParam_03f(fp128 %f1, double* nocapture %d1, <4 x i32> %vec1,
615 ; CHECK-LABEL: mixParam_03f:
616 ; CHECK: # %bb.0: # %entry
617 ; CHECK-NEXT: stxv v2, 0(r4)
618 ; CHECK-NEXT: stxv v3, 0(r7)
619 ; CHECK-NEXT: lxv v2, 0(r4)
620 ; CHECK-NEXT: mtvsrwa v3, r5
621 ; CHECK-NEXT: xscvsdqp v3, v3
622 ; CHECK-NEXT: xsaddqp v2, v2, v3
623 ; CHECK-NEXT: xscvqpdp v2, v2
624 ; CHECK-NEXT: stxsd v2, 0(r3)
627 ; CHECK-P8-LABEL: mixParam_03f:
628 ; CHECK-P8: # %bb.0: # %entry
629 ; CHECK-P8-NEXT: mflr r0
630 ; CHECK-P8-NEXT: std r0, 16(r1)
631 ; CHECK-P8-NEXT: stdu r1, -80(r1)
632 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 80
633 ; CHECK-P8-NEXT: .cfi_offset lr, 16
634 ; CHECK-P8-NEXT: .cfi_offset r30, -16
635 ; CHECK-P8-NEXT: .cfi_offset v31, -32
636 ; CHECK-P8-NEXT: li r6, 48
637 ; CHECK-P8-NEXT: stvx v2, 0, r4
638 ; CHECK-P8-NEXT: stvx v3, 0, r7
639 ; CHECK-P8-NEXT: std r30, 64(r1) # 8-byte Folded Spill
640 ; CHECK-P8-NEXT: mr r30, r3
641 ; CHECK-P8-NEXT: mr r3, r5
642 ; CHECK-P8-NEXT: stvx v31, r1, r6 # 16-byte Folded Spill
643 ; CHECK-P8-NEXT: lvx v31, 0, r4
644 ; CHECK-P8-NEXT: bl __floatsikf
646 ; CHECK-P8-NEXT: vmr v3, v2
647 ; CHECK-P8-NEXT: vmr v2, v31
648 ; CHECK-P8-NEXT: bl __addkf3
650 ; CHECK-P8-NEXT: bl __trunckfdf2
652 ; CHECK-P8-NEXT: li r3, 48
653 ; CHECK-P8-NEXT: stfd f1, 0(r30)
654 ; CHECK-P8-NEXT: ld r30, 64(r1) # 8-byte Folded Reload
655 ; CHECK-P8-NEXT: lvx v31, r1, r3 # 16-byte Folded Reload
656 ; CHECK-P8-NEXT: addi r1, r1, 80
657 ; CHECK-P8-NEXT: ld r0, 16(r1)
658 ; CHECK-P8-NEXT: mtlr r0
660 fp128* nocapture %f2, i32 signext %i1, i8 zeroext %c1,
661 <4 x i32>* nocapture %vec2) {
663 store fp128 %f1, fp128* %f2, align 16
664 store <4 x i32> %vec1, <4 x i32>* %vec2, align 16
665 %0 = load fp128, fp128* %f2, align 16
666 %conv = sitofp i32 %i1 to fp128
667 %add = fadd fp128 %0, %conv
668 %conv1 = fptrunc fp128 %add to double
669 store double %conv1, double* %d1, align 8
673 ; Function Attrs: noinline optnone
674 define signext i32 @noopt_call_crash() #0 {
675 ; CHECK-LABEL: noopt_call_crash:
676 ; CHECK: # %bb.0: # %entry
677 ; CHECK-NEXT: mflr r0
678 ; CHECK-NEXT: std r0, 16(r1)
679 ; CHECK-NEXT: stdu r1, -96(r1)
680 ; CHECK-NEXT: .cfi_def_cfa_offset 96
681 ; CHECK-NEXT: .cfi_offset lr, 16
686 ; CHECK-NEXT: li r3, 0
687 ; CHECK-NEXT: addi r1, r1, 96
688 ; CHECK-NEXT: ld r0, 16(r1)
689 ; CHECK-NEXT: mtlr r0
692 ; CHECK-P8-LABEL: noopt_call_crash:
693 ; CHECK-P8: # %bb.0: # %entry
694 ; CHECK-P8-NEXT: mflr r0
695 ; CHECK-P8-NEXT: std r0, 16(r1)
696 ; CHECK-P8-NEXT: stdu r1, -96(r1)
697 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 96
698 ; CHECK-P8-NEXT: .cfi_offset lr, 16
699 ; CHECK-P8-NEXT: bl in
701 ; CHECK-P8-NEXT: bl out
703 ; CHECK-P8-NEXT: li r3, 0
704 ; CHECK-P8-NEXT: addi r1, r1, 96
705 ; CHECK-P8-NEXT: ld r0, 16(r1)
706 ; CHECK-P8-NEXT: mtlr r0
709 %call = call fp128 @in()
710 call void @out(fp128 %call)
714 declare void @out(fp128)
717 attributes #0 = { noinline optnone }