illegal-float-ops.ll
8.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
; RUN: llc -mtriple=aarch64-linux-android -verify-machineinstrs -o - %s | FileCheck %s
@varfloat = global float 0.0
@vardouble = global double 0.0
@varfp128 = global fp128 zeroinitializer
declare float @llvm.cos.f32(float)
declare double @llvm.cos.f64(double)
declare fp128 @llvm.cos.f128(fp128)
define void @test_cos(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_cos:
%cosfloat = call float @llvm.cos.f32(float %float)
store float %cosfloat, float* @varfloat
; CHECK: bl cosf
%cosdouble = call double @llvm.cos.f64(double %double)
store double %cosdouble, double* @vardouble
; CHECK: bl cos
%cosfp128 = call fp128 @llvm.cos.f128(fp128 %fp128)
store fp128 %cosfp128, fp128* @varfp128
; CHECK: bl cosl
ret void
}
declare float @llvm.exp.f32(float)
declare double @llvm.exp.f64(double)
declare fp128 @llvm.exp.f128(fp128)
define void @test_exp(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_exp:
%expfloat = call float @llvm.exp.f32(float %float)
store float %expfloat, float* @varfloat
; CHECK: bl expf
%expdouble = call double @llvm.exp.f64(double %double)
store double %expdouble, double* @vardouble
; CHECK: bl exp
%expfp128 = call fp128 @llvm.exp.f128(fp128 %fp128)
store fp128 %expfp128, fp128* @varfp128
; CHECK: bl expl
ret void
}
declare float @llvm.exp2.f32(float)
declare double @llvm.exp2.f64(double)
declare fp128 @llvm.exp2.f128(fp128)
define void @test_exp2(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_exp2:
%exp2float = call float @llvm.exp2.f32(float %float)
store float %exp2float, float* @varfloat
; CHECK: bl exp2f
%exp2double = call double @llvm.exp2.f64(double %double)
store double %exp2double, double* @vardouble
; CHECK: bl exp2
%exp2fp128 = call fp128 @llvm.exp2.f128(fp128 %fp128)
store fp128 %exp2fp128, fp128* @varfp128
; CHECK: bl exp2l
ret void
}
declare float @llvm.log.f32(float)
declare double @llvm.log.f64(double)
declare fp128 @llvm.log.f128(fp128)
define void @test_log(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_log:
%logfloat = call float @llvm.log.f32(float %float)
store float %logfloat, float* @varfloat
; CHECK: bl logf
%logdouble = call double @llvm.log.f64(double %double)
store double %logdouble, double* @vardouble
; CHECK: bl log
%logfp128 = call fp128 @llvm.log.f128(fp128 %fp128)
store fp128 %logfp128, fp128* @varfp128
; CHECK: bl logl
ret void
}
declare float @llvm.log2.f32(float)
declare double @llvm.log2.f64(double)
declare fp128 @llvm.log2.f128(fp128)
define void @test_log2(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_log2:
%log2float = call float @llvm.log2.f32(float %float)
store float %log2float, float* @varfloat
; CHECK: bl log2f
%log2double = call double @llvm.log2.f64(double %double)
store double %log2double, double* @vardouble
; CHECK: bl log2
%log2fp128 = call fp128 @llvm.log2.f128(fp128 %fp128)
store fp128 %log2fp128, fp128* @varfp128
; CHECK: bl log2l
ret void
}
declare float @llvm.log10.f32(float)
declare double @llvm.log10.f64(double)
declare fp128 @llvm.log10.f128(fp128)
define void @test_log10(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_log10:
%log10float = call float @llvm.log10.f32(float %float)
store float %log10float, float* @varfloat
; CHECK: bl log10f
%log10double = call double @llvm.log10.f64(double %double)
store double %log10double, double* @vardouble
; CHECK: bl log10
%log10fp128 = call fp128 @llvm.log10.f128(fp128 %fp128)
store fp128 %log10fp128, fp128* @varfp128
; CHECK: bl log10l
ret void
}
declare float @llvm.sin.f32(float)
declare double @llvm.sin.f64(double)
declare fp128 @llvm.sin.f128(fp128)
define void @test_sin(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_sin:
%sinfloat = call float @llvm.sin.f32(float %float)
store float %sinfloat, float* @varfloat
; CHECK: bl sinf
%sindouble = call double @llvm.sin.f64(double %double)
store double %sindouble, double* @vardouble
; CHECK: bl sin
%sinfp128 = call fp128 @llvm.sin.f128(fp128 %fp128)
store fp128 %sinfp128, fp128* @varfp128
; CHECK: bl sinl
ret void
}
declare float @llvm.pow.f32(float, float)
declare double @llvm.pow.f64(double, double)
declare fp128 @llvm.pow.f128(fp128, fp128)
define void @test_pow(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_pow:
%powfloat = call float @llvm.pow.f32(float %float, float %float)
store float %powfloat, float* @varfloat
; CHECK: bl powf
%powdouble = call double @llvm.pow.f64(double %double, double %double)
store double %powdouble, double* @vardouble
; CHECK: bl pow
%powfp128 = call fp128 @llvm.pow.f128(fp128 %fp128, fp128 %fp128)
store fp128 %powfp128, fp128* @varfp128
; CHECK: bl powl
ret void
}
declare float @llvm.powi.f32(float, i32)
declare double @llvm.powi.f64(double, i32)
declare fp128 @llvm.powi.f128(fp128, i32)
define void @test_powi(float %float, double %double, i32 %exponent, fp128 %fp128) {
; CHECK-LABEL: test_powi:
%powifloat = call float @llvm.powi.f32(float %float, i32 %exponent)
store float %powifloat, float* @varfloat
; CHECK: bl __powisf2
%powidouble = call double @llvm.powi.f64(double %double, i32 %exponent)
store double %powidouble, double* @vardouble
; CHECK: bl __powidf2
%powifp128 = call fp128 @llvm.powi.f128(fp128 %fp128, i32 %exponent)
store fp128 %powifp128, fp128* @varfp128
; CHECK: bl __powitf2
ret void
}
define void @test_frem(float %float, double %double, fp128 %fp128) {
; CHECK-LABEL: test_frem:
%fremfloat = frem float %float, %float
store float %fremfloat, float* @varfloat
; CHECK: bl fmodf
%fremdouble = frem double %double, %double
store double %fremdouble, double* @vardouble
; CHECK: bl fmod
%fremfp128 = frem fp128 %fp128, %fp128
store fp128 %fremfp128, fp128* @varfp128
; CHECK: bl fmodl
ret void
}
declare fp128 @llvm.fma.f128(fp128, fp128, fp128)
define void @test_fma(fp128 %fp128) {
; CHECK-LABEL: test_fma:
%fmafp128 = call fp128 @llvm.fma.f128(fp128 %fp128, fp128 %fp128, fp128 %fp128)
store fp128 %fmafp128, fp128* @varfp128
; CHECK: bl fmal
ret void
}
declare fp128 @llvm.fmuladd.f128(fp128, fp128, fp128)
define void @test_fmuladd(fp128 %fp128) {
; CHECK-LABEL: test_fmuladd:
%fmuladdfp128 = call fp128 @llvm.fmuladd.f128(fp128 %fp128, fp128 %fp128, fp128 %fp128)
store fp128 %fmuladdfp128, fp128* @varfp128
; CHECK-NOT: bl fmal
; CHECK: bl __multf3
; CHECK: bl __addtf3
ret void
}
define i32 @test_fptosi32(fp128 %a) {
; CHECK-LABEL: test_fptosi32:
; CHECK: bl __fixtfsi
%conv.i = fptosi fp128 %a to i32
%b = add nsw i32 %conv.i, 48
ret i32 %b
}
define i64 @test_fptosi64(fp128 %a) {
; CHECK-LABEL: test_fptosi64:
; CHECK: bl __fixtfdi
%conv.i = fptosi fp128 %a to i64
%b = add nsw i64 %conv.i, 48
ret i64 %b
}
define i128 @test_fptosi128(fp128 %a) {
; CHECK-LABEL: test_fptosi128:
; CHECK: bl __fixtfti
%conv.i = fptosi fp128 %a to i128
%b = add nsw i128 %conv.i, 48
ret i128 %b
}
define i32 @test_fptoui32(fp128 %a) {
; CHECK-LABEL: test_fptoui32:
; CHECK: bl __fixunstfsi
%conv.i = fptoui fp128 %a to i32
%b = add nsw i32 %conv.i, 48
ret i32 %b
}
define i64 @test_fptoui64(fp128 %a) {
; CHECK-LABEL: test_fptoui64:
; CHECK: bl __fixunstfdi
%conv.i = fptoui fp128 %a to i64
%b = add nsw i64 %conv.i, 48
ret i64 %b
}
define i128 @test_fptoui128(fp128 %a) {
; CHECK-LABEL: test_fptoui128:
; CHECK: bl __fixunstfti
%conv.i = fptoui fp128 %a to i128
%b = add nsw i128 %conv.i, 48
ret i128 %b
}
define void @test_exp_finite(double %double) #0 {
%expdouble = call double @llvm.exp.f64(double %double)
store double %expdouble, double* @vardouble
; ANDROID-AARCH64-NOT: bl __exp_finite
; CHECK: bl exp
ret void
}
define void @test_exp2_finite(double %double) #0 {
%expdouble = call double @llvm.exp2.f64(double %double)
store double %expdouble, double* @vardouble
; CHECK-NOT: bl __exp2_finite
; CHECK: bl exp2
ret void
}
define void @test_log_finite(double %double) #0 {
%logdouble = call double @llvm.log.f64(double %double)
store double %logdouble, double* @vardouble
; CHECK-NOT: bl __log_finite
; CHECK: bl log
ret void
}
define void @test_log2_finite(double %double) #0 {
%log2double = call double @llvm.log2.f64(double %double)
store double %log2double, double* @vardouble
; CHECK-NOT: bl __log2_finite
; CHECK: bl log2
ret void
}
define void @test_log10_finite(double %double) #0 {
%log10double = call double @llvm.log10.f64(double %double)
store double %log10double, double* @vardouble
; CHECK-NOT: bl __log10_finite
; CHECK: bl log10
ret void
}
define void @test_pow_finite(double %double) #0 {
%powdouble = call double @llvm.pow.f64(double %double, double %double)
store double %powdouble, double* @vardouble
; CHECK-NOT: bl __pow_finite
; CHECK: bl pow
ret void
}
attributes #0 = { "no-infs-fp-math"="true" "no-nans-fp-math"="true" }