1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s --check-prefixes=CHECK,CHECK-CVT
3 ; RUN: llc < %s -mtriple=aarch64 -mattr=+fullfp16 | FileCheck %s --check-prefixes=CHECK,CHECK-FP16
6 ; Float to unsigned 32-bit -- Vector size variation
9 declare <1 x i32> @llvm.fptoui.sat.v1f32.v1i32 (<1 x float>)
10 declare <2 x i32> @llvm.fptoui.sat.v2f32.v2i32 (<2 x float>)
11 declare <3 x i32> @llvm.fptoui.sat.v3f32.v3i32 (<3 x float>)
12 declare <4 x i32> @llvm.fptoui.sat.v4f32.v4i32 (<4 x float>)
13 declare <5 x i32> @llvm.fptoui.sat.v5f32.v5i32 (<5 x float>)
14 declare <6 x i32> @llvm.fptoui.sat.v6f32.v6i32 (<6 x float>)
15 declare <7 x i32> @llvm.fptoui.sat.v7f32.v7i32 (<7 x float>)
16 declare <8 x i32> @llvm.fptoui.sat.v8f32.v8i32 (<8 x float>)
18 define <1 x i32> @test_unsigned_v1f32_v1i32(<1 x float> %f) {
19 ; CHECK-LABEL: test_unsigned_v1f32_v1i32:
21 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
23 %x = call <1 x i32> @llvm.fptoui.sat.v1f32.v1i32(<1 x float> %f)
27 define <2 x i32> @test_unsigned_v2f32_v2i32(<2 x float> %f) {
28 ; CHECK-LABEL: test_unsigned_v2f32_v2i32:
30 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
32 %x = call <2 x i32> @llvm.fptoui.sat.v2f32.v2i32(<2 x float> %f)
36 define <3 x i32> @test_unsigned_v3f32_v3i32(<3 x float> %f) {
37 ; CHECK-LABEL: test_unsigned_v3f32_v3i32:
39 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
41 %x = call <3 x i32> @llvm.fptoui.sat.v3f32.v3i32(<3 x float> %f)
45 define <4 x i32> @test_unsigned_v4f32_v4i32(<4 x float> %f) {
46 ; CHECK-LABEL: test_unsigned_v4f32_v4i32:
48 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
50 %x = call <4 x i32> @llvm.fptoui.sat.v4f32.v4i32(<4 x float> %f)
54 define <5 x i32> @test_unsigned_v5f32_v5i32(<5 x float> %f) {
55 ; CHECK-LABEL: test_unsigned_v5f32_v5i32:
57 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
58 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
59 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
60 ; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
61 ; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
62 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
63 ; CHECK-NEXT: fcvtzu v4.4s, v4.4s
64 ; CHECK-NEXT: mov v0.s[2], v2.s[0]
65 ; CHECK-NEXT: fmov w4, s4
66 ; CHECK-NEXT: mov v0.s[3], v3.s[0]
67 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
68 ; CHECK-NEXT: mov w1, v0.s[1]
69 ; CHECK-NEXT: mov w2, v0.s[2]
70 ; CHECK-NEXT: mov w3, v0.s[3]
71 ; CHECK-NEXT: fmov w0, s0
73 %x = call <5 x i32> @llvm.fptoui.sat.v5f32.v5i32(<5 x float> %f)
77 define <6 x i32> @test_unsigned_v6f32_v6i32(<6 x float> %f) {
78 ; CHECK-LABEL: test_unsigned_v6f32_v6i32:
80 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
81 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
82 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
83 ; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
84 ; CHECK-NEXT: // kill: def $s5 killed $s5 def $q5
85 ; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
86 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
87 ; CHECK-NEXT: mov v4.s[1], v5.s[0]
88 ; CHECK-NEXT: mov v0.s[2], v2.s[0]
89 ; CHECK-NEXT: fcvtzu v1.4s, v4.4s
90 ; CHECK-NEXT: mov v0.s[3], v3.s[0]
91 ; CHECK-NEXT: mov w5, v1.s[1]
92 ; CHECK-NEXT: fmov w4, s1
93 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
94 ; CHECK-NEXT: mov w1, v0.s[1]
95 ; CHECK-NEXT: mov w2, v0.s[2]
96 ; CHECK-NEXT: mov w3, v0.s[3]
97 ; CHECK-NEXT: fmov w0, s0
99 %x = call <6 x i32> @llvm.fptoui.sat.v6f32.v6i32(<6 x float> %f)
103 define <7 x i32> @test_unsigned_v7f32_v7i32(<7 x float> %f) {
104 ; CHECK-LABEL: test_unsigned_v7f32_v7i32:
106 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
107 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
108 ; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
109 ; CHECK-NEXT: // kill: def $s5 killed $s5 def $q5
110 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
111 ; CHECK-NEXT: // kill: def $s6 killed $s6 def $q6
112 ; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
113 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
114 ; CHECK-NEXT: mov v4.s[1], v5.s[0]
115 ; CHECK-NEXT: mov v0.s[2], v2.s[0]
116 ; CHECK-NEXT: mov v4.s[2], v6.s[0]
117 ; CHECK-NEXT: mov v0.s[3], v3.s[0]
118 ; CHECK-NEXT: fcvtzu v1.4s, v4.4s
119 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
120 ; CHECK-NEXT: mov w5, v1.s[1]
121 ; CHECK-NEXT: mov w6, v1.s[2]
122 ; CHECK-NEXT: fmov w4, s1
123 ; CHECK-NEXT: mov w1, v0.s[1]
124 ; CHECK-NEXT: mov w2, v0.s[2]
125 ; CHECK-NEXT: mov w3, v0.s[3]
126 ; CHECK-NEXT: fmov w0, s0
128 %x = call <7 x i32> @llvm.fptoui.sat.v7f32.v7i32(<7 x float> %f)
132 define <8 x i32> @test_unsigned_v8f32_v8i32(<8 x float> %f) {
133 ; CHECK-LABEL: test_unsigned_v8f32_v8i32:
135 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
136 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
138 %x = call <8 x i32> @llvm.fptoui.sat.v8f32.v8i32(<8 x float> %f)
143 ; Double to unsigned 32-bit -- Vector size variation
146 declare <1 x i32> @llvm.fptoui.sat.v1f64.v1i32 (<1 x double>)
147 declare <2 x i32> @llvm.fptoui.sat.v2f64.v2i32 (<2 x double>)
148 declare <3 x i32> @llvm.fptoui.sat.v3f64.v3i32 (<3 x double>)
149 declare <4 x i32> @llvm.fptoui.sat.v4f64.v4i32 (<4 x double>)
150 declare <5 x i32> @llvm.fptoui.sat.v5f64.v5i32 (<5 x double>)
151 declare <6 x i32> @llvm.fptoui.sat.v6f64.v6i32 (<6 x double>)
153 define <1 x i32> @test_unsigned_v1f64_v1i32(<1 x double> %f) {
154 ; CHECK-LABEL: test_unsigned_v1f64_v1i32:
156 ; CHECK-NEXT: fcvtzu w8, d0
157 ; CHECK-NEXT: fmov s0, w8
159 %x = call <1 x i32> @llvm.fptoui.sat.v1f64.v1i32(<1 x double> %f)
163 define <2 x i32> @test_unsigned_v2f64_v2i32(<2 x double> %f) {
164 ; CHECK-LABEL: test_unsigned_v2f64_v2i32:
166 ; CHECK-NEXT: mov d1, v0.d[1]
167 ; CHECK-NEXT: fcvtzu w8, d0
168 ; CHECK-NEXT: fcvtzu w9, d1
169 ; CHECK-NEXT: fmov s0, w8
170 ; CHECK-NEXT: mov v0.s[1], w9
171 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
173 %x = call <2 x i32> @llvm.fptoui.sat.v2f64.v2i32(<2 x double> %f)
177 define <3 x i32> @test_unsigned_v3f64_v3i32(<3 x double> %f) {
178 ; CHECK-LABEL: test_unsigned_v3f64_v3i32:
180 ; CHECK-NEXT: fcvtzu w8, d0
181 ; CHECK-NEXT: fcvtzu w9, d1
182 ; CHECK-NEXT: fmov s0, w8
183 ; CHECK-NEXT: fcvtzu w8, d2
184 ; CHECK-NEXT: mov v0.s[1], w9
185 ; CHECK-NEXT: mov v0.s[2], w8
186 ; CHECK-NEXT: fcvtzu w8, d0
187 ; CHECK-NEXT: mov v0.s[3], w8
189 %x = call <3 x i32> @llvm.fptoui.sat.v3f64.v3i32(<3 x double> %f)
193 define <4 x i32> @test_unsigned_v4f64_v4i32(<4 x double> %f) {
194 ; CHECK-LABEL: test_unsigned_v4f64_v4i32:
196 ; CHECK-NEXT: mov d2, v0.d[1]
197 ; CHECK-NEXT: fcvtzu w8, d0
198 ; CHECK-NEXT: fcvtzu w9, d2
199 ; CHECK-NEXT: fmov s0, w8
200 ; CHECK-NEXT: fcvtzu w8, d1
201 ; CHECK-NEXT: mov d1, v1.d[1]
202 ; CHECK-NEXT: mov v0.s[1], w9
203 ; CHECK-NEXT: mov v0.s[2], w8
204 ; CHECK-NEXT: fcvtzu w8, d1
205 ; CHECK-NEXT: mov v0.s[3], w8
207 %x = call <4 x i32> @llvm.fptoui.sat.v4f64.v4i32(<4 x double> %f)
211 define <5 x i32> @test_unsigned_v5f64_v5i32(<5 x double> %f) {
212 ; CHECK-LABEL: test_unsigned_v5f64_v5i32:
214 ; CHECK-NEXT: fcvtzu w0, d0
215 ; CHECK-NEXT: fcvtzu w1, d1
216 ; CHECK-NEXT: fcvtzu w2, d2
217 ; CHECK-NEXT: fcvtzu w3, d3
218 ; CHECK-NEXT: fcvtzu w4, d4
220 %x = call <5 x i32> @llvm.fptoui.sat.v5f64.v5i32(<5 x double> %f)
224 define <6 x i32> @test_unsigned_v6f64_v6i32(<6 x double> %f) {
225 ; CHECK-LABEL: test_unsigned_v6f64_v6i32:
227 ; CHECK-NEXT: fcvtzu w0, d0
228 ; CHECK-NEXT: fcvtzu w1, d1
229 ; CHECK-NEXT: fcvtzu w2, d2
230 ; CHECK-NEXT: fcvtzu w3, d3
231 ; CHECK-NEXT: fcvtzu w4, d4
232 ; CHECK-NEXT: fcvtzu w5, d5
234 %x = call <6 x i32> @llvm.fptoui.sat.v6f64.v6i32(<6 x double> %f)
239 ; FP128 to unsigned 32-bit -- Vector size variation
242 declare <1 x i32> @llvm.fptoui.sat.v1f128.v1i32 (<1 x fp128>)
243 declare <2 x i32> @llvm.fptoui.sat.v2f128.v2i32 (<2 x fp128>)
244 declare <3 x i32> @llvm.fptoui.sat.v3f128.v3i32 (<3 x fp128>)
245 declare <4 x i32> @llvm.fptoui.sat.v4f128.v4i32 (<4 x fp128>)
247 define <1 x i32> @test_unsigned_v1f128_v1i32(<1 x fp128> %f) {
248 ; CHECK-LABEL: test_unsigned_v1f128_v1i32:
250 ; CHECK-NEXT: sub sp, sp, #32
251 ; CHECK-NEXT: stp x30, x19, [sp, #16] // 16-byte Folded Spill
252 ; CHECK-NEXT: .cfi_def_cfa_offset 32
253 ; CHECK-NEXT: .cfi_offset w19, -8
254 ; CHECK-NEXT: .cfi_offset w30, -16
255 ; CHECK-NEXT: adrp x8, .LCPI14_0
256 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
257 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI14_0]
258 ; CHECK-NEXT: bl __getf2
259 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
260 ; CHECK-NEXT: mov w19, w0
261 ; CHECK-NEXT: bl __fixunstfsi
262 ; CHECK-NEXT: adrp x8, .LCPI14_1
263 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
264 ; CHECK-NEXT: cmp w19, #0
265 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI14_1]
266 ; CHECK-NEXT: csel w19, wzr, w0, lt
267 ; CHECK-NEXT: bl __gttf2
268 ; CHECK-NEXT: cmp w0, #0
269 ; CHECK-NEXT: csinv w8, w19, wzr, le
270 ; CHECK-NEXT: ldp x30, x19, [sp, #16] // 16-byte Folded Reload
271 ; CHECK-NEXT: fmov s0, w8
272 ; CHECK-NEXT: add sp, sp, #32
274 %x = call <1 x i32> @llvm.fptoui.sat.v1f128.v1i32(<1 x fp128> %f)
278 define <2 x i32> @test_unsigned_v2f128_v2i32(<2 x fp128> %f) {
279 ; CHECK-LABEL: test_unsigned_v2f128_v2i32:
281 ; CHECK-NEXT: sub sp, sp, #96
282 ; CHECK-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
283 ; CHECK-NEXT: stp x20, x19, [sp, #80] // 16-byte Folded Spill
284 ; CHECK-NEXT: .cfi_def_cfa_offset 96
285 ; CHECK-NEXT: .cfi_offset w19, -8
286 ; CHECK-NEXT: .cfi_offset w20, -16
287 ; CHECK-NEXT: .cfi_offset w30, -32
288 ; CHECK-NEXT: mov v2.16b, v1.16b
289 ; CHECK-NEXT: stp q1, q0, [sp, #32] // 32-byte Folded Spill
290 ; CHECK-NEXT: adrp x8, .LCPI15_0
291 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_0]
292 ; CHECK-NEXT: mov v0.16b, v2.16b
293 ; CHECK-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
294 ; CHECK-NEXT: bl __getf2
295 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
296 ; CHECK-NEXT: mov w19, w0
297 ; CHECK-NEXT: bl __fixunstfsi
298 ; CHECK-NEXT: adrp x8, .LCPI15_1
299 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
300 ; CHECK-NEXT: cmp w19, #0
301 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_1]
302 ; CHECK-NEXT: csel w19, wzr, w0, lt
303 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
304 ; CHECK-NEXT: bl __gttf2
305 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
306 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
307 ; CHECK-NEXT: cmp w0, #0
308 ; CHECK-NEXT: csinv w20, w19, wzr, le
309 ; CHECK-NEXT: bl __getf2
310 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
311 ; CHECK-NEXT: mov w19, w0
312 ; CHECK-NEXT: bl __fixunstfsi
313 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
314 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
315 ; CHECK-NEXT: cmp w19, #0
316 ; CHECK-NEXT: csel w19, wzr, w0, lt
317 ; CHECK-NEXT: bl __gttf2
318 ; CHECK-NEXT: cmp w0, #0
319 ; CHECK-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
320 ; CHECK-NEXT: csinv w8, w19, wzr, le
321 ; CHECK-NEXT: fmov s0, w8
322 ; CHECK-NEXT: mov v0.s[1], w20
323 ; CHECK-NEXT: ldp x20, x19, [sp, #80] // 16-byte Folded Reload
324 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
325 ; CHECK-NEXT: add sp, sp, #96
327 %x = call <2 x i32> @llvm.fptoui.sat.v2f128.v2i32(<2 x fp128> %f)
331 define <3 x i32> @test_unsigned_v3f128_v3i32(<3 x fp128> %f) {
332 ; CHECK-LABEL: test_unsigned_v3f128_v3i32:
334 ; CHECK-NEXT: sub sp, sp, #112
335 ; CHECK-NEXT: str x30, [sp, #80] // 8-byte Folded Spill
336 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
337 ; CHECK-NEXT: .cfi_def_cfa_offset 112
338 ; CHECK-NEXT: .cfi_offset w19, -8
339 ; CHECK-NEXT: .cfi_offset w20, -16
340 ; CHECK-NEXT: .cfi_offset w30, -32
341 ; CHECK-NEXT: stp q0, q2, [sp, #48] // 32-byte Folded Spill
342 ; CHECK-NEXT: mov v2.16b, v1.16b
343 ; CHECK-NEXT: adrp x8, .LCPI16_0
344 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
345 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_0]
346 ; CHECK-NEXT: mov v0.16b, v2.16b
347 ; CHECK-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
348 ; CHECK-NEXT: bl __getf2
349 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
350 ; CHECK-NEXT: mov w19, w0
351 ; CHECK-NEXT: bl __fixunstfsi
352 ; CHECK-NEXT: adrp x8, .LCPI16_1
353 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
354 ; CHECK-NEXT: cmp w19, #0
355 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_1]
356 ; CHECK-NEXT: csel w19, wzr, w0, lt
357 ; CHECK-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
358 ; CHECK-NEXT: bl __gttf2
359 ; CHECK-NEXT: ldp q1, q0, [sp, #32] // 32-byte Folded Reload
360 ; CHECK-NEXT: cmp w0, #0
361 ; CHECK-NEXT: csinv w20, w19, wzr, le
362 ; CHECK-NEXT: bl __getf2
363 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
364 ; CHECK-NEXT: mov w19, w0
365 ; CHECK-NEXT: bl __fixunstfsi
366 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
367 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
368 ; CHECK-NEXT: cmp w19, #0
369 ; CHECK-NEXT: csel w19, wzr, w0, lt
370 ; CHECK-NEXT: bl __gttf2
371 ; CHECK-NEXT: cmp w0, #0
372 ; CHECK-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
373 ; CHECK-NEXT: csinv w8, w19, wzr, le
374 ; CHECK-NEXT: fmov s0, w8
375 ; CHECK-NEXT: mov v0.s[1], w20
376 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
377 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
378 ; CHECK-NEXT: bl __getf2
379 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
380 ; CHECK-NEXT: mov w19, w0
381 ; CHECK-NEXT: bl __fixunstfsi
382 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
383 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
384 ; CHECK-NEXT: cmp w19, #0
385 ; CHECK-NEXT: csel w19, wzr, w0, lt
386 ; CHECK-NEXT: bl __gttf2
387 ; CHECK-NEXT: cmp w0, #0
388 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
389 ; CHECK-NEXT: ldr x30, [sp, #80] // 8-byte Folded Reload
390 ; CHECK-NEXT: csinv w8, w19, wzr, le
391 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
392 ; CHECK-NEXT: mov v0.s[2], w8
393 ; CHECK-NEXT: add sp, sp, #112
395 %x = call <3 x i32> @llvm.fptoui.sat.v3f128.v3i32(<3 x fp128> %f)
399 define <4 x i32> @test_unsigned_v4f128_v4i32(<4 x fp128> %f) {
400 ; CHECK-LABEL: test_unsigned_v4f128_v4i32:
402 ; CHECK-NEXT: sub sp, sp, #128
403 ; CHECK-NEXT: str x30, [sp, #96] // 8-byte Folded Spill
404 ; CHECK-NEXT: stp x20, x19, [sp, #112] // 16-byte Folded Spill
405 ; CHECK-NEXT: .cfi_def_cfa_offset 128
406 ; CHECK-NEXT: .cfi_offset w19, -8
407 ; CHECK-NEXT: .cfi_offset w20, -16
408 ; CHECK-NEXT: .cfi_offset w30, -32
409 ; CHECK-NEXT: stp q0, q2, [sp, #16] // 32-byte Folded Spill
410 ; CHECK-NEXT: mov v2.16b, v1.16b
411 ; CHECK-NEXT: adrp x8, .LCPI17_0
412 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
413 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_0]
414 ; CHECK-NEXT: str q3, [sp, #80] // 16-byte Folded Spill
415 ; CHECK-NEXT: mov v0.16b, v2.16b
416 ; CHECK-NEXT: str q1, [sp, #64] // 16-byte Folded Spill
417 ; CHECK-NEXT: bl __getf2
418 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
419 ; CHECK-NEXT: mov w19, w0
420 ; CHECK-NEXT: bl __fixunstfsi
421 ; CHECK-NEXT: adrp x8, .LCPI17_1
422 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
423 ; CHECK-NEXT: cmp w19, #0
424 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_1]
425 ; CHECK-NEXT: csel w19, wzr, w0, lt
426 ; CHECK-NEXT: str q1, [sp, #48] // 16-byte Folded Spill
427 ; CHECK-NEXT: bl __gttf2
428 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
429 ; CHECK-NEXT: ldr q1, [sp, #64] // 16-byte Folded Reload
430 ; CHECK-NEXT: cmp w0, #0
431 ; CHECK-NEXT: csinv w20, w19, wzr, le
432 ; CHECK-NEXT: bl __getf2
433 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
434 ; CHECK-NEXT: mov w19, w0
435 ; CHECK-NEXT: bl __fixunstfsi
436 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
437 ; CHECK-NEXT: ldr q1, [sp, #48] // 16-byte Folded Reload
438 ; CHECK-NEXT: cmp w19, #0
439 ; CHECK-NEXT: csel w19, wzr, w0, lt
440 ; CHECK-NEXT: bl __gttf2
441 ; CHECK-NEXT: cmp w0, #0
442 ; CHECK-NEXT: ldr q1, [sp, #64] // 16-byte Folded Reload
443 ; CHECK-NEXT: csinv w8, w19, wzr, le
444 ; CHECK-NEXT: fmov s0, w8
445 ; CHECK-NEXT: mov v0.s[1], w20
446 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
447 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
448 ; CHECK-NEXT: bl __getf2
449 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
450 ; CHECK-NEXT: mov w19, w0
451 ; CHECK-NEXT: bl __fixunstfsi
452 ; CHECK-NEXT: ldp q0, q1, [sp, #32] // 32-byte Folded Reload
453 ; CHECK-NEXT: cmp w19, #0
454 ; CHECK-NEXT: csel w19, wzr, w0, lt
455 ; CHECK-NEXT: bl __gttf2
456 ; CHECK-NEXT: cmp w0, #0
457 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
458 ; CHECK-NEXT: csinv w8, w19, wzr, le
459 ; CHECK-NEXT: mov v0.s[2], w8
460 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
461 ; CHECK-NEXT: ldp q1, q0, [sp, #64] // 32-byte Folded Reload
462 ; CHECK-NEXT: bl __getf2
463 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
464 ; CHECK-NEXT: mov w19, w0
465 ; CHECK-NEXT: bl __fixunstfsi
466 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
467 ; CHECK-NEXT: ldr q1, [sp, #48] // 16-byte Folded Reload
468 ; CHECK-NEXT: cmp w19, #0
469 ; CHECK-NEXT: csel w19, wzr, w0, lt
470 ; CHECK-NEXT: bl __gttf2
471 ; CHECK-NEXT: cmp w0, #0
472 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
473 ; CHECK-NEXT: ldr x30, [sp, #96] // 8-byte Folded Reload
474 ; CHECK-NEXT: csinv w8, w19, wzr, le
475 ; CHECK-NEXT: ldp x20, x19, [sp, #112] // 16-byte Folded Reload
476 ; CHECK-NEXT: mov v0.s[3], w8
477 ; CHECK-NEXT: add sp, sp, #128
479 %x = call <4 x i32> @llvm.fptoui.sat.v4f128.v4i32(<4 x fp128> %f)
484 ; FP16 to unsigned 32-bit -- Vector size variation
487 declare <1 x i32> @llvm.fptoui.sat.v1f16.v1i32 (<1 x half>)
488 declare <2 x i32> @llvm.fptoui.sat.v2f16.v2i32 (<2 x half>)
489 declare <3 x i32> @llvm.fptoui.sat.v3f16.v3i32 (<3 x half>)
490 declare <4 x i32> @llvm.fptoui.sat.v4f16.v4i32 (<4 x half>)
491 declare <5 x i32> @llvm.fptoui.sat.v5f16.v5i32 (<5 x half>)
492 declare <6 x i32> @llvm.fptoui.sat.v6f16.v6i32 (<6 x half>)
493 declare <7 x i32> @llvm.fptoui.sat.v7f16.v7i32 (<7 x half>)
494 declare <8 x i32> @llvm.fptoui.sat.v8f16.v8i32 (<8 x half>)
496 define <1 x i32> @test_unsigned_v1f16_v1i32(<1 x half> %f) {
497 ; CHECK-CVT-LABEL: test_unsigned_v1f16_v1i32:
498 ; CHECK-CVT: // %bb.0:
499 ; CHECK-CVT-NEXT: fcvt s0, h0
500 ; CHECK-CVT-NEXT: fcvtzu w8, s0
501 ; CHECK-CVT-NEXT: fmov s0, w8
502 ; CHECK-CVT-NEXT: ret
504 ; CHECK-FP16-LABEL: test_unsigned_v1f16_v1i32:
505 ; CHECK-FP16: // %bb.0:
506 ; CHECK-FP16-NEXT: fcvtzu w8, h0
507 ; CHECK-FP16-NEXT: fmov s0, w8
508 ; CHECK-FP16-NEXT: ret
509 %x = call <1 x i32> @llvm.fptoui.sat.v1f16.v1i32(<1 x half> %f)
513 define <2 x i32> @test_unsigned_v2f16_v2i32(<2 x half> %f) {
514 ; CHECK-LABEL: test_unsigned_v2f16_v2i32:
516 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
517 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
518 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
520 %x = call <2 x i32> @llvm.fptoui.sat.v2f16.v2i32(<2 x half> %f)
524 define <3 x i32> @test_unsigned_v3f16_v3i32(<3 x half> %f) {
525 ; CHECK-LABEL: test_unsigned_v3f16_v3i32:
527 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
528 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
530 %x = call <3 x i32> @llvm.fptoui.sat.v3f16.v3i32(<3 x half> %f)
534 define <4 x i32> @test_unsigned_v4f16_v4i32(<4 x half> %f) {
535 ; CHECK-LABEL: test_unsigned_v4f16_v4i32:
537 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
538 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
540 %x = call <4 x i32> @llvm.fptoui.sat.v4f16.v4i32(<4 x half> %f)
544 define <5 x i32> @test_unsigned_v5f16_v5i32(<5 x half> %f) {
545 ; CHECK-LABEL: test_unsigned_v5f16_v5i32:
547 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
548 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
549 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
550 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
551 ; CHECK-NEXT: mov w1, v1.s[1]
552 ; CHECK-NEXT: mov w2, v1.s[2]
553 ; CHECK-NEXT: mov w3, v1.s[3]
554 ; CHECK-NEXT: fmov w0, s1
555 ; CHECK-NEXT: fmov w4, s0
557 %x = call <5 x i32> @llvm.fptoui.sat.v5f16.v5i32(<5 x half> %f)
561 define <6 x i32> @test_unsigned_v6f16_v6i32(<6 x half> %f) {
562 ; CHECK-LABEL: test_unsigned_v6f16_v6i32:
564 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
565 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
566 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
567 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
568 ; CHECK-NEXT: mov w1, v1.s[1]
569 ; CHECK-NEXT: mov w2, v1.s[2]
570 ; CHECK-NEXT: mov w5, v0.s[1]
571 ; CHECK-NEXT: mov w3, v1.s[3]
572 ; CHECK-NEXT: fmov w4, s0
573 ; CHECK-NEXT: fmov w0, s1
575 %x = call <6 x i32> @llvm.fptoui.sat.v6f16.v6i32(<6 x half> %f)
579 define <7 x i32> @test_unsigned_v7f16_v7i32(<7 x half> %f) {
580 ; CHECK-LABEL: test_unsigned_v7f16_v7i32:
582 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
583 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
584 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
585 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
586 ; CHECK-NEXT: mov w1, v1.s[1]
587 ; CHECK-NEXT: mov w2, v1.s[2]
588 ; CHECK-NEXT: mov w3, v1.s[3]
589 ; CHECK-NEXT: mov w5, v0.s[1]
590 ; CHECK-NEXT: mov w6, v0.s[2]
591 ; CHECK-NEXT: fmov w0, s1
592 ; CHECK-NEXT: fmov w4, s0
594 %x = call <7 x i32> @llvm.fptoui.sat.v7f16.v7i32(<7 x half> %f)
598 define <8 x i32> @test_unsigned_v8f16_v8i32(<8 x half> %f) {
599 ; CHECK-LABEL: test_unsigned_v8f16_v8i32:
601 ; CHECK-NEXT: fcvtl2 v1.4s, v0.8h
602 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
603 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
604 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
606 %x = call <8 x i32> @llvm.fptoui.sat.v8f16.v8i32(<8 x half> %f)
611 ; 2-Vector float to unsigned integer -- result size variation
614 declare <2 x i1> @llvm.fptoui.sat.v2f32.v2i1 (<2 x float>)
615 declare <2 x i8> @llvm.fptoui.sat.v2f32.v2i8 (<2 x float>)
616 declare <2 x i13> @llvm.fptoui.sat.v2f32.v2i13 (<2 x float>)
617 declare <2 x i16> @llvm.fptoui.sat.v2f32.v2i16 (<2 x float>)
618 declare <2 x i19> @llvm.fptoui.sat.v2f32.v2i19 (<2 x float>)
619 declare <2 x i50> @llvm.fptoui.sat.v2f32.v2i50 (<2 x float>)
620 declare <2 x i64> @llvm.fptoui.sat.v2f32.v2i64 (<2 x float>)
621 declare <2 x i100> @llvm.fptoui.sat.v2f32.v2i100(<2 x float>)
622 declare <2 x i128> @llvm.fptoui.sat.v2f32.v2i128(<2 x float>)
624 define <2 x i1> @test_unsigned_v2f32_v2i1(<2 x float> %f) {
625 ; CHECK-LABEL: test_unsigned_v2f32_v2i1:
627 ; CHECK-NEXT: movi v1.2s, #1
628 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
629 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
631 %x = call <2 x i1> @llvm.fptoui.sat.v2f32.v2i1(<2 x float> %f)
635 define <2 x i8> @test_unsigned_v2f32_v2i8(<2 x float> %f) {
636 ; CHECK-LABEL: test_unsigned_v2f32_v2i8:
638 ; CHECK-NEXT: movi d1, #0x0000ff000000ff
639 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
640 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
642 %x = call <2 x i8> @llvm.fptoui.sat.v2f32.v2i8(<2 x float> %f)
646 define <2 x i13> @test_unsigned_v2f32_v2i13(<2 x float> %f) {
647 ; CHECK-LABEL: test_unsigned_v2f32_v2i13:
649 ; CHECK-NEXT: movi v1.2s, #31, msl #8
650 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
651 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
653 %x = call <2 x i13> @llvm.fptoui.sat.v2f32.v2i13(<2 x float> %f)
657 define <2 x i16> @test_unsigned_v2f32_v2i16(<2 x float> %f) {
658 ; CHECK-LABEL: test_unsigned_v2f32_v2i16:
660 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
661 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
662 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
664 %x = call <2 x i16> @llvm.fptoui.sat.v2f32.v2i16(<2 x float> %f)
668 define <2 x i19> @test_unsigned_v2f32_v2i19(<2 x float> %f) {
669 ; CHECK-LABEL: test_unsigned_v2f32_v2i19:
671 ; CHECK-NEXT: movi v1.2s, #7, msl #16
672 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
673 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
675 %x = call <2 x i19> @llvm.fptoui.sat.v2f32.v2i19(<2 x float> %f)
679 define <2 x i32> @test_unsigned_v2f32_v2i32_duplicate(<2 x float> %f) {
680 ; CHECK-LABEL: test_unsigned_v2f32_v2i32_duplicate:
682 ; CHECK-NEXT: fcvtzu v0.2s, v0.2s
684 %x = call <2 x i32> @llvm.fptoui.sat.v2f32.v2i32(<2 x float> %f)
688 define <2 x i50> @test_unsigned_v2f32_v2i50(<2 x float> %f) {
689 ; CHECK-LABEL: test_unsigned_v2f32_v2i50:
691 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
692 ; CHECK-NEXT: mov s1, v0.s[1]
693 ; CHECK-NEXT: fcvtzu x9, s0
694 ; CHECK-NEXT: mov x10, #1125899906842623 // =0x3ffffffffffff
695 ; CHECK-NEXT: fcvtzu x8, s1
696 ; CHECK-NEXT: cmp x8, x10
697 ; CHECK-NEXT: csel x8, x8, x10, lo
698 ; CHECK-NEXT: cmp x9, x10
699 ; CHECK-NEXT: csel x9, x9, x10, lo
700 ; CHECK-NEXT: fmov d0, x9
701 ; CHECK-NEXT: mov v0.d[1], x8
703 %x = call <2 x i50> @llvm.fptoui.sat.v2f32.v2i50(<2 x float> %f)
707 define <2 x i64> @test_unsigned_v2f32_v2i64(<2 x float> %f) {
708 ; CHECK-LABEL: test_unsigned_v2f32_v2i64:
710 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
711 ; CHECK-NEXT: mov s1, v0.s[1]
712 ; CHECK-NEXT: fcvtzu x8, s0
713 ; CHECK-NEXT: fcvtzu x9, s1
714 ; CHECK-NEXT: fmov d0, x8
715 ; CHECK-NEXT: mov v0.d[1], x9
717 %x = call <2 x i64> @llvm.fptoui.sat.v2f32.v2i64(<2 x float> %f)
721 define <2 x i100> @test_unsigned_v2f32_v2i100(<2 x float> %f) {
722 ; CHECK-LABEL: test_unsigned_v2f32_v2i100:
724 ; CHECK-NEXT: sub sp, sp, #64
725 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
726 ; CHECK-NEXT: stp x30, x21, [sp, #32] // 16-byte Folded Spill
727 ; CHECK-NEXT: stp x20, x19, [sp, #48] // 16-byte Folded Spill
728 ; CHECK-NEXT: .cfi_def_cfa_offset 64
729 ; CHECK-NEXT: .cfi_offset w19, -8
730 ; CHECK-NEXT: .cfi_offset w20, -16
731 ; CHECK-NEXT: .cfi_offset w21, -24
732 ; CHECK-NEXT: .cfi_offset w30, -32
733 ; CHECK-NEXT: .cfi_offset b8, -40
734 ; CHECK-NEXT: .cfi_offset b9, -48
735 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
736 ; CHECK-NEXT: mov s8, v0.s[1]
737 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
738 ; CHECK-NEXT: fmov s0, s8
739 ; CHECK-NEXT: bl __fixunssfti
740 ; CHECK-NEXT: mov w8, #1904214015 // =0x717fffff
741 ; CHECK-NEXT: fcmp s8, #0.0
742 ; CHECK-NEXT: mov x21, #68719476735 // =0xfffffffff
743 ; CHECK-NEXT: fmov s9, w8
744 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
745 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
746 ; CHECK-NEXT: csel x8, xzr, x0, lt
747 ; CHECK-NEXT: csel x9, xzr, x1, lt
748 ; CHECK-NEXT: fcmp s8, s9
749 ; CHECK-NEXT: csel x19, x21, x9, gt
750 ; CHECK-NEXT: csinv x20, x8, xzr, le
751 ; CHECK-NEXT: bl __fixunssfti
752 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
753 ; CHECK-NEXT: mov x2, x20
754 ; CHECK-NEXT: mov x3, x19
755 ; CHECK-NEXT: ldp x20, x19, [sp, #48] // 16-byte Folded Reload
756 ; CHECK-NEXT: fcmp s0, #0.0
757 ; CHECK-NEXT: csel x8, xzr, x0, lt
758 ; CHECK-NEXT: csel x9, xzr, x1, lt
759 ; CHECK-NEXT: fcmp s0, s9
760 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
761 ; CHECK-NEXT: csinv x8, x8, xzr, le
762 ; CHECK-NEXT: csel x1, x21, x9, gt
763 ; CHECK-NEXT: fmov d0, x8
764 ; CHECK-NEXT: ldp x30, x21, [sp, #32] // 16-byte Folded Reload
765 ; CHECK-NEXT: mov v0.d[1], x1
766 ; CHECK-NEXT: fmov x0, d0
767 ; CHECK-NEXT: add sp, sp, #64
769 %x = call <2 x i100> @llvm.fptoui.sat.v2f32.v2i100(<2 x float> %f)
773 define <2 x i128> @test_unsigned_v2f32_v2i128(<2 x float> %f) {
774 ; CHECK-LABEL: test_unsigned_v2f32_v2i128:
776 ; CHECK-NEXT: sub sp, sp, #64
777 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
778 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
779 ; CHECK-NEXT: stp x20, x19, [sp, #48] // 16-byte Folded Spill
780 ; CHECK-NEXT: .cfi_def_cfa_offset 64
781 ; CHECK-NEXT: .cfi_offset w19, -8
782 ; CHECK-NEXT: .cfi_offset w20, -16
783 ; CHECK-NEXT: .cfi_offset w30, -32
784 ; CHECK-NEXT: .cfi_offset b8, -40
785 ; CHECK-NEXT: .cfi_offset b9, -48
786 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
787 ; CHECK-NEXT: mov s8, v0.s[1]
788 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
789 ; CHECK-NEXT: fmov s0, s8
790 ; CHECK-NEXT: bl __fixunssfti
791 ; CHECK-NEXT: mov w8, #2139095039 // =0x7f7fffff
792 ; CHECK-NEXT: fcmp s8, #0.0
793 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
794 ; CHECK-NEXT: fmov s9, w8
795 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
796 ; CHECK-NEXT: csel x8, xzr, x1, lt
797 ; CHECK-NEXT: csel x9, xzr, x0, lt
798 ; CHECK-NEXT: fcmp s8, s9
799 ; CHECK-NEXT: csinv x19, x9, xzr, le
800 ; CHECK-NEXT: csinv x20, x8, xzr, le
801 ; CHECK-NEXT: bl __fixunssfti
802 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
803 ; CHECK-NEXT: mov x2, x19
804 ; CHECK-NEXT: mov x3, x20
805 ; CHECK-NEXT: ldp x20, x19, [sp, #48] // 16-byte Folded Reload
806 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
807 ; CHECK-NEXT: fcmp s0, #0.0
808 ; CHECK-NEXT: csel x8, xzr, x0, lt
809 ; CHECK-NEXT: csel x9, xzr, x1, lt
810 ; CHECK-NEXT: fcmp s0, s9
811 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
812 ; CHECK-NEXT: csinv x8, x8, xzr, le
813 ; CHECK-NEXT: csinv x1, x9, xzr, le
814 ; CHECK-NEXT: fmov d0, x8
815 ; CHECK-NEXT: mov v0.d[1], x1
816 ; CHECK-NEXT: fmov x0, d0
817 ; CHECK-NEXT: add sp, sp, #64
819 %x = call <2 x i128> @llvm.fptoui.sat.v2f32.v2i128(<2 x float> %f)
824 ; 4-Vector float to unsigned integer -- result size variation
827 declare <4 x i1> @llvm.fptoui.sat.v4f32.v4i1 (<4 x float>)
828 declare <4 x i8> @llvm.fptoui.sat.v4f32.v4i8 (<4 x float>)
829 declare <4 x i13> @llvm.fptoui.sat.v4f32.v4i13 (<4 x float>)
830 declare <4 x i16> @llvm.fptoui.sat.v4f32.v4i16 (<4 x float>)
831 declare <4 x i19> @llvm.fptoui.sat.v4f32.v4i19 (<4 x float>)
832 declare <4 x i50> @llvm.fptoui.sat.v4f32.v4i50 (<4 x float>)
833 declare <4 x i64> @llvm.fptoui.sat.v4f32.v4i64 (<4 x float>)
834 declare <4 x i100> @llvm.fptoui.sat.v4f32.v4i100(<4 x float>)
835 declare <4 x i128> @llvm.fptoui.sat.v4f32.v4i128(<4 x float>)
837 define <4 x i1> @test_unsigned_v4f32_v4i1(<4 x float> %f) {
838 ; CHECK-LABEL: test_unsigned_v4f32_v4i1:
840 ; CHECK-NEXT: movi v1.4s, #1
841 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
842 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
843 ; CHECK-NEXT: xtn v0.4h, v0.4s
845 %x = call <4 x i1> @llvm.fptoui.sat.v4f32.v4i1(<4 x float> %f)
849 define <4 x i8> @test_unsigned_v4f32_v4i8(<4 x float> %f) {
850 ; CHECK-LABEL: test_unsigned_v4f32_v4i8:
852 ; CHECK-NEXT: movi v1.2d, #0x0000ff000000ff
853 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
854 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
855 ; CHECK-NEXT: xtn v0.4h, v0.4s
857 %x = call <4 x i8> @llvm.fptoui.sat.v4f32.v4i8(<4 x float> %f)
861 define <4 x i13> @test_unsigned_v4f32_v4i13(<4 x float> %f) {
862 ; CHECK-LABEL: test_unsigned_v4f32_v4i13:
864 ; CHECK-NEXT: movi v1.4s, #31, msl #8
865 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
866 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
867 ; CHECK-NEXT: xtn v0.4h, v0.4s
869 %x = call <4 x i13> @llvm.fptoui.sat.v4f32.v4i13(<4 x float> %f)
873 define <4 x i16> @test_unsigned_v4f32_v4i16(<4 x float> %f) {
874 ; CHECK-LABEL: test_unsigned_v4f32_v4i16:
876 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
877 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
879 %x = call <4 x i16> @llvm.fptoui.sat.v4f32.v4i16(<4 x float> %f)
883 define <4 x i19> @test_unsigned_v4f32_v4i19(<4 x float> %f) {
884 ; CHECK-LABEL: test_unsigned_v4f32_v4i19:
886 ; CHECK-NEXT: movi v1.4s, #7, msl #16
887 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
888 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
890 %x = call <4 x i19> @llvm.fptoui.sat.v4f32.v4i19(<4 x float> %f)
894 define <4 x i32> @test_unsigned_v4f32_v4i32_duplicate(<4 x float> %f) {
895 ; CHECK-LABEL: test_unsigned_v4f32_v4i32_duplicate:
897 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
899 %x = call <4 x i32> @llvm.fptoui.sat.v4f32.v4i32(<4 x float> %f)
903 define <4 x i50> @test_unsigned_v4f32_v4i50(<4 x float> %f) {
904 ; CHECK-LABEL: test_unsigned_v4f32_v4i50:
906 ; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
907 ; CHECK-NEXT: mov s3, v0.s[1]
908 ; CHECK-NEXT: mov x8, #1125899906842623 // =0x3ffffffffffff
909 ; CHECK-NEXT: fcvtzu x11, s0
910 ; CHECK-NEXT: mov s2, v1.s[1]
911 ; CHECK-NEXT: fcvtzu x9, s1
912 ; CHECK-NEXT: fcvtzu x12, s3
913 ; CHECK-NEXT: fcvtzu x10, s2
914 ; CHECK-NEXT: cmp x9, x8
915 ; CHECK-NEXT: csel x2, x9, x8, lo
916 ; CHECK-NEXT: cmp x10, x8
917 ; CHECK-NEXT: csel x3, x10, x8, lo
918 ; CHECK-NEXT: cmp x11, x8
919 ; CHECK-NEXT: csel x0, x11, x8, lo
920 ; CHECK-NEXT: cmp x12, x8
921 ; CHECK-NEXT: csel x1, x12, x8, lo
923 %x = call <4 x i50> @llvm.fptoui.sat.v4f32.v4i50(<4 x float> %f)
927 define <4 x i64> @test_unsigned_v4f32_v4i64(<4 x float> %f) {
928 ; CHECK-LABEL: test_unsigned_v4f32_v4i64:
930 ; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
931 ; CHECK-NEXT: mov s3, v0.s[1]
932 ; CHECK-NEXT: fcvtzu x9, s0
933 ; CHECK-NEXT: mov s2, v1.s[1]
934 ; CHECK-NEXT: fcvtzu x8, s1
935 ; CHECK-NEXT: fcvtzu x11, s3
936 ; CHECK-NEXT: fmov d0, x9
937 ; CHECK-NEXT: fcvtzu x10, s2
938 ; CHECK-NEXT: fmov d1, x8
939 ; CHECK-NEXT: mov v0.d[1], x11
940 ; CHECK-NEXT: mov v1.d[1], x10
942 %x = call <4 x i64> @llvm.fptoui.sat.v4f32.v4i64(<4 x float> %f)
946 define <4 x i100> @test_unsigned_v4f32_v4i100(<4 x float> %f) {
947 ; CHECK-LABEL: test_unsigned_v4f32_v4i100:
949 ; CHECK-NEXT: sub sp, sp, #112
950 ; CHECK-NEXT: stp d9, d8, [sp, #32] // 16-byte Folded Spill
951 ; CHECK-NEXT: stp x30, x25, [sp, #48] // 16-byte Folded Spill
952 ; CHECK-NEXT: stp x24, x23, [sp, #64] // 16-byte Folded Spill
953 ; CHECK-NEXT: stp x22, x21, [sp, #80] // 16-byte Folded Spill
954 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
955 ; CHECK-NEXT: .cfi_def_cfa_offset 112
956 ; CHECK-NEXT: .cfi_offset w19, -8
957 ; CHECK-NEXT: .cfi_offset w20, -16
958 ; CHECK-NEXT: .cfi_offset w21, -24
959 ; CHECK-NEXT: .cfi_offset w22, -32
960 ; CHECK-NEXT: .cfi_offset w23, -40
961 ; CHECK-NEXT: .cfi_offset w24, -48
962 ; CHECK-NEXT: .cfi_offset w25, -56
963 ; CHECK-NEXT: .cfi_offset w30, -64
964 ; CHECK-NEXT: .cfi_offset b8, -72
965 ; CHECK-NEXT: .cfi_offset b9, -80
966 ; CHECK-NEXT: mov s8, v0.s[1]
967 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
968 ; CHECK-NEXT: fmov s0, s8
969 ; CHECK-NEXT: bl __fixunssfti
970 ; CHECK-NEXT: mov w8, #1904214015 // =0x717fffff
971 ; CHECK-NEXT: fcmp s8, #0.0
972 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
973 ; CHECK-NEXT: fmov s9, w8
974 ; CHECK-NEXT: mov x25, #68719476735 // =0xfffffffff
975 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
976 ; CHECK-NEXT: csel x8, xzr, x0, lt
977 ; CHECK-NEXT: csel x9, xzr, x1, lt
978 ; CHECK-NEXT: fcmp s8, s9
979 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
980 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
981 ; CHECK-NEXT: csel x19, x25, x9, gt
982 ; CHECK-NEXT: csinv x20, x8, xzr, le
983 ; CHECK-NEXT: bl __fixunssfti
984 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
985 ; CHECK-NEXT: mov s8, v0.s[1]
986 ; CHECK-NEXT: fcmp s0, #0.0
987 ; CHECK-NEXT: csel x8, xzr, x0, lt
988 ; CHECK-NEXT: csel x9, xzr, x1, lt
989 ; CHECK-NEXT: fcmp s0, s9
990 ; CHECK-NEXT: fmov s0, s8
991 ; CHECK-NEXT: csel x21, x25, x9, gt
992 ; CHECK-NEXT: csinv x22, x8, xzr, le
993 ; CHECK-NEXT: bl __fixunssfti
994 ; CHECK-NEXT: fcmp s8, #0.0
995 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
996 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
997 ; CHECK-NEXT: csel x8, xzr, x0, lt
998 ; CHECK-NEXT: csel x9, xzr, x1, lt
999 ; CHECK-NEXT: fcmp s8, s9
1000 ; CHECK-NEXT: csel x23, x25, x9, gt
1001 ; CHECK-NEXT: csinv x24, x8, xzr, le
1002 ; CHECK-NEXT: bl __fixunssfti
1003 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1004 ; CHECK-NEXT: mov x2, x20
1005 ; CHECK-NEXT: mov x3, x19
1006 ; CHECK-NEXT: mov x4, x22
1007 ; CHECK-NEXT: mov x5, x21
1008 ; CHECK-NEXT: mov x6, x24
1009 ; CHECK-NEXT: fcmp s0, #0.0
1010 ; CHECK-NEXT: mov x7, x23
1011 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
1012 ; CHECK-NEXT: ldp x22, x21, [sp, #80] // 16-byte Folded Reload
1013 ; CHECK-NEXT: csel x8, xzr, x0, lt
1014 ; CHECK-NEXT: csel x9, xzr, x1, lt
1015 ; CHECK-NEXT: fcmp s0, s9
1016 ; CHECK-NEXT: ldp x24, x23, [sp, #64] // 16-byte Folded Reload
1017 ; CHECK-NEXT: ldp d9, d8, [sp, #32] // 16-byte Folded Reload
1018 ; CHECK-NEXT: csinv x8, x8, xzr, le
1019 ; CHECK-NEXT: csel x1, x25, x9, gt
1020 ; CHECK-NEXT: fmov d0, x8
1021 ; CHECK-NEXT: ldp x30, x25, [sp, #48] // 16-byte Folded Reload
1022 ; CHECK-NEXT: mov v0.d[1], x1
1023 ; CHECK-NEXT: fmov x0, d0
1024 ; CHECK-NEXT: add sp, sp, #112
1026 %x = call <4 x i100> @llvm.fptoui.sat.v4f32.v4i100(<4 x float> %f)
1030 define <4 x i128> @test_unsigned_v4f32_v4i128(<4 x float> %f) {
1031 ; CHECK-LABEL: test_unsigned_v4f32_v4i128:
1033 ; CHECK-NEXT: sub sp, sp, #112
1034 ; CHECK-NEXT: stp d9, d8, [sp, #32] // 16-byte Folded Spill
1035 ; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
1036 ; CHECK-NEXT: stp x24, x23, [sp, #64] // 16-byte Folded Spill
1037 ; CHECK-NEXT: stp x22, x21, [sp, #80] // 16-byte Folded Spill
1038 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
1039 ; CHECK-NEXT: .cfi_def_cfa_offset 112
1040 ; CHECK-NEXT: .cfi_offset w19, -8
1041 ; CHECK-NEXT: .cfi_offset w20, -16
1042 ; CHECK-NEXT: .cfi_offset w21, -24
1043 ; CHECK-NEXT: .cfi_offset w22, -32
1044 ; CHECK-NEXT: .cfi_offset w23, -40
1045 ; CHECK-NEXT: .cfi_offset w24, -48
1046 ; CHECK-NEXT: .cfi_offset w30, -64
1047 ; CHECK-NEXT: .cfi_offset b8, -72
1048 ; CHECK-NEXT: .cfi_offset b9, -80
1049 ; CHECK-NEXT: mov s8, v0.s[1]
1050 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1051 ; CHECK-NEXT: fmov s0, s8
1052 ; CHECK-NEXT: bl __fixunssfti
1053 ; CHECK-NEXT: mov w8, #2139095039 // =0x7f7fffff
1054 ; CHECK-NEXT: fcmp s8, #0.0
1055 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1056 ; CHECK-NEXT: fmov s9, w8
1057 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
1058 ; CHECK-NEXT: csel x8, xzr, x1, lt
1059 ; CHECK-NEXT: csel x9, xzr, x0, lt
1060 ; CHECK-NEXT: fcmp s8, s9
1061 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1062 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1063 ; CHECK-NEXT: csinv x19, x9, xzr, le
1064 ; CHECK-NEXT: csinv x20, x8, xzr, le
1065 ; CHECK-NEXT: bl __fixunssfti
1066 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1067 ; CHECK-NEXT: mov s8, v0.s[1]
1068 ; CHECK-NEXT: fcmp s0, #0.0
1069 ; CHECK-NEXT: csel x8, xzr, x1, lt
1070 ; CHECK-NEXT: csel x9, xzr, x0, lt
1071 ; CHECK-NEXT: fcmp s0, s9
1072 ; CHECK-NEXT: fmov s0, s8
1073 ; CHECK-NEXT: csinv x21, x9, xzr, le
1074 ; CHECK-NEXT: csinv x22, x8, xzr, le
1075 ; CHECK-NEXT: bl __fixunssfti
1076 ; CHECK-NEXT: fcmp s8, #0.0
1077 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1078 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1079 ; CHECK-NEXT: csel x8, xzr, x1, lt
1080 ; CHECK-NEXT: csel x9, xzr, x0, lt
1081 ; CHECK-NEXT: fcmp s8, s9
1082 ; CHECK-NEXT: csinv x23, x9, xzr, le
1083 ; CHECK-NEXT: csinv x24, x8, xzr, le
1084 ; CHECK-NEXT: bl __fixunssfti
1085 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1086 ; CHECK-NEXT: mov x2, x19
1087 ; CHECK-NEXT: mov x3, x20
1088 ; CHECK-NEXT: mov x4, x21
1089 ; CHECK-NEXT: mov x5, x22
1090 ; CHECK-NEXT: mov x6, x23
1091 ; CHECK-NEXT: fcmp s0, #0.0
1092 ; CHECK-NEXT: mov x7, x24
1093 ; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
1094 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
1095 ; CHECK-NEXT: ldp x22, x21, [sp, #80] // 16-byte Folded Reload
1096 ; CHECK-NEXT: csel x8, xzr, x0, lt
1097 ; CHECK-NEXT: csel x9, xzr, x1, lt
1098 ; CHECK-NEXT: fcmp s0, s9
1099 ; CHECK-NEXT: ldp x24, x23, [sp, #64] // 16-byte Folded Reload
1100 ; CHECK-NEXT: ldp d9, d8, [sp, #32] // 16-byte Folded Reload
1101 ; CHECK-NEXT: csinv x8, x8, xzr, le
1102 ; CHECK-NEXT: csinv x1, x9, xzr, le
1103 ; CHECK-NEXT: fmov d0, x8
1104 ; CHECK-NEXT: mov v0.d[1], x1
1105 ; CHECK-NEXT: fmov x0, d0
1106 ; CHECK-NEXT: add sp, sp, #112
1108 %x = call <4 x i128> @llvm.fptoui.sat.v4f32.v4i128(<4 x float> %f)
1113 ; 2-Vector double to unsigned integer -- result size variation
1116 declare <2 x i1> @llvm.fptoui.sat.v2f64.v2i1 (<2 x double>)
1117 declare <2 x i8> @llvm.fptoui.sat.v2f64.v2i8 (<2 x double>)
1118 declare <2 x i13> @llvm.fptoui.sat.v2f64.v2i13 (<2 x double>)
1119 declare <2 x i16> @llvm.fptoui.sat.v2f64.v2i16 (<2 x double>)
1120 declare <2 x i19> @llvm.fptoui.sat.v2f64.v2i19 (<2 x double>)
1121 declare <2 x i50> @llvm.fptoui.sat.v2f64.v2i50 (<2 x double>)
1122 declare <2 x i64> @llvm.fptoui.sat.v2f64.v2i64 (<2 x double>)
1123 declare <2 x i100> @llvm.fptoui.sat.v2f64.v2i100(<2 x double>)
1124 declare <2 x i128> @llvm.fptoui.sat.v2f64.v2i128(<2 x double>)
1126 define <2 x i1> @test_unsigned_v2f64_v2i1(<2 x double> %f) {
1127 ; CHECK-LABEL: test_unsigned_v2f64_v2i1:
1129 ; CHECK-NEXT: mov d1, v0.d[1]
1130 ; CHECK-NEXT: fcvtzu w9, d0
1131 ; CHECK-NEXT: fcvtzu w8, d1
1132 ; CHECK-NEXT: cmp w8, #1
1133 ; CHECK-NEXT: csinc w8, w8, wzr, lo
1134 ; CHECK-NEXT: cmp w9, #1
1135 ; CHECK-NEXT: csinc w9, w9, wzr, lo
1136 ; CHECK-NEXT: fmov s0, w9
1137 ; CHECK-NEXT: mov v0.s[1], w8
1138 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1140 %x = call <2 x i1> @llvm.fptoui.sat.v2f64.v2i1(<2 x double> %f)
1144 define <2 x i8> @test_unsigned_v2f64_v2i8(<2 x double> %f) {
1145 ; CHECK-LABEL: test_unsigned_v2f64_v2i8:
1147 ; CHECK-NEXT: mov d1, v0.d[1]
1148 ; CHECK-NEXT: fcvtzu w10, d0
1149 ; CHECK-NEXT: mov w8, #255 // =0xff
1150 ; CHECK-NEXT: fcvtzu w9, d1
1151 ; CHECK-NEXT: cmp w9, #255
1152 ; CHECK-NEXT: csel w9, w9, w8, lo
1153 ; CHECK-NEXT: cmp w10, #255
1154 ; CHECK-NEXT: csel w8, w10, w8, lo
1155 ; CHECK-NEXT: fmov s0, w8
1156 ; CHECK-NEXT: mov v0.s[1], w9
1157 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1159 %x = call <2 x i8> @llvm.fptoui.sat.v2f64.v2i8(<2 x double> %f)
1163 define <2 x i13> @test_unsigned_v2f64_v2i13(<2 x double> %f) {
1164 ; CHECK-LABEL: test_unsigned_v2f64_v2i13:
1166 ; CHECK-NEXT: mov d1, v0.d[1]
1167 ; CHECK-NEXT: fcvtzu w9, d0
1168 ; CHECK-NEXT: mov w10, #8191 // =0x1fff
1169 ; CHECK-NEXT: fcvtzu w8, d1
1170 ; CHECK-NEXT: cmp w8, w10
1171 ; CHECK-NEXT: csel w8, w8, w10, lo
1172 ; CHECK-NEXT: cmp w9, w10
1173 ; CHECK-NEXT: csel w9, w9, w10, lo
1174 ; CHECK-NEXT: fmov s0, w9
1175 ; CHECK-NEXT: mov v0.s[1], w8
1176 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1178 %x = call <2 x i13> @llvm.fptoui.sat.v2f64.v2i13(<2 x double> %f)
1182 define <2 x i16> @test_unsigned_v2f64_v2i16(<2 x double> %f) {
1183 ; CHECK-LABEL: test_unsigned_v2f64_v2i16:
1185 ; CHECK-NEXT: mov d1, v0.d[1]
1186 ; CHECK-NEXT: fcvtzu w9, d0
1187 ; CHECK-NEXT: mov w10, #65535 // =0xffff
1188 ; CHECK-NEXT: fcvtzu w8, d1
1189 ; CHECK-NEXT: cmp w8, w10
1190 ; CHECK-NEXT: csel w8, w8, w10, lo
1191 ; CHECK-NEXT: cmp w9, w10
1192 ; CHECK-NEXT: csel w9, w9, w10, lo
1193 ; CHECK-NEXT: fmov s0, w9
1194 ; CHECK-NEXT: mov v0.s[1], w8
1195 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1197 %x = call <2 x i16> @llvm.fptoui.sat.v2f64.v2i16(<2 x double> %f)
1201 define <2 x i19> @test_unsigned_v2f64_v2i19(<2 x double> %f) {
1202 ; CHECK-LABEL: test_unsigned_v2f64_v2i19:
1204 ; CHECK-NEXT: mov d1, v0.d[1]
1205 ; CHECK-NEXT: fcvtzu w9, d0
1206 ; CHECK-NEXT: mov w10, #524287 // =0x7ffff
1207 ; CHECK-NEXT: fcvtzu w8, d1
1208 ; CHECK-NEXT: cmp w8, w10
1209 ; CHECK-NEXT: csel w8, w8, w10, lo
1210 ; CHECK-NEXT: cmp w9, w10
1211 ; CHECK-NEXT: csel w9, w9, w10, lo
1212 ; CHECK-NEXT: fmov s0, w9
1213 ; CHECK-NEXT: mov v0.s[1], w8
1214 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1216 %x = call <2 x i19> @llvm.fptoui.sat.v2f64.v2i19(<2 x double> %f)
1220 define <2 x i32> @test_unsigned_v2f64_v2i32_duplicate(<2 x double> %f) {
1221 ; CHECK-LABEL: test_unsigned_v2f64_v2i32_duplicate:
1223 ; CHECK-NEXT: mov d1, v0.d[1]
1224 ; CHECK-NEXT: fcvtzu w8, d0
1225 ; CHECK-NEXT: fcvtzu w9, d1
1226 ; CHECK-NEXT: fmov s0, w8
1227 ; CHECK-NEXT: mov v0.s[1], w9
1228 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1230 %x = call <2 x i32> @llvm.fptoui.sat.v2f64.v2i32(<2 x double> %f)
1234 define <2 x i50> @test_unsigned_v2f64_v2i50(<2 x double> %f) {
1235 ; CHECK-LABEL: test_unsigned_v2f64_v2i50:
1237 ; CHECK-NEXT: mov d1, v0.d[1]
1238 ; CHECK-NEXT: fcvtzu x9, d0
1239 ; CHECK-NEXT: mov x10, #1125899906842623 // =0x3ffffffffffff
1240 ; CHECK-NEXT: fcvtzu x8, d1
1241 ; CHECK-NEXT: cmp x8, x10
1242 ; CHECK-NEXT: csel x8, x8, x10, lo
1243 ; CHECK-NEXT: cmp x9, x10
1244 ; CHECK-NEXT: csel x9, x9, x10, lo
1245 ; CHECK-NEXT: fmov d0, x9
1246 ; CHECK-NEXT: mov v0.d[1], x8
1248 %x = call <2 x i50> @llvm.fptoui.sat.v2f64.v2i50(<2 x double> %f)
1252 define <2 x i64> @test_unsigned_v2f64_v2i64(<2 x double> %f) {
1253 ; CHECK-LABEL: test_unsigned_v2f64_v2i64:
1255 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
1257 %x = call <2 x i64> @llvm.fptoui.sat.v2f64.v2i64(<2 x double> %f)
1261 define <2 x i100> @test_unsigned_v2f64_v2i100(<2 x double> %f) {
1262 ; CHECK-LABEL: test_unsigned_v2f64_v2i100:
1264 ; CHECK-NEXT: sub sp, sp, #64
1265 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
1266 ; CHECK-NEXT: stp x30, x21, [sp, #32] // 16-byte Folded Spill
1267 ; CHECK-NEXT: stp x20, x19, [sp, #48] // 16-byte Folded Spill
1268 ; CHECK-NEXT: .cfi_def_cfa_offset 64
1269 ; CHECK-NEXT: .cfi_offset w19, -8
1270 ; CHECK-NEXT: .cfi_offset w20, -16
1271 ; CHECK-NEXT: .cfi_offset w21, -24
1272 ; CHECK-NEXT: .cfi_offset w30, -32
1273 ; CHECK-NEXT: .cfi_offset b8, -40
1274 ; CHECK-NEXT: .cfi_offset b9, -48
1275 ; CHECK-NEXT: mov d8, v0.d[1]
1276 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1277 ; CHECK-NEXT: fmov d0, d8
1278 ; CHECK-NEXT: bl __fixunsdfti
1279 ; CHECK-NEXT: mov x8, #5057542381537067007 // =0x462fffffffffffff
1280 ; CHECK-NEXT: fcmp d8, #0.0
1281 ; CHECK-NEXT: mov x21, #68719476735 // =0xfffffffff
1282 ; CHECK-NEXT: fmov d9, x8
1283 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1284 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1285 ; CHECK-NEXT: csel x8, xzr, x0, lt
1286 ; CHECK-NEXT: csel x9, xzr, x1, lt
1287 ; CHECK-NEXT: fcmp d8, d9
1288 ; CHECK-NEXT: csel x19, x21, x9, gt
1289 ; CHECK-NEXT: csinv x20, x8, xzr, le
1290 ; CHECK-NEXT: bl __fixunsdfti
1291 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1292 ; CHECK-NEXT: mov x2, x20
1293 ; CHECK-NEXT: mov x3, x19
1294 ; CHECK-NEXT: ldp x20, x19, [sp, #48] // 16-byte Folded Reload
1295 ; CHECK-NEXT: fcmp d0, #0.0
1296 ; CHECK-NEXT: csel x8, xzr, x0, lt
1297 ; CHECK-NEXT: csel x9, xzr, x1, lt
1298 ; CHECK-NEXT: fcmp d0, d9
1299 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
1300 ; CHECK-NEXT: csinv x8, x8, xzr, le
1301 ; CHECK-NEXT: csel x1, x21, x9, gt
1302 ; CHECK-NEXT: fmov d0, x8
1303 ; CHECK-NEXT: ldp x30, x21, [sp, #32] // 16-byte Folded Reload
1304 ; CHECK-NEXT: mov v0.d[1], x1
1305 ; CHECK-NEXT: fmov x0, d0
1306 ; CHECK-NEXT: add sp, sp, #64
1308 %x = call <2 x i100> @llvm.fptoui.sat.v2f64.v2i100(<2 x double> %f)
1312 define <2 x i128> @test_unsigned_v2f64_v2i128(<2 x double> %f) {
1313 ; CHECK-LABEL: test_unsigned_v2f64_v2i128:
1315 ; CHECK-NEXT: sub sp, sp, #64
1316 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
1317 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1318 ; CHECK-NEXT: stp x20, x19, [sp, #48] // 16-byte Folded Spill
1319 ; CHECK-NEXT: .cfi_def_cfa_offset 64
1320 ; CHECK-NEXT: .cfi_offset w19, -8
1321 ; CHECK-NEXT: .cfi_offset w20, -16
1322 ; CHECK-NEXT: .cfi_offset w30, -32
1323 ; CHECK-NEXT: .cfi_offset b8, -40
1324 ; CHECK-NEXT: .cfi_offset b9, -48
1325 ; CHECK-NEXT: mov d8, v0.d[1]
1326 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1327 ; CHECK-NEXT: fmov d0, d8
1328 ; CHECK-NEXT: bl __fixunsdfti
1329 ; CHECK-NEXT: mov x8, #5183643171103440895 // =0x47efffffffffffff
1330 ; CHECK-NEXT: fcmp d8, #0.0
1331 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1332 ; CHECK-NEXT: fmov d9, x8
1333 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1334 ; CHECK-NEXT: csel x8, xzr, x1, lt
1335 ; CHECK-NEXT: csel x9, xzr, x0, lt
1336 ; CHECK-NEXT: fcmp d8, d9
1337 ; CHECK-NEXT: csinv x19, x9, xzr, le
1338 ; CHECK-NEXT: csinv x20, x8, xzr, le
1339 ; CHECK-NEXT: bl __fixunsdfti
1340 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1341 ; CHECK-NEXT: mov x2, x19
1342 ; CHECK-NEXT: mov x3, x20
1343 ; CHECK-NEXT: ldp x20, x19, [sp, #48] // 16-byte Folded Reload
1344 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1345 ; CHECK-NEXT: fcmp d0, #0.0
1346 ; CHECK-NEXT: csel x8, xzr, x0, lt
1347 ; CHECK-NEXT: csel x9, xzr, x1, lt
1348 ; CHECK-NEXT: fcmp d0, d9
1349 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
1350 ; CHECK-NEXT: csinv x8, x8, xzr, le
1351 ; CHECK-NEXT: csinv x1, x9, xzr, le
1352 ; CHECK-NEXT: fmov d0, x8
1353 ; CHECK-NEXT: mov v0.d[1], x1
1354 ; CHECK-NEXT: fmov x0, d0
1355 ; CHECK-NEXT: add sp, sp, #64
1357 %x = call <2 x i128> @llvm.fptoui.sat.v2f64.v2i128(<2 x double> %f)
1362 ; 4-Vector half to unsigned integer -- result size variation
1365 declare <4 x i1> @llvm.fptoui.sat.v4f16.v4i1 (<4 x half>)
1366 declare <4 x i8> @llvm.fptoui.sat.v4f16.v4i8 (<4 x half>)
1367 declare <4 x i13> @llvm.fptoui.sat.v4f16.v4i13 (<4 x half>)
1368 declare <4 x i16> @llvm.fptoui.sat.v4f16.v4i16 (<4 x half>)
1369 declare <4 x i19> @llvm.fptoui.sat.v4f16.v4i19 (<4 x half>)
1370 declare <4 x i50> @llvm.fptoui.sat.v4f16.v4i50 (<4 x half>)
1371 declare <4 x i64> @llvm.fptoui.sat.v4f16.v4i64 (<4 x half>)
1372 declare <4 x i100> @llvm.fptoui.sat.v4f16.v4i100(<4 x half>)
1373 declare <4 x i128> @llvm.fptoui.sat.v4f16.v4i128(<4 x half>)
1375 define <4 x i1> @test_unsigned_v4f16_v4i1(<4 x half> %f) {
1376 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i1:
1377 ; CHECK-CVT: // %bb.0:
1378 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1379 ; CHECK-CVT-NEXT: movi v1.4s, #1
1380 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
1381 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
1382 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1383 ; CHECK-CVT-NEXT: ret
1385 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i1:
1386 ; CHECK-FP16: // %bb.0:
1387 ; CHECK-FP16-NEXT: movi v1.4h, #1
1388 ; CHECK-FP16-NEXT: fcvtzu v0.4h, v0.4h
1389 ; CHECK-FP16-NEXT: umin v0.4h, v0.4h, v1.4h
1390 ; CHECK-FP16-NEXT: ret
1391 %x = call <4 x i1> @llvm.fptoui.sat.v4f16.v4i1(<4 x half> %f)
1395 define <4 x i8> @test_unsigned_v4f16_v4i8(<4 x half> %f) {
1396 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i8:
1397 ; CHECK-CVT: // %bb.0:
1398 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1399 ; CHECK-CVT-NEXT: movi v1.2d, #0x0000ff000000ff
1400 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
1401 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
1402 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1403 ; CHECK-CVT-NEXT: ret
1405 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i8:
1406 ; CHECK-FP16: // %bb.0:
1407 ; CHECK-FP16-NEXT: movi d1, #0xff00ff00ff00ff
1408 ; CHECK-FP16-NEXT: fcvtzu v0.4h, v0.4h
1409 ; CHECK-FP16-NEXT: umin v0.4h, v0.4h, v1.4h
1410 ; CHECK-FP16-NEXT: ret
1411 %x = call <4 x i8> @llvm.fptoui.sat.v4f16.v4i8(<4 x half> %f)
1415 define <4 x i13> @test_unsigned_v4f16_v4i13(<4 x half> %f) {
1416 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i13:
1417 ; CHECK-CVT: // %bb.0:
1418 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1419 ; CHECK-CVT-NEXT: movi v1.4s, #31, msl #8
1420 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
1421 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
1422 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1423 ; CHECK-CVT-NEXT: ret
1425 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i13:
1426 ; CHECK-FP16: // %bb.0:
1427 ; CHECK-FP16-NEXT: fcvtzu v0.4h, v0.4h
1428 ; CHECK-FP16-NEXT: mvni v1.4h, #224, lsl #8
1429 ; CHECK-FP16-NEXT: umin v0.4h, v0.4h, v1.4h
1430 ; CHECK-FP16-NEXT: ret
1431 %x = call <4 x i13> @llvm.fptoui.sat.v4f16.v4i13(<4 x half> %f)
1435 define <4 x i16> @test_unsigned_v4f16_v4i16(<4 x half> %f) {
1436 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i16:
1437 ; CHECK-CVT: // %bb.0:
1438 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1439 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
1440 ; CHECK-CVT-NEXT: uqxtn v0.4h, v0.4s
1441 ; CHECK-CVT-NEXT: ret
1443 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i16:
1444 ; CHECK-FP16: // %bb.0:
1445 ; CHECK-FP16-NEXT: fcvtzu v0.4h, v0.4h
1446 ; CHECK-FP16-NEXT: ret
1447 %x = call <4 x i16> @llvm.fptoui.sat.v4f16.v4i16(<4 x half> %f)
1451 define <4 x i19> @test_unsigned_v4f16_v4i19(<4 x half> %f) {
1452 ; CHECK-LABEL: test_unsigned_v4f16_v4i19:
1454 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
1455 ; CHECK-NEXT: movi v1.4s, #7, msl #16
1456 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
1457 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1459 %x = call <4 x i19> @llvm.fptoui.sat.v4f16.v4i19(<4 x half> %f)
1463 define <4 x i32> @test_unsigned_v4f16_v4i32_duplicate(<4 x half> %f) {
1464 ; CHECK-LABEL: test_unsigned_v4f16_v4i32_duplicate:
1466 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
1467 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
1469 %x = call <4 x i32> @llvm.fptoui.sat.v4f16.v4i32(<4 x half> %f)
1473 define <4 x i50> @test_unsigned_v4f16_v4i50(<4 x half> %f) {
1474 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i50:
1475 ; CHECK-CVT: // %bb.0:
1476 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1477 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
1478 ; CHECK-CVT-NEXT: mov h2, v0.h[2]
1479 ; CHECK-CVT-NEXT: mov x8, #1125899906842623 // =0x3ffffffffffff
1480 ; CHECK-CVT-NEXT: mov h3, v0.h[3]
1481 ; CHECK-CVT-NEXT: fcvt s0, h0
1482 ; CHECK-CVT-NEXT: fcvt s1, h1
1483 ; CHECK-CVT-NEXT: fcvt s2, h2
1484 ; CHECK-CVT-NEXT: fcvt s3, h3
1485 ; CHECK-CVT-NEXT: fcvtzu x9, s0
1486 ; CHECK-CVT-NEXT: fcvtzu x10, s1
1487 ; CHECK-CVT-NEXT: fcvtzu x11, s2
1488 ; CHECK-CVT-NEXT: fcvtzu x12, s3
1489 ; CHECK-CVT-NEXT: cmp x9, x8
1490 ; CHECK-CVT-NEXT: csel x0, x9, x8, lo
1491 ; CHECK-CVT-NEXT: cmp x10, x8
1492 ; CHECK-CVT-NEXT: csel x1, x10, x8, lo
1493 ; CHECK-CVT-NEXT: cmp x11, x8
1494 ; CHECK-CVT-NEXT: csel x2, x11, x8, lo
1495 ; CHECK-CVT-NEXT: cmp x12, x8
1496 ; CHECK-CVT-NEXT: csel x3, x12, x8, lo
1497 ; CHECK-CVT-NEXT: ret
1499 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i50:
1500 ; CHECK-FP16: // %bb.0:
1501 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1502 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
1503 ; CHECK-FP16-NEXT: mov h2, v0.h[2]
1504 ; CHECK-FP16-NEXT: mov x8, #1125899906842623 // =0x3ffffffffffff
1505 ; CHECK-FP16-NEXT: mov h3, v0.h[3]
1506 ; CHECK-FP16-NEXT: fcvtzu x9, h0
1507 ; CHECK-FP16-NEXT: fcvtzu x10, h1
1508 ; CHECK-FP16-NEXT: fcvtzu x11, h2
1509 ; CHECK-FP16-NEXT: fcvtzu x12, h3
1510 ; CHECK-FP16-NEXT: cmp x9, x8
1511 ; CHECK-FP16-NEXT: csel x0, x9, x8, lo
1512 ; CHECK-FP16-NEXT: cmp x10, x8
1513 ; CHECK-FP16-NEXT: csel x1, x10, x8, lo
1514 ; CHECK-FP16-NEXT: cmp x11, x8
1515 ; CHECK-FP16-NEXT: csel x2, x11, x8, lo
1516 ; CHECK-FP16-NEXT: cmp x12, x8
1517 ; CHECK-FP16-NEXT: csel x3, x12, x8, lo
1518 ; CHECK-FP16-NEXT: ret
1519 %x = call <4 x i50> @llvm.fptoui.sat.v4f16.v4i50(<4 x half> %f)
1523 define <4 x i64> @test_unsigned_v4f16_v4i64(<4 x half> %f) {
1524 ; CHECK-CVT-LABEL: test_unsigned_v4f16_v4i64:
1525 ; CHECK-CVT: // %bb.0:
1526 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1527 ; CHECK-CVT-NEXT: mov h1, v0.h[2]
1528 ; CHECK-CVT-NEXT: mov h2, v0.h[1]
1529 ; CHECK-CVT-NEXT: mov h3, v0.h[3]
1530 ; CHECK-CVT-NEXT: fcvt s0, h0
1531 ; CHECK-CVT-NEXT: fcvt s1, h1
1532 ; CHECK-CVT-NEXT: fcvt s2, h2
1533 ; CHECK-CVT-NEXT: fcvt s3, h3
1534 ; CHECK-CVT-NEXT: fcvtzu x8, s0
1535 ; CHECK-CVT-NEXT: fcvtzu x9, s1
1536 ; CHECK-CVT-NEXT: fcvtzu x10, s2
1537 ; CHECK-CVT-NEXT: fcvtzu x11, s3
1538 ; CHECK-CVT-NEXT: fmov d0, x8
1539 ; CHECK-CVT-NEXT: fmov d1, x9
1540 ; CHECK-CVT-NEXT: mov v0.d[1], x10
1541 ; CHECK-CVT-NEXT: mov v1.d[1], x11
1542 ; CHECK-CVT-NEXT: ret
1544 ; CHECK-FP16-LABEL: test_unsigned_v4f16_v4i64:
1545 ; CHECK-FP16: // %bb.0:
1546 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1547 ; CHECK-FP16-NEXT: mov h1, v0.h[2]
1548 ; CHECK-FP16-NEXT: mov h2, v0.h[1]
1549 ; CHECK-FP16-NEXT: mov h3, v0.h[3]
1550 ; CHECK-FP16-NEXT: fcvtzu x8, h0
1551 ; CHECK-FP16-NEXT: fcvtzu x9, h1
1552 ; CHECK-FP16-NEXT: fcvtzu x10, h2
1553 ; CHECK-FP16-NEXT: fcvtzu x11, h3
1554 ; CHECK-FP16-NEXT: fmov d0, x8
1555 ; CHECK-FP16-NEXT: fmov d1, x9
1556 ; CHECK-FP16-NEXT: mov v0.d[1], x10
1557 ; CHECK-FP16-NEXT: mov v1.d[1], x11
1558 ; CHECK-FP16-NEXT: ret
1559 %x = call <4 x i64> @llvm.fptoui.sat.v4f16.v4i64(<4 x half> %f)
1563 define <4 x i100> @test_unsigned_v4f16_v4i100(<4 x half> %f) {
1564 ; CHECK-LABEL: test_unsigned_v4f16_v4i100:
1566 ; CHECK-NEXT: sub sp, sp, #96
1567 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
1568 ; CHECK-NEXT: stp x30, x25, [sp, #32] // 16-byte Folded Spill
1569 ; CHECK-NEXT: stp x24, x23, [sp, #48] // 16-byte Folded Spill
1570 ; CHECK-NEXT: stp x22, x21, [sp, #64] // 16-byte Folded Spill
1571 ; CHECK-NEXT: stp x20, x19, [sp, #80] // 16-byte Folded Spill
1572 ; CHECK-NEXT: .cfi_def_cfa_offset 96
1573 ; CHECK-NEXT: .cfi_offset w19, -8
1574 ; CHECK-NEXT: .cfi_offset w20, -16
1575 ; CHECK-NEXT: .cfi_offset w21, -24
1576 ; CHECK-NEXT: .cfi_offset w22, -32
1577 ; CHECK-NEXT: .cfi_offset w23, -40
1578 ; CHECK-NEXT: .cfi_offset w24, -48
1579 ; CHECK-NEXT: .cfi_offset w25, -56
1580 ; CHECK-NEXT: .cfi_offset w30, -64
1581 ; CHECK-NEXT: .cfi_offset b8, -72
1582 ; CHECK-NEXT: .cfi_offset b9, -80
1583 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1584 ; CHECK-NEXT: mov h1, v0.h[2]
1585 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1586 ; CHECK-NEXT: fcvt s8, h1
1587 ; CHECK-NEXT: fmov s0, s8
1588 ; CHECK-NEXT: bl __fixunssfti
1589 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1590 ; CHECK-NEXT: mov w8, #1904214015 // =0x717fffff
1591 ; CHECK-NEXT: fcmp s8, #0.0
1592 ; CHECK-NEXT: fmov s9, w8
1593 ; CHECK-NEXT: mov x25, #68719476735 // =0xfffffffff
1594 ; CHECK-NEXT: mov h0, v0.h[1]
1595 ; CHECK-NEXT: csel x9, xzr, x0, lt
1596 ; CHECK-NEXT: csel x8, xzr, x1, lt
1597 ; CHECK-NEXT: fcmp s8, s9
1598 ; CHECK-NEXT: fcvt s8, h0
1599 ; CHECK-NEXT: csel x19, x25, x8, gt
1600 ; CHECK-NEXT: csinv x20, x9, xzr, le
1601 ; CHECK-NEXT: fmov s0, s8
1602 ; CHECK-NEXT: bl __fixunssfti
1603 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1604 ; CHECK-NEXT: fcmp s8, #0.0
1605 ; CHECK-NEXT: mov h0, v0.h[3]
1606 ; CHECK-NEXT: csel x8, xzr, x0, lt
1607 ; CHECK-NEXT: csel x9, xzr, x1, lt
1608 ; CHECK-NEXT: fcmp s8, s9
1609 ; CHECK-NEXT: fcvt s8, h0
1610 ; CHECK-NEXT: csel x21, x25, x9, gt
1611 ; CHECK-NEXT: csinv x22, x8, xzr, le
1612 ; CHECK-NEXT: fmov s0, s8
1613 ; CHECK-NEXT: bl __fixunssfti
1614 ; CHECK-NEXT: fcmp s8, #0.0
1615 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1616 ; CHECK-NEXT: csel x8, xzr, x0, lt
1617 ; CHECK-NEXT: csel x9, xzr, x1, lt
1618 ; CHECK-NEXT: fcmp s8, s9
1619 ; CHECK-NEXT: fcvt s8, h0
1620 ; CHECK-NEXT: csel x23, x25, x9, gt
1621 ; CHECK-NEXT: csinv x24, x8, xzr, le
1622 ; CHECK-NEXT: fmov s0, s8
1623 ; CHECK-NEXT: bl __fixunssfti
1624 ; CHECK-NEXT: fcmp s8, #0.0
1625 ; CHECK-NEXT: mov x2, x22
1626 ; CHECK-NEXT: mov x3, x21
1627 ; CHECK-NEXT: mov x4, x20
1628 ; CHECK-NEXT: mov x5, x19
1629 ; CHECK-NEXT: mov x6, x24
1630 ; CHECK-NEXT: mov x7, x23
1631 ; CHECK-NEXT: ldp x20, x19, [sp, #80] // 16-byte Folded Reload
1632 ; CHECK-NEXT: csel x8, xzr, x0, lt
1633 ; CHECK-NEXT: csel x9, xzr, x1, lt
1634 ; CHECK-NEXT: fcmp s8, s9
1635 ; CHECK-NEXT: ldp x22, x21, [sp, #64] // 16-byte Folded Reload
1636 ; CHECK-NEXT: ldp x24, x23, [sp, #48] // 16-byte Folded Reload
1637 ; CHECK-NEXT: csinv x8, x8, xzr, le
1638 ; CHECK-NEXT: csel x1, x25, x9, gt
1639 ; CHECK-NEXT: fmov d0, x8
1640 ; CHECK-NEXT: ldp x30, x25, [sp, #32] // 16-byte Folded Reload
1641 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
1642 ; CHECK-NEXT: mov v0.d[1], x1
1643 ; CHECK-NEXT: fmov x0, d0
1644 ; CHECK-NEXT: add sp, sp, #96
1646 %x = call <4 x i100> @llvm.fptoui.sat.v4f16.v4i100(<4 x half> %f)
1650 define <4 x i128> @test_unsigned_v4f16_v4i128(<4 x half> %f) {
1651 ; CHECK-LABEL: test_unsigned_v4f16_v4i128:
1653 ; CHECK-NEXT: sub sp, sp, #96
1654 ; CHECK-NEXT: stp d9, d8, [sp, #16] // 16-byte Folded Spill
1655 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1656 ; CHECK-NEXT: stp x24, x23, [sp, #48] // 16-byte Folded Spill
1657 ; CHECK-NEXT: stp x22, x21, [sp, #64] // 16-byte Folded Spill
1658 ; CHECK-NEXT: stp x20, x19, [sp, #80] // 16-byte Folded Spill
1659 ; CHECK-NEXT: .cfi_def_cfa_offset 96
1660 ; CHECK-NEXT: .cfi_offset w19, -8
1661 ; CHECK-NEXT: .cfi_offset w20, -16
1662 ; CHECK-NEXT: .cfi_offset w21, -24
1663 ; CHECK-NEXT: .cfi_offset w22, -32
1664 ; CHECK-NEXT: .cfi_offset w23, -40
1665 ; CHECK-NEXT: .cfi_offset w24, -48
1666 ; CHECK-NEXT: .cfi_offset w30, -64
1667 ; CHECK-NEXT: .cfi_offset b8, -72
1668 ; CHECK-NEXT: .cfi_offset b9, -80
1669 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1670 ; CHECK-NEXT: mov h1, v0.h[1]
1671 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1672 ; CHECK-NEXT: fcvt s8, h1
1673 ; CHECK-NEXT: fmov s0, s8
1674 ; CHECK-NEXT: bl __fixunssfti
1675 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1676 ; CHECK-NEXT: mov w8, #2139095039 // =0x7f7fffff
1677 ; CHECK-NEXT: fcmp s8, #0.0
1678 ; CHECK-NEXT: fmov s9, w8
1679 ; CHECK-NEXT: mov h0, v0.h[2]
1680 ; CHECK-NEXT: csel x9, xzr, x1, lt
1681 ; CHECK-NEXT: csel x8, xzr, x0, lt
1682 ; CHECK-NEXT: fcmp s8, s9
1683 ; CHECK-NEXT: fcvt s8, h0
1684 ; CHECK-NEXT: csinv x19, x8, xzr, le
1685 ; CHECK-NEXT: csinv x20, x9, xzr, le
1686 ; CHECK-NEXT: fmov s0, s8
1687 ; CHECK-NEXT: bl __fixunssfti
1688 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1689 ; CHECK-NEXT: fcmp s8, #0.0
1690 ; CHECK-NEXT: mov h0, v0.h[3]
1691 ; CHECK-NEXT: csel x8, xzr, x1, lt
1692 ; CHECK-NEXT: csel x9, xzr, x0, lt
1693 ; CHECK-NEXT: fcmp s8, s9
1694 ; CHECK-NEXT: fcvt s8, h0
1695 ; CHECK-NEXT: csinv x21, x9, xzr, le
1696 ; CHECK-NEXT: csinv x22, x8, xzr, le
1697 ; CHECK-NEXT: fmov s0, s8
1698 ; CHECK-NEXT: bl __fixunssfti
1699 ; CHECK-NEXT: fcmp s8, #0.0
1700 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1701 ; CHECK-NEXT: csel x8, xzr, x1, lt
1702 ; CHECK-NEXT: csel x9, xzr, x0, lt
1703 ; CHECK-NEXT: fcmp s8, s9
1704 ; CHECK-NEXT: fcvt s8, h0
1705 ; CHECK-NEXT: csinv x23, x9, xzr, le
1706 ; CHECK-NEXT: csinv x24, x8, xzr, le
1707 ; CHECK-NEXT: fmov s0, s8
1708 ; CHECK-NEXT: bl __fixunssfti
1709 ; CHECK-NEXT: fcmp s8, #0.0
1710 ; CHECK-NEXT: mov x2, x19
1711 ; CHECK-NEXT: mov x3, x20
1712 ; CHECK-NEXT: mov x4, x21
1713 ; CHECK-NEXT: mov x5, x22
1714 ; CHECK-NEXT: mov x6, x23
1715 ; CHECK-NEXT: mov x7, x24
1716 ; CHECK-NEXT: ldp x20, x19, [sp, #80] // 16-byte Folded Reload
1717 ; CHECK-NEXT: csel x8, xzr, x0, lt
1718 ; CHECK-NEXT: csel x9, xzr, x1, lt
1719 ; CHECK-NEXT: fcmp s8, s9
1720 ; CHECK-NEXT: ldp x22, x21, [sp, #64] // 16-byte Folded Reload
1721 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1722 ; CHECK-NEXT: ldp x24, x23, [sp, #48] // 16-byte Folded Reload
1723 ; CHECK-NEXT: csinv x8, x8, xzr, le
1724 ; CHECK-NEXT: csinv x1, x9, xzr, le
1725 ; CHECK-NEXT: fmov d0, x8
1726 ; CHECK-NEXT: ldp d9, d8, [sp, #16] // 16-byte Folded Reload
1727 ; CHECK-NEXT: mov v0.d[1], x1
1728 ; CHECK-NEXT: fmov x0, d0
1729 ; CHECK-NEXT: add sp, sp, #96
1731 %x = call <4 x i128> @llvm.fptoui.sat.v4f16.v4i128(<4 x half> %f)
1736 ; 8-Vector half to unsigned integer -- result size variation
1739 declare <8 x i1> @llvm.fptoui.sat.v8f16.v8i1 (<8 x half>)
1740 declare <8 x i8> @llvm.fptoui.sat.v8f16.v8i8 (<8 x half>)
1741 declare <8 x i13> @llvm.fptoui.sat.v8f16.v8i13 (<8 x half>)
1742 declare <8 x i16> @llvm.fptoui.sat.v8f16.v8i16 (<8 x half>)
1743 declare <8 x i19> @llvm.fptoui.sat.v8f16.v8i19 (<8 x half>)
1744 declare <8 x i50> @llvm.fptoui.sat.v8f16.v8i50 (<8 x half>)
1745 declare <8 x i64> @llvm.fptoui.sat.v8f16.v8i64 (<8 x half>)
1746 declare <8 x i100> @llvm.fptoui.sat.v8f16.v8i100(<8 x half>)
1747 declare <8 x i128> @llvm.fptoui.sat.v8f16.v8i128(<8 x half>)
1749 define <8 x i1> @test_unsigned_v8f16_v8i1(<8 x half> %f) {
1750 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i1:
1751 ; CHECK-CVT: // %bb.0:
1752 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
1753 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1754 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
1755 ; CHECK-CVT-NEXT: mov s3, v1.s[2]
1756 ; CHECK-CVT-NEXT: mov s4, v1.s[3]
1757 ; CHECK-CVT-NEXT: fcvtzu w9, s1
1758 ; CHECK-CVT-NEXT: fcvtzu w13, s0
1759 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
1760 ; CHECK-CVT-NEXT: fcvtzu w8, s2
1761 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
1762 ; CHECK-CVT-NEXT: fcvtzu w10, s3
1763 ; CHECK-CVT-NEXT: fcvtzu w11, s4
1764 ; CHECK-CVT-NEXT: fcvtzu w14, s1
1765 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
1766 ; CHECK-CVT-NEXT: cmp w8, #1
1767 ; CHECK-CVT-NEXT: fcvtzu w12, s2
1768 ; CHECK-CVT-NEXT: csinc w8, w8, wzr, lo
1769 ; CHECK-CVT-NEXT: cmp w9, #1
1770 ; CHECK-CVT-NEXT: csinc w9, w9, wzr, lo
1771 ; CHECK-CVT-NEXT: cmp w10, #1
1772 ; CHECK-CVT-NEXT: csinc w10, w10, wzr, lo
1773 ; CHECK-CVT-NEXT: cmp w11, #1
1774 ; CHECK-CVT-NEXT: fmov s1, w9
1775 ; CHECK-CVT-NEXT: csinc w11, w11, wzr, lo
1776 ; CHECK-CVT-NEXT: cmp w12, #1
1777 ; CHECK-CVT-NEXT: csinc w12, w12, wzr, lo
1778 ; CHECK-CVT-NEXT: cmp w13, #1
1779 ; CHECK-CVT-NEXT: csinc w13, w13, wzr, lo
1780 ; CHECK-CVT-NEXT: mov v1.s[1], w8
1781 ; CHECK-CVT-NEXT: cmp w14, #1
1782 ; CHECK-CVT-NEXT: fmov s2, w13
1783 ; CHECK-CVT-NEXT: fcvtzu w8, s0
1784 ; CHECK-CVT-NEXT: csinc w9, w14, wzr, lo
1785 ; CHECK-CVT-NEXT: mov v2.s[1], w12
1786 ; CHECK-CVT-NEXT: mov v1.s[2], w10
1787 ; CHECK-CVT-NEXT: cmp w8, #1
1788 ; CHECK-CVT-NEXT: csinc w8, w8, wzr, lo
1789 ; CHECK-CVT-NEXT: mov v2.s[2], w9
1790 ; CHECK-CVT-NEXT: mov v1.s[3], w11
1791 ; CHECK-CVT-NEXT: mov v2.s[3], w8
1792 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
1793 ; CHECK-CVT-NEXT: xtn v0.8b, v0.8h
1794 ; CHECK-CVT-NEXT: ret
1796 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i1:
1797 ; CHECK-FP16: // %bb.0:
1798 ; CHECK-FP16-NEXT: movi v1.8h, #1
1799 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
1800 ; CHECK-FP16-NEXT: umin v0.8h, v0.8h, v1.8h
1801 ; CHECK-FP16-NEXT: xtn v0.8b, v0.8h
1802 ; CHECK-FP16-NEXT: ret
1803 %x = call <8 x i1> @llvm.fptoui.sat.v8f16.v8i1(<8 x half> %f)
1807 define <8 x i8> @test_unsigned_v8f16_v8i8(<8 x half> %f) {
1808 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i8:
1809 ; CHECK-CVT: // %bb.0:
1810 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
1811 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1812 ; CHECK-CVT-NEXT: mov w8, #255 // =0xff
1813 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
1814 ; CHECK-CVT-NEXT: mov s3, v1.s[2]
1815 ; CHECK-CVT-NEXT: mov s4, v1.s[3]
1816 ; CHECK-CVT-NEXT: fcvtzu w10, s1
1817 ; CHECK-CVT-NEXT: fcvtzu w14, s0
1818 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
1819 ; CHECK-CVT-NEXT: fcvtzu w9, s2
1820 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
1821 ; CHECK-CVT-NEXT: fcvtzu w11, s3
1822 ; CHECK-CVT-NEXT: fcvtzu w12, s4
1823 ; CHECK-CVT-NEXT: fcvtzu w15, s1
1824 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
1825 ; CHECK-CVT-NEXT: cmp w9, #255
1826 ; CHECK-CVT-NEXT: fcvtzu w13, s2
1827 ; CHECK-CVT-NEXT: csel w9, w9, w8, lo
1828 ; CHECK-CVT-NEXT: cmp w10, #255
1829 ; CHECK-CVT-NEXT: csel w10, w10, w8, lo
1830 ; CHECK-CVT-NEXT: cmp w11, #255
1831 ; CHECK-CVT-NEXT: csel w11, w11, w8, lo
1832 ; CHECK-CVT-NEXT: cmp w12, #255
1833 ; CHECK-CVT-NEXT: fmov s1, w10
1834 ; CHECK-CVT-NEXT: csel w12, w12, w8, lo
1835 ; CHECK-CVT-NEXT: cmp w13, #255
1836 ; CHECK-CVT-NEXT: csel w13, w13, w8, lo
1837 ; CHECK-CVT-NEXT: cmp w14, #255
1838 ; CHECK-CVT-NEXT: csel w14, w14, w8, lo
1839 ; CHECK-CVT-NEXT: mov v1.s[1], w9
1840 ; CHECK-CVT-NEXT: cmp w15, #255
1841 ; CHECK-CVT-NEXT: fmov s2, w14
1842 ; CHECK-CVT-NEXT: fcvtzu w9, s0
1843 ; CHECK-CVT-NEXT: csel w10, w15, w8, lo
1844 ; CHECK-CVT-NEXT: mov v2.s[1], w13
1845 ; CHECK-CVT-NEXT: mov v1.s[2], w11
1846 ; CHECK-CVT-NEXT: cmp w9, #255
1847 ; CHECK-CVT-NEXT: csel w8, w9, w8, lo
1848 ; CHECK-CVT-NEXT: mov v2.s[2], w10
1849 ; CHECK-CVT-NEXT: mov v1.s[3], w12
1850 ; CHECK-CVT-NEXT: mov v2.s[3], w8
1851 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
1852 ; CHECK-CVT-NEXT: xtn v0.8b, v0.8h
1853 ; CHECK-CVT-NEXT: ret
1855 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i8:
1856 ; CHECK-FP16: // %bb.0:
1857 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
1858 ; CHECK-FP16-NEXT: uqxtn v0.8b, v0.8h
1859 ; CHECK-FP16-NEXT: ret
1860 %x = call <8 x i8> @llvm.fptoui.sat.v8f16.v8i8(<8 x half> %f)
1864 define <8 x i13> @test_unsigned_v8f16_v8i13(<8 x half> %f) {
1865 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i13:
1866 ; CHECK-CVT: // %bb.0:
1867 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
1868 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1869 ; CHECK-CVT-NEXT: mov w8, #8191 // =0x1fff
1870 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
1871 ; CHECK-CVT-NEXT: mov s3, v1.s[2]
1872 ; CHECK-CVT-NEXT: mov s4, v1.s[3]
1873 ; CHECK-CVT-NEXT: fcvtzu w10, s1
1874 ; CHECK-CVT-NEXT: fcvtzu w14, s0
1875 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
1876 ; CHECK-CVT-NEXT: fcvtzu w9, s2
1877 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
1878 ; CHECK-CVT-NEXT: fcvtzu w11, s3
1879 ; CHECK-CVT-NEXT: fcvtzu w12, s4
1880 ; CHECK-CVT-NEXT: fcvtzu w15, s1
1881 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
1882 ; CHECK-CVT-NEXT: cmp w9, w8
1883 ; CHECK-CVT-NEXT: fcvtzu w13, s2
1884 ; CHECK-CVT-NEXT: csel w9, w9, w8, lo
1885 ; CHECK-CVT-NEXT: cmp w10, w8
1886 ; CHECK-CVT-NEXT: csel w10, w10, w8, lo
1887 ; CHECK-CVT-NEXT: cmp w11, w8
1888 ; CHECK-CVT-NEXT: csel w11, w11, w8, lo
1889 ; CHECK-CVT-NEXT: cmp w12, w8
1890 ; CHECK-CVT-NEXT: fmov s1, w10
1891 ; CHECK-CVT-NEXT: csel w12, w12, w8, lo
1892 ; CHECK-CVT-NEXT: cmp w13, w8
1893 ; CHECK-CVT-NEXT: csel w13, w13, w8, lo
1894 ; CHECK-CVT-NEXT: cmp w14, w8
1895 ; CHECK-CVT-NEXT: csel w14, w14, w8, lo
1896 ; CHECK-CVT-NEXT: mov v1.s[1], w9
1897 ; CHECK-CVT-NEXT: cmp w15, w8
1898 ; CHECK-CVT-NEXT: fmov s2, w14
1899 ; CHECK-CVT-NEXT: fcvtzu w9, s0
1900 ; CHECK-CVT-NEXT: csel w10, w15, w8, lo
1901 ; CHECK-CVT-NEXT: mov v2.s[1], w13
1902 ; CHECK-CVT-NEXT: mov v1.s[2], w11
1903 ; CHECK-CVT-NEXT: cmp w9, w8
1904 ; CHECK-CVT-NEXT: csel w8, w9, w8, lo
1905 ; CHECK-CVT-NEXT: mov v2.s[2], w10
1906 ; CHECK-CVT-NEXT: mov v1.s[3], w12
1907 ; CHECK-CVT-NEXT: mov v2.s[3], w8
1908 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
1909 ; CHECK-CVT-NEXT: ret
1911 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i13:
1912 ; CHECK-FP16: // %bb.0:
1913 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
1914 ; CHECK-FP16-NEXT: mvni v1.8h, #224, lsl #8
1915 ; CHECK-FP16-NEXT: umin v0.8h, v0.8h, v1.8h
1916 ; CHECK-FP16-NEXT: ret
1917 %x = call <8 x i13> @llvm.fptoui.sat.v8f16.v8i13(<8 x half> %f)
1921 define <8 x i16> @test_unsigned_v8f16_v8i16(<8 x half> %f) {
1922 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i16:
1923 ; CHECK-CVT: // %bb.0:
1924 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
1925 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1926 ; CHECK-CVT-NEXT: mov w8, #65535 // =0xffff
1927 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
1928 ; CHECK-CVT-NEXT: mov s3, v1.s[2]
1929 ; CHECK-CVT-NEXT: mov s4, v1.s[3]
1930 ; CHECK-CVT-NEXT: fcvtzu w10, s1
1931 ; CHECK-CVT-NEXT: fcvtzu w14, s0
1932 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
1933 ; CHECK-CVT-NEXT: fcvtzu w9, s2
1934 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
1935 ; CHECK-CVT-NEXT: fcvtzu w11, s3
1936 ; CHECK-CVT-NEXT: fcvtzu w12, s4
1937 ; CHECK-CVT-NEXT: fcvtzu w15, s1
1938 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
1939 ; CHECK-CVT-NEXT: cmp w9, w8
1940 ; CHECK-CVT-NEXT: fcvtzu w13, s2
1941 ; CHECK-CVT-NEXT: csel w9, w9, w8, lo
1942 ; CHECK-CVT-NEXT: cmp w10, w8
1943 ; CHECK-CVT-NEXT: csel w10, w10, w8, lo
1944 ; CHECK-CVT-NEXT: cmp w11, w8
1945 ; CHECK-CVT-NEXT: csel w11, w11, w8, lo
1946 ; CHECK-CVT-NEXT: cmp w12, w8
1947 ; CHECK-CVT-NEXT: fmov s1, w10
1948 ; CHECK-CVT-NEXT: csel w12, w12, w8, lo
1949 ; CHECK-CVT-NEXT: cmp w13, w8
1950 ; CHECK-CVT-NEXT: csel w13, w13, w8, lo
1951 ; CHECK-CVT-NEXT: cmp w14, w8
1952 ; CHECK-CVT-NEXT: csel w14, w14, w8, lo
1953 ; CHECK-CVT-NEXT: mov v1.s[1], w9
1954 ; CHECK-CVT-NEXT: cmp w15, w8
1955 ; CHECK-CVT-NEXT: fmov s2, w14
1956 ; CHECK-CVT-NEXT: fcvtzu w9, s0
1957 ; CHECK-CVT-NEXT: csel w10, w15, w8, lo
1958 ; CHECK-CVT-NEXT: mov v2.s[1], w13
1959 ; CHECK-CVT-NEXT: mov v1.s[2], w11
1960 ; CHECK-CVT-NEXT: cmp w9, w8
1961 ; CHECK-CVT-NEXT: csel w8, w9, w8, lo
1962 ; CHECK-CVT-NEXT: mov v2.s[2], w10
1963 ; CHECK-CVT-NEXT: mov v1.s[3], w12
1964 ; CHECK-CVT-NEXT: mov v2.s[3], w8
1965 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
1966 ; CHECK-CVT-NEXT: ret
1968 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i16:
1969 ; CHECK-FP16: // %bb.0:
1970 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
1971 ; CHECK-FP16-NEXT: ret
1972 %x = call <8 x i16> @llvm.fptoui.sat.v8f16.v8i16(<8 x half> %f)
1976 define <8 x i19> @test_unsigned_v8f16_v8i19(<8 x half> %f) {
1977 ; CHECK-LABEL: test_unsigned_v8f16_v8i19:
1979 ; CHECK-NEXT: fcvtl v2.4s, v0.4h
1980 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
1981 ; CHECK-NEXT: movi v1.4s, #7, msl #16
1982 ; CHECK-NEXT: fcvtzu v2.4s, v2.4s
1983 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
1984 ; CHECK-NEXT: umin v2.4s, v2.4s, v1.4s
1985 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1986 ; CHECK-NEXT: mov w1, v2.s[1]
1987 ; CHECK-NEXT: mov w2, v2.s[2]
1988 ; CHECK-NEXT: mov w3, v2.s[3]
1989 ; CHECK-NEXT: mov w5, v0.s[1]
1990 ; CHECK-NEXT: mov w6, v0.s[2]
1991 ; CHECK-NEXT: mov w7, v0.s[3]
1992 ; CHECK-NEXT: fmov w4, s0
1993 ; CHECK-NEXT: fmov w0, s2
1995 %x = call <8 x i19> @llvm.fptoui.sat.v8f16.v8i19(<8 x half> %f)
1999 define <8 x i32> @test_unsigned_v8f16_v8i32_duplicate(<8 x half> %f) {
2000 ; CHECK-LABEL: test_unsigned_v8f16_v8i32_duplicate:
2002 ; CHECK-NEXT: fcvtl2 v1.4s, v0.8h
2003 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
2004 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
2005 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
2007 %x = call <8 x i32> @llvm.fptoui.sat.v8f16.v8i32(<8 x half> %f)
2011 define <8 x i50> @test_unsigned_v8f16_v8i50(<8 x half> %f) {
2012 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i50:
2013 ; CHECK-CVT: // %bb.0:
2014 ; CHECK-CVT-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2015 ; CHECK-CVT-NEXT: mov h5, v0.h[1]
2016 ; CHECK-CVT-NEXT: mov x8, #1125899906842623 // =0x3ffffffffffff
2017 ; CHECK-CVT-NEXT: mov h6, v0.h[2]
2018 ; CHECK-CVT-NEXT: mov h7, v0.h[3]
2019 ; CHECK-CVT-NEXT: fcvt s0, h0
2020 ; CHECK-CVT-NEXT: mov h2, v1.h[1]
2021 ; CHECK-CVT-NEXT: mov h3, v1.h[2]
2022 ; CHECK-CVT-NEXT: mov h4, v1.h[3]
2023 ; CHECK-CVT-NEXT: fcvt s1, h1
2024 ; CHECK-CVT-NEXT: fcvtzu x13, s0
2025 ; CHECK-CVT-NEXT: fcvt s2, h2
2026 ; CHECK-CVT-NEXT: fcvt s3, h3
2027 ; CHECK-CVT-NEXT: fcvt s4, h4
2028 ; CHECK-CVT-NEXT: fcvtzu x9, s1
2029 ; CHECK-CVT-NEXT: fcvt s1, h5
2030 ; CHECK-CVT-NEXT: fcvtzu x10, s2
2031 ; CHECK-CVT-NEXT: fcvtzu x11, s3
2032 ; CHECK-CVT-NEXT: fcvt s2, h6
2033 ; CHECK-CVT-NEXT: fcvtzu x12, s4
2034 ; CHECK-CVT-NEXT: fcvt s3, h7
2035 ; CHECK-CVT-NEXT: cmp x9, x8
2036 ; CHECK-CVT-NEXT: fcvtzu x14, s1
2037 ; CHECK-CVT-NEXT: csel x4, x9, x8, lo
2038 ; CHECK-CVT-NEXT: cmp x10, x8
2039 ; CHECK-CVT-NEXT: fcvtzu x9, s2
2040 ; CHECK-CVT-NEXT: csel x5, x10, x8, lo
2041 ; CHECK-CVT-NEXT: cmp x11, x8
2042 ; CHECK-CVT-NEXT: fcvtzu x10, s3
2043 ; CHECK-CVT-NEXT: csel x6, x11, x8, lo
2044 ; CHECK-CVT-NEXT: cmp x12, x8
2045 ; CHECK-CVT-NEXT: csel x7, x12, x8, lo
2046 ; CHECK-CVT-NEXT: cmp x13, x8
2047 ; CHECK-CVT-NEXT: csel x0, x13, x8, lo
2048 ; CHECK-CVT-NEXT: cmp x14, x8
2049 ; CHECK-CVT-NEXT: csel x1, x14, x8, lo
2050 ; CHECK-CVT-NEXT: cmp x9, x8
2051 ; CHECK-CVT-NEXT: csel x2, x9, x8, lo
2052 ; CHECK-CVT-NEXT: cmp x10, x8
2053 ; CHECK-CVT-NEXT: csel x3, x10, x8, lo
2054 ; CHECK-CVT-NEXT: ret
2056 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i50:
2057 ; CHECK-FP16: // %bb.0:
2058 ; CHECK-FP16-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2059 ; CHECK-FP16-NEXT: mov x8, #1125899906842623 // =0x3ffffffffffff
2060 ; CHECK-FP16-NEXT: fcvtzu x13, h0
2061 ; CHECK-FP16-NEXT: mov h2, v1.h[1]
2062 ; CHECK-FP16-NEXT: mov h3, v1.h[2]
2063 ; CHECK-FP16-NEXT: mov h4, v1.h[3]
2064 ; CHECK-FP16-NEXT: fcvtzu x9, h1
2065 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
2066 ; CHECK-FP16-NEXT: fcvtzu x10, h2
2067 ; CHECK-FP16-NEXT: fcvtzu x11, h3
2068 ; CHECK-FP16-NEXT: mov h2, v0.h[2]
2069 ; CHECK-FP16-NEXT: fcvtzu x12, h4
2070 ; CHECK-FP16-NEXT: mov h3, v0.h[3]
2071 ; CHECK-FP16-NEXT: cmp x9, x8
2072 ; CHECK-FP16-NEXT: fcvtzu x14, h1
2073 ; CHECK-FP16-NEXT: csel x4, x9, x8, lo
2074 ; CHECK-FP16-NEXT: cmp x10, x8
2075 ; CHECK-FP16-NEXT: fcvtzu x9, h2
2076 ; CHECK-FP16-NEXT: csel x5, x10, x8, lo
2077 ; CHECK-FP16-NEXT: cmp x11, x8
2078 ; CHECK-FP16-NEXT: fcvtzu x10, h3
2079 ; CHECK-FP16-NEXT: csel x6, x11, x8, lo
2080 ; CHECK-FP16-NEXT: cmp x12, x8
2081 ; CHECK-FP16-NEXT: csel x7, x12, x8, lo
2082 ; CHECK-FP16-NEXT: cmp x13, x8
2083 ; CHECK-FP16-NEXT: csel x0, x13, x8, lo
2084 ; CHECK-FP16-NEXT: cmp x14, x8
2085 ; CHECK-FP16-NEXT: csel x1, x14, x8, lo
2086 ; CHECK-FP16-NEXT: cmp x9, x8
2087 ; CHECK-FP16-NEXT: csel x2, x9, x8, lo
2088 ; CHECK-FP16-NEXT: cmp x10, x8
2089 ; CHECK-FP16-NEXT: csel x3, x10, x8, lo
2090 ; CHECK-FP16-NEXT: ret
2091 %x = call <8 x i50> @llvm.fptoui.sat.v8f16.v8i50(<8 x half> %f)
2095 define <8 x i64> @test_unsigned_v8f16_v8i64(<8 x half> %f) {
2096 ; CHECK-CVT-LABEL: test_unsigned_v8f16_v8i64:
2097 ; CHECK-CVT: // %bb.0:
2098 ; CHECK-CVT-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2099 ; CHECK-CVT-NEXT: mov h4, v0.h[2]
2100 ; CHECK-CVT-NEXT: mov h3, v0.h[1]
2101 ; CHECK-CVT-NEXT: mov h7, v0.h[3]
2102 ; CHECK-CVT-NEXT: fcvt s0, h0
2103 ; CHECK-CVT-NEXT: mov h2, v1.h[2]
2104 ; CHECK-CVT-NEXT: mov h5, v1.h[1]
2105 ; CHECK-CVT-NEXT: mov h6, v1.h[3]
2106 ; CHECK-CVT-NEXT: fcvt s1, h1
2107 ; CHECK-CVT-NEXT: fcvt s4, h4
2108 ; CHECK-CVT-NEXT: fcvt s3, h3
2109 ; CHECK-CVT-NEXT: fcvt s7, h7
2110 ; CHECK-CVT-NEXT: fcvtzu x9, s0
2111 ; CHECK-CVT-NEXT: fcvt s2, h2
2112 ; CHECK-CVT-NEXT: fcvt s5, h5
2113 ; CHECK-CVT-NEXT: fcvt s6, h6
2114 ; CHECK-CVT-NEXT: fcvtzu x8, s1
2115 ; CHECK-CVT-NEXT: fcvtzu x12, s4
2116 ; CHECK-CVT-NEXT: fcvtzu x11, s3
2117 ; CHECK-CVT-NEXT: fcvtzu x15, s7
2118 ; CHECK-CVT-NEXT: fmov d0, x9
2119 ; CHECK-CVT-NEXT: fcvtzu x10, s2
2120 ; CHECK-CVT-NEXT: fcvtzu x13, s5
2121 ; CHECK-CVT-NEXT: fcvtzu x14, s6
2122 ; CHECK-CVT-NEXT: fmov d2, x8
2123 ; CHECK-CVT-NEXT: fmov d1, x12
2124 ; CHECK-CVT-NEXT: mov v0.d[1], x11
2125 ; CHECK-CVT-NEXT: fmov d3, x10
2126 ; CHECK-CVT-NEXT: mov v2.d[1], x13
2127 ; CHECK-CVT-NEXT: mov v1.d[1], x15
2128 ; CHECK-CVT-NEXT: mov v3.d[1], x14
2129 ; CHECK-CVT-NEXT: ret
2131 ; CHECK-FP16-LABEL: test_unsigned_v8f16_v8i64:
2132 ; CHECK-FP16: // %bb.0:
2133 ; CHECK-FP16-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2134 ; CHECK-FP16-NEXT: mov h4, v0.h[2]
2135 ; CHECK-FP16-NEXT: mov h3, v0.h[1]
2136 ; CHECK-FP16-NEXT: mov h7, v0.h[3]
2137 ; CHECK-FP16-NEXT: fcvtzu x9, h0
2138 ; CHECK-FP16-NEXT: mov h2, v1.h[2]
2139 ; CHECK-FP16-NEXT: mov h5, v1.h[1]
2140 ; CHECK-FP16-NEXT: mov h6, v1.h[3]
2141 ; CHECK-FP16-NEXT: fcvtzu x8, h1
2142 ; CHECK-FP16-NEXT: fcvtzu x12, h4
2143 ; CHECK-FP16-NEXT: fcvtzu x11, h3
2144 ; CHECK-FP16-NEXT: fcvtzu x15, h7
2145 ; CHECK-FP16-NEXT: fmov d0, x9
2146 ; CHECK-FP16-NEXT: fcvtzu x10, h2
2147 ; CHECK-FP16-NEXT: fcvtzu x13, h5
2148 ; CHECK-FP16-NEXT: fcvtzu x14, h6
2149 ; CHECK-FP16-NEXT: fmov d2, x8
2150 ; CHECK-FP16-NEXT: fmov d1, x12
2151 ; CHECK-FP16-NEXT: mov v0.d[1], x11
2152 ; CHECK-FP16-NEXT: fmov d3, x10
2153 ; CHECK-FP16-NEXT: mov v2.d[1], x13
2154 ; CHECK-FP16-NEXT: mov v1.d[1], x15
2155 ; CHECK-FP16-NEXT: mov v3.d[1], x14
2156 ; CHECK-FP16-NEXT: ret
2157 %x = call <8 x i64> @llvm.fptoui.sat.v8f16.v8i64(<8 x half> %f)
2161 define <8 x i100> @test_unsigned_v8f16_v8i100(<8 x half> %f) {
2162 ; CHECK-LABEL: test_unsigned_v8f16_v8i100:
2164 ; CHECK-NEXT: sub sp, sp, #176
2165 ; CHECK-NEXT: stp d9, d8, [sp, #64] // 16-byte Folded Spill
2166 ; CHECK-NEXT: stp x29, x30, [sp, #80] // 16-byte Folded Spill
2167 ; CHECK-NEXT: stp x28, x27, [sp, #96] // 16-byte Folded Spill
2168 ; CHECK-NEXT: stp x26, x25, [sp, #112] // 16-byte Folded Spill
2169 ; CHECK-NEXT: stp x24, x23, [sp, #128] // 16-byte Folded Spill
2170 ; CHECK-NEXT: stp x22, x21, [sp, #144] // 16-byte Folded Spill
2171 ; CHECK-NEXT: stp x20, x19, [sp, #160] // 16-byte Folded Spill
2172 ; CHECK-NEXT: .cfi_def_cfa_offset 176
2173 ; CHECK-NEXT: .cfi_offset w19, -8
2174 ; CHECK-NEXT: .cfi_offset w20, -16
2175 ; CHECK-NEXT: .cfi_offset w21, -24
2176 ; CHECK-NEXT: .cfi_offset w22, -32
2177 ; CHECK-NEXT: .cfi_offset w23, -40
2178 ; CHECK-NEXT: .cfi_offset w24, -48
2179 ; CHECK-NEXT: .cfi_offset w25, -56
2180 ; CHECK-NEXT: .cfi_offset w26, -64
2181 ; CHECK-NEXT: .cfi_offset w27, -72
2182 ; CHECK-NEXT: .cfi_offset w28, -80
2183 ; CHECK-NEXT: .cfi_offset w30, -88
2184 ; CHECK-NEXT: .cfi_offset w29, -96
2185 ; CHECK-NEXT: .cfi_offset b8, -104
2186 ; CHECK-NEXT: .cfi_offset b9, -112
2187 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2188 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
2189 ; CHECK-NEXT: mov x19, x8
2190 ; CHECK-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2191 ; CHECK-NEXT: mov h0, v0.h[1]
2192 ; CHECK-NEXT: fcvt s8, h0
2193 ; CHECK-NEXT: fmov s0, s8
2194 ; CHECK-NEXT: bl __fixunssfti
2195 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2196 ; CHECK-NEXT: mov w8, #1904214015 // =0x717fffff
2197 ; CHECK-NEXT: fcmp s8, #0.0
2198 ; CHECK-NEXT: fmov s9, w8
2199 ; CHECK-NEXT: mov x22, #68719476735 // =0xfffffffff
2200 ; CHECK-NEXT: mov h0, v0.h[3]
2201 ; CHECK-NEXT: csel x9, xzr, x0, lt
2202 ; CHECK-NEXT: csel x8, xzr, x1, lt
2203 ; CHECK-NEXT: fcmp s8, s9
2204 ; CHECK-NEXT: fcvt s8, h0
2205 ; CHECK-NEXT: csel x10, x22, x8, gt
2206 ; CHECK-NEXT: csinv x8, x9, xzr, le
2207 ; CHECK-NEXT: stp x8, x10, [sp, #16] // 16-byte Folded Spill
2208 ; CHECK-NEXT: fmov s0, s8
2209 ; CHECK-NEXT: bl __fixunssfti
2210 ; CHECK-NEXT: fcmp s8, #0.0
2211 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2212 ; CHECK-NEXT: csel x8, xzr, x0, lt
2213 ; CHECK-NEXT: csel x9, xzr, x1, lt
2214 ; CHECK-NEXT: fcmp s8, s9
2215 ; CHECK-NEXT: fcvt s8, h0
2216 ; CHECK-NEXT: csel x9, x22, x9, gt
2217 ; CHECK-NEXT: csinv x24, x8, xzr, le
2218 ; CHECK-NEXT: str x9, [sp, #8] // 8-byte Folded Spill
2219 ; CHECK-NEXT: fmov s0, s8
2220 ; CHECK-NEXT: bl __fixunssfti
2221 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2222 ; CHECK-NEXT: fcmp s8, #0.0
2223 ; CHECK-NEXT: mov h0, v0.h[2]
2224 ; CHECK-NEXT: csel x8, xzr, x0, lt
2225 ; CHECK-NEXT: csel x9, xzr, x1, lt
2226 ; CHECK-NEXT: fcmp s8, s9
2227 ; CHECK-NEXT: fcvt s8, h0
2228 ; CHECK-NEXT: csinv x8, x8, xzr, le
2229 ; CHECK-NEXT: csel x25, x22, x9, gt
2230 ; CHECK-NEXT: str x8, [sp, #32] // 8-byte Folded Spill
2231 ; CHECK-NEXT: fmov s0, s8
2232 ; CHECK-NEXT: bl __fixunssfti
2233 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2234 ; CHECK-NEXT: fcmp s8, #0.0
2235 ; CHECK-NEXT: mov h0, v0.h[1]
2236 ; CHECK-NEXT: csel x8, xzr, x0, lt
2237 ; CHECK-NEXT: csel x9, xzr, x1, lt
2238 ; CHECK-NEXT: fcmp s8, s9
2239 ; CHECK-NEXT: fcvt s8, h0
2240 ; CHECK-NEXT: csinv x8, x8, xzr, le
2241 ; CHECK-NEXT: csel x26, x22, x9, gt
2242 ; CHECK-NEXT: str x8, [sp] // 8-byte Folded Spill
2243 ; CHECK-NEXT: fmov s0, s8
2244 ; CHECK-NEXT: bl __fixunssfti
2245 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2246 ; CHECK-NEXT: fcmp s8, #0.0
2247 ; CHECK-NEXT: mov h0, v0.h[3]
2248 ; CHECK-NEXT: csel x8, xzr, x0, lt
2249 ; CHECK-NEXT: csel x9, xzr, x1, lt
2250 ; CHECK-NEXT: fcmp s8, s9
2251 ; CHECK-NEXT: fcvt s8, h0
2252 ; CHECK-NEXT: csel x29, x22, x9, gt
2253 ; CHECK-NEXT: csinv x27, x8, xzr, le
2254 ; CHECK-NEXT: fmov s0, s8
2255 ; CHECK-NEXT: bl __fixunssfti
2256 ; CHECK-NEXT: fcmp s8, #0.0
2257 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2258 ; CHECK-NEXT: csel x8, xzr, x0, lt
2259 ; CHECK-NEXT: csel x9, xzr, x1, lt
2260 ; CHECK-NEXT: fcmp s8, s9
2261 ; CHECK-NEXT: fcvt s8, h0
2262 ; CHECK-NEXT: csel x20, x22, x9, gt
2263 ; CHECK-NEXT: csinv x21, x8, xzr, le
2264 ; CHECK-NEXT: fmov s0, s8
2265 ; CHECK-NEXT: bl __fixunssfti
2266 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2267 ; CHECK-NEXT: fcmp s8, #0.0
2268 ; CHECK-NEXT: mov h0, v0.h[2]
2269 ; CHECK-NEXT: csel x8, xzr, x0, lt
2270 ; CHECK-NEXT: csel x9, xzr, x1, lt
2271 ; CHECK-NEXT: fcmp s8, s9
2272 ; CHECK-NEXT: fcvt s8, h0
2273 ; CHECK-NEXT: csel x28, x22, x9, gt
2274 ; CHECK-NEXT: csinv x23, x8, xzr, le
2275 ; CHECK-NEXT: fmov s0, s8
2276 ; CHECK-NEXT: bl __fixunssfti
2277 ; CHECK-NEXT: ldr x9, [sp] // 8-byte Folded Reload
2278 ; CHECK-NEXT: extr x8, x20, x21, #28
2279 ; CHECK-NEXT: fcmp s8, #0.0
2280 ; CHECK-NEXT: bfi x28, x27, #36, #28
2281 ; CHECK-NEXT: lsr x11, x29, #28
2282 ; CHECK-NEXT: bfi x26, x24, #36, #28
2283 ; CHECK-NEXT: stur x9, [x19, #75]
2284 ; CHECK-NEXT: extr x9, x29, x27, #28
2285 ; CHECK-NEXT: stur x8, [x19, #41]
2286 ; CHECK-NEXT: csel x8, xzr, x0, lt
2287 ; CHECK-NEXT: str x9, [x19, #16]
2288 ; CHECK-NEXT: csel x9, xzr, x1, lt
2289 ; CHECK-NEXT: fcmp s8, s9
2290 ; CHECK-NEXT: ldr x10, [sp, #32] // 8-byte Folded Reload
2291 ; CHECK-NEXT: stp x23, x28, [x19]
2292 ; CHECK-NEXT: strb w11, [x19, #24]
2293 ; CHECK-NEXT: stur x10, [x19, #50]
2294 ; CHECK-NEXT: lsr x10, x20, #28
2295 ; CHECK-NEXT: csel x9, x22, x9, gt
2296 ; CHECK-NEXT: bfi x9, x21, #36, #28
2297 ; CHECK-NEXT: csinv x8, x8, xzr, le
2298 ; CHECK-NEXT: strb w10, [x19, #49]
2299 ; CHECK-NEXT: ldr x11, [sp, #8] // 8-byte Folded Reload
2300 ; CHECK-NEXT: stur x8, [x19, #25]
2301 ; CHECK-NEXT: stur x9, [x19, #33]
2302 ; CHECK-NEXT: extr x10, x11, x24, #28
2303 ; CHECK-NEXT: stur x10, [x19, #91]
2304 ; CHECK-NEXT: ldp x10, x9, [sp, #16] // 16-byte Folded Reload
2305 ; CHECK-NEXT: stur x26, [x19, #83]
2306 ; CHECK-NEXT: extr x8, x9, x10, #28
2307 ; CHECK-NEXT: bfi x25, x10, #36, #28
2308 ; CHECK-NEXT: lsr x9, x9, #28
2309 ; CHECK-NEXT: stur x8, [x19, #66]
2310 ; CHECK-NEXT: lsr x8, x11, #28
2311 ; CHECK-NEXT: stur x25, [x19, #58]
2312 ; CHECK-NEXT: strb w8, [x19, #99]
2313 ; CHECK-NEXT: strb w9, [x19, #74]
2314 ; CHECK-NEXT: ldp x20, x19, [sp, #160] // 16-byte Folded Reload
2315 ; CHECK-NEXT: ldp x22, x21, [sp, #144] // 16-byte Folded Reload
2316 ; CHECK-NEXT: ldp x24, x23, [sp, #128] // 16-byte Folded Reload
2317 ; CHECK-NEXT: ldp x26, x25, [sp, #112] // 16-byte Folded Reload
2318 ; CHECK-NEXT: ldp x28, x27, [sp, #96] // 16-byte Folded Reload
2319 ; CHECK-NEXT: ldp x29, x30, [sp, #80] // 16-byte Folded Reload
2320 ; CHECK-NEXT: ldp d9, d8, [sp, #64] // 16-byte Folded Reload
2321 ; CHECK-NEXT: add sp, sp, #176
2323 %x = call <8 x i100> @llvm.fptoui.sat.v8f16.v8i100(<8 x half> %f)
2327 define <8 x i128> @test_unsigned_v8f16_v8i128(<8 x half> %f) {
2328 ; CHECK-LABEL: test_unsigned_v8f16_v8i128:
2330 ; CHECK-NEXT: sub sp, sp, #176
2331 ; CHECK-NEXT: stp d9, d8, [sp, #64] // 16-byte Folded Spill
2332 ; CHECK-NEXT: stp x29, x30, [sp, #80] // 16-byte Folded Spill
2333 ; CHECK-NEXT: stp x28, x27, [sp, #96] // 16-byte Folded Spill
2334 ; CHECK-NEXT: stp x26, x25, [sp, #112] // 16-byte Folded Spill
2335 ; CHECK-NEXT: stp x24, x23, [sp, #128] // 16-byte Folded Spill
2336 ; CHECK-NEXT: stp x22, x21, [sp, #144] // 16-byte Folded Spill
2337 ; CHECK-NEXT: stp x20, x19, [sp, #160] // 16-byte Folded Spill
2338 ; CHECK-NEXT: .cfi_def_cfa_offset 176
2339 ; CHECK-NEXT: .cfi_offset w19, -8
2340 ; CHECK-NEXT: .cfi_offset w20, -16
2341 ; CHECK-NEXT: .cfi_offset w21, -24
2342 ; CHECK-NEXT: .cfi_offset w22, -32
2343 ; CHECK-NEXT: .cfi_offset w23, -40
2344 ; CHECK-NEXT: .cfi_offset w24, -48
2345 ; CHECK-NEXT: .cfi_offset w25, -56
2346 ; CHECK-NEXT: .cfi_offset w26, -64
2347 ; CHECK-NEXT: .cfi_offset w27, -72
2348 ; CHECK-NEXT: .cfi_offset w28, -80
2349 ; CHECK-NEXT: .cfi_offset w30, -88
2350 ; CHECK-NEXT: .cfi_offset w29, -96
2351 ; CHECK-NEXT: .cfi_offset b8, -104
2352 ; CHECK-NEXT: .cfi_offset b9, -112
2353 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2354 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
2355 ; CHECK-NEXT: mov x19, x8
2356 ; CHECK-NEXT: fcvt s8, h0
2357 ; CHECK-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2358 ; CHECK-NEXT: fmov s0, s8
2359 ; CHECK-NEXT: bl __fixunssfti
2360 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2361 ; CHECK-NEXT: mov w8, #2139095039 // =0x7f7fffff
2362 ; CHECK-NEXT: fcmp s8, #0.0
2363 ; CHECK-NEXT: fmov s9, w8
2364 ; CHECK-NEXT: mov h0, v0.h[1]
2365 ; CHECK-NEXT: csel x9, xzr, x1, lt
2366 ; CHECK-NEXT: csel x8, xzr, x0, lt
2367 ; CHECK-NEXT: fcmp s8, s9
2368 ; CHECK-NEXT: fcvt s8, h0
2369 ; CHECK-NEXT: csinv x10, x8, xzr, le
2370 ; CHECK-NEXT: csinv x8, x9, xzr, le
2371 ; CHECK-NEXT: stp x8, x10, [sp, #16] // 16-byte Folded Spill
2372 ; CHECK-NEXT: fmov s0, s8
2373 ; CHECK-NEXT: bl __fixunssfti
2374 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2375 ; CHECK-NEXT: fcmp s8, #0.0
2376 ; CHECK-NEXT: mov h0, v0.h[2]
2377 ; CHECK-NEXT: csel x8, xzr, x1, lt
2378 ; CHECK-NEXT: csel x9, xzr, x0, lt
2379 ; CHECK-NEXT: fcmp s8, s9
2380 ; CHECK-NEXT: fcvt s8, h0
2381 ; CHECK-NEXT: csinv x9, x9, xzr, le
2382 ; CHECK-NEXT: csinv x8, x8, xzr, le
2383 ; CHECK-NEXT: stp x8, x9, [sp] // 16-byte Folded Spill
2384 ; CHECK-NEXT: fmov s0, s8
2385 ; CHECK-NEXT: bl __fixunssfti
2386 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2387 ; CHECK-NEXT: fcmp s8, #0.0
2388 ; CHECK-NEXT: mov h0, v0.h[3]
2389 ; CHECK-NEXT: csel x8, xzr, x1, lt
2390 ; CHECK-NEXT: csel x9, xzr, x0, lt
2391 ; CHECK-NEXT: fcmp s8, s9
2392 ; CHECK-NEXT: fcvt s8, h0
2393 ; CHECK-NEXT: csinv x24, x9, xzr, le
2394 ; CHECK-NEXT: csinv x25, x8, xzr, le
2395 ; CHECK-NEXT: fmov s0, s8
2396 ; CHECK-NEXT: bl __fixunssfti
2397 ; CHECK-NEXT: fcmp s8, #0.0
2398 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2399 ; CHECK-NEXT: csel x8, xzr, x1, lt
2400 ; CHECK-NEXT: csel x9, xzr, x0, lt
2401 ; CHECK-NEXT: fcmp s8, s9
2402 ; CHECK-NEXT: fcvt s8, h0
2403 ; CHECK-NEXT: csinv x26, x9, xzr, le
2404 ; CHECK-NEXT: csinv x27, x8, xzr, le
2405 ; CHECK-NEXT: fmov s0, s8
2406 ; CHECK-NEXT: bl __fixunssfti
2407 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2408 ; CHECK-NEXT: fcmp s8, #0.0
2409 ; CHECK-NEXT: mov h0, v0.h[1]
2410 ; CHECK-NEXT: csel x8, xzr, x1, lt
2411 ; CHECK-NEXT: csel x9, xzr, x0, lt
2412 ; CHECK-NEXT: fcmp s8, s9
2413 ; CHECK-NEXT: fcvt s8, h0
2414 ; CHECK-NEXT: csinv x28, x9, xzr, le
2415 ; CHECK-NEXT: csinv x29, x8, xzr, le
2416 ; CHECK-NEXT: fmov s0, s8
2417 ; CHECK-NEXT: bl __fixunssfti
2418 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2419 ; CHECK-NEXT: fcmp s8, #0.0
2420 ; CHECK-NEXT: mov h0, v0.h[2]
2421 ; CHECK-NEXT: csel x8, xzr, x1, lt
2422 ; CHECK-NEXT: csel x9, xzr, x0, lt
2423 ; CHECK-NEXT: fcmp s8, s9
2424 ; CHECK-NEXT: fcvt s8, h0
2425 ; CHECK-NEXT: csinv x20, x9, xzr, le
2426 ; CHECK-NEXT: csinv x21, x8, xzr, le
2427 ; CHECK-NEXT: fmov s0, s8
2428 ; CHECK-NEXT: bl __fixunssfti
2429 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2430 ; CHECK-NEXT: fcmp s8, #0.0
2431 ; CHECK-NEXT: mov h0, v0.h[3]
2432 ; CHECK-NEXT: csel x8, xzr, x1, lt
2433 ; CHECK-NEXT: csel x9, xzr, x0, lt
2434 ; CHECK-NEXT: fcmp s8, s9
2435 ; CHECK-NEXT: fcvt s8, h0
2436 ; CHECK-NEXT: csinv x22, x9, xzr, le
2437 ; CHECK-NEXT: csinv x23, x8, xzr, le
2438 ; CHECK-NEXT: fmov s0, s8
2439 ; CHECK-NEXT: bl __fixunssfti
2440 ; CHECK-NEXT: fcmp s8, #0.0
2441 ; CHECK-NEXT: stp x22, x23, [x19, #32]
2442 ; CHECK-NEXT: stp x20, x21, [x19, #16]
2443 ; CHECK-NEXT: stp x28, x29, [x19]
2444 ; CHECK-NEXT: csel x8, xzr, x1, lt
2445 ; CHECK-NEXT: csel x9, xzr, x0, lt
2446 ; CHECK-NEXT: fcmp s8, s9
2447 ; CHECK-NEXT: stp x26, x27, [x19, #112]
2448 ; CHECK-NEXT: stp x24, x25, [x19, #96]
2449 ; CHECK-NEXT: csinv x8, x8, xzr, le
2450 ; CHECK-NEXT: csinv x9, x9, xzr, le
2451 ; CHECK-NEXT: stp x9, x8, [x19, #48]
2452 ; CHECK-NEXT: ldr x8, [sp] // 8-byte Folded Reload
2453 ; CHECK-NEXT: str x8, [x19, #88]
2454 ; CHECK-NEXT: ldr x8, [sp, #8] // 8-byte Folded Reload
2455 ; CHECK-NEXT: str x8, [x19, #80]
2456 ; CHECK-NEXT: ldr x8, [sp, #16] // 8-byte Folded Reload
2457 ; CHECK-NEXT: str x8, [x19, #72]
2458 ; CHECK-NEXT: ldr x8, [sp, #24] // 8-byte Folded Reload
2459 ; CHECK-NEXT: str x8, [x19, #64]
2460 ; CHECK-NEXT: ldp x20, x19, [sp, #160] // 16-byte Folded Reload
2461 ; CHECK-NEXT: ldp x22, x21, [sp, #144] // 16-byte Folded Reload
2462 ; CHECK-NEXT: ldp x24, x23, [sp, #128] // 16-byte Folded Reload
2463 ; CHECK-NEXT: ldp x26, x25, [sp, #112] // 16-byte Folded Reload
2464 ; CHECK-NEXT: ldp x28, x27, [sp, #96] // 16-byte Folded Reload
2465 ; CHECK-NEXT: ldp x29, x30, [sp, #80] // 16-byte Folded Reload
2466 ; CHECK-NEXT: ldp d9, d8, [sp, #64] // 16-byte Folded Reload
2467 ; CHECK-NEXT: add sp, sp, #176
2469 %x = call <8 x i128> @llvm.fptoui.sat.v8f16.v8i128(<8 x half> %f)
2474 declare <8 x i8> @llvm.fptoui.sat.v8f32.v8i8(<8 x float> %f)
2475 declare <8 x i16> @llvm.fptoui.sat.v8f32.v8i16(<8 x float> %f)
2476 declare <16 x i8> @llvm.fptoui.sat.v16f32.v16i8(<16 x float> %f)
2477 declare <16 x i16> @llvm.fptoui.sat.v16f32.v16i16(<16 x float> %f)
2479 declare <16 x i8> @llvm.fptoui.sat.v16f16.v16i8(<16 x half> %f)
2480 declare <16 x i16> @llvm.fptoui.sat.v16f16.v16i16(<16 x half> %f)
2482 declare <8 x i8> @llvm.fptoui.sat.v8f64.v8i8(<8 x double> %f)
2483 declare <8 x i16> @llvm.fptoui.sat.v8f64.v8i16(<8 x double> %f)
2484 declare <16 x i8> @llvm.fptoui.sat.v16f64.v16i8(<16 x double> %f)
2485 declare <16 x i16> @llvm.fptoui.sat.v16f64.v16i16(<16 x double> %f)
2487 define <8 x i8> @test_unsigned_v8f32_v8i8(<8 x float> %f) {
2488 ; CHECK-LABEL: test_unsigned_v8f32_v8i8:
2490 ; CHECK-NEXT: movi v2.2d, #0x0000ff000000ff
2491 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
2492 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
2493 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
2494 ; CHECK-NEXT: umin v0.4s, v0.4s, v2.4s
2495 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2496 ; CHECK-NEXT: xtn v0.8b, v0.8h
2498 %x = call <8 x i8> @llvm.fptoui.sat.v8f32.v8i8(<8 x float> %f)
2502 define <16 x i8> @test_unsigned_v16f32_v16i8(<16 x float> %f) {
2503 ; CHECK-LABEL: test_unsigned_v16f32_v16i8:
2505 ; CHECK-NEXT: movi v4.2d, #0x0000ff000000ff
2506 ; CHECK-NEXT: fcvtzu v3.4s, v3.4s
2507 ; CHECK-NEXT: fcvtzu v2.4s, v2.4s
2508 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
2509 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
2510 ; CHECK-NEXT: umin v3.4s, v3.4s, v4.4s
2511 ; CHECK-NEXT: umin v2.4s, v2.4s, v4.4s
2512 ; CHECK-NEXT: umin v1.4s, v1.4s, v4.4s
2513 ; CHECK-NEXT: umin v0.4s, v0.4s, v4.4s
2514 ; CHECK-NEXT: uzp1 v2.8h, v2.8h, v3.8h
2515 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2516 ; CHECK-NEXT: uzp1 v0.16b, v0.16b, v2.16b
2518 %x = call <16 x i8> @llvm.fptoui.sat.v16f32.v16i8(<16 x float> %f)
2522 define <8 x i16> @test_unsigned_v8f32_v8i16(<8 x float> %f) {
2523 ; CHECK-LABEL: test_unsigned_v8f32_v8i16:
2525 ; CHECK-NEXT: movi v2.2d, #0x00ffff0000ffff
2526 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
2527 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
2528 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
2529 ; CHECK-NEXT: umin v0.4s, v0.4s, v2.4s
2530 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2532 %x = call <8 x i16> @llvm.fptoui.sat.v8f32.v8i16(<8 x float> %f)
2536 define <16 x i16> @test_unsigned_v16f32_v16i16(<16 x float> %f) {
2537 ; CHECK-LABEL: test_unsigned_v16f32_v16i16:
2539 ; CHECK-NEXT: movi v4.2d, #0x00ffff0000ffff
2540 ; CHECK-NEXT: fcvtzu v1.4s, v1.4s
2541 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
2542 ; CHECK-NEXT: fcvtzu v3.4s, v3.4s
2543 ; CHECK-NEXT: fcvtzu v2.4s, v2.4s
2544 ; CHECK-NEXT: umin v1.4s, v1.4s, v4.4s
2545 ; CHECK-NEXT: umin v0.4s, v0.4s, v4.4s
2546 ; CHECK-NEXT: umin v3.4s, v3.4s, v4.4s
2547 ; CHECK-NEXT: umin v2.4s, v2.4s, v4.4s
2548 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2549 ; CHECK-NEXT: uzp1 v1.8h, v2.8h, v3.8h
2551 %x = call <16 x i16> @llvm.fptoui.sat.v16f32.v16i16(<16 x float> %f)
2557 define <16 x i8> @test_unsigned_v16f16_v16i8(<16 x half> %f) {
2558 ; CHECK-CVT-LABEL: test_unsigned_v16f16_v16i8:
2559 ; CHECK-CVT: // %bb.0:
2560 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v1.8h
2561 ; CHECK-CVT-NEXT: fcvtl v1.4s, v1.4h
2562 ; CHECK-CVT-NEXT: mov w8, #255 // =0xff
2563 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
2564 ; CHECK-CVT-NEXT: mov s4, v2.s[2]
2565 ; CHECK-CVT-NEXT: mov s5, v2.s[3]
2566 ; CHECK-CVT-NEXT: fcvtzu w10, s2
2567 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
2568 ; CHECK-CVT-NEXT: fcvtzu w13, s1
2569 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2570 ; CHECK-CVT-NEXT: fcvtzu w9, s3
2571 ; CHECK-CVT-NEXT: mov s3, v1.s[1]
2572 ; CHECK-CVT-NEXT: fcvtzu w11, s4
2573 ; CHECK-CVT-NEXT: mov s4, v1.s[2]
2574 ; CHECK-CVT-NEXT: fcvtzu w12, s5
2575 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
2576 ; CHECK-CVT-NEXT: fcvtzu w18, s2
2577 ; CHECK-CVT-NEXT: fcvtzu w3, s0
2578 ; CHECK-CVT-NEXT: fcvtzu w14, s3
2579 ; CHECK-CVT-NEXT: cmp w9, #255
2580 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
2581 ; CHECK-CVT-NEXT: csel w9, w9, w8, lo
2582 ; CHECK-CVT-NEXT: cmp w10, #255
2583 ; CHECK-CVT-NEXT: fcvtzu w15, s4
2584 ; CHECK-CVT-NEXT: csel w10, w10, w8, lo
2585 ; CHECK-CVT-NEXT: cmp w11, #255
2586 ; CHECK-CVT-NEXT: mov s4, v2.s[2]
2587 ; CHECK-CVT-NEXT: csel w11, w11, w8, lo
2588 ; CHECK-CVT-NEXT: cmp w12, #255
2589 ; CHECK-CVT-NEXT: fcvtzu w16, s1
2590 ; CHECK-CVT-NEXT: mov s1, v2.s[3]
2591 ; CHECK-CVT-NEXT: csel w12, w12, w8, lo
2592 ; CHECK-CVT-NEXT: cmp w14, #255
2593 ; CHECK-CVT-NEXT: fcvtzu w17, s3
2594 ; CHECK-CVT-NEXT: mov s3, v0.s[1]
2595 ; CHECK-CVT-NEXT: csel w14, w14, w8, lo
2596 ; CHECK-CVT-NEXT: cmp w13, #255
2597 ; CHECK-CVT-NEXT: fcvtzu w0, s4
2598 ; CHECK-CVT-NEXT: fmov s2, w10
2599 ; CHECK-CVT-NEXT: csel w13, w13, w8, lo
2600 ; CHECK-CVT-NEXT: cmp w15, #255
2601 ; CHECK-CVT-NEXT: csel w15, w15, w8, lo
2602 ; CHECK-CVT-NEXT: cmp w16, #255
2603 ; CHECK-CVT-NEXT: fcvtzu w1, s1
2604 ; CHECK-CVT-NEXT: csel w16, w16, w8, lo
2605 ; CHECK-CVT-NEXT: cmp w17, #255
2606 ; CHECK-CVT-NEXT: fcvtzu w2, s3
2607 ; CHECK-CVT-NEXT: csel w17, w17, w8, lo
2608 ; CHECK-CVT-NEXT: cmp w18, #255
2609 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
2610 ; CHECK-CVT-NEXT: csel w18, w18, w8, lo
2611 ; CHECK-CVT-NEXT: cmp w0, #255
2612 ; CHECK-CVT-NEXT: mov v2.s[1], w9
2613 ; CHECK-CVT-NEXT: csel w0, w0, w8, lo
2614 ; CHECK-CVT-NEXT: cmp w1, #255
2615 ; CHECK-CVT-NEXT: fmov s3, w18
2616 ; CHECK-CVT-NEXT: csel w10, w1, w8, lo
2617 ; CHECK-CVT-NEXT: cmp w2, #255
2618 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2619 ; CHECK-CVT-NEXT: csel w9, w2, w8, lo
2620 ; CHECK-CVT-NEXT: cmp w3, #255
2621 ; CHECK-CVT-NEXT: fcvtzu w2, s1
2622 ; CHECK-CVT-NEXT: csel w1, w3, w8, lo
2623 ; CHECK-CVT-NEXT: fmov s1, w13
2624 ; CHECK-CVT-NEXT: mov v3.s[1], w17
2625 ; CHECK-CVT-NEXT: fmov s4, w1
2626 ; CHECK-CVT-NEXT: mov v2.s[2], w11
2627 ; CHECK-CVT-NEXT: mov v1.s[1], w14
2628 ; CHECK-CVT-NEXT: cmp w2, #255
2629 ; CHECK-CVT-NEXT: mov v4.s[1], w9
2630 ; CHECK-CVT-NEXT: fcvtzu w9, s0
2631 ; CHECK-CVT-NEXT: csel w11, w2, w8, lo
2632 ; CHECK-CVT-NEXT: mov v3.s[2], w0
2633 ; CHECK-CVT-NEXT: mov v2.s[3], w12
2634 ; CHECK-CVT-NEXT: mov v1.s[2], w15
2635 ; CHECK-CVT-NEXT: mov v4.s[2], w11
2636 ; CHECK-CVT-NEXT: cmp w9, #255
2637 ; CHECK-CVT-NEXT: csel w8, w9, w8, lo
2638 ; CHECK-CVT-NEXT: mov v3.s[3], w10
2639 ; CHECK-CVT-NEXT: mov v1.s[3], w16
2640 ; CHECK-CVT-NEXT: mov v4.s[3], w8
2641 ; CHECK-CVT-NEXT: uzp1 v0.8h, v1.8h, v2.8h
2642 ; CHECK-CVT-NEXT: uzp1 v1.8h, v4.8h, v3.8h
2643 ; CHECK-CVT-NEXT: uzp1 v0.16b, v1.16b, v0.16b
2644 ; CHECK-CVT-NEXT: ret
2646 ; CHECK-FP16-LABEL: test_unsigned_v16f16_v16i8:
2647 ; CHECK-FP16: // %bb.0:
2648 ; CHECK-FP16-NEXT: movi v2.2d, #0xff00ff00ff00ff
2649 ; CHECK-FP16-NEXT: fcvtzu v1.8h, v1.8h
2650 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
2651 ; CHECK-FP16-NEXT: umin v1.8h, v1.8h, v2.8h
2652 ; CHECK-FP16-NEXT: umin v0.8h, v0.8h, v2.8h
2653 ; CHECK-FP16-NEXT: uzp1 v0.16b, v0.16b, v1.16b
2654 ; CHECK-FP16-NEXT: ret
2655 %x = call <16 x i8> @llvm.fptoui.sat.v16f16.v16i8(<16 x half> %f)
2659 define <16 x i16> @test_unsigned_v16f16_v16i16(<16 x half> %f) {
2660 ; CHECK-CVT-LABEL: test_unsigned_v16f16_v16i16:
2661 ; CHECK-CVT: // %bb.0:
2662 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
2663 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2664 ; CHECK-CVT-NEXT: mov w8, #65535 // =0xffff
2665 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
2666 ; CHECK-CVT-NEXT: mov s4, v2.s[2]
2667 ; CHECK-CVT-NEXT: mov s5, v2.s[3]
2668 ; CHECK-CVT-NEXT: fcvtzu w10, s2
2669 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v1.8h
2670 ; CHECK-CVT-NEXT: fcvtzu w13, s0
2671 ; CHECK-CVT-NEXT: fcvtl v1.4s, v1.4h
2672 ; CHECK-CVT-NEXT: fcvtzu w9, s3
2673 ; CHECK-CVT-NEXT: mov s3, v0.s[1]
2674 ; CHECK-CVT-NEXT: fcvtzu w11, s4
2675 ; CHECK-CVT-NEXT: mov s4, v0.s[2]
2676 ; CHECK-CVT-NEXT: fcvtzu w12, s5
2677 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2678 ; CHECK-CVT-NEXT: fcvtzu w18, s2
2679 ; CHECK-CVT-NEXT: fcvtzu w3, s1
2680 ; CHECK-CVT-NEXT: fcvtzu w14, s3
2681 ; CHECK-CVT-NEXT: cmp w9, w8
2682 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
2683 ; CHECK-CVT-NEXT: csel w9, w9, w8, lo
2684 ; CHECK-CVT-NEXT: cmp w10, w8
2685 ; CHECK-CVT-NEXT: fcvtzu w15, s4
2686 ; CHECK-CVT-NEXT: csel w10, w10, w8, lo
2687 ; CHECK-CVT-NEXT: cmp w11, w8
2688 ; CHECK-CVT-NEXT: mov s4, v2.s[2]
2689 ; CHECK-CVT-NEXT: csel w11, w11, w8, lo
2690 ; CHECK-CVT-NEXT: cmp w12, w8
2691 ; CHECK-CVT-NEXT: fcvtzu w16, s0
2692 ; CHECK-CVT-NEXT: mov s0, v2.s[3]
2693 ; CHECK-CVT-NEXT: csel w12, w12, w8, lo
2694 ; CHECK-CVT-NEXT: cmp w14, w8
2695 ; CHECK-CVT-NEXT: fcvtzu w17, s3
2696 ; CHECK-CVT-NEXT: mov s3, v1.s[1]
2697 ; CHECK-CVT-NEXT: csel w14, w14, w8, lo
2698 ; CHECK-CVT-NEXT: cmp w13, w8
2699 ; CHECK-CVT-NEXT: fcvtzu w0, s4
2700 ; CHECK-CVT-NEXT: fmov s2, w10
2701 ; CHECK-CVT-NEXT: csel w13, w13, w8, lo
2702 ; CHECK-CVT-NEXT: cmp w15, w8
2703 ; CHECK-CVT-NEXT: csel w15, w15, w8, lo
2704 ; CHECK-CVT-NEXT: cmp w16, w8
2705 ; CHECK-CVT-NEXT: fcvtzu w1, s0
2706 ; CHECK-CVT-NEXT: csel w16, w16, w8, lo
2707 ; CHECK-CVT-NEXT: cmp w17, w8
2708 ; CHECK-CVT-NEXT: fcvtzu w2, s3
2709 ; CHECK-CVT-NEXT: csel w17, w17, w8, lo
2710 ; CHECK-CVT-NEXT: cmp w18, w8
2711 ; CHECK-CVT-NEXT: mov s0, v1.s[2]
2712 ; CHECK-CVT-NEXT: csel w18, w18, w8, lo
2713 ; CHECK-CVT-NEXT: cmp w0, w8
2714 ; CHECK-CVT-NEXT: mov v2.s[1], w9
2715 ; CHECK-CVT-NEXT: csel w0, w0, w8, lo
2716 ; CHECK-CVT-NEXT: cmp w1, w8
2717 ; CHECK-CVT-NEXT: fmov s3, w18
2718 ; CHECK-CVT-NEXT: csel w10, w1, w8, lo
2719 ; CHECK-CVT-NEXT: cmp w2, w8
2720 ; CHECK-CVT-NEXT: csel w9, w2, w8, lo
2721 ; CHECK-CVT-NEXT: cmp w3, w8
2722 ; CHECK-CVT-NEXT: fcvtzu w2, s0
2723 ; CHECK-CVT-NEXT: csel w1, w3, w8, lo
2724 ; CHECK-CVT-NEXT: mov s0, v1.s[3]
2725 ; CHECK-CVT-NEXT: fmov s1, w13
2726 ; CHECK-CVT-NEXT: fmov s4, w1
2727 ; CHECK-CVT-NEXT: mov v3.s[1], w17
2728 ; CHECK-CVT-NEXT: mov v2.s[2], w11
2729 ; CHECK-CVT-NEXT: mov v1.s[1], w14
2730 ; CHECK-CVT-NEXT: cmp w2, w8
2731 ; CHECK-CVT-NEXT: mov v4.s[1], w9
2732 ; CHECK-CVT-NEXT: fcvtzu w9, s0
2733 ; CHECK-CVT-NEXT: csel w11, w2, w8, lo
2734 ; CHECK-CVT-NEXT: mov v3.s[2], w0
2735 ; CHECK-CVT-NEXT: mov v2.s[3], w12
2736 ; CHECK-CVT-NEXT: mov v1.s[2], w15
2737 ; CHECK-CVT-NEXT: mov v4.s[2], w11
2738 ; CHECK-CVT-NEXT: cmp w9, w8
2739 ; CHECK-CVT-NEXT: csel w8, w9, w8, lo
2740 ; CHECK-CVT-NEXT: mov v3.s[3], w10
2741 ; CHECK-CVT-NEXT: mov v1.s[3], w16
2742 ; CHECK-CVT-NEXT: mov v4.s[3], w8
2743 ; CHECK-CVT-NEXT: uzp1 v0.8h, v1.8h, v2.8h
2744 ; CHECK-CVT-NEXT: uzp1 v1.8h, v4.8h, v3.8h
2745 ; CHECK-CVT-NEXT: ret
2747 ; CHECK-FP16-LABEL: test_unsigned_v16f16_v16i16:
2748 ; CHECK-FP16: // %bb.0:
2749 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
2750 ; CHECK-FP16-NEXT: fcvtzu v1.8h, v1.8h
2751 ; CHECK-FP16-NEXT: ret
2752 %x = call <16 x i16> @llvm.fptoui.sat.v16f16.v16i16(<16 x half> %f)
2756 define <8 x i8> @test_unsigned_v8f64_v8i8(<8 x double> %f) {
2757 ; CHECK-LABEL: test_unsigned_v8f64_v8i8:
2759 ; CHECK-NEXT: mov d4, v3.d[1]
2760 ; CHECK-NEXT: mov d5, v2.d[1]
2761 ; CHECK-NEXT: mov w11, #255 // =0xff
2762 ; CHECK-NEXT: fcvtzu w9, d3
2763 ; CHECK-NEXT: mov d3, v1.d[1]
2764 ; CHECK-NEXT: fcvtzu w12, d2
2765 ; CHECK-NEXT: fcvtzu w14, d1
2766 ; CHECK-NEXT: fcvtzu w8, d4
2767 ; CHECK-NEXT: mov d4, v0.d[1]
2768 ; CHECK-NEXT: fcvtzu w10, d5
2769 ; CHECK-NEXT: fcvtzu w13, d3
2770 ; CHECK-NEXT: cmp w8, #255
2771 ; CHECK-NEXT: fcvtzu w15, d4
2772 ; CHECK-NEXT: csel w8, w8, w11, lo
2773 ; CHECK-NEXT: cmp w9, #255
2774 ; CHECK-NEXT: csel w9, w9, w11, lo
2775 ; CHECK-NEXT: cmp w10, #255
2776 ; CHECK-NEXT: fmov s4, w9
2777 ; CHECK-NEXT: csel w9, w10, w11, lo
2778 ; CHECK-NEXT: cmp w12, #255
2779 ; CHECK-NEXT: fcvtzu w10, d0
2780 ; CHECK-NEXT: mov v4.s[1], w8
2781 ; CHECK-NEXT: csel w8, w12, w11, lo
2782 ; CHECK-NEXT: cmp w13, #255
2783 ; CHECK-NEXT: fmov s3, w8
2784 ; CHECK-NEXT: csel w8, w13, w11, lo
2785 ; CHECK-NEXT: cmp w14, #255
2786 ; CHECK-NEXT: mov v3.s[1], w9
2787 ; CHECK-NEXT: csel w9, w14, w11, lo
2788 ; CHECK-NEXT: cmp w15, #255
2789 ; CHECK-NEXT: fmov s2, w9
2790 ; CHECK-NEXT: csel w9, w15, w11, lo
2791 ; CHECK-NEXT: cmp w10, #255
2792 ; CHECK-NEXT: mov v2.s[1], w8
2793 ; CHECK-NEXT: csel w8, w10, w11, lo
2794 ; CHECK-NEXT: fmov s1, w8
2795 ; CHECK-NEXT: adrp x8, .LCPI82_0
2796 ; CHECK-NEXT: ldr d0, [x8, :lo12:.LCPI82_0]
2797 ; CHECK-NEXT: mov v1.s[1], w9
2798 ; CHECK-NEXT: tbl v0.8b, { v1.16b, v2.16b, v3.16b, v4.16b }, v0.8b
2800 %x = call <8 x i8> @llvm.fptoui.sat.v8f64.v8i8(<8 x double> %f)
2804 define <16 x i8> @test_unsigned_v16f64_v16i8(<16 x double> %f) {
2805 ; CHECK-LABEL: test_unsigned_v16f64_v16i8:
2807 ; CHECK-NEXT: mov d16, v0.d[1]
2808 ; CHECK-NEXT: fcvtzu w10, d0
2809 ; CHECK-NEXT: mov w8, #255 // =0xff
2810 ; CHECK-NEXT: fcvtzu w9, d16
2811 ; CHECK-NEXT: mov d16, v1.d[1]
2812 ; CHECK-NEXT: cmp w9, #255
2813 ; CHECK-NEXT: csel w9, w9, w8, lo
2814 ; CHECK-NEXT: cmp w10, #255
2815 ; CHECK-NEXT: csel w10, w10, w8, lo
2816 ; CHECK-NEXT: fmov s0, w10
2817 ; CHECK-NEXT: fcvtzu w10, d16
2818 ; CHECK-NEXT: mov d16, v2.d[1]
2819 ; CHECK-NEXT: mov v0.s[1], w9
2820 ; CHECK-NEXT: fcvtzu w9, d1
2821 ; CHECK-NEXT: cmp w10, #255
2822 ; CHECK-NEXT: csel w10, w10, w8, lo
2823 ; CHECK-NEXT: cmp w9, #255
2824 ; CHECK-NEXT: mov w11, v0.s[1]
2825 ; CHECK-NEXT: csel w9, w9, w8, lo
2826 ; CHECK-NEXT: fmov s1, w9
2827 ; CHECK-NEXT: fcvtzu w9, d16
2828 ; CHECK-NEXT: mov d16, v3.d[1]
2829 ; CHECK-NEXT: mov v0.b[1], w11
2830 ; CHECK-NEXT: mov v1.s[1], w10
2831 ; CHECK-NEXT: fcvtzu w10, d2
2832 ; CHECK-NEXT: cmp w9, #255
2833 ; CHECK-NEXT: csel w9, w9, w8, lo
2834 ; CHECK-NEXT: cmp w10, #255
2835 ; CHECK-NEXT: mov w11, v1.s[1]
2836 ; CHECK-NEXT: mov v0.b[2], v1.b[0]
2837 ; CHECK-NEXT: csel w10, w10, w8, lo
2838 ; CHECK-NEXT: fmov s2, w10
2839 ; CHECK-NEXT: fcvtzu w10, d16
2840 ; CHECK-NEXT: mov d16, v4.d[1]
2841 ; CHECK-NEXT: mov v0.b[3], w11
2842 ; CHECK-NEXT: mov v2.s[1], w9
2843 ; CHECK-NEXT: fcvtzu w9, d3
2844 ; CHECK-NEXT: cmp w10, #255
2845 ; CHECK-NEXT: csel w10, w10, w8, lo
2846 ; CHECK-NEXT: cmp w9, #255
2847 ; CHECK-NEXT: mov w11, v2.s[1]
2848 ; CHECK-NEXT: mov v0.b[4], v2.b[0]
2849 ; CHECK-NEXT: csel w9, w9, w8, lo
2850 ; CHECK-NEXT: fmov s3, w9
2851 ; CHECK-NEXT: fcvtzu w9, d16
2852 ; CHECK-NEXT: mov v0.b[5], w11
2853 ; CHECK-NEXT: mov v3.s[1], w10
2854 ; CHECK-NEXT: fcvtzu w10, d4
2855 ; CHECK-NEXT: mov d4, v5.d[1]
2856 ; CHECK-NEXT: cmp w9, #255
2857 ; CHECK-NEXT: csel w9, w9, w8, lo
2858 ; CHECK-NEXT: cmp w10, #255
2859 ; CHECK-NEXT: mov w11, v3.s[1]
2860 ; CHECK-NEXT: mov v0.b[6], v3.b[0]
2861 ; CHECK-NEXT: csel w10, w10, w8, lo
2862 ; CHECK-NEXT: fmov s16, w10
2863 ; CHECK-NEXT: fcvtzu w10, d4
2864 ; CHECK-NEXT: mov d4, v6.d[1]
2865 ; CHECK-NEXT: mov v0.b[7], w11
2866 ; CHECK-NEXT: mov v16.s[1], w9
2867 ; CHECK-NEXT: fcvtzu w9, d5
2868 ; CHECK-NEXT: cmp w10, #255
2869 ; CHECK-NEXT: csel w10, w10, w8, lo
2870 ; CHECK-NEXT: cmp w9, #255
2871 ; CHECK-NEXT: mov w11, v16.s[1]
2872 ; CHECK-NEXT: mov v0.b[8], v16.b[0]
2873 ; CHECK-NEXT: csel w9, w9, w8, lo
2874 ; CHECK-NEXT: fmov s5, w9
2875 ; CHECK-NEXT: fcvtzu w9, d4
2876 ; CHECK-NEXT: mov d4, v7.d[1]
2877 ; CHECK-NEXT: mov v0.b[9], w11
2878 ; CHECK-NEXT: mov v5.s[1], w10
2879 ; CHECK-NEXT: fcvtzu w10, d6
2880 ; CHECK-NEXT: cmp w9, #255
2881 ; CHECK-NEXT: csel w9, w9, w8, lo
2882 ; CHECK-NEXT: cmp w10, #255
2883 ; CHECK-NEXT: mov v0.b[10], v5.b[0]
2884 ; CHECK-NEXT: mov w11, v5.s[1]
2885 ; CHECK-NEXT: csel w10, w10, w8, lo
2886 ; CHECK-NEXT: fmov s6, w10
2887 ; CHECK-NEXT: fcvtzu w10, d7
2888 ; CHECK-NEXT: mov v0.b[11], w11
2889 ; CHECK-NEXT: mov v6.s[1], w9
2890 ; CHECK-NEXT: fcvtzu w9, d4
2891 ; CHECK-NEXT: cmp w9, #255
2892 ; CHECK-NEXT: mov v0.b[12], v6.b[0]
2893 ; CHECK-NEXT: mov w11, v6.s[1]
2894 ; CHECK-NEXT: csel w9, w9, w8, lo
2895 ; CHECK-NEXT: cmp w10, #255
2896 ; CHECK-NEXT: csel w8, w10, w8, lo
2897 ; CHECK-NEXT: fmov s4, w8
2898 ; CHECK-NEXT: mov v0.b[13], w11
2899 ; CHECK-NEXT: mov v4.s[1], w9
2900 ; CHECK-NEXT: mov v0.b[14], v4.b[0]
2901 ; CHECK-NEXT: mov w8, v4.s[1]
2902 ; CHECK-NEXT: mov v0.b[15], w8
2904 %x = call <16 x i8> @llvm.fptoui.sat.v16f64.v16i8(<16 x double> %f)
2908 define <8 x i16> @test_unsigned_v8f64_v8i16(<8 x double> %f) {
2909 ; CHECK-LABEL: test_unsigned_v8f64_v8i16:
2911 ; CHECK-NEXT: mov d4, v3.d[1]
2912 ; CHECK-NEXT: mov d5, v2.d[1]
2913 ; CHECK-NEXT: mov w10, #65535 // =0xffff
2914 ; CHECK-NEXT: fcvtzu w9, d3
2915 ; CHECK-NEXT: mov d3, v1.d[1]
2916 ; CHECK-NEXT: fcvtzu w12, d2
2917 ; CHECK-NEXT: fcvtzu w14, d1
2918 ; CHECK-NEXT: fcvtzu w8, d4
2919 ; CHECK-NEXT: mov d4, v0.d[1]
2920 ; CHECK-NEXT: fcvtzu w11, d5
2921 ; CHECK-NEXT: fcvtzu w13, d3
2922 ; CHECK-NEXT: cmp w8, w10
2923 ; CHECK-NEXT: fcvtzu w15, d4
2924 ; CHECK-NEXT: csel w8, w8, w10, lo
2925 ; CHECK-NEXT: cmp w9, w10
2926 ; CHECK-NEXT: csel w9, w9, w10, lo
2927 ; CHECK-NEXT: cmp w11, w10
2928 ; CHECK-NEXT: fmov s4, w9
2929 ; CHECK-NEXT: csel w9, w11, w10, lo
2930 ; CHECK-NEXT: cmp w12, w10
2931 ; CHECK-NEXT: fcvtzu w11, d0
2932 ; CHECK-NEXT: mov v4.s[1], w8
2933 ; CHECK-NEXT: csel w8, w12, w10, lo
2934 ; CHECK-NEXT: cmp w13, w10
2935 ; CHECK-NEXT: fmov s3, w8
2936 ; CHECK-NEXT: csel w8, w13, w10, lo
2937 ; CHECK-NEXT: cmp w14, w10
2938 ; CHECK-NEXT: mov v3.s[1], w9
2939 ; CHECK-NEXT: csel w9, w14, w10, lo
2940 ; CHECK-NEXT: cmp w15, w10
2941 ; CHECK-NEXT: fmov s2, w9
2942 ; CHECK-NEXT: csel w9, w15, w10, lo
2943 ; CHECK-NEXT: cmp w11, w10
2944 ; CHECK-NEXT: mov v2.s[1], w8
2945 ; CHECK-NEXT: csel w8, w11, w10, lo
2946 ; CHECK-NEXT: fmov s1, w8
2947 ; CHECK-NEXT: adrp x8, .LCPI84_0
2948 ; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI84_0]
2949 ; CHECK-NEXT: mov v1.s[1], w9
2950 ; CHECK-NEXT: tbl v0.16b, { v1.16b, v2.16b, v3.16b, v4.16b }, v0.16b
2952 %x = call <8 x i16> @llvm.fptoui.sat.v8f64.v8i16(<8 x double> %f)
2956 define <16 x i16> @test_unsigned_v16f64_v16i16(<16 x double> %f) {
2957 ; CHECK-LABEL: test_unsigned_v16f64_v16i16:
2959 ; CHECK-NEXT: mov d16, v3.d[1]
2960 ; CHECK-NEXT: mov d17, v2.d[1]
2961 ; CHECK-NEXT: mov w8, #65535 // =0xffff
2962 ; CHECK-NEXT: fcvtzu w9, d3
2963 ; CHECK-NEXT: mov d3, v1.d[1]
2964 ; CHECK-NEXT: fcvtzu w11, d1
2965 ; CHECK-NEXT: mov d1, v0.d[1]
2966 ; CHECK-NEXT: fcvtzu w10, d2
2967 ; CHECK-NEXT: fcvtzu w13, d0
2968 ; CHECK-NEXT: mov d0, v7.d[1]
2969 ; CHECK-NEXT: mov d2, v6.d[1]
2970 ; CHECK-NEXT: fcvtzu w15, d7
2971 ; CHECK-NEXT: fcvtzu w12, d16
2972 ; CHECK-NEXT: fcvtzu w14, d17
2973 ; CHECK-NEXT: fcvtzu w16, d6
2974 ; CHECK-NEXT: fcvtzu w17, d3
2975 ; CHECK-NEXT: mov d6, v5.d[1]
2976 ; CHECK-NEXT: mov d3, v4.d[1]
2977 ; CHECK-NEXT: fcvtzu w18, d1
2978 ; CHECK-NEXT: cmp w12, w8
2979 ; CHECK-NEXT: csel w12, w12, w8, lo
2980 ; CHECK-NEXT: cmp w9, w8
2981 ; CHECK-NEXT: csel w9, w9, w8, lo
2982 ; CHECK-NEXT: cmp w14, w8
2983 ; CHECK-NEXT: fmov s19, w9
2984 ; CHECK-NEXT: csel w9, w14, w8, lo
2985 ; CHECK-NEXT: cmp w10, w8
2986 ; CHECK-NEXT: fcvtzu w14, d0
2987 ; CHECK-NEXT: csel w10, w10, w8, lo
2988 ; CHECK-NEXT: cmp w17, w8
2989 ; CHECK-NEXT: mov v19.s[1], w12
2990 ; CHECK-NEXT: csel w12, w17, w8, lo
2991 ; CHECK-NEXT: cmp w11, w8
2992 ; CHECK-NEXT: csel w11, w11, w8, lo
2993 ; CHECK-NEXT: cmp w18, w8
2994 ; CHECK-NEXT: fmov s18, w10
2995 ; CHECK-NEXT: csel w10, w18, w8, lo
2996 ; CHECK-NEXT: cmp w13, w8
2997 ; CHECK-NEXT: fcvtzu w17, d2
2998 ; CHECK-NEXT: csel w13, w13, w8, lo
2999 ; CHECK-NEXT: cmp w14, w8
3000 ; CHECK-NEXT: fcvtzu w18, d6
3001 ; CHECK-NEXT: mov v18.s[1], w9
3002 ; CHECK-NEXT: csel w9, w14, w8, lo
3003 ; CHECK-NEXT: cmp w15, w8
3004 ; CHECK-NEXT: fmov s17, w11
3005 ; CHECK-NEXT: csel w11, w15, w8, lo
3006 ; CHECK-NEXT: fcvtzu w14, d5
3007 ; CHECK-NEXT: fmov s23, w11
3008 ; CHECK-NEXT: cmp w17, w8
3009 ; CHECK-NEXT: fcvtzu w15, d3
3010 ; CHECK-NEXT: csel w11, w17, w8, lo
3011 ; CHECK-NEXT: cmp w16, w8
3012 ; CHECK-NEXT: fcvtzu w17, d4
3013 ; CHECK-NEXT: mov v17.s[1], w12
3014 ; CHECK-NEXT: mov v23.s[1], w9
3015 ; CHECK-NEXT: csel w9, w16, w8, lo
3016 ; CHECK-NEXT: cmp w18, w8
3017 ; CHECK-NEXT: fmov s22, w9
3018 ; CHECK-NEXT: csel w9, w18, w8, lo
3019 ; CHECK-NEXT: cmp w14, w8
3020 ; CHECK-NEXT: fmov s16, w13
3021 ; CHECK-NEXT: mov v22.s[1], w11
3022 ; CHECK-NEXT: csel w11, w14, w8, lo
3023 ; CHECK-NEXT: cmp w15, w8
3024 ; CHECK-NEXT: fmov s21, w11
3025 ; CHECK-NEXT: csel w11, w15, w8, lo
3026 ; CHECK-NEXT: cmp w17, w8
3027 ; CHECK-NEXT: csel w8, w17, w8, lo
3028 ; CHECK-NEXT: mov v16.s[1], w10
3029 ; CHECK-NEXT: mov v21.s[1], w9
3030 ; CHECK-NEXT: fmov s20, w8
3031 ; CHECK-NEXT: adrp x8, .LCPI85_0
3032 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI85_0]
3033 ; CHECK-NEXT: mov v20.s[1], w11
3034 ; CHECK-NEXT: tbl v0.16b, { v16.16b, v17.16b, v18.16b, v19.16b }, v1.16b
3035 ; CHECK-NEXT: tbl v1.16b, { v20.16b, v21.16b, v22.16b, v23.16b }, v1.16b
3037 %x = call <16 x i16> @llvm.fptoui.sat.v16f64.v16i16(<16 x double> %f)