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 signed 32-bit -- Vector size variation
9 declare <1 x i32> @llvm.fptosi.sat.v1f32.v1i32 (<1 x float>)
10 declare <2 x i32> @llvm.fptosi.sat.v2f32.v2i32 (<2 x float>)
11 declare <3 x i32> @llvm.fptosi.sat.v3f32.v3i32 (<3 x float>)
12 declare <4 x i32> @llvm.fptosi.sat.v4f32.v4i32 (<4 x float>)
13 declare <5 x i32> @llvm.fptosi.sat.v5f32.v5i32 (<5 x float>)
14 declare <6 x i32> @llvm.fptosi.sat.v6f32.v6i32 (<6 x float>)
15 declare <7 x i32> @llvm.fptosi.sat.v7f32.v7i32 (<7 x float>)
16 declare <8 x i32> @llvm.fptosi.sat.v8f32.v8i32 (<8 x float>)
18 define <1 x i32> @test_signed_v1f32_v1i32(<1 x float> %f) {
19 ; CHECK-LABEL: test_signed_v1f32_v1i32:
21 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
23 %x = call <1 x i32> @llvm.fptosi.sat.v1f32.v1i32(<1 x float> %f)
27 define <2 x i32> @test_signed_v2f32_v2i32(<2 x float> %f) {
28 ; CHECK-LABEL: test_signed_v2f32_v2i32:
30 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
32 %x = call <2 x i32> @llvm.fptosi.sat.v2f32.v2i32(<2 x float> %f)
36 define <3 x i32> @test_signed_v3f32_v3i32(<3 x float> %f) {
37 ; CHECK-LABEL: test_signed_v3f32_v3i32:
39 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
41 %x = call <3 x i32> @llvm.fptosi.sat.v3f32.v3i32(<3 x float> %f)
45 define <4 x i32> @test_signed_v4f32_v4i32(<4 x float> %f) {
46 ; CHECK-LABEL: test_signed_v4f32_v4i32:
48 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
50 %x = call <4 x i32> @llvm.fptosi.sat.v4f32.v4i32(<4 x float> %f)
54 define <5 x i32> @test_signed_v5f32_v5i32(<5 x float> %f) {
55 ; CHECK-LABEL: test_signed_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: fcvtzs 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: fcvtzs 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.fptosi.sat.v5f32.v5i32(<5 x float> %f)
77 define <6 x i32> @test_signed_v6f32_v6i32(<6 x float> %f) {
78 ; CHECK-LABEL: test_signed_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: fcvtzs 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: fcvtzs 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.fptosi.sat.v6f32.v6i32(<6 x float> %f)
103 define <7 x i32> @test_signed_v7f32_v7i32(<7 x float> %f) {
104 ; CHECK-LABEL: test_signed_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: fcvtzs v1.4s, v4.4s
119 ; CHECK-NEXT: fcvtzs 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.fptosi.sat.v7f32.v7i32(<7 x float> %f)
132 define <8 x i32> @test_signed_v8f32_v8i32(<8 x float> %f) {
133 ; CHECK-LABEL: test_signed_v8f32_v8i32:
135 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
136 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
138 %x = call <8 x i32> @llvm.fptosi.sat.v8f32.v8i32(<8 x float> %f)
143 ; Double to signed 32-bit -- Vector size variation
146 declare <1 x i32> @llvm.fptosi.sat.v1f64.v1i32 (<1 x double>)
147 declare <2 x i32> @llvm.fptosi.sat.v2f64.v2i32 (<2 x double>)
148 declare <3 x i32> @llvm.fptosi.sat.v3f64.v3i32 (<3 x double>)
149 declare <4 x i32> @llvm.fptosi.sat.v4f64.v4i32 (<4 x double>)
150 declare <5 x i32> @llvm.fptosi.sat.v5f64.v5i32 (<5 x double>)
151 declare <6 x i32> @llvm.fptosi.sat.v6f64.v6i32 (<6 x double>)
153 define <1 x i32> @test_signed_v1f64_v1i32(<1 x double> %f) {
154 ; CHECK-LABEL: test_signed_v1f64_v1i32:
156 ; CHECK-NEXT: fcvtzs w8, d0
157 ; CHECK-NEXT: fmov s0, w8
159 %x = call <1 x i32> @llvm.fptosi.sat.v1f64.v1i32(<1 x double> %f)
163 define <2 x i32> @test_signed_v2f64_v2i32(<2 x double> %f) {
164 ; CHECK-LABEL: test_signed_v2f64_v2i32:
166 ; CHECK-NEXT: mov d1, v0.d[1]
167 ; CHECK-NEXT: fcvtzs w8, d0
168 ; CHECK-NEXT: fcvtzs 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.fptosi.sat.v2f64.v2i32(<2 x double> %f)
177 define <3 x i32> @test_signed_v3f64_v3i32(<3 x double> %f) {
178 ; CHECK-LABEL: test_signed_v3f64_v3i32:
180 ; CHECK-NEXT: fcvtzs w8, d0
181 ; CHECK-NEXT: fcvtzs w9, d1
182 ; CHECK-NEXT: fmov s0, w8
183 ; CHECK-NEXT: fcvtzs w8, d2
184 ; CHECK-NEXT: mov v0.s[1], w9
185 ; CHECK-NEXT: mov v0.s[2], w8
186 ; CHECK-NEXT: fcvtzs w8, d0
187 ; CHECK-NEXT: mov v0.s[3], w8
189 %x = call <3 x i32> @llvm.fptosi.sat.v3f64.v3i32(<3 x double> %f)
193 define <4 x i32> @test_signed_v4f64_v4i32(<4 x double> %f) {
194 ; CHECK-LABEL: test_signed_v4f64_v4i32:
196 ; CHECK-NEXT: mov d2, v0.d[1]
197 ; CHECK-NEXT: fcvtzs w8, d0
198 ; CHECK-NEXT: fcvtzs w9, d2
199 ; CHECK-NEXT: fmov s0, w8
200 ; CHECK-NEXT: fcvtzs 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: fcvtzs w8, d1
205 ; CHECK-NEXT: mov v0.s[3], w8
207 %x = call <4 x i32> @llvm.fptosi.sat.v4f64.v4i32(<4 x double> %f)
211 define <5 x i32> @test_signed_v5f64_v5i32(<5 x double> %f) {
212 ; CHECK-LABEL: test_signed_v5f64_v5i32:
214 ; CHECK-NEXT: fcvtzs w0, d0
215 ; CHECK-NEXT: fcvtzs w1, d1
216 ; CHECK-NEXT: fcvtzs w2, d2
217 ; CHECK-NEXT: fcvtzs w3, d3
218 ; CHECK-NEXT: fcvtzs w4, d4
220 %x = call <5 x i32> @llvm.fptosi.sat.v5f64.v5i32(<5 x double> %f)
224 define <6 x i32> @test_signed_v6f64_v6i32(<6 x double> %f) {
225 ; CHECK-LABEL: test_signed_v6f64_v6i32:
227 ; CHECK-NEXT: fcvtzs w0, d0
228 ; CHECK-NEXT: fcvtzs w1, d1
229 ; CHECK-NEXT: fcvtzs w2, d2
230 ; CHECK-NEXT: fcvtzs w3, d3
231 ; CHECK-NEXT: fcvtzs w4, d4
232 ; CHECK-NEXT: fcvtzs w5, d5
234 %x = call <6 x i32> @llvm.fptosi.sat.v6f64.v6i32(<6 x double> %f)
239 ; FP128 to signed 32-bit -- Vector size variation
242 declare <1 x i32> @llvm.fptosi.sat.v1f128.v1i32 (<1 x fp128>)
243 declare <2 x i32> @llvm.fptosi.sat.v2f128.v2i32 (<2 x fp128>)
244 declare <3 x i32> @llvm.fptosi.sat.v3f128.v3i32 (<3 x fp128>)
245 declare <4 x i32> @llvm.fptosi.sat.v4f128.v4i32 (<4 x fp128>)
247 define <1 x i32> @test_signed_v1f128_v1i32(<1 x fp128> %f) {
248 ; CHECK-LABEL: test_signed_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 __fixtfsi
262 ; CHECK-NEXT: cmp w19, #0
263 ; CHECK-NEXT: mov w8, #-2147483648 // =0x80000000
264 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
265 ; CHECK-NEXT: csel w19, w8, w0, lt
266 ; CHECK-NEXT: adrp x8, .LCPI14_1
267 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI14_1]
268 ; CHECK-NEXT: bl __gttf2
269 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
270 ; CHECK-NEXT: mov w8, #2147483647 // =0x7fffffff
271 ; CHECK-NEXT: cmp w0, #0
272 ; CHECK-NEXT: csel w19, w8, w19, gt
273 ; CHECK-NEXT: mov v1.16b, v0.16b
274 ; CHECK-NEXT: bl __unordtf2
275 ; CHECK-NEXT: cmp w0, #0
276 ; CHECK-NEXT: csel w8, wzr, w19, ne
277 ; CHECK-NEXT: ldp x30, x19, [sp, #16] // 16-byte Folded Reload
278 ; CHECK-NEXT: fmov s0, w8
279 ; CHECK-NEXT: add sp, sp, #32
281 %x = call <1 x i32> @llvm.fptosi.sat.v1f128.v1i32(<1 x fp128> %f)
285 define <2 x i32> @test_signed_v2f128_v2i32(<2 x fp128> %f) {
286 ; CHECK-LABEL: test_signed_v2f128_v2i32:
288 ; CHECK-NEXT: sub sp, sp, #112
289 ; CHECK-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
290 ; CHECK-NEXT: stp x22, x21, [sp, #80] // 16-byte Folded Spill
291 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
292 ; CHECK-NEXT: .cfi_def_cfa_offset 112
293 ; CHECK-NEXT: .cfi_offset w19, -8
294 ; CHECK-NEXT: .cfi_offset w20, -16
295 ; CHECK-NEXT: .cfi_offset w21, -24
296 ; CHECK-NEXT: .cfi_offset w22, -32
297 ; CHECK-NEXT: .cfi_offset w30, -48
298 ; CHECK-NEXT: mov v2.16b, v1.16b
299 ; CHECK-NEXT: stp q1, q0, [sp, #32] // 32-byte Folded Spill
300 ; CHECK-NEXT: adrp x8, .LCPI15_0
301 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_0]
302 ; CHECK-NEXT: mov v0.16b, v2.16b
303 ; CHECK-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
304 ; CHECK-NEXT: bl __getf2
305 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
306 ; CHECK-NEXT: mov w19, w0
307 ; CHECK-NEXT: bl __fixtfsi
308 ; CHECK-NEXT: adrp x8, .LCPI15_1
309 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
310 ; CHECK-NEXT: cmp w19, #0
311 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_1]
312 ; CHECK-NEXT: mov w20, #-2147483648 // =0x80000000
313 ; CHECK-NEXT: csel w19, w20, w0, lt
314 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
315 ; CHECK-NEXT: bl __gttf2
316 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
317 ; CHECK-NEXT: mov w21, #2147483647 // =0x7fffffff
318 ; CHECK-NEXT: cmp w0, #0
319 ; CHECK-NEXT: csel w19, w21, w19, gt
320 ; CHECK-NEXT: mov v1.16b, v0.16b
321 ; CHECK-NEXT: bl __unordtf2
322 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
323 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
324 ; CHECK-NEXT: cmp w0, #0
325 ; CHECK-NEXT: csel w22, wzr, w19, ne
326 ; CHECK-NEXT: bl __getf2
327 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
328 ; CHECK-NEXT: mov w19, w0
329 ; CHECK-NEXT: bl __fixtfsi
330 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
331 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
332 ; CHECK-NEXT: cmp w19, #0
333 ; CHECK-NEXT: csel w19, w20, w0, lt
334 ; CHECK-NEXT: bl __gttf2
335 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
336 ; CHECK-NEXT: cmp w0, #0
337 ; CHECK-NEXT: csel w19, w21, w19, gt
338 ; CHECK-NEXT: mov v1.16b, v0.16b
339 ; CHECK-NEXT: bl __unordtf2
340 ; CHECK-NEXT: cmp w0, #0
341 ; CHECK-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
342 ; CHECK-NEXT: csel w8, wzr, w19, ne
343 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
344 ; CHECK-NEXT: fmov s0, w8
345 ; CHECK-NEXT: mov v0.s[1], w22
346 ; CHECK-NEXT: ldp x22, x21, [sp, #80] // 16-byte Folded Reload
347 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
348 ; CHECK-NEXT: add sp, sp, #112
350 %x = call <2 x i32> @llvm.fptosi.sat.v2f128.v2i32(<2 x fp128> %f)
354 define <3 x i32> @test_signed_v3f128_v3i32(<3 x fp128> %f) {
355 ; CHECK-LABEL: test_signed_v3f128_v3i32:
357 ; CHECK-NEXT: sub sp, sp, #128
358 ; CHECK-NEXT: str x30, [sp, #80] // 8-byte Folded Spill
359 ; CHECK-NEXT: stp x22, x21, [sp, #96] // 16-byte Folded Spill
360 ; CHECK-NEXT: stp x20, x19, [sp, #112] // 16-byte Folded Spill
361 ; CHECK-NEXT: .cfi_def_cfa_offset 128
362 ; CHECK-NEXT: .cfi_offset w19, -8
363 ; CHECK-NEXT: .cfi_offset w20, -16
364 ; CHECK-NEXT: .cfi_offset w21, -24
365 ; CHECK-NEXT: .cfi_offset w22, -32
366 ; CHECK-NEXT: .cfi_offset w30, -48
367 ; CHECK-NEXT: stp q0, q2, [sp, #48] // 32-byte Folded Spill
368 ; CHECK-NEXT: mov v2.16b, v1.16b
369 ; CHECK-NEXT: adrp x8, .LCPI16_0
370 ; CHECK-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
371 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_0]
372 ; CHECK-NEXT: mov v0.16b, v2.16b
373 ; CHECK-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
374 ; CHECK-NEXT: bl __getf2
375 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
376 ; CHECK-NEXT: mov w19, w0
377 ; CHECK-NEXT: bl __fixtfsi
378 ; CHECK-NEXT: adrp x8, .LCPI16_1
379 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
380 ; CHECK-NEXT: cmp w19, #0
381 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_1]
382 ; CHECK-NEXT: mov w20, #-2147483648 // =0x80000000
383 ; CHECK-NEXT: csel w19, w20, w0, lt
384 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
385 ; CHECK-NEXT: bl __gttf2
386 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
387 ; CHECK-NEXT: mov w21, #2147483647 // =0x7fffffff
388 ; CHECK-NEXT: cmp w0, #0
389 ; CHECK-NEXT: csel w19, w21, w19, gt
390 ; CHECK-NEXT: mov v1.16b, v0.16b
391 ; CHECK-NEXT: bl __unordtf2
392 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
393 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
394 ; CHECK-NEXT: cmp w0, #0
395 ; CHECK-NEXT: csel w22, wzr, w19, ne
396 ; CHECK-NEXT: bl __getf2
397 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
398 ; CHECK-NEXT: mov w19, w0
399 ; CHECK-NEXT: bl __fixtfsi
400 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
401 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
402 ; CHECK-NEXT: cmp w19, #0
403 ; CHECK-NEXT: csel w19, w20, w0, lt
404 ; CHECK-NEXT: bl __gttf2
405 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
406 ; CHECK-NEXT: cmp w0, #0
407 ; CHECK-NEXT: csel w19, w21, w19, gt
408 ; CHECK-NEXT: mov v1.16b, v0.16b
409 ; CHECK-NEXT: bl __unordtf2
410 ; CHECK-NEXT: cmp w0, #0
411 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
412 ; CHECK-NEXT: csel w8, wzr, w19, ne
413 ; CHECK-NEXT: fmov s0, w8
414 ; CHECK-NEXT: mov v0.s[1], w22
415 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
416 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
417 ; CHECK-NEXT: bl __getf2
418 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
419 ; CHECK-NEXT: mov w19, w0
420 ; CHECK-NEXT: bl __fixtfsi
421 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
422 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
423 ; CHECK-NEXT: cmp w19, #0
424 ; CHECK-NEXT: csel w19, w20, w0, lt
425 ; CHECK-NEXT: bl __gttf2
426 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
427 ; CHECK-NEXT: cmp w0, #0
428 ; CHECK-NEXT: csel w19, w21, w19, gt
429 ; CHECK-NEXT: mov v1.16b, v0.16b
430 ; CHECK-NEXT: bl __unordtf2
431 ; CHECK-NEXT: cmp w0, #0
432 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
433 ; CHECK-NEXT: ldr x30, [sp, #80] // 8-byte Folded Reload
434 ; CHECK-NEXT: csel w8, wzr, w19, ne
435 ; CHECK-NEXT: ldp x20, x19, [sp, #112] // 16-byte Folded Reload
436 ; CHECK-NEXT: ldp x22, x21, [sp, #96] // 16-byte Folded Reload
437 ; CHECK-NEXT: mov v0.s[2], w8
438 ; CHECK-NEXT: add sp, sp, #128
440 %x = call <3 x i32> @llvm.fptosi.sat.v3f128.v3i32(<3 x fp128> %f)
444 define <4 x i32> @test_signed_v4f128_v4i32(<4 x fp128> %f) {
445 ; CHECK-LABEL: test_signed_v4f128_v4i32:
447 ; CHECK-NEXT: sub sp, sp, #144
448 ; CHECK-NEXT: str x30, [sp, #96] // 8-byte Folded Spill
449 ; CHECK-NEXT: stp x22, x21, [sp, #112] // 16-byte Folded Spill
450 ; CHECK-NEXT: stp x20, x19, [sp, #128] // 16-byte Folded Spill
451 ; CHECK-NEXT: .cfi_def_cfa_offset 144
452 ; CHECK-NEXT: .cfi_offset w19, -8
453 ; CHECK-NEXT: .cfi_offset w20, -16
454 ; CHECK-NEXT: .cfi_offset w21, -24
455 ; CHECK-NEXT: .cfi_offset w22, -32
456 ; CHECK-NEXT: .cfi_offset w30, -48
457 ; CHECK-NEXT: stp q2, q3, [sp, #64] // 32-byte Folded Spill
458 ; CHECK-NEXT: mov v2.16b, v1.16b
459 ; CHECK-NEXT: adrp x8, .LCPI17_0
460 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
461 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
462 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_0]
463 ; CHECK-NEXT: mov v0.16b, v2.16b
464 ; CHECK-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
465 ; CHECK-NEXT: bl __getf2
466 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
467 ; CHECK-NEXT: mov w19, w0
468 ; CHECK-NEXT: bl __fixtfsi
469 ; CHECK-NEXT: adrp x8, .LCPI17_1
470 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
471 ; CHECK-NEXT: cmp w19, #0
472 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_1]
473 ; CHECK-NEXT: mov w20, #-2147483648 // =0x80000000
474 ; CHECK-NEXT: csel w19, w20, w0, lt
475 ; CHECK-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
476 ; CHECK-NEXT: bl __gttf2
477 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
478 ; CHECK-NEXT: mov w21, #2147483647 // =0x7fffffff
479 ; CHECK-NEXT: cmp w0, #0
480 ; CHECK-NEXT: csel w19, w21, w19, gt
481 ; CHECK-NEXT: mov v1.16b, v0.16b
482 ; CHECK-NEXT: bl __unordtf2
483 ; CHECK-NEXT: ldp q1, q0, [sp, #32] // 32-byte Folded Reload
484 ; CHECK-NEXT: cmp w0, #0
485 ; CHECK-NEXT: csel w22, wzr, w19, ne
486 ; CHECK-NEXT: bl __getf2
487 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
488 ; CHECK-NEXT: mov w19, w0
489 ; CHECK-NEXT: bl __fixtfsi
490 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
491 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
492 ; CHECK-NEXT: cmp w19, #0
493 ; CHECK-NEXT: csel w19, w20, w0, lt
494 ; CHECK-NEXT: bl __gttf2
495 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
496 ; CHECK-NEXT: cmp w0, #0
497 ; CHECK-NEXT: csel w19, w21, w19, gt
498 ; CHECK-NEXT: mov v1.16b, v0.16b
499 ; CHECK-NEXT: bl __unordtf2
500 ; CHECK-NEXT: cmp w0, #0
501 ; CHECK-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
502 ; CHECK-NEXT: csel w8, wzr, w19, ne
503 ; CHECK-NEXT: fmov s0, w8
504 ; CHECK-NEXT: mov v0.s[1], w22
505 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
506 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
507 ; CHECK-NEXT: bl __getf2
508 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
509 ; CHECK-NEXT: mov w19, w0
510 ; CHECK-NEXT: bl __fixtfsi
511 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
512 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
513 ; CHECK-NEXT: cmp w19, #0
514 ; CHECK-NEXT: csel w19, w20, w0, lt
515 ; CHECK-NEXT: bl __gttf2
516 ; CHECK-NEXT: ldr q0, [sp, #64] // 16-byte Folded Reload
517 ; CHECK-NEXT: cmp w0, #0
518 ; CHECK-NEXT: csel w19, w21, w19, gt
519 ; CHECK-NEXT: mov v1.16b, v0.16b
520 ; CHECK-NEXT: bl __unordtf2
521 ; CHECK-NEXT: ldp q1, q0, [sp, #32] // 32-byte Folded Reload
522 ; CHECK-NEXT: cmp w0, #0
523 ; CHECK-NEXT: csel w8, wzr, w19, ne
524 ; CHECK-NEXT: mov v0.s[2], w8
525 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
526 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
527 ; CHECK-NEXT: bl __getf2
528 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
529 ; CHECK-NEXT: mov w19, w0
530 ; CHECK-NEXT: bl __fixtfsi
531 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
532 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
533 ; CHECK-NEXT: cmp w19, #0
534 ; CHECK-NEXT: csel w19, w20, w0, lt
535 ; CHECK-NEXT: bl __gttf2
536 ; CHECK-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
537 ; CHECK-NEXT: cmp w0, #0
538 ; CHECK-NEXT: csel w19, w21, w19, gt
539 ; CHECK-NEXT: mov v1.16b, v0.16b
540 ; CHECK-NEXT: bl __unordtf2
541 ; CHECK-NEXT: cmp w0, #0
542 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
543 ; CHECK-NEXT: ldr x30, [sp, #96] // 8-byte Folded Reload
544 ; CHECK-NEXT: csel w8, wzr, w19, ne
545 ; CHECK-NEXT: ldp x20, x19, [sp, #128] // 16-byte Folded Reload
546 ; CHECK-NEXT: ldp x22, x21, [sp, #112] // 16-byte Folded Reload
547 ; CHECK-NEXT: mov v0.s[3], w8
548 ; CHECK-NEXT: add sp, sp, #144
550 %x = call <4 x i32> @llvm.fptosi.sat.v4f128.v4i32(<4 x fp128> %f)
555 ; FP16 to signed 32-bit -- Vector size variation
558 declare <1 x i32> @llvm.fptosi.sat.v1f16.v1i32 (<1 x half>)
559 declare <2 x i32> @llvm.fptosi.sat.v2f16.v2i32 (<2 x half>)
560 declare <3 x i32> @llvm.fptosi.sat.v3f16.v3i32 (<3 x half>)
561 declare <4 x i32> @llvm.fptosi.sat.v4f16.v4i32 (<4 x half>)
562 declare <5 x i32> @llvm.fptosi.sat.v5f16.v5i32 (<5 x half>)
563 declare <6 x i32> @llvm.fptosi.sat.v6f16.v6i32 (<6 x half>)
564 declare <7 x i32> @llvm.fptosi.sat.v7f16.v7i32 (<7 x half>)
565 declare <8 x i32> @llvm.fptosi.sat.v8f16.v8i32 (<8 x half>)
567 define <1 x i32> @test_signed_v1f16_v1i32(<1 x half> %f) {
568 ; CHECK-CVT-LABEL: test_signed_v1f16_v1i32:
569 ; CHECK-CVT: // %bb.0:
570 ; CHECK-CVT-NEXT: fcvt s0, h0
571 ; CHECK-CVT-NEXT: fcvtzs w8, s0
572 ; CHECK-CVT-NEXT: fmov s0, w8
573 ; CHECK-CVT-NEXT: ret
575 ; CHECK-FP16-LABEL: test_signed_v1f16_v1i32:
576 ; CHECK-FP16: // %bb.0:
577 ; CHECK-FP16-NEXT: fcvtzs w8, h0
578 ; CHECK-FP16-NEXT: fmov s0, w8
579 ; CHECK-FP16-NEXT: ret
580 %x = call <1 x i32> @llvm.fptosi.sat.v1f16.v1i32(<1 x half> %f)
584 define <2 x i32> @test_signed_v2f16_v2i32(<2 x half> %f) {
585 ; CHECK-LABEL: test_signed_v2f16_v2i32:
587 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
588 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
589 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
591 %x = call <2 x i32> @llvm.fptosi.sat.v2f16.v2i32(<2 x half> %f)
595 define <3 x i32> @test_signed_v3f16_v3i32(<3 x half> %f) {
596 ; CHECK-LABEL: test_signed_v3f16_v3i32:
598 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
599 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
601 %x = call <3 x i32> @llvm.fptosi.sat.v3f16.v3i32(<3 x half> %f)
605 define <4 x i32> @test_signed_v4f16_v4i32(<4 x half> %f) {
606 ; CHECK-LABEL: test_signed_v4f16_v4i32:
608 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
609 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
611 %x = call <4 x i32> @llvm.fptosi.sat.v4f16.v4i32(<4 x half> %f)
615 define <5 x i32> @test_signed_v5f16_v5i32(<5 x half> %f) {
616 ; CHECK-LABEL: test_signed_v5f16_v5i32:
618 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
619 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
620 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
621 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
622 ; CHECK-NEXT: mov w1, v1.s[1]
623 ; CHECK-NEXT: mov w2, v1.s[2]
624 ; CHECK-NEXT: mov w3, v1.s[3]
625 ; CHECK-NEXT: fmov w0, s1
626 ; CHECK-NEXT: fmov w4, s0
628 %x = call <5 x i32> @llvm.fptosi.sat.v5f16.v5i32(<5 x half> %f)
632 define <6 x i32> @test_signed_v6f16_v6i32(<6 x half> %f) {
633 ; CHECK-LABEL: test_signed_v6f16_v6i32:
635 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
636 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
637 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
638 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
639 ; CHECK-NEXT: mov w1, v1.s[1]
640 ; CHECK-NEXT: mov w2, v1.s[2]
641 ; CHECK-NEXT: mov w5, v0.s[1]
642 ; CHECK-NEXT: mov w3, v1.s[3]
643 ; CHECK-NEXT: fmov w4, s0
644 ; CHECK-NEXT: fmov w0, s1
646 %x = call <6 x i32> @llvm.fptosi.sat.v6f16.v6i32(<6 x half> %f)
650 define <7 x i32> @test_signed_v7f16_v7i32(<7 x half> %f) {
651 ; CHECK-LABEL: test_signed_v7f16_v7i32:
653 ; CHECK-NEXT: fcvtl v1.4s, v0.4h
654 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
655 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
656 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
657 ; CHECK-NEXT: mov w1, v1.s[1]
658 ; CHECK-NEXT: mov w2, v1.s[2]
659 ; CHECK-NEXT: mov w3, v1.s[3]
660 ; CHECK-NEXT: mov w5, v0.s[1]
661 ; CHECK-NEXT: mov w6, v0.s[2]
662 ; CHECK-NEXT: fmov w0, s1
663 ; CHECK-NEXT: fmov w4, s0
665 %x = call <7 x i32> @llvm.fptosi.sat.v7f16.v7i32(<7 x half> %f)
669 define <8 x i32> @test_signed_v8f16_v8i32(<8 x half> %f) {
670 ; CHECK-LABEL: test_signed_v8f16_v8i32:
672 ; CHECK-NEXT: fcvtl2 v1.4s, v0.8h
673 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
674 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
675 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
677 %x = call <8 x i32> @llvm.fptosi.sat.v8f16.v8i32(<8 x half> %f)
682 ; 2-Vector float to signed integer -- result size variation
685 declare <2 x i1> @llvm.fptosi.sat.v2f32.v2i1 (<2 x float>)
686 declare <2 x i8> @llvm.fptosi.sat.v2f32.v2i8 (<2 x float>)
687 declare <2 x i13> @llvm.fptosi.sat.v2f32.v2i13 (<2 x float>)
688 declare <2 x i16> @llvm.fptosi.sat.v2f32.v2i16 (<2 x float>)
689 declare <2 x i19> @llvm.fptosi.sat.v2f32.v2i19 (<2 x float>)
690 declare <2 x i50> @llvm.fptosi.sat.v2f32.v2i50 (<2 x float>)
691 declare <2 x i64> @llvm.fptosi.sat.v2f32.v2i64 (<2 x float>)
692 declare <2 x i100> @llvm.fptosi.sat.v2f32.v2i100(<2 x float>)
693 declare <2 x i128> @llvm.fptosi.sat.v2f32.v2i128(<2 x float>)
695 define <2 x i1> @test_signed_v2f32_v2i1(<2 x float> %f) {
696 ; CHECK-LABEL: test_signed_v2f32_v2i1:
698 ; CHECK-NEXT: movi v1.2d, #0000000000000000
699 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
700 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
701 ; CHECK-NEXT: movi v1.2d, #0xffffffffffffffff
702 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
704 %x = call <2 x i1> @llvm.fptosi.sat.v2f32.v2i1(<2 x float> %f)
708 define <2 x i8> @test_signed_v2f32_v2i8(<2 x float> %f) {
709 ; CHECK-LABEL: test_signed_v2f32_v2i8:
711 ; CHECK-NEXT: movi v1.2s, #127
712 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
713 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
714 ; CHECK-NEXT: mvni v1.2s, #127
715 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
717 %x = call <2 x i8> @llvm.fptosi.sat.v2f32.v2i8(<2 x float> %f)
721 define <2 x i13> @test_signed_v2f32_v2i13(<2 x float> %f) {
722 ; CHECK-LABEL: test_signed_v2f32_v2i13:
724 ; CHECK-NEXT: movi v1.2s, #15, msl #8
725 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
726 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
727 ; CHECK-NEXT: mvni v1.2s, #15, msl #8
728 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
730 %x = call <2 x i13> @llvm.fptosi.sat.v2f32.v2i13(<2 x float> %f)
734 define <2 x i16> @test_signed_v2f32_v2i16(<2 x float> %f) {
735 ; CHECK-LABEL: test_signed_v2f32_v2i16:
737 ; CHECK-NEXT: movi v1.2s, #127, msl #8
738 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
739 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
740 ; CHECK-NEXT: mvni v1.2s, #127, msl #8
741 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
743 %x = call <2 x i16> @llvm.fptosi.sat.v2f32.v2i16(<2 x float> %f)
747 define <2 x i19> @test_signed_v2f32_v2i19(<2 x float> %f) {
748 ; CHECK-LABEL: test_signed_v2f32_v2i19:
750 ; CHECK-NEXT: movi v1.2s, #3, msl #16
751 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
752 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
753 ; CHECK-NEXT: mvni v1.2s, #3, msl #16
754 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
756 %x = call <2 x i19> @llvm.fptosi.sat.v2f32.v2i19(<2 x float> %f)
760 define <2 x i32> @test_signed_v2f32_v2i32_duplicate(<2 x float> %f) {
761 ; CHECK-LABEL: test_signed_v2f32_v2i32_duplicate:
763 ; CHECK-NEXT: fcvtzs v0.2s, v0.2s
765 %x = call <2 x i32> @llvm.fptosi.sat.v2f32.v2i32(<2 x float> %f)
769 define <2 x i50> @test_signed_v2f32_v2i50(<2 x float> %f) {
770 ; CHECK-LABEL: test_signed_v2f32_v2i50:
772 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
773 ; CHECK-NEXT: mov s1, v0.s[1]
774 ; CHECK-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
775 ; CHECK-NEXT: fcvtzs x10, s0
776 ; CHECK-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
777 ; CHECK-NEXT: fcvtzs x9, s1
778 ; CHECK-NEXT: cmp x9, x8
779 ; CHECK-NEXT: csel x9, x9, x8, lt
780 ; CHECK-NEXT: cmp x9, x11
781 ; CHECK-NEXT: csel x9, x9, x11, gt
782 ; CHECK-NEXT: cmp x10, x8
783 ; CHECK-NEXT: csel x8, x10, x8, lt
784 ; CHECK-NEXT: cmp x8, x11
785 ; CHECK-NEXT: csel x8, x8, x11, gt
786 ; CHECK-NEXT: fmov d0, x8
787 ; CHECK-NEXT: mov v0.d[1], x9
789 %x = call <2 x i50> @llvm.fptosi.sat.v2f32.v2i50(<2 x float> %f)
793 define <2 x i64> @test_signed_v2f32_v2i64(<2 x float> %f) {
794 ; CHECK-LABEL: test_signed_v2f32_v2i64:
796 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
797 ; CHECK-NEXT: mov s1, v0.s[1]
798 ; CHECK-NEXT: fcvtzs x8, s0
799 ; CHECK-NEXT: fcvtzs x9, s1
800 ; CHECK-NEXT: fmov d0, x8
801 ; CHECK-NEXT: mov v0.d[1], x9
803 %x = call <2 x i64> @llvm.fptosi.sat.v2f32.v2i64(<2 x float> %f)
807 define <2 x i100> @test_signed_v2f32_v2i100(<2 x float> %f) {
808 ; CHECK-LABEL: test_signed_v2f32_v2i100:
810 ; CHECK-NEXT: sub sp, sp, #80
811 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
812 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
813 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
814 ; CHECK-NEXT: stp x22, x21, [sp, #48] // 16-byte Folded Spill
815 ; CHECK-NEXT: stp x20, x19, [sp, #64] // 16-byte Folded Spill
816 ; CHECK-NEXT: .cfi_def_cfa_offset 80
817 ; CHECK-NEXT: .cfi_offset w19, -8
818 ; CHECK-NEXT: .cfi_offset w20, -16
819 ; CHECK-NEXT: .cfi_offset w21, -24
820 ; CHECK-NEXT: .cfi_offset w22, -32
821 ; CHECK-NEXT: .cfi_offset w30, -40
822 ; CHECK-NEXT: .cfi_offset b8, -48
823 ; CHECK-NEXT: .cfi_offset b9, -56
824 ; CHECK-NEXT: .cfi_offset b10, -64
825 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
826 ; CHECK-NEXT: mov s8, v0.s[1]
827 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
828 ; CHECK-NEXT: fmov s0, s8
829 ; CHECK-NEXT: bl __fixsfti
830 ; CHECK-NEXT: movi v9.2s, #241, lsl #24
831 ; CHECK-NEXT: mov w8, #1895825407 // =0x70ffffff
832 ; CHECK-NEXT: mov x21, #-34359738368 // =0xfffffff800000000
833 ; CHECK-NEXT: fmov s10, w8
834 ; CHECK-NEXT: mov x22, #34359738367 // =0x7ffffffff
835 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
836 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
837 ; CHECK-NEXT: fcmp s8, s9
838 ; CHECK-NEXT: csel x8, xzr, x0, lt
839 ; CHECK-NEXT: csel x9, x21, x1, lt
840 ; CHECK-NEXT: fcmp s8, s10
841 ; CHECK-NEXT: csel x9, x22, x9, gt
842 ; CHECK-NEXT: csinv x8, x8, xzr, le
843 ; CHECK-NEXT: fcmp s8, s8
844 ; CHECK-NEXT: csel x19, xzr, x8, vs
845 ; CHECK-NEXT: csel x20, xzr, x9, vs
846 ; CHECK-NEXT: bl __fixsfti
847 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
848 ; CHECK-NEXT: mov x2, x19
849 ; CHECK-NEXT: mov x3, x20
850 ; CHECK-NEXT: ldp x20, x19, [sp, #64] // 16-byte Folded Reload
851 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
852 ; CHECK-NEXT: fcmp s0, s9
853 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
854 ; CHECK-NEXT: csel x8, x21, x1, lt
855 ; CHECK-NEXT: csel x9, xzr, x0, lt
856 ; CHECK-NEXT: fcmp s0, s10
857 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
858 ; CHECK-NEXT: csinv x9, x9, xzr, le
859 ; CHECK-NEXT: csel x8, x22, x8, gt
860 ; CHECK-NEXT: fcmp s0, s0
861 ; CHECK-NEXT: ldp x22, x21, [sp, #48] // 16-byte Folded Reload
862 ; CHECK-NEXT: csel x9, xzr, x9, vs
863 ; CHECK-NEXT: csel x1, xzr, x8, vs
864 ; CHECK-NEXT: fmov d0, x9
865 ; CHECK-NEXT: mov v0.d[1], x1
866 ; CHECK-NEXT: fmov x0, d0
867 ; CHECK-NEXT: add sp, sp, #80
869 %x = call <2 x i100> @llvm.fptosi.sat.v2f32.v2i100(<2 x float> %f)
873 define <2 x i128> @test_signed_v2f32_v2i128(<2 x float> %f) {
874 ; CHECK-LABEL: test_signed_v2f32_v2i128:
876 ; CHECK-NEXT: sub sp, sp, #80
877 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
878 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
879 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
880 ; CHECK-NEXT: stp x22, x21, [sp, #48] // 16-byte Folded Spill
881 ; CHECK-NEXT: stp x20, x19, [sp, #64] // 16-byte Folded Spill
882 ; CHECK-NEXT: .cfi_def_cfa_offset 80
883 ; CHECK-NEXT: .cfi_offset w19, -8
884 ; CHECK-NEXT: .cfi_offset w20, -16
885 ; CHECK-NEXT: .cfi_offset w21, -24
886 ; CHECK-NEXT: .cfi_offset w22, -32
887 ; CHECK-NEXT: .cfi_offset w30, -40
888 ; CHECK-NEXT: .cfi_offset b8, -48
889 ; CHECK-NEXT: .cfi_offset b9, -56
890 ; CHECK-NEXT: .cfi_offset b10, -64
891 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
892 ; CHECK-NEXT: mov s8, v0.s[1]
893 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
894 ; CHECK-NEXT: fmov s0, s8
895 ; CHECK-NEXT: bl __fixsfti
896 ; CHECK-NEXT: movi v9.2s, #255, lsl #24
897 ; CHECK-NEXT: mov w8, #2130706431 // =0x7effffff
898 ; CHECK-NEXT: mov x21, #-9223372036854775808 // =0x8000000000000000
899 ; CHECK-NEXT: fmov s10, w8
900 ; CHECK-NEXT: mov x22, #9223372036854775807 // =0x7fffffffffffffff
901 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
902 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
903 ; CHECK-NEXT: fcmp s8, s9
904 ; CHECK-NEXT: csel x8, xzr, x0, lt
905 ; CHECK-NEXT: csel x9, x21, x1, lt
906 ; CHECK-NEXT: fcmp s8, s10
907 ; CHECK-NEXT: csel x9, x22, x9, gt
908 ; CHECK-NEXT: csinv x8, x8, xzr, le
909 ; CHECK-NEXT: fcmp s8, s8
910 ; CHECK-NEXT: csel x19, xzr, x8, vs
911 ; CHECK-NEXT: csel x20, xzr, x9, vs
912 ; CHECK-NEXT: bl __fixsfti
913 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
914 ; CHECK-NEXT: mov x2, x19
915 ; CHECK-NEXT: mov x3, x20
916 ; CHECK-NEXT: ldp x20, x19, [sp, #64] // 16-byte Folded Reload
917 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
918 ; CHECK-NEXT: fcmp s0, s9
919 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
920 ; CHECK-NEXT: csel x8, x21, x1, lt
921 ; CHECK-NEXT: csel x9, xzr, x0, lt
922 ; CHECK-NEXT: fcmp s0, s10
923 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
924 ; CHECK-NEXT: csinv x9, x9, xzr, le
925 ; CHECK-NEXT: csel x8, x22, x8, gt
926 ; CHECK-NEXT: fcmp s0, s0
927 ; CHECK-NEXT: ldp x22, x21, [sp, #48] // 16-byte Folded Reload
928 ; CHECK-NEXT: csel x9, xzr, x9, vs
929 ; CHECK-NEXT: csel x1, xzr, x8, vs
930 ; CHECK-NEXT: fmov d0, x9
931 ; CHECK-NEXT: mov v0.d[1], x1
932 ; CHECK-NEXT: fmov x0, d0
933 ; CHECK-NEXT: add sp, sp, #80
935 %x = call <2 x i128> @llvm.fptosi.sat.v2f32.v2i128(<2 x float> %f)
940 ; 4-Vector float to signed integer -- result size variation
943 declare <4 x i1> @llvm.fptosi.sat.v4f32.v4i1 (<4 x float>)
944 declare <4 x i8> @llvm.fptosi.sat.v4f32.v4i8 (<4 x float>)
945 declare <4 x i13> @llvm.fptosi.sat.v4f32.v4i13 (<4 x float>)
946 declare <4 x i16> @llvm.fptosi.sat.v4f32.v4i16 (<4 x float>)
947 declare <4 x i19> @llvm.fptosi.sat.v4f32.v4i19 (<4 x float>)
948 declare <4 x i50> @llvm.fptosi.sat.v4f32.v4i50 (<4 x float>)
949 declare <4 x i64> @llvm.fptosi.sat.v4f32.v4i64 (<4 x float>)
950 declare <4 x i100> @llvm.fptosi.sat.v4f32.v4i100(<4 x float>)
951 declare <4 x i128> @llvm.fptosi.sat.v4f32.v4i128(<4 x float>)
953 define <4 x i1> @test_signed_v4f32_v4i1(<4 x float> %f) {
954 ; CHECK-LABEL: test_signed_v4f32_v4i1:
956 ; CHECK-NEXT: movi v1.2d, #0000000000000000
957 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
958 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
959 ; CHECK-NEXT: movi v1.2d, #0xffffffffffffffff
960 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
961 ; CHECK-NEXT: xtn v0.4h, v0.4s
963 %x = call <4 x i1> @llvm.fptosi.sat.v4f32.v4i1(<4 x float> %f)
967 define <4 x i8> @test_signed_v4f32_v4i8(<4 x float> %f) {
968 ; CHECK-LABEL: test_signed_v4f32_v4i8:
970 ; CHECK-NEXT: movi v1.4s, #127
971 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
972 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
973 ; CHECK-NEXT: mvni v1.4s, #127
974 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
975 ; CHECK-NEXT: xtn v0.4h, v0.4s
977 %x = call <4 x i8> @llvm.fptosi.sat.v4f32.v4i8(<4 x float> %f)
981 define <4 x i13> @test_signed_v4f32_v4i13(<4 x float> %f) {
982 ; CHECK-LABEL: test_signed_v4f32_v4i13:
984 ; CHECK-NEXT: movi v1.4s, #15, msl #8
985 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
986 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
987 ; CHECK-NEXT: mvni v1.4s, #15, msl #8
988 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
989 ; CHECK-NEXT: xtn v0.4h, v0.4s
991 %x = call <4 x i13> @llvm.fptosi.sat.v4f32.v4i13(<4 x float> %f)
995 define <4 x i16> @test_signed_v4f32_v4i16(<4 x float> %f) {
996 ; CHECK-LABEL: test_signed_v4f32_v4i16:
998 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
999 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
1001 %x = call <4 x i16> @llvm.fptosi.sat.v4f32.v4i16(<4 x float> %f)
1005 define <4 x i19> @test_signed_v4f32_v4i19(<4 x float> %f) {
1006 ; CHECK-LABEL: test_signed_v4f32_v4i19:
1008 ; CHECK-NEXT: movi v1.4s, #3, msl #16
1009 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
1010 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1011 ; CHECK-NEXT: mvni v1.4s, #3, msl #16
1012 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1014 %x = call <4 x i19> @llvm.fptosi.sat.v4f32.v4i19(<4 x float> %f)
1018 define <4 x i32> @test_signed_v4f32_v4i32_duplicate(<4 x float> %f) {
1019 ; CHECK-LABEL: test_signed_v4f32_v4i32_duplicate:
1021 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
1023 %x = call <4 x i32> @llvm.fptosi.sat.v4f32.v4i32(<4 x float> %f)
1027 define <4 x i50> @test_signed_v4f32_v4i50(<4 x float> %f) {
1028 ; CHECK-LABEL: test_signed_v4f32_v4i50:
1030 ; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
1031 ; CHECK-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
1032 ; CHECK-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
1033 ; CHECK-NEXT: fcvtzs x12, s0
1034 ; CHECK-NEXT: mov s2, v1.s[1]
1035 ; CHECK-NEXT: fcvtzs x9, s1
1036 ; CHECK-NEXT: mov s1, v0.s[1]
1037 ; CHECK-NEXT: fcvtzs x10, s2
1038 ; CHECK-NEXT: cmp x9, x8
1039 ; CHECK-NEXT: csel x9, x9, x8, lt
1040 ; CHECK-NEXT: cmp x9, x11
1041 ; CHECK-NEXT: csel x2, x9, x11, gt
1042 ; CHECK-NEXT: cmp x10, x8
1043 ; CHECK-NEXT: csel x9, x10, x8, lt
1044 ; CHECK-NEXT: fcvtzs x10, s1
1045 ; CHECK-NEXT: cmp x9, x11
1046 ; CHECK-NEXT: csel x3, x9, x11, gt
1047 ; CHECK-NEXT: cmp x12, x8
1048 ; CHECK-NEXT: csel x9, x12, x8, lt
1049 ; CHECK-NEXT: cmp x9, x11
1050 ; CHECK-NEXT: csel x0, x9, x11, gt
1051 ; CHECK-NEXT: cmp x10, x8
1052 ; CHECK-NEXT: csel x8, x10, x8, lt
1053 ; CHECK-NEXT: cmp x8, x11
1054 ; CHECK-NEXT: csel x1, x8, x11, gt
1056 %x = call <4 x i50> @llvm.fptosi.sat.v4f32.v4i50(<4 x float> %f)
1060 define <4 x i64> @test_signed_v4f32_v4i64(<4 x float> %f) {
1061 ; CHECK-LABEL: test_signed_v4f32_v4i64:
1063 ; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
1064 ; CHECK-NEXT: mov s3, v0.s[1]
1065 ; CHECK-NEXT: fcvtzs x9, s0
1066 ; CHECK-NEXT: mov s2, v1.s[1]
1067 ; CHECK-NEXT: fcvtzs x8, s1
1068 ; CHECK-NEXT: fcvtzs x11, s3
1069 ; CHECK-NEXT: fmov d0, x9
1070 ; CHECK-NEXT: fcvtzs x10, s2
1071 ; CHECK-NEXT: fmov d1, x8
1072 ; CHECK-NEXT: mov v0.d[1], x11
1073 ; CHECK-NEXT: mov v1.d[1], x10
1075 %x = call <4 x i64> @llvm.fptosi.sat.v4f32.v4i64(<4 x float> %f)
1079 define <4 x i100> @test_signed_v4f32_v4i100(<4 x float> %f) {
1080 ; CHECK-LABEL: test_signed_v4f32_v4i100:
1082 ; CHECK-NEXT: sub sp, sp, #128
1083 ; CHECK-NEXT: str d10, [sp, #32] // 8-byte Folded Spill
1084 ; CHECK-NEXT: stp d9, d8, [sp, #40] // 16-byte Folded Spill
1085 ; CHECK-NEXT: str x30, [sp, #56] // 8-byte Folded Spill
1086 ; CHECK-NEXT: stp x26, x25, [sp, #64] // 16-byte Folded Spill
1087 ; CHECK-NEXT: stp x24, x23, [sp, #80] // 16-byte Folded Spill
1088 ; CHECK-NEXT: stp x22, x21, [sp, #96] // 16-byte Folded Spill
1089 ; CHECK-NEXT: stp x20, x19, [sp, #112] // 16-byte Folded Spill
1090 ; CHECK-NEXT: .cfi_def_cfa_offset 128
1091 ; CHECK-NEXT: .cfi_offset w19, -8
1092 ; CHECK-NEXT: .cfi_offset w20, -16
1093 ; CHECK-NEXT: .cfi_offset w21, -24
1094 ; CHECK-NEXT: .cfi_offset w22, -32
1095 ; CHECK-NEXT: .cfi_offset w23, -40
1096 ; CHECK-NEXT: .cfi_offset w24, -48
1097 ; CHECK-NEXT: .cfi_offset w25, -56
1098 ; CHECK-NEXT: .cfi_offset w26, -64
1099 ; CHECK-NEXT: .cfi_offset w30, -72
1100 ; CHECK-NEXT: .cfi_offset b8, -80
1101 ; CHECK-NEXT: .cfi_offset b9, -88
1102 ; CHECK-NEXT: .cfi_offset b10, -96
1103 ; CHECK-NEXT: mov s8, v0.s[1]
1104 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1105 ; CHECK-NEXT: fmov s0, s8
1106 ; CHECK-NEXT: bl __fixsfti
1107 ; CHECK-NEXT: movi v9.2s, #241, lsl #24
1108 ; CHECK-NEXT: mov w8, #1895825407 // =0x70ffffff
1109 ; CHECK-NEXT: mov x25, #-34359738368 // =0xfffffff800000000
1110 ; CHECK-NEXT: fmov s10, w8
1111 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1112 ; CHECK-NEXT: mov x26, #34359738367 // =0x7ffffffff
1113 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
1114 ; CHECK-NEXT: fcmp s8, s9
1115 ; CHECK-NEXT: csel x8, xzr, x0, lt
1116 ; CHECK-NEXT: csel x9, x25, x1, lt
1117 ; CHECK-NEXT: fcmp s8, s10
1118 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1119 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1120 ; CHECK-NEXT: csel x9, x26, x9, gt
1121 ; CHECK-NEXT: csinv x8, x8, xzr, le
1122 ; CHECK-NEXT: fcmp s8, s8
1123 ; CHECK-NEXT: csel x19, xzr, x8, vs
1124 ; CHECK-NEXT: csel x20, xzr, x9, vs
1125 ; CHECK-NEXT: bl __fixsfti
1126 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1127 ; CHECK-NEXT: fcmp s0, s9
1128 ; CHECK-NEXT: mov s8, v0.s[1]
1129 ; CHECK-NEXT: csel x8, xzr, x0, lt
1130 ; CHECK-NEXT: csel x9, x25, x1, lt
1131 ; CHECK-NEXT: fcmp s0, s10
1132 ; CHECK-NEXT: csel x9, x26, x9, gt
1133 ; CHECK-NEXT: csinv x8, x8, xzr, le
1134 ; CHECK-NEXT: fcmp s0, s0
1135 ; CHECK-NEXT: fmov s0, s8
1136 ; CHECK-NEXT: csel x21, xzr, x8, vs
1137 ; CHECK-NEXT: csel x22, xzr, x9, vs
1138 ; CHECK-NEXT: bl __fixsfti
1139 ; CHECK-NEXT: fcmp s8, s9
1140 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1141 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1142 ; CHECK-NEXT: csel x8, xzr, x0, lt
1143 ; CHECK-NEXT: csel x9, x25, x1, lt
1144 ; CHECK-NEXT: fcmp s8, s10
1145 ; CHECK-NEXT: csel x9, x26, x9, gt
1146 ; CHECK-NEXT: csinv x8, x8, xzr, le
1147 ; CHECK-NEXT: fcmp s8, s8
1148 ; CHECK-NEXT: csel x23, xzr, x8, vs
1149 ; CHECK-NEXT: csel x24, xzr, x9, vs
1150 ; CHECK-NEXT: bl __fixsfti
1151 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1152 ; CHECK-NEXT: mov x2, x19
1153 ; CHECK-NEXT: mov x3, x20
1154 ; CHECK-NEXT: mov x4, x21
1155 ; CHECK-NEXT: mov x5, x22
1156 ; CHECK-NEXT: mov x6, x23
1157 ; CHECK-NEXT: fcmp s0, s9
1158 ; CHECK-NEXT: mov x7, x24
1159 ; CHECK-NEXT: ldr x30, [sp, #56] // 8-byte Folded Reload
1160 ; CHECK-NEXT: ldp x20, x19, [sp, #112] // 16-byte Folded Reload
1161 ; CHECK-NEXT: ldp x22, x21, [sp, #96] // 16-byte Folded Reload
1162 ; CHECK-NEXT: csel x8, x25, x1, lt
1163 ; CHECK-NEXT: csel x9, xzr, x0, lt
1164 ; CHECK-NEXT: fcmp s0, s10
1165 ; CHECK-NEXT: ldp x24, x23, [sp, #80] // 16-byte Folded Reload
1166 ; CHECK-NEXT: ldr d10, [sp, #32] // 8-byte Folded Reload
1167 ; CHECK-NEXT: ldp d9, d8, [sp, #40] // 16-byte Folded Reload
1168 ; CHECK-NEXT: csinv x9, x9, xzr, le
1169 ; CHECK-NEXT: csel x8, x26, x8, gt
1170 ; CHECK-NEXT: fcmp s0, s0
1171 ; CHECK-NEXT: ldp x26, x25, [sp, #64] // 16-byte Folded Reload
1172 ; CHECK-NEXT: csel x9, xzr, x9, vs
1173 ; CHECK-NEXT: csel x1, xzr, x8, vs
1174 ; CHECK-NEXT: fmov d0, x9
1175 ; CHECK-NEXT: mov v0.d[1], x1
1176 ; CHECK-NEXT: fmov x0, d0
1177 ; CHECK-NEXT: add sp, sp, #128
1179 %x = call <4 x i100> @llvm.fptosi.sat.v4f32.v4i100(<4 x float> %f)
1183 define <4 x i128> @test_signed_v4f32_v4i128(<4 x float> %f) {
1184 ; CHECK-LABEL: test_signed_v4f32_v4i128:
1186 ; CHECK-NEXT: sub sp, sp, #128
1187 ; CHECK-NEXT: str d10, [sp, #32] // 8-byte Folded Spill
1188 ; CHECK-NEXT: stp d9, d8, [sp, #40] // 16-byte Folded Spill
1189 ; CHECK-NEXT: str x30, [sp, #56] // 8-byte Folded Spill
1190 ; CHECK-NEXT: stp x26, x25, [sp, #64] // 16-byte Folded Spill
1191 ; CHECK-NEXT: stp x24, x23, [sp, #80] // 16-byte Folded Spill
1192 ; CHECK-NEXT: stp x22, x21, [sp, #96] // 16-byte Folded Spill
1193 ; CHECK-NEXT: stp x20, x19, [sp, #112] // 16-byte Folded Spill
1194 ; CHECK-NEXT: .cfi_def_cfa_offset 128
1195 ; CHECK-NEXT: .cfi_offset w19, -8
1196 ; CHECK-NEXT: .cfi_offset w20, -16
1197 ; CHECK-NEXT: .cfi_offset w21, -24
1198 ; CHECK-NEXT: .cfi_offset w22, -32
1199 ; CHECK-NEXT: .cfi_offset w23, -40
1200 ; CHECK-NEXT: .cfi_offset w24, -48
1201 ; CHECK-NEXT: .cfi_offset w25, -56
1202 ; CHECK-NEXT: .cfi_offset w26, -64
1203 ; CHECK-NEXT: .cfi_offset w30, -72
1204 ; CHECK-NEXT: .cfi_offset b8, -80
1205 ; CHECK-NEXT: .cfi_offset b9, -88
1206 ; CHECK-NEXT: .cfi_offset b10, -96
1207 ; CHECK-NEXT: mov s8, v0.s[1]
1208 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1209 ; CHECK-NEXT: fmov s0, s8
1210 ; CHECK-NEXT: bl __fixsfti
1211 ; CHECK-NEXT: movi v9.2s, #255, lsl #24
1212 ; CHECK-NEXT: mov w8, #2130706431 // =0x7effffff
1213 ; CHECK-NEXT: mov x25, #-9223372036854775808 // =0x8000000000000000
1214 ; CHECK-NEXT: fmov s10, w8
1215 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1216 ; CHECK-NEXT: mov x26, #9223372036854775807 // =0x7fffffffffffffff
1217 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
1218 ; CHECK-NEXT: fcmp s8, s9
1219 ; CHECK-NEXT: csel x8, xzr, x0, lt
1220 ; CHECK-NEXT: csel x9, x25, x1, lt
1221 ; CHECK-NEXT: fcmp s8, s10
1222 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1223 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1224 ; CHECK-NEXT: csel x9, x26, x9, gt
1225 ; CHECK-NEXT: csinv x8, x8, xzr, le
1226 ; CHECK-NEXT: fcmp s8, s8
1227 ; CHECK-NEXT: csel x19, xzr, x8, vs
1228 ; CHECK-NEXT: csel x20, xzr, x9, vs
1229 ; CHECK-NEXT: bl __fixsfti
1230 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1231 ; CHECK-NEXT: fcmp s0, s9
1232 ; CHECK-NEXT: mov s8, v0.s[1]
1233 ; CHECK-NEXT: csel x8, xzr, x0, lt
1234 ; CHECK-NEXT: csel x9, x25, x1, lt
1235 ; CHECK-NEXT: fcmp s0, s10
1236 ; CHECK-NEXT: csel x9, x26, x9, gt
1237 ; CHECK-NEXT: csinv x8, x8, xzr, le
1238 ; CHECK-NEXT: fcmp s0, s0
1239 ; CHECK-NEXT: fmov s0, s8
1240 ; CHECK-NEXT: csel x21, xzr, x8, vs
1241 ; CHECK-NEXT: csel x22, xzr, x9, vs
1242 ; CHECK-NEXT: bl __fixsfti
1243 ; CHECK-NEXT: fcmp s8, s9
1244 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1245 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1246 ; CHECK-NEXT: csel x8, xzr, x0, lt
1247 ; CHECK-NEXT: csel x9, x25, x1, lt
1248 ; CHECK-NEXT: fcmp s8, s10
1249 ; CHECK-NEXT: csel x9, x26, x9, gt
1250 ; CHECK-NEXT: csinv x8, x8, xzr, le
1251 ; CHECK-NEXT: fcmp s8, s8
1252 ; CHECK-NEXT: csel x23, xzr, x8, vs
1253 ; CHECK-NEXT: csel x24, xzr, x9, vs
1254 ; CHECK-NEXT: bl __fixsfti
1255 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1256 ; CHECK-NEXT: mov x2, x19
1257 ; CHECK-NEXT: mov x3, x20
1258 ; CHECK-NEXT: mov x4, x21
1259 ; CHECK-NEXT: mov x5, x22
1260 ; CHECK-NEXT: mov x6, x23
1261 ; CHECK-NEXT: fcmp s0, s9
1262 ; CHECK-NEXT: mov x7, x24
1263 ; CHECK-NEXT: ldr x30, [sp, #56] // 8-byte Folded Reload
1264 ; CHECK-NEXT: ldp x20, x19, [sp, #112] // 16-byte Folded Reload
1265 ; CHECK-NEXT: ldp x22, x21, [sp, #96] // 16-byte Folded Reload
1266 ; CHECK-NEXT: csel x8, x25, x1, lt
1267 ; CHECK-NEXT: csel x9, xzr, x0, lt
1268 ; CHECK-NEXT: fcmp s0, s10
1269 ; CHECK-NEXT: ldp x24, x23, [sp, #80] // 16-byte Folded Reload
1270 ; CHECK-NEXT: ldr d10, [sp, #32] // 8-byte Folded Reload
1271 ; CHECK-NEXT: ldp d9, d8, [sp, #40] // 16-byte Folded Reload
1272 ; CHECK-NEXT: csinv x9, x9, xzr, le
1273 ; CHECK-NEXT: csel x8, x26, x8, gt
1274 ; CHECK-NEXT: fcmp s0, s0
1275 ; CHECK-NEXT: ldp x26, x25, [sp, #64] // 16-byte Folded Reload
1276 ; CHECK-NEXT: csel x9, xzr, x9, vs
1277 ; CHECK-NEXT: csel x1, xzr, x8, vs
1278 ; CHECK-NEXT: fmov d0, x9
1279 ; CHECK-NEXT: mov v0.d[1], x1
1280 ; CHECK-NEXT: fmov x0, d0
1281 ; CHECK-NEXT: add sp, sp, #128
1283 %x = call <4 x i128> @llvm.fptosi.sat.v4f32.v4i128(<4 x float> %f)
1288 ; 2-Vector double to signed integer -- result size variation
1291 declare <2 x i1> @llvm.fptosi.sat.v2f64.v2i1 (<2 x double>)
1292 declare <2 x i8> @llvm.fptosi.sat.v2f64.v2i8 (<2 x double>)
1293 declare <2 x i13> @llvm.fptosi.sat.v2f64.v2i13 (<2 x double>)
1294 declare <2 x i16> @llvm.fptosi.sat.v2f64.v2i16 (<2 x double>)
1295 declare <2 x i19> @llvm.fptosi.sat.v2f64.v2i19 (<2 x double>)
1296 declare <2 x i50> @llvm.fptosi.sat.v2f64.v2i50 (<2 x double>)
1297 declare <2 x i64> @llvm.fptosi.sat.v2f64.v2i64 (<2 x double>)
1298 declare <2 x i100> @llvm.fptosi.sat.v2f64.v2i100(<2 x double>)
1299 declare <2 x i128> @llvm.fptosi.sat.v2f64.v2i128(<2 x double>)
1301 define <2 x i1> @test_signed_v2f64_v2i1(<2 x double> %f) {
1302 ; CHECK-LABEL: test_signed_v2f64_v2i1:
1304 ; CHECK-NEXT: mov d1, v0.d[1]
1305 ; CHECK-NEXT: fcvtzs w9, d0
1306 ; CHECK-NEXT: fcvtzs w8, d1
1307 ; CHECK-NEXT: ands w8, w8, w8, asr #31
1308 ; CHECK-NEXT: csinv w8, w8, wzr, ge
1309 ; CHECK-NEXT: ands w9, w9, w9, asr #31
1310 ; CHECK-NEXT: csinv w9, w9, wzr, ge
1311 ; CHECK-NEXT: fmov s0, w9
1312 ; CHECK-NEXT: mov v0.s[1], w8
1313 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1315 %x = call <2 x i1> @llvm.fptosi.sat.v2f64.v2i1(<2 x double> %f)
1319 define <2 x i8> @test_signed_v2f64_v2i8(<2 x double> %f) {
1320 ; CHECK-LABEL: test_signed_v2f64_v2i8:
1322 ; CHECK-NEXT: mov d1, v0.d[1]
1323 ; CHECK-NEXT: fcvtzs w10, d0
1324 ; CHECK-NEXT: mov w8, #127 // =0x7f
1325 ; CHECK-NEXT: mov w11, #-128 // =0xffffff80
1326 ; CHECK-NEXT: fcvtzs w9, d1
1327 ; CHECK-NEXT: cmp w9, #127
1328 ; CHECK-NEXT: csel w9, w9, w8, lt
1329 ; CHECK-NEXT: cmn w9, #128
1330 ; CHECK-NEXT: csel w9, w9, w11, gt
1331 ; CHECK-NEXT: cmp w10, #127
1332 ; CHECK-NEXT: csel w8, w10, w8, lt
1333 ; CHECK-NEXT: cmn w8, #128
1334 ; CHECK-NEXT: csel w8, w8, w11, gt
1335 ; CHECK-NEXT: fmov s0, w8
1336 ; CHECK-NEXT: mov v0.s[1], w9
1337 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1339 %x = call <2 x i8> @llvm.fptosi.sat.v2f64.v2i8(<2 x double> %f)
1343 define <2 x i13> @test_signed_v2f64_v2i13(<2 x double> %f) {
1344 ; CHECK-LABEL: test_signed_v2f64_v2i13:
1346 ; CHECK-NEXT: mov d1, v0.d[1]
1347 ; CHECK-NEXT: fcvtzs w10, d0
1348 ; CHECK-NEXT: mov w8, #4095 // =0xfff
1349 ; CHECK-NEXT: mov w11, #-4096 // =0xfffff000
1350 ; CHECK-NEXT: fcvtzs w9, d1
1351 ; CHECK-NEXT: cmp w9, #4095
1352 ; CHECK-NEXT: csel w9, w9, w8, lt
1353 ; CHECK-NEXT: cmn w9, #1, lsl #12 // =4096
1354 ; CHECK-NEXT: csel w9, w9, w11, gt
1355 ; CHECK-NEXT: cmp w10, #4095
1356 ; CHECK-NEXT: csel w8, w10, w8, lt
1357 ; CHECK-NEXT: cmn w8, #1, lsl #12 // =4096
1358 ; CHECK-NEXT: csel w8, w8, w11, gt
1359 ; CHECK-NEXT: fmov s0, w8
1360 ; CHECK-NEXT: mov v0.s[1], w9
1361 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1363 %x = call <2 x i13> @llvm.fptosi.sat.v2f64.v2i13(<2 x double> %f)
1367 define <2 x i16> @test_signed_v2f64_v2i16(<2 x double> %f) {
1368 ; CHECK-LABEL: test_signed_v2f64_v2i16:
1370 ; CHECK-NEXT: mov d1, v0.d[1]
1371 ; CHECK-NEXT: mov w8, #32767 // =0x7fff
1372 ; CHECK-NEXT: fcvtzs w10, d0
1373 ; CHECK-NEXT: mov w11, #-32768 // =0xffff8000
1374 ; CHECK-NEXT: fcvtzs w9, d1
1375 ; CHECK-NEXT: cmp w9, w8
1376 ; CHECK-NEXT: csel w9, w9, w8, lt
1377 ; CHECK-NEXT: cmn w9, #8, lsl #12 // =32768
1378 ; CHECK-NEXT: csel w9, w9, w11, gt
1379 ; CHECK-NEXT: cmp w10, w8
1380 ; CHECK-NEXT: csel w8, w10, w8, lt
1381 ; CHECK-NEXT: cmn w8, #8, lsl #12 // =32768
1382 ; CHECK-NEXT: csel w8, w8, w11, gt
1383 ; CHECK-NEXT: fmov s0, w8
1384 ; CHECK-NEXT: mov v0.s[1], w9
1385 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1387 %x = call <2 x i16> @llvm.fptosi.sat.v2f64.v2i16(<2 x double> %f)
1391 define <2 x i19> @test_signed_v2f64_v2i19(<2 x double> %f) {
1392 ; CHECK-LABEL: test_signed_v2f64_v2i19:
1394 ; CHECK-NEXT: mov d1, v0.d[1]
1395 ; CHECK-NEXT: mov w8, #262143 // =0x3ffff
1396 ; CHECK-NEXT: fcvtzs w10, d0
1397 ; CHECK-NEXT: mov w11, #-262144 // =0xfffc0000
1398 ; CHECK-NEXT: fcvtzs w9, d1
1399 ; CHECK-NEXT: cmp w9, w8
1400 ; CHECK-NEXT: csel w9, w9, w8, lt
1401 ; CHECK-NEXT: cmn w9, #64, lsl #12 // =262144
1402 ; CHECK-NEXT: csel w9, w9, w11, gt
1403 ; CHECK-NEXT: cmp w10, w8
1404 ; CHECK-NEXT: csel w8, w10, w8, lt
1405 ; CHECK-NEXT: cmn w8, #64, lsl #12 // =262144
1406 ; CHECK-NEXT: csel w8, w8, w11, gt
1407 ; CHECK-NEXT: fmov s0, w8
1408 ; CHECK-NEXT: mov v0.s[1], w9
1409 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1411 %x = call <2 x i19> @llvm.fptosi.sat.v2f64.v2i19(<2 x double> %f)
1415 define <2 x i32> @test_signed_v2f64_v2i32_duplicate(<2 x double> %f) {
1416 ; CHECK-LABEL: test_signed_v2f64_v2i32_duplicate:
1418 ; CHECK-NEXT: mov d1, v0.d[1]
1419 ; CHECK-NEXT: fcvtzs w8, d0
1420 ; CHECK-NEXT: fcvtzs w9, d1
1421 ; CHECK-NEXT: fmov s0, w8
1422 ; CHECK-NEXT: mov v0.s[1], w9
1423 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1425 %x = call <2 x i32> @llvm.fptosi.sat.v2f64.v2i32(<2 x double> %f)
1429 define <2 x i50> @test_signed_v2f64_v2i50(<2 x double> %f) {
1430 ; CHECK-LABEL: test_signed_v2f64_v2i50:
1432 ; CHECK-NEXT: mov d1, v0.d[1]
1433 ; CHECK-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
1434 ; CHECK-NEXT: fcvtzs x10, d0
1435 ; CHECK-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
1436 ; CHECK-NEXT: fcvtzs x9, d1
1437 ; CHECK-NEXT: cmp x9, x8
1438 ; CHECK-NEXT: csel x9, x9, x8, lt
1439 ; CHECK-NEXT: cmp x9, x11
1440 ; CHECK-NEXT: csel x9, x9, x11, gt
1441 ; CHECK-NEXT: cmp x10, x8
1442 ; CHECK-NEXT: csel x8, x10, x8, lt
1443 ; CHECK-NEXT: cmp x8, x11
1444 ; CHECK-NEXT: csel x8, x8, x11, gt
1445 ; CHECK-NEXT: fmov d0, x8
1446 ; CHECK-NEXT: mov v0.d[1], x9
1448 %x = call <2 x i50> @llvm.fptosi.sat.v2f64.v2i50(<2 x double> %f)
1452 define <2 x i64> @test_signed_v2f64_v2i64(<2 x double> %f) {
1453 ; CHECK-LABEL: test_signed_v2f64_v2i64:
1455 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
1457 %x = call <2 x i64> @llvm.fptosi.sat.v2f64.v2i64(<2 x double> %f)
1461 define <2 x i100> @test_signed_v2f64_v2i100(<2 x double> %f) {
1462 ; CHECK-LABEL: test_signed_v2f64_v2i100:
1464 ; CHECK-NEXT: sub sp, sp, #80
1465 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
1466 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
1467 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
1468 ; CHECK-NEXT: stp x22, x21, [sp, #48] // 16-byte Folded Spill
1469 ; CHECK-NEXT: stp x20, x19, [sp, #64] // 16-byte Folded Spill
1470 ; CHECK-NEXT: .cfi_def_cfa_offset 80
1471 ; CHECK-NEXT: .cfi_offset w19, -8
1472 ; CHECK-NEXT: .cfi_offset w20, -16
1473 ; CHECK-NEXT: .cfi_offset w21, -24
1474 ; CHECK-NEXT: .cfi_offset w22, -32
1475 ; CHECK-NEXT: .cfi_offset w30, -40
1476 ; CHECK-NEXT: .cfi_offset b8, -48
1477 ; CHECK-NEXT: .cfi_offset b9, -56
1478 ; CHECK-NEXT: .cfi_offset b10, -64
1479 ; CHECK-NEXT: mov d8, v0.d[1]
1480 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1481 ; CHECK-NEXT: fmov d0, d8
1482 ; CHECK-NEXT: bl __fixdfti
1483 ; CHECK-NEXT: mov x8, #-4170333254945079296 // =0xc620000000000000
1484 ; CHECK-NEXT: mov x21, #-34359738368 // =0xfffffff800000000
1485 ; CHECK-NEXT: mov x22, #34359738367 // =0x7ffffffff
1486 ; CHECK-NEXT: fmov d9, x8
1487 ; CHECK-NEXT: mov x8, #5053038781909696511 // =0x461fffffffffffff
1488 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1489 ; CHECK-NEXT: fmov d10, x8
1490 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1491 ; CHECK-NEXT: fcmp d8, d9
1492 ; CHECK-NEXT: csel x8, xzr, x0, lt
1493 ; CHECK-NEXT: csel x9, x21, x1, lt
1494 ; CHECK-NEXT: fcmp d8, d10
1495 ; CHECK-NEXT: csel x9, x22, x9, gt
1496 ; CHECK-NEXT: csinv x8, x8, xzr, le
1497 ; CHECK-NEXT: fcmp d8, d8
1498 ; CHECK-NEXT: csel x19, xzr, x8, vs
1499 ; CHECK-NEXT: csel x20, xzr, x9, vs
1500 ; CHECK-NEXT: bl __fixdfti
1501 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1502 ; CHECK-NEXT: mov x2, x19
1503 ; CHECK-NEXT: mov x3, x20
1504 ; CHECK-NEXT: ldp x20, x19, [sp, #64] // 16-byte Folded Reload
1505 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
1506 ; CHECK-NEXT: fcmp d0, d9
1507 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
1508 ; CHECK-NEXT: csel x8, x21, x1, lt
1509 ; CHECK-NEXT: csel x9, xzr, x0, lt
1510 ; CHECK-NEXT: fcmp d0, d10
1511 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
1512 ; CHECK-NEXT: csinv x9, x9, xzr, le
1513 ; CHECK-NEXT: csel x8, x22, x8, gt
1514 ; CHECK-NEXT: fcmp d0, d0
1515 ; CHECK-NEXT: ldp x22, x21, [sp, #48] // 16-byte Folded Reload
1516 ; CHECK-NEXT: csel x9, xzr, x9, vs
1517 ; CHECK-NEXT: csel x1, xzr, x8, vs
1518 ; CHECK-NEXT: fmov d0, x9
1519 ; CHECK-NEXT: mov v0.d[1], x1
1520 ; CHECK-NEXT: fmov x0, d0
1521 ; CHECK-NEXT: add sp, sp, #80
1523 %x = call <2 x i100> @llvm.fptosi.sat.v2f64.v2i100(<2 x double> %f)
1527 define <2 x i128> @test_signed_v2f64_v2i128(<2 x double> %f) {
1528 ; CHECK-LABEL: test_signed_v2f64_v2i128:
1530 ; CHECK-NEXT: sub sp, sp, #80
1531 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
1532 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
1533 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
1534 ; CHECK-NEXT: stp x22, x21, [sp, #48] // 16-byte Folded Spill
1535 ; CHECK-NEXT: stp x20, x19, [sp, #64] // 16-byte Folded Spill
1536 ; CHECK-NEXT: .cfi_def_cfa_offset 80
1537 ; CHECK-NEXT: .cfi_offset w19, -8
1538 ; CHECK-NEXT: .cfi_offset w20, -16
1539 ; CHECK-NEXT: .cfi_offset w21, -24
1540 ; CHECK-NEXT: .cfi_offset w22, -32
1541 ; CHECK-NEXT: .cfi_offset w30, -40
1542 ; CHECK-NEXT: .cfi_offset b8, -48
1543 ; CHECK-NEXT: .cfi_offset b9, -56
1544 ; CHECK-NEXT: .cfi_offset b10, -64
1545 ; CHECK-NEXT: mov d8, v0.d[1]
1546 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1547 ; CHECK-NEXT: fmov d0, d8
1548 ; CHECK-NEXT: bl __fixdfti
1549 ; CHECK-NEXT: mov x8, #-4044232465378705408 // =0xc7e0000000000000
1550 ; CHECK-NEXT: mov x21, #-9223372036854775808 // =0x8000000000000000
1551 ; CHECK-NEXT: mov x22, #9223372036854775807 // =0x7fffffffffffffff
1552 ; CHECK-NEXT: fmov d9, x8
1553 ; CHECK-NEXT: mov x8, #5179139571476070399 // =0x47dfffffffffffff
1554 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1555 ; CHECK-NEXT: fmov d10, x8
1556 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1557 ; CHECK-NEXT: fcmp d8, d9
1558 ; CHECK-NEXT: csel x8, xzr, x0, lt
1559 ; CHECK-NEXT: csel x9, x21, x1, lt
1560 ; CHECK-NEXT: fcmp d8, d10
1561 ; CHECK-NEXT: csel x9, x22, x9, gt
1562 ; CHECK-NEXT: csinv x8, x8, xzr, le
1563 ; CHECK-NEXT: fcmp d8, d8
1564 ; CHECK-NEXT: csel x19, xzr, x8, vs
1565 ; CHECK-NEXT: csel x20, xzr, x9, vs
1566 ; CHECK-NEXT: bl __fixdfti
1567 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1568 ; CHECK-NEXT: mov x2, x19
1569 ; CHECK-NEXT: mov x3, x20
1570 ; CHECK-NEXT: ldp x20, x19, [sp, #64] // 16-byte Folded Reload
1571 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
1572 ; CHECK-NEXT: fcmp d0, d9
1573 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
1574 ; CHECK-NEXT: csel x8, x21, x1, lt
1575 ; CHECK-NEXT: csel x9, xzr, x0, lt
1576 ; CHECK-NEXT: fcmp d0, d10
1577 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
1578 ; CHECK-NEXT: csinv x9, x9, xzr, le
1579 ; CHECK-NEXT: csel x8, x22, x8, gt
1580 ; CHECK-NEXT: fcmp d0, d0
1581 ; CHECK-NEXT: ldp x22, x21, [sp, #48] // 16-byte Folded Reload
1582 ; CHECK-NEXT: csel x9, xzr, x9, vs
1583 ; CHECK-NEXT: csel x1, xzr, x8, vs
1584 ; CHECK-NEXT: fmov d0, x9
1585 ; CHECK-NEXT: mov v0.d[1], x1
1586 ; CHECK-NEXT: fmov x0, d0
1587 ; CHECK-NEXT: add sp, sp, #80
1589 %x = call <2 x i128> @llvm.fptosi.sat.v2f64.v2i128(<2 x double> %f)
1594 ; 4-Vector half to signed integer -- result size variation
1597 declare <4 x i1> @llvm.fptosi.sat.v4f16.v4i1 (<4 x half>)
1598 declare <4 x i8> @llvm.fptosi.sat.v4f16.v4i8 (<4 x half>)
1599 declare <4 x i13> @llvm.fptosi.sat.v4f16.v4i13 (<4 x half>)
1600 declare <4 x i16> @llvm.fptosi.sat.v4f16.v4i16 (<4 x half>)
1601 declare <4 x i19> @llvm.fptosi.sat.v4f16.v4i19 (<4 x half>)
1602 declare <4 x i50> @llvm.fptosi.sat.v4f16.v4i50 (<4 x half>)
1603 declare <4 x i64> @llvm.fptosi.sat.v4f16.v4i64 (<4 x half>)
1604 declare <4 x i100> @llvm.fptosi.sat.v4f16.v4i100(<4 x half>)
1605 declare <4 x i128> @llvm.fptosi.sat.v4f16.v4i128(<4 x half>)
1607 define <4 x i1> @test_signed_v4f16_v4i1(<4 x half> %f) {
1608 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i1:
1609 ; CHECK-CVT: // %bb.0:
1610 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1611 ; CHECK-CVT-NEXT: movi v1.2d, #0000000000000000
1612 ; CHECK-CVT-NEXT: fcvtzs v0.4s, v0.4s
1613 ; CHECK-CVT-NEXT: smin v0.4s, v0.4s, v1.4s
1614 ; CHECK-CVT-NEXT: movi v1.2d, #0xffffffffffffffff
1615 ; CHECK-CVT-NEXT: smax v0.4s, v0.4s, v1.4s
1616 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1617 ; CHECK-CVT-NEXT: ret
1619 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i1:
1620 ; CHECK-FP16: // %bb.0:
1621 ; CHECK-FP16-NEXT: movi v1.2d, #0000000000000000
1622 ; CHECK-FP16-NEXT: fcvtzs v0.4h, v0.4h
1623 ; CHECK-FP16-NEXT: smin v0.4h, v0.4h, v1.4h
1624 ; CHECK-FP16-NEXT: movi v1.2d, #0xffffffffffffffff
1625 ; CHECK-FP16-NEXT: smax v0.4h, v0.4h, v1.4h
1626 ; CHECK-FP16-NEXT: ret
1627 %x = call <4 x i1> @llvm.fptosi.sat.v4f16.v4i1(<4 x half> %f)
1631 define <4 x i8> @test_signed_v4f16_v4i8(<4 x half> %f) {
1632 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i8:
1633 ; CHECK-CVT: // %bb.0:
1634 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1635 ; CHECK-CVT-NEXT: movi v1.4s, #127
1636 ; CHECK-CVT-NEXT: fcvtzs v0.4s, v0.4s
1637 ; CHECK-CVT-NEXT: smin v0.4s, v0.4s, v1.4s
1638 ; CHECK-CVT-NEXT: mvni v1.4s, #127
1639 ; CHECK-CVT-NEXT: smax v0.4s, v0.4s, v1.4s
1640 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1641 ; CHECK-CVT-NEXT: ret
1643 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i8:
1644 ; CHECK-FP16: // %bb.0:
1645 ; CHECK-FP16-NEXT: movi v1.4h, #127
1646 ; CHECK-FP16-NEXT: fcvtzs v0.4h, v0.4h
1647 ; CHECK-FP16-NEXT: smin v0.4h, v0.4h, v1.4h
1648 ; CHECK-FP16-NEXT: mvni v1.4h, #127
1649 ; CHECK-FP16-NEXT: smax v0.4h, v0.4h, v1.4h
1650 ; CHECK-FP16-NEXT: ret
1651 %x = call <4 x i8> @llvm.fptosi.sat.v4f16.v4i8(<4 x half> %f)
1655 define <4 x i13> @test_signed_v4f16_v4i13(<4 x half> %f) {
1656 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i13:
1657 ; CHECK-CVT: // %bb.0:
1658 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1659 ; CHECK-CVT-NEXT: movi v1.4s, #15, msl #8
1660 ; CHECK-CVT-NEXT: fcvtzs v0.4s, v0.4s
1661 ; CHECK-CVT-NEXT: smin v0.4s, v0.4s, v1.4s
1662 ; CHECK-CVT-NEXT: mvni v1.4s, #15, msl #8
1663 ; CHECK-CVT-NEXT: smax v0.4s, v0.4s, v1.4s
1664 ; CHECK-CVT-NEXT: xtn v0.4h, v0.4s
1665 ; CHECK-CVT-NEXT: ret
1667 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i13:
1668 ; CHECK-FP16: // %bb.0:
1669 ; CHECK-FP16-NEXT: fcvtzs v0.4h, v0.4h
1670 ; CHECK-FP16-NEXT: mvni v1.4h, #240, lsl #8
1671 ; CHECK-FP16-NEXT: smin v0.4h, v0.4h, v1.4h
1672 ; CHECK-FP16-NEXT: movi v1.4h, #240, lsl #8
1673 ; CHECK-FP16-NEXT: smax v0.4h, v0.4h, v1.4h
1674 ; CHECK-FP16-NEXT: ret
1675 %x = call <4 x i13> @llvm.fptosi.sat.v4f16.v4i13(<4 x half> %f)
1679 define <4 x i16> @test_signed_v4f16_v4i16(<4 x half> %f) {
1680 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i16:
1681 ; CHECK-CVT: // %bb.0:
1682 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
1683 ; CHECK-CVT-NEXT: fcvtzs v0.4s, v0.4s
1684 ; CHECK-CVT-NEXT: sqxtn v0.4h, v0.4s
1685 ; CHECK-CVT-NEXT: ret
1687 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i16:
1688 ; CHECK-FP16: // %bb.0:
1689 ; CHECK-FP16-NEXT: fcvtzs v0.4h, v0.4h
1690 ; CHECK-FP16-NEXT: ret
1691 %x = call <4 x i16> @llvm.fptosi.sat.v4f16.v4i16(<4 x half> %f)
1695 define <4 x i19> @test_signed_v4f16_v4i19(<4 x half> %f) {
1696 ; CHECK-LABEL: test_signed_v4f16_v4i19:
1698 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
1699 ; CHECK-NEXT: movi v1.4s, #3, msl #16
1700 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
1701 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1702 ; CHECK-NEXT: mvni v1.4s, #3, msl #16
1703 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1705 %x = call <4 x i19> @llvm.fptosi.sat.v4f16.v4i19(<4 x half> %f)
1709 define <4 x i32> @test_signed_v4f16_v4i32_duplicate(<4 x half> %f) {
1710 ; CHECK-LABEL: test_signed_v4f16_v4i32_duplicate:
1712 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
1713 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
1715 %x = call <4 x i32> @llvm.fptosi.sat.v4f16.v4i32(<4 x half> %f)
1719 define <4 x i50> @test_signed_v4f16_v4i50(<4 x half> %f) {
1720 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i50:
1721 ; CHECK-CVT: // %bb.0:
1722 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1723 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
1724 ; CHECK-CVT-NEXT: fcvt s2, h0
1725 ; CHECK-CVT-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
1726 ; CHECK-CVT-NEXT: mov h3, v0.h[2]
1727 ; CHECK-CVT-NEXT: mov h0, v0.h[3]
1728 ; CHECK-CVT-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
1729 ; CHECK-CVT-NEXT: fcvt s1, h1
1730 ; CHECK-CVT-NEXT: fcvtzs x9, s2
1731 ; CHECK-CVT-NEXT: fcvt s2, h3
1732 ; CHECK-CVT-NEXT: fcvt s0, h0
1733 ; CHECK-CVT-NEXT: fcvtzs x10, s1
1734 ; CHECK-CVT-NEXT: cmp x9, x8
1735 ; CHECK-CVT-NEXT: csel x9, x9, x8, lt
1736 ; CHECK-CVT-NEXT: fcvtzs x12, s2
1737 ; CHECK-CVT-NEXT: cmp x9, x11
1738 ; CHECK-CVT-NEXT: csel x0, x9, x11, gt
1739 ; CHECK-CVT-NEXT: cmp x10, x8
1740 ; CHECK-CVT-NEXT: csel x9, x10, x8, lt
1741 ; CHECK-CVT-NEXT: fcvtzs x10, s0
1742 ; CHECK-CVT-NEXT: cmp x9, x11
1743 ; CHECK-CVT-NEXT: csel x1, x9, x11, gt
1744 ; CHECK-CVT-NEXT: cmp x12, x8
1745 ; CHECK-CVT-NEXT: csel x9, x12, x8, lt
1746 ; CHECK-CVT-NEXT: cmp x9, x11
1747 ; CHECK-CVT-NEXT: csel x2, x9, x11, gt
1748 ; CHECK-CVT-NEXT: cmp x10, x8
1749 ; CHECK-CVT-NEXT: csel x8, x10, x8, lt
1750 ; CHECK-CVT-NEXT: cmp x8, x11
1751 ; CHECK-CVT-NEXT: csel x3, x8, x11, gt
1752 ; CHECK-CVT-NEXT: ret
1754 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i50:
1755 ; CHECK-FP16: // %bb.0:
1756 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1757 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
1758 ; CHECK-FP16-NEXT: fcvtzs x9, h0
1759 ; CHECK-FP16-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
1760 ; CHECK-FP16-NEXT: mov h2, v0.h[2]
1761 ; CHECK-FP16-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
1762 ; CHECK-FP16-NEXT: mov h0, v0.h[3]
1763 ; CHECK-FP16-NEXT: fcvtzs x10, h1
1764 ; CHECK-FP16-NEXT: cmp x9, x8
1765 ; CHECK-FP16-NEXT: csel x9, x9, x8, lt
1766 ; CHECK-FP16-NEXT: fcvtzs x12, h2
1767 ; CHECK-FP16-NEXT: cmp x9, x11
1768 ; CHECK-FP16-NEXT: csel x0, x9, x11, gt
1769 ; CHECK-FP16-NEXT: cmp x10, x8
1770 ; CHECK-FP16-NEXT: csel x9, x10, x8, lt
1771 ; CHECK-FP16-NEXT: fcvtzs x10, h0
1772 ; CHECK-FP16-NEXT: cmp x9, x11
1773 ; CHECK-FP16-NEXT: csel x1, x9, x11, gt
1774 ; CHECK-FP16-NEXT: cmp x12, x8
1775 ; CHECK-FP16-NEXT: csel x9, x12, x8, lt
1776 ; CHECK-FP16-NEXT: cmp x9, x11
1777 ; CHECK-FP16-NEXT: csel x2, x9, x11, gt
1778 ; CHECK-FP16-NEXT: cmp x10, x8
1779 ; CHECK-FP16-NEXT: csel x8, x10, x8, lt
1780 ; CHECK-FP16-NEXT: cmp x8, x11
1781 ; CHECK-FP16-NEXT: csel x3, x8, x11, gt
1782 ; CHECK-FP16-NEXT: ret
1783 %x = call <4 x i50> @llvm.fptosi.sat.v4f16.v4i50(<4 x half> %f)
1787 define <4 x i64> @test_signed_v4f16_v4i64(<4 x half> %f) {
1788 ; CHECK-CVT-LABEL: test_signed_v4f16_v4i64:
1789 ; CHECK-CVT: // %bb.0:
1790 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1791 ; CHECK-CVT-NEXT: mov h1, v0.h[2]
1792 ; CHECK-CVT-NEXT: mov h2, v0.h[1]
1793 ; CHECK-CVT-NEXT: mov h3, v0.h[3]
1794 ; CHECK-CVT-NEXT: fcvt s0, h0
1795 ; CHECK-CVT-NEXT: fcvt s1, h1
1796 ; CHECK-CVT-NEXT: fcvt s2, h2
1797 ; CHECK-CVT-NEXT: fcvt s3, h3
1798 ; CHECK-CVT-NEXT: fcvtzs x8, s0
1799 ; CHECK-CVT-NEXT: fcvtzs x9, s1
1800 ; CHECK-CVT-NEXT: fcvtzs x10, s2
1801 ; CHECK-CVT-NEXT: fcvtzs x11, s3
1802 ; CHECK-CVT-NEXT: fmov d0, x8
1803 ; CHECK-CVT-NEXT: fmov d1, x9
1804 ; CHECK-CVT-NEXT: mov v0.d[1], x10
1805 ; CHECK-CVT-NEXT: mov v1.d[1], x11
1806 ; CHECK-CVT-NEXT: ret
1808 ; CHECK-FP16-LABEL: test_signed_v4f16_v4i64:
1809 ; CHECK-FP16: // %bb.0:
1810 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1811 ; CHECK-FP16-NEXT: mov h1, v0.h[2]
1812 ; CHECK-FP16-NEXT: mov h2, v0.h[1]
1813 ; CHECK-FP16-NEXT: mov h3, v0.h[3]
1814 ; CHECK-FP16-NEXT: fcvtzs x8, h0
1815 ; CHECK-FP16-NEXT: fcvtzs x9, h1
1816 ; CHECK-FP16-NEXT: fcvtzs x10, h2
1817 ; CHECK-FP16-NEXT: fcvtzs x11, h3
1818 ; CHECK-FP16-NEXT: fmov d0, x8
1819 ; CHECK-FP16-NEXT: fmov d1, x9
1820 ; CHECK-FP16-NEXT: mov v0.d[1], x10
1821 ; CHECK-FP16-NEXT: mov v1.d[1], x11
1822 ; CHECK-FP16-NEXT: ret
1823 %x = call <4 x i64> @llvm.fptosi.sat.v4f16.v4i64(<4 x half> %f)
1827 define <4 x i100> @test_signed_v4f16_v4i100(<4 x half> %f) {
1828 ; CHECK-LABEL: test_signed_v4f16_v4i100:
1830 ; CHECK-NEXT: sub sp, sp, #112
1831 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
1832 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
1833 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
1834 ; CHECK-NEXT: stp x26, x25, [sp, #48] // 16-byte Folded Spill
1835 ; CHECK-NEXT: stp x24, x23, [sp, #64] // 16-byte Folded Spill
1836 ; CHECK-NEXT: stp x22, x21, [sp, #80] // 16-byte Folded Spill
1837 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
1838 ; CHECK-NEXT: .cfi_def_cfa_offset 112
1839 ; CHECK-NEXT: .cfi_offset w19, -8
1840 ; CHECK-NEXT: .cfi_offset w20, -16
1841 ; CHECK-NEXT: .cfi_offset w21, -24
1842 ; CHECK-NEXT: .cfi_offset w22, -32
1843 ; CHECK-NEXT: .cfi_offset w23, -40
1844 ; CHECK-NEXT: .cfi_offset w24, -48
1845 ; CHECK-NEXT: .cfi_offset w25, -56
1846 ; CHECK-NEXT: .cfi_offset w26, -64
1847 ; CHECK-NEXT: .cfi_offset w30, -72
1848 ; CHECK-NEXT: .cfi_offset b8, -80
1849 ; CHECK-NEXT: .cfi_offset b9, -88
1850 ; CHECK-NEXT: .cfi_offset b10, -96
1851 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1852 ; CHECK-NEXT: mov h1, v0.h[1]
1853 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1854 ; CHECK-NEXT: fcvt s8, h1
1855 ; CHECK-NEXT: fmov s0, s8
1856 ; CHECK-NEXT: bl __fixsfti
1857 ; CHECK-NEXT: movi v9.2s, #241, lsl #24
1858 ; CHECK-NEXT: mov w8, #1895825407 // =0x70ffffff
1859 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1860 ; CHECK-NEXT: fmov s10, w8
1861 ; CHECK-NEXT: mov x25, #-34359738368 // =0xfffffff800000000
1862 ; CHECK-NEXT: mov x26, #34359738367 // =0x7ffffffff
1863 ; CHECK-NEXT: mov h0, v0.h[2]
1864 ; CHECK-NEXT: fcmp s8, s9
1865 ; CHECK-NEXT: csel x8, xzr, x0, lt
1866 ; CHECK-NEXT: csel x9, x25, x1, lt
1867 ; CHECK-NEXT: fcmp s8, s10
1868 ; CHECK-NEXT: csel x9, x26, x9, gt
1869 ; CHECK-NEXT: csinv x8, x8, xzr, le
1870 ; CHECK-NEXT: fcmp s8, s8
1871 ; CHECK-NEXT: fcvt s8, h0
1872 ; CHECK-NEXT: csel x19, xzr, x8, vs
1873 ; CHECK-NEXT: csel x20, xzr, x9, vs
1874 ; CHECK-NEXT: fmov s0, s8
1875 ; CHECK-NEXT: bl __fixsfti
1876 ; CHECK-NEXT: fcmp s8, s9
1877 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1878 ; CHECK-NEXT: mov h0, v0.h[3]
1879 ; CHECK-NEXT: csel x8, xzr, x0, lt
1880 ; CHECK-NEXT: csel x9, x25, x1, lt
1881 ; CHECK-NEXT: fcmp s8, s10
1882 ; CHECK-NEXT: csel x9, x26, x9, gt
1883 ; CHECK-NEXT: csinv x8, x8, xzr, le
1884 ; CHECK-NEXT: fcmp s8, s8
1885 ; CHECK-NEXT: fcvt s8, h0
1886 ; CHECK-NEXT: csel x21, xzr, x8, vs
1887 ; CHECK-NEXT: csel x22, xzr, x9, vs
1888 ; CHECK-NEXT: fmov s0, s8
1889 ; CHECK-NEXT: bl __fixsfti
1890 ; CHECK-NEXT: fcmp s8, s9
1891 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1892 ; CHECK-NEXT: csel x8, xzr, x0, lt
1893 ; CHECK-NEXT: csel x9, x25, x1, lt
1894 ; CHECK-NEXT: fcmp s8, s10
1895 ; CHECK-NEXT: csel x9, x26, x9, gt
1896 ; CHECK-NEXT: csinv x8, x8, xzr, le
1897 ; CHECK-NEXT: fcmp s8, s8
1898 ; CHECK-NEXT: fcvt s8, h0
1899 ; CHECK-NEXT: csel x23, xzr, x8, vs
1900 ; CHECK-NEXT: csel x24, xzr, x9, vs
1901 ; CHECK-NEXT: fmov s0, s8
1902 ; CHECK-NEXT: bl __fixsfti
1903 ; CHECK-NEXT: fcmp s8, s9
1904 ; CHECK-NEXT: mov x2, x19
1905 ; CHECK-NEXT: mov x3, x20
1906 ; CHECK-NEXT: mov x4, x21
1907 ; CHECK-NEXT: mov x5, x22
1908 ; CHECK-NEXT: mov x6, x23
1909 ; CHECK-NEXT: mov x7, x24
1910 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
1911 ; CHECK-NEXT: csel x8, x25, x1, lt
1912 ; CHECK-NEXT: csel x9, xzr, x0, lt
1913 ; CHECK-NEXT: fcmp s8, s10
1914 ; CHECK-NEXT: ldp x22, x21, [sp, #80] // 16-byte Folded Reload
1915 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
1916 ; CHECK-NEXT: ldp x24, x23, [sp, #64] // 16-byte Folded Reload
1917 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
1918 ; CHECK-NEXT: csinv x9, x9, xzr, le
1919 ; CHECK-NEXT: csel x8, x26, x8, gt
1920 ; CHECK-NEXT: fcmp s8, s8
1921 ; CHECK-NEXT: ldp x26, x25, [sp, #48] // 16-byte Folded Reload
1922 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
1923 ; CHECK-NEXT: csel x9, xzr, x9, vs
1924 ; CHECK-NEXT: csel x1, xzr, x8, vs
1925 ; CHECK-NEXT: fmov d0, x9
1926 ; CHECK-NEXT: mov v0.d[1], x1
1927 ; CHECK-NEXT: fmov x0, d0
1928 ; CHECK-NEXT: add sp, sp, #112
1930 %x = call <4 x i100> @llvm.fptosi.sat.v4f16.v4i100(<4 x half> %f)
1934 define <4 x i128> @test_signed_v4f16_v4i128(<4 x half> %f) {
1935 ; CHECK-LABEL: test_signed_v4f16_v4i128:
1937 ; CHECK-NEXT: sub sp, sp, #112
1938 ; CHECK-NEXT: str d10, [sp, #16] // 8-byte Folded Spill
1939 ; CHECK-NEXT: stp d9, d8, [sp, #24] // 16-byte Folded Spill
1940 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
1941 ; CHECK-NEXT: stp x26, x25, [sp, #48] // 16-byte Folded Spill
1942 ; CHECK-NEXT: stp x24, x23, [sp, #64] // 16-byte Folded Spill
1943 ; CHECK-NEXT: stp x22, x21, [sp, #80] // 16-byte Folded Spill
1944 ; CHECK-NEXT: stp x20, x19, [sp, #96] // 16-byte Folded Spill
1945 ; CHECK-NEXT: .cfi_def_cfa_offset 112
1946 ; CHECK-NEXT: .cfi_offset w19, -8
1947 ; CHECK-NEXT: .cfi_offset w20, -16
1948 ; CHECK-NEXT: .cfi_offset w21, -24
1949 ; CHECK-NEXT: .cfi_offset w22, -32
1950 ; CHECK-NEXT: .cfi_offset w23, -40
1951 ; CHECK-NEXT: .cfi_offset w24, -48
1952 ; CHECK-NEXT: .cfi_offset w25, -56
1953 ; CHECK-NEXT: .cfi_offset w26, -64
1954 ; CHECK-NEXT: .cfi_offset w30, -72
1955 ; CHECK-NEXT: .cfi_offset b8, -80
1956 ; CHECK-NEXT: .cfi_offset b9, -88
1957 ; CHECK-NEXT: .cfi_offset b10, -96
1958 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1959 ; CHECK-NEXT: mov h1, v0.h[1]
1960 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1961 ; CHECK-NEXT: fcvt s8, h1
1962 ; CHECK-NEXT: fmov s0, s8
1963 ; CHECK-NEXT: bl __fixsfti
1964 ; CHECK-NEXT: movi v9.2s, #255, lsl #24
1965 ; CHECK-NEXT: mov w8, #2130706431 // =0x7effffff
1966 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1967 ; CHECK-NEXT: fmov s10, w8
1968 ; CHECK-NEXT: mov x25, #-9223372036854775808 // =0x8000000000000000
1969 ; CHECK-NEXT: mov x26, #9223372036854775807 // =0x7fffffffffffffff
1970 ; CHECK-NEXT: mov h0, v0.h[2]
1971 ; CHECK-NEXT: fcmp s8, s9
1972 ; CHECK-NEXT: csel x8, xzr, x0, lt
1973 ; CHECK-NEXT: csel x9, x25, x1, lt
1974 ; CHECK-NEXT: fcmp s8, s10
1975 ; CHECK-NEXT: csel x9, x26, x9, gt
1976 ; CHECK-NEXT: csinv x8, x8, xzr, le
1977 ; CHECK-NEXT: fcmp s8, s8
1978 ; CHECK-NEXT: fcvt s8, h0
1979 ; CHECK-NEXT: csel x19, xzr, x8, vs
1980 ; CHECK-NEXT: csel x20, xzr, x9, vs
1981 ; CHECK-NEXT: fmov s0, s8
1982 ; CHECK-NEXT: bl __fixsfti
1983 ; CHECK-NEXT: fcmp s8, s9
1984 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1985 ; CHECK-NEXT: mov h0, v0.h[3]
1986 ; CHECK-NEXT: csel x8, xzr, x0, lt
1987 ; CHECK-NEXT: csel x9, x25, x1, lt
1988 ; CHECK-NEXT: fcmp s8, s10
1989 ; CHECK-NEXT: csel x9, x26, x9, gt
1990 ; CHECK-NEXT: csinv x8, x8, xzr, le
1991 ; CHECK-NEXT: fcmp s8, s8
1992 ; CHECK-NEXT: fcvt s8, h0
1993 ; CHECK-NEXT: csel x21, xzr, x8, vs
1994 ; CHECK-NEXT: csel x22, xzr, x9, vs
1995 ; CHECK-NEXT: fmov s0, s8
1996 ; CHECK-NEXT: bl __fixsfti
1997 ; CHECK-NEXT: fcmp s8, s9
1998 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1999 ; CHECK-NEXT: csel x8, xzr, x0, lt
2000 ; CHECK-NEXT: csel x9, x25, x1, lt
2001 ; CHECK-NEXT: fcmp s8, s10
2002 ; CHECK-NEXT: csel x9, x26, x9, gt
2003 ; CHECK-NEXT: csinv x8, x8, xzr, le
2004 ; CHECK-NEXT: fcmp s8, s8
2005 ; CHECK-NEXT: fcvt s8, h0
2006 ; CHECK-NEXT: csel x23, xzr, x8, vs
2007 ; CHECK-NEXT: csel x24, xzr, x9, vs
2008 ; CHECK-NEXT: fmov s0, s8
2009 ; CHECK-NEXT: bl __fixsfti
2010 ; CHECK-NEXT: fcmp s8, s9
2011 ; CHECK-NEXT: mov x2, x19
2012 ; CHECK-NEXT: mov x3, x20
2013 ; CHECK-NEXT: mov x4, x21
2014 ; CHECK-NEXT: mov x5, x22
2015 ; CHECK-NEXT: mov x6, x23
2016 ; CHECK-NEXT: mov x7, x24
2017 ; CHECK-NEXT: ldp x20, x19, [sp, #96] // 16-byte Folded Reload
2018 ; CHECK-NEXT: csel x8, x25, x1, lt
2019 ; CHECK-NEXT: csel x9, xzr, x0, lt
2020 ; CHECK-NEXT: fcmp s8, s10
2021 ; CHECK-NEXT: ldp x22, x21, [sp, #80] // 16-byte Folded Reload
2022 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
2023 ; CHECK-NEXT: ldp x24, x23, [sp, #64] // 16-byte Folded Reload
2024 ; CHECK-NEXT: ldr d10, [sp, #16] // 8-byte Folded Reload
2025 ; CHECK-NEXT: csinv x9, x9, xzr, le
2026 ; CHECK-NEXT: csel x8, x26, x8, gt
2027 ; CHECK-NEXT: fcmp s8, s8
2028 ; CHECK-NEXT: ldp x26, x25, [sp, #48] // 16-byte Folded Reload
2029 ; CHECK-NEXT: ldp d9, d8, [sp, #24] // 16-byte Folded Reload
2030 ; CHECK-NEXT: csel x9, xzr, x9, vs
2031 ; CHECK-NEXT: csel x1, xzr, x8, vs
2032 ; CHECK-NEXT: fmov d0, x9
2033 ; CHECK-NEXT: mov v0.d[1], x1
2034 ; CHECK-NEXT: fmov x0, d0
2035 ; CHECK-NEXT: add sp, sp, #112
2037 %x = call <4 x i128> @llvm.fptosi.sat.v4f16.v4i128(<4 x half> %f)
2042 ; 8-Vector half to signed integer -- result size variation
2045 declare <8 x i1> @llvm.fptosi.sat.v8f16.v8i1 (<8 x half>)
2046 declare <8 x i8> @llvm.fptosi.sat.v8f16.v8i8 (<8 x half>)
2047 declare <8 x i13> @llvm.fptosi.sat.v8f16.v8i13 (<8 x half>)
2048 declare <8 x i16> @llvm.fptosi.sat.v8f16.v8i16 (<8 x half>)
2049 declare <8 x i19> @llvm.fptosi.sat.v8f16.v8i19 (<8 x half>)
2050 declare <8 x i50> @llvm.fptosi.sat.v8f16.v8i50 (<8 x half>)
2051 declare <8 x i64> @llvm.fptosi.sat.v8f16.v8i64 (<8 x half>)
2052 declare <8 x i100> @llvm.fptosi.sat.v8f16.v8i100(<8 x half>)
2053 declare <8 x i128> @llvm.fptosi.sat.v8f16.v8i128(<8 x half>)
2055 define <8 x i1> @test_signed_v8f16_v8i1(<8 x half> %f) {
2056 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i1:
2057 ; CHECK-CVT: // %bb.0:
2058 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
2059 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2060 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
2061 ; CHECK-CVT-NEXT: fcvtzs w9, s1
2062 ; CHECK-CVT-NEXT: fcvtzs w13, s0
2063 ; CHECK-CVT-NEXT: fcvtzs w8, s2
2064 ; CHECK-CVT-NEXT: mov s2, v1.s[2]
2065 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
2066 ; CHECK-CVT-NEXT: ands w8, w8, w8, asr #31
2067 ; CHECK-CVT-NEXT: fcvtzs w10, s2
2068 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
2069 ; CHECK-CVT-NEXT: fcvtzs w11, s1
2070 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
2071 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2072 ; CHECK-CVT-NEXT: csinv w8, w8, wzr, ge
2073 ; CHECK-CVT-NEXT: ands w9, w9, w9, asr #31
2074 ; CHECK-CVT-NEXT: csinv w9, w9, wzr, ge
2075 ; CHECK-CVT-NEXT: ands w10, w10, w10, asr #31
2076 ; CHECK-CVT-NEXT: fcvtzs w12, s2
2077 ; CHECK-CVT-NEXT: fcvtzs w14, s1
2078 ; CHECK-CVT-NEXT: fmov s1, w9
2079 ; CHECK-CVT-NEXT: fcvtzs w9, s0
2080 ; CHECK-CVT-NEXT: csinv w10, w10, wzr, ge
2081 ; CHECK-CVT-NEXT: ands w11, w11, w11, asr #31
2082 ; CHECK-CVT-NEXT: csinv w11, w11, wzr, ge
2083 ; CHECK-CVT-NEXT: ands w12, w12, w12, asr #31
2084 ; CHECK-CVT-NEXT: mov v1.s[1], w8
2085 ; CHECK-CVT-NEXT: csinv w12, w12, wzr, ge
2086 ; CHECK-CVT-NEXT: ands w13, w13, w13, asr #31
2087 ; CHECK-CVT-NEXT: csinv w13, w13, wzr, ge
2088 ; CHECK-CVT-NEXT: ands w8, w14, w14, asr #31
2089 ; CHECK-CVT-NEXT: mov v1.s[2], w10
2090 ; CHECK-CVT-NEXT: fmov s2, w13
2091 ; CHECK-CVT-NEXT: csinv w8, w8, wzr, ge
2092 ; CHECK-CVT-NEXT: mov v2.s[1], w12
2093 ; CHECK-CVT-NEXT: mov v1.s[3], w11
2094 ; CHECK-CVT-NEXT: mov v2.s[2], w8
2095 ; CHECK-CVT-NEXT: ands w8, w9, w9, asr #31
2096 ; CHECK-CVT-NEXT: csinv w8, w8, wzr, ge
2097 ; CHECK-CVT-NEXT: mov v2.s[3], w8
2098 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
2099 ; CHECK-CVT-NEXT: xtn v0.8b, v0.8h
2100 ; CHECK-CVT-NEXT: ret
2102 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i1:
2103 ; CHECK-FP16: // %bb.0:
2104 ; CHECK-FP16-NEXT: movi v1.2d, #0000000000000000
2105 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
2106 ; CHECK-FP16-NEXT: smin v0.8h, v0.8h, v1.8h
2107 ; CHECK-FP16-NEXT: movi v1.2d, #0xffffffffffffffff
2108 ; CHECK-FP16-NEXT: smax v0.8h, v0.8h, v1.8h
2109 ; CHECK-FP16-NEXT: xtn v0.8b, v0.8h
2110 ; CHECK-FP16-NEXT: ret
2111 %x = call <8 x i1> @llvm.fptosi.sat.v8f16.v8i1(<8 x half> %f)
2115 define <8 x i8> @test_signed_v8f16_v8i8(<8 x half> %f) {
2116 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i8:
2117 ; CHECK-CVT: // %bb.0:
2118 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
2119 ; CHECK-CVT-NEXT: mov w8, #127 // =0x7f
2120 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2121 ; CHECK-CVT-NEXT: mov w11, #-128 // =0xffffff80
2122 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
2123 ; CHECK-CVT-NEXT: fcvtzs w10, s1
2124 ; CHECK-CVT-NEXT: fcvtzs w15, s0
2125 ; CHECK-CVT-NEXT: fcvtzs w9, s2
2126 ; CHECK-CVT-NEXT: mov s2, v1.s[2]
2127 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
2128 ; CHECK-CVT-NEXT: cmp w9, #127
2129 ; CHECK-CVT-NEXT: fcvtzs w12, s2
2130 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
2131 ; CHECK-CVT-NEXT: csel w9, w9, w8, lt
2132 ; CHECK-CVT-NEXT: fcvtzs w13, s1
2133 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
2134 ; CHECK-CVT-NEXT: cmn w9, #128
2135 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2136 ; CHECK-CVT-NEXT: csel w9, w9, w11, gt
2137 ; CHECK-CVT-NEXT: cmp w10, #127
2138 ; CHECK-CVT-NEXT: csel w10, w10, w8, lt
2139 ; CHECK-CVT-NEXT: fcvtzs w14, s2
2140 ; CHECK-CVT-NEXT: cmn w10, #128
2141 ; CHECK-CVT-NEXT: fcvtzs w16, s1
2142 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2143 ; CHECK-CVT-NEXT: cmp w12, #127
2144 ; CHECK-CVT-NEXT: csel w12, w12, w8, lt
2145 ; CHECK-CVT-NEXT: fmov s1, w10
2146 ; CHECK-CVT-NEXT: cmn w12, #128
2147 ; CHECK-CVT-NEXT: csel w12, w12, w11, gt
2148 ; CHECK-CVT-NEXT: cmp w13, #127
2149 ; CHECK-CVT-NEXT: csel w13, w13, w8, lt
2150 ; CHECK-CVT-NEXT: mov v1.s[1], w9
2151 ; CHECK-CVT-NEXT: fcvtzs w9, s0
2152 ; CHECK-CVT-NEXT: cmn w13, #128
2153 ; CHECK-CVT-NEXT: csel w13, w13, w11, gt
2154 ; CHECK-CVT-NEXT: cmp w14, #127
2155 ; CHECK-CVT-NEXT: csel w14, w14, w8, lt
2156 ; CHECK-CVT-NEXT: cmn w14, #128
2157 ; CHECK-CVT-NEXT: mov v1.s[2], w12
2158 ; CHECK-CVT-NEXT: csel w14, w14, w11, gt
2159 ; CHECK-CVT-NEXT: cmp w15, #127
2160 ; CHECK-CVT-NEXT: csel w15, w15, w8, lt
2161 ; CHECK-CVT-NEXT: cmn w15, #128
2162 ; CHECK-CVT-NEXT: csel w10, w15, w11, gt
2163 ; CHECK-CVT-NEXT: cmp w16, #127
2164 ; CHECK-CVT-NEXT: mov v1.s[3], w13
2165 ; CHECK-CVT-NEXT: fmov s2, w10
2166 ; CHECK-CVT-NEXT: csel w10, w16, w8, lt
2167 ; CHECK-CVT-NEXT: cmn w10, #128
2168 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2169 ; CHECK-CVT-NEXT: cmp w9, #127
2170 ; CHECK-CVT-NEXT: mov v2.s[1], w14
2171 ; CHECK-CVT-NEXT: csel w8, w9, w8, lt
2172 ; CHECK-CVT-NEXT: cmn w8, #128
2173 ; CHECK-CVT-NEXT: csel w8, w8, w11, gt
2174 ; CHECK-CVT-NEXT: mov v2.s[2], w10
2175 ; CHECK-CVT-NEXT: mov v2.s[3], w8
2176 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
2177 ; CHECK-CVT-NEXT: xtn v0.8b, v0.8h
2178 ; CHECK-CVT-NEXT: ret
2180 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i8:
2181 ; CHECK-FP16: // %bb.0:
2182 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
2183 ; CHECK-FP16-NEXT: sqxtn v0.8b, v0.8h
2184 ; CHECK-FP16-NEXT: ret
2185 %x = call <8 x i8> @llvm.fptosi.sat.v8f16.v8i8(<8 x half> %f)
2189 define <8 x i13> @test_signed_v8f16_v8i13(<8 x half> %f) {
2190 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i13:
2191 ; CHECK-CVT: // %bb.0:
2192 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
2193 ; CHECK-CVT-NEXT: mov w8, #4095 // =0xfff
2194 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2195 ; CHECK-CVT-NEXT: mov w11, #-4096 // =0xfffff000
2196 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
2197 ; CHECK-CVT-NEXT: fcvtzs w10, s1
2198 ; CHECK-CVT-NEXT: fcvtzs w15, s0
2199 ; CHECK-CVT-NEXT: fcvtzs w9, s2
2200 ; CHECK-CVT-NEXT: mov s2, v1.s[2]
2201 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
2202 ; CHECK-CVT-NEXT: cmp w9, #4095
2203 ; CHECK-CVT-NEXT: fcvtzs w12, s2
2204 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
2205 ; CHECK-CVT-NEXT: csel w9, w9, w8, lt
2206 ; CHECK-CVT-NEXT: fcvtzs w13, s1
2207 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
2208 ; CHECK-CVT-NEXT: cmn w9, #1, lsl #12 // =4096
2209 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2210 ; CHECK-CVT-NEXT: csel w9, w9, w11, gt
2211 ; CHECK-CVT-NEXT: cmp w10, #4095
2212 ; CHECK-CVT-NEXT: csel w10, w10, w8, lt
2213 ; CHECK-CVT-NEXT: fcvtzs w14, s2
2214 ; CHECK-CVT-NEXT: cmn w10, #1, lsl #12 // =4096
2215 ; CHECK-CVT-NEXT: fcvtzs w16, s1
2216 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2217 ; CHECK-CVT-NEXT: cmp w12, #4095
2218 ; CHECK-CVT-NEXT: csel w12, w12, w8, lt
2219 ; CHECK-CVT-NEXT: fmov s1, w10
2220 ; CHECK-CVT-NEXT: cmn w12, #1, lsl #12 // =4096
2221 ; CHECK-CVT-NEXT: csel w12, w12, w11, gt
2222 ; CHECK-CVT-NEXT: cmp w13, #4095
2223 ; CHECK-CVT-NEXT: csel w13, w13, w8, lt
2224 ; CHECK-CVT-NEXT: mov v1.s[1], w9
2225 ; CHECK-CVT-NEXT: fcvtzs w9, s0
2226 ; CHECK-CVT-NEXT: cmn w13, #1, lsl #12 // =4096
2227 ; CHECK-CVT-NEXT: csel w13, w13, w11, gt
2228 ; CHECK-CVT-NEXT: cmp w14, #4095
2229 ; CHECK-CVT-NEXT: csel w14, w14, w8, lt
2230 ; CHECK-CVT-NEXT: cmn w14, #1, lsl #12 // =4096
2231 ; CHECK-CVT-NEXT: mov v1.s[2], w12
2232 ; CHECK-CVT-NEXT: csel w14, w14, w11, gt
2233 ; CHECK-CVT-NEXT: cmp w15, #4095
2234 ; CHECK-CVT-NEXT: csel w15, w15, w8, lt
2235 ; CHECK-CVT-NEXT: cmn w15, #1, lsl #12 // =4096
2236 ; CHECK-CVT-NEXT: csel w10, w15, w11, gt
2237 ; CHECK-CVT-NEXT: cmp w16, #4095
2238 ; CHECK-CVT-NEXT: mov v1.s[3], w13
2239 ; CHECK-CVT-NEXT: fmov s2, w10
2240 ; CHECK-CVT-NEXT: csel w10, w16, w8, lt
2241 ; CHECK-CVT-NEXT: cmn w10, #1, lsl #12 // =4096
2242 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2243 ; CHECK-CVT-NEXT: cmp w9, #4095
2244 ; CHECK-CVT-NEXT: mov v2.s[1], w14
2245 ; CHECK-CVT-NEXT: csel w8, w9, w8, lt
2246 ; CHECK-CVT-NEXT: cmn w8, #1, lsl #12 // =4096
2247 ; CHECK-CVT-NEXT: csel w8, w8, w11, gt
2248 ; CHECK-CVT-NEXT: mov v2.s[2], w10
2249 ; CHECK-CVT-NEXT: mov v2.s[3], w8
2250 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
2251 ; CHECK-CVT-NEXT: ret
2253 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i13:
2254 ; CHECK-FP16: // %bb.0:
2255 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
2256 ; CHECK-FP16-NEXT: mvni v1.8h, #240, lsl #8
2257 ; CHECK-FP16-NEXT: smin v0.8h, v0.8h, v1.8h
2258 ; CHECK-FP16-NEXT: movi v1.8h, #240, lsl #8
2259 ; CHECK-FP16-NEXT: smax v0.8h, v0.8h, v1.8h
2260 ; CHECK-FP16-NEXT: ret
2261 %x = call <8 x i13> @llvm.fptosi.sat.v8f16.v8i13(<8 x half> %f)
2265 define <8 x i16> @test_signed_v8f16_v8i16(<8 x half> %f) {
2266 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i16:
2267 ; CHECK-CVT: // %bb.0:
2268 ; CHECK-CVT-NEXT: fcvtl2 v1.4s, v0.8h
2269 ; CHECK-CVT-NEXT: mov w8, #32767 // =0x7fff
2270 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
2271 ; CHECK-CVT-NEXT: mov w11, #-32768 // =0xffff8000
2272 ; CHECK-CVT-NEXT: mov s2, v1.s[1]
2273 ; CHECK-CVT-NEXT: fcvtzs w10, s1
2274 ; CHECK-CVT-NEXT: fcvtzs w15, s0
2275 ; CHECK-CVT-NEXT: fcvtzs w9, s2
2276 ; CHECK-CVT-NEXT: mov s2, v1.s[2]
2277 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
2278 ; CHECK-CVT-NEXT: cmp w9, w8
2279 ; CHECK-CVT-NEXT: fcvtzs w12, s2
2280 ; CHECK-CVT-NEXT: mov s2, v0.s[1]
2281 ; CHECK-CVT-NEXT: csel w9, w9, w8, lt
2282 ; CHECK-CVT-NEXT: fcvtzs w13, s1
2283 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
2284 ; CHECK-CVT-NEXT: cmn w9, #8, lsl #12 // =32768
2285 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
2286 ; CHECK-CVT-NEXT: csel w9, w9, w11, gt
2287 ; CHECK-CVT-NEXT: cmp w10, w8
2288 ; CHECK-CVT-NEXT: csel w10, w10, w8, lt
2289 ; CHECK-CVT-NEXT: fcvtzs w14, s2
2290 ; CHECK-CVT-NEXT: cmn w10, #8, lsl #12 // =32768
2291 ; CHECK-CVT-NEXT: fcvtzs w16, s1
2292 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2293 ; CHECK-CVT-NEXT: cmp w12, w8
2294 ; CHECK-CVT-NEXT: csel w12, w12, w8, lt
2295 ; CHECK-CVT-NEXT: fmov s1, w10
2296 ; CHECK-CVT-NEXT: cmn w12, #8, lsl #12 // =32768
2297 ; CHECK-CVT-NEXT: csel w12, w12, w11, gt
2298 ; CHECK-CVT-NEXT: cmp w13, w8
2299 ; CHECK-CVT-NEXT: csel w13, w13, w8, lt
2300 ; CHECK-CVT-NEXT: mov v1.s[1], w9
2301 ; CHECK-CVT-NEXT: fcvtzs w9, s0
2302 ; CHECK-CVT-NEXT: cmn w13, #8, lsl #12 // =32768
2303 ; CHECK-CVT-NEXT: csel w13, w13, w11, gt
2304 ; CHECK-CVT-NEXT: cmp w14, w8
2305 ; CHECK-CVT-NEXT: csel w14, w14, w8, lt
2306 ; CHECK-CVT-NEXT: cmn w14, #8, lsl #12 // =32768
2307 ; CHECK-CVT-NEXT: mov v1.s[2], w12
2308 ; CHECK-CVT-NEXT: csel w14, w14, w11, gt
2309 ; CHECK-CVT-NEXT: cmp w15, w8
2310 ; CHECK-CVT-NEXT: csel w15, w15, w8, lt
2311 ; CHECK-CVT-NEXT: cmn w15, #8, lsl #12 // =32768
2312 ; CHECK-CVT-NEXT: csel w10, w15, w11, gt
2313 ; CHECK-CVT-NEXT: cmp w16, w8
2314 ; CHECK-CVT-NEXT: mov v1.s[3], w13
2315 ; CHECK-CVT-NEXT: fmov s2, w10
2316 ; CHECK-CVT-NEXT: csel w10, w16, w8, lt
2317 ; CHECK-CVT-NEXT: cmn w10, #8, lsl #12 // =32768
2318 ; CHECK-CVT-NEXT: csel w10, w10, w11, gt
2319 ; CHECK-CVT-NEXT: cmp w9, w8
2320 ; CHECK-CVT-NEXT: mov v2.s[1], w14
2321 ; CHECK-CVT-NEXT: csel w8, w9, w8, lt
2322 ; CHECK-CVT-NEXT: cmn w8, #8, lsl #12 // =32768
2323 ; CHECK-CVT-NEXT: csel w8, w8, w11, gt
2324 ; CHECK-CVT-NEXT: mov v2.s[2], w10
2325 ; CHECK-CVT-NEXT: mov v2.s[3], w8
2326 ; CHECK-CVT-NEXT: uzp1 v0.8h, v2.8h, v1.8h
2327 ; CHECK-CVT-NEXT: ret
2329 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i16:
2330 ; CHECK-FP16: // %bb.0:
2331 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
2332 ; CHECK-FP16-NEXT: ret
2333 %x = call <8 x i16> @llvm.fptosi.sat.v8f16.v8i16(<8 x half> %f)
2337 define <8 x i19> @test_signed_v8f16_v8i19(<8 x half> %f) {
2338 ; CHECK-LABEL: test_signed_v8f16_v8i19:
2340 ; CHECK-NEXT: fcvtl v2.4s, v0.4h
2341 ; CHECK-NEXT: fcvtl2 v0.4s, v0.8h
2342 ; CHECK-NEXT: movi v1.4s, #3, msl #16
2343 ; CHECK-NEXT: mvni v3.4s, #3, msl #16
2344 ; CHECK-NEXT: fcvtzs v2.4s, v2.4s
2345 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
2346 ; CHECK-NEXT: smin v2.4s, v2.4s, v1.4s
2347 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
2348 ; CHECK-NEXT: smax v1.4s, v2.4s, v3.4s
2349 ; CHECK-NEXT: smax v0.4s, v0.4s, v3.4s
2350 ; CHECK-NEXT: mov w1, v1.s[1]
2351 ; CHECK-NEXT: mov w2, v1.s[2]
2352 ; CHECK-NEXT: mov w3, v1.s[3]
2353 ; CHECK-NEXT: mov w5, v0.s[1]
2354 ; CHECK-NEXT: mov w6, v0.s[2]
2355 ; CHECK-NEXT: mov w7, v0.s[3]
2356 ; CHECK-NEXT: fmov w4, s0
2357 ; CHECK-NEXT: fmov w0, s1
2359 %x = call <8 x i19> @llvm.fptosi.sat.v8f16.v8i19(<8 x half> %f)
2363 define <8 x i32> @test_signed_v8f16_v8i32_duplicate(<8 x half> %f) {
2364 ; CHECK-LABEL: test_signed_v8f16_v8i32_duplicate:
2366 ; CHECK-NEXT: fcvtl2 v1.4s, v0.8h
2367 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
2368 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
2369 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
2371 %x = call <8 x i32> @llvm.fptosi.sat.v8f16.v8i32(<8 x half> %f)
2375 define <8 x i50> @test_signed_v8f16_v8i50(<8 x half> %f) {
2376 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i50:
2377 ; CHECK-CVT: // %bb.0:
2378 ; CHECK-CVT-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2379 ; CHECK-CVT-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
2380 ; CHECK-CVT-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
2381 ; CHECK-CVT-NEXT: mov h2, v1.h[1]
2382 ; CHECK-CVT-NEXT: fcvt s3, h1
2383 ; CHECK-CVT-NEXT: mov h4, v1.h[2]
2384 ; CHECK-CVT-NEXT: mov h1, v1.h[3]
2385 ; CHECK-CVT-NEXT: fcvt s2, h2
2386 ; CHECK-CVT-NEXT: fcvtzs x9, s3
2387 ; CHECK-CVT-NEXT: fcvt s3, h4
2388 ; CHECK-CVT-NEXT: fcvt s1, h1
2389 ; CHECK-CVT-NEXT: fcvtzs x10, s2
2390 ; CHECK-CVT-NEXT: cmp x9, x8
2391 ; CHECK-CVT-NEXT: fcvtzs x12, s3
2392 ; CHECK-CVT-NEXT: csel x9, x9, x8, lt
2393 ; CHECK-CVT-NEXT: mov h2, v0.h[1]
2394 ; CHECK-CVT-NEXT: fcvt s3, h0
2395 ; CHECK-CVT-NEXT: cmp x9, x11
2396 ; CHECK-CVT-NEXT: csel x4, x9, x11, gt
2397 ; CHECK-CVT-NEXT: cmp x10, x8
2398 ; CHECK-CVT-NEXT: csel x9, x10, x8, lt
2399 ; CHECK-CVT-NEXT: fcvtzs x10, s1
2400 ; CHECK-CVT-NEXT: mov h1, v0.h[2]
2401 ; CHECK-CVT-NEXT: cmp x9, x11
2402 ; CHECK-CVT-NEXT: fcvt s2, h2
2403 ; CHECK-CVT-NEXT: mov h0, v0.h[3]
2404 ; CHECK-CVT-NEXT: csel x5, x9, x11, gt
2405 ; CHECK-CVT-NEXT: cmp x12, x8
2406 ; CHECK-CVT-NEXT: csel x9, x12, x8, lt
2407 ; CHECK-CVT-NEXT: fcvtzs x12, s3
2408 ; CHECK-CVT-NEXT: cmp x9, x11
2409 ; CHECK-CVT-NEXT: fcvt s1, h1
2410 ; CHECK-CVT-NEXT: csel x6, x9, x11, gt
2411 ; CHECK-CVT-NEXT: cmp x10, x8
2412 ; CHECK-CVT-NEXT: fcvt s0, h0
2413 ; CHECK-CVT-NEXT: csel x9, x10, x8, lt
2414 ; CHECK-CVT-NEXT: fcvtzs x10, s2
2415 ; CHECK-CVT-NEXT: cmp x9, x11
2416 ; CHECK-CVT-NEXT: csel x7, x9, x11, gt
2417 ; CHECK-CVT-NEXT: cmp x12, x8
2418 ; CHECK-CVT-NEXT: csel x9, x12, x8, lt
2419 ; CHECK-CVT-NEXT: fcvtzs x12, s1
2420 ; CHECK-CVT-NEXT: cmp x9, x11
2421 ; CHECK-CVT-NEXT: csel x0, x9, x11, gt
2422 ; CHECK-CVT-NEXT: cmp x10, x8
2423 ; CHECK-CVT-NEXT: csel x9, x10, x8, lt
2424 ; CHECK-CVT-NEXT: fcvtzs x10, s0
2425 ; CHECK-CVT-NEXT: cmp x9, x11
2426 ; CHECK-CVT-NEXT: csel x1, x9, x11, gt
2427 ; CHECK-CVT-NEXT: cmp x12, x8
2428 ; CHECK-CVT-NEXT: csel x9, x12, x8, lt
2429 ; CHECK-CVT-NEXT: cmp x9, x11
2430 ; CHECK-CVT-NEXT: csel x2, x9, x11, gt
2431 ; CHECK-CVT-NEXT: cmp x10, x8
2432 ; CHECK-CVT-NEXT: csel x8, x10, x8, lt
2433 ; CHECK-CVT-NEXT: cmp x8, x11
2434 ; CHECK-CVT-NEXT: csel x3, x8, x11, gt
2435 ; CHECK-CVT-NEXT: ret
2437 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i50:
2438 ; CHECK-FP16: // %bb.0:
2439 ; CHECK-FP16-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2440 ; CHECK-FP16-NEXT: mov x8, #562949953421311 // =0x1ffffffffffff
2441 ; CHECK-FP16-NEXT: mov x11, #-562949953421312 // =0xfffe000000000000
2442 ; CHECK-FP16-NEXT: mov h2, v1.h[1]
2443 ; CHECK-FP16-NEXT: fcvtzs x9, h1
2444 ; CHECK-FP16-NEXT: mov h3, v1.h[2]
2445 ; CHECK-FP16-NEXT: mov h1, v1.h[3]
2446 ; CHECK-FP16-NEXT: fcvtzs x10, h2
2447 ; CHECK-FP16-NEXT: cmp x9, x8
2448 ; CHECK-FP16-NEXT: fcvtzs x12, h3
2449 ; CHECK-FP16-NEXT: csel x9, x9, x8, lt
2450 ; CHECK-FP16-NEXT: mov h2, v0.h[2]
2451 ; CHECK-FP16-NEXT: cmp x9, x11
2452 ; CHECK-FP16-NEXT: csel x4, x9, x11, gt
2453 ; CHECK-FP16-NEXT: cmp x10, x8
2454 ; CHECK-FP16-NEXT: csel x9, x10, x8, lt
2455 ; CHECK-FP16-NEXT: fcvtzs x10, h1
2456 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
2457 ; CHECK-FP16-NEXT: cmp x9, x11
2458 ; CHECK-FP16-NEXT: csel x5, x9, x11, gt
2459 ; CHECK-FP16-NEXT: cmp x12, x8
2460 ; CHECK-FP16-NEXT: csel x9, x12, x8, lt
2461 ; CHECK-FP16-NEXT: fcvtzs x12, h0
2462 ; CHECK-FP16-NEXT: mov h0, v0.h[3]
2463 ; CHECK-FP16-NEXT: cmp x9, x11
2464 ; CHECK-FP16-NEXT: csel x6, x9, x11, gt
2465 ; CHECK-FP16-NEXT: cmp x10, x8
2466 ; CHECK-FP16-NEXT: csel x9, x10, x8, lt
2467 ; CHECK-FP16-NEXT: fcvtzs x10, h1
2468 ; CHECK-FP16-NEXT: cmp x9, x11
2469 ; CHECK-FP16-NEXT: csel x7, x9, x11, gt
2470 ; CHECK-FP16-NEXT: cmp x12, x8
2471 ; CHECK-FP16-NEXT: csel x9, x12, x8, lt
2472 ; CHECK-FP16-NEXT: fcvtzs x12, h2
2473 ; CHECK-FP16-NEXT: cmp x9, x11
2474 ; CHECK-FP16-NEXT: csel x0, x9, x11, gt
2475 ; CHECK-FP16-NEXT: cmp x10, x8
2476 ; CHECK-FP16-NEXT: csel x9, x10, x8, lt
2477 ; CHECK-FP16-NEXT: fcvtzs x10, h0
2478 ; CHECK-FP16-NEXT: cmp x9, x11
2479 ; CHECK-FP16-NEXT: csel x1, x9, x11, gt
2480 ; CHECK-FP16-NEXT: cmp x12, x8
2481 ; CHECK-FP16-NEXT: csel x9, x12, x8, lt
2482 ; CHECK-FP16-NEXT: cmp x9, x11
2483 ; CHECK-FP16-NEXT: csel x2, x9, x11, gt
2484 ; CHECK-FP16-NEXT: cmp x10, x8
2485 ; CHECK-FP16-NEXT: csel x8, x10, x8, lt
2486 ; CHECK-FP16-NEXT: cmp x8, x11
2487 ; CHECK-FP16-NEXT: csel x3, x8, x11, gt
2488 ; CHECK-FP16-NEXT: ret
2489 %x = call <8 x i50> @llvm.fptosi.sat.v8f16.v8i50(<8 x half> %f)
2493 define <8 x i64> @test_signed_v8f16_v8i64(<8 x half> %f) {
2494 ; CHECK-CVT-LABEL: test_signed_v8f16_v8i64:
2495 ; CHECK-CVT: // %bb.0:
2496 ; CHECK-CVT-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2497 ; CHECK-CVT-NEXT: mov h4, v0.h[2]
2498 ; CHECK-CVT-NEXT: mov h3, v0.h[1]
2499 ; CHECK-CVT-NEXT: mov h7, v0.h[3]
2500 ; CHECK-CVT-NEXT: fcvt s0, h0
2501 ; CHECK-CVT-NEXT: mov h2, v1.h[2]
2502 ; CHECK-CVT-NEXT: mov h5, v1.h[1]
2503 ; CHECK-CVT-NEXT: mov h6, v1.h[3]
2504 ; CHECK-CVT-NEXT: fcvt s1, h1
2505 ; CHECK-CVT-NEXT: fcvt s4, h4
2506 ; CHECK-CVT-NEXT: fcvt s3, h3
2507 ; CHECK-CVT-NEXT: fcvt s7, h7
2508 ; CHECK-CVT-NEXT: fcvtzs x9, s0
2509 ; CHECK-CVT-NEXT: fcvt s2, h2
2510 ; CHECK-CVT-NEXT: fcvt s5, h5
2511 ; CHECK-CVT-NEXT: fcvt s6, h6
2512 ; CHECK-CVT-NEXT: fcvtzs x8, s1
2513 ; CHECK-CVT-NEXT: fcvtzs x12, s4
2514 ; CHECK-CVT-NEXT: fcvtzs x11, s3
2515 ; CHECK-CVT-NEXT: fcvtzs x15, s7
2516 ; CHECK-CVT-NEXT: fmov d0, x9
2517 ; CHECK-CVT-NEXT: fcvtzs x10, s2
2518 ; CHECK-CVT-NEXT: fcvtzs x13, s5
2519 ; CHECK-CVT-NEXT: fcvtzs x14, s6
2520 ; CHECK-CVT-NEXT: fmov d2, x8
2521 ; CHECK-CVT-NEXT: fmov d1, x12
2522 ; CHECK-CVT-NEXT: mov v0.d[1], x11
2523 ; CHECK-CVT-NEXT: fmov d3, x10
2524 ; CHECK-CVT-NEXT: mov v2.d[1], x13
2525 ; CHECK-CVT-NEXT: mov v1.d[1], x15
2526 ; CHECK-CVT-NEXT: mov v3.d[1], x14
2527 ; CHECK-CVT-NEXT: ret
2529 ; CHECK-FP16-LABEL: test_signed_v8f16_v8i64:
2530 ; CHECK-FP16: // %bb.0:
2531 ; CHECK-FP16-NEXT: ext v1.16b, v0.16b, v0.16b, #8
2532 ; CHECK-FP16-NEXT: mov h4, v0.h[2]
2533 ; CHECK-FP16-NEXT: mov h3, v0.h[1]
2534 ; CHECK-FP16-NEXT: mov h7, v0.h[3]
2535 ; CHECK-FP16-NEXT: fcvtzs x9, h0
2536 ; CHECK-FP16-NEXT: mov h2, v1.h[2]
2537 ; CHECK-FP16-NEXT: mov h5, v1.h[1]
2538 ; CHECK-FP16-NEXT: mov h6, v1.h[3]
2539 ; CHECK-FP16-NEXT: fcvtzs x8, h1
2540 ; CHECK-FP16-NEXT: fcvtzs x12, h4
2541 ; CHECK-FP16-NEXT: fcvtzs x11, h3
2542 ; CHECK-FP16-NEXT: fcvtzs x15, h7
2543 ; CHECK-FP16-NEXT: fmov d0, x9
2544 ; CHECK-FP16-NEXT: fcvtzs x10, h2
2545 ; CHECK-FP16-NEXT: fcvtzs x13, h5
2546 ; CHECK-FP16-NEXT: fcvtzs x14, h6
2547 ; CHECK-FP16-NEXT: fmov d2, x8
2548 ; CHECK-FP16-NEXT: fmov d1, x12
2549 ; CHECK-FP16-NEXT: mov v0.d[1], x11
2550 ; CHECK-FP16-NEXT: fmov d3, x10
2551 ; CHECK-FP16-NEXT: mov v2.d[1], x13
2552 ; CHECK-FP16-NEXT: mov v1.d[1], x15
2553 ; CHECK-FP16-NEXT: mov v3.d[1], x14
2554 ; CHECK-FP16-NEXT: ret
2555 %x = call <8 x i64> @llvm.fptosi.sat.v8f16.v8i64(<8 x half> %f)
2559 define <8 x i100> @test_signed_v8f16_v8i100(<8 x half> %f) {
2560 ; CHECK-LABEL: test_signed_v8f16_v8i100:
2562 ; CHECK-NEXT: sub sp, sp, #192
2563 ; CHECK-NEXT: str d10, [sp, #64] // 8-byte Folded Spill
2564 ; CHECK-NEXT: stp d9, d8, [sp, #80] // 16-byte Folded Spill
2565 ; CHECK-NEXT: stp x29, x30, [sp, #96] // 16-byte Folded Spill
2566 ; CHECK-NEXT: stp x28, x27, [sp, #112] // 16-byte Folded Spill
2567 ; CHECK-NEXT: stp x26, x25, [sp, #128] // 16-byte Folded Spill
2568 ; CHECK-NEXT: stp x24, x23, [sp, #144] // 16-byte Folded Spill
2569 ; CHECK-NEXT: stp x22, x21, [sp, #160] // 16-byte Folded Spill
2570 ; CHECK-NEXT: stp x20, x19, [sp, #176] // 16-byte Folded Spill
2571 ; CHECK-NEXT: .cfi_def_cfa_offset 192
2572 ; CHECK-NEXT: .cfi_offset w19, -8
2573 ; CHECK-NEXT: .cfi_offset w20, -16
2574 ; CHECK-NEXT: .cfi_offset w21, -24
2575 ; CHECK-NEXT: .cfi_offset w22, -32
2576 ; CHECK-NEXT: .cfi_offset w23, -40
2577 ; CHECK-NEXT: .cfi_offset w24, -48
2578 ; CHECK-NEXT: .cfi_offset w25, -56
2579 ; CHECK-NEXT: .cfi_offset w26, -64
2580 ; CHECK-NEXT: .cfi_offset w27, -72
2581 ; CHECK-NEXT: .cfi_offset w28, -80
2582 ; CHECK-NEXT: .cfi_offset w30, -88
2583 ; CHECK-NEXT: .cfi_offset w29, -96
2584 ; CHECK-NEXT: .cfi_offset b8, -104
2585 ; CHECK-NEXT: .cfi_offset b9, -112
2586 ; CHECK-NEXT: .cfi_offset b10, -128
2587 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2588 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
2589 ; CHECK-NEXT: mov x19, x8
2590 ; CHECK-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2591 ; CHECK-NEXT: mov h0, v0.h[1]
2592 ; CHECK-NEXT: fcvt s8, h0
2593 ; CHECK-NEXT: fmov s0, s8
2594 ; CHECK-NEXT: bl __fixsfti
2595 ; CHECK-NEXT: movi v10.2s, #241, lsl #24
2596 ; CHECK-NEXT: mov w8, #1895825407 // =0x70ffffff
2597 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2598 ; CHECK-NEXT: fmov s9, w8
2599 ; CHECK-NEXT: mov x21, #-34359738368 // =0xfffffff800000000
2600 ; CHECK-NEXT: mov x23, #34359738367 // =0x7ffffffff
2601 ; CHECK-NEXT: mov h0, v0.h[3]
2602 ; CHECK-NEXT: fcmp s8, s10
2603 ; CHECK-NEXT: csel x8, x21, x1, lt
2604 ; CHECK-NEXT: csel x9, xzr, x0, lt
2605 ; CHECK-NEXT: fcmp s8, s9
2606 ; CHECK-NEXT: csinv x9, x9, xzr, le
2607 ; CHECK-NEXT: csel x8, x23, x8, gt
2608 ; CHECK-NEXT: fcmp s8, s8
2609 ; CHECK-NEXT: fcvt s8, h0
2610 ; CHECK-NEXT: csel x8, xzr, x8, vs
2611 ; CHECK-NEXT: str x8, [sp, #72] // 8-byte Folded Spill
2612 ; CHECK-NEXT: csel x8, xzr, x9, vs
2613 ; CHECK-NEXT: fmov s0, s8
2614 ; CHECK-NEXT: str x8, [sp, #24] // 8-byte Folded Spill
2615 ; CHECK-NEXT: bl __fixsfti
2616 ; CHECK-NEXT: fcmp s8, s10
2617 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2618 ; CHECK-NEXT: csel x8, xzr, x0, lt
2619 ; CHECK-NEXT: csel x9, x21, x1, lt
2620 ; CHECK-NEXT: fcmp s8, s9
2621 ; CHECK-NEXT: csel x9, x23, x9, gt
2622 ; CHECK-NEXT: csinv x8, x8, xzr, le
2623 ; CHECK-NEXT: fcmp s8, s8
2624 ; CHECK-NEXT: fcvt s8, h0
2625 ; CHECK-NEXT: csel x10, xzr, x8, vs
2626 ; CHECK-NEXT: csel x8, xzr, x9, vs
2627 ; CHECK-NEXT: stp x8, x10, [sp, #8] // 16-byte Folded Spill
2628 ; CHECK-NEXT: fmov s0, s8
2629 ; CHECK-NEXT: bl __fixsfti
2630 ; CHECK-NEXT: fcmp s8, s10
2631 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2632 ; CHECK-NEXT: mov h0, v0.h[2]
2633 ; CHECK-NEXT: csel x8, x21, x1, lt
2634 ; CHECK-NEXT: csel x9, xzr, x0, lt
2635 ; CHECK-NEXT: fcmp s8, s9
2636 ; CHECK-NEXT: csinv x9, x9, xzr, le
2637 ; CHECK-NEXT: csel x8, x23, x8, gt
2638 ; CHECK-NEXT: fcmp s8, s8
2639 ; CHECK-NEXT: fcvt s8, h0
2640 ; CHECK-NEXT: csel x26, xzr, x8, vs
2641 ; CHECK-NEXT: csel x8, xzr, x9, vs
2642 ; CHECK-NEXT: str x8, [sp, #32] // 8-byte Folded Spill
2643 ; CHECK-NEXT: fmov s0, s8
2644 ; CHECK-NEXT: bl __fixsfti
2645 ; CHECK-NEXT: fcmp s8, s10
2646 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2647 ; CHECK-NEXT: mov h0, v0.h[1]
2648 ; CHECK-NEXT: csel x8, x21, x1, lt
2649 ; CHECK-NEXT: csel x9, xzr, x0, lt
2650 ; CHECK-NEXT: fcmp s8, s9
2651 ; CHECK-NEXT: csinv x9, x9, xzr, le
2652 ; CHECK-NEXT: csel x8, x23, x8, gt
2653 ; CHECK-NEXT: fcmp s8, s8
2654 ; CHECK-NEXT: fcvt s8, h0
2655 ; CHECK-NEXT: csel x28, xzr, x8, vs
2656 ; CHECK-NEXT: csel x8, xzr, x9, vs
2657 ; CHECK-NEXT: str x8, [sp] // 8-byte Folded Spill
2658 ; CHECK-NEXT: fmov s0, s8
2659 ; CHECK-NEXT: bl __fixsfti
2660 ; CHECK-NEXT: fcmp s8, s10
2661 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2662 ; CHECK-NEXT: mov h0, v0.h[3]
2663 ; CHECK-NEXT: csel x8, x21, x1, lt
2664 ; CHECK-NEXT: csel x9, xzr, x0, lt
2665 ; CHECK-NEXT: fcmp s8, s9
2666 ; CHECK-NEXT: csinv x9, x9, xzr, le
2667 ; CHECK-NEXT: csel x8, x23, x8, gt
2668 ; CHECK-NEXT: fcmp s8, s8
2669 ; CHECK-NEXT: fcvt s8, h0
2670 ; CHECK-NEXT: csel x27, xzr, x8, vs
2671 ; CHECK-NEXT: csel x20, xzr, x9, vs
2672 ; CHECK-NEXT: fmov s0, s8
2673 ; CHECK-NEXT: bl __fixsfti
2674 ; CHECK-NEXT: fcmp s8, s10
2675 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2676 ; CHECK-NEXT: csel x8, xzr, x0, lt
2677 ; CHECK-NEXT: csel x9, x21, x1, lt
2678 ; CHECK-NEXT: fcmp s8, s9
2679 ; CHECK-NEXT: csel x9, x23, x9, gt
2680 ; CHECK-NEXT: csinv x8, x8, xzr, le
2681 ; CHECK-NEXT: fcmp s8, s8
2682 ; CHECK-NEXT: fcvt s8, h0
2683 ; CHECK-NEXT: csel x22, xzr, x8, vs
2684 ; CHECK-NEXT: csel x29, xzr, x9, vs
2685 ; CHECK-NEXT: fmov s0, s8
2686 ; CHECK-NEXT: bl __fixsfti
2687 ; CHECK-NEXT: fcmp s8, s10
2688 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2689 ; CHECK-NEXT: mov h0, v0.h[2]
2690 ; CHECK-NEXT: csel x8, x21, x1, lt
2691 ; CHECK-NEXT: csel x9, xzr, x0, lt
2692 ; CHECK-NEXT: fcmp s8, s9
2693 ; CHECK-NEXT: csinv x9, x9, xzr, le
2694 ; CHECK-NEXT: csel x8, x23, x8, gt
2695 ; CHECK-NEXT: fcmp s8, s8
2696 ; CHECK-NEXT: fcvt s8, h0
2697 ; CHECK-NEXT: csel x24, xzr, x8, vs
2698 ; CHECK-NEXT: csel x25, xzr, x9, vs
2699 ; CHECK-NEXT: fmov s0, s8
2700 ; CHECK-NEXT: bl __fixsfti
2701 ; CHECK-NEXT: ldr x9, [sp] // 8-byte Folded Reload
2702 ; CHECK-NEXT: extr x8, x29, x22, #28
2703 ; CHECK-NEXT: fcmp s8, s10
2704 ; CHECK-NEXT: bfi x24, x20, #36, #28
2705 ; CHECK-NEXT: lsr x11, x27, #28
2706 ; CHECK-NEXT: stur x9, [x19, #75]
2707 ; CHECK-NEXT: extr x9, x27, x20, #28
2708 ; CHECK-NEXT: stur x8, [x19, #41]
2709 ; CHECK-NEXT: csel x8, x21, x1, lt
2710 ; CHECK-NEXT: str x9, [x19, #16]
2711 ; CHECK-NEXT: csel x9, xzr, x0, lt
2712 ; CHECK-NEXT: fcmp s8, s9
2713 ; CHECK-NEXT: ldr x10, [sp, #32] // 8-byte Folded Reload
2714 ; CHECK-NEXT: stp x25, x24, [x19]
2715 ; CHECK-NEXT: stur x10, [x19, #50]
2716 ; CHECK-NEXT: lsr x10, x29, #28
2717 ; CHECK-NEXT: csinv x9, x9, xzr, le
2718 ; CHECK-NEXT: csel x8, x23, x8, gt
2719 ; CHECK-NEXT: fcmp s8, s8
2720 ; CHECK-NEXT: strb w10, [x19, #49]
2721 ; CHECK-NEXT: ldp x14, x12, [sp, #8] // 16-byte Folded Reload
2722 ; CHECK-NEXT: strb w11, [x19, #24]
2723 ; CHECK-NEXT: csel x8, xzr, x8, vs
2724 ; CHECK-NEXT: ldr x13, [sp, #24] // 8-byte Folded Reload
2725 ; CHECK-NEXT: csel x9, xzr, x9, vs
2726 ; CHECK-NEXT: bfi x8, x22, #36, #28
2727 ; CHECK-NEXT: extr x10, x14, x12, #28
2728 ; CHECK-NEXT: bfi x28, x12, #36, #28
2729 ; CHECK-NEXT: ldr x12, [sp, #72] // 8-byte Folded Reload
2730 ; CHECK-NEXT: bfi x26, x13, #36, #28
2731 ; CHECK-NEXT: stur x9, [x19, #25]
2732 ; CHECK-NEXT: lsr x9, x14, #28
2733 ; CHECK-NEXT: extr x11, x12, x13, #28
2734 ; CHECK-NEXT: stur x8, [x19, #33]
2735 ; CHECK-NEXT: lsr x8, x12, #28
2736 ; CHECK-NEXT: stur x10, [x19, #91]
2737 ; CHECK-NEXT: stur x28, [x19, #83]
2738 ; CHECK-NEXT: stur x11, [x19, #66]
2739 ; CHECK-NEXT: stur x26, [x19, #58]
2740 ; CHECK-NEXT: strb w9, [x19, #99]
2741 ; CHECK-NEXT: strb w8, [x19, #74]
2742 ; CHECK-NEXT: ldp x20, x19, [sp, #176] // 16-byte Folded Reload
2743 ; CHECK-NEXT: ldr d10, [sp, #64] // 8-byte Folded Reload
2744 ; CHECK-NEXT: ldp x22, x21, [sp, #160] // 16-byte Folded Reload
2745 ; CHECK-NEXT: ldp x24, x23, [sp, #144] // 16-byte Folded Reload
2746 ; CHECK-NEXT: ldp x26, x25, [sp, #128] // 16-byte Folded Reload
2747 ; CHECK-NEXT: ldp x28, x27, [sp, #112] // 16-byte Folded Reload
2748 ; CHECK-NEXT: ldp x29, x30, [sp, #96] // 16-byte Folded Reload
2749 ; CHECK-NEXT: ldp d9, d8, [sp, #80] // 16-byte Folded Reload
2750 ; CHECK-NEXT: add sp, sp, #192
2752 %x = call <8 x i100> @llvm.fptosi.sat.v8f16.v8i100(<8 x half> %f)
2756 define <8 x i128> @test_signed_v8f16_v8i128(<8 x half> %f) {
2757 ; CHECK-LABEL: test_signed_v8f16_v8i128:
2759 ; CHECK-NEXT: sub sp, sp, #192
2760 ; CHECK-NEXT: str d10, [sp, #64] // 8-byte Folded Spill
2761 ; CHECK-NEXT: stp d9, d8, [sp, #80] // 16-byte Folded Spill
2762 ; CHECK-NEXT: stp x29, x30, [sp, #96] // 16-byte Folded Spill
2763 ; CHECK-NEXT: stp x28, x27, [sp, #112] // 16-byte Folded Spill
2764 ; CHECK-NEXT: stp x26, x25, [sp, #128] // 16-byte Folded Spill
2765 ; CHECK-NEXT: stp x24, x23, [sp, #144] // 16-byte Folded Spill
2766 ; CHECK-NEXT: stp x22, x21, [sp, #160] // 16-byte Folded Spill
2767 ; CHECK-NEXT: stp x20, x19, [sp, #176] // 16-byte Folded Spill
2768 ; CHECK-NEXT: .cfi_def_cfa_offset 192
2769 ; CHECK-NEXT: .cfi_offset w19, -8
2770 ; CHECK-NEXT: .cfi_offset w20, -16
2771 ; CHECK-NEXT: .cfi_offset w21, -24
2772 ; CHECK-NEXT: .cfi_offset w22, -32
2773 ; CHECK-NEXT: .cfi_offset w23, -40
2774 ; CHECK-NEXT: .cfi_offset w24, -48
2775 ; CHECK-NEXT: .cfi_offset w25, -56
2776 ; CHECK-NEXT: .cfi_offset w26, -64
2777 ; CHECK-NEXT: .cfi_offset w27, -72
2778 ; CHECK-NEXT: .cfi_offset w28, -80
2779 ; CHECK-NEXT: .cfi_offset w30, -88
2780 ; CHECK-NEXT: .cfi_offset w29, -96
2781 ; CHECK-NEXT: .cfi_offset b8, -104
2782 ; CHECK-NEXT: .cfi_offset b9, -112
2783 ; CHECK-NEXT: .cfi_offset b10, -128
2784 ; CHECK-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2785 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
2786 ; CHECK-NEXT: mov x19, x8
2787 ; CHECK-NEXT: fcvt s8, h0
2788 ; CHECK-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2789 ; CHECK-NEXT: fmov s0, s8
2790 ; CHECK-NEXT: bl __fixsfti
2791 ; CHECK-NEXT: movi v9.2s, #255, lsl #24
2792 ; CHECK-NEXT: mov w8, #2130706431 // =0x7effffff
2793 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2794 ; CHECK-NEXT: fmov s10, w8
2795 ; CHECK-NEXT: mov x23, #-9223372036854775808 // =0x8000000000000000
2796 ; CHECK-NEXT: mov x22, #9223372036854775807 // =0x7fffffffffffffff
2797 ; CHECK-NEXT: mov h0, v0.h[1]
2798 ; CHECK-NEXT: fcmp s8, s9
2799 ; CHECK-NEXT: csel x8, xzr, x0, lt
2800 ; CHECK-NEXT: csel x9, x23, x1, lt
2801 ; CHECK-NEXT: fcmp s8, s10
2802 ; CHECK-NEXT: csel x9, x22, x9, gt
2803 ; CHECK-NEXT: csinv x8, x8, xzr, le
2804 ; CHECK-NEXT: fcmp s8, s8
2805 ; CHECK-NEXT: fcvt s8, h0
2806 ; CHECK-NEXT: csel x8, xzr, x8, vs
2807 ; CHECK-NEXT: str x8, [sp, #72] // 8-byte Folded Spill
2808 ; CHECK-NEXT: csel x8, xzr, x9, vs
2809 ; CHECK-NEXT: fmov s0, s8
2810 ; CHECK-NEXT: str x8, [sp, #24] // 8-byte Folded Spill
2811 ; CHECK-NEXT: bl __fixsfti
2812 ; CHECK-NEXT: fcmp s8, s9
2813 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2814 ; CHECK-NEXT: mov h0, v0.h[2]
2815 ; CHECK-NEXT: csel x8, xzr, x0, lt
2816 ; CHECK-NEXT: csel x9, x23, x1, lt
2817 ; CHECK-NEXT: fcmp s8, s10
2818 ; CHECK-NEXT: csel x9, x22, x9, gt
2819 ; CHECK-NEXT: csinv x8, x8, xzr, le
2820 ; CHECK-NEXT: fcmp s8, s8
2821 ; CHECK-NEXT: fcvt s8, h0
2822 ; CHECK-NEXT: csel x10, xzr, x8, vs
2823 ; CHECK-NEXT: csel x8, xzr, x9, vs
2824 ; CHECK-NEXT: stp x8, x10, [sp, #8] // 16-byte Folded Spill
2825 ; CHECK-NEXT: fmov s0, s8
2826 ; CHECK-NEXT: bl __fixsfti
2827 ; CHECK-NEXT: fcmp s8, s9
2828 ; CHECK-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
2829 ; CHECK-NEXT: mov h0, v0.h[3]
2830 ; CHECK-NEXT: csel x8, xzr, x0, lt
2831 ; CHECK-NEXT: csel x9, x23, x1, lt
2832 ; CHECK-NEXT: fcmp s8, s10
2833 ; CHECK-NEXT: csel x9, x22, x9, gt
2834 ; CHECK-NEXT: csinv x8, x8, xzr, le
2835 ; CHECK-NEXT: fcmp s8, s8
2836 ; CHECK-NEXT: fcvt s8, h0
2837 ; CHECK-NEXT: csel x8, xzr, x8, vs
2838 ; CHECK-NEXT: str x8, [sp, #32] // 8-byte Folded Spill
2839 ; CHECK-NEXT: csel x8, xzr, x9, vs
2840 ; CHECK-NEXT: fmov s0, s8
2841 ; CHECK-NEXT: str x8, [sp] // 8-byte Folded Spill
2842 ; CHECK-NEXT: bl __fixsfti
2843 ; CHECK-NEXT: fcmp s8, s9
2844 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2845 ; CHECK-NEXT: csel x8, xzr, x0, lt
2846 ; CHECK-NEXT: csel x9, x23, x1, lt
2847 ; CHECK-NEXT: fcmp s8, s10
2848 ; CHECK-NEXT: csel x9, x22, x9, gt
2849 ; CHECK-NEXT: csinv x8, x8, xzr, le
2850 ; CHECK-NEXT: fcmp s8, s8
2851 ; CHECK-NEXT: fcvt s8, h0
2852 ; CHECK-NEXT: csel x28, xzr, x8, vs
2853 ; CHECK-NEXT: csel x29, xzr, x9, vs
2854 ; CHECK-NEXT: fmov s0, s8
2855 ; CHECK-NEXT: bl __fixsfti
2856 ; CHECK-NEXT: fcmp s8, s9
2857 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2858 ; CHECK-NEXT: mov h0, v0.h[1]
2859 ; CHECK-NEXT: csel x8, xzr, x0, lt
2860 ; CHECK-NEXT: csel x9, x23, x1, lt
2861 ; CHECK-NEXT: fcmp s8, s10
2862 ; CHECK-NEXT: csel x9, x22, x9, gt
2863 ; CHECK-NEXT: csinv x8, x8, xzr, le
2864 ; CHECK-NEXT: fcmp s8, s8
2865 ; CHECK-NEXT: fcvt s8, h0
2866 ; CHECK-NEXT: csel x20, xzr, x8, vs
2867 ; CHECK-NEXT: csel x21, xzr, x9, vs
2868 ; CHECK-NEXT: fmov s0, s8
2869 ; CHECK-NEXT: bl __fixsfti
2870 ; CHECK-NEXT: fcmp s8, s9
2871 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2872 ; CHECK-NEXT: mov h0, v0.h[2]
2873 ; CHECK-NEXT: csel x8, xzr, x0, lt
2874 ; CHECK-NEXT: csel x9, x23, x1, lt
2875 ; CHECK-NEXT: fcmp s8, s10
2876 ; CHECK-NEXT: csel x9, x22, x9, gt
2877 ; CHECK-NEXT: csinv x8, x8, xzr, le
2878 ; CHECK-NEXT: fcmp s8, s8
2879 ; CHECK-NEXT: fcvt s8, h0
2880 ; CHECK-NEXT: csel x24, xzr, x8, vs
2881 ; CHECK-NEXT: csel x25, xzr, x9, vs
2882 ; CHECK-NEXT: fmov s0, s8
2883 ; CHECK-NEXT: bl __fixsfti
2884 ; CHECK-NEXT: fcmp s8, s9
2885 ; CHECK-NEXT: ldr q0, [sp, #48] // 16-byte Folded Reload
2886 ; CHECK-NEXT: mov h0, v0.h[3]
2887 ; CHECK-NEXT: csel x8, xzr, x0, lt
2888 ; CHECK-NEXT: csel x9, x23, x1, lt
2889 ; CHECK-NEXT: fcmp s8, s10
2890 ; CHECK-NEXT: csel x9, x22, x9, gt
2891 ; CHECK-NEXT: csinv x8, x8, xzr, le
2892 ; CHECK-NEXT: fcmp s8, s8
2893 ; CHECK-NEXT: fcvt s8, h0
2894 ; CHECK-NEXT: csel x26, xzr, x8, vs
2895 ; CHECK-NEXT: csel x27, xzr, x9, vs
2896 ; CHECK-NEXT: fmov s0, s8
2897 ; CHECK-NEXT: bl __fixsfti
2898 ; CHECK-NEXT: fcmp s8, s9
2899 ; CHECK-NEXT: stp x26, x27, [x19, #32]
2900 ; CHECK-NEXT: stp x24, x25, [x19, #16]
2901 ; CHECK-NEXT: stp x20, x21, [x19]
2902 ; CHECK-NEXT: csel x8, xzr, x0, lt
2903 ; CHECK-NEXT: csel x9, x23, x1, lt
2904 ; CHECK-NEXT: fcmp s8, s10
2905 ; CHECK-NEXT: stp x28, x29, [x19, #112]
2906 ; CHECK-NEXT: csel x9, x22, x9, gt
2907 ; CHECK-NEXT: csinv x8, x8, xzr, le
2908 ; CHECK-NEXT: fcmp s8, s8
2909 ; CHECK-NEXT: csel x9, xzr, x9, vs
2910 ; CHECK-NEXT: csel x8, xzr, x8, vs
2911 ; CHECK-NEXT: stp x8, x9, [x19, #48]
2912 ; CHECK-NEXT: ldr x8, [sp] // 8-byte Folded Reload
2913 ; CHECK-NEXT: str x8, [x19, #104]
2914 ; CHECK-NEXT: ldr x8, [sp, #32] // 8-byte Folded Reload
2915 ; CHECK-NEXT: str x8, [x19, #96]
2916 ; CHECK-NEXT: ldr x8, [sp, #8] // 8-byte Folded Reload
2917 ; CHECK-NEXT: str x8, [x19, #88]
2918 ; CHECK-NEXT: ldr x8, [sp, #16] // 8-byte Folded Reload
2919 ; CHECK-NEXT: str x8, [x19, #80]
2920 ; CHECK-NEXT: ldr x8, [sp, #24] // 8-byte Folded Reload
2921 ; CHECK-NEXT: str x8, [x19, #72]
2922 ; CHECK-NEXT: ldr x8, [sp, #72] // 8-byte Folded Reload
2923 ; CHECK-NEXT: str x8, [x19, #64]
2924 ; CHECK-NEXT: ldp x20, x19, [sp, #176] // 16-byte Folded Reload
2925 ; CHECK-NEXT: ldr d10, [sp, #64] // 8-byte Folded Reload
2926 ; CHECK-NEXT: ldp x22, x21, [sp, #160] // 16-byte Folded Reload
2927 ; CHECK-NEXT: ldp x24, x23, [sp, #144] // 16-byte Folded Reload
2928 ; CHECK-NEXT: ldp x26, x25, [sp, #128] // 16-byte Folded Reload
2929 ; CHECK-NEXT: ldp x28, x27, [sp, #112] // 16-byte Folded Reload
2930 ; CHECK-NEXT: ldp x29, x30, [sp, #96] // 16-byte Folded Reload
2931 ; CHECK-NEXT: ldp d9, d8, [sp, #80] // 16-byte Folded Reload
2932 ; CHECK-NEXT: add sp, sp, #192
2934 %x = call <8 x i128> @llvm.fptosi.sat.v8f16.v8i128(<8 x half> %f)
2939 declare <8 x i8> @llvm.fptosi.sat.v8f32.v8i8(<8 x float> %f)
2940 declare <8 x i16> @llvm.fptosi.sat.v8f32.v8i16(<8 x float> %f)
2941 declare <16 x i8> @llvm.fptosi.sat.v16f32.v16i8(<16 x float> %f)
2942 declare <16 x i16> @llvm.fptosi.sat.v16f32.v16i16(<16 x float> %f)
2944 declare <16 x i8> @llvm.fptosi.sat.v16f16.v16i8(<16 x half> %f)
2945 declare <16 x i16> @llvm.fptosi.sat.v16f16.v16i16(<16 x half> %f)
2947 declare <8 x i8> @llvm.fptosi.sat.v8f64.v8i8(<8 x double> %f)
2948 declare <8 x i16> @llvm.fptosi.sat.v8f64.v8i16(<8 x double> %f)
2949 declare <16 x i8> @llvm.fptosi.sat.v16f64.v16i8(<16 x double> %f)
2950 declare <16 x i16> @llvm.fptosi.sat.v16f64.v16i16(<16 x double> %f)
2952 define <8 x i8> @test_signed_v8f32_v8i8(<8 x float> %f) {
2953 ; CHECK-LABEL: test_signed_v8f32_v8i8:
2955 ; CHECK-NEXT: movi v2.4s, #127
2956 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
2957 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
2958 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
2959 ; CHECK-NEXT: smin v0.4s, v0.4s, v2.4s
2960 ; CHECK-NEXT: mvni v2.4s, #127
2961 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
2962 ; CHECK-NEXT: smax v0.4s, v0.4s, v2.4s
2963 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2964 ; CHECK-NEXT: xtn v0.8b, v0.8h
2966 %x = call <8 x i8> @llvm.fptosi.sat.v8f32.v8i8(<8 x float> %f)
2970 define <16 x i8> @test_signed_v16f32_v16i8(<16 x float> %f) {
2971 ; CHECK-LABEL: test_signed_v16f32_v16i8:
2973 ; CHECK-NEXT: movi v4.4s, #127
2974 ; CHECK-NEXT: fcvtzs v3.4s, v3.4s
2975 ; CHECK-NEXT: fcvtzs v2.4s, v2.4s
2976 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
2977 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
2978 ; CHECK-NEXT: mvni v5.4s, #127
2979 ; CHECK-NEXT: smin v3.4s, v3.4s, v4.4s
2980 ; CHECK-NEXT: smin v2.4s, v2.4s, v4.4s
2981 ; CHECK-NEXT: smin v1.4s, v1.4s, v4.4s
2982 ; CHECK-NEXT: smin v0.4s, v0.4s, v4.4s
2983 ; CHECK-NEXT: smax v3.4s, v3.4s, v5.4s
2984 ; CHECK-NEXT: smax v2.4s, v2.4s, v5.4s
2985 ; CHECK-NEXT: smax v1.4s, v1.4s, v5.4s
2986 ; CHECK-NEXT: smax v0.4s, v0.4s, v5.4s
2987 ; CHECK-NEXT: uzp1 v2.8h, v2.8h, v3.8h
2988 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
2989 ; CHECK-NEXT: uzp1 v0.16b, v0.16b, v2.16b
2991 %x = call <16 x i8> @llvm.fptosi.sat.v16f32.v16i8(<16 x float> %f)
2995 define <8 x i16> @test_signed_v8f32_v8i16(<8 x float> %f) {
2996 ; CHECK-LABEL: test_signed_v8f32_v8i16:
2998 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
2999 ; CHECK-NEXT: fcvtzs v1.4s, v1.4s
3000 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
3001 ; CHECK-NEXT: sqxtn2 v0.8h, v1.4s
3003 %x = call <8 x i16> @llvm.fptosi.sat.v8f32.v8i16(<8 x float> %f)
3007 define <16 x i16> @test_signed_v16f32_v16i16(<16 x float> %f) {
3008 ; CHECK-LABEL: test_signed_v16f32_v16i16:
3010 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
3011 ; CHECK-NEXT: fcvtzs v2.4s, v2.4s
3012 ; CHECK-NEXT: fcvtzs v4.4s, v1.4s
3013 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
3014 ; CHECK-NEXT: sqxtn v1.4h, v2.4s
3015 ; CHECK-NEXT: fcvtzs v2.4s, v3.4s
3016 ; CHECK-NEXT: sqxtn2 v0.8h, v4.4s
3017 ; CHECK-NEXT: sqxtn2 v1.8h, v2.4s
3019 %x = call <16 x i16> @llvm.fptosi.sat.v16f32.v16i16(<16 x float> %f)
3025 define <16 x i8> @test_signed_v16f16_v16i8(<16 x half> %f) {
3026 ; CHECK-CVT-LABEL: test_signed_v16f16_v16i8:
3027 ; CHECK-CVT: // %bb.0:
3028 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v1.8h
3029 ; CHECK-CVT-NEXT: mov w8, #127 // =0x7f
3030 ; CHECK-CVT-NEXT: fcvtl v1.4s, v1.4h
3031 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
3032 ; CHECK-CVT-NEXT: fcvtzs w10, s2
3033 ; CHECK-CVT-NEXT: fcvtzs w9, s3
3034 ; CHECK-CVT-NEXT: mov s3, v2.s[2]
3035 ; CHECK-CVT-NEXT: mov s2, v2.s[3]
3036 ; CHECK-CVT-NEXT: cmp w9, #127
3037 ; CHECK-CVT-NEXT: fcvtzs w12, s3
3038 ; CHECK-CVT-NEXT: mov s3, v1.s[1]
3039 ; CHECK-CVT-NEXT: csel w11, w9, w8, lt
3040 ; CHECK-CVT-NEXT: mov w9, #-128 // =0xffffff80
3041 ; CHECK-CVT-NEXT: fcvtzs w14, s2
3042 ; CHECK-CVT-NEXT: cmn w11, #128
3043 ; CHECK-CVT-NEXT: mov s2, v1.s[2]
3044 ; CHECK-CVT-NEXT: csel w11, w11, w9, gt
3045 ; CHECK-CVT-NEXT: cmp w10, #127
3046 ; CHECK-CVT-NEXT: csel w10, w10, w8, lt
3047 ; CHECK-CVT-NEXT: fcvtzs w15, s3
3048 ; CHECK-CVT-NEXT: fcvtl2 v3.4s, v0.8h
3049 ; CHECK-CVT-NEXT: cmn w10, #128
3050 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
3051 ; CHECK-CVT-NEXT: csel w13, w10, w9, gt
3052 ; CHECK-CVT-NEXT: cmp w12, #127
3053 ; CHECK-CVT-NEXT: fcvtzs w16, s2
3054 ; CHECK-CVT-NEXT: csel w10, w12, w8, lt
3055 ; CHECK-CVT-NEXT: cmn w10, #128
3056 ; CHECK-CVT-NEXT: mov s2, v3.s[1]
3057 ; CHECK-CVT-NEXT: fcvtzs w0, s3
3058 ; CHECK-CVT-NEXT: csel w10, w10, w9, gt
3059 ; CHECK-CVT-NEXT: cmp w14, #127
3060 ; CHECK-CVT-NEXT: fcvtzs w4, s0
3061 ; CHECK-CVT-NEXT: csel w12, w14, w8, lt
3062 ; CHECK-CVT-NEXT: fcvtzs w14, s1
3063 ; CHECK-CVT-NEXT: mov s1, v1.s[3]
3064 ; CHECK-CVT-NEXT: cmn w12, #128
3065 ; CHECK-CVT-NEXT: csel w12, w12, w9, gt
3066 ; CHECK-CVT-NEXT: cmp w15, #127
3067 ; CHECK-CVT-NEXT: fcvtzs w18, s2
3068 ; CHECK-CVT-NEXT: csel w15, w15, w8, lt
3069 ; CHECK-CVT-NEXT: mov s2, v3.s[3]
3070 ; CHECK-CVT-NEXT: cmn w15, #128
3071 ; CHECK-CVT-NEXT: fcvtzs w17, s1
3072 ; CHECK-CVT-NEXT: mov s1, v3.s[2]
3073 ; CHECK-CVT-NEXT: csel w15, w15, w9, gt
3074 ; CHECK-CVT-NEXT: cmp w14, #127
3075 ; CHECK-CVT-NEXT: csel w14, w14, w8, lt
3076 ; CHECK-CVT-NEXT: cmn w14, #128
3077 ; CHECK-CVT-NEXT: fcvtzs w2, s2
3078 ; CHECK-CVT-NEXT: fmov s2, w13
3079 ; CHECK-CVT-NEXT: csel w14, w14, w9, gt
3080 ; CHECK-CVT-NEXT: cmp w16, #127
3081 ; CHECK-CVT-NEXT: fcvtzs w1, s1
3082 ; CHECK-CVT-NEXT: csel w16, w16, w8, lt
3083 ; CHECK-CVT-NEXT: mov s1, v0.s[1]
3084 ; CHECK-CVT-NEXT: cmn w16, #128
3085 ; CHECK-CVT-NEXT: mov v2.s[1], w11
3086 ; CHECK-CVT-NEXT: csel w16, w16, w9, gt
3087 ; CHECK-CVT-NEXT: cmp w17, #127
3088 ; CHECK-CVT-NEXT: csel w17, w17, w8, lt
3089 ; CHECK-CVT-NEXT: cmn w17, #128
3090 ; CHECK-CVT-NEXT: fcvtzs w3, s1
3091 ; CHECK-CVT-NEXT: mov s1, v0.s[2]
3092 ; CHECK-CVT-NEXT: csel w17, w17, w9, gt
3093 ; CHECK-CVT-NEXT: cmp w18, #127
3094 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
3095 ; CHECK-CVT-NEXT: csel w18, w18, w8, lt
3096 ; CHECK-CVT-NEXT: mov v2.s[2], w10
3097 ; CHECK-CVT-NEXT: cmn w18, #128
3098 ; CHECK-CVT-NEXT: csel w18, w18, w9, gt
3099 ; CHECK-CVT-NEXT: cmp w0, #127
3100 ; CHECK-CVT-NEXT: csel w0, w0, w8, lt
3101 ; CHECK-CVT-NEXT: cmn w0, #128
3102 ; CHECK-CVT-NEXT: mov v2.s[3], w12
3103 ; CHECK-CVT-NEXT: csel w0, w0, w9, gt
3104 ; CHECK-CVT-NEXT: cmp w1, #127
3105 ; CHECK-CVT-NEXT: csel w1, w1, w8, lt
3106 ; CHECK-CVT-NEXT: fmov s3, w0
3107 ; CHECK-CVT-NEXT: cmn w1, #128
3108 ; CHECK-CVT-NEXT: csel w1, w1, w9, gt
3109 ; CHECK-CVT-NEXT: cmp w2, #127
3110 ; CHECK-CVT-NEXT: csel w2, w2, w8, lt
3111 ; CHECK-CVT-NEXT: mov v3.s[1], w18
3112 ; CHECK-CVT-NEXT: cmn w2, #128
3113 ; CHECK-CVT-NEXT: csel w2, w2, w9, gt
3114 ; CHECK-CVT-NEXT: cmp w3, #127
3115 ; CHECK-CVT-NEXT: csel w3, w3, w8, lt
3116 ; CHECK-CVT-NEXT: cmn w3, #128
3117 ; CHECK-CVT-NEXT: mov v3.s[2], w1
3118 ; CHECK-CVT-NEXT: csel w13, w3, w9, gt
3119 ; CHECK-CVT-NEXT: cmp w4, #127
3120 ; CHECK-CVT-NEXT: csel w3, w4, w8, lt
3121 ; CHECK-CVT-NEXT: fcvtzs w4, s1
3122 ; CHECK-CVT-NEXT: fmov s1, w14
3123 ; CHECK-CVT-NEXT: cmn w3, #128
3124 ; CHECK-CVT-NEXT: csel w11, w3, w9, gt
3125 ; CHECK-CVT-NEXT: mov v3.s[3], w2
3126 ; CHECK-CVT-NEXT: fmov s4, w11
3127 ; CHECK-CVT-NEXT: mov v1.s[1], w15
3128 ; CHECK-CVT-NEXT: fcvtzs w11, s0
3129 ; CHECK-CVT-NEXT: cmp w4, #127
3130 ; CHECK-CVT-NEXT: mov v4.s[1], w13
3131 ; CHECK-CVT-NEXT: csel w13, w4, w8, lt
3132 ; CHECK-CVT-NEXT: cmn w13, #128
3133 ; CHECK-CVT-NEXT: mov v1.s[2], w16
3134 ; CHECK-CVT-NEXT: csel w10, w13, w9, gt
3135 ; CHECK-CVT-NEXT: cmp w11, #127
3136 ; CHECK-CVT-NEXT: csel w8, w11, w8, lt
3137 ; CHECK-CVT-NEXT: mov v4.s[2], w10
3138 ; CHECK-CVT-NEXT: cmn w8, #128
3139 ; CHECK-CVT-NEXT: csel w8, w8, w9, gt
3140 ; CHECK-CVT-NEXT: mov v1.s[3], w17
3141 ; CHECK-CVT-NEXT: mov v4.s[3], w8
3142 ; CHECK-CVT-NEXT: uzp1 v0.8h, v1.8h, v2.8h
3143 ; CHECK-CVT-NEXT: uzp1 v1.8h, v4.8h, v3.8h
3144 ; CHECK-CVT-NEXT: uzp1 v0.16b, v1.16b, v0.16b
3145 ; CHECK-CVT-NEXT: ret
3147 ; CHECK-FP16-LABEL: test_signed_v16f16_v16i8:
3148 ; CHECK-FP16: // %bb.0:
3149 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
3150 ; CHECK-FP16-NEXT: fcvtzs v1.8h, v1.8h
3151 ; CHECK-FP16-NEXT: sqxtn v0.8b, v0.8h
3152 ; CHECK-FP16-NEXT: sqxtn2 v0.16b, v1.8h
3153 ; CHECK-FP16-NEXT: ret
3154 %x = call <16 x i8> @llvm.fptosi.sat.v16f16.v16i8(<16 x half> %f)
3158 define <16 x i16> @test_signed_v16f16_v16i16(<16 x half> %f) {
3159 ; CHECK-CVT-LABEL: test_signed_v16f16_v16i16:
3160 ; CHECK-CVT: // %bb.0:
3161 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
3162 ; CHECK-CVT-NEXT: mov w8, #32767 // =0x7fff
3163 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
3164 ; CHECK-CVT-NEXT: mov s3, v2.s[1]
3165 ; CHECK-CVT-NEXT: fcvtzs w10, s2
3166 ; CHECK-CVT-NEXT: fcvtzs w9, s3
3167 ; CHECK-CVT-NEXT: mov s3, v2.s[2]
3168 ; CHECK-CVT-NEXT: mov s2, v2.s[3]
3169 ; CHECK-CVT-NEXT: cmp w9, w8
3170 ; CHECK-CVT-NEXT: fcvtzs w12, s3
3171 ; CHECK-CVT-NEXT: mov s3, v0.s[1]
3172 ; CHECK-CVT-NEXT: csel w11, w9, w8, lt
3173 ; CHECK-CVT-NEXT: mov w9, #-32768 // =0xffff8000
3174 ; CHECK-CVT-NEXT: fcvtzs w14, s2
3175 ; CHECK-CVT-NEXT: cmn w11, #8, lsl #12 // =32768
3176 ; CHECK-CVT-NEXT: mov s2, v0.s[2]
3177 ; CHECK-CVT-NEXT: csel w11, w11, w9, gt
3178 ; CHECK-CVT-NEXT: cmp w10, w8
3179 ; CHECK-CVT-NEXT: csel w10, w10, w8, lt
3180 ; CHECK-CVT-NEXT: fcvtzs w15, s3
3181 ; CHECK-CVT-NEXT: fcvtl2 v3.4s, v1.8h
3182 ; CHECK-CVT-NEXT: cmn w10, #8, lsl #12 // =32768
3183 ; CHECK-CVT-NEXT: fcvtl v1.4s, v1.4h
3184 ; CHECK-CVT-NEXT: csel w13, w10, w9, gt
3185 ; CHECK-CVT-NEXT: cmp w12, w8
3186 ; CHECK-CVT-NEXT: fcvtzs w16, s2
3187 ; CHECK-CVT-NEXT: csel w10, w12, w8, lt
3188 ; CHECK-CVT-NEXT: cmn w10, #8, lsl #12 // =32768
3189 ; CHECK-CVT-NEXT: mov s2, v3.s[1]
3190 ; CHECK-CVT-NEXT: fcvtzs w0, s3
3191 ; CHECK-CVT-NEXT: csel w10, w10, w9, gt
3192 ; CHECK-CVT-NEXT: cmp w14, w8
3193 ; CHECK-CVT-NEXT: fcvtzs w4, s1
3194 ; CHECK-CVT-NEXT: csel w12, w14, w8, lt
3195 ; CHECK-CVT-NEXT: fcvtzs w14, s0
3196 ; CHECK-CVT-NEXT: mov s0, v0.s[3]
3197 ; CHECK-CVT-NEXT: cmn w12, #8, lsl #12 // =32768
3198 ; CHECK-CVT-NEXT: csel w12, w12, w9, gt
3199 ; CHECK-CVT-NEXT: cmp w15, w8
3200 ; CHECK-CVT-NEXT: fcvtzs w18, s2
3201 ; CHECK-CVT-NEXT: csel w15, w15, w8, lt
3202 ; CHECK-CVT-NEXT: mov s2, v3.s[3]
3203 ; CHECK-CVT-NEXT: cmn w15, #8, lsl #12 // =32768
3204 ; CHECK-CVT-NEXT: fcvtzs w17, s0
3205 ; CHECK-CVT-NEXT: mov s0, v3.s[2]
3206 ; CHECK-CVT-NEXT: csel w15, w15, w9, gt
3207 ; CHECK-CVT-NEXT: cmp w14, w8
3208 ; CHECK-CVT-NEXT: csel w14, w14, w8, lt
3209 ; CHECK-CVT-NEXT: cmn w14, #8, lsl #12 // =32768
3210 ; CHECK-CVT-NEXT: fcvtzs w2, s2
3211 ; CHECK-CVT-NEXT: fmov s2, w13
3212 ; CHECK-CVT-NEXT: csel w14, w14, w9, gt
3213 ; CHECK-CVT-NEXT: cmp w16, w8
3214 ; CHECK-CVT-NEXT: fcvtzs w1, s0
3215 ; CHECK-CVT-NEXT: csel w16, w16, w8, lt
3216 ; CHECK-CVT-NEXT: mov s0, v1.s[1]
3217 ; CHECK-CVT-NEXT: cmn w16, #8, lsl #12 // =32768
3218 ; CHECK-CVT-NEXT: mov v2.s[1], w11
3219 ; CHECK-CVT-NEXT: csel w16, w16, w9, gt
3220 ; CHECK-CVT-NEXT: cmp w17, w8
3221 ; CHECK-CVT-NEXT: csel w17, w17, w8, lt
3222 ; CHECK-CVT-NEXT: cmn w17, #8, lsl #12 // =32768
3223 ; CHECK-CVT-NEXT: fcvtzs w3, s0
3224 ; CHECK-CVT-NEXT: mov s0, v1.s[2]
3225 ; CHECK-CVT-NEXT: csel w17, w17, w9, gt
3226 ; CHECK-CVT-NEXT: cmp w18, w8
3227 ; CHECK-CVT-NEXT: mov v2.s[2], w10
3228 ; CHECK-CVT-NEXT: csel w18, w18, w8, lt
3229 ; CHECK-CVT-NEXT: cmn w18, #8, lsl #12 // =32768
3230 ; CHECK-CVT-NEXT: csel w18, w18, w9, gt
3231 ; CHECK-CVT-NEXT: cmp w0, w8
3232 ; CHECK-CVT-NEXT: csel w0, w0, w8, lt
3233 ; CHECK-CVT-NEXT: mov v2.s[3], w12
3234 ; CHECK-CVT-NEXT: cmn w0, #8, lsl #12 // =32768
3235 ; CHECK-CVT-NEXT: csel w0, w0, w9, gt
3236 ; CHECK-CVT-NEXT: cmp w1, w8
3237 ; CHECK-CVT-NEXT: csel w1, w1, w8, lt
3238 ; CHECK-CVT-NEXT: fmov s3, w0
3239 ; CHECK-CVT-NEXT: cmn w1, #8, lsl #12 // =32768
3240 ; CHECK-CVT-NEXT: csel w1, w1, w9, gt
3241 ; CHECK-CVT-NEXT: cmp w2, w8
3242 ; CHECK-CVT-NEXT: csel w2, w2, w8, lt
3243 ; CHECK-CVT-NEXT: mov v3.s[1], w18
3244 ; CHECK-CVT-NEXT: cmn w2, #8, lsl #12 // =32768
3245 ; CHECK-CVT-NEXT: csel w2, w2, w9, gt
3246 ; CHECK-CVT-NEXT: cmp w3, w8
3247 ; CHECK-CVT-NEXT: csel w3, w3, w8, lt
3248 ; CHECK-CVT-NEXT: cmn w3, #8, lsl #12 // =32768
3249 ; CHECK-CVT-NEXT: mov v3.s[2], w1
3250 ; CHECK-CVT-NEXT: csel w13, w3, w9, gt
3251 ; CHECK-CVT-NEXT: cmp w4, w8
3252 ; CHECK-CVT-NEXT: csel w3, w4, w8, lt
3253 ; CHECK-CVT-NEXT: fcvtzs w4, s0
3254 ; CHECK-CVT-NEXT: mov s0, v1.s[3]
3255 ; CHECK-CVT-NEXT: cmn w3, #8, lsl #12 // =32768
3256 ; CHECK-CVT-NEXT: fmov s1, w14
3257 ; CHECK-CVT-NEXT: csel w11, w3, w9, gt
3258 ; CHECK-CVT-NEXT: mov v3.s[3], w2
3259 ; CHECK-CVT-NEXT: fmov s4, w11
3260 ; CHECK-CVT-NEXT: mov v1.s[1], w15
3261 ; CHECK-CVT-NEXT: cmp w4, w8
3262 ; CHECK-CVT-NEXT: fcvtzs w11, s0
3263 ; CHECK-CVT-NEXT: mov v4.s[1], w13
3264 ; CHECK-CVT-NEXT: csel w13, w4, w8, lt
3265 ; CHECK-CVT-NEXT: cmn w13, #8, lsl #12 // =32768
3266 ; CHECK-CVT-NEXT: csel w10, w13, w9, gt
3267 ; CHECK-CVT-NEXT: mov v1.s[2], w16
3268 ; CHECK-CVT-NEXT: cmp w11, w8
3269 ; CHECK-CVT-NEXT: csel w8, w11, w8, lt
3270 ; CHECK-CVT-NEXT: mov v4.s[2], w10
3271 ; CHECK-CVT-NEXT: cmn w8, #8, lsl #12 // =32768
3272 ; CHECK-CVT-NEXT: csel w8, w8, w9, gt
3273 ; CHECK-CVT-NEXT: mov v1.s[3], w17
3274 ; CHECK-CVT-NEXT: mov v4.s[3], w8
3275 ; CHECK-CVT-NEXT: uzp1 v0.8h, v1.8h, v2.8h
3276 ; CHECK-CVT-NEXT: uzp1 v1.8h, v4.8h, v3.8h
3277 ; CHECK-CVT-NEXT: ret
3279 ; CHECK-FP16-LABEL: test_signed_v16f16_v16i16:
3280 ; CHECK-FP16: // %bb.0:
3281 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
3282 ; CHECK-FP16-NEXT: fcvtzs v1.8h, v1.8h
3283 ; CHECK-FP16-NEXT: ret
3284 %x = call <16 x i16> @llvm.fptosi.sat.v16f16.v16i16(<16 x half> %f)
3288 define <8 x i8> @test_signed_v8f64_v8i8(<8 x double> %f) {
3289 ; CHECK-LABEL: test_signed_v8f64_v8i8:
3291 ; CHECK-NEXT: mov d4, v3.d[1]
3292 ; CHECK-NEXT: fcvtzs w9, d3
3293 ; CHECK-NEXT: mov w10, #127 // =0x7f
3294 ; CHECK-NEXT: mov w11, #-128 // =0xffffff80
3295 ; CHECK-NEXT: mov d3, v1.d[1]
3296 ; CHECK-NEXT: fcvtzs w13, d2
3297 ; CHECK-NEXT: fcvtzs w15, d1
3298 ; CHECK-NEXT: fcvtzs w17, d0
3299 ; CHECK-NEXT: fcvtzs w8, d4
3300 ; CHECK-NEXT: mov d4, v2.d[1]
3301 ; CHECK-NEXT: mov d2, v0.d[1]
3302 ; CHECK-NEXT: fcvtzs w14, d3
3303 ; CHECK-NEXT: cmp w8, #127
3304 ; CHECK-NEXT: fcvtzs w12, d4
3305 ; CHECK-NEXT: fcvtzs w16, d2
3306 ; CHECK-NEXT: csel w8, w8, w10, lt
3307 ; CHECK-NEXT: cmn w8, #128
3308 ; CHECK-NEXT: csel w8, w8, w11, gt
3309 ; CHECK-NEXT: cmp w9, #127
3310 ; CHECK-NEXT: csel w9, w9, w10, lt
3311 ; CHECK-NEXT: cmn w9, #128
3312 ; CHECK-NEXT: csel w9, w9, w11, gt
3313 ; CHECK-NEXT: cmp w12, #127
3314 ; CHECK-NEXT: csel w12, w12, w10, lt
3315 ; CHECK-NEXT: fmov s3, w9
3316 ; CHECK-NEXT: cmn w12, #128
3317 ; CHECK-NEXT: csel w12, w12, w11, gt
3318 ; CHECK-NEXT: cmp w13, #127
3319 ; CHECK-NEXT: csel w13, w13, w10, lt
3320 ; CHECK-NEXT: mov v3.s[1], w8
3321 ; CHECK-NEXT: cmn w13, #128
3322 ; CHECK-NEXT: csel w13, w13, w11, gt
3323 ; CHECK-NEXT: cmp w14, #127
3324 ; CHECK-NEXT: csel w14, w14, w10, lt
3325 ; CHECK-NEXT: fmov s2, w13
3326 ; CHECK-NEXT: cmn w14, #128
3327 ; CHECK-NEXT: csel w14, w14, w11, gt
3328 ; CHECK-NEXT: cmp w15, #127
3329 ; CHECK-NEXT: csel w15, w15, w10, lt
3330 ; CHECK-NEXT: mov v2.s[1], w12
3331 ; CHECK-NEXT: cmn w15, #128
3332 ; CHECK-NEXT: csel w15, w15, w11, gt
3333 ; CHECK-NEXT: cmp w16, #127
3334 ; CHECK-NEXT: csel w9, w16, w10, lt
3335 ; CHECK-NEXT: fmov s1, w15
3336 ; CHECK-NEXT: cmn w9, #128
3337 ; CHECK-NEXT: csel w8, w9, w11, gt
3338 ; CHECK-NEXT: cmp w17, #127
3339 ; CHECK-NEXT: csel w9, w17, w10, lt
3340 ; CHECK-NEXT: mov v1.s[1], w14
3341 ; CHECK-NEXT: cmn w9, #128
3342 ; CHECK-NEXT: csel w9, w9, w11, gt
3343 ; CHECK-NEXT: fmov s0, w9
3344 ; CHECK-NEXT: mov v0.s[1], w8
3345 ; CHECK-NEXT: adrp x8, .LCPI82_0
3346 ; CHECK-NEXT: ldr d4, [x8, :lo12:.LCPI82_0]
3347 ; CHECK-NEXT: tbl v0.8b, { v0.16b, v1.16b, v2.16b, v3.16b }, v4.8b
3349 %x = call <8 x i8> @llvm.fptosi.sat.v8f64.v8i8(<8 x double> %f)
3353 define <16 x i8> @test_signed_v16f64_v16i8(<16 x double> %f) {
3354 ; CHECK-LABEL: test_signed_v16f64_v16i8:
3356 ; CHECK-NEXT: mov d16, v0.d[1]
3357 ; CHECK-NEXT: fcvtzs w10, d0
3358 ; CHECK-NEXT: mov w8, #127 // =0x7f
3359 ; CHECK-NEXT: mov d0, v1.d[1]
3360 ; CHECK-NEXT: fcvtzs w13, d1
3361 ; CHECK-NEXT: mov d1, v2.d[1]
3362 ; CHECK-NEXT: fcvtzs w9, d16
3363 ; CHECK-NEXT: fcvtzs w12, d0
3364 ; CHECK-NEXT: cmp w9, #127
3365 ; CHECK-NEXT: csel w11, w9, w8, lt
3366 ; CHECK-NEXT: mov w9, #-128 // =0xffffff80
3367 ; CHECK-NEXT: cmn w11, #128
3368 ; CHECK-NEXT: csel w11, w11, w9, gt
3369 ; CHECK-NEXT: cmp w10, #127
3370 ; CHECK-NEXT: csel w10, w10, w8, lt
3371 ; CHECK-NEXT: cmn w10, #128
3372 ; CHECK-NEXT: csel w10, w10, w9, gt
3373 ; CHECK-NEXT: cmp w12, #127
3374 ; CHECK-NEXT: fmov s0, w10
3375 ; CHECK-NEXT: csel w10, w12, w8, lt
3376 ; CHECK-NEXT: cmn w10, #128
3377 ; CHECK-NEXT: csel w10, w10, w9, gt
3378 ; CHECK-NEXT: cmp w13, #127
3379 ; CHECK-NEXT: csel w12, w13, w8, lt
3380 ; CHECK-NEXT: mov v0.s[1], w11
3381 ; CHECK-NEXT: fcvtzs w11, d1
3382 ; CHECK-NEXT: cmn w12, #128
3383 ; CHECK-NEXT: csel w12, w12, w9, gt
3384 ; CHECK-NEXT: fmov s1, w12
3385 ; CHECK-NEXT: fcvtzs w12, d2
3386 ; CHECK-NEXT: mov d2, v3.d[1]
3387 ; CHECK-NEXT: cmp w11, #127
3388 ; CHECK-NEXT: mov w13, v0.s[1]
3389 ; CHECK-NEXT: mov v1.s[1], w10
3390 ; CHECK-NEXT: csel w10, w11, w8, lt
3391 ; CHECK-NEXT: cmn w10, #128
3392 ; CHECK-NEXT: fcvtzs w11, d2
3393 ; CHECK-NEXT: csel w10, w10, w9, gt
3394 ; CHECK-NEXT: cmp w12, #127
3395 ; CHECK-NEXT: mov v0.b[1], w13
3396 ; CHECK-NEXT: csel w12, w12, w8, lt
3397 ; CHECK-NEXT: cmn w12, #128
3398 ; CHECK-NEXT: mov w13, v1.s[1]
3399 ; CHECK-NEXT: csel w12, w12, w9, gt
3400 ; CHECK-NEXT: cmp w11, #127
3401 ; CHECK-NEXT: fmov s2, w12
3402 ; CHECK-NEXT: fcvtzs w12, d3
3403 ; CHECK-NEXT: mov d3, v4.d[1]
3404 ; CHECK-NEXT: mov v0.b[2], v1.b[0]
3405 ; CHECK-NEXT: mov v2.s[1], w10
3406 ; CHECK-NEXT: csel w10, w11, w8, lt
3407 ; CHECK-NEXT: cmn w10, #128
3408 ; CHECK-NEXT: fcvtzs w11, d3
3409 ; CHECK-NEXT: csel w10, w10, w9, gt
3410 ; CHECK-NEXT: cmp w12, #127
3411 ; CHECK-NEXT: mov v0.b[3], w13
3412 ; CHECK-NEXT: csel w12, w12, w8, lt
3413 ; CHECK-NEXT: cmn w12, #128
3414 ; CHECK-NEXT: mov w13, v2.s[1]
3415 ; CHECK-NEXT: csel w12, w12, w9, gt
3416 ; CHECK-NEXT: cmp w11, #127
3417 ; CHECK-NEXT: fmov s3, w12
3418 ; CHECK-NEXT: fcvtzs w12, d4
3419 ; CHECK-NEXT: mov v0.b[4], v2.b[0]
3420 ; CHECK-NEXT: mov d4, v5.d[1]
3421 ; CHECK-NEXT: mov v3.s[1], w10
3422 ; CHECK-NEXT: csel w10, w11, w8, lt
3423 ; CHECK-NEXT: cmn w10, #128
3424 ; CHECK-NEXT: mov v0.b[5], w13
3425 ; CHECK-NEXT: csel w10, w10, w9, gt
3426 ; CHECK-NEXT: cmp w12, #127
3427 ; CHECK-NEXT: fcvtzs w11, d4
3428 ; CHECK-NEXT: csel w12, w12, w8, lt
3429 ; CHECK-NEXT: cmn w12, #128
3430 ; CHECK-NEXT: mov w13, v3.s[1]
3431 ; CHECK-NEXT: csel w12, w12, w9, gt
3432 ; CHECK-NEXT: mov v0.b[6], v3.b[0]
3433 ; CHECK-NEXT: fmov s4, w12
3434 ; CHECK-NEXT: fcvtzs w12, d5
3435 ; CHECK-NEXT: cmp w11, #127
3436 ; CHECK-NEXT: mov d5, v6.d[1]
3437 ; CHECK-NEXT: mov v4.s[1], w10
3438 ; CHECK-NEXT: csel w10, w11, w8, lt
3439 ; CHECK-NEXT: mov v0.b[7], w13
3440 ; CHECK-NEXT: cmn w10, #128
3441 ; CHECK-NEXT: csel w10, w10, w9, gt
3442 ; CHECK-NEXT: cmp w12, #127
3443 ; CHECK-NEXT: fcvtzs w13, d5
3444 ; CHECK-NEXT: csel w11, w12, w8, lt
3445 ; CHECK-NEXT: cmn w11, #128
3446 ; CHECK-NEXT: mov w12, v4.s[1]
3447 ; CHECK-NEXT: mov v0.b[8], v4.b[0]
3448 ; CHECK-NEXT: csel w11, w11, w9, gt
3449 ; CHECK-NEXT: fmov s5, w11
3450 ; CHECK-NEXT: fcvtzs w11, d6
3451 ; CHECK-NEXT: cmp w13, #127
3452 ; CHECK-NEXT: mov d6, v7.d[1]
3453 ; CHECK-NEXT: mov v0.b[9], w12
3454 ; CHECK-NEXT: mov v5.s[1], w10
3455 ; CHECK-NEXT: csel w10, w13, w8, lt
3456 ; CHECK-NEXT: cmn w10, #128
3457 ; CHECK-NEXT: csel w10, w10, w9, gt
3458 ; CHECK-NEXT: cmp w11, #127
3459 ; CHECK-NEXT: fcvtzs w13, d6
3460 ; CHECK-NEXT: csel w11, w11, w8, lt
3461 ; CHECK-NEXT: cmn w11, #128
3462 ; CHECK-NEXT: mov v0.b[10], v5.b[0]
3463 ; CHECK-NEXT: mov w12, v5.s[1]
3464 ; CHECK-NEXT: csel w11, w11, w9, gt
3465 ; CHECK-NEXT: fmov s6, w11
3466 ; CHECK-NEXT: fcvtzs w11, d7
3467 ; CHECK-NEXT: cmp w13, #127
3468 ; CHECK-NEXT: mov v0.b[11], w12
3469 ; CHECK-NEXT: mov v6.s[1], w10
3470 ; CHECK-NEXT: csel w10, w13, w8, lt
3471 ; CHECK-NEXT: cmn w10, #128
3472 ; CHECK-NEXT: csel w10, w10, w9, gt
3473 ; CHECK-NEXT: cmp w11, #127
3474 ; CHECK-NEXT: csel w8, w11, w8, lt
3475 ; CHECK-NEXT: cmn w8, #128
3476 ; CHECK-NEXT: mov v0.b[12], v6.b[0]
3477 ; CHECK-NEXT: mov w11, v6.s[1]
3478 ; CHECK-NEXT: csel w8, w8, w9, gt
3479 ; CHECK-NEXT: fmov s7, w8
3480 ; CHECK-NEXT: mov v0.b[13], w11
3481 ; CHECK-NEXT: mov v7.s[1], w10
3482 ; CHECK-NEXT: mov v0.b[14], v7.b[0]
3483 ; CHECK-NEXT: mov w8, v7.s[1]
3484 ; CHECK-NEXT: mov v0.b[15], w8
3486 %x = call <16 x i8> @llvm.fptosi.sat.v16f64.v16i8(<16 x double> %f)
3490 define <8 x i16> @test_signed_v8f64_v8i16(<8 x double> %f) {
3491 ; CHECK-LABEL: test_signed_v8f64_v8i16:
3493 ; CHECK-NEXT: mov d4, v3.d[1]
3494 ; CHECK-NEXT: mov w9, #32767 // =0x7fff
3495 ; CHECK-NEXT: fcvtzs w10, d3
3496 ; CHECK-NEXT: mov w11, #-32768 // =0xffff8000
3497 ; CHECK-NEXT: mov d3, v1.d[1]
3498 ; CHECK-NEXT: fcvtzs w13, d2
3499 ; CHECK-NEXT: fcvtzs w15, d1
3500 ; CHECK-NEXT: fcvtzs w17, d0
3501 ; CHECK-NEXT: fcvtzs w8, d4
3502 ; CHECK-NEXT: mov d4, v2.d[1]
3503 ; CHECK-NEXT: mov d2, v0.d[1]
3504 ; CHECK-NEXT: fcvtzs w14, d3
3505 ; CHECK-NEXT: cmp w8, w9
3506 ; CHECK-NEXT: fcvtzs w12, d4
3507 ; CHECK-NEXT: fcvtzs w16, d2
3508 ; CHECK-NEXT: csel w8, w8, w9, lt
3509 ; CHECK-NEXT: cmn w8, #8, lsl #12 // =32768
3510 ; CHECK-NEXT: csel w8, w8, w11, gt
3511 ; CHECK-NEXT: cmp w10, w9
3512 ; CHECK-NEXT: csel w10, w10, w9, lt
3513 ; CHECK-NEXT: cmn w10, #8, lsl #12 // =32768
3514 ; CHECK-NEXT: csel w10, w10, w11, gt
3515 ; CHECK-NEXT: cmp w12, w9
3516 ; CHECK-NEXT: csel w12, w12, w9, lt
3517 ; CHECK-NEXT: fmov s3, w10
3518 ; CHECK-NEXT: cmn w12, #8, lsl #12 // =32768
3519 ; CHECK-NEXT: csel w12, w12, w11, gt
3520 ; CHECK-NEXT: cmp w13, w9
3521 ; CHECK-NEXT: csel w13, w13, w9, lt
3522 ; CHECK-NEXT: mov v3.s[1], w8
3523 ; CHECK-NEXT: cmn w13, #8, lsl #12 // =32768
3524 ; CHECK-NEXT: csel w13, w13, w11, gt
3525 ; CHECK-NEXT: cmp w14, w9
3526 ; CHECK-NEXT: csel w14, w14, w9, lt
3527 ; CHECK-NEXT: fmov s2, w13
3528 ; CHECK-NEXT: cmn w14, #8, lsl #12 // =32768
3529 ; CHECK-NEXT: csel w14, w14, w11, gt
3530 ; CHECK-NEXT: cmp w15, w9
3531 ; CHECK-NEXT: csel w15, w15, w9, lt
3532 ; CHECK-NEXT: mov v2.s[1], w12
3533 ; CHECK-NEXT: cmn w15, #8, lsl #12 // =32768
3534 ; CHECK-NEXT: csel w15, w15, w11, gt
3535 ; CHECK-NEXT: cmp w16, w9
3536 ; CHECK-NEXT: csel w10, w16, w9, lt
3537 ; CHECK-NEXT: fmov s1, w15
3538 ; CHECK-NEXT: cmn w10, #8, lsl #12 // =32768
3539 ; CHECK-NEXT: csel w8, w10, w11, gt
3540 ; CHECK-NEXT: cmp w17, w9
3541 ; CHECK-NEXT: csel w9, w17, w9, lt
3542 ; CHECK-NEXT: mov v1.s[1], w14
3543 ; CHECK-NEXT: cmn w9, #8, lsl #12 // =32768
3544 ; CHECK-NEXT: csel w9, w9, w11, gt
3545 ; CHECK-NEXT: fmov s0, w9
3546 ; CHECK-NEXT: mov v0.s[1], w8
3547 ; CHECK-NEXT: adrp x8, .LCPI84_0
3548 ; CHECK-NEXT: ldr q4, [x8, :lo12:.LCPI84_0]
3549 ; CHECK-NEXT: tbl v0.16b, { v0.16b, v1.16b, v2.16b, v3.16b }, v4.16b
3551 %x = call <8 x i16> @llvm.fptosi.sat.v8f64.v8i16(<8 x double> %f)
3555 define <16 x i16> @test_signed_v16f64_v16i16(<16 x double> %f) {
3556 ; CHECK-LABEL: test_signed_v16f64_v16i16:
3558 ; CHECK-NEXT: mov d16, v3.d[1]
3559 ; CHECK-NEXT: mov w9, #32767 // =0x7fff
3560 ; CHECK-NEXT: fcvtzs w11, d3
3561 ; CHECK-NEXT: mov d3, v1.d[1]
3562 ; CHECK-NEXT: fcvtzs w14, d2
3563 ; CHECK-NEXT: fcvtzs w15, d1
3564 ; CHECK-NEXT: mov d1, v7.d[1]
3565 ; CHECK-NEXT: fcvtzs w18, d0
3566 ; CHECK-NEXT: fcvtzs w0, d7
3567 ; CHECK-NEXT: fcvtzs w2, d6
3568 ; CHECK-NEXT: fcvtzs w4, d5
3569 ; CHECK-NEXT: fcvtzs w6, d4
3570 ; CHECK-NEXT: fcvtzs w8, d16
3571 ; CHECK-NEXT: mov d16, v2.d[1]
3572 ; CHECK-NEXT: mov d2, v0.d[1]
3573 ; CHECK-NEXT: mov d0, v6.d[1]
3574 ; CHECK-NEXT: cmp w8, w9
3575 ; CHECK-NEXT: fcvtzs w13, d16
3576 ; CHECK-NEXT: fcvtzs w17, d2
3577 ; CHECK-NEXT: csel w10, w8, w9, lt
3578 ; CHECK-NEXT: mov w8, #-32768 // =0xffff8000
3579 ; CHECK-NEXT: fcvtzs w1, d0
3580 ; CHECK-NEXT: cmn w10, #8, lsl #12 // =32768
3581 ; CHECK-NEXT: mov d0, v5.d[1]
3582 ; CHECK-NEXT: csel w10, w10, w8, gt
3583 ; CHECK-NEXT: cmp w11, w9
3584 ; CHECK-NEXT: csel w11, w11, w9, lt
3585 ; CHECK-NEXT: cmn w11, #8, lsl #12 // =32768
3586 ; CHECK-NEXT: csel w12, w11, w8, gt
3587 ; CHECK-NEXT: cmp w13, w9
3588 ; CHECK-NEXT: fcvtzs w3, d0
3589 ; CHECK-NEXT: csel w11, w13, w9, lt
3590 ; CHECK-NEXT: fcvtzs w13, d3
3591 ; CHECK-NEXT: mov d0, v4.d[1]
3592 ; CHECK-NEXT: cmn w11, #8, lsl #12 // =32768
3593 ; CHECK-NEXT: csel w11, w11, w8, gt
3594 ; CHECK-NEXT: cmp w14, w9
3595 ; CHECK-NEXT: csel w14, w14, w9, lt
3596 ; CHECK-NEXT: cmn w14, #8, lsl #12 // =32768
3597 ; CHECK-NEXT: fcvtzs w5, d0
3598 ; CHECK-NEXT: csel w14, w14, w8, gt
3599 ; CHECK-NEXT: cmp w13, w9
3600 ; CHECK-NEXT: csel w13, w13, w9, lt
3601 ; CHECK-NEXT: cmn w13, #8, lsl #12 // =32768
3602 ; CHECK-NEXT: csel w13, w13, w8, gt
3603 ; CHECK-NEXT: cmp w15, w9
3604 ; CHECK-NEXT: csel w15, w15, w9, lt
3605 ; CHECK-NEXT: cmn w15, #8, lsl #12 // =32768
3606 ; CHECK-NEXT: csel w16, w15, w8, gt
3607 ; CHECK-NEXT: cmp w17, w9
3608 ; CHECK-NEXT: csel w15, w17, w9, lt
3609 ; CHECK-NEXT: fcvtzs w17, d1
3610 ; CHECK-NEXT: fmov s3, w12
3611 ; CHECK-NEXT: cmn w15, #8, lsl #12 // =32768
3612 ; CHECK-NEXT: csel w15, w15, w8, gt
3613 ; CHECK-NEXT: cmp w18, w9
3614 ; CHECK-NEXT: csel w18, w18, w9, lt
3615 ; CHECK-NEXT: mov v3.s[1], w10
3616 ; CHECK-NEXT: cmn w18, #8, lsl #12 // =32768
3617 ; CHECK-NEXT: fmov s2, w14
3618 ; CHECK-NEXT: csel w18, w18, w8, gt
3619 ; CHECK-NEXT: cmp w17, w9
3620 ; CHECK-NEXT: csel w17, w17, w9, lt
3621 ; CHECK-NEXT: cmn w17, #8, lsl #12 // =32768
3622 ; CHECK-NEXT: mov v2.s[1], w11
3623 ; CHECK-NEXT: csel w17, w17, w8, gt
3624 ; CHECK-NEXT: cmp w0, w9
3625 ; CHECK-NEXT: fmov s1, w16
3626 ; CHECK-NEXT: csel w0, w0, w9, lt
3627 ; CHECK-NEXT: cmn w0, #8, lsl #12 // =32768
3628 ; CHECK-NEXT: csel w0, w0, w8, gt
3629 ; CHECK-NEXT: cmp w1, w9
3630 ; CHECK-NEXT: mov v1.s[1], w13
3631 ; CHECK-NEXT: csel w1, w1, w9, lt
3632 ; CHECK-NEXT: fmov s7, w0
3633 ; CHECK-NEXT: fmov s0, w18
3634 ; CHECK-NEXT: cmn w1, #8, lsl #12 // =32768
3635 ; CHECK-NEXT: csel w1, w1, w8, gt
3636 ; CHECK-NEXT: cmp w2, w9
3637 ; CHECK-NEXT: csel w2, w2, w9, lt
3638 ; CHECK-NEXT: mov v7.s[1], w17
3639 ; CHECK-NEXT: mov v0.s[1], w15
3640 ; CHECK-NEXT: cmn w2, #8, lsl #12 // =32768
3641 ; CHECK-NEXT: csel w2, w2, w8, gt
3642 ; CHECK-NEXT: cmp w3, w9
3643 ; CHECK-NEXT: csel w3, w3, w9, lt
3644 ; CHECK-NEXT: fmov s6, w2
3645 ; CHECK-NEXT: cmn w3, #8, lsl #12 // =32768
3646 ; CHECK-NEXT: csel w3, w3, w8, gt
3647 ; CHECK-NEXT: cmp w4, w9
3648 ; CHECK-NEXT: csel w4, w4, w9, lt
3649 ; CHECK-NEXT: mov v6.s[1], w1
3650 ; CHECK-NEXT: cmn w4, #8, lsl #12 // =32768
3651 ; CHECK-NEXT: csel w12, w4, w8, gt
3652 ; CHECK-NEXT: cmp w5, w9
3653 ; CHECK-NEXT: csel w10, w5, w9, lt
3654 ; CHECK-NEXT: fmov s5, w12
3655 ; CHECK-NEXT: cmn w10, #8, lsl #12 // =32768
3656 ; CHECK-NEXT: csel w10, w10, w8, gt
3657 ; CHECK-NEXT: cmp w6, w9
3658 ; CHECK-NEXT: csel w9, w6, w9, lt
3659 ; CHECK-NEXT: mov v5.s[1], w3
3660 ; CHECK-NEXT: cmn w9, #8, lsl #12 // =32768
3661 ; CHECK-NEXT: csel w8, w9, w8, gt
3662 ; CHECK-NEXT: fmov s4, w8
3663 ; CHECK-NEXT: adrp x8, .LCPI85_0
3664 ; CHECK-NEXT: ldr q16, [x8, :lo12:.LCPI85_0]
3665 ; CHECK-NEXT: mov v4.s[1], w10
3666 ; CHECK-NEXT: tbl v0.16b, { v0.16b, v1.16b, v2.16b, v3.16b }, v16.16b
3667 ; CHECK-NEXT: tbl v1.16b, { v4.16b, v5.16b, v6.16b, v7.16b }, v16.16b
3669 %x = call <16 x i16> @llvm.fptosi.sat.v16f64.v16i16(<16 x double> %f)