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