xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/sincos.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-apple-ios6 -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-apple-ios7 -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-linux-gnu -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT-GNU
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a8 \
5*9880d681SAndroid Build Coastguard Worker; RUN:   --enable-unsafe-fp-math | FileCheck %s --check-prefix=SINCOS-GNU
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Combine sin / cos into a single call.
8*9880d681SAndroid Build Coastguard Worker; rdar://12856873
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine float @test1(float %x) nounwind {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker; SINCOS-LABEL: test1:
13*9880d681SAndroid Build Coastguard Worker; SINCOS: bl ___sincosf_stret
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; SINCOS-GNU-LABEL: test1:
16*9880d681SAndroid Build Coastguard Worker; SINCOS-GNU: bl sincosf
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; NOOPT-LABEL: test1:
19*9880d681SAndroid Build Coastguard Worker; NOOPT: bl _sinf
20*9880d681SAndroid Build Coastguard Worker; NOOPT: bl _cosf
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU-LABEL: test1:
23*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU: bl sinf
24*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU: bl cosf
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker  %call = tail call float @sinf(float %x) nounwind readnone
27*9880d681SAndroid Build Coastguard Worker  %call1 = tail call float @cosf(float %x) nounwind readnone
28*9880d681SAndroid Build Coastguard Worker  %add = fadd float %call, %call1
29*9880d681SAndroid Build Coastguard Worker  ret float %add
30*9880d681SAndroid Build Coastguard Worker}
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine double @test2(double %x) nounwind {
33*9880d681SAndroid Build Coastguard Workerentry:
34*9880d681SAndroid Build Coastguard Worker; SINCOS-LABEL: test2:
35*9880d681SAndroid Build Coastguard Worker; SINCOS: bl ___sincos_stret
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker; SINCOS-GNU-LABEL: test2:
38*9880d681SAndroid Build Coastguard Worker; SINCOS-GNU: bl sincos
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Worker; NOOPT-LABEL: test2:
41*9880d681SAndroid Build Coastguard Worker; NOOPT: bl _sin
42*9880d681SAndroid Build Coastguard Worker; NOOPT: bl _cos
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU-LABEL: test2:
45*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU: bl sin
46*9880d681SAndroid Build Coastguard Worker; NOOPT-GNU: bl cos
47*9880d681SAndroid Build Coastguard Worker  %call = tail call double @sin(double %x) nounwind readnone
48*9880d681SAndroid Build Coastguard Worker  %call1 = tail call double @cos(double %x) nounwind readnone
49*9880d681SAndroid Build Coastguard Worker  %add = fadd double %call, %call1
50*9880d681SAndroid Build Coastguard Worker  ret double %add
51*9880d681SAndroid Build Coastguard Worker}
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Workerdeclare float  @sinf(float) readonly
54*9880d681SAndroid Build Coastguard Workerdeclare double @sin(double) readonly
55*9880d681SAndroid Build Coastguard Workerdeclare float @cosf(float) readonly
56*9880d681SAndroid Build Coastguard Workerdeclare double @cos(double) readonly
57