1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-android \
3 ; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=ANDROID
4 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu \
5 ; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=GNU
6 ; RUN: llc < %s -O2 -mtriple=i686-linux-gnu -mattr=sse2 \
7 ; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=X86
9 ; Check all soft floating point library function calls.
11 @vf64 = common dso_local global double 0.000000e+00, align 8
12 @vf128 = common dso_local global fp128 0xL00000000000000000000000000000000, align 16
14 define dso_local void @Test128Add(fp128 %d1, fp128 %d2) nounwind {
15 ; CHECK-LABEL: Test128Add:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: pushq %rax
18 ; CHECK-NEXT: callq __addtf3@PLT
19 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
20 ; CHECK-NEXT: popq %rax
23 ; ANDROID-LABEL: Test128Add:
24 ; ANDROID: # %bb.0: # %entry
25 ; ANDROID-NEXT: pushq %rax
26 ; ANDROID-NEXT: callq __addtf3@PLT
27 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
28 ; ANDROID-NEXT: popq %rax
31 ; GNU-LABEL: Test128Add:
32 ; GNU: # %bb.0: # %entry
33 ; GNU-NEXT: pushq %rax
34 ; GNU-NEXT: callq __addtf3@PLT
35 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
39 ; X86-LABEL: Test128Add:
40 ; X86: # %bb.0: # %entry
41 ; X86-NEXT: subl $40, %esp
42 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
43 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
44 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
45 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
46 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
47 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
48 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
49 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
50 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
51 ; X86-NEXT: pushl %eax
52 ; X86-NEXT: calll __addtf3
53 ; X86-NEXT: addl $44, %esp
54 ; X86-NEXT: movaps (%esp), %xmm0
55 ; X86-NEXT: movaps %xmm0, vf128
56 ; X86-NEXT: addl $28, %esp
59 %add = fadd fp128 %d1, %d2
60 store fp128 %add, ptr @vf128, align 16
64 define dso_local void @Test128_1Add(fp128 %d1) nounwind {
65 ; CHECK-LABEL: Test128_1Add:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: pushq %rax
68 ; CHECK-NEXT: movaps %xmm0, %xmm1
69 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
70 ; CHECK-NEXT: callq __addtf3@PLT
71 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
72 ; CHECK-NEXT: popq %rax
75 ; ANDROID-LABEL: Test128_1Add:
76 ; ANDROID: # %bb.0: # %entry
77 ; ANDROID-NEXT: pushq %rax
78 ; ANDROID-NEXT: movaps %xmm0, %xmm1
79 ; ANDROID-NEXT: movaps vf128(%rip), %xmm0
80 ; ANDROID-NEXT: callq __addtf3@PLT
81 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
82 ; ANDROID-NEXT: popq %rax
85 ; GNU-LABEL: Test128_1Add:
86 ; GNU: # %bb.0: # %entry
87 ; GNU-NEXT: pushq %rax
88 ; GNU-NEXT: movaps %xmm0, %xmm1
89 ; GNU-NEXT: movaps vf128(%rip), %xmm0
90 ; GNU-NEXT: callq __addtf3@PLT
91 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
95 ; X86-LABEL: Test128_1Add:
96 ; X86: # %bb.0: # %entry
97 ; X86-NEXT: subl $40, %esp
98 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
99 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
100 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
101 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
102 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
103 ; X86-NEXT: pushl vf128+12
104 ; X86-NEXT: pushl vf128+8
105 ; X86-NEXT: pushl vf128+4
106 ; X86-NEXT: pushl vf128
107 ; X86-NEXT: pushl %eax
108 ; X86-NEXT: calll __addtf3
109 ; X86-NEXT: addl $44, %esp
110 ; X86-NEXT: movaps (%esp), %xmm0
111 ; X86-NEXT: movaps %xmm0, vf128
112 ; X86-NEXT: addl $28, %esp
115 %0 = load fp128, ptr @vf128, align 16
116 %add = fadd fp128 %0, %d1
117 store fp128 %add, ptr @vf128, align 16
121 define dso_local void @Test128Sub(fp128 %d1, fp128 %d2) nounwind {
122 ; CHECK-LABEL: Test128Sub:
123 ; CHECK: # %bb.0: # %entry
124 ; CHECK-NEXT: pushq %rax
125 ; CHECK-NEXT: callq __subtf3@PLT
126 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
127 ; CHECK-NEXT: popq %rax
130 ; ANDROID-LABEL: Test128Sub:
131 ; ANDROID: # %bb.0: # %entry
132 ; ANDROID-NEXT: pushq %rax
133 ; ANDROID-NEXT: callq __subtf3@PLT
134 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
135 ; ANDROID-NEXT: popq %rax
138 ; GNU-LABEL: Test128Sub:
139 ; GNU: # %bb.0: # %entry
140 ; GNU-NEXT: pushq %rax
141 ; GNU-NEXT: callq __subtf3@PLT
142 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
143 ; GNU-NEXT: popq %rax
146 ; X86-LABEL: Test128Sub:
147 ; X86: # %bb.0: # %entry
148 ; X86-NEXT: subl $40, %esp
149 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
150 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
151 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
152 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
153 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
154 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
155 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
156 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
157 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
158 ; X86-NEXT: pushl %eax
159 ; X86-NEXT: calll __subtf3
160 ; X86-NEXT: addl $44, %esp
161 ; X86-NEXT: movaps (%esp), %xmm0
162 ; X86-NEXT: movaps %xmm0, vf128
163 ; X86-NEXT: addl $28, %esp
166 %sub = fsub fp128 %d1, %d2
167 store fp128 %sub, ptr @vf128, align 16
171 define dso_local void @Test128_1Sub(fp128 %d1) nounwind {
172 ; CHECK-LABEL: Test128_1Sub:
173 ; CHECK: # %bb.0: # %entry
174 ; CHECK-NEXT: pushq %rax
175 ; CHECK-NEXT: movaps %xmm0, %xmm1
176 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
177 ; CHECK-NEXT: callq __subtf3@PLT
178 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
179 ; CHECK-NEXT: popq %rax
182 ; ANDROID-LABEL: Test128_1Sub:
183 ; ANDROID: # %bb.0: # %entry
184 ; ANDROID-NEXT: pushq %rax
185 ; ANDROID-NEXT: movaps %xmm0, %xmm1
186 ; ANDROID-NEXT: movaps vf128(%rip), %xmm0
187 ; ANDROID-NEXT: callq __subtf3@PLT
188 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
189 ; ANDROID-NEXT: popq %rax
192 ; GNU-LABEL: Test128_1Sub:
193 ; GNU: # %bb.0: # %entry
194 ; GNU-NEXT: pushq %rax
195 ; GNU-NEXT: movaps %xmm0, %xmm1
196 ; GNU-NEXT: movaps vf128(%rip), %xmm0
197 ; GNU-NEXT: callq __subtf3@PLT
198 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
199 ; GNU-NEXT: popq %rax
202 ; X86-LABEL: Test128_1Sub:
203 ; X86: # %bb.0: # %entry
204 ; X86-NEXT: subl $40, %esp
205 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
206 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
207 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
208 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
209 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
210 ; X86-NEXT: pushl vf128+12
211 ; X86-NEXT: pushl vf128+8
212 ; X86-NEXT: pushl vf128+4
213 ; X86-NEXT: pushl vf128
214 ; X86-NEXT: pushl %eax
215 ; X86-NEXT: calll __subtf3
216 ; X86-NEXT: addl $44, %esp
217 ; X86-NEXT: movaps (%esp), %xmm0
218 ; X86-NEXT: movaps %xmm0, vf128
219 ; X86-NEXT: addl $28, %esp
222 %0 = load fp128, ptr @vf128, align 16
223 %sub = fsub fp128 %0, %d1
224 store fp128 %sub, ptr @vf128, align 16
228 define dso_local void @Test128Mul(fp128 %d1, fp128 %d2) nounwind {
229 ; CHECK-LABEL: Test128Mul:
230 ; CHECK: # %bb.0: # %entry
231 ; CHECK-NEXT: pushq %rax
232 ; CHECK-NEXT: callq __multf3@PLT
233 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
234 ; CHECK-NEXT: popq %rax
237 ; ANDROID-LABEL: Test128Mul:
238 ; ANDROID: # %bb.0: # %entry
239 ; ANDROID-NEXT: pushq %rax
240 ; ANDROID-NEXT: callq __multf3@PLT
241 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
242 ; ANDROID-NEXT: popq %rax
245 ; GNU-LABEL: Test128Mul:
246 ; GNU: # %bb.0: # %entry
247 ; GNU-NEXT: pushq %rax
248 ; GNU-NEXT: callq __multf3@PLT
249 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
250 ; GNU-NEXT: popq %rax
253 ; X86-LABEL: Test128Mul:
254 ; X86: # %bb.0: # %entry
255 ; X86-NEXT: subl $40, %esp
256 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
257 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
258 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
259 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
260 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
261 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
262 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
263 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
264 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
265 ; X86-NEXT: pushl %eax
266 ; X86-NEXT: calll __multf3
267 ; X86-NEXT: addl $44, %esp
268 ; X86-NEXT: movaps (%esp), %xmm0
269 ; X86-NEXT: movaps %xmm0, vf128
270 ; X86-NEXT: addl $28, %esp
273 %mul = fmul fp128 %d1, %d2
274 store fp128 %mul, ptr @vf128, align 16
278 define dso_local void @Test128_1Mul(fp128 %d1) nounwind {
279 ; CHECK-LABEL: Test128_1Mul:
280 ; CHECK: # %bb.0: # %entry
281 ; CHECK-NEXT: pushq %rax
282 ; CHECK-NEXT: movaps %xmm0, %xmm1
283 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
284 ; CHECK-NEXT: callq __multf3@PLT
285 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
286 ; CHECK-NEXT: popq %rax
289 ; ANDROID-LABEL: Test128_1Mul:
290 ; ANDROID: # %bb.0: # %entry
291 ; ANDROID-NEXT: pushq %rax
292 ; ANDROID-NEXT: movaps %xmm0, %xmm1
293 ; ANDROID-NEXT: movaps vf128(%rip), %xmm0
294 ; ANDROID-NEXT: callq __multf3@PLT
295 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
296 ; ANDROID-NEXT: popq %rax
299 ; GNU-LABEL: Test128_1Mul:
300 ; GNU: # %bb.0: # %entry
301 ; GNU-NEXT: pushq %rax
302 ; GNU-NEXT: movaps %xmm0, %xmm1
303 ; GNU-NEXT: movaps vf128(%rip), %xmm0
304 ; GNU-NEXT: callq __multf3@PLT
305 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
306 ; GNU-NEXT: popq %rax
309 ; X86-LABEL: Test128_1Mul:
310 ; X86: # %bb.0: # %entry
311 ; X86-NEXT: subl $40, %esp
312 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
313 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
314 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
315 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
316 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
317 ; X86-NEXT: pushl vf128+12
318 ; X86-NEXT: pushl vf128+8
319 ; X86-NEXT: pushl vf128+4
320 ; X86-NEXT: pushl vf128
321 ; X86-NEXT: pushl %eax
322 ; X86-NEXT: calll __multf3
323 ; X86-NEXT: addl $44, %esp
324 ; X86-NEXT: movaps (%esp), %xmm0
325 ; X86-NEXT: movaps %xmm0, vf128
326 ; X86-NEXT: addl $28, %esp
329 %0 = load fp128, ptr @vf128, align 16
330 %mul = fmul fp128 %0, %d1
331 store fp128 %mul, ptr @vf128, align 16
335 define dso_local void @Test128Div(fp128 %d1, fp128 %d2) nounwind {
336 ; CHECK-LABEL: Test128Div:
337 ; CHECK: # %bb.0: # %entry
338 ; CHECK-NEXT: pushq %rax
339 ; CHECK-NEXT: callq __divtf3@PLT
340 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
341 ; CHECK-NEXT: popq %rax
344 ; ANDROID-LABEL: Test128Div:
345 ; ANDROID: # %bb.0: # %entry
346 ; ANDROID-NEXT: pushq %rax
347 ; ANDROID-NEXT: callq __divtf3@PLT
348 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
349 ; ANDROID-NEXT: popq %rax
352 ; GNU-LABEL: Test128Div:
353 ; GNU: # %bb.0: # %entry
354 ; GNU-NEXT: pushq %rax
355 ; GNU-NEXT: callq __divtf3@PLT
356 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
357 ; GNU-NEXT: popq %rax
360 ; X86-LABEL: Test128Div:
361 ; X86: # %bb.0: # %entry
362 ; X86-NEXT: subl $40, %esp
363 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
364 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
365 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
366 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
367 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
368 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
369 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
370 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
371 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
372 ; X86-NEXT: pushl %eax
373 ; X86-NEXT: calll __divtf3
374 ; X86-NEXT: addl $44, %esp
375 ; X86-NEXT: movaps (%esp), %xmm0
376 ; X86-NEXT: movaps %xmm0, vf128
377 ; X86-NEXT: addl $28, %esp
380 %div = fdiv fp128 %d1, %d2
381 store fp128 %div, ptr @vf128, align 16
385 define dso_local void @Test128_1Div(fp128 %d1) nounwind {
386 ; CHECK-LABEL: Test128_1Div:
387 ; CHECK: # %bb.0: # %entry
388 ; CHECK-NEXT: pushq %rax
389 ; CHECK-NEXT: movaps %xmm0, %xmm1
390 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
391 ; CHECK-NEXT: callq __divtf3@PLT
392 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
393 ; CHECK-NEXT: popq %rax
396 ; ANDROID-LABEL: Test128_1Div:
397 ; ANDROID: # %bb.0: # %entry
398 ; ANDROID-NEXT: pushq %rax
399 ; ANDROID-NEXT: movaps %xmm0, %xmm1
400 ; ANDROID-NEXT: movaps vf128(%rip), %xmm0
401 ; ANDROID-NEXT: callq __divtf3@PLT
402 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
403 ; ANDROID-NEXT: popq %rax
406 ; GNU-LABEL: Test128_1Div:
407 ; GNU: # %bb.0: # %entry
408 ; GNU-NEXT: pushq %rax
409 ; GNU-NEXT: movaps %xmm0, %xmm1
410 ; GNU-NEXT: movaps vf128(%rip), %xmm0
411 ; GNU-NEXT: callq __divtf3@PLT
412 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
413 ; GNU-NEXT: popq %rax
416 ; X86-LABEL: Test128_1Div:
417 ; X86: # %bb.0: # %entry
418 ; X86-NEXT: subl $40, %esp
419 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
420 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
421 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
422 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
423 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
424 ; X86-NEXT: pushl vf128+12
425 ; X86-NEXT: pushl vf128+8
426 ; X86-NEXT: pushl vf128+4
427 ; X86-NEXT: pushl vf128
428 ; X86-NEXT: pushl %eax
429 ; X86-NEXT: calll __divtf3
430 ; X86-NEXT: addl $44, %esp
431 ; X86-NEXT: movaps (%esp), %xmm0
432 ; X86-NEXT: movaps %xmm0, vf128
433 ; X86-NEXT: addl $28, %esp
436 %0 = load fp128, ptr @vf128, align 16
437 %div = fdiv fp128 %0, %d1
438 store fp128 %div, ptr @vf128, align 16
442 define dso_local void @Test128Rem(fp128 %d1, fp128 %d2) nounwind {
443 ; ANDROID-LABEL: Test128Rem:
444 ; ANDROID: # %bb.0: # %entry
445 ; ANDROID-NEXT: pushq %rax
446 ; ANDROID-NEXT: callq fmodl@PLT
447 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
448 ; ANDROID-NEXT: popq %rax
451 ; GNU-LABEL: Test128Rem:
452 ; GNU: # %bb.0: # %entry
453 ; GNU-NEXT: pushq %rax
454 ; GNU-NEXT: callq fmodf128@PLT
455 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
456 ; GNU-NEXT: popq %rax
459 ; X86-LABEL: Test128Rem:
460 ; X86: # %bb.0: # %entry
461 ; X86-NEXT: subl $40, %esp
462 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
463 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
464 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
465 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
466 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
467 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
468 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
469 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
470 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
471 ; X86-NEXT: pushl %eax
472 ; X86-NEXT: calll fmodl
473 ; X86-NEXT: addl $44, %esp
474 ; X86-NEXT: movaps (%esp), %xmm0
475 ; X86-NEXT: movaps %xmm0, vf128
476 ; X86-NEXT: addl $28, %esp
479 %div = frem fp128 %d1, %d2
480 store fp128 %div, ptr @vf128, align 16
484 define dso_local void @Test128_1Rem(fp128 %d1) nounwind {
485 ; ANDROID-LABEL: Test128_1Rem:
486 ; ANDROID: # %bb.0: # %entry
487 ; ANDROID-NEXT: pushq %rax
488 ; ANDROID-NEXT: movaps %xmm0, %xmm1
489 ; ANDROID-NEXT: movaps vf128(%rip), %xmm0
490 ; ANDROID-NEXT: callq fmodl@PLT
491 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
492 ; ANDROID-NEXT: popq %rax
495 ; GNU-LABEL: Test128_1Rem:
496 ; GNU: # %bb.0: # %entry
497 ; GNU-NEXT: pushq %rax
498 ; GNU-NEXT: movaps %xmm0, %xmm1
499 ; GNU-NEXT: movaps vf128(%rip), %xmm0
500 ; GNU-NEXT: callq fmodf128@PLT
501 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
502 ; GNU-NEXT: popq %rax
505 ; X86-LABEL: Test128_1Rem:
506 ; X86: # %bb.0: # %entry
507 ; X86-NEXT: subl $40, %esp
508 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
509 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
510 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
511 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
512 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
513 ; X86-NEXT: pushl vf128+12
514 ; X86-NEXT: pushl vf128+8
515 ; X86-NEXT: pushl vf128+4
516 ; X86-NEXT: pushl vf128
517 ; X86-NEXT: pushl %eax
518 ; X86-NEXT: calll fmodl
519 ; X86-NEXT: addl $44, %esp
520 ; X86-NEXT: movaps (%esp), %xmm0
521 ; X86-NEXT: movaps %xmm0, vf128
522 ; X86-NEXT: addl $28, %esp
525 %0 = load fp128, ptr @vf128, align 16
526 %div = frem fp128 %0, %d1
527 store fp128 %div, ptr @vf128, align 16
531 define dso_local void @Test128Sqrt(fp128 %d1) nounwind {
532 ; ANDROID-LABEL: Test128Sqrt:
533 ; ANDROID: # %bb.0: # %entry
534 ; ANDROID-NEXT: pushq %rax
535 ; ANDROID-NEXT: callq sqrtl@PLT
536 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
537 ; ANDROID-NEXT: popq %rax
540 ; GNU-LABEL: Test128Sqrt:
541 ; GNU: # %bb.0: # %entry
542 ; GNU-NEXT: pushq %rax
543 ; GNU-NEXT: callq sqrtf128@PLT
544 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
545 ; GNU-NEXT: popq %rax
548 ; X86-LABEL: Test128Sqrt:
549 ; X86: # %bb.0: # %entry
550 ; X86-NEXT: subl $40, %esp
551 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
552 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
553 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
554 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
555 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
556 ; X86-NEXT: pushl %eax
557 ; X86-NEXT: calll sqrtl
558 ; X86-NEXT: addl $28, %esp
559 ; X86-NEXT: movaps (%esp), %xmm0
560 ; X86-NEXT: movaps %xmm0, vf128
561 ; X86-NEXT: addl $28, %esp
564 %sqrt = call fp128 @llvm.sqrt.f128(fp128 %d1)
565 store fp128 %sqrt, ptr @vf128, align 16
568 declare fp128 @llvm.sqrt.f128(fp128)
570 define dso_local void @Test128Sin(fp128 %d1) nounwind {
571 ; ANDROID-LABEL: Test128Sin:
572 ; ANDROID: # %bb.0: # %entry
573 ; ANDROID-NEXT: pushq %rax
574 ; ANDROID-NEXT: callq sinl@PLT
575 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
576 ; ANDROID-NEXT: popq %rax
579 ; GNU-LABEL: Test128Sin:
580 ; GNU: # %bb.0: # %entry
581 ; GNU-NEXT: pushq %rax
582 ; GNU-NEXT: callq sinf128@PLT
583 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
584 ; GNU-NEXT: popq %rax
587 ; X86-LABEL: Test128Sin:
588 ; X86: # %bb.0: # %entry
589 ; X86-NEXT: subl $40, %esp
590 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
591 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
592 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
593 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
594 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
595 ; X86-NEXT: pushl %eax
596 ; X86-NEXT: calll sinl
597 ; X86-NEXT: addl $28, %esp
598 ; X86-NEXT: movaps (%esp), %xmm0
599 ; X86-NEXT: movaps %xmm0, vf128
600 ; X86-NEXT: addl $28, %esp
603 %sqrt = call fp128 @llvm.sin.f128(fp128 %d1)
604 store fp128 %sqrt, ptr @vf128, align 16
607 declare fp128 @llvm.sin.f128(fp128)
609 define dso_local void @Test128Cos(fp128 %d1) nounwind {
610 ; ANDROID-LABEL: Test128Cos:
611 ; ANDROID: # %bb.0: # %entry
612 ; ANDROID-NEXT: pushq %rax
613 ; ANDROID-NEXT: callq cosl@PLT
614 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
615 ; ANDROID-NEXT: popq %rax
618 ; GNU-LABEL: Test128Cos:
619 ; GNU: # %bb.0: # %entry
620 ; GNU-NEXT: pushq %rax
621 ; GNU-NEXT: callq cosf128@PLT
622 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
623 ; GNU-NEXT: popq %rax
626 ; X86-LABEL: Test128Cos:
627 ; X86: # %bb.0: # %entry
628 ; X86-NEXT: subl $40, %esp
629 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
630 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
631 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
632 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
633 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
634 ; X86-NEXT: pushl %eax
635 ; X86-NEXT: calll cosl
636 ; X86-NEXT: addl $28, %esp
637 ; X86-NEXT: movaps (%esp), %xmm0
638 ; X86-NEXT: movaps %xmm0, vf128
639 ; X86-NEXT: addl $28, %esp
642 %sqrt = call fp128 @llvm.cos.f128(fp128 %d1)
643 store fp128 %sqrt, ptr @vf128, align 16
646 declare fp128 @llvm.cos.f128(fp128)
648 define dso_local void @Test128Ceil(fp128 %d1) nounwind {
649 ; ANDROID-LABEL: Test128Ceil:
650 ; ANDROID: # %bb.0: # %entry
651 ; ANDROID-NEXT: pushq %rax
652 ; ANDROID-NEXT: callq ceill@PLT
653 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
654 ; ANDROID-NEXT: popq %rax
657 ; GNU-LABEL: Test128Ceil:
658 ; GNU: # %bb.0: # %entry
659 ; GNU-NEXT: pushq %rax
660 ; GNU-NEXT: callq ceilf128@PLT
661 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
662 ; GNU-NEXT: popq %rax
665 ; X86-LABEL: Test128Ceil:
666 ; X86: # %bb.0: # %entry
667 ; X86-NEXT: subl $40, %esp
668 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
669 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
670 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
671 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
672 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
673 ; X86-NEXT: pushl %eax
674 ; X86-NEXT: calll ceill
675 ; X86-NEXT: addl $28, %esp
676 ; X86-NEXT: movaps (%esp), %xmm0
677 ; X86-NEXT: movaps %xmm0, vf128
678 ; X86-NEXT: addl $28, %esp
681 %sqrt = call fp128 @llvm.ceil.f128(fp128 %d1)
682 store fp128 %sqrt, ptr @vf128, align 16
685 declare fp128 @llvm.ceil.f128(fp128)
687 define dso_local void @Test128Floor(fp128 %d1) nounwind {
688 ; ANDROID-LABEL: Test128Floor:
689 ; ANDROID: # %bb.0: # %entry
690 ; ANDROID-NEXT: pushq %rax
691 ; ANDROID-NEXT: callq floorl@PLT
692 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
693 ; ANDROID-NEXT: popq %rax
696 ; GNU-LABEL: Test128Floor:
697 ; GNU: # %bb.0: # %entry
698 ; GNU-NEXT: pushq %rax
699 ; GNU-NEXT: callq floorf128@PLT
700 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
701 ; GNU-NEXT: popq %rax
704 ; X86-LABEL: Test128Floor:
705 ; X86: # %bb.0: # %entry
706 ; X86-NEXT: subl $40, %esp
707 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
708 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
709 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
710 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
711 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
712 ; X86-NEXT: pushl %eax
713 ; X86-NEXT: calll floorl
714 ; X86-NEXT: addl $28, %esp
715 ; X86-NEXT: movaps (%esp), %xmm0
716 ; X86-NEXT: movaps %xmm0, vf128
717 ; X86-NEXT: addl $28, %esp
720 %sqrt = call fp128 @llvm.floor.f128(fp128 %d1)
721 store fp128 %sqrt, ptr @vf128, align 16
724 declare fp128 @llvm.floor.f128(fp128)
726 define dso_local void @Test128Trunc(fp128 %d1) nounwind {
727 ; ANDROID-LABEL: Test128Trunc:
728 ; ANDROID: # %bb.0: # %entry
729 ; ANDROID-NEXT: pushq %rax
730 ; ANDROID-NEXT: callq truncl@PLT
731 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
732 ; ANDROID-NEXT: popq %rax
735 ; GNU-LABEL: Test128Trunc:
736 ; GNU: # %bb.0: # %entry
737 ; GNU-NEXT: pushq %rax
738 ; GNU-NEXT: callq truncf128@PLT
739 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
740 ; GNU-NEXT: popq %rax
743 ; X86-LABEL: Test128Trunc:
744 ; X86: # %bb.0: # %entry
745 ; X86-NEXT: subl $40, %esp
746 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
747 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
748 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
749 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
750 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
751 ; X86-NEXT: pushl %eax
752 ; X86-NEXT: calll truncl
753 ; X86-NEXT: addl $28, %esp
754 ; X86-NEXT: movaps (%esp), %xmm0
755 ; X86-NEXT: movaps %xmm0, vf128
756 ; X86-NEXT: addl $28, %esp
759 %sqrt = call fp128 @llvm.trunc.f128(fp128 %d1)
760 store fp128 %sqrt, ptr @vf128, align 16
763 declare fp128 @llvm.trunc.f128(fp128)
765 define dso_local void @Test128Nearbyint(fp128 %d1) nounwind {
766 ; ANDROID-LABEL: Test128Nearbyint:
767 ; ANDROID: # %bb.0: # %entry
768 ; ANDROID-NEXT: pushq %rax
769 ; ANDROID-NEXT: callq nearbyintl@PLT
770 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
771 ; ANDROID-NEXT: popq %rax
774 ; GNU-LABEL: Test128Nearbyint:
775 ; GNU: # %bb.0: # %entry
776 ; GNU-NEXT: pushq %rax
777 ; GNU-NEXT: callq nearbyintf128@PLT
778 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
779 ; GNU-NEXT: popq %rax
782 ; X86-LABEL: Test128Nearbyint:
783 ; X86: # %bb.0: # %entry
784 ; X86-NEXT: subl $40, %esp
785 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
786 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
787 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
788 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
789 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
790 ; X86-NEXT: pushl %eax
791 ; X86-NEXT: calll nearbyintl
792 ; X86-NEXT: addl $28, %esp
793 ; X86-NEXT: movaps (%esp), %xmm0
794 ; X86-NEXT: movaps %xmm0, vf128
795 ; X86-NEXT: addl $28, %esp
798 %sqrt = call fp128 @llvm.nearbyint.f128(fp128 %d1)
799 store fp128 %sqrt, ptr @vf128, align 16
802 declare fp128 @llvm.nearbyint.f128(fp128)
804 define dso_local void @Test128Rint(fp128 %d1) nounwind {
805 ; ANDROID-LABEL: Test128Rint:
806 ; ANDROID: # %bb.0: # %entry
807 ; ANDROID-NEXT: pushq %rax
808 ; ANDROID-NEXT: callq rintl@PLT
809 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
810 ; ANDROID-NEXT: popq %rax
813 ; GNU-LABEL: Test128Rint:
814 ; GNU: # %bb.0: # %entry
815 ; GNU-NEXT: pushq %rax
816 ; GNU-NEXT: callq rintf128@PLT
817 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
818 ; GNU-NEXT: popq %rax
821 ; X86-LABEL: Test128Rint:
822 ; X86: # %bb.0: # %entry
823 ; X86-NEXT: subl $40, %esp
824 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
825 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
826 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
827 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
828 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
829 ; X86-NEXT: pushl %eax
830 ; X86-NEXT: calll rintl
831 ; X86-NEXT: addl $28, %esp
832 ; X86-NEXT: movaps (%esp), %xmm0
833 ; X86-NEXT: movaps %xmm0, vf128
834 ; X86-NEXT: addl $28, %esp
837 %sqrt = call fp128 @llvm.rint.f128(fp128 %d1)
838 store fp128 %sqrt, ptr @vf128, align 16
841 declare fp128 @llvm.rint.f128(fp128)
843 define dso_local void @Test128Round(fp128 %d1) nounwind {
844 ; ANDROID-LABEL: Test128Round:
845 ; ANDROID: # %bb.0: # %entry
846 ; ANDROID-NEXT: pushq %rax
847 ; ANDROID-NEXT: callq roundl@PLT
848 ; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
849 ; ANDROID-NEXT: popq %rax
852 ; GNU-LABEL: Test128Round:
853 ; GNU: # %bb.0: # %entry
854 ; GNU-NEXT: pushq %rax
855 ; GNU-NEXT: callq roundf128@PLT
856 ; GNU-NEXT: movaps %xmm0, vf128(%rip)
857 ; GNU-NEXT: popq %rax
860 ; X86-LABEL: Test128Round:
861 ; X86: # %bb.0: # %entry
862 ; X86-NEXT: subl $40, %esp
863 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
864 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
865 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
866 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
867 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
868 ; X86-NEXT: pushl %eax
869 ; X86-NEXT: calll roundl
870 ; X86-NEXT: addl $28, %esp
871 ; X86-NEXT: movaps (%esp), %xmm0
872 ; X86-NEXT: movaps %xmm0, vf128
873 ; X86-NEXT: addl $28, %esp
876 %sqrt = call fp128 @llvm.round.f128(fp128 %d1)
877 store fp128 %sqrt, ptr @vf128, align 16
880 declare fp128 @llvm.round.f128(fp128)
882 define fp128 @Test128FMA(fp128 %a, fp128 %b, fp128 %c) nounwind {
883 ; ANDROID-LABEL: Test128FMA:
884 ; ANDROID: # %bb.0: # %entry
885 ; ANDROID-NEXT: jmp fmal@PLT # TAILCALL
887 ; GNU-LABEL: Test128FMA:
888 ; GNU: # %bb.0: # %entry
889 ; GNU-NEXT: jmp fmaf128@PLT # TAILCALL
891 ; X86-LABEL: Test128FMA:
892 ; X86: # %bb.0: # %entry
893 ; X86-NEXT: pushl %esi
894 ; X86-NEXT: subl $24, %esp
895 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
896 ; X86-NEXT: subl $12, %esp
897 ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
898 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
899 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
900 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
901 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
902 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
903 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
904 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
905 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
906 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
907 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
908 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
909 ; X86-NEXT: pushl {{[0-9]+}}(%esp)
910 ; X86-NEXT: pushl %eax
911 ; X86-NEXT: calll fmal
912 ; X86-NEXT: addl $60, %esp
913 ; X86-NEXT: movaps (%esp), %xmm0
914 ; X86-NEXT: movaps %xmm0, (%esi)
915 ; X86-NEXT: movl %esi, %eax
916 ; X86-NEXT: addl $24, %esp
917 ; X86-NEXT: popl %esi
920 %call = call fp128 @llvm.fma.f128(fp128 %a, fp128 %b, fp128 %c)
923 declare fp128 @llvm.fma.f128(fp128, fp128, fp128)