• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that library calls are emitted for LLVM IR intrinsics
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5define float @f1(float %x, i32 %y) {
6; CHECK-LABEL: f1:
7; CHECK: brasl %r14, __powisf2@PLT
8  %tmp = call float @llvm.powi.f32(float %x, i32 %y)
9  ret float %tmp
10}
11
12define double @f2(double %x, i32 %y) {
13; CHECK-LABEL: f2:
14; CHECK: brasl %r14, __powidf2@PLT
15  %tmp = call double @llvm.powi.f64(double %x, i32 %y)
16  ret double %tmp
17}
18
19define fp128 @f3(fp128 %x, i32 %y) {
20; CHECK-LABEL: f3:
21; CHECK: brasl %r14, __powitf2@PLT
22  %tmp = call fp128 @llvm.powi.f128(fp128 %x, i32 %y)
23  ret fp128 %tmp
24}
25
26define float @f4(float %x, float %y) {
27; CHECK-LABEL: f4:
28; CHECK: brasl %r14, powf@PLT
29  %tmp = call float @llvm.pow.f32(float %x, float %y)
30  ret float %tmp
31}
32
33define double @f5(double %x, double %y) {
34; CHECK-LABEL: f5:
35; CHECK: brasl %r14, pow@PLT
36  %tmp = call double @llvm.pow.f64(double %x, double %y)
37  ret double %tmp
38}
39
40define fp128 @f6(fp128 %x, fp128 %y) {
41; CHECK-LABEL: f6:
42; CHECK: brasl %r14, powl@PLT
43  %tmp = call fp128 @llvm.pow.f128(fp128 %x, fp128 %y)
44  ret fp128 %tmp
45}
46
47define float @f7(float %x) {
48; CHECK-LABEL: f7:
49; CHECK: brasl %r14, sinf@PLT
50  %tmp = call float @llvm.sin.f32(float %x)
51  ret float %tmp
52}
53
54define double @f8(double %x) {
55; CHECK-LABEL: f8:
56; CHECK: brasl %r14, sin@PLT
57  %tmp = call double @llvm.sin.f64(double %x)
58  ret double %tmp
59}
60
61define fp128 @f9(fp128 %x) {
62; CHECK-LABEL: f9:
63; CHECK: brasl %r14, sinl@PLT
64  %tmp = call fp128 @llvm.sin.f128(fp128 %x)
65  ret fp128 %tmp
66}
67
68define float @f10(float %x) {
69; CHECK-LABEL: f10:
70; CHECK: brasl %r14, cosf@PLT
71  %tmp = call float @llvm.cos.f32(float %x)
72  ret float %tmp
73}
74
75define double @f11(double %x) {
76; CHECK-LABEL: f11:
77; CHECK: brasl %r14, cos@PLT
78  %tmp = call double @llvm.cos.f64(double %x)
79  ret double %tmp
80}
81
82define fp128 @f12(fp128 %x) {
83; CHECK-LABEL: f12:
84; CHECK: brasl %r14, cosl@PLT
85  %tmp = call fp128 @llvm.cos.f128(fp128 %x)
86  ret fp128 %tmp
87}
88
89define float @f13(float %x) {
90; CHECK-LABEL: f13:
91; CHECK: brasl %r14, expf@PLT
92  %tmp = call float @llvm.exp.f32(float %x)
93  ret float %tmp
94}
95
96define double @f14(double %x) {
97; CHECK-LABEL: f14:
98; CHECK: brasl %r14, exp@PLT
99  %tmp = call double @llvm.exp.f64(double %x)
100  ret double %tmp
101}
102
103define fp128 @f15(fp128 %x) {
104; CHECK-LABEL: f15:
105; CHECK: brasl %r14, expl@PLT
106  %tmp = call fp128 @llvm.exp.f128(fp128 %x)
107  ret fp128 %tmp
108}
109
110define float @f16(float %x) {
111; CHECK-LABEL: f16:
112; CHECK: brasl %r14, exp2f@PLT
113  %tmp = call float @llvm.exp2.f32(float %x)
114  ret float %tmp
115}
116
117define double @f17(double %x) {
118; CHECK-LABEL: f17:
119; CHECK: brasl %r14, exp2@PLT
120  %tmp = call double @llvm.exp2.f64(double %x)
121  ret double %tmp
122}
123
124define fp128 @f18(fp128 %x) {
125; CHECK-LABEL: f18:
126; CHECK: brasl %r14, exp2l@PLT
127  %tmp = call fp128 @llvm.exp2.f128(fp128 %x)
128  ret fp128 %tmp
129}
130
131define float @f19(float %x) {
132; CHECK-LABEL: f19:
133; CHECK: brasl %r14, logf@PLT
134  %tmp = call float @llvm.log.f32(float %x)
135  ret float %tmp
136}
137
138define double @f20(double %x) {
139; CHECK-LABEL: f20:
140; CHECK: brasl %r14, log@PLT
141  %tmp = call double @llvm.log.f64(double %x)
142  ret double %tmp
143}
144
145define fp128 @f21(fp128 %x) {
146; CHECK-LABEL: f21:
147; CHECK: brasl %r14, logl@PLT
148  %tmp = call fp128 @llvm.log.f128(fp128 %x)
149  ret fp128 %tmp
150}
151
152define float @f22(float %x) {
153; CHECK-LABEL: f22:
154; CHECK: brasl %r14, log2f@PLT
155  %tmp = call float @llvm.log2.f32(float %x)
156  ret float %tmp
157}
158
159define double @f23(double %x) {
160; CHECK-LABEL: f23:
161; CHECK: brasl %r14, log2@PLT
162  %tmp = call double @llvm.log2.f64(double %x)
163  ret double %tmp
164}
165
166define fp128 @f24(fp128 %x) {
167; CHECK-LABEL: f24:
168; CHECK: brasl %r14, log2l@PLT
169  %tmp = call fp128 @llvm.log2.f128(fp128 %x)
170  ret fp128 %tmp
171}
172
173define float @f25(float %x) {
174; CHECK-LABEL: f25:
175; CHECK: brasl %r14, log10f@PLT
176  %tmp = call float @llvm.log10.f32(float %x)
177  ret float %tmp
178}
179
180define double @f26(double %x) {
181; CHECK-LABEL: f26:
182; CHECK: brasl %r14, log10@PLT
183  %tmp = call double @llvm.log10.f64(double %x)
184  ret double %tmp
185}
186
187define fp128 @f27(fp128 %x) {
188; CHECK-LABEL: f27:
189; CHECK: brasl %r14, log10l@PLT
190  %tmp = call fp128 @llvm.log10.f128(fp128 %x)
191  ret fp128 %tmp
192}
193
194define float @f28(float %x, float %y) {
195; CHECK-LABEL: f28:
196; CHECK: brasl %r14, fminf@PLT
197  %tmp = call float @llvm.minnum.f32(float %x, float %y)
198  ret float %tmp
199}
200
201define double @f29(double %x, double %y) {
202; CHECK-LABEL: f29:
203; CHECK: brasl %r14, fmin@PLT
204  %tmp = call double @llvm.minnum.f64(double %x, double %y)
205  ret double %tmp
206}
207
208define fp128 @f30(fp128 %x, fp128 %y) {
209; CHECK-LABEL: f30:
210; CHECK: brasl %r14, fminl@PLT
211  %tmp = call fp128 @llvm.minnum.f128(fp128 %x, fp128 %y)
212  ret fp128 %tmp
213}
214
215define float @f31(float %x, float %y) {
216; CHECK-LABEL: f31:
217; CHECK: brasl %r14, fmaxf@PLT
218  %tmp = call float @llvm.maxnum.f32(float %x, float %y)
219  ret float %tmp
220}
221
222define double @f32(double %x, double %y) {
223; CHECK-LABEL: f32:
224; CHECK: brasl %r14, fmax@PLT
225  %tmp = call double @llvm.maxnum.f64(double %x, double %y)
226  ret double %tmp
227}
228
229define fp128 @f33(fp128 %x, fp128 %y) {
230; CHECK-LABEL: f33:
231; CHECK: brasl %r14, fmaxl@PLT
232  %tmp = call fp128 @llvm.maxnum.f128(fp128 %x, fp128 %y)
233  ret fp128 %tmp
234}
235
236declare float @llvm.powi.f32(float, i32)
237declare double @llvm.powi.f64(double, i32)
238declare fp128 @llvm.powi.f128(fp128, i32)
239declare float @llvm.pow.f32(float, float)
240declare double @llvm.pow.f64(double, double)
241declare fp128 @llvm.pow.f128(fp128, fp128)
242
243declare float @llvm.sin.f32(float)
244declare double @llvm.sin.f64(double)
245declare fp128 @llvm.sin.f128(fp128)
246declare float @llvm.cos.f32(float)
247declare double @llvm.cos.f64(double)
248declare fp128 @llvm.cos.f128(fp128)
249
250declare float @llvm.exp.f32(float)
251declare double @llvm.exp.f64(double)
252declare fp128 @llvm.exp.f128(fp128)
253declare float @llvm.exp2.f32(float)
254declare double @llvm.exp2.f64(double)
255declare fp128 @llvm.exp2.f128(fp128)
256
257declare float @llvm.log.f32(float)
258declare double @llvm.log.f64(double)
259declare fp128 @llvm.log.f128(fp128)
260declare float @llvm.log2.f32(float)
261declare double @llvm.log2.f64(double)
262declare fp128 @llvm.log2.f128(fp128)
263declare float @llvm.log10.f32(float)
264declare double @llvm.log10.f64(double)
265declare fp128 @llvm.log10.f128(fp128)
266
267declare float @llvm.minnum.f32(float, float)
268declare double @llvm.minnum.f64(double, double)
269declare fp128 @llvm.minnum.f128(fp128, fp128)
270declare float @llvm.maxnum.f32(float, float)
271declare double @llvm.maxnum.f64(double, double)
272declare fp128 @llvm.maxnum.f128(fp128, fp128)
273
274