| ; 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=X64,SDAG-X64 |
| ; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes=X86,GISEL-X86 |
| ; RUN: llc < %s -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes=X64,GISEL-X64 |
| |
| define float @use_atan2f32(float %a, float %b) nounwind { |
| ; X86-LABEL: use_atan2f32: |
| ; X86: # %bb.0: |
| ; X86-NEXT: subl $12, %esp |
| ; X86-NEXT: flds {{[0-9]+}}(%esp) |
| ; X86-NEXT: flds {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstps {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstps (%esp) |
| ; X86-NEXT: calll atan2f |
| ; X86-NEXT: addl $12, %esp |
| ; X86-NEXT: retl |
| ; |
| ; X64-LABEL: use_atan2f32: |
| ; X64: # %bb.0: |
| ; X64-NEXT: jmp atan2f@PLT # TAILCALL |
| %x = call float @llvm.atan2.f32(float %a, float %b) |
| ret float %x |
| } |
| |
| define double @use_atan2f64(double %a, double %b) nounwind { |
| ; X86-LABEL: use_atan2f64: |
| ; X86: # %bb.0: |
| ; X86-NEXT: subl $28, %esp |
| ; X86-NEXT: fldl {{[0-9]+}}(%esp) |
| ; X86-NEXT: fldl {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstpl {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstpl (%esp) |
| ; X86-NEXT: calll atan2 |
| ; X86-NEXT: addl $28, %esp |
| ; X86-NEXT: retl |
| ; |
| ; X64-LABEL: use_atan2f64: |
| ; X64: # %bb.0: |
| ; X64-NEXT: jmp atan2@PLT # TAILCALL |
| %x = call double @llvm.atan2.f64(double %a, double %b) |
| ret double %x |
| } |
| |
| define x86_fp80 @use_atan2f80(x86_fp80 %a, x86_fp80 %b) nounwind { |
| ; X86-LABEL: use_atan2f80: |
| ; X86: # %bb.0: |
| ; X86-NEXT: subl $28, %esp |
| ; X86-NEXT: fldt {{[0-9]+}}(%esp) |
| ; X86-NEXT: fldt {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstpt {{[0-9]+}}(%esp) |
| ; X86-NEXT: fstpt (%esp) |
| ; X86-NEXT: calll atan2l |
| ; X86-NEXT: addl $28, %esp |
| ; X86-NEXT: retl |
| ; |
| ; X64-LABEL: use_atan2f80: |
| ; X64: # %bb.0: |
| ; X64-NEXT: subq $40, %rsp |
| ; X64-NEXT: fldt {{[0-9]+}}(%rsp) |
| ; X64-NEXT: fldt {{[0-9]+}}(%rsp) |
| ; X64-NEXT: fstpt {{[0-9]+}}(%rsp) |
| ; X64-NEXT: fstpt (%rsp) |
| ; X64-NEXT: callq atan2l@PLT |
| ; X64-NEXT: addq $40, %rsp |
| ; X64-NEXT: retq |
| %x = call x86_fp80 @llvm.atan2.f80(x86_fp80 %a, x86_fp80 %b) |
| ret x86_fp80 %x |
| } |
| |
| declare float @llvm.atan2.f32(float, float) |
| declare double @llvm.atan2.f64(double, double) |
| declare x86_fp80 @llvm.atan2.f80(x86_fp80, x86_fp80) |
| ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: |
| ; GISEL-X64: {{.*}} |
| ; GISEL-X86: {{.*}} |
| ; SDAG-X64: {{.*}} |
| ; SDAG-X86: {{.*}} |