1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-unknown | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefixes=X64,X64-X87
4 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ssse3 | FileCheck %s --check-prefixes=X64,X64-SSSE3
10 define i16 @fptosi_i16_fp80(x86_fp80 %a0) nounwind {
11 ; X86-LABEL: fptosi_i16_fp80:
13 ; X86-NEXT: subl $8, %esp
14 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
15 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
16 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
17 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
18 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
19 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
20 ; X86-NEXT: fistps {{[0-9]+}}(%esp)
21 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
22 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
23 ; X86-NEXT: addl $8, %esp
26 ; X64-X87-LABEL: fptosi_i16_fp80:
28 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
29 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
30 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
31 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
32 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
33 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
34 ; X64-X87-NEXT: fistps -{{[0-9]+}}(%rsp)
35 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
36 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
39 ; X64-SSSE3-LABEL: fptosi_i16_fp80:
41 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
42 ; X64-SSSE3-NEXT: fisttps -{{[0-9]+}}(%rsp)
43 ; X64-SSSE3-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
44 ; X64-SSSE3-NEXT: retq
45 %1 = fptosi x86_fp80 %a0 to i16
49 define i16 @fptosi_i16_fp80_ld(ptr%a0) nounwind {
50 ; X86-LABEL: fptosi_i16_fp80_ld:
52 ; X86-NEXT: subl $8, %esp
53 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
54 ; X86-NEXT: fldt (%eax)
55 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
56 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
57 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
58 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
59 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
60 ; X86-NEXT: fistps {{[0-9]+}}(%esp)
61 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
62 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
63 ; X86-NEXT: addl $8, %esp
66 ; X64-X87-LABEL: fptosi_i16_fp80_ld:
68 ; X64-X87-NEXT: fldt (%rdi)
69 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
70 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
71 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
72 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
73 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
74 ; X64-X87-NEXT: fistps -{{[0-9]+}}(%rsp)
75 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
76 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
79 ; X64-SSSE3-LABEL: fptosi_i16_fp80_ld:
81 ; X64-SSSE3-NEXT: fldt (%rdi)
82 ; X64-SSSE3-NEXT: fisttps -{{[0-9]+}}(%rsp)
83 ; X64-SSSE3-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
84 ; X64-SSSE3-NEXT: retq
85 %1 = load x86_fp80, ptr%a0
86 %2 = fptosi x86_fp80 %1 to i16
90 define i32 @fptosi_i32_fp80(x86_fp80 %a0) nounwind {
91 ; X86-LABEL: fptosi_i32_fp80:
93 ; X86-NEXT: subl $8, %esp
94 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
95 ; X86-NEXT: fnstcw (%esp)
96 ; X86-NEXT: movzwl (%esp), %eax
97 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
98 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
99 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
100 ; X86-NEXT: fistpl {{[0-9]+}}(%esp)
101 ; X86-NEXT: fldcw (%esp)
102 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
103 ; X86-NEXT: addl $8, %esp
106 ; X64-X87-LABEL: fptosi_i32_fp80:
108 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
109 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
110 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
111 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
112 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
113 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
114 ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp)
115 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
116 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
119 ; X64-SSSE3-LABEL: fptosi_i32_fp80:
120 ; X64-SSSE3: # %bb.0:
121 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
122 ; X64-SSSE3-NEXT: fisttpl -{{[0-9]+}}(%rsp)
123 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
124 ; X64-SSSE3-NEXT: retq
125 %1 = fptosi x86_fp80 %a0 to i32
129 define i32 @fptosi_i32_fp80_ld(ptr%a0) nounwind {
130 ; X86-LABEL: fptosi_i32_fp80_ld:
132 ; X86-NEXT: subl $8, %esp
133 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
134 ; X86-NEXT: fldt (%eax)
135 ; X86-NEXT: fnstcw (%esp)
136 ; X86-NEXT: movzwl (%esp), %eax
137 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
138 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
139 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
140 ; X86-NEXT: fistpl {{[0-9]+}}(%esp)
141 ; X86-NEXT: fldcw (%esp)
142 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
143 ; X86-NEXT: addl $8, %esp
146 ; X64-X87-LABEL: fptosi_i32_fp80_ld:
148 ; X64-X87-NEXT: fldt (%rdi)
149 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
150 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
151 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
152 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
153 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
154 ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp)
155 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
156 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
159 ; X64-SSSE3-LABEL: fptosi_i32_fp80_ld:
160 ; X64-SSSE3: # %bb.0:
161 ; X64-SSSE3-NEXT: fldt (%rdi)
162 ; X64-SSSE3-NEXT: fisttpl -{{[0-9]+}}(%rsp)
163 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
164 ; X64-SSSE3-NEXT: retq
165 %1 = load x86_fp80, ptr%a0
166 %2 = fptosi x86_fp80 %1 to i32
170 define i64 @fptosi_i64_fp80(x86_fp80 %a0) nounwind {
171 ; X86-LABEL: fptosi_i64_fp80:
173 ; X86-NEXT: pushl %ebp
174 ; X86-NEXT: movl %esp, %ebp
175 ; X86-NEXT: andl $-8, %esp
176 ; X86-NEXT: subl $16, %esp
177 ; X86-NEXT: fldt 8(%ebp)
178 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
179 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
180 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
181 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
182 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
183 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
184 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
185 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
186 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
187 ; X86-NEXT: movl %ebp, %esp
188 ; X86-NEXT: popl %ebp
191 ; X64-X87-LABEL: fptosi_i64_fp80:
193 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
194 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
195 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
196 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
197 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
198 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
199 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
200 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
201 ; X64-X87-NEXT: movq -{{[0-9]+}}(%rsp), %rax
204 ; X64-SSSE3-LABEL: fptosi_i64_fp80:
205 ; X64-SSSE3: # %bb.0:
206 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
207 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
208 ; X64-SSSE3-NEXT: movq -{{[0-9]+}}(%rsp), %rax
209 ; X64-SSSE3-NEXT: retq
210 %1 = fptosi x86_fp80 %a0 to i64
214 define i64 @fptosi_i64_fp80_ld(ptr%a0) nounwind {
215 ; X86-LABEL: fptosi_i64_fp80_ld:
217 ; X86-NEXT: pushl %ebp
218 ; X86-NEXT: movl %esp, %ebp
219 ; X86-NEXT: andl $-8, %esp
220 ; X86-NEXT: subl $16, %esp
221 ; X86-NEXT: movl 8(%ebp), %eax
222 ; X86-NEXT: fldt (%eax)
223 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
224 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
225 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
226 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
227 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
228 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
229 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
230 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
231 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
232 ; X86-NEXT: movl %ebp, %esp
233 ; X86-NEXT: popl %ebp
236 ; X64-X87-LABEL: fptosi_i64_fp80_ld:
238 ; X64-X87-NEXT: fldt (%rdi)
239 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
240 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
241 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
242 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
243 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
244 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
245 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
246 ; X64-X87-NEXT: movq -{{[0-9]+}}(%rsp), %rax
249 ; X64-SSSE3-LABEL: fptosi_i64_fp80_ld:
250 ; X64-SSSE3: # %bb.0:
251 ; X64-SSSE3-NEXT: fldt (%rdi)
252 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
253 ; X64-SSSE3-NEXT: movq -{{[0-9]+}}(%rsp), %rax
254 ; X64-SSSE3-NEXT: retq
255 %1 = load x86_fp80, ptr%a0
256 %2 = fptosi x86_fp80 %1 to i64
264 define i16 @fptoui_i16_fp80(x86_fp80 %a0) nounwind {
265 ; X86-LABEL: fptoui_i16_fp80:
267 ; X86-NEXT: subl $8, %esp
268 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
269 ; X86-NEXT: fnstcw (%esp)
270 ; X86-NEXT: movzwl (%esp), %eax
271 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
272 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
273 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
274 ; X86-NEXT: fistpl {{[0-9]+}}(%esp)
275 ; X86-NEXT: fldcw (%esp)
276 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
277 ; X86-NEXT: # kill: def $ax killed $ax killed $eax
278 ; X86-NEXT: addl $8, %esp
281 ; X64-X87-LABEL: fptoui_i16_fp80:
283 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
284 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
285 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
286 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
287 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
288 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
289 ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp)
290 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
291 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
292 ; X64-X87-NEXT: # kill: def $ax killed $ax killed $eax
295 ; X64-SSSE3-LABEL: fptoui_i16_fp80:
296 ; X64-SSSE3: # %bb.0:
297 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
298 ; X64-SSSE3-NEXT: fisttpl -{{[0-9]+}}(%rsp)
299 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
300 ; X64-SSSE3-NEXT: # kill: def $ax killed $ax killed $eax
301 ; X64-SSSE3-NEXT: retq
302 %1 = fptoui x86_fp80 %a0 to i16
306 define i16 @fptoui_i16_fp80_ld(ptr%a0) nounwind {
307 ; X86-LABEL: fptoui_i16_fp80_ld:
309 ; X86-NEXT: subl $8, %esp
310 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
311 ; X86-NEXT: fldt (%eax)
312 ; X86-NEXT: fnstcw (%esp)
313 ; X86-NEXT: movzwl (%esp), %eax
314 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
315 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
316 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
317 ; X86-NEXT: fistpl {{[0-9]+}}(%esp)
318 ; X86-NEXT: fldcw (%esp)
319 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
320 ; X86-NEXT: # kill: def $ax killed $ax killed $eax
321 ; X86-NEXT: addl $8, %esp
324 ; X64-X87-LABEL: fptoui_i16_fp80_ld:
326 ; X64-X87-NEXT: fldt (%rdi)
327 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
328 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
329 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
330 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
331 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
332 ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp)
333 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
334 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
335 ; X64-X87-NEXT: # kill: def $ax killed $ax killed $eax
338 ; X64-SSSE3-LABEL: fptoui_i16_fp80_ld:
339 ; X64-SSSE3: # %bb.0:
340 ; X64-SSSE3-NEXT: fldt (%rdi)
341 ; X64-SSSE3-NEXT: fisttpl -{{[0-9]+}}(%rsp)
342 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
343 ; X64-SSSE3-NEXT: # kill: def $ax killed $ax killed $eax
344 ; X64-SSSE3-NEXT: retq
345 %1 = load x86_fp80, ptr%a0
346 %2 = fptoui x86_fp80 %1 to i16
350 define i32 @fptoui_i32_fp80(x86_fp80 %a0) nounwind {
351 ; X86-LABEL: fptoui_i32_fp80:
353 ; X86-NEXT: pushl %ebp
354 ; X86-NEXT: movl %esp, %ebp
355 ; X86-NEXT: andl $-8, %esp
356 ; X86-NEXT: subl $16, %esp
357 ; X86-NEXT: fldt 8(%ebp)
358 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
359 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
360 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
361 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
362 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
363 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
364 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
365 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
366 ; X86-NEXT: movl %ebp, %esp
367 ; X86-NEXT: popl %ebp
370 ; X64-X87-LABEL: fptoui_i32_fp80:
372 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
373 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
374 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
375 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
376 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
377 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
378 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
379 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
380 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
383 ; X64-SSSE3-LABEL: fptoui_i32_fp80:
384 ; X64-SSSE3: # %bb.0:
385 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
386 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
387 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
388 ; X64-SSSE3-NEXT: retq
389 %1 = fptoui x86_fp80 %a0 to i32
393 define i32 @fptoui_i32_fp80_ld(ptr%a0) nounwind {
394 ; X86-LABEL: fptoui_i32_fp80_ld:
396 ; X86-NEXT: pushl %ebp
397 ; X86-NEXT: movl %esp, %ebp
398 ; X86-NEXT: andl $-8, %esp
399 ; X86-NEXT: subl $16, %esp
400 ; X86-NEXT: movl 8(%ebp), %eax
401 ; X86-NEXT: fldt (%eax)
402 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
403 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
404 ; X86-NEXT: orl $3072, %eax # imm = 0xC00
405 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
406 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
407 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
408 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
409 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
410 ; X86-NEXT: movl %ebp, %esp
411 ; X86-NEXT: popl %ebp
414 ; X64-X87-LABEL: fptoui_i32_fp80_ld:
416 ; X64-X87-NEXT: fldt (%rdi)
417 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
418 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
419 ; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00
420 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
421 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
422 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
423 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
424 ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax
427 ; X64-SSSE3-LABEL: fptoui_i32_fp80_ld:
428 ; X64-SSSE3: # %bb.0:
429 ; X64-SSSE3-NEXT: fldt (%rdi)
430 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
431 ; X64-SSSE3-NEXT: movl -{{[0-9]+}}(%rsp), %eax
432 ; X64-SSSE3-NEXT: retq
433 %1 = load x86_fp80, ptr%a0
434 %2 = fptoui x86_fp80 %1 to i32
438 define i64 @fptoui_i64_fp80(x86_fp80 %a0) nounwind {
439 ; X86-LABEL: fptoui_i64_fp80:
441 ; X86-NEXT: pushl %ebp
442 ; X86-NEXT: movl %esp, %ebp
443 ; X86-NEXT: andl $-8, %esp
444 ; X86-NEXT: subl $16, %esp
445 ; X86-NEXT: fldt 8(%ebp)
446 ; X86-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
447 ; X86-NEXT: fucom %st(1)
448 ; X86-NEXT: fnstsw %ax
449 ; X86-NEXT: xorl %edx, %edx
450 ; X86-NEXT: # kill: def $ah killed $ah killed $ax
452 ; X86-NEXT: setbe %al
454 ; X86-NEXT: jbe .LBB10_2
456 ; X86-NEXT: fstp %st(1)
458 ; X86-NEXT: .LBB10_2:
459 ; X86-NEXT: fstp %st(0)
460 ; X86-NEXT: fsubrp %st, %st(1)
461 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
462 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
463 ; X86-NEXT: orl $3072, %ecx # imm = 0xC00
464 ; X86-NEXT: movw %cx, {{[0-9]+}}(%esp)
465 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
466 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
467 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
468 ; X86-NEXT: movb %al, %dl
469 ; X86-NEXT: shll $31, %edx
470 ; X86-NEXT: xorl {{[0-9]+}}(%esp), %edx
471 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
472 ; X86-NEXT: movl %ebp, %esp
473 ; X86-NEXT: popl %ebp
476 ; X64-X87-LABEL: fptoui_i64_fp80:
478 ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp)
479 ; X64-X87-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
480 ; X64-X87-NEXT: xorl %eax, %eax
481 ; X64-X87-NEXT: fucomi %st(1), %st
482 ; X64-X87-NEXT: setbe %al
484 ; X64-X87-NEXT: fcmovbe %st(1), %st
485 ; X64-X87-NEXT: fstp %st(1)
486 ; X64-X87-NEXT: fsubrp %st, %st(1)
487 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
488 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx
489 ; X64-X87-NEXT: orl $3072, %ecx # imm = 0xC00
490 ; X64-X87-NEXT: movw %cx, -{{[0-9]+}}(%rsp)
491 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
492 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
493 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
494 ; X64-X87-NEXT: shlq $63, %rax
495 ; X64-X87-NEXT: xorq -{{[0-9]+}}(%rsp), %rax
498 ; X64-SSSE3-LABEL: fptoui_i64_fp80:
499 ; X64-SSSE3: # %bb.0:
500 ; X64-SSSE3-NEXT: fldt {{[0-9]+}}(%rsp)
501 ; X64-SSSE3-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
502 ; X64-SSSE3-NEXT: xorl %eax, %eax
503 ; X64-SSSE3-NEXT: fucomi %st(1), %st
504 ; X64-SSSE3-NEXT: fldz
505 ; X64-SSSE3-NEXT: fcmovbe %st(1), %st
506 ; X64-SSSE3-NEXT: fstp %st(1)
507 ; X64-SSSE3-NEXT: fsubrp %st, %st(1)
508 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
509 ; X64-SSSE3-NEXT: setbe %al
510 ; X64-SSSE3-NEXT: shlq $63, %rax
511 ; X64-SSSE3-NEXT: xorq -{{[0-9]+}}(%rsp), %rax
512 ; X64-SSSE3-NEXT: retq
513 %1 = fptoui x86_fp80 %a0 to i64
517 define i64 @fptoui_i64_fp80_ld(ptr%a0) nounwind {
518 ; X86-LABEL: fptoui_i64_fp80_ld:
520 ; X86-NEXT: pushl %ebp
521 ; X86-NEXT: movl %esp, %ebp
522 ; X86-NEXT: andl $-8, %esp
523 ; X86-NEXT: subl $16, %esp
524 ; X86-NEXT: movl 8(%ebp), %eax
525 ; X86-NEXT: fldt (%eax)
526 ; X86-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
527 ; X86-NEXT: fucom %st(1)
528 ; X86-NEXT: fnstsw %ax
529 ; X86-NEXT: xorl %edx, %edx
530 ; X86-NEXT: # kill: def $ah killed $ah killed $ax
532 ; X86-NEXT: setbe %al
534 ; X86-NEXT: jbe .LBB11_2
536 ; X86-NEXT: fstp %st(1)
538 ; X86-NEXT: .LBB11_2:
539 ; X86-NEXT: fstp %st(0)
540 ; X86-NEXT: fsubrp %st, %st(1)
541 ; X86-NEXT: fnstcw {{[0-9]+}}(%esp)
542 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
543 ; X86-NEXT: orl $3072, %ecx # imm = 0xC00
544 ; X86-NEXT: movw %cx, {{[0-9]+}}(%esp)
545 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
546 ; X86-NEXT: fistpll {{[0-9]+}}(%esp)
547 ; X86-NEXT: fldcw {{[0-9]+}}(%esp)
548 ; X86-NEXT: movb %al, %dl
549 ; X86-NEXT: shll $31, %edx
550 ; X86-NEXT: xorl {{[0-9]+}}(%esp), %edx
551 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
552 ; X86-NEXT: movl %ebp, %esp
553 ; X86-NEXT: popl %ebp
556 ; X64-X87-LABEL: fptoui_i64_fp80_ld:
558 ; X64-X87-NEXT: fldt (%rdi)
559 ; X64-X87-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
560 ; X64-X87-NEXT: xorl %eax, %eax
561 ; X64-X87-NEXT: fucomi %st(1), %st
562 ; X64-X87-NEXT: setbe %al
564 ; X64-X87-NEXT: fcmovbe %st(1), %st
565 ; X64-X87-NEXT: fstp %st(1)
566 ; X64-X87-NEXT: fsubrp %st, %st(1)
567 ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp)
568 ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx
569 ; X64-X87-NEXT: orl $3072, %ecx # imm = 0xC00
570 ; X64-X87-NEXT: movw %cx, -{{[0-9]+}}(%rsp)
571 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
572 ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp)
573 ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp)
574 ; X64-X87-NEXT: shlq $63, %rax
575 ; X64-X87-NEXT: xorq -{{[0-9]+}}(%rsp), %rax
578 ; X64-SSSE3-LABEL: fptoui_i64_fp80_ld:
579 ; X64-SSSE3: # %bb.0:
580 ; X64-SSSE3-NEXT: fldt (%rdi)
581 ; X64-SSSE3-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}(%rip)
582 ; X64-SSSE3-NEXT: xorl %eax, %eax
583 ; X64-SSSE3-NEXT: fucomi %st(1), %st
584 ; X64-SSSE3-NEXT: fldz
585 ; X64-SSSE3-NEXT: fcmovbe %st(1), %st
586 ; X64-SSSE3-NEXT: fstp %st(1)
587 ; X64-SSSE3-NEXT: fsubrp %st, %st(1)
588 ; X64-SSSE3-NEXT: fisttpll -{{[0-9]+}}(%rsp)
589 ; X64-SSSE3-NEXT: setbe %al
590 ; X64-SSSE3-NEXT: shlq $63, %rax
591 ; X64-SSSE3-NEXT: xorq -{{[0-9]+}}(%rsp), %rax
592 ; X64-SSSE3-NEXT: retq
593 %1 = load x86_fp80, ptr%a0
594 %2 = fptoui x86_fp80 %1 to i64
602 define x86_fp80 @sitofp_fp80_i16(i16 %a0) nounwind {
603 ; X86-LABEL: sitofp_fp80_i16:
605 ; X86-NEXT: pushl %eax
606 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
607 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
608 ; X86-NEXT: filds {{[0-9]+}}(%esp)
609 ; X86-NEXT: popl %eax
612 ; X64-LABEL: sitofp_fp80_i16:
614 ; X64-NEXT: movw %di, -{{[0-9]+}}(%rsp)
615 ; X64-NEXT: filds -{{[0-9]+}}(%rsp)
617 %1 = sitofp i16 %a0 to x86_fp80
621 define x86_fp80 @sitofp_fp80_i16_ld(ptr%a0) nounwind {
622 ; X86-LABEL: sitofp_fp80_i16_ld:
624 ; X86-NEXT: pushl %eax
625 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
626 ; X86-NEXT: movzwl (%eax), %eax
627 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp)
628 ; X86-NEXT: filds {{[0-9]+}}(%esp)
629 ; X86-NEXT: popl %eax
632 ; X64-LABEL: sitofp_fp80_i16_ld:
634 ; X64-NEXT: movzwl (%rdi), %eax
635 ; X64-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
636 ; X64-NEXT: filds -{{[0-9]+}}(%rsp)
638 %1 = load i16, ptr%a0
639 %2 = sitofp i16 %1 to x86_fp80
643 define x86_fp80 @sitofp_fp80_i32(i32 %a0) nounwind {
644 ; X86-LABEL: sitofp_fp80_i32:
646 ; X86-NEXT: pushl %eax
647 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
648 ; X86-NEXT: movl %eax, (%esp)
649 ; X86-NEXT: fildl (%esp)
650 ; X86-NEXT: popl %eax
653 ; X64-LABEL: sitofp_fp80_i32:
655 ; X64-NEXT: movl %edi, -{{[0-9]+}}(%rsp)
656 ; X64-NEXT: fildl -{{[0-9]+}}(%rsp)
658 %1 = sitofp i32 %a0 to x86_fp80
662 define x86_fp80 @sitofp_fp80_i32_ld(ptr%a0) nounwind {
663 ; X86-LABEL: sitofp_fp80_i32_ld:
665 ; X86-NEXT: pushl %eax
666 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
667 ; X86-NEXT: movl (%eax), %eax
668 ; X86-NEXT: movl %eax, (%esp)
669 ; X86-NEXT: fildl (%esp)
670 ; X86-NEXT: popl %eax
673 ; X64-LABEL: sitofp_fp80_i32_ld:
675 ; X64-NEXT: movl (%rdi), %eax
676 ; X64-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
677 ; X64-NEXT: fildl -{{[0-9]+}}(%rsp)
679 %1 = load i32, ptr%a0
680 %2 = sitofp i32 %1 to x86_fp80
684 define x86_fp80 @sitofp_fp80_i64(i64 %a0) nounwind {
685 ; X86-LABEL: sitofp_fp80_i64:
687 ; X86-NEXT: fildll {{[0-9]+}}(%esp)
690 ; X64-LABEL: sitofp_fp80_i64:
692 ; X64-NEXT: movq %rdi, -{{[0-9]+}}(%rsp)
693 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
695 %1 = sitofp i64 %a0 to x86_fp80
699 define x86_fp80 @sitofp_fp80_i64_ld(ptr%a0) nounwind {
700 ; X86-LABEL: sitofp_fp80_i64_ld:
702 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
703 ; X86-NEXT: fildll (%eax)
706 ; X64-LABEL: sitofp_fp80_i64_ld:
708 ; X64-NEXT: movq (%rdi), %rax
709 ; X64-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
710 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
712 %1 = load i64, ptr%a0
713 %2 = sitofp i64 %1 to x86_fp80
721 define x86_fp80 @uitofp_fp80_i16(i16 %a0) nounwind {
722 ; X86-LABEL: uitofp_fp80_i16:
724 ; X86-NEXT: pushl %eax
725 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
726 ; X86-NEXT: movl %eax, (%esp)
727 ; X86-NEXT: fildl (%esp)
728 ; X86-NEXT: popl %eax
731 ; X64-LABEL: uitofp_fp80_i16:
733 ; X64-NEXT: movzwl %di, %eax
734 ; X64-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
735 ; X64-NEXT: fildl -{{[0-9]+}}(%rsp)
737 %1 = uitofp i16 %a0 to x86_fp80
741 define x86_fp80 @uitofp_fp80_i16_ld(ptr%a0) nounwind {
742 ; X86-LABEL: uitofp_fp80_i16_ld:
744 ; X86-NEXT: pushl %eax
745 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
746 ; X86-NEXT: movzwl (%eax), %eax
747 ; X86-NEXT: movl %eax, (%esp)
748 ; X86-NEXT: fildl (%esp)
749 ; X86-NEXT: popl %eax
752 ; X64-LABEL: uitofp_fp80_i16_ld:
754 ; X64-NEXT: movzwl (%rdi), %eax
755 ; X64-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
756 ; X64-NEXT: fildl -{{[0-9]+}}(%rsp)
758 %1 = load i16, ptr%a0
759 %2 = uitofp i16 %1 to x86_fp80
763 define x86_fp80 @uitofp_fp80_i32(i32 %a0) nounwind {
764 ; X86-LABEL: uitofp_fp80_i32:
766 ; X86-NEXT: pushl %ebp
767 ; X86-NEXT: movl %esp, %ebp
768 ; X86-NEXT: andl $-8, %esp
769 ; X86-NEXT: subl $8, %esp
770 ; X86-NEXT: movl 8(%ebp), %eax
771 ; X86-NEXT: movl %eax, (%esp)
772 ; X86-NEXT: movl $0, {{[0-9]+}}(%esp)
773 ; X86-NEXT: fildll (%esp)
774 ; X86-NEXT: movl %ebp, %esp
775 ; X86-NEXT: popl %ebp
778 ; X64-LABEL: uitofp_fp80_i32:
780 ; X64-NEXT: movl %edi, %eax
781 ; X64-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
782 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
784 %1 = uitofp i32 %a0 to x86_fp80
788 define x86_fp80 @uitofp_fp80_i32_ld(ptr%a0) nounwind {
789 ; X86-LABEL: uitofp_fp80_i32_ld:
791 ; X86-NEXT: pushl %ebp
792 ; X86-NEXT: movl %esp, %ebp
793 ; X86-NEXT: andl $-8, %esp
794 ; X86-NEXT: subl $8, %esp
795 ; X86-NEXT: movl 8(%ebp), %eax
796 ; X86-NEXT: movl (%eax), %eax
797 ; X86-NEXT: movl %eax, (%esp)
798 ; X86-NEXT: movl $0, {{[0-9]+}}(%esp)
799 ; X86-NEXT: fildll (%esp)
800 ; X86-NEXT: movl %ebp, %esp
801 ; X86-NEXT: popl %ebp
804 ; X64-LABEL: uitofp_fp80_i32_ld:
806 ; X64-NEXT: movl (%rdi), %eax
807 ; X64-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
808 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
810 %1 = load i32, ptr%a0
811 %2 = uitofp i32 %1 to x86_fp80
815 define x86_fp80 @uitofp_fp80_i64(i64 %a0) nounwind {
816 ; X86-LABEL: uitofp_fp80_i64:
818 ; X86-NEXT: pushl %ebp
819 ; X86-NEXT: movl %esp, %ebp
820 ; X86-NEXT: andl $-8, %esp
821 ; X86-NEXT: subl $8, %esp
822 ; X86-NEXT: movl 8(%ebp), %eax
823 ; X86-NEXT: movl 12(%ebp), %ecx
824 ; X86-NEXT: movl %ecx, {{[0-9]+}}(%esp)
825 ; X86-NEXT: movl %eax, (%esp)
826 ; X86-NEXT: shrl $31, %ecx
827 ; X86-NEXT: fildll (%esp)
828 ; X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%ecx,4)
829 ; X86-NEXT: movl %ebp, %esp
830 ; X86-NEXT: popl %ebp
833 ; X64-LABEL: uitofp_fp80_i64:
835 ; X64-NEXT: movq %rdi, -{{[0-9]+}}(%rsp)
836 ; X64-NEXT: xorl %eax, %eax
837 ; X64-NEXT: testq %rdi, %rdi
839 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
840 ; X64-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%rax,4)
842 %1 = uitofp i64 %a0 to x86_fp80
846 define x86_fp80 @uitofp_fp80_i64_ld(ptr%a0) nounwind {
847 ; X86-LABEL: uitofp_fp80_i64_ld:
849 ; X86-NEXT: pushl %ebp
850 ; X86-NEXT: movl %esp, %ebp
851 ; X86-NEXT: andl $-8, %esp
852 ; X86-NEXT: subl $8, %esp
853 ; X86-NEXT: movl 8(%ebp), %eax
854 ; X86-NEXT: movl (%eax), %ecx
855 ; X86-NEXT: movl 4(%eax), %eax
856 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
857 ; X86-NEXT: movl %ecx, (%esp)
858 ; X86-NEXT: shrl $31, %eax
859 ; X86-NEXT: fildll (%esp)
860 ; X86-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%eax,4)
861 ; X86-NEXT: movl %ebp, %esp
862 ; X86-NEXT: popl %ebp
865 ; X64-LABEL: uitofp_fp80_i64_ld:
867 ; X64-NEXT: movq (%rdi), %rax
868 ; X64-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
869 ; X64-NEXT: xorl %ecx, %ecx
870 ; X64-NEXT: testq %rax, %rax
872 ; X64-NEXT: fildll -{{[0-9]+}}(%rsp)
873 ; X64-NEXT: fadds {{\.?LCPI[0-9]+_[0-9]+}}(,%rcx,4)
875 %1 = load i64, ptr%a0
876 %2 = uitofp i64 %1 to x86_fp80
884 define x86_fp80 @floor_fp80(x86_fp80 %a0) nounwind {
885 ; X86-LABEL: floor_fp80:
887 ; X86-NEXT: subl $12, %esp
888 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
889 ; X86-NEXT: fstpt (%esp)
890 ; X86-NEXT: calll floorl
891 ; X86-NEXT: addl $12, %esp
894 ; X64-LABEL: floor_fp80:
896 ; X64-NEXT: subq $24, %rsp
897 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
898 ; X64-NEXT: fstpt (%rsp)
899 ; X64-NEXT: callq floorl@PLT
900 ; X64-NEXT: addq $24, %rsp
902 %1 = call x86_fp80 @llvm.floor.f80(x86_fp80 %a0)
906 define x86_fp80 @floor_fp80_ld(ptr%a0) nounwind {
907 ; X86-LABEL: floor_fp80_ld:
909 ; X86-NEXT: subl $12, %esp
910 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
911 ; X86-NEXT: fldt (%eax)
912 ; X86-NEXT: fstpt (%esp)
913 ; X86-NEXT: calll floorl
914 ; X86-NEXT: addl $12, %esp
917 ; X64-LABEL: floor_fp80_ld:
919 ; X64-NEXT: subq $24, %rsp
920 ; X64-NEXT: fldt (%rdi)
921 ; X64-NEXT: fstpt (%rsp)
922 ; X64-NEXT: callq floorl@PLT
923 ; X64-NEXT: addq $24, %rsp
925 %1 = load x86_fp80, ptr%a0
926 %2 = call x86_fp80 @llvm.floor.f80(x86_fp80 %1)
930 declare x86_fp80 @llvm.floor.f80(x86_fp80 %p)
936 define x86_fp80 @ceil_fp80(x86_fp80 %a0) nounwind {
937 ; X86-LABEL: ceil_fp80:
939 ; X86-NEXT: subl $12, %esp
940 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
941 ; X86-NEXT: fstpt (%esp)
942 ; X86-NEXT: calll ceill
943 ; X86-NEXT: addl $12, %esp
946 ; X64-LABEL: ceil_fp80:
948 ; X64-NEXT: subq $24, %rsp
949 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
950 ; X64-NEXT: fstpt (%rsp)
951 ; X64-NEXT: callq ceill@PLT
952 ; X64-NEXT: addq $24, %rsp
954 %1 = call x86_fp80 @llvm.ceil.f80(x86_fp80 %a0)
958 define x86_fp80 @ceil_fp80_ld(ptr%a0) nounwind {
959 ; X86-LABEL: ceil_fp80_ld:
961 ; X86-NEXT: subl $12, %esp
962 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
963 ; X86-NEXT: fldt (%eax)
964 ; X86-NEXT: fstpt (%esp)
965 ; X86-NEXT: calll ceill
966 ; X86-NEXT: addl $12, %esp
969 ; X64-LABEL: ceil_fp80_ld:
971 ; X64-NEXT: subq $24, %rsp
972 ; X64-NEXT: fldt (%rdi)
973 ; X64-NEXT: fstpt (%rsp)
974 ; X64-NEXT: callq ceill@PLT
975 ; X64-NEXT: addq $24, %rsp
977 %1 = load x86_fp80, ptr%a0
978 %2 = call x86_fp80 @llvm.ceil.f80(x86_fp80 %1)
982 declare x86_fp80 @llvm.ceil.f80(x86_fp80 %p)
988 define x86_fp80 @trunc_fp80(x86_fp80 %a0) nounwind {
989 ; X86-LABEL: trunc_fp80:
991 ; X86-NEXT: subl $12, %esp
992 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
993 ; X86-NEXT: fstpt (%esp)
994 ; X86-NEXT: calll truncl
995 ; X86-NEXT: addl $12, %esp
998 ; X64-LABEL: trunc_fp80:
1000 ; X64-NEXT: subq $24, %rsp
1001 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
1002 ; X64-NEXT: fstpt (%rsp)
1003 ; X64-NEXT: callq truncl@PLT
1004 ; X64-NEXT: addq $24, %rsp
1006 %1 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %a0)
1010 define x86_fp80 @trunc_fp80_ld(ptr%a0) nounwind {
1011 ; X86-LABEL: trunc_fp80_ld:
1013 ; X86-NEXT: subl $12, %esp
1014 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1015 ; X86-NEXT: fldt (%eax)
1016 ; X86-NEXT: fstpt (%esp)
1017 ; X86-NEXT: calll truncl
1018 ; X86-NEXT: addl $12, %esp
1021 ; X64-LABEL: trunc_fp80_ld:
1023 ; X64-NEXT: subq $24, %rsp
1024 ; X64-NEXT: fldt (%rdi)
1025 ; X64-NEXT: fstpt (%rsp)
1026 ; X64-NEXT: callq truncl@PLT
1027 ; X64-NEXT: addq $24, %rsp
1029 %1 = load x86_fp80, ptr%a0
1030 %2 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %1)
1034 declare x86_fp80 @llvm.trunc.f80(x86_fp80 %p)
1040 define x86_fp80 @rint_fp80(x86_fp80 %a0) nounwind {
1041 ; X86-LABEL: rint_fp80:
1043 ; X86-NEXT: subl $12, %esp
1044 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
1045 ; X86-NEXT: fstpt (%esp)
1046 ; X86-NEXT: calll rintl
1047 ; X86-NEXT: addl $12, %esp
1050 ; X64-LABEL: rint_fp80:
1052 ; X64-NEXT: subq $24, %rsp
1053 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
1054 ; X64-NEXT: fstpt (%rsp)
1055 ; X64-NEXT: callq rintl@PLT
1056 ; X64-NEXT: addq $24, %rsp
1058 %1 = call x86_fp80 @llvm.rint.f80(x86_fp80 %a0)
1062 define x86_fp80 @rint_fp80_ld(ptr%a0) nounwind {
1063 ; X86-LABEL: rint_fp80_ld:
1065 ; X86-NEXT: subl $12, %esp
1066 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1067 ; X86-NEXT: fldt (%eax)
1068 ; X86-NEXT: fstpt (%esp)
1069 ; X86-NEXT: calll rintl
1070 ; X86-NEXT: addl $12, %esp
1073 ; X64-LABEL: rint_fp80_ld:
1075 ; X64-NEXT: subq $24, %rsp
1076 ; X64-NEXT: fldt (%rdi)
1077 ; X64-NEXT: fstpt (%rsp)
1078 ; X64-NEXT: callq rintl@PLT
1079 ; X64-NEXT: addq $24, %rsp
1081 %1 = load x86_fp80, ptr%a0
1082 %2 = call x86_fp80 @llvm.rint.f80(x86_fp80 %1)
1086 declare x86_fp80 @llvm.rint.f80(x86_fp80 %p)
1092 define x86_fp80 @roundeven_fp80(x86_fp80 %a0) nounwind {
1093 ; X86-LABEL: roundeven_fp80:
1095 ; X86-NEXT: subl $12, %esp
1096 ; X86-NEXT: fldt {{[0-9]+}}(%esp)
1097 ; X86-NEXT: fstpt (%esp)
1098 ; X86-NEXT: calll roundevenl
1099 ; X86-NEXT: addl $12, %esp
1102 ; X64-LABEL: roundeven_fp80:
1104 ; X64-NEXT: subq $24, %rsp
1105 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
1106 ; X64-NEXT: fstpt (%rsp)
1107 ; X64-NEXT: callq roundevenl@PLT
1108 ; X64-NEXT: addq $24, %rsp
1110 %1 = call x86_fp80 @llvm.roundeven.f80(x86_fp80 %a0)
1114 define x86_fp80 @roundeven_fp80_ld(ptr%a0) nounwind {
1115 ; X86-LABEL: roundeven_fp80_ld:
1117 ; X86-NEXT: subl $12, %esp
1118 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1119 ; X86-NEXT: fldt (%eax)
1120 ; X86-NEXT: fstpt (%esp)
1121 ; X86-NEXT: calll roundevenl
1122 ; X86-NEXT: addl $12, %esp
1125 ; X64-LABEL: roundeven_fp80_ld:
1127 ; X64-NEXT: subq $24, %rsp
1128 ; X64-NEXT: fldt (%rdi)
1129 ; X64-NEXT: fstpt (%rsp)
1130 ; X64-NEXT: callq roundevenl@PLT
1131 ; X64-NEXT: addq $24, %rsp
1133 %1 = load x86_fp80, ptr%a0
1134 %2 = call x86_fp80 @llvm.roundeven.f80(x86_fp80 %1)
1138 declare x86_fp80 @llvm.roundeven.f80(x86_fp80 %p)