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
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx \
; RUN: -enable-legalize-types-checking | FileCheck %s
; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx \
; RUN: -enable-legalize-types-checking | FileCheck %s
; Check all soft floating point library function calls.
@vf64 = common global double 0.000000e+00, align 8
@vf128 = common global fp128 0xL00000000000000000000000000000000, align 16
define void @Test128Add(fp128 %d1, fp128 %d2) {
; CHECK-LABEL: Test128Add:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq __addtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%add = fadd fp128 %d1, %d2
store fp128 %add, fp128* @vf128, align 16
ret void
}
define void @Test128_1Add(fp128 %d1){
; CHECK-LABEL: Test128_1Add:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: movaps %xmm0, %xmm1
; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
; CHECK-NEXT: callq __addtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%0 = load fp128, fp128* @vf128, align 16
%add = fadd fp128 %0, %d1
store fp128 %add, fp128* @vf128, align 16
ret void
}
define void @Test128Sub(fp128 %d1, fp128 %d2){
; CHECK-LABEL: Test128Sub:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq __subtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%sub = fsub fp128 %d1, %d2
store fp128 %sub, fp128* @vf128, align 16
ret void
}
define void @Test128_1Sub(fp128 %d1){
; CHECK-LABEL: Test128_1Sub:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: movaps %xmm0, %xmm1
; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
; CHECK-NEXT: callq __subtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%0 = load fp128, fp128* @vf128, align 16
%sub = fsub fp128 %0, %d1
store fp128 %sub, fp128* @vf128, align 16
ret void
}
define void @Test128Mul(fp128 %d1, fp128 %d2){
; CHECK-LABEL: Test128Mul:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq __multf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%mul = fmul fp128 %d1, %d2
store fp128 %mul, fp128* @vf128, align 16
ret void
}
define void @Test128_1Mul(fp128 %d1){
; CHECK-LABEL: Test128_1Mul:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: movaps %xmm0, %xmm1
; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
; CHECK-NEXT: callq __multf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%0 = load fp128, fp128* @vf128, align 16
%mul = fmul fp128 %0, %d1
store fp128 %mul, fp128* @vf128, align 16
ret void
}
define void @Test128Div(fp128 %d1, fp128 %d2){
; CHECK-LABEL: Test128Div:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq __divtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%div = fdiv fp128 %d1, %d2
store fp128 %div, fp128* @vf128, align 16
ret void
}
define void @Test128_1Div(fp128 %d1){
; CHECK-LABEL: Test128_1Div:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: movaps %xmm0, %xmm1
; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
; CHECK-NEXT: callq __divtf3
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%0 = load fp128, fp128* @vf128, align 16
%div = fdiv fp128 %0, %d1
store fp128 %div, fp128* @vf128, align 16
ret void
}
define void @Test128Rem(fp128 %d1, fp128 %d2){
; CHECK-LABEL: Test128Rem:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq fmodl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%div = frem fp128 %d1, %d2
store fp128 %div, fp128* @vf128, align 16
ret void
}
define void @Test128_1Rem(fp128 %d1){
; CHECK-LABEL: Test128_1Rem:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: movaps %xmm0, %xmm1
; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
; CHECK-NEXT: callq fmodl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%0 = load fp128, fp128* @vf128, align 16
%div = frem fp128 %0, %d1
store fp128 %div, fp128* @vf128, align 16
ret void
}
define void @Test128Sqrt(fp128 %d1){
; CHECK-LABEL: Test128Sqrt:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq sqrtl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.sqrt.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.sqrt.f128(fp128)
define void @Test128Sin(fp128 %d1){
; CHECK-LABEL: Test128Sin:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq sinl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.sin.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.sin.f128(fp128)
define void @Test128Cos(fp128 %d1){
; CHECK-LABEL: Test128Cos:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: callq cosl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.cos.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.cos.f128(fp128)
define void @Test128Ceil(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Ceil:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq ceill
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.ceil.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.ceil.f128(fp128)
define void @Test128Floor(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Floor:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq floorl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.floor.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.floor.f128(fp128)
define void @Test128Trunc(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Trunc:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq truncl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.trunc.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.trunc.f128(fp128)
define void @Test128Nearbyint(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Nearbyint:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq nearbyintl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.nearbyint.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.nearbyint.f128(fp128)
define void @Test128Rint(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Rint:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq rintl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.rint.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.rint.f128(fp128)
define void @Test128Round(fp128 %d1) nounwind {
; CHECK-LABEL: Test128Round:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: callq roundl
; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip)
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
entry:
%sqrt = call fp128 @llvm.round.f128(fp128 %d1)
store fp128 %sqrt, fp128* @vf128, align 16
ret void
}
declare fp128 @llvm.round.f128(fp128)
|