summaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/X86/isel-llvm.asin.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/isel-llvm.asin.ll')
-rw-r--r--llvm/test/CodeGen/X86/isel-llvm.asin.ll111
1 files changed, 111 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/isel-llvm.asin.ll b/llvm/test/CodeGen/X86/isel-llvm.asin.ll
new file mode 100644
index 000000000000..87ffcc9c963c
--- /dev/null
+++ b/llvm/test/CodeGen/X86/isel-llvm.asin.ll
@@ -0,0 +1,111 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
+; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel=0 | FileCheck %s --check-prefixes=X86,SDAG-X86
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -global-isel=0 | FileCheck %s --check-prefixes=SDAG-X64
+; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X86,GISEL-X86
+; RUN: llc < %s -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X64
+
+define float @use_asinf32(float %a) nounwind {
+; SDAG-X86-LABEL: use_asinf32:
+; SDAG-X86: # %bb.0:
+; SDAG-X86-NEXT: subl $12, %esp
+; SDAG-X86-NEXT: flds {{[0-9]+}}(%esp)
+; SDAG-X86-NEXT: fstps (%esp)
+; SDAG-X86-NEXT: calll asinf
+; SDAG-X86-NEXT: addl $12, %esp
+; SDAG-X86-NEXT: retl
+;
+; SDAG-X64-LABEL: use_asinf32:
+; SDAG-X64: # %bb.0:
+; SDAG-X64-NEXT: jmp asinf@PLT # TAILCALL
+;
+; GISEL-X86-LABEL: use_asinf32:
+; GISEL-X86: # %bb.0:
+; GISEL-X86-NEXT: subl $12, %esp
+; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; GISEL-X86-NEXT: movl %eax, (%esp)
+; GISEL-X86-NEXT: calll asinf
+; GISEL-X86-NEXT: addl $12, %esp
+; GISEL-X86-NEXT: retl
+;
+; GISEL-X64-LABEL: use_asinf32:
+; GISEL-X64: # %bb.0:
+; GISEL-X64-NEXT: pushq %rax
+; GISEL-X64-NEXT: callq asinf
+; GISEL-X64-NEXT: popq %rax
+; GISEL-X64-NEXT: retq
+ %x = call float @llvm.asin.f32(float %a)
+ ret float %x
+}
+
+define double @use_asinf64(double %a) nounwind {
+; SDAG-X86-LABEL: use_asinf64:
+; SDAG-X86: # %bb.0:
+; SDAG-X86-NEXT: subl $12, %esp
+; SDAG-X86-NEXT: fldl {{[0-9]+}}(%esp)
+; SDAG-X86-NEXT: fstpl (%esp)
+; SDAG-X86-NEXT: calll asin
+; SDAG-X86-NEXT: addl $12, %esp
+; SDAG-X86-NEXT: retl
+;
+; SDAG-X64-LABEL: use_asinf64:
+; SDAG-X64: # %bb.0:
+; SDAG-X64-NEXT: jmp asin@PLT # TAILCALL
+;
+; GISEL-X86-LABEL: use_asinf64:
+; GISEL-X86: # %bb.0:
+; GISEL-X86-NEXT: subl $12, %esp
+; GISEL-X86-NEXT: leal {{[0-9]+}}(%esp), %eax
+; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; GISEL-X86-NEXT: movl 4(%eax), %eax
+; GISEL-X86-NEXT: xorl %edx, %edx
+; GISEL-X86-NEXT: addl %esp, %edx
+; GISEL-X86-NEXT: movl %ecx, (%esp)
+; GISEL-X86-NEXT: movl %eax, 4(%edx)
+; GISEL-X86-NEXT: calll asin
+; GISEL-X86-NEXT: addl $12, %esp
+; GISEL-X86-NEXT: retl
+;
+; GISEL-X64-LABEL: use_asinf64:
+; GISEL-X64: # %bb.0:
+; GISEL-X64-NEXT: pushq %rax
+; GISEL-X64-NEXT: callq asin
+; GISEL-X64-NEXT: popq %rax
+; GISEL-X64-NEXT: retq
+ %x = call double @llvm.asin.f64(double %a)
+ ret double %x
+}
+
+define x86_fp80 @use_asinf80(x86_fp80 %a) nounwind {
+; X86-LABEL: use_asinf80:
+; X86: # %bb.0:
+; X86-NEXT: subl $12, %esp
+; X86-NEXT: fldt {{[0-9]+}}(%esp)
+; X86-NEXT: fstpt (%esp)
+; X86-NEXT: calll asinl
+; X86-NEXT: addl $12, %esp
+; X86-NEXT: retl
+;
+; SDAG-X64-LABEL: use_asinf80:
+; SDAG-X64: # %bb.0:
+; SDAG-X64-NEXT: subq $24, %rsp
+; SDAG-X64-NEXT: fldt {{[0-9]+}}(%rsp)
+; SDAG-X64-NEXT: fstpt (%rsp)
+; SDAG-X64-NEXT: callq asinl@PLT
+; SDAG-X64-NEXT: addq $24, %rsp
+; SDAG-X64-NEXT: retq
+;
+; GISEL-X64-LABEL: use_asinf80:
+; GISEL-X64: # %bb.0:
+; GISEL-X64-NEXT: subq $24, %rsp
+; GISEL-X64-NEXT: fldt {{[0-9]+}}(%rsp)
+; GISEL-X64-NEXT: fstpt (%rsp)
+; GISEL-X64-NEXT: callq asinl
+; GISEL-X64-NEXT: addq $24, %rsp
+; GISEL-X64-NEXT: retq
+ %x = call x86_fp80 @llvm.asin.f80(x86_fp80 %a)
+ ret x86_fp80 %x
+}
+
+declare float @llvm.asin.f32(float)
+declare double @llvm.asin.f64(double)
+declare x86_fp80 @llvm.asin.f80(x86_fp80)