1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
3 ; RUN: llc < %s -mtriple=i386-pc-win32 | FileCheck %s -check-prefix=CHECK-WIN
5 define float @call_ldexpf(float %a, i32 %b) {
6 ; CHECK-LABEL: call_ldexpf:
8 ; CHECK-NEXT: jmp ldexpf@PLT # TAILCALL
10 ; CHECK-WIN-LABEL: call_ldexpf:
12 ; CHECK-WIN-NEXT: subl $8, %esp
13 ; CHECK-WIN-NEXT: flds {{[0-9]+}}(%esp)
14 ; CHECK-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
15 ; CHECK-WIN-NEXT: movl %eax, {{[0-9]+}}(%esp)
16 ; CHECK-WIN-NEXT: fstps (%esp)
17 ; CHECK-WIN-NEXT: calll _ldexpf
18 ; CHECK-WIN-NEXT: addl $8, %esp
19 ; CHECK-WIN-NEXT: retl
20 %result = call float @ldexpf(float %a, i32 %b)
24 define double @call_ldexp(double %a, i32 %b) {
25 ; CHECK-LABEL: call_ldexp:
27 ; CHECK-NEXT: jmp ldexp@PLT # TAILCALL
29 ; CHECK-WIN-LABEL: call_ldexp:
31 ; CHECK-WIN-NEXT: subl $12, %esp
32 ; CHECK-WIN-NEXT: fldl {{[0-9]+}}(%esp)
33 ; CHECK-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
34 ; CHECK-WIN-NEXT: movl %eax, {{[0-9]+}}(%esp)
35 ; CHECK-WIN-NEXT: fstpl (%esp)
36 ; CHECK-WIN-NEXT: calll _ldexp
37 ; CHECK-WIN-NEXT: addl $12, %esp
38 ; CHECK-WIN-NEXT: retl
39 %result = call double @ldexp(double %a, i32 %b)
43 define x86_fp80 @call_ldexpl(x86_fp80 %a, i32 %b) {
44 ; CHECK-LABEL: call_ldexpl:
46 ; CHECK-NEXT: subq $24, %rsp
47 ; CHECK-NEXT: .cfi_def_cfa_offset 32
48 ; CHECK-NEXT: fldt {{[0-9]+}}(%rsp)
49 ; CHECK-NEXT: fstpt (%rsp)
50 ; CHECK-NEXT: callq ldexpl@PLT
51 ; CHECK-NEXT: addq $24, %rsp
52 ; CHECK-NEXT: .cfi_def_cfa_offset 8
55 ; CHECK-WIN-LABEL: call_ldexpl:
57 ; CHECK-WIN-NEXT: pushl %ebp
58 ; CHECK-WIN-NEXT: movl %esp, %ebp
59 ; CHECK-WIN-NEXT: andl $-16, %esp
60 ; CHECK-WIN-NEXT: subl $48, %esp
61 ; CHECK-WIN-NEXT: fldt 8(%ebp)
62 ; CHECK-WIN-NEXT: movl 24(%ebp), %eax
63 ; CHECK-WIN-NEXT: movl %eax, {{[0-9]+}}(%esp)
64 ; CHECK-WIN-NEXT: fstpt (%esp)
65 ; CHECK-WIN-NEXT: calll _ldexpl
66 ; CHECK-WIN-NEXT: movl %ebp, %esp
67 ; CHECK-WIN-NEXT: popl %ebp
68 ; CHECK-WIN-NEXT: retl
69 %result = call x86_fp80 @ldexpl(x86_fp80 %a, i32 %b)
73 declare float @ldexpf(float %a, i32 %b) #0
74 declare double @ldexp(double %a, i32 %b) #0
75 declare x86_fp80 @ldexpl(x86_fp80 %a, i32 %b) #0
77 attributes #0 = { nounwind readonly }