1; RUN: llc < %s -march=xcore | FileCheck %s
2declare double @llvm.cos.f64(double)
3declare double @llvm.exp.f64(double)
4declare double @llvm.exp2.f64(double)
5declare double @llvm.log.f64(double)
6declare double @llvm.log10.f64(double)
7declare double @llvm.log2.f64(double)
8declare double @llvm.pow.f64(double, double)
9declare double @llvm.powi.f64(double, i32)
10declare double @llvm.sin.f64(double)
11declare double @llvm.sqrt.f64(double)
12
13define double @cos(double %F) {
14; CHECK-LABEL: cos:
15; CHECK: bl cos
16        %result = call double @llvm.cos.f64(double %F)
17	ret double %result
18}
19
20declare float @llvm.cos.f32(float)
21
22; CHECK-LABEL: cosf:
23; CHECK: bl cosf
24define float @cosf(float %F) {
25        %result = call float @llvm.cos.f32(float %F)
26	ret float %result
27}
28
29define double @exp(double %F) {
30; CHECK-LABEL: exp:
31; CHECK: bl exp
32        %result = call double @llvm.exp.f64(double %F)
33	ret double %result
34}
35
36declare float @llvm.exp.f32(float)
37
38define float @expf(float %F) {
39; CHECK-LABEL: expf:
40; CHECK: bl expf
41        %result = call float @llvm.exp.f32(float %F)
42	ret float %result
43}
44
45define double @exp2(double %F) {
46; CHECK-LABEL: exp2:
47; CHECK: bl exp2
48        %result = call double @llvm.exp2.f64(double %F)
49	ret double %result
50}
51
52declare float @llvm.exp2.f32(float)
53
54define float @exp2f(float %F) {
55; CHECK-LABEL: exp2f:
56; CHECK: bl exp2f
57        %result = call float @llvm.exp2.f32(float %F)
58	ret float %result
59}
60
61define double @log(double %F) {
62; CHECK-LABEL: log:
63; CHECK: bl log
64        %result = call double @llvm.log.f64(double %F)
65	ret double %result
66}
67
68declare float @llvm.log.f32(float)
69
70define float @logf(float %F) {
71; CHECK-LABEL: logf:
72; CHECK: bl logf
73        %result = call float @llvm.log.f32(float %F)
74	ret float %result
75}
76
77define double @log10(double %F) {
78; CHECK-LABEL: log10:
79; CHECK: bl log10
80        %result = call double @llvm.log10.f64(double %F)
81	ret double %result
82}
83
84declare float @llvm.log10.f32(float)
85
86define float @log10f(float %F) {
87; CHECK-LABEL: log10f:
88; CHECK: bl log10f
89        %result = call float @llvm.log10.f32(float %F)
90	ret float %result
91}
92
93define double @log2(double %F) {
94; CHECK-LABEL: log2:
95; CHECK: bl log2
96        %result = call double @llvm.log2.f64(double %F)
97	ret double %result
98}
99
100declare float @llvm.log2.f32(float)
101
102define float @log2f(float %F) {
103; CHECK-LABEL: log2f:
104; CHECK: bl log2f
105        %result = call float @llvm.log2.f32(float %F)
106	ret float %result
107}
108
109define double @pow(double %F, double %power) {
110; CHECK-LABEL: pow:
111; CHECK: bl pow
112        %result = call double @llvm.pow.f64(double %F, double %power)
113	ret double %result
114}
115
116declare float @llvm.pow.f32(float, float)
117
118define float @powf(float %F, float %power) {
119; CHECK-LABEL: powf:
120; CHECK: bl powf
121        %result = call float @llvm.pow.f32(float %F, float %power)
122	ret float %result
123}
124
125define double @powi(double %F, i32 %power) {
126; CHECK-LABEL: powi:
127; CHECK: bl __powidf2
128        %result = call double @llvm.powi.f64(double %F, i32 %power)
129	ret double %result
130}
131
132declare float @llvm.powi.f32(float, i32)
133
134define float @powif(float %F, i32 %power) {
135; CHECK-LABEL: powif:
136; CHECK: bl __powisf2
137        %result = call float @llvm.powi.f32(float %F, i32 %power)
138	ret float %result
139}
140
141define double @sin(double %F) {
142; CHECK-LABEL: sin:
143; CHECK: bl sin
144        %result = call double @llvm.sin.f64(double %F)
145	ret double %result
146}
147
148declare float @llvm.sin.f32(float)
149
150define float @sinf(float %F) {
151; CHECK-LABEL: sinf:
152; CHECK: bl sinf
153        %result = call float @llvm.sin.f32(float %F)
154	ret float %result
155}
156
157define double @sqrt(double %F) {
158; CHECK-LABEL: sqrt:
159; CHECK: bl sqrt
160        %result = call double @llvm.sqrt.f64(double %F)
161	ret double %result
162}
163
164declare float @llvm.sqrt.f32(float)
165
166define float @sqrtf(float %F) {
167; CHECK-LABEL: sqrtf:
168; CHECK: bl sqrtf
169        %result = call float @llvm.sqrt.f32(float %F)
170	ret float %result
171}
172