ARM64: initial backend import
[oota-llvm.git] / test / CodeGen / ARM64 / sincos.ll
1 ; RUN: llc < %s -mtriple=arm64-apple-ios7 | FileCheck %s
2
3 ; Combine sin / cos into a single call.
4 ; rdar://12856873
5
6 define float @test1(float %x) nounwind {
7 entry:
8 ; CHECK-LABEL: test1:
9 ; CHECK: bl ___sincosf_stret
10 ; CHECK: fadd s0, s0, s1
11   %call = tail call float @sinf(float %x) nounwind readnone
12   %call1 = tail call float @cosf(float %x) nounwind readnone
13   %add = fadd float %call, %call1
14   ret float %add
15 }
16
17 define double @test2(double %x) nounwind {
18 entry:
19 ; CHECK-LABEL: test2:
20 ; CHECK: bl ___sincos_stret
21 ; CHECK: fadd d0, d0, d1
22   %call = tail call double @sin(double %x) nounwind readnone
23   %call1 = tail call double @cos(double %x) nounwind readnone
24   %add = fadd double %call, %call1
25   ret double %add
26 }
27
28 declare float  @sinf(float) readonly
29 declare double @sin(double) readonly
30 declare float @cosf(float) readonly
31 declare double @cos(double) readonly