1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQVL_32_WIN
3 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQVL_32_LIN
4 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQVL_64_WIN
5 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQVL_64_LIN
6 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQ_32_WIN
7 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQ_32_LIN
8 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQ_64_WIN
9 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQ_64_LIN
10 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512F_32_WIN
11 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512F_32_LIN
12 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512F_64_WIN
13 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512F_64_LIN
14 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_WIN
15 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_LIN
16 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_WIN
17 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_LIN
18 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_WIN
19 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_LIN
20 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_WIN
21 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_LIN
22 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X32,SSE_32,SSE_32_WIN
23 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X32,SSE_32,SSE_32_LIN
24 ; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_WIN
25 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_LIN
27 ; Check that scalar FP conversions to signed and unsigned int32 are using
28 ; reasonable sequences, across platforms and target switches.
30 define i32 @f_to_u32(float %a) nounwind {
31 ; AVX512_32-LABEL: f_to_u32:
33 ; AVX512_32-NEXT: vcvttss2usi {{[0-9]+}}(%esp), %eax
34 ; AVX512_32-NEXT: retl
36 ; AVX512_64-LABEL: f_to_u32:
38 ; AVX512_64-NEXT: vcvttss2usi %xmm0, %eax
39 ; AVX512_64-NEXT: retq
41 ; SSE3_32_WIN-LABEL: f_to_u32:
42 ; SSE3_32_WIN: # %bb.0:
43 ; SSE3_32_WIN-NEXT: pushl %ebp
44 ; SSE3_32_WIN-NEXT: movl %esp, %ebp
45 ; SSE3_32_WIN-NEXT: andl $-8, %esp
46 ; SSE3_32_WIN-NEXT: subl $8, %esp
47 ; SSE3_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
48 ; SSE3_32_WIN-NEXT: movss %xmm0, (%esp)
49 ; SSE3_32_WIN-NEXT: flds (%esp)
50 ; SSE3_32_WIN-NEXT: fisttpll (%esp)
51 ; SSE3_32_WIN-NEXT: movl (%esp), %eax
52 ; SSE3_32_WIN-NEXT: movl %ebp, %esp
53 ; SSE3_32_WIN-NEXT: popl %ebp
54 ; SSE3_32_WIN-NEXT: retl
56 ; SSE3_32_LIN-LABEL: f_to_u32:
57 ; SSE3_32_LIN: # %bb.0:
58 ; SSE3_32_LIN-NEXT: subl $12, %esp
59 ; SSE3_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
60 ; SSE3_32_LIN-NEXT: movss %xmm0, (%esp)
61 ; SSE3_32_LIN-NEXT: flds (%esp)
62 ; SSE3_32_LIN-NEXT: fisttpll (%esp)
63 ; SSE3_32_LIN-NEXT: movl (%esp), %eax
64 ; SSE3_32_LIN-NEXT: addl $12, %esp
65 ; SSE3_32_LIN-NEXT: retl
67 ; SSE3_64-LABEL: f_to_u32:
69 ; SSE3_64-NEXT: cvttss2si %xmm0, %rax
70 ; SSE3_64-NEXT: # kill: def $eax killed $eax killed $rax
73 ; SSE2_32-LABEL: f_to_u32:
75 ; SSE2_32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
76 ; SSE2_32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
77 ; SSE2_32-NEXT: movaps %xmm0, %xmm2
78 ; SSE2_32-NEXT: subss %xmm1, %xmm2
79 ; SSE2_32-NEXT: cvttss2si %xmm2, %ecx
80 ; SSE2_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000
81 ; SSE2_32-NEXT: cvttss2si %xmm0, %eax
82 ; SSE2_32-NEXT: ucomiss %xmm0, %xmm1
83 ; SSE2_32-NEXT: cmovbel %ecx, %eax
86 ; SSE2_64-LABEL: f_to_u32:
88 ; SSE2_64-NEXT: cvttss2si %xmm0, %rax
89 ; SSE2_64-NEXT: # kill: def $eax killed $eax killed $rax
92 ; SSE_32-LABEL: f_to_u32:
94 ; SSE_32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
95 ; SSE_32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
96 ; SSE_32-NEXT: movaps %xmm0, %xmm2
97 ; SSE_32-NEXT: subss %xmm1, %xmm2
98 ; SSE_32-NEXT: cvttss2si %xmm2, %ecx
99 ; SSE_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000
100 ; SSE_32-NEXT: cvttss2si %xmm0, %eax
101 ; SSE_32-NEXT: ucomiss %xmm0, %xmm1
102 ; SSE_32-NEXT: cmovbel %ecx, %eax
105 ; X87_WIN-LABEL: f_to_u32:
107 ; X87_WIN-NEXT: pushl %ebp
108 ; X87_WIN-NEXT: movl %esp, %ebp
109 ; X87_WIN-NEXT: andl $-8, %esp
110 ; X87_WIN-NEXT: subl $16, %esp
111 ; X87_WIN-NEXT: flds 8(%ebp)
112 ; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
113 ; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
114 ; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00
115 ; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
116 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
117 ; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
118 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
119 ; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
120 ; X87_WIN-NEXT: movl %ebp, %esp
121 ; X87_WIN-NEXT: popl %ebp
124 ; X87_LIN-LABEL: f_to_u32:
126 ; X87_LIN-NEXT: subl $20, %esp
127 ; X87_LIN-NEXT: flds {{[0-9]+}}(%esp)
128 ; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
129 ; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
130 ; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00
131 ; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
132 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
133 ; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
134 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
135 ; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
136 ; X87_LIN-NEXT: addl $20, %esp
138 %r = fptoui float %a to i32
142 define i32 @f_to_s32(float %a) nounwind {
143 ; AVX512_32-LABEL: f_to_s32:
144 ; AVX512_32: # %bb.0:
145 ; AVX512_32-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax
146 ; AVX512_32-NEXT: retl
148 ; AVX512_64-LABEL: f_to_s32:
149 ; AVX512_64: # %bb.0:
150 ; AVX512_64-NEXT: vcvttss2si %xmm0, %eax
151 ; AVX512_64-NEXT: retq
153 ; SSE3_32-LABEL: f_to_s32:
155 ; SSE3_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax
158 ; SSE3_64-LABEL: f_to_s32:
160 ; SSE3_64-NEXT: cvttss2si %xmm0, %eax
163 ; SSE2_32-LABEL: f_to_s32:
165 ; SSE2_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax
168 ; SSE2_64-LABEL: f_to_s32:
170 ; SSE2_64-NEXT: cvttss2si %xmm0, %eax
173 ; SSE_32-LABEL: f_to_s32:
175 ; SSE_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax
178 ; X87-LABEL: f_to_s32:
180 ; X87-NEXT: subl $8, %esp
181 ; X87-NEXT: flds {{[0-9]+}}(%esp)
182 ; X87-NEXT: fnstcw (%esp)
183 ; X87-NEXT: movzwl (%esp), %eax
184 ; X87-NEXT: orl $3072, %eax # imm = 0xC00
185 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
186 ; X87-NEXT: fldcw {{[0-9]+}}(%esp)
187 ; X87-NEXT: fistpl {{[0-9]+}}(%esp)
188 ; X87-NEXT: fldcw (%esp)
189 ; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
190 ; X87-NEXT: addl $8, %esp
192 %r = fptosi float %a to i32
196 define i32 @d_to_u32(double %a) nounwind {
197 ; AVX512_32-LABEL: d_to_u32:
198 ; AVX512_32: # %bb.0:
199 ; AVX512_32-NEXT: vcvttsd2usi {{[0-9]+}}(%esp), %eax
200 ; AVX512_32-NEXT: retl
202 ; AVX512_64-LABEL: d_to_u32:
203 ; AVX512_64: # %bb.0:
204 ; AVX512_64-NEXT: vcvttsd2usi %xmm0, %eax
205 ; AVX512_64-NEXT: retq
207 ; SSE3_32_WIN-LABEL: d_to_u32:
208 ; SSE3_32_WIN: # %bb.0:
209 ; SSE3_32_WIN-NEXT: pushl %ebp
210 ; SSE3_32_WIN-NEXT: movl %esp, %ebp
211 ; SSE3_32_WIN-NEXT: andl $-8, %esp
212 ; SSE3_32_WIN-NEXT: subl $8, %esp
213 ; SSE3_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
214 ; SSE3_32_WIN-NEXT: movsd %xmm0, (%esp)
215 ; SSE3_32_WIN-NEXT: fldl (%esp)
216 ; SSE3_32_WIN-NEXT: fisttpll (%esp)
217 ; SSE3_32_WIN-NEXT: movl (%esp), %eax
218 ; SSE3_32_WIN-NEXT: movl %ebp, %esp
219 ; SSE3_32_WIN-NEXT: popl %ebp
220 ; SSE3_32_WIN-NEXT: retl
222 ; SSE3_32_LIN-LABEL: d_to_u32:
223 ; SSE3_32_LIN: # %bb.0:
224 ; SSE3_32_LIN-NEXT: subl $12, %esp
225 ; SSE3_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
226 ; SSE3_32_LIN-NEXT: movsd %xmm0, (%esp)
227 ; SSE3_32_LIN-NEXT: fldl (%esp)
228 ; SSE3_32_LIN-NEXT: fisttpll (%esp)
229 ; SSE3_32_LIN-NEXT: movl (%esp), %eax
230 ; SSE3_32_LIN-NEXT: addl $12, %esp
231 ; SSE3_32_LIN-NEXT: retl
233 ; SSE3_64-LABEL: d_to_u32:
235 ; SSE3_64-NEXT: cvttsd2si %xmm0, %rax
236 ; SSE3_64-NEXT: # kill: def $eax killed $eax killed $rax
239 ; SSE2_32-LABEL: d_to_u32:
241 ; SSE2_32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
242 ; SSE2_32-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
243 ; SSE2_32-NEXT: movapd %xmm0, %xmm2
244 ; SSE2_32-NEXT: subsd %xmm1, %xmm2
245 ; SSE2_32-NEXT: cvttsd2si %xmm2, %ecx
246 ; SSE2_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000
247 ; SSE2_32-NEXT: cvttsd2si %xmm0, %eax
248 ; SSE2_32-NEXT: ucomisd %xmm0, %xmm1
249 ; SSE2_32-NEXT: cmovbel %ecx, %eax
252 ; SSE2_64-LABEL: d_to_u32:
254 ; SSE2_64-NEXT: cvttsd2si %xmm0, %rax
255 ; SSE2_64-NEXT: # kill: def $eax killed $eax killed $rax
258 ; SSE_32_WIN-LABEL: d_to_u32:
259 ; SSE_32_WIN: # %bb.0:
260 ; SSE_32_WIN-NEXT: pushl %ebp
261 ; SSE_32_WIN-NEXT: movl %esp, %ebp
262 ; SSE_32_WIN-NEXT: andl $-8, %esp
263 ; SSE_32_WIN-NEXT: subl $16, %esp
264 ; SSE_32_WIN-NEXT: fldl 8(%ebp)
265 ; SSE_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
266 ; SSE_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
267 ; SSE_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00
268 ; SSE_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
269 ; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
270 ; SSE_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
271 ; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
272 ; SSE_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
273 ; SSE_32_WIN-NEXT: movl %ebp, %esp
274 ; SSE_32_WIN-NEXT: popl %ebp
275 ; SSE_32_WIN-NEXT: retl
277 ; SSE_32_LIN-LABEL: d_to_u32:
278 ; SSE_32_LIN: # %bb.0:
279 ; SSE_32_LIN-NEXT: subl $20, %esp
280 ; SSE_32_LIN-NEXT: fldl {{[0-9]+}}(%esp)
281 ; SSE_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
282 ; SSE_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
283 ; SSE_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00
284 ; SSE_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
285 ; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
286 ; SSE_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
287 ; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
288 ; SSE_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
289 ; SSE_32_LIN-NEXT: addl $20, %esp
290 ; SSE_32_LIN-NEXT: retl
292 ; X87_WIN-LABEL: d_to_u32:
294 ; X87_WIN-NEXT: pushl %ebp
295 ; X87_WIN-NEXT: movl %esp, %ebp
296 ; X87_WIN-NEXT: andl $-8, %esp
297 ; X87_WIN-NEXT: subl $16, %esp
298 ; X87_WIN-NEXT: fldl 8(%ebp)
299 ; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
300 ; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
301 ; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00
302 ; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
303 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
304 ; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
305 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
306 ; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
307 ; X87_WIN-NEXT: movl %ebp, %esp
308 ; X87_WIN-NEXT: popl %ebp
311 ; X87_LIN-LABEL: d_to_u32:
313 ; X87_LIN-NEXT: subl $20, %esp
314 ; X87_LIN-NEXT: fldl {{[0-9]+}}(%esp)
315 ; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
316 ; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
317 ; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00
318 ; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
319 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
320 ; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
321 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
322 ; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
323 ; X87_LIN-NEXT: addl $20, %esp
325 %r = fptoui double %a to i32
329 define i32 @d_to_s32(double %a) nounwind {
330 ; AVX512_32-LABEL: d_to_s32:
331 ; AVX512_32: # %bb.0:
332 ; AVX512_32-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax
333 ; AVX512_32-NEXT: retl
335 ; AVX512_64-LABEL: d_to_s32:
336 ; AVX512_64: # %bb.0:
337 ; AVX512_64-NEXT: vcvttsd2si %xmm0, %eax
338 ; AVX512_64-NEXT: retq
340 ; SSE3_32-LABEL: d_to_s32:
342 ; SSE3_32-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax
345 ; SSE3_64-LABEL: d_to_s32:
347 ; SSE3_64-NEXT: cvttsd2si %xmm0, %eax
350 ; SSE2_32-LABEL: d_to_s32:
352 ; SSE2_32-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax
355 ; SSE2_64-LABEL: d_to_s32:
357 ; SSE2_64-NEXT: cvttsd2si %xmm0, %eax
360 ; SSE_32-LABEL: d_to_s32:
362 ; SSE_32-NEXT: subl $8, %esp
363 ; SSE_32-NEXT: fldl {{[0-9]+}}(%esp)
364 ; SSE_32-NEXT: fnstcw (%esp)
365 ; SSE_32-NEXT: movzwl (%esp), %eax
366 ; SSE_32-NEXT: orl $3072, %eax # imm = 0xC00
367 ; SSE_32-NEXT: movw %ax, {{[0-9]+}}(%esp)
368 ; SSE_32-NEXT: fldcw {{[0-9]+}}(%esp)
369 ; SSE_32-NEXT: fistpl {{[0-9]+}}(%esp)
370 ; SSE_32-NEXT: fldcw (%esp)
371 ; SSE_32-NEXT: movl {{[0-9]+}}(%esp), %eax
372 ; SSE_32-NEXT: addl $8, %esp
375 ; X87-LABEL: d_to_s32:
377 ; X87-NEXT: subl $8, %esp
378 ; X87-NEXT: fldl {{[0-9]+}}(%esp)
379 ; X87-NEXT: fnstcw (%esp)
380 ; X87-NEXT: movzwl (%esp), %eax
381 ; X87-NEXT: orl $3072, %eax # imm = 0xC00
382 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
383 ; X87-NEXT: fldcw {{[0-9]+}}(%esp)
384 ; X87-NEXT: fistpl {{[0-9]+}}(%esp)
385 ; X87-NEXT: fldcw (%esp)
386 ; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
387 ; X87-NEXT: addl $8, %esp
389 %r = fptosi double %a to i32
393 define i32 @x_to_u32(x86_fp80 %a) nounwind {
394 ; AVX512_32_WIN-LABEL: x_to_u32:
395 ; AVX512_32_WIN: # %bb.0:
396 ; AVX512_32_WIN-NEXT: pushl %ebp
397 ; AVX512_32_WIN-NEXT: movl %esp, %ebp
398 ; AVX512_32_WIN-NEXT: andl $-8, %esp
399 ; AVX512_32_WIN-NEXT: subl $8, %esp
400 ; AVX512_32_WIN-NEXT: fldt 8(%ebp)
401 ; AVX512_32_WIN-NEXT: fisttpll (%esp)
402 ; AVX512_32_WIN-NEXT: movl (%esp), %eax
403 ; AVX512_32_WIN-NEXT: movl %ebp, %esp
404 ; AVX512_32_WIN-NEXT: popl %ebp
405 ; AVX512_32_WIN-NEXT: retl
407 ; AVX512_32_LIN-LABEL: x_to_u32:
408 ; AVX512_32_LIN: # %bb.0:
409 ; AVX512_32_LIN-NEXT: subl $12, %esp
410 ; AVX512_32_LIN-NEXT: fldt {{[0-9]+}}(%esp)
411 ; AVX512_32_LIN-NEXT: fisttpll (%esp)
412 ; AVX512_32_LIN-NEXT: movl (%esp), %eax
413 ; AVX512_32_LIN-NEXT: addl $12, %esp
414 ; AVX512_32_LIN-NEXT: retl
416 ; AVX512_64_WIN-LABEL: x_to_u32:
417 ; AVX512_64_WIN: # %bb.0:
418 ; AVX512_64_WIN-NEXT: pushq %rax
419 ; AVX512_64_WIN-NEXT: fldt (%rcx)
420 ; AVX512_64_WIN-NEXT: fisttpll (%rsp)
421 ; AVX512_64_WIN-NEXT: movl (%rsp), %eax
422 ; AVX512_64_WIN-NEXT: popq %rcx
423 ; AVX512_64_WIN-NEXT: retq
425 ; AVX512_64_LIN-LABEL: x_to_u32:
426 ; AVX512_64_LIN: # %bb.0:
427 ; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
428 ; AVX512_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp)
429 ; AVX512_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
430 ; AVX512_64_LIN-NEXT: retq
432 ; SSE3_32_WIN-LABEL: x_to_u32:
433 ; SSE3_32_WIN: # %bb.0:
434 ; SSE3_32_WIN-NEXT: pushl %ebp
435 ; SSE3_32_WIN-NEXT: movl %esp, %ebp
436 ; SSE3_32_WIN-NEXT: andl $-8, %esp
437 ; SSE3_32_WIN-NEXT: subl $8, %esp
438 ; SSE3_32_WIN-NEXT: fldt 8(%ebp)
439 ; SSE3_32_WIN-NEXT: fisttpll (%esp)
440 ; SSE3_32_WIN-NEXT: movl (%esp), %eax
441 ; SSE3_32_WIN-NEXT: movl %ebp, %esp
442 ; SSE3_32_WIN-NEXT: popl %ebp
443 ; SSE3_32_WIN-NEXT: retl
445 ; SSE3_32_LIN-LABEL: x_to_u32:
446 ; SSE3_32_LIN: # %bb.0:
447 ; SSE3_32_LIN-NEXT: subl $12, %esp
448 ; SSE3_32_LIN-NEXT: fldt {{[0-9]+}}(%esp)
449 ; SSE3_32_LIN-NEXT: fisttpll (%esp)
450 ; SSE3_32_LIN-NEXT: movl (%esp), %eax
451 ; SSE3_32_LIN-NEXT: addl $12, %esp
452 ; SSE3_32_LIN-NEXT: retl
454 ; SSE3_64_WIN-LABEL: x_to_u32:
455 ; SSE3_64_WIN: # %bb.0:
456 ; SSE3_64_WIN-NEXT: pushq %rax
457 ; SSE3_64_WIN-NEXT: fldt (%rcx)
458 ; SSE3_64_WIN-NEXT: fisttpll (%rsp)
459 ; SSE3_64_WIN-NEXT: movl (%rsp), %eax
460 ; SSE3_64_WIN-NEXT: popq %rcx
461 ; SSE3_64_WIN-NEXT: retq
463 ; SSE3_64_LIN-LABEL: x_to_u32:
464 ; SSE3_64_LIN: # %bb.0:
465 ; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
466 ; SSE3_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp)
467 ; SSE3_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
468 ; SSE3_64_LIN-NEXT: retq
470 ; SSE2_32_WIN-LABEL: x_to_u32:
471 ; SSE2_32_WIN: # %bb.0:
472 ; SSE2_32_WIN-NEXT: pushl %ebp
473 ; SSE2_32_WIN-NEXT: movl %esp, %ebp
474 ; SSE2_32_WIN-NEXT: andl $-8, %esp
475 ; SSE2_32_WIN-NEXT: subl $16, %esp
476 ; SSE2_32_WIN-NEXT: fldt 8(%ebp)
477 ; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
478 ; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
479 ; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00
480 ; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
481 ; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
482 ; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
483 ; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
484 ; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
485 ; SSE2_32_WIN-NEXT: movl %ebp, %esp
486 ; SSE2_32_WIN-NEXT: popl %ebp
487 ; SSE2_32_WIN-NEXT: retl
489 ; SSE2_32_LIN-LABEL: x_to_u32:
490 ; SSE2_32_LIN: # %bb.0:
491 ; SSE2_32_LIN-NEXT: subl $20, %esp
492 ; SSE2_32_LIN-NEXT: fldt {{[0-9]+}}(%esp)
493 ; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
494 ; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
495 ; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00
496 ; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
497 ; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
498 ; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
499 ; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
500 ; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
501 ; SSE2_32_LIN-NEXT: addl $20, %esp
502 ; SSE2_32_LIN-NEXT: retl
504 ; SSE2_64_WIN-LABEL: x_to_u32:
505 ; SSE2_64_WIN: # %bb.0:
506 ; SSE2_64_WIN-NEXT: subq $16, %rsp
507 ; SSE2_64_WIN-NEXT: fldt (%rcx)
508 ; SSE2_64_WIN-NEXT: fnstcw {{[0-9]+}}(%rsp)
509 ; SSE2_64_WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
510 ; SSE2_64_WIN-NEXT: orl $3072, %eax # imm = 0xC00
511 ; SSE2_64_WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp)
512 ; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp)
513 ; SSE2_64_WIN-NEXT: fistpll {{[0-9]+}}(%rsp)
514 ; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp)
515 ; SSE2_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax
516 ; SSE2_64_WIN-NEXT: addq $16, %rsp
517 ; SSE2_64_WIN-NEXT: retq
519 ; SSE2_64_LIN-LABEL: x_to_u32:
520 ; SSE2_64_LIN: # %bb.0:
521 ; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
522 ; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp)
523 ; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
524 ; SSE2_64_LIN-NEXT: orl $3072, %eax # imm = 0xC00
525 ; SSE2_64_LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
526 ; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp)
527 ; SSE2_64_LIN-NEXT: fistpll -{{[0-9]+}}(%rsp)
528 ; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp)
529 ; SSE2_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
530 ; SSE2_64_LIN-NEXT: retq
532 ; SSE_32_WIN-LABEL: x_to_u32:
533 ; SSE_32_WIN: # %bb.0:
534 ; SSE_32_WIN-NEXT: pushl %ebp
535 ; SSE_32_WIN-NEXT: movl %esp, %ebp
536 ; SSE_32_WIN-NEXT: andl $-8, %esp
537 ; SSE_32_WIN-NEXT: subl $16, %esp
538 ; SSE_32_WIN-NEXT: fldt 8(%ebp)
539 ; SSE_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
540 ; SSE_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
541 ; SSE_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00
542 ; SSE_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
543 ; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
544 ; SSE_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
545 ; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
546 ; SSE_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
547 ; SSE_32_WIN-NEXT: movl %ebp, %esp
548 ; SSE_32_WIN-NEXT: popl %ebp
549 ; SSE_32_WIN-NEXT: retl
551 ; SSE_32_LIN-LABEL: x_to_u32:
552 ; SSE_32_LIN: # %bb.0:
553 ; SSE_32_LIN-NEXT: subl $20, %esp
554 ; SSE_32_LIN-NEXT: fldt {{[0-9]+}}(%esp)
555 ; SSE_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
556 ; SSE_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
557 ; SSE_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00
558 ; SSE_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
559 ; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
560 ; SSE_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
561 ; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
562 ; SSE_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
563 ; SSE_32_LIN-NEXT: addl $20, %esp
564 ; SSE_32_LIN-NEXT: retl
566 ; X87_WIN-LABEL: x_to_u32:
568 ; X87_WIN-NEXT: pushl %ebp
569 ; X87_WIN-NEXT: movl %esp, %ebp
570 ; X87_WIN-NEXT: andl $-8, %esp
571 ; X87_WIN-NEXT: subl $16, %esp
572 ; X87_WIN-NEXT: fldt 8(%ebp)
573 ; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
574 ; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
575 ; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00
576 ; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
577 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
578 ; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp)
579 ; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp)
580 ; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
581 ; X87_WIN-NEXT: movl %ebp, %esp
582 ; X87_WIN-NEXT: popl %ebp
585 ; X87_LIN-LABEL: x_to_u32:
587 ; X87_LIN-NEXT: subl $20, %esp
588 ; X87_LIN-NEXT: fldt {{[0-9]+}}(%esp)
589 ; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp)
590 ; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
591 ; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00
592 ; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
593 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
594 ; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp)
595 ; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp)
596 ; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
597 ; X87_LIN-NEXT: addl $20, %esp
599 %r = fptoui x86_fp80 %a to i32
603 define i32 @x_to_s32(x86_fp80 %a) nounwind {
604 ; AVX512_32-LABEL: x_to_s32:
605 ; AVX512_32: # %bb.0:
606 ; AVX512_32-NEXT: pushl %eax
607 ; AVX512_32-NEXT: fldt {{[0-9]+}}(%esp)
608 ; AVX512_32-NEXT: fisttpl (%esp)
609 ; AVX512_32-NEXT: movl (%esp), %eax
610 ; AVX512_32-NEXT: popl %ecx
611 ; AVX512_32-NEXT: retl
613 ; AVX512_64_WIN-LABEL: x_to_s32:
614 ; AVX512_64_WIN: # %bb.0:
615 ; AVX512_64_WIN-NEXT: pushq %rax
616 ; AVX512_64_WIN-NEXT: fldt (%rcx)
617 ; AVX512_64_WIN-NEXT: fisttpl {{[0-9]+}}(%rsp)
618 ; AVX512_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax
619 ; AVX512_64_WIN-NEXT: popq %rcx
620 ; AVX512_64_WIN-NEXT: retq
622 ; AVX512_64_LIN-LABEL: x_to_s32:
623 ; AVX512_64_LIN: # %bb.0:
624 ; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
625 ; AVX512_64_LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp)
626 ; AVX512_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
627 ; AVX512_64_LIN-NEXT: retq
629 ; SSE3_32-LABEL: x_to_s32:
631 ; SSE3_32-NEXT: pushl %eax
632 ; SSE3_32-NEXT: fldt {{[0-9]+}}(%esp)
633 ; SSE3_32-NEXT: fisttpl (%esp)
634 ; SSE3_32-NEXT: movl (%esp), %eax
635 ; SSE3_32-NEXT: popl %ecx
638 ; SSE3_64_WIN-LABEL: x_to_s32:
639 ; SSE3_64_WIN: # %bb.0:
640 ; SSE3_64_WIN-NEXT: pushq %rax
641 ; SSE3_64_WIN-NEXT: fldt (%rcx)
642 ; SSE3_64_WIN-NEXT: fisttpl {{[0-9]+}}(%rsp)
643 ; SSE3_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax
644 ; SSE3_64_WIN-NEXT: popq %rcx
645 ; SSE3_64_WIN-NEXT: retq
647 ; SSE3_64_LIN-LABEL: x_to_s32:
648 ; SSE3_64_LIN: # %bb.0:
649 ; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
650 ; SSE3_64_LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp)
651 ; SSE3_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
652 ; SSE3_64_LIN-NEXT: retq
654 ; SSE2_32-LABEL: x_to_s32:
656 ; SSE2_32-NEXT: subl $8, %esp
657 ; SSE2_32-NEXT: fldt {{[0-9]+}}(%esp)
658 ; SSE2_32-NEXT: fnstcw (%esp)
659 ; SSE2_32-NEXT: movzwl (%esp), %eax
660 ; SSE2_32-NEXT: orl $3072, %eax # imm = 0xC00
661 ; SSE2_32-NEXT: movw %ax, {{[0-9]+}}(%esp)
662 ; SSE2_32-NEXT: fldcw {{[0-9]+}}(%esp)
663 ; SSE2_32-NEXT: fistpl {{[0-9]+}}(%esp)
664 ; SSE2_32-NEXT: fldcw (%esp)
665 ; SSE2_32-NEXT: movl {{[0-9]+}}(%esp), %eax
666 ; SSE2_32-NEXT: addl $8, %esp
669 ; SSE2_64_WIN-LABEL: x_to_s32:
670 ; SSE2_64_WIN: # %bb.0:
671 ; SSE2_64_WIN-NEXT: pushq %rax
672 ; SSE2_64_WIN-NEXT: fldt (%rcx)
673 ; SSE2_64_WIN-NEXT: fnstcw (%rsp)
674 ; SSE2_64_WIN-NEXT: movzwl (%rsp), %eax
675 ; SSE2_64_WIN-NEXT: orl $3072, %eax # imm = 0xC00
676 ; SSE2_64_WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp)
677 ; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp)
678 ; SSE2_64_WIN-NEXT: fistpl {{[0-9]+}}(%rsp)
679 ; SSE2_64_WIN-NEXT: fldcw (%rsp)
680 ; SSE2_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax
681 ; SSE2_64_WIN-NEXT: popq %rcx
682 ; SSE2_64_WIN-NEXT: retq
684 ; SSE2_64_LIN-LABEL: x_to_s32:
685 ; SSE2_64_LIN: # %bb.0:
686 ; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp)
687 ; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp)
688 ; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax
689 ; SSE2_64_LIN-NEXT: orl $3072, %eax # imm = 0xC00
690 ; SSE2_64_LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
691 ; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp)
692 ; SSE2_64_LIN-NEXT: fistpl -{{[0-9]+}}(%rsp)
693 ; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp)
694 ; SSE2_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
695 ; SSE2_64_LIN-NEXT: retq
697 ; SSE_32-LABEL: x_to_s32:
699 ; SSE_32-NEXT: subl $8, %esp
700 ; SSE_32-NEXT: fldt {{[0-9]+}}(%esp)
701 ; SSE_32-NEXT: fnstcw (%esp)
702 ; SSE_32-NEXT: movzwl (%esp), %eax
703 ; SSE_32-NEXT: orl $3072, %eax # imm = 0xC00
704 ; SSE_32-NEXT: movw %ax, {{[0-9]+}}(%esp)
705 ; SSE_32-NEXT: fldcw {{[0-9]+}}(%esp)
706 ; SSE_32-NEXT: fistpl {{[0-9]+}}(%esp)
707 ; SSE_32-NEXT: fldcw (%esp)
708 ; SSE_32-NEXT: movl {{[0-9]+}}(%esp), %eax
709 ; SSE_32-NEXT: addl $8, %esp
712 ; X87-LABEL: x_to_s32:
714 ; X87-NEXT: subl $8, %esp
715 ; X87-NEXT: fldt {{[0-9]+}}(%esp)
716 ; X87-NEXT: fnstcw (%esp)
717 ; X87-NEXT: movzwl (%esp), %eax
718 ; X87-NEXT: orl $3072, %eax # imm = 0xC00
719 ; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
720 ; X87-NEXT: fldcw {{[0-9]+}}(%esp)
721 ; X87-NEXT: fistpl {{[0-9]+}}(%esp)
722 ; X87-NEXT: fldcw (%esp)
723 ; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
724 ; X87-NEXT: addl $8, %esp
726 %r = fptosi x86_fp80 %a to i32
730 define i32 @t_to_u32(fp128 %a) nounwind {
731 ; AVX512_32_WIN-LABEL: t_to_u32:
732 ; AVX512_32_WIN: # %bb.0:
733 ; AVX512_32_WIN-NEXT: subl $16, %esp
734 ; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0
735 ; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp)
736 ; AVX512_32_WIN-NEXT: calll ___fixunstfsi
737 ; AVX512_32_WIN-NEXT: addl $16, %esp
738 ; AVX512_32_WIN-NEXT: retl
740 ; AVX512_32_LIN-LABEL: t_to_u32:
741 ; AVX512_32_LIN: # %bb.0:
742 ; AVX512_32_LIN-NEXT: subl $28, %esp
743 ; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0
744 ; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp)
745 ; AVX512_32_LIN-NEXT: calll __fixunstfsi
746 ; AVX512_32_LIN-NEXT: addl $28, %esp
747 ; AVX512_32_LIN-NEXT: retl
749 ; AVX512_64_WIN-LABEL: t_to_u32:
750 ; AVX512_64_WIN: # %bb.0:
751 ; AVX512_64_WIN-NEXT: subq $40, %rsp
752 ; AVX512_64_WIN-NEXT: callq __fixunstfsi
753 ; AVX512_64_WIN-NEXT: addq $40, %rsp
754 ; AVX512_64_WIN-NEXT: retq
756 ; AVX512_64_LIN-LABEL: t_to_u32:
757 ; AVX512_64_LIN: # %bb.0:
758 ; AVX512_64_LIN-NEXT: pushq %rax
759 ; AVX512_64_LIN-NEXT: callq __fixunstfsi
760 ; AVX512_64_LIN-NEXT: popq %rcx
761 ; AVX512_64_LIN-NEXT: retq
763 ; SSE3_32_WIN-LABEL: t_to_u32:
764 ; SSE3_32_WIN: # %bb.0:
765 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
766 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
767 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
768 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
769 ; SSE3_32_WIN-NEXT: calll ___fixunstfsi
770 ; SSE3_32_WIN-NEXT: addl $16, %esp
771 ; SSE3_32_WIN-NEXT: retl
773 ; SSE3_32_LIN-LABEL: t_to_u32:
774 ; SSE3_32_LIN: # %bb.0:
775 ; SSE3_32_LIN-NEXT: subl $12, %esp
776 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
777 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
778 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
779 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
780 ; SSE3_32_LIN-NEXT: calll __fixunstfsi
781 ; SSE3_32_LIN-NEXT: addl $28, %esp
782 ; SSE3_32_LIN-NEXT: retl
784 ; SSE3_64_WIN-LABEL: t_to_u32:
785 ; SSE3_64_WIN: # %bb.0:
786 ; SSE3_64_WIN-NEXT: subq $40, %rsp
787 ; SSE3_64_WIN-NEXT: callq __fixunstfsi
788 ; SSE3_64_WIN-NEXT: addq $40, %rsp
789 ; SSE3_64_WIN-NEXT: retq
791 ; SSE3_64_LIN-LABEL: t_to_u32:
792 ; SSE3_64_LIN: # %bb.0:
793 ; SSE3_64_LIN-NEXT: pushq %rax
794 ; SSE3_64_LIN-NEXT: callq __fixunstfsi
795 ; SSE3_64_LIN-NEXT: popq %rcx
796 ; SSE3_64_LIN-NEXT: retq
798 ; SSE2_32_WIN-LABEL: t_to_u32:
799 ; SSE2_32_WIN: # %bb.0:
800 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
801 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
802 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
803 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
804 ; SSE2_32_WIN-NEXT: calll ___fixunstfsi
805 ; SSE2_32_WIN-NEXT: addl $16, %esp
806 ; SSE2_32_WIN-NEXT: retl
808 ; SSE2_32_LIN-LABEL: t_to_u32:
809 ; SSE2_32_LIN: # %bb.0:
810 ; SSE2_32_LIN-NEXT: subl $12, %esp
811 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
812 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
813 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
814 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
815 ; SSE2_32_LIN-NEXT: calll __fixunstfsi
816 ; SSE2_32_LIN-NEXT: addl $28, %esp
817 ; SSE2_32_LIN-NEXT: retl
819 ; SSE2_64_WIN-LABEL: t_to_u32:
820 ; SSE2_64_WIN: # %bb.0:
821 ; SSE2_64_WIN-NEXT: subq $40, %rsp
822 ; SSE2_64_WIN-NEXT: callq __fixunstfsi
823 ; SSE2_64_WIN-NEXT: addq $40, %rsp
824 ; SSE2_64_WIN-NEXT: retq
826 ; SSE2_64_LIN-LABEL: t_to_u32:
827 ; SSE2_64_LIN: # %bb.0:
828 ; SSE2_64_LIN-NEXT: pushq %rax
829 ; SSE2_64_LIN-NEXT: callq __fixunstfsi
830 ; SSE2_64_LIN-NEXT: popq %rcx
831 ; SSE2_64_LIN-NEXT: retq
833 ; SSE_32_WIN-LABEL: t_to_u32:
834 ; SSE_32_WIN: # %bb.0:
835 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
836 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
837 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
838 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
839 ; SSE_32_WIN-NEXT: calll ___fixunstfsi
840 ; SSE_32_WIN-NEXT: addl $16, %esp
841 ; SSE_32_WIN-NEXT: retl
843 ; SSE_32_LIN-LABEL: t_to_u32:
844 ; SSE_32_LIN: # %bb.0:
845 ; SSE_32_LIN-NEXT: subl $12, %esp
846 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
847 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
848 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
849 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
850 ; SSE_32_LIN-NEXT: calll __fixunstfsi
851 ; SSE_32_LIN-NEXT: addl $28, %esp
852 ; SSE_32_LIN-NEXT: retl
854 ; X87_WIN-LABEL: t_to_u32:
856 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
857 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
858 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
859 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
860 ; X87_WIN-NEXT: calll ___fixunstfsi
861 ; X87_WIN-NEXT: addl $16, %esp
864 ; X87_LIN-LABEL: t_to_u32:
866 ; X87_LIN-NEXT: subl $12, %esp
867 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
868 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
869 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
870 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
871 ; X87_LIN-NEXT: calll __fixunstfsi
872 ; X87_LIN-NEXT: addl $28, %esp
874 %r = fptoui fp128 %a to i32
878 define i32 @t_to_s32(fp128 %a) nounwind {
879 ; AVX512_32_WIN-LABEL: t_to_s32:
880 ; AVX512_32_WIN: # %bb.0:
881 ; AVX512_32_WIN-NEXT: subl $16, %esp
882 ; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0
883 ; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp)
884 ; AVX512_32_WIN-NEXT: calll ___fixtfsi
885 ; AVX512_32_WIN-NEXT: addl $16, %esp
886 ; AVX512_32_WIN-NEXT: retl
888 ; AVX512_32_LIN-LABEL: t_to_s32:
889 ; AVX512_32_LIN: # %bb.0:
890 ; AVX512_32_LIN-NEXT: subl $28, %esp
891 ; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0
892 ; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp)
893 ; AVX512_32_LIN-NEXT: calll __fixtfsi
894 ; AVX512_32_LIN-NEXT: addl $28, %esp
895 ; AVX512_32_LIN-NEXT: retl
897 ; AVX512_64_WIN-LABEL: t_to_s32:
898 ; AVX512_64_WIN: # %bb.0:
899 ; AVX512_64_WIN-NEXT: subq $40, %rsp
900 ; AVX512_64_WIN-NEXT: callq __fixtfsi
901 ; AVX512_64_WIN-NEXT: addq $40, %rsp
902 ; AVX512_64_WIN-NEXT: retq
904 ; AVX512_64_LIN-LABEL: t_to_s32:
905 ; AVX512_64_LIN: # %bb.0:
906 ; AVX512_64_LIN-NEXT: pushq %rax
907 ; AVX512_64_LIN-NEXT: callq __fixtfsi
908 ; AVX512_64_LIN-NEXT: popq %rcx
909 ; AVX512_64_LIN-NEXT: retq
911 ; SSE3_32_WIN-LABEL: t_to_s32:
912 ; SSE3_32_WIN: # %bb.0:
913 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
914 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
915 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
916 ; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
917 ; SSE3_32_WIN-NEXT: calll ___fixtfsi
918 ; SSE3_32_WIN-NEXT: addl $16, %esp
919 ; SSE3_32_WIN-NEXT: retl
921 ; SSE3_32_LIN-LABEL: t_to_s32:
922 ; SSE3_32_LIN: # %bb.0:
923 ; SSE3_32_LIN-NEXT: subl $12, %esp
924 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
925 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
926 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
927 ; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
928 ; SSE3_32_LIN-NEXT: calll __fixtfsi
929 ; SSE3_32_LIN-NEXT: addl $28, %esp
930 ; SSE3_32_LIN-NEXT: retl
932 ; SSE3_64_WIN-LABEL: t_to_s32:
933 ; SSE3_64_WIN: # %bb.0:
934 ; SSE3_64_WIN-NEXT: subq $40, %rsp
935 ; SSE3_64_WIN-NEXT: callq __fixtfsi
936 ; SSE3_64_WIN-NEXT: addq $40, %rsp
937 ; SSE3_64_WIN-NEXT: retq
939 ; SSE3_64_LIN-LABEL: t_to_s32:
940 ; SSE3_64_LIN: # %bb.0:
941 ; SSE3_64_LIN-NEXT: pushq %rax
942 ; SSE3_64_LIN-NEXT: callq __fixtfsi
943 ; SSE3_64_LIN-NEXT: popq %rcx
944 ; SSE3_64_LIN-NEXT: retq
946 ; SSE2_32_WIN-LABEL: t_to_s32:
947 ; SSE2_32_WIN: # %bb.0:
948 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
949 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
950 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
951 ; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
952 ; SSE2_32_WIN-NEXT: calll ___fixtfsi
953 ; SSE2_32_WIN-NEXT: addl $16, %esp
954 ; SSE2_32_WIN-NEXT: retl
956 ; SSE2_32_LIN-LABEL: t_to_s32:
957 ; SSE2_32_LIN: # %bb.0:
958 ; SSE2_32_LIN-NEXT: subl $12, %esp
959 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
960 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
961 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
962 ; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
963 ; SSE2_32_LIN-NEXT: calll __fixtfsi
964 ; SSE2_32_LIN-NEXT: addl $28, %esp
965 ; SSE2_32_LIN-NEXT: retl
967 ; SSE2_64_WIN-LABEL: t_to_s32:
968 ; SSE2_64_WIN: # %bb.0:
969 ; SSE2_64_WIN-NEXT: subq $40, %rsp
970 ; SSE2_64_WIN-NEXT: callq __fixtfsi
971 ; SSE2_64_WIN-NEXT: addq $40, %rsp
972 ; SSE2_64_WIN-NEXT: retq
974 ; SSE2_64_LIN-LABEL: t_to_s32:
975 ; SSE2_64_LIN: # %bb.0:
976 ; SSE2_64_LIN-NEXT: pushq %rax
977 ; SSE2_64_LIN-NEXT: callq __fixtfsi
978 ; SSE2_64_LIN-NEXT: popq %rcx
979 ; SSE2_64_LIN-NEXT: retq
981 ; SSE_32_WIN-LABEL: t_to_s32:
982 ; SSE_32_WIN: # %bb.0:
983 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
984 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
985 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
986 ; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp)
987 ; SSE_32_WIN-NEXT: calll ___fixtfsi
988 ; SSE_32_WIN-NEXT: addl $16, %esp
989 ; SSE_32_WIN-NEXT: retl
991 ; SSE_32_LIN-LABEL: t_to_s32:
992 ; SSE_32_LIN: # %bb.0:
993 ; SSE_32_LIN-NEXT: subl $12, %esp
994 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
995 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
996 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
997 ; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp)
998 ; SSE_32_LIN-NEXT: calll __fixtfsi
999 ; SSE_32_LIN-NEXT: addl $28, %esp
1000 ; SSE_32_LIN-NEXT: retl
1002 ; X87_WIN-LABEL: t_to_s32:
1004 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
1005 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
1006 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
1007 ; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp)
1008 ; X87_WIN-NEXT: calll ___fixtfsi
1009 ; X87_WIN-NEXT: addl $16, %esp
1010 ; X87_WIN-NEXT: retl
1012 ; X87_LIN-LABEL: t_to_s32:
1014 ; X87_LIN-NEXT: subl $12, %esp
1015 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
1016 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
1017 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
1018 ; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp)
1019 ; X87_LIN-NEXT: calll __fixtfsi
1020 ; X87_LIN-NEXT: addl $28, %esp
1021 ; X87_LIN-NEXT: retl
1022 %r = fptosi fp128 %a to i32