1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -global-isel < %s \
3 ; RUN: | FileCheck -check-prefixes=CHECK,RV64I %s
4 ; RUN: llc -mtriple=riscv64 -global-isel -mattr=+d < %s \
5 ; RUN: | FileCheck -check-prefixes=CHECK,RV64D %s
9 define fp128 @fadd(fp128 %x, fp128 %y) nounwind {
12 ; CHECK-NEXT: addi sp, sp, -16
13 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
14 ; CHECK-NEXT: call __addtf3
15 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
16 ; CHECK-NEXT: addi sp, sp, 16
18 %a = fadd fp128 %x, %y
22 define fp128 @fsub(fp128 %x, fp128 %y) nounwind {
25 ; CHECK-NEXT: addi sp, sp, -16
26 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
27 ; CHECK-NEXT: call __subtf3
28 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
29 ; CHECK-NEXT: addi sp, sp, 16
31 %a = fsub fp128 %x, %y
35 define fp128 @fmul(fp128 %x, fp128 %y) nounwind {
38 ; CHECK-NEXT: addi sp, sp, -16
39 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
40 ; CHECK-NEXT: call __multf3
41 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
42 ; CHECK-NEXT: addi sp, sp, 16
44 %a = fmul fp128 %x, %y
48 define fp128 @fdiv(fp128 %x, fp128 %y) nounwind {
51 ; CHECK-NEXT: addi sp, sp, -16
52 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
53 ; CHECK-NEXT: call __divtf3
54 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
55 ; CHECK-NEXT: addi sp, sp, 16
57 %a = fdiv fp128 %x, %y
61 define fp128 @frem(fp128 %x, fp128 %y) nounwind {
64 ; CHECK-NEXT: addi sp, sp, -16
65 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
66 ; CHECK-NEXT: call fmodl
67 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
68 ; CHECK-NEXT: addi sp, sp, 16
70 %a = frem fp128 %x, %y
74 define fp128 @fma(fp128 %x, fp128 %y, fp128 %z) nounwind {
77 ; CHECK-NEXT: addi sp, sp, -16
78 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
79 ; CHECK-NEXT: call fmal
80 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
81 ; CHECK-NEXT: addi sp, sp, 16
83 %a = call fp128 @llvm.fma.f128(fp128 %x, fp128 %y, fp128 %z)
87 define fp128 @fneg(fp128 %x) {
90 ; CHECK-NEXT: li a2, -1
91 ; CHECK-NEXT: slli a2, a2, 63
92 ; CHECK-NEXT: xor a1, a1, a2
98 define fp128 @fabs(fp128 %x) {
101 ; CHECK-NEXT: slli a1, a1, 1
102 ; CHECK-NEXT: srli a1, a1, 1
104 %a = call fp128 @llvm.fabs.f128(fp128 %x)
108 define fp128 @fcopysign(fp128 %x, fp128 %y) {
109 ; CHECK-LABEL: fcopysign:
111 ; CHECK-NEXT: slli a1, a1, 1
112 ; CHECK-NEXT: srli a3, a3, 63
113 ; CHECK-NEXT: srli a1, a1, 1
114 ; CHECK-NEXT: slli a3, a3, 63
115 ; CHECK-NEXT: or a1, a1, a3
117 %a = call fp128 @llvm.copysign.f128(fp128 %x, fp128 %y)
121 define i1 @fcmp(fp128 %x, fp128 %y) nounwind {
124 ; CHECK-NEXT: addi sp, sp, -16
125 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
126 ; CHECK-NEXT: call __eqtf2
127 ; CHECK-NEXT: sext.w a0, a0
128 ; CHECK-NEXT: seqz a0, a0
129 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
130 ; CHECK-NEXT: addi sp, sp, 16
132 %a = fcmp oeq fp128 %x, %y
136 define fp128 @constant(fp128 %x) nounwind {
137 ; CHECK-LABEL: constant:
139 ; CHECK-NEXT: addi sp, sp, -16
140 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
141 ; CHECK-NEXT: lui a2, %hi(.LCPI10_0)
142 ; CHECK-NEXT: addi a3, a2, %lo(.LCPI10_0)
143 ; CHECK-NEXT: ld a2, 0(a3)
144 ; CHECK-NEXT: ld a3, 8(a3)
145 ; CHECK-NEXT: call __addtf3
146 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
147 ; CHECK-NEXT: addi sp, sp, 16
149 %a = fadd fp128 %x, 0xL00000000000000007FFF000000000000
153 define fp128 @fpext_f32(float %x, float %y) nounwind {
154 ; RV64I-LABEL: fpext_f32:
156 ; RV64I-NEXT: addi sp, sp, -16
157 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
158 ; RV64I-NEXT: call __addsf3
159 ; RV64I-NEXT: call __extendsftf2
160 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
161 ; RV64I-NEXT: addi sp, sp, 16
164 ; RV64D-LABEL: fpext_f32:
166 ; RV64D-NEXT: addi sp, sp, -16
167 ; RV64D-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
168 ; RV64D-NEXT: fadd.s fa0, fa0, fa1
169 ; RV64D-NEXT: call __extendsftf2
170 ; RV64D-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
171 ; RV64D-NEXT: addi sp, sp, 16
173 %a = fadd float %x, %y
174 %b = fpext float %a to fp128
178 define fp128 @fpext_f64(double %x, double %y) nounwind {
179 ; RV64I-LABEL: fpext_f64:
181 ; RV64I-NEXT: addi sp, sp, -16
182 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
183 ; RV64I-NEXT: call __adddf3
184 ; RV64I-NEXT: call __extenddftf2
185 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
186 ; RV64I-NEXT: addi sp, sp, 16
189 ; RV64D-LABEL: fpext_f64:
191 ; RV64D-NEXT: addi sp, sp, -16
192 ; RV64D-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
193 ; RV64D-NEXT: fadd.d fa0, fa0, fa1
194 ; RV64D-NEXT: call __extenddftf2
195 ; RV64D-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
196 ; RV64D-NEXT: addi sp, sp, 16
198 %a = fadd double %x, %y
199 %b = fpext double %a to fp128
203 define float @fptrunc_f32(fp128 %x, float %y) nounwind {
204 ; RV64I-LABEL: fptrunc_f32:
206 ; RV64I-NEXT: addi sp, sp, -16
207 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
208 ; RV64I-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
209 ; RV64I-NEXT: mv s0, a2
210 ; RV64I-NEXT: call __trunctfsf2
211 ; RV64I-NEXT: mv a1, s0
212 ; RV64I-NEXT: call __addsf3
213 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
214 ; RV64I-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
215 ; RV64I-NEXT: addi sp, sp, 16
218 ; RV64D-LABEL: fptrunc_f32:
220 ; RV64D-NEXT: addi sp, sp, -16
221 ; RV64D-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
222 ; RV64D-NEXT: fsd fs0, 0(sp) # 8-byte Folded Spill
223 ; RV64D-NEXT: fmv.s fs0, fa0
224 ; RV64D-NEXT: call __trunctfsf2
225 ; RV64D-NEXT: fadd.s fa0, fa0, fs0
226 ; RV64D-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
227 ; RV64D-NEXT: fld fs0, 0(sp) # 8-byte Folded Reload
228 ; RV64D-NEXT: addi sp, sp, 16
230 %a = fptrunc fp128 %x to float
231 %b = fadd float %a, %y
235 define double @fptrunc_f64(fp128 %x, double %y) nounwind {
236 ; RV64I-LABEL: fptrunc_f64:
238 ; RV64I-NEXT: addi sp, sp, -16
239 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
240 ; RV64I-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
241 ; RV64I-NEXT: mv s0, a2
242 ; RV64I-NEXT: call __trunctfdf2
243 ; RV64I-NEXT: mv a1, s0
244 ; RV64I-NEXT: call __adddf3
245 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
246 ; RV64I-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
247 ; RV64I-NEXT: addi sp, sp, 16
250 ; RV64D-LABEL: fptrunc_f64:
252 ; RV64D-NEXT: addi sp, sp, -16
253 ; RV64D-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
254 ; RV64D-NEXT: fsd fs0, 0(sp) # 8-byte Folded Spill
255 ; RV64D-NEXT: fmv.d fs0, fa0
256 ; RV64D-NEXT: call __trunctfdf2
257 ; RV64D-NEXT: fadd.d fa0, fa0, fs0
258 ; RV64D-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
259 ; RV64D-NEXT: fld fs0, 0(sp) # 8-byte Folded Reload
260 ; RV64D-NEXT: addi sp, sp, 16
262 %a = fptrunc fp128 %x to double
263 %b = fadd double %a, %y
267 define i8 @fptosi_i8(fp128 %x) nounwind {
268 ; CHECK-LABEL: fptosi_i8:
270 ; CHECK-NEXT: addi sp, sp, -16
271 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
272 ; CHECK-NEXT: call __fixtfsi
273 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
274 ; CHECK-NEXT: addi sp, sp, 16
276 %a = fptosi fp128 %x to i8
280 define i16 @fptosi_i16(fp128 %x) nounwind {
281 ; CHECK-LABEL: fptosi_i16:
283 ; CHECK-NEXT: addi sp, sp, -16
284 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
285 ; CHECK-NEXT: call __fixtfsi
286 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
287 ; CHECK-NEXT: addi sp, sp, 16
289 %a = fptosi fp128 %x to i16
293 define i32 @fptosi_i32(fp128 %x) nounwind {
294 ; CHECK-LABEL: fptosi_i32:
296 ; CHECK-NEXT: addi sp, sp, -16
297 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
298 ; CHECK-NEXT: call __fixtfsi
299 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
300 ; CHECK-NEXT: addi sp, sp, 16
302 %a = fptosi fp128 %x to i32
306 define i64 @fptosi_i64(fp128 %x) nounwind {
307 ; CHECK-LABEL: fptosi_i64:
309 ; CHECK-NEXT: addi sp, sp, -16
310 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
311 ; CHECK-NEXT: call __fixtfdi
312 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
313 ; CHECK-NEXT: addi sp, sp, 16
315 %a = fptosi fp128 %x to i64
319 define i128 @fptosi_i128(fp128 %x) nounwind {
320 ; CHECK-LABEL: fptosi_i128:
322 ; CHECK-NEXT: addi sp, sp, -16
323 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
324 ; CHECK-NEXT: call __fixtfti
325 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
326 ; CHECK-NEXT: addi sp, sp, 16
328 %a = fptosi fp128 %x to i128
332 define i8 @fptoui_i8(fp128 %x) nounwind {
333 ; CHECK-LABEL: fptoui_i8:
335 ; CHECK-NEXT: addi sp, sp, -16
336 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
337 ; CHECK-NEXT: call __fixunstfsi
338 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
339 ; CHECK-NEXT: addi sp, sp, 16
341 %a = fptoui fp128 %x to i8
345 define i16 @fptoui_i16(fp128 %x) nounwind {
346 ; CHECK-LABEL: fptoui_i16:
348 ; CHECK-NEXT: addi sp, sp, -16
349 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
350 ; CHECK-NEXT: call __fixunstfsi
351 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
352 ; CHECK-NEXT: addi sp, sp, 16
354 %a = fptoui fp128 %x to i16
358 define i32 @fptoui_i32(fp128 %x) nounwind {
359 ; CHECK-LABEL: fptoui_i32:
361 ; CHECK-NEXT: addi sp, sp, -16
362 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
363 ; CHECK-NEXT: call __fixunstfsi
364 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
365 ; CHECK-NEXT: addi sp, sp, 16
367 %a = fptoui fp128 %x to i32
371 define i64 @fptoui_i64(fp128 %x) nounwind {
372 ; CHECK-LABEL: fptoui_i64:
374 ; CHECK-NEXT: addi sp, sp, -16
375 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
376 ; CHECK-NEXT: call __fixunstfdi
377 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
378 ; CHECK-NEXT: addi sp, sp, 16
380 %a = fptoui fp128 %x to i64
384 define i128 @fptoui_i128(fp128 %x) nounwind {
385 ; CHECK-LABEL: fptoui_i128:
387 ; CHECK-NEXT: addi sp, sp, -16
388 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
389 ; CHECK-NEXT: call __fixunstfti
390 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
391 ; CHECK-NEXT: addi sp, sp, 16
393 %a = fptoui fp128 %x to i128
397 define fp128 @sitofp_i8(i8 %x) nounwind {
398 ; CHECK-LABEL: sitofp_i8:
400 ; CHECK-NEXT: addi sp, sp, -16
401 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
402 ; CHECK-NEXT: slli a0, a0, 56
403 ; CHECK-NEXT: srai a0, a0, 56
404 ; CHECK-NEXT: call __floatsitf
405 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
406 ; CHECK-NEXT: addi sp, sp, 16
408 %a = sitofp i8 %x to fp128
412 define fp128 @sitofp_i16(i16 %x) nounwind {
413 ; CHECK-LABEL: sitofp_i16:
415 ; CHECK-NEXT: addi sp, sp, -16
416 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
417 ; CHECK-NEXT: slli a0, a0, 48
418 ; CHECK-NEXT: srai a0, a0, 48
419 ; CHECK-NEXT: call __floatsitf
420 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
421 ; CHECK-NEXT: addi sp, sp, 16
423 %a = sitofp i16 %x to fp128
427 define fp128 @sitofp_i32(i32 %x) nounwind {
428 ; CHECK-LABEL: sitofp_i32:
430 ; CHECK-NEXT: addi sp, sp, -16
431 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
432 ; CHECK-NEXT: sext.w a0, a0
433 ; CHECK-NEXT: call __floatsitf
434 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
435 ; CHECK-NEXT: addi sp, sp, 16
437 %a = sitofp i32 %x to fp128
441 define fp128 @sitofp_i64(i64 %x) nounwind {
442 ; CHECK-LABEL: sitofp_i64:
444 ; CHECK-NEXT: addi sp, sp, -16
445 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
446 ; CHECK-NEXT: call __floatditf
447 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
448 ; CHECK-NEXT: addi sp, sp, 16
450 %a = sitofp i64 %x to fp128
454 define fp128 @sitofp_i128(i128 %x) nounwind {
455 ; CHECK-LABEL: sitofp_i128:
457 ; CHECK-NEXT: addi sp, sp, -16
458 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
459 ; CHECK-NEXT: call __floattitf
460 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
461 ; CHECK-NEXT: addi sp, sp, 16
463 %a = sitofp i128 %x to fp128
467 define fp128 @uitofp_i8(i8 %x) nounwind {
468 ; CHECK-LABEL: uitofp_i8:
470 ; CHECK-NEXT: addi sp, sp, -16
471 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
472 ; CHECK-NEXT: andi a0, a0, 255
473 ; CHECK-NEXT: call __floatunsitf
474 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
475 ; CHECK-NEXT: addi sp, sp, 16
477 %a = uitofp i8 %x to fp128
481 define fp128 @uitofp_i16(i16 %x) nounwind {
482 ; CHECK-LABEL: uitofp_i16:
484 ; CHECK-NEXT: addi sp, sp, -16
485 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
486 ; CHECK-NEXT: slli a0, a0, 48
487 ; CHECK-NEXT: srli a0, a0, 48
488 ; CHECK-NEXT: call __floatunsitf
489 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
490 ; CHECK-NEXT: addi sp, sp, 16
492 %a = uitofp i16 %x to fp128
496 define fp128 @uitofp_i32(i32 %x) nounwind {
497 ; CHECK-LABEL: uitofp_i32:
499 ; CHECK-NEXT: addi sp, sp, -16
500 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
501 ; CHECK-NEXT: sext.w a0, a0
502 ; CHECK-NEXT: call __floatunsitf
503 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
504 ; CHECK-NEXT: addi sp, sp, 16
506 %a = uitofp i32 %x to fp128
510 define fp128 @uitofp_i64(i64 %x) nounwind {
511 ; CHECK-LABEL: uitofp_i64:
513 ; CHECK-NEXT: addi sp, sp, -16
514 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
515 ; CHECK-NEXT: call __floatunditf
516 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
517 ; CHECK-NEXT: addi sp, sp, 16
519 %a = uitofp i64 %x to fp128
523 define fp128 @uitofp_i128(i128 %x) nounwind {
524 ; CHECK-LABEL: uitofp_i128:
526 ; CHECK-NEXT: addi sp, sp, -16
527 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
528 ; CHECK-NEXT: call __floatuntitf
529 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
530 ; CHECK-NEXT: addi sp, sp, 16
532 %a = uitofp i128 %x to fp128
536 define fp128 @sqrt(fp128 %a) nounwind {
539 ; CHECK-NEXT: addi sp, sp, -16
540 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
541 ; CHECK-NEXT: call sqrtl
542 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
543 ; CHECK-NEXT: addi sp, sp, 16
545 %1 = call fp128 @llvm.sqrt.f128(fp128 %a)
549 define fp128 @powi(fp128 %a, i32 %b) nounwind {
552 ; CHECK-NEXT: addi sp, sp, -16
553 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
554 ; CHECK-NEXT: sext.w a2, a2
555 ; CHECK-NEXT: call __powitf2
556 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
557 ; CHECK-NEXT: addi sp, sp, 16
559 %1 = call fp128 @llvm.powi.f128.i32(fp128 %a, i32 %b)
563 define fp128 @sin(fp128 %a) nounwind {
566 ; CHECK-NEXT: addi sp, sp, -16
567 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
568 ; CHECK-NEXT: call sinl
569 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
570 ; CHECK-NEXT: addi sp, sp, 16
572 %1 = call fp128 @llvm.sin.f128(fp128 %a)
576 define fp128 @cos(fp128 %a) nounwind {
579 ; CHECK-NEXT: addi sp, sp, -16
580 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
581 ; CHECK-NEXT: call cosl
582 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
583 ; CHECK-NEXT: addi sp, sp, 16
585 %1 = call fp128 @llvm.cos.f128(fp128 %a)
589 define fp128 @pow(fp128 %a, fp128 %b) nounwind {
592 ; CHECK-NEXT: addi sp, sp, -16
593 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
594 ; CHECK-NEXT: call powl
595 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
596 ; CHECK-NEXT: addi sp, sp, 16
598 %1 = call fp128 @llvm.pow.f128(fp128 %a, fp128 %b)
602 define fp128 @exp(fp128 %a) nounwind {
605 ; CHECK-NEXT: addi sp, sp, -16
606 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
607 ; CHECK-NEXT: call expl
608 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
609 ; CHECK-NEXT: addi sp, sp, 16
611 %1 = call fp128 @llvm.exp.f128(fp128 %a)
615 define fp128 @exp2(fp128 %a) nounwind {
618 ; CHECK-NEXT: addi sp, sp, -16
619 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
620 ; CHECK-NEXT: call exp2l
621 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
622 ; CHECK-NEXT: addi sp, sp, 16
624 %1 = call fp128 @llvm.exp2.f128(fp128 %a)
628 define fp128 @exp10(fp128 %a) nounwind {
629 ; CHECK-LABEL: exp10:
631 ; CHECK-NEXT: addi sp, sp, -16
632 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
633 ; CHECK-NEXT: call exp10l
634 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
635 ; CHECK-NEXT: addi sp, sp, 16
637 %1 = call fp128 @llvm.exp10.f128(fp128 %a)
641 define fp128 @log(fp128 %a) nounwind {
644 ; CHECK-NEXT: addi sp, sp, -16
645 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
646 ; CHECK-NEXT: call logl
647 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
648 ; CHECK-NEXT: addi sp, sp, 16
650 %1 = call fp128 @llvm.log.f128(fp128 %a)
654 define fp128 @log10(fp128 %a) nounwind {
655 ; CHECK-LABEL: log10:
657 ; CHECK-NEXT: addi sp, sp, -16
658 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
659 ; CHECK-NEXT: call log10l
660 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
661 ; CHECK-NEXT: addi sp, sp, 16
663 %1 = call fp128 @llvm.log10.f128(fp128 %a)
667 define fp128 @log2(fp128 %a) nounwind {
670 ; CHECK-NEXT: addi sp, sp, -16
671 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
672 ; CHECK-NEXT: call log2l
673 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
674 ; CHECK-NEXT: addi sp, sp, 16
676 %1 = call fp128 @llvm.log2.f128(fp128 %a)
680 define fp128 @minnum(fp128 %a, fp128 %b) nounwind {
681 ; CHECK-LABEL: minnum:
683 ; CHECK-NEXT: addi sp, sp, -16
684 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
685 ; CHECK-NEXT: call fminl
686 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
687 ; CHECK-NEXT: addi sp, sp, 16
689 %1 = call fp128 @llvm.minnum.f128(fp128 %a, fp128 %b)
693 define fp128 @maxnum(fp128 %a, fp128 %b) nounwind {
694 ; CHECK-LABEL: maxnum:
696 ; CHECK-NEXT: addi sp, sp, -16
697 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
698 ; CHECK-NEXT: call fmaxl
699 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
700 ; CHECK-NEXT: addi sp, sp, 16
702 %1 = call fp128 @llvm.maxnum.f128(fp128 %a, fp128 %b)
706 define fp128 @floor(fp128 %a) nounwind {
707 ; CHECK-LABEL: floor:
709 ; CHECK-NEXT: addi sp, sp, -16
710 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
711 ; CHECK-NEXT: call floorl
712 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
713 ; CHECK-NEXT: addi sp, sp, 16
715 %1 = call fp128 @llvm.floor.f128(fp128 %a)
719 define fp128 @ceil(fp128 %a) nounwind {
722 ; CHECK-NEXT: addi sp, sp, -16
723 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
724 ; CHECK-NEXT: call ceill
725 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
726 ; CHECK-NEXT: addi sp, sp, 16
728 %1 = call fp128 @llvm.ceil.f128(fp128 %a)
732 define fp128 @trunc(fp128 %a) nounwind {
733 ; CHECK-LABEL: trunc:
735 ; CHECK-NEXT: addi sp, sp, -16
736 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
737 ; CHECK-NEXT: call truncl
738 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
739 ; CHECK-NEXT: addi sp, sp, 16
741 %1 = call fp128 @llvm.trunc.f128(fp128 %a)
745 define fp128 @rint(fp128 %a) nounwind {
748 ; CHECK-NEXT: addi sp, sp, -16
749 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
750 ; CHECK-NEXT: call rintl
751 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
752 ; CHECK-NEXT: addi sp, sp, 16
754 %1 = call fp128 @llvm.rint.f128(fp128 %a)
758 define fp128 @nearbyint(fp128 %a) nounwind {
759 ; CHECK-LABEL: nearbyint:
761 ; CHECK-NEXT: addi sp, sp, -16
762 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
763 ; CHECK-NEXT: call nearbyintl
764 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
765 ; CHECK-NEXT: addi sp, sp, 16
767 %1 = call fp128 @llvm.nearbyint.f128(fp128 %a)
771 define fp128 @round(fp128 %a) nounwind {
772 ; CHECK-LABEL: round:
774 ; CHECK-NEXT: addi sp, sp, -16
775 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
776 ; CHECK-NEXT: call roundl
777 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
778 ; CHECK-NEXT: addi sp, sp, 16
780 %1 = call fp128 @llvm.round.f128(fp128 %a)
784 define fp128 @roundeven(fp128 %a) nounwind {
785 ; CHECK-LABEL: roundeven:
787 ; CHECK-NEXT: addi sp, sp, -16
788 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
789 ; CHECK-NEXT: call roundevenl
790 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
791 ; CHECK-NEXT: addi sp, sp, 16
793 %1 = call fp128 @llvm.roundeven.f128(fp128 %a)
797 define fp128 @tan(fp128 %a) nounwind {
800 ; CHECK-NEXT: addi sp, sp, -16
801 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
802 ; CHECK-NEXT: call tanl
803 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
804 ; CHECK-NEXT: addi sp, sp, 16
806 %1 = call fp128 @llvm.tan.f128(fp128 %a)
810 define fp128 @ldexp_fp128(fp128 %x, i32 %y) nounwind {
811 ; CHECK-LABEL: ldexp_fp128:
813 ; CHECK-NEXT: addi sp, sp, -16
814 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
815 ; CHECK-NEXT: sext.w a2, a2
816 ; CHECK-NEXT: call ldexpl
817 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
818 ; CHECK-NEXT: addi sp, sp, 16
820 %z = call fp128 @llvm.ldexp.f128.i32(fp128 %x, i32 %y)
824 define fp128 @asin(fp128 %a) nounwind {
827 ; CHECK-NEXT: addi sp, sp, -16
828 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
829 ; CHECK-NEXT: call asinl
830 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
831 ; CHECK-NEXT: addi sp, sp, 16
833 %1 = call fp128 @llvm.asin.f128(fp128 %a)
837 define fp128 @acos(fp128 %a) nounwind {
840 ; CHECK-NEXT: addi sp, sp, -16
841 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
842 ; CHECK-NEXT: call acosl
843 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
844 ; CHECK-NEXT: addi sp, sp, 16
846 %1 = call fp128 @llvm.acos.f128(fp128 %a)
850 define fp128 @atan(fp128 %a) nounwind {
853 ; CHECK-NEXT: addi sp, sp, -16
854 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
855 ; CHECK-NEXT: call atanl
856 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
857 ; CHECK-NEXT: addi sp, sp, 16
859 %1 = call fp128 @llvm.atan.f128(fp128 %a)
863 define fp128 @atan2(fp128 %a, fp128 %b) nounwind {
864 ; CHECK-LABEL: atan2:
866 ; CHECK-NEXT: addi sp, sp, -16
867 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
868 ; CHECK-NEXT: call atan2l
869 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
870 ; CHECK-NEXT: addi sp, sp, 16
872 %1 = call fp128 @llvm.atan2.f128(fp128 %a, fp128 %b)
876 define fp128 @sinh(fp128 %a) nounwind {
879 ; CHECK-NEXT: addi sp, sp, -16
880 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
881 ; CHECK-NEXT: call sinhl
882 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
883 ; CHECK-NEXT: addi sp, sp, 16
885 %1 = call fp128 @llvm.sinh.f128(fp128 %a)
889 define fp128 @cosh(fp128 %a) nounwind {
892 ; CHECK-NEXT: addi sp, sp, -16
893 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
894 ; CHECK-NEXT: call coshl
895 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
896 ; CHECK-NEXT: addi sp, sp, 16
898 %1 = call fp128 @llvm.cosh.f128(fp128 %a)
902 define fp128 @tanh(fp128 %a) nounwind {
905 ; CHECK-NEXT: addi sp, sp, -16
906 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
907 ; CHECK-NEXT: call tanhl
908 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
909 ; CHECK-NEXT: addi sp, sp, 16
911 %1 = call fp128 @llvm.tanh.f128(fp128 %a)