1 ; Test that library calls are emitted for LLVM IR intrinsics
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 define float @f1(float %x, i32 %y) {
7 ; CHECK: brasl %r14, __powisf2@PLT
8 %tmp = call float @llvm.powi.f32(float %x, i32 %y)
12 define double @f2(double %x, i32 %y) {
14 ; CHECK: brasl %r14, __powidf2@PLT
15 %tmp = call double @llvm.powi.f64(double %x, i32 %y)
19 define fp128 @f3(fp128 %x, i32 %y) {
21 ; CHECK: brasl %r14, __powitf2@PLT
22 %tmp = call fp128 @llvm.powi.f128(fp128 %x, i32 %y)
26 define float @f4(float %x, float %y) {
28 ; CHECK: brasl %r14, powf@PLT
29 %tmp = call float @llvm.pow.f32(float %x, float %y)
33 define double @f5(double %x, double %y) {
35 ; CHECK: brasl %r14, pow@PLT
36 %tmp = call double @llvm.pow.f64(double %x, double %y)
40 define fp128 @f6(fp128 %x, fp128 %y) {
42 ; CHECK: brasl %r14, powl@PLT
43 %tmp = call fp128 @llvm.pow.f128(fp128 %x, fp128 %y)
47 define float @f7(float %x) {
49 ; CHECK: brasl %r14, sinf@PLT
50 %tmp = call float @llvm.sin.f32(float %x)
54 define double @f8(double %x) {
56 ; CHECK: brasl %r14, sin@PLT
57 %tmp = call double @llvm.sin.f64(double %x)
61 define fp128 @f9(fp128 %x) {
63 ; CHECK: brasl %r14, sinl@PLT
64 %tmp = call fp128 @llvm.sin.f128(fp128 %x)
68 define float @f10(float %x) {
70 ; CHECK: brasl %r14, cosf@PLT
71 %tmp = call float @llvm.cos.f32(float %x)
75 define double @f11(double %x) {
77 ; CHECK: brasl %r14, cos@PLT
78 %tmp = call double @llvm.cos.f64(double %x)
82 define fp128 @f12(fp128 %x) {
84 ; CHECK: brasl %r14, cosl@PLT
85 %tmp = call fp128 @llvm.cos.f128(fp128 %x)
89 define float @f13(float %x) {
91 ; CHECK: brasl %r14, expf@PLT
92 %tmp = call float @llvm.exp.f32(float %x)
96 define double @f14(double %x) {
98 ; CHECK: brasl %r14, exp@PLT
99 %tmp = call double @llvm.exp.f64(double %x)
103 define fp128 @f15(fp128 %x) {
105 ; CHECK: brasl %r14, expl@PLT
106 %tmp = call fp128 @llvm.exp.f128(fp128 %x)
110 define float @f16(float %x) {
112 ; CHECK: brasl %r14, exp2f@PLT
113 %tmp = call float @llvm.exp2.f32(float %x)
117 define double @f17(double %x) {
119 ; CHECK: brasl %r14, exp2@PLT
120 %tmp = call double @llvm.exp2.f64(double %x)
124 define fp128 @f18(fp128 %x) {
126 ; CHECK: brasl %r14, exp2l@PLT
127 %tmp = call fp128 @llvm.exp2.f128(fp128 %x)
131 define float @f19(float %x) {
133 ; CHECK: brasl %r14, logf@PLT
134 %tmp = call float @llvm.log.f32(float %x)
138 define double @f20(double %x) {
140 ; CHECK: brasl %r14, log@PLT
141 %tmp = call double @llvm.log.f64(double %x)
145 define fp128 @f21(fp128 %x) {
147 ; CHECK: brasl %r14, logl@PLT
148 %tmp = call fp128 @llvm.log.f128(fp128 %x)
152 define float @f22(float %x) {
154 ; CHECK: brasl %r14, log2f@PLT
155 %tmp = call float @llvm.log2.f32(float %x)
159 define double @f23(double %x) {
161 ; CHECK: brasl %r14, log2@PLT
162 %tmp = call double @llvm.log2.f64(double %x)
166 define fp128 @f24(fp128 %x) {
168 ; CHECK: brasl %r14, log2l@PLT
169 %tmp = call fp128 @llvm.log2.f128(fp128 %x)
173 define float @f25(float %x) {
175 ; CHECK: brasl %r14, log10f@PLT
176 %tmp = call float @llvm.log10.f32(float %x)
180 define double @f26(double %x) {
182 ; CHECK: brasl %r14, log10@PLT
183 %tmp = call double @llvm.log10.f64(double %x)
187 define fp128 @f27(fp128 %x) {
189 ; CHECK: brasl %r14, log10l@PLT
190 %tmp = call fp128 @llvm.log10.f128(fp128 %x)
194 define float @f28(float %x, float %y) {
196 ; CHECK: brasl %r14, fminf@PLT
197 %tmp = call float @llvm.minnum.f32(float %x, float %y)
201 define double @f29(double %x, double %y) {
203 ; CHECK: brasl %r14, fmin@PLT
204 %tmp = call double @llvm.minnum.f64(double %x, double %y)
208 define fp128 @f30(fp128 %x, fp128 %y) {
210 ; CHECK: brasl %r14, fminl@PLT
211 %tmp = call fp128 @llvm.minnum.f128(fp128 %x, fp128 %y)
215 define float @f31(float %x, float %y) {
217 ; CHECK: brasl %r14, fmaxf@PLT
218 %tmp = call float @llvm.maxnum.f32(float %x, float %y)
222 define double @f32(double %x, double %y) {
224 ; CHECK: brasl %r14, fmax@PLT
225 %tmp = call double @llvm.maxnum.f64(double %x, double %y)
229 define fp128 @f33(fp128 %x, fp128 %y) {
231 ; CHECK: brasl %r14, fmaxl@PLT
232 %tmp = call fp128 @llvm.maxnum.f128(fp128 %x, fp128 %y)
236 declare float @llvm.powi.f32(float, i32)
237 declare double @llvm.powi.f64(double, i32)
238 declare fp128 @llvm.powi.f128(fp128, i32)
239 declare float @llvm.pow.f32(float, float)
240 declare double @llvm.pow.f64(double, double)
241 declare fp128 @llvm.pow.f128(fp128, fp128)
243 declare float @llvm.sin.f32(float)
244 declare double @llvm.sin.f64(double)
245 declare fp128 @llvm.sin.f128(fp128)
246 declare float @llvm.cos.f32(float)
247 declare double @llvm.cos.f64(double)
248 declare fp128 @llvm.cos.f128(fp128)
250 declare float @llvm.exp.f32(float)
251 declare double @llvm.exp.f64(double)
252 declare fp128 @llvm.exp.f128(fp128)
253 declare float @llvm.exp2.f32(float)
254 declare double @llvm.exp2.f64(double)
255 declare fp128 @llvm.exp2.f128(fp128)
257 declare float @llvm.log.f32(float)
258 declare double @llvm.log.f64(double)
259 declare fp128 @llvm.log.f128(fp128)
260 declare float @llvm.log2.f32(float)
261 declare double @llvm.log2.f64(double)
262 declare fp128 @llvm.log2.f128(fp128)
263 declare float @llvm.log10.f32(float)
264 declare double @llvm.log10.f64(double)
265 declare fp128 @llvm.log10.f128(fp128)
267 declare float @llvm.minnum.f32(float, float)
268 declare double @llvm.minnum.f64(double, double)
269 declare fp128 @llvm.minnum.f128(fp128, fp128)
270 declare float @llvm.maxnum.f32(float, float)
271 declare double @llvm.maxnum.f64(double, double)
272 declare fp128 @llvm.maxnum.f128(fp128, fp128)