blob: 010151764fd65a089cc6b1bec9f308862a8d95a3 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu \
; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=GNU
; RUN: llc < %s -O2 -mtriple=i686-linux-gnu -mattr=sse2 \
; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=X86
; These fp128 libcall operations only have a libcall on targets whose libc
; provides the f128-suffixed math functions (glibc). The android/windows
; variants have no libcall and are covered by fp128-libcalls.ll (arithmetic
; only) plus the no-libcall diagnostic tests.
@vf64 = common dso_local global double 0.000000e+00, align 8
@vf128 = common dso_local global fp128 0xL00000000000000000000000000000000, align 16
define dso_local void @Test128Rem(fp128 %d1, fp128 %d2) nounwind {
; GNU-LABEL: Test128Rem:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq fmodf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Rem:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %ebp
; X86-NEXT: pushl %ebx
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $76, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebp, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll fmodf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $76, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: popl %ebx
; X86-NEXT: popl %ebp
; X86-NEXT: retl
entry:
%div = frem fp128 %d1, %d2
store fp128 %div, ptr @vf128, align 16
ret void
}
define dso_local void @Test128_1Rem(fp128 %d1) nounwind {
; GNU-LABEL: Test128_1Rem:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: movaps %xmm0, %xmm1
; GNU-NEXT: movaps vf128(%rip), %xmm0
; GNU-NEXT: callq fmodf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128_1Rem:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %ebp
; X86-NEXT: pushl %ebx
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $76, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl vf128, %edi
; X86-NEXT: movl vf128+4, %ebx
; X86-NEXT: movl vf128+8, %ebp
; X86-NEXT: movl vf128+12, %eax
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebp, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll fmodf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $76, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: popl %ebx
; X86-NEXT: popl %ebp
; X86-NEXT: retl
entry:
%0 = load fp128, ptr @vf128, align 16
%div = frem fp128 %0, %d1
store fp128 %div, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Sqrt(fp128 %d1) nounwind {
; GNU-LABEL: Test128Sqrt:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq sqrtf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Sqrt:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll sqrtf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.sqrt.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Sin(fp128 %d1) nounwind {
; GNU-LABEL: Test128Sin:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq sinf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Sin:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll sinf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.sin.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Cos(fp128 %d1) nounwind {
; GNU-LABEL: Test128Cos:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq cosf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Cos:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll cosf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.cos.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Ceil(fp128 %d1) nounwind {
; GNU-LABEL: Test128Ceil:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq ceilf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Ceil:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll ceilf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.ceil.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Floor(fp128 %d1) nounwind {
; GNU-LABEL: Test128Floor:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq floorf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Floor:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll floorf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.floor.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Trunc(fp128 %d1) nounwind {
; GNU-LABEL: Test128Trunc:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq truncf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Trunc:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll truncf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.trunc.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Nearbyint(fp128 %d1) nounwind {
; GNU-LABEL: Test128Nearbyint:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq nearbyintf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Nearbyint:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll nearbyintf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.nearbyint.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Rint(fp128 %d1) nounwind {
; GNU-LABEL: Test128Rint:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq rintf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Rint:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll rintf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.rint.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define dso_local void @Test128Round(fp128 %d1) nounwind {
; GNU-LABEL: Test128Round:
; GNU: # %bb.0: # %entry
; GNU-NEXT: pushq %rax
; GNU-NEXT: callq roundf128@PLT
; GNU-NEXT: movaps %xmm0, vf128(%rip)
; GNU-NEXT: popq %rax
; GNU-NEXT: retq
;
; X86-LABEL: Test128Round:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
; X86-NEXT: subl $56, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll roundf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
; X86-NEXT: addl $56, %esp
; X86-NEXT: popl %esi
; X86-NEXT: retl
entry:
%sqrt = call fp128 @llvm.round.f128(fp128 %d1)
store fp128 %sqrt, ptr @vf128, align 16
ret void
}
define fp128 @Test128FMA(fp128 %a, fp128 %b, fp128 %c) nounwind {
; GNU-LABEL: Test128FMA:
; GNU: # %bb.0: # %entry
; GNU-NEXT: jmp fmaf128@PLT # TAILCALL
;
; X86-LABEL: Test128FMA:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %ebp
; X86-NEXT: pushl %ebx
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $92, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebx, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll fmaf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%ebp)
; X86-NEXT: movl %ebp, %eax
; X86-NEXT: addl $92, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: popl %ebx
; X86-NEXT: popl %ebp
; X86-NEXT: retl $4
entry:
%call = call fp128 @llvm.fma.f128(fp128 %a, fp128 %b, fp128 %c)
ret fp128 %call
}
define fp128 @Test128Acos(fp128 %a) nounwind {
; GNU-LABEL: Test128Acos:
; GNU: # %bb.0:
; GNU-NEXT: jmp acosf128@PLT # TAILCALL
;
; X86-LABEL: Test128Acos:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll acosf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.acos.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Asin(fp128 %a) nounwind {
; GNU-LABEL: Test128Asin:
; GNU: # %bb.0:
; GNU-NEXT: jmp asinf128@PLT # TAILCALL
;
; X86-LABEL: Test128Asin:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll asinf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.asin.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Atan(fp128 %a) nounwind {
; GNU-LABEL: Test128Atan:
; GNU: # %bb.0:
; GNU-NEXT: jmp atanf128@PLT # TAILCALL
;
; X86-LABEL: Test128Atan:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll atanf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.atan.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Atan2(fp128 %a, fp128 %b) nounwind {
; GNU-LABEL: Test128Atan2:
; GNU: # %bb.0:
; GNU-NEXT: jmp atan2f128@PLT # TAILCALL
;
; X86-LABEL: Test128Atan2:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
; X86-NEXT: pushl %ebx
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $76, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebp, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ebx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll atan2f128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $76, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: popl %ebx
; X86-NEXT: popl %ebp
; X86-NEXT: retl $4
%x = call fp128 @llvm.atan2.f128(fp128 %a, fp128 %b)
ret fp128 %x
}
define fp128 @Test128Cosh(fp128 %a) nounwind {
; GNU-LABEL: Test128Cosh:
; GNU: # %bb.0:
; GNU-NEXT: jmp coshf128@PLT # TAILCALL
;
; X86-LABEL: Test128Cosh:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll coshf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.cosh.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Sinh(fp128 %a) nounwind {
; GNU-LABEL: Test128Sinh:
; GNU: # %bb.0:
; GNU-NEXT: jmp sinhf128@PLT # TAILCALL
;
; X86-LABEL: Test128Sinh:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll sinhf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.sinh.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Tan(fp128 %a) nounwind {
; GNU-LABEL: Test128Tan:
; GNU: # %bb.0:
; GNU-NEXT: jmp tanf128@PLT # TAILCALL
;
; X86-LABEL: Test128Tan:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll tanf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.tan.f128(fp128 %a)
ret fp128 %x
}
define fp128 @Test128Tanh(fp128 %a) nounwind {
; GNU-LABEL: Test128Tanh:
; GNU: # %bb.0:
; GNU-NEXT: jmp tanhf128@PLT # TAILCALL
;
; X86-LABEL: Test128Tanh:
; X86: # %bb.0:
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $52, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll tanhf128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $52, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: retl $4
%x = call fp128 @llvm.tanh.f128(fp128 %a)
ret fp128 %x
}
define { fp128, fp128 } @Test128Modf(fp128 %a) nounwind {
; GNU-LABEL: Test128Modf:
; GNU: # %bb.0:
; GNU-NEXT: subq $24, %rsp
; GNU-NEXT: movq %rsp, %rdi
; GNU-NEXT: callq modff128@PLT
; GNU-NEXT: movaps (%rsp), %xmm1
; GNU-NEXT: addq $24, %rsp
; GNU-NEXT: retq
;
; X86-LABEL: Test128Modf:
; X86: # %bb.0:
; X86-NEXT: pushl %ebx
; X86-NEXT: pushl %edi
; X86-NEXT: pushl %esi
; X86-NEXT: subl $80, %esp
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
; X86-NEXT: leal {{[0-9]+}}(%esp), %ebx
; X86-NEXT: movl %ebx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edi, {{[0-9]+}}(%esp)
; X86-NEXT: movl %edx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
; X86-NEXT: movl %eax, (%esp)
; X86-NEXT: calll modff128
; X86-NEXT: subl $4, %esp
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm0
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm1
; X86-NEXT: movaps %xmm1, 16(%esi)
; X86-NEXT: movaps %xmm0, (%esi)
; X86-NEXT: movl %esi, %eax
; X86-NEXT: addl $80, %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %edi
; X86-NEXT: popl %ebx
; X86-NEXT: retl $4
%x = call { fp128, fp128 } @llvm.modf.f128(fp128 %a)
ret { fp128, fp128 } %x
}
declare fp128 @llvm.sqrt.f128(fp128)
declare fp128 @llvm.sin.f128(fp128)
declare fp128 @llvm.cos.f128(fp128)
declare fp128 @llvm.ceil.f128(fp128)
declare fp128 @llvm.floor.f128(fp128)
declare fp128 @llvm.trunc.f128(fp128)
declare fp128 @llvm.nearbyint.f128(fp128)
declare fp128 @llvm.rint.f128(fp128)
declare fp128 @llvm.round.f128(fp128)
declare fp128 @llvm.fma.f128(fp128, fp128, fp128)