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
7 define <2 x i32> @stest_f64i32(<2 x double> %x) {
8 ; CHECK-LABEL: stest_f64i32:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: mov d1, v0.d[1]
11 ; CHECK-NEXT: fcvtzs w8, d0
12 ; CHECK-NEXT: fcvtzs w9, d1
13 ; CHECK-NEXT: fmov s0, w8
14 ; CHECK-NEXT: mov v0.s[1], w9
15 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
18 %conv = fptosi <2 x double> %x to <2 x i64>
19 %0 = icmp slt <2 x i64> %conv, <i64 2147483647, i64 2147483647>
20 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>
21 %1 = icmp sgt <2 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648>
22 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>
23 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
27 define <2 x i32> @utest_f64i32(<2 x double> %x) {
28 ; CHECK-LABEL: utest_f64i32:
29 ; CHECK: // %bb.0: // %entry
30 ; CHECK-NEXT: mov d1, v0.d[1]
31 ; CHECK-NEXT: fcvtzu w8, d0
32 ; CHECK-NEXT: fcvtzu w9, d1
33 ; CHECK-NEXT: fmov s0, w8
34 ; CHECK-NEXT: mov v0.s[1], w9
35 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
38 %conv = fptoui <2 x double> %x to <2 x i64>
39 %0 = icmp ult <2 x i64> %conv, <i64 4294967295, i64 4294967295>
40 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
41 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
45 define <2 x i32> @ustest_f64i32(<2 x double> %x) {
46 ; CHECK-LABEL: ustest_f64i32:
47 ; CHECK: // %bb.0: // %entry
48 ; CHECK-NEXT: mov d1, v0.d[1]
49 ; CHECK-NEXT: fcvtzu w8, d0
50 ; CHECK-NEXT: fcvtzu w9, d1
51 ; CHECK-NEXT: fmov s0, w8
52 ; CHECK-NEXT: mov v0.s[1], w9
53 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
56 %conv = fptosi <2 x double> %x to <2 x i64>
57 %0 = icmp slt <2 x i64> %conv, <i64 4294967295, i64 4294967295>
58 %spec.store.select = select <2 x i1> %0, <2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>
59 %1 = icmp sgt <2 x i64> %spec.store.select, zeroinitializer
60 %spec.store.select7 = select <2 x i1> %1, <2 x i64> %spec.store.select, <2 x i64> zeroinitializer
61 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
65 define <4 x i32> @stest_f32i32(<4 x float> %x) {
66 ; CHECK-LABEL: stest_f32i32:
67 ; CHECK: // %bb.0: // %entry
68 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
71 %conv = fptosi <4 x float> %x to <4 x i64>
72 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
73 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
74 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
75 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
76 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
80 define <4 x i32> @utest_f32i32(<4 x float> %x) {
81 ; CHECK-LABEL: utest_f32i32:
82 ; CHECK: // %bb.0: // %entry
83 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
86 %conv = fptoui <4 x float> %x to <4 x i64>
87 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
88 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
89 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
93 define <4 x i32> @ustest_f32i32(<4 x float> %x) {
94 ; CHECK-LABEL: ustest_f32i32:
95 ; CHECK: // %bb.0: // %entry
96 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
99 %conv = fptosi <4 x float> %x to <4 x i64>
100 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
101 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
102 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
103 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
104 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
108 define <4 x i32> @stest_f16i32(<4 x half> %x) {
109 ; CHECK-LABEL: stest_f16i32:
110 ; CHECK: // %bb.0: // %entry
111 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
112 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
115 %conv = fptosi <4 x half> %x to <4 x i64>
116 %0 = icmp slt <4 x i64> %conv, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
117 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>
118 %1 = icmp sgt <4 x i64> %spec.store.select, <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
119 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>
120 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
124 define <4 x i32> @utesth_f16i32(<4 x half> %x) {
125 ; CHECK-LABEL: utesth_f16i32:
126 ; CHECK: // %bb.0: // %entry
127 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
128 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
131 %conv = fptoui <4 x half> %x to <4 x i64>
132 %0 = icmp ult <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
133 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
134 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
138 define <4 x i32> @ustest_f16i32(<4 x half> %x) {
139 ; CHECK-LABEL: ustest_f16i32:
140 ; CHECK: // %bb.0: // %entry
141 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
142 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
145 %conv = fptosi <4 x half> %x to <4 x i64>
146 %0 = icmp slt <4 x i64> %conv, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
147 %spec.store.select = select <4 x i1> %0, <4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
148 %1 = icmp sgt <4 x i64> %spec.store.select, zeroinitializer
149 %spec.store.select7 = select <4 x i1> %1, <4 x i64> %spec.store.select, <4 x i64> zeroinitializer
150 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
156 define <2 x i16> @stest_f64i16(<2 x double> %x) {
157 ; CHECK-LABEL: stest_f64i16:
158 ; CHECK: // %bb.0: // %entry
159 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
160 ; CHECK-NEXT: movi v1.2s, #127, msl #8
161 ; CHECK-NEXT: xtn v0.2s, v0.2d
162 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
163 ; CHECK-NEXT: mvni v1.2s, #127, msl #8
164 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
167 %conv = fptosi <2 x double> %x to <2 x i32>
168 %0 = icmp slt <2 x i32> %conv, <i32 32767, i32 32767>
169 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>
170 %1 = icmp sgt <2 x i32> %spec.store.select, <i32 -32768, i32 -32768>
171 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>
172 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
176 define <2 x i16> @utest_f64i16(<2 x double> %x) {
177 ; CHECK-LABEL: utest_f64i16:
178 ; CHECK: // %bb.0: // %entry
179 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
180 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
181 ; CHECK-NEXT: xtn v0.2s, v0.2d
182 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
185 %conv = fptoui <2 x double> %x to <2 x i32>
186 %0 = icmp ult <2 x i32> %conv, <i32 65535, i32 65535>
187 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
188 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
192 define <2 x i16> @ustest_f64i16(<2 x double> %x) {
193 ; CHECK-LABEL: ustest_f64i16:
194 ; CHECK: // %bb.0: // %entry
195 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
196 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
197 ; CHECK-NEXT: movi v2.2d, #0000000000000000
198 ; CHECK-NEXT: xtn v0.2s, v0.2d
199 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
200 ; CHECK-NEXT: smax v0.2s, v0.2s, v2.2s
203 %conv = fptosi <2 x double> %x to <2 x i32>
204 %0 = icmp slt <2 x i32> %conv, <i32 65535, i32 65535>
205 %spec.store.select = select <2 x i1> %0, <2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>
206 %1 = icmp sgt <2 x i32> %spec.store.select, zeroinitializer
207 %spec.store.select7 = select <2 x i1> %1, <2 x i32> %spec.store.select, <2 x i32> zeroinitializer
208 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
212 define <4 x i16> @stest_f32i16(<4 x float> %x) {
213 ; CHECK-LABEL: stest_f32i16:
214 ; CHECK: // %bb.0: // %entry
215 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
216 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
219 %conv = fptosi <4 x float> %x to <4 x i32>
220 %0 = icmp slt <4 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767>
221 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>
222 %1 = icmp sgt <4 x i32> %spec.store.select, <i32 -32768, i32 -32768, i32 -32768, i32 -32768>
223 %spec.store.select7 = select <4 x i1> %1, <4 x i32> %spec.store.select, <4 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768>
224 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
228 define <4 x i16> @utest_f32i16(<4 x float> %x) {
229 ; CHECK-LABEL: utest_f32i16:
230 ; CHECK: // %bb.0: // %entry
231 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
232 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
235 %conv = fptoui <4 x float> %x to <4 x i32>
236 %0 = icmp ult <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
237 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
238 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
242 define <4 x i16> @ustest_f32i16(<4 x float> %x) {
243 ; CHECK-LABEL: ustest_f32i16:
244 ; CHECK: // %bb.0: // %entry
245 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
246 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
249 %conv = fptosi <4 x float> %x to <4 x i32>
250 %0 = icmp slt <4 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535>
251 %spec.store.select = select <4 x i1> %0, <4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
252 %1 = icmp sgt <4 x i32> %spec.store.select, zeroinitializer
253 %spec.store.select7 = select <4 x i1> %1, <4 x i32> %spec.store.select, <4 x i32> zeroinitializer
254 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
258 define <8 x i16> @stest_f16i16(<8 x half> %x) {
259 ; CHECK-CVT-LABEL: stest_f16i16:
260 ; CHECK-CVT: // %bb.0: // %entry
261 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
262 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
263 ; CHECK-CVT-NEXT: fcvtzs v1.4s, v1.4s
264 ; CHECK-CVT-NEXT: fcvtzs v2.4s, v0.4s
265 ; CHECK-CVT-NEXT: sqxtn v0.4h, v1.4s
266 ; CHECK-CVT-NEXT: sqxtn2 v0.8h, v2.4s
267 ; CHECK-CVT-NEXT: ret
269 ; CHECK-FP16-LABEL: stest_f16i16:
270 ; CHECK-FP16: // %bb.0: // %entry
271 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
272 ; CHECK-FP16-NEXT: ret
274 %conv = fptosi <8 x half> %x to <8 x i32>
275 %0 = icmp slt <8 x i32> %conv, <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>
276 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>
277 %1 = icmp sgt <8 x i32> %spec.store.select, <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>
278 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>
279 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
283 define <8 x i16> @utesth_f16i16(<8 x half> %x) {
284 ; CHECK-CVT-LABEL: utesth_f16i16:
285 ; CHECK-CVT: // %bb.0: // %entry
286 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
287 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
288 ; CHECK-CVT-NEXT: fcvtzu v1.4s, v1.4s
289 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v0.4s
290 ; CHECK-CVT-NEXT: uqxtn v0.4h, v1.4s
291 ; CHECK-CVT-NEXT: uqxtn2 v0.8h, v2.4s
292 ; CHECK-CVT-NEXT: ret
294 ; CHECK-FP16-LABEL: utesth_f16i16:
295 ; CHECK-FP16: // %bb.0: // %entry
296 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
297 ; CHECK-FP16-NEXT: ret
299 %conv = fptoui <8 x half> %x to <8 x i32>
300 %0 = icmp ult <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
301 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
302 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
306 define <8 x i16> @ustest_f16i16(<8 x half> %x) {
307 ; CHECK-CVT-LABEL: ustest_f16i16:
308 ; CHECK-CVT: // %bb.0: // %entry
309 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
310 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
311 ; CHECK-CVT-NEXT: fcvtzu v1.4s, v1.4s
312 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v0.4s
313 ; CHECK-CVT-NEXT: uqxtn v0.4h, v1.4s
314 ; CHECK-CVT-NEXT: uqxtn2 v0.8h, v2.4s
315 ; CHECK-CVT-NEXT: ret
317 ; CHECK-FP16-LABEL: ustest_f16i16:
318 ; CHECK-FP16: // %bb.0: // %entry
319 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
320 ; CHECK-FP16-NEXT: ret
322 %conv = fptosi <8 x half> %x to <8 x i32>
323 %0 = icmp slt <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
324 %spec.store.select = select <8 x i1> %0, <8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
325 %1 = icmp sgt <8 x i32> %spec.store.select, zeroinitializer
326 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> zeroinitializer
327 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
333 define <2 x i64> @stest_f64i64(<2 x double> %x) {
334 ; CHECK-LABEL: stest_f64i64:
335 ; CHECK: // %bb.0: // %entry
336 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
339 %conv = fptosi <2 x double> %x to <2 x i128>
340 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
341 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
342 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
343 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
344 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
348 define <2 x i64> @utest_f64i64(<2 x double> %x) {
349 ; CHECK-LABEL: utest_f64i64:
350 ; CHECK: // %bb.0: // %entry
351 ; CHECK-NEXT: sub sp, sp, #48
352 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
353 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
354 ; CHECK-NEXT: .cfi_def_cfa_offset 48
355 ; CHECK-NEXT: .cfi_offset w19, -8
356 ; CHECK-NEXT: .cfi_offset w20, -16
357 ; CHECK-NEXT: .cfi_offset w30, -32
358 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
359 ; CHECK-NEXT: mov d0, v0.d[1]
360 ; CHECK-NEXT: bl __fixunsdfti
361 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
362 ; CHECK-NEXT: mov x19, x0
363 ; CHECK-NEXT: mov x20, x1
364 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
365 ; CHECK-NEXT: bl __fixunsdfti
366 ; CHECK-NEXT: cmp x1, #0
367 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
368 ; CHECK-NEXT: csel x8, x0, xzr, eq
369 ; CHECK-NEXT: cmp x20, #0
370 ; CHECK-NEXT: csel x9, x19, xzr, eq
371 ; CHECK-NEXT: fmov d0, x8
372 ; CHECK-NEXT: fmov d1, x9
373 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
374 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
375 ; CHECK-NEXT: add sp, sp, #48
378 %conv = fptoui <2 x double> %x to <2 x i128>
379 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
380 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
381 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
385 define <2 x i64> @ustest_f64i64(<2 x double> %x) {
386 ; CHECK-LABEL: ustest_f64i64:
387 ; CHECK: // %bb.0: // %entry
388 ; CHECK-NEXT: sub sp, sp, #48
389 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
390 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
391 ; CHECK-NEXT: .cfi_def_cfa_offset 48
392 ; CHECK-NEXT: .cfi_offset w19, -8
393 ; CHECK-NEXT: .cfi_offset w20, -16
394 ; CHECK-NEXT: .cfi_offset w30, -32
395 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
396 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
397 ; CHECK-NEXT: bl __fixdfti
398 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
399 ; CHECK-NEXT: mov x19, x0
400 ; CHECK-NEXT: mov x20, x1
401 ; CHECK-NEXT: mov d0, v0.d[1]
402 ; CHECK-NEXT: bl __fixdfti
403 ; CHECK-NEXT: cmp x1, #1
404 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
405 ; CHECK-NEXT: csel x8, x0, xzr, lt
406 ; CHECK-NEXT: csinc x9, x1, xzr, lt
407 ; CHECK-NEXT: cmp x20, #1
408 ; CHECK-NEXT: csel x10, x19, xzr, lt
409 ; CHECK-NEXT: csinc x11, x20, xzr, lt
410 ; CHECK-NEXT: cmp xzr, x10
411 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
412 ; CHECK-NEXT: ngcs xzr, x11
413 ; CHECK-NEXT: csel x10, x10, xzr, lt
414 ; CHECK-NEXT: cmp xzr, x8
415 ; CHECK-NEXT: ngcs xzr, x9
416 ; CHECK-NEXT: fmov d0, x10
417 ; CHECK-NEXT: csel x8, x8, xzr, lt
418 ; CHECK-NEXT: fmov d1, x8
419 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
420 ; CHECK-NEXT: add sp, sp, #48
423 %conv = fptosi <2 x double> %x to <2 x i128>
424 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
425 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
426 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
427 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
428 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
432 define <2 x i64> @stest_f32i64(<2 x float> %x) {
433 ; CHECK-LABEL: stest_f32i64:
434 ; CHECK: // %bb.0: // %entry
435 ; CHECK-NEXT: fcvtl v0.2d, v0.2s
436 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
439 %conv = fptosi <2 x float> %x to <2 x i128>
440 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
441 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
442 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
443 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
444 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
448 define <2 x i64> @utest_f32i64(<2 x float> %x) {
449 ; CHECK-LABEL: utest_f32i64:
450 ; CHECK: // %bb.0: // %entry
451 ; CHECK-NEXT: sub sp, sp, #48
452 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
453 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
454 ; CHECK-NEXT: .cfi_def_cfa_offset 48
455 ; CHECK-NEXT: .cfi_offset w19, -8
456 ; CHECK-NEXT: .cfi_offset w20, -16
457 ; CHECK-NEXT: .cfi_offset w30, -32
458 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
459 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
460 ; CHECK-NEXT: mov s0, v0.s[1]
461 ; CHECK-NEXT: bl __fixunssfti
462 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
463 ; CHECK-NEXT: mov x19, x0
464 ; CHECK-NEXT: mov x20, x1
465 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
466 ; CHECK-NEXT: bl __fixunssfti
467 ; CHECK-NEXT: cmp x1, #0
468 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
469 ; CHECK-NEXT: csel x8, x0, xzr, eq
470 ; CHECK-NEXT: cmp x20, #0
471 ; CHECK-NEXT: csel x9, x19, xzr, eq
472 ; CHECK-NEXT: fmov d0, x8
473 ; CHECK-NEXT: fmov d1, x9
474 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
475 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
476 ; CHECK-NEXT: add sp, sp, #48
479 %conv = fptoui <2 x float> %x to <2 x i128>
480 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
481 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
482 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
486 define <2 x i64> @ustest_f32i64(<2 x float> %x) {
487 ; CHECK-LABEL: ustest_f32i64:
488 ; CHECK: // %bb.0: // %entry
489 ; CHECK-NEXT: sub sp, sp, #48
490 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
491 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
492 ; CHECK-NEXT: .cfi_def_cfa_offset 48
493 ; CHECK-NEXT: .cfi_offset w19, -8
494 ; CHECK-NEXT: .cfi_offset w20, -16
495 ; CHECK-NEXT: .cfi_offset w30, -32
496 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
497 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
498 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
499 ; CHECK-NEXT: bl __fixsfti
500 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
501 ; CHECK-NEXT: mov x19, x0
502 ; CHECK-NEXT: mov x20, x1
503 ; CHECK-NEXT: mov s0, v0.s[1]
504 ; CHECK-NEXT: bl __fixsfti
505 ; CHECK-NEXT: cmp x1, #1
506 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
507 ; CHECK-NEXT: csinc x8, x1, xzr, lt
508 ; CHECK-NEXT: csel x9, x0, xzr, lt
509 ; CHECK-NEXT: cmp x20, #1
510 ; CHECK-NEXT: csel x10, x19, xzr, lt
511 ; CHECK-NEXT: csinc x11, x20, xzr, lt
512 ; CHECK-NEXT: cmp xzr, x10
513 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
514 ; CHECK-NEXT: ngcs xzr, x11
515 ; CHECK-NEXT: csel x10, x10, xzr, lt
516 ; CHECK-NEXT: cmp xzr, x9
517 ; CHECK-NEXT: ngcs xzr, x8
518 ; CHECK-NEXT: fmov d0, x10
519 ; CHECK-NEXT: csel x8, x9, xzr, lt
520 ; CHECK-NEXT: fmov d1, x8
521 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
522 ; CHECK-NEXT: add sp, sp, #48
525 %conv = fptosi <2 x float> %x to <2 x i128>
526 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
527 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
528 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
529 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
530 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
534 define <2 x i64> @stest_f16i64(<2 x half> %x) {
535 ; CHECK-CVT-LABEL: stest_f16i64:
536 ; CHECK-CVT: // %bb.0: // %entry
537 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
538 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
539 ; CHECK-CVT-NEXT: fcvt s0, h0
540 ; CHECK-CVT-NEXT: fcvt s1, h1
541 ; CHECK-CVT-NEXT: fcvtzs x8, s0
542 ; CHECK-CVT-NEXT: fcvtzs x9, s1
543 ; CHECK-CVT-NEXT: fmov d0, x8
544 ; CHECK-CVT-NEXT: mov v0.d[1], x9
545 ; CHECK-CVT-NEXT: ret
547 ; CHECK-FP16-LABEL: stest_f16i64:
548 ; CHECK-FP16: // %bb.0: // %entry
549 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
550 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
551 ; CHECK-FP16-NEXT: fcvtzs x8, h0
552 ; CHECK-FP16-NEXT: fcvtzs x9, h1
553 ; CHECK-FP16-NEXT: fmov d0, x8
554 ; CHECK-FP16-NEXT: mov v0.d[1], x9
555 ; CHECK-FP16-NEXT: ret
557 %conv = fptosi <2 x half> %x to <2 x i128>
558 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
559 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
560 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
561 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
562 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
566 define <2 x i64> @utesth_f16i64(<2 x half> %x) {
567 ; CHECK-LABEL: utesth_f16i64:
568 ; CHECK: // %bb.0: // %entry
569 ; CHECK-NEXT: sub sp, sp, #48
570 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
571 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
572 ; CHECK-NEXT: .cfi_def_cfa_offset 48
573 ; CHECK-NEXT: .cfi_offset w19, -8
574 ; CHECK-NEXT: .cfi_offset w20, -16
575 ; CHECK-NEXT: .cfi_offset w30, -32
576 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
577 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
578 ; CHECK-NEXT: mov h0, v0.h[1]
579 ; CHECK-NEXT: bl __fixunshfti
580 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
581 ; CHECK-NEXT: mov x19, x0
582 ; CHECK-NEXT: mov x20, x1
583 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
584 ; CHECK-NEXT: bl __fixunshfti
585 ; CHECK-NEXT: cmp x1, #0
586 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
587 ; CHECK-NEXT: csel x8, x0, xzr, eq
588 ; CHECK-NEXT: cmp x20, #0
589 ; CHECK-NEXT: csel x9, x19, xzr, eq
590 ; CHECK-NEXT: fmov d0, x8
591 ; CHECK-NEXT: fmov d1, x9
592 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
593 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
594 ; CHECK-NEXT: add sp, sp, #48
597 %conv = fptoui <2 x half> %x to <2 x i128>
598 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
599 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
600 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
604 define <2 x i64> @ustest_f16i64(<2 x half> %x) {
605 ; CHECK-LABEL: ustest_f16i64:
606 ; CHECK: // %bb.0: // %entry
607 ; CHECK-NEXT: sub sp, sp, #48
608 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
609 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
610 ; CHECK-NEXT: .cfi_def_cfa_offset 48
611 ; CHECK-NEXT: .cfi_offset w19, -8
612 ; CHECK-NEXT: .cfi_offset w20, -16
613 ; CHECK-NEXT: .cfi_offset w30, -32
614 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
615 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
616 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
617 ; CHECK-NEXT: bl __fixhfti
618 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
619 ; CHECK-NEXT: mov x19, x0
620 ; CHECK-NEXT: mov x20, x1
621 ; CHECK-NEXT: mov h0, v0.h[1]
622 ; CHECK-NEXT: bl __fixhfti
623 ; CHECK-NEXT: cmp x1, #1
624 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
625 ; CHECK-NEXT: csinc x8, x1, xzr, lt
626 ; CHECK-NEXT: csel x9, x0, xzr, lt
627 ; CHECK-NEXT: cmp x20, #1
628 ; CHECK-NEXT: csel x10, x19, xzr, lt
629 ; CHECK-NEXT: csinc x11, x20, xzr, lt
630 ; CHECK-NEXT: cmp xzr, x10
631 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
632 ; CHECK-NEXT: ngcs xzr, x11
633 ; CHECK-NEXT: csel x10, x10, xzr, lt
634 ; CHECK-NEXT: cmp xzr, x9
635 ; CHECK-NEXT: ngcs xzr, x8
636 ; CHECK-NEXT: fmov d0, x10
637 ; CHECK-NEXT: csel x8, x9, xzr, lt
638 ; CHECK-NEXT: fmov d1, x8
639 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
640 ; CHECK-NEXT: add sp, sp, #48
643 %conv = fptosi <2 x half> %x to <2 x i128>
644 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
645 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
646 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
647 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
648 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
656 define <2 x i32> @stest_f64i32_mm(<2 x double> %x) {
657 ; CHECK-LABEL: stest_f64i32_mm:
658 ; CHECK: // %bb.0: // %entry
659 ; CHECK-NEXT: mov d1, v0.d[1]
660 ; CHECK-NEXT: fcvtzs w8, d0
661 ; CHECK-NEXT: fcvtzs w9, d1
662 ; CHECK-NEXT: fmov s0, w8
663 ; CHECK-NEXT: mov v0.s[1], w9
664 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
667 %conv = fptosi <2 x double> %x to <2 x i64>
668 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>)
669 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>)
670 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
674 define <2 x i32> @utest_f64i32_mm(<2 x double> %x) {
675 ; CHECK-LABEL: utest_f64i32_mm:
676 ; CHECK: // %bb.0: // %entry
677 ; CHECK-NEXT: mov d1, v0.d[1]
678 ; CHECK-NEXT: fcvtzu w8, d0
679 ; CHECK-NEXT: fcvtzu w9, d1
680 ; CHECK-NEXT: fmov s0, w8
681 ; CHECK-NEXT: mov v0.s[1], w9
682 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
685 %conv = fptoui <2 x double> %x to <2 x i64>
686 %spec.store.select = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
687 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
691 define <2 x i32> @ustest_f64i32_mm(<2 x double> %x) {
692 ; CHECK-LABEL: ustest_f64i32_mm:
693 ; CHECK: // %bb.0: // %entry
694 ; CHECK-NEXT: mov d1, v0.d[1]
695 ; CHECK-NEXT: fcvtzu w8, d0
696 ; CHECK-NEXT: fcvtzu w9, d1
697 ; CHECK-NEXT: fmov s0, w8
698 ; CHECK-NEXT: mov v0.s[1], w9
699 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
702 %conv = fptosi <2 x double> %x to <2 x i64>
703 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
704 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> zeroinitializer)
705 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
709 define <4 x i32> @stest_f32i32_mm(<4 x float> %x) {
710 ; CHECK-LABEL: stest_f32i32_mm:
711 ; CHECK: // %bb.0: // %entry
712 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
715 %conv = fptosi <4 x float> %x to <4 x i64>
716 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>)
717 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>)
718 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
722 define <4 x i32> @utest_f32i32_mm(<4 x float> %x) {
723 ; CHECK-LABEL: utest_f32i32_mm:
724 ; CHECK: // %bb.0: // %entry
725 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
728 %conv = fptoui <4 x float> %x to <4 x i64>
729 %spec.store.select = call <4 x i64> @llvm.umin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
730 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
734 define <4 x i32> @ustest_f32i32_mm(<4 x float> %x) {
735 ; CHECK-LABEL: ustest_f32i32_mm:
736 ; CHECK: // %bb.0: // %entry
737 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
740 %conv = fptosi <4 x float> %x to <4 x i64>
741 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
742 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
743 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
747 define <4 x i32> @stest_f16i32_mm(<4 x half> %x) {
748 ; CHECK-LABEL: stest_f16i32_mm:
749 ; CHECK: // %bb.0: // %entry
750 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
751 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
754 %conv = fptosi <4 x half> %x to <4 x i64>
755 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483647>)
756 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> <i64 -2147483648, i64 -2147483648, i64 -2147483648, i64 -2147483648>)
757 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
761 define <4 x i32> @utesth_f16i32_mm(<4 x half> %x) {
762 ; CHECK-LABEL: utesth_f16i32_mm:
763 ; CHECK: // %bb.0: // %entry
764 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
765 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
768 %conv = fptoui <4 x half> %x to <4 x i64>
769 %spec.store.select = call <4 x i64> @llvm.umin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
770 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
774 define <4 x i32> @ustest_f16i32_mm(<4 x half> %x) {
775 ; CHECK-LABEL: ustest_f16i32_mm:
776 ; CHECK: // %bb.0: // %entry
777 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
778 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
781 %conv = fptosi <4 x half> %x to <4 x i64>
782 %spec.store.select = call <4 x i64> @llvm.smin.v4i64(<4 x i64> %conv, <4 x i64> <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>)
783 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
784 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
790 define <2 x i16> @stest_f64i16_mm(<2 x double> %x) {
791 ; CHECK-LABEL: stest_f64i16_mm:
792 ; CHECK: // %bb.0: // %entry
793 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
794 ; CHECK-NEXT: movi v1.2s, #127, msl #8
795 ; CHECK-NEXT: xtn v0.2s, v0.2d
796 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
797 ; CHECK-NEXT: mvni v1.2s, #127, msl #8
798 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
801 %conv = fptosi <2 x double> %x to <2 x i32>
802 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>)
803 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>)
804 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
808 define <2 x i16> @utest_f64i16_mm(<2 x double> %x) {
809 ; CHECK-LABEL: utest_f64i16_mm:
810 ; CHECK: // %bb.0: // %entry
811 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
812 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
813 ; CHECK-NEXT: xtn v0.2s, v0.2d
814 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
817 %conv = fptoui <2 x double> %x to <2 x i32>
818 %spec.store.select = call <2 x i32> @llvm.umin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
819 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
823 define <2 x i16> @ustest_f64i16_mm(<2 x double> %x) {
824 ; CHECK-LABEL: ustest_f64i16_mm:
825 ; CHECK: // %bb.0: // %entry
826 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
827 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
828 ; CHECK-NEXT: movi v2.2d, #0000000000000000
829 ; CHECK-NEXT: xtn v0.2s, v0.2d
830 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
831 ; CHECK-NEXT: smax v0.2s, v0.2s, v2.2s
834 %conv = fptosi <2 x double> %x to <2 x i32>
835 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
836 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> zeroinitializer)
837 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
841 define <4 x i16> @stest_f32i16_mm(<4 x float> %x) {
842 ; CHECK-LABEL: stest_f32i16_mm:
843 ; CHECK: // %bb.0: // %entry
844 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
845 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
848 %conv = fptosi <4 x float> %x to <4 x i32>
849 %spec.store.select = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %conv, <4 x i32> <i32 32767, i32 32767, i32 32767, i32 32767>)
850 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768>)
851 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
855 define <4 x i16> @utest_f32i16_mm(<4 x float> %x) {
856 ; CHECK-LABEL: utest_f32i16_mm:
857 ; CHECK: // %bb.0: // %entry
858 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
859 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
862 %conv = fptoui <4 x float> %x to <4 x i32>
863 %spec.store.select = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>)
864 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
868 define <4 x i16> @ustest_f32i16_mm(<4 x float> %x) {
869 ; CHECK-LABEL: ustest_f32i16_mm:
870 ; CHECK: // %bb.0: // %entry
871 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
872 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
875 %conv = fptosi <4 x float> %x to <4 x i32>
876 %spec.store.select = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %conv, <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>)
877 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> zeroinitializer)
878 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
882 define <8 x i16> @stest_f16i16_mm(<8 x half> %x) {
883 ; CHECK-CVT-LABEL: stest_f16i16_mm:
884 ; CHECK-CVT: // %bb.0: // %entry
885 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
886 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
887 ; CHECK-CVT-NEXT: fcvtzs v1.4s, v1.4s
888 ; CHECK-CVT-NEXT: fcvtzs v2.4s, v0.4s
889 ; CHECK-CVT-NEXT: sqxtn v0.4h, v1.4s
890 ; CHECK-CVT-NEXT: sqxtn2 v0.8h, v2.4s
891 ; CHECK-CVT-NEXT: ret
893 ; CHECK-FP16-LABEL: stest_f16i16_mm:
894 ; CHECK-FP16: // %bb.0: // %entry
895 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
896 ; CHECK-FP16-NEXT: ret
898 %conv = fptosi <8 x half> %x to <8 x i32>
899 %spec.store.select = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %conv, <8 x i32> <i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767, i32 32767>)
900 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> <i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768, i32 -32768>)
901 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
905 define <8 x i16> @utesth_f16i16_mm(<8 x half> %x) {
906 ; CHECK-CVT-LABEL: utesth_f16i16_mm:
907 ; CHECK-CVT: // %bb.0: // %entry
908 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
909 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
910 ; CHECK-CVT-NEXT: fcvtzu v1.4s, v1.4s
911 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v0.4s
912 ; CHECK-CVT-NEXT: uqxtn v0.4h, v1.4s
913 ; CHECK-CVT-NEXT: uqxtn2 v0.8h, v2.4s
914 ; CHECK-CVT-NEXT: ret
916 ; CHECK-FP16-LABEL: utesth_f16i16_mm:
917 ; CHECK-FP16: // %bb.0: // %entry
918 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
919 ; CHECK-FP16-NEXT: ret
921 %conv = fptoui <8 x half> %x to <8 x i32>
922 %spec.store.select = call <8 x i32> @llvm.umin.v8i32(<8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>)
923 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
927 define <8 x i16> @ustest_f16i16_mm(<8 x half> %x) {
928 ; CHECK-CVT-LABEL: ustest_f16i16_mm:
929 ; CHECK-CVT: // %bb.0: // %entry
930 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
931 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
932 ; CHECK-CVT-NEXT: fcvtzu v1.4s, v1.4s
933 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v0.4s
934 ; CHECK-CVT-NEXT: uqxtn v0.4h, v1.4s
935 ; CHECK-CVT-NEXT: uqxtn2 v0.8h, v2.4s
936 ; CHECK-CVT-NEXT: ret
938 ; CHECK-FP16-LABEL: ustest_f16i16_mm:
939 ; CHECK-FP16: // %bb.0: // %entry
940 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
941 ; CHECK-FP16-NEXT: ret
943 %conv = fptosi <8 x half> %x to <8 x i32>
944 %spec.store.select = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %conv, <8 x i32> <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>)
945 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> zeroinitializer)
946 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
952 define <2 x i64> @stest_f64i64_mm(<2 x double> %x) {
953 ; CHECK-LABEL: stest_f64i64_mm:
954 ; CHECK: // %bb.0: // %entry
955 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
958 %conv = fptosi <2 x double> %x to <2 x i128>
959 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
960 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
961 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
965 define <2 x i64> @utest_f64i64_mm(<2 x double> %x) {
966 ; CHECK-LABEL: utest_f64i64_mm:
967 ; CHECK: // %bb.0: // %entry
968 ; CHECK-NEXT: sub sp, sp, #48
969 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
970 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
971 ; CHECK-NEXT: .cfi_def_cfa_offset 48
972 ; CHECK-NEXT: .cfi_offset w19, -8
973 ; CHECK-NEXT: .cfi_offset w20, -16
974 ; CHECK-NEXT: .cfi_offset w30, -32
975 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
976 ; CHECK-NEXT: mov d0, v0.d[1]
977 ; CHECK-NEXT: bl __fixunsdfti
978 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
979 ; CHECK-NEXT: mov x19, x0
980 ; CHECK-NEXT: mov x20, x1
981 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
982 ; CHECK-NEXT: bl __fixunsdfti
983 ; CHECK-NEXT: cmp x1, #0
984 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
985 ; CHECK-NEXT: csel x8, x0, xzr, eq
986 ; CHECK-NEXT: cmp x20, #0
987 ; CHECK-NEXT: csel x9, x19, xzr, eq
988 ; CHECK-NEXT: fmov d0, x8
989 ; CHECK-NEXT: fmov d1, x9
990 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
991 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
992 ; CHECK-NEXT: add sp, sp, #48
995 %conv = fptoui <2 x double> %x to <2 x i128>
996 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
997 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1001 define <2 x i64> @ustest_f64i64_mm(<2 x double> %x) {
1002 ; CHECK-LABEL: ustest_f64i64_mm:
1003 ; CHECK: // %bb.0: // %entry
1004 ; CHECK-NEXT: sub sp, sp, #48
1005 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1006 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1007 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1008 ; CHECK-NEXT: .cfi_offset w19, -8
1009 ; CHECK-NEXT: .cfi_offset w20, -16
1010 ; CHECK-NEXT: .cfi_offset w30, -32
1011 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1012 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1013 ; CHECK-NEXT: bl __fixdfti
1014 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1015 ; CHECK-NEXT: mov x19, x0
1016 ; CHECK-NEXT: mov x20, x1
1017 ; CHECK-NEXT: mov d0, v0.d[1]
1018 ; CHECK-NEXT: bl __fixdfti
1019 ; CHECK-NEXT: cmp x1, #1
1020 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1021 ; CHECK-NEXT: csel x8, x0, xzr, lt
1022 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1023 ; CHECK-NEXT: cmp x20, #1
1024 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1025 ; CHECK-NEXT: csel x11, x19, xzr, lt
1026 ; CHECK-NEXT: cmp x10, #0
1027 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1028 ; CHECK-NEXT: csel x10, xzr, x11, lt
1029 ; CHECK-NEXT: cmp x9, #0
1030 ; CHECK-NEXT: csel x8, xzr, x8, lt
1031 ; CHECK-NEXT: fmov d0, x10
1032 ; CHECK-NEXT: fmov d1, x8
1033 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1034 ; CHECK-NEXT: add sp, sp, #48
1037 %conv = fptosi <2 x double> %x to <2 x i128>
1038 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1039 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1040 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1041 ret <2 x i64> %conv6
1044 define <2 x i64> @stest_f32i64_mm(<2 x float> %x) {
1045 ; CHECK-LABEL: stest_f32i64_mm:
1046 ; CHECK: // %bb.0: // %entry
1047 ; CHECK-NEXT: fcvtl v0.2d, v0.2s
1048 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
1051 %conv = fptosi <2 x float> %x to <2 x i128>
1052 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1053 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1054 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1055 ret <2 x i64> %conv6
1058 define <2 x i64> @utest_f32i64_mm(<2 x float> %x) {
1059 ; CHECK-LABEL: utest_f32i64_mm:
1060 ; CHECK: // %bb.0: // %entry
1061 ; CHECK-NEXT: sub sp, sp, #48
1062 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1063 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1064 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1065 ; CHECK-NEXT: .cfi_offset w19, -8
1066 ; CHECK-NEXT: .cfi_offset w20, -16
1067 ; CHECK-NEXT: .cfi_offset w30, -32
1068 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1069 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1070 ; CHECK-NEXT: mov s0, v0.s[1]
1071 ; CHECK-NEXT: bl __fixunssfti
1072 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1073 ; CHECK-NEXT: mov x19, x0
1074 ; CHECK-NEXT: mov x20, x1
1075 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1076 ; CHECK-NEXT: bl __fixunssfti
1077 ; CHECK-NEXT: cmp x1, #0
1078 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1079 ; CHECK-NEXT: csel x8, x0, xzr, eq
1080 ; CHECK-NEXT: cmp x20, #0
1081 ; CHECK-NEXT: csel x9, x19, xzr, eq
1082 ; CHECK-NEXT: fmov d0, x8
1083 ; CHECK-NEXT: fmov d1, x9
1084 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1085 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1086 ; CHECK-NEXT: add sp, sp, #48
1089 %conv = fptoui <2 x float> %x to <2 x i128>
1090 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1091 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1092 ret <2 x i64> %conv6
1095 define <2 x i64> @ustest_f32i64_mm(<2 x float> %x) {
1096 ; CHECK-LABEL: ustest_f32i64_mm:
1097 ; CHECK: // %bb.0: // %entry
1098 ; CHECK-NEXT: sub sp, sp, #48
1099 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1100 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1101 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1102 ; CHECK-NEXT: .cfi_offset w19, -8
1103 ; CHECK-NEXT: .cfi_offset w20, -16
1104 ; CHECK-NEXT: .cfi_offset w30, -32
1105 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1106 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1107 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1108 ; CHECK-NEXT: bl __fixsfti
1109 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1110 ; CHECK-NEXT: mov x19, x0
1111 ; CHECK-NEXT: mov x20, x1
1112 ; CHECK-NEXT: mov s0, v0.s[1]
1113 ; CHECK-NEXT: bl __fixsfti
1114 ; CHECK-NEXT: cmp x1, #1
1115 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1116 ; CHECK-NEXT: csel x8, x0, xzr, lt
1117 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1118 ; CHECK-NEXT: cmp x20, #1
1119 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1120 ; CHECK-NEXT: csel x11, x19, xzr, lt
1121 ; CHECK-NEXT: cmp x10, #0
1122 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1123 ; CHECK-NEXT: csel x10, xzr, x11, lt
1124 ; CHECK-NEXT: cmp x9, #0
1125 ; CHECK-NEXT: csel x8, xzr, x8, lt
1126 ; CHECK-NEXT: fmov d0, x10
1127 ; CHECK-NEXT: fmov d1, x8
1128 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1129 ; CHECK-NEXT: add sp, sp, #48
1132 %conv = fptosi <2 x float> %x to <2 x i128>
1133 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1134 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1135 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1136 ret <2 x i64> %conv6
1139 define <2 x i64> @stest_f16i64_mm(<2 x half> %x) {
1140 ; CHECK-CVT-LABEL: stest_f16i64_mm:
1141 ; CHECK-CVT: // %bb.0: // %entry
1142 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1143 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
1144 ; CHECK-CVT-NEXT: fcvt s0, h0
1145 ; CHECK-CVT-NEXT: fcvt s1, h1
1146 ; CHECK-CVT-NEXT: fcvtzs x8, s0
1147 ; CHECK-CVT-NEXT: fcvtzs x9, s1
1148 ; CHECK-CVT-NEXT: fmov d0, x8
1149 ; CHECK-CVT-NEXT: mov v0.d[1], x9
1150 ; CHECK-CVT-NEXT: ret
1152 ; CHECK-FP16-LABEL: stest_f16i64_mm:
1153 ; CHECK-FP16: // %bb.0: // %entry
1154 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1155 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
1156 ; CHECK-FP16-NEXT: fcvtzs x8, h0
1157 ; CHECK-FP16-NEXT: fcvtzs x9, h1
1158 ; CHECK-FP16-NEXT: fmov d0, x8
1159 ; CHECK-FP16-NEXT: mov v0.d[1], x9
1160 ; CHECK-FP16-NEXT: ret
1162 %conv = fptosi <2 x half> %x to <2 x i128>
1163 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1164 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1165 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1166 ret <2 x i64> %conv6
1169 define <2 x i64> @utesth_f16i64_mm(<2 x half> %x) {
1170 ; CHECK-LABEL: utesth_f16i64_mm:
1171 ; CHECK: // %bb.0: // %entry
1172 ; CHECK-NEXT: sub sp, sp, #48
1173 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1174 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1175 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1176 ; CHECK-NEXT: .cfi_offset w19, -8
1177 ; CHECK-NEXT: .cfi_offset w20, -16
1178 ; CHECK-NEXT: .cfi_offset w30, -32
1179 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1180 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1181 ; CHECK-NEXT: mov h0, v0.h[1]
1182 ; CHECK-NEXT: bl __fixunshfti
1183 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1184 ; CHECK-NEXT: mov x19, x0
1185 ; CHECK-NEXT: mov x20, x1
1186 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1187 ; CHECK-NEXT: bl __fixunshfti
1188 ; CHECK-NEXT: cmp x1, #0
1189 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1190 ; CHECK-NEXT: csel x8, x0, xzr, eq
1191 ; CHECK-NEXT: cmp x20, #0
1192 ; CHECK-NEXT: csel x9, x19, xzr, eq
1193 ; CHECK-NEXT: fmov d0, x8
1194 ; CHECK-NEXT: fmov d1, x9
1195 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1196 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1197 ; CHECK-NEXT: add sp, sp, #48
1200 %conv = fptoui <2 x half> %x to <2 x i128>
1201 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1202 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1203 ret <2 x i64> %conv6
1206 define <2 x i64> @ustest_f16i64_mm(<2 x half> %x) {
1207 ; CHECK-LABEL: ustest_f16i64_mm:
1208 ; CHECK: // %bb.0: // %entry
1209 ; CHECK-NEXT: sub sp, sp, #48
1210 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1211 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1212 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1213 ; CHECK-NEXT: .cfi_offset w19, -8
1214 ; CHECK-NEXT: .cfi_offset w20, -16
1215 ; CHECK-NEXT: .cfi_offset w30, -32
1216 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1217 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1218 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1219 ; CHECK-NEXT: bl __fixhfti
1220 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1221 ; CHECK-NEXT: mov x19, x0
1222 ; CHECK-NEXT: mov x20, x1
1223 ; CHECK-NEXT: mov h0, v0.h[1]
1224 ; CHECK-NEXT: bl __fixhfti
1225 ; CHECK-NEXT: cmp x1, #1
1226 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1227 ; CHECK-NEXT: csel x8, x0, xzr, lt
1228 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1229 ; CHECK-NEXT: cmp x20, #1
1230 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1231 ; CHECK-NEXT: csel x11, x19, xzr, lt
1232 ; CHECK-NEXT: cmp x10, #0
1233 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1234 ; CHECK-NEXT: csel x10, xzr, x11, lt
1235 ; CHECK-NEXT: cmp x9, #0
1236 ; CHECK-NEXT: csel x8, xzr, x8, lt
1237 ; CHECK-NEXT: fmov d0, x10
1238 ; CHECK-NEXT: fmov d1, x8
1239 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1240 ; CHECK-NEXT: add sp, sp, #48
1243 %conv = fptosi <2 x half> %x to <2 x i128>
1244 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1245 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1246 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1247 ret <2 x i64> %conv6
1250 declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>)
1251 declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>)
1252 declare <2 x i32> @llvm.umin.v2i32(<2 x i32>, <2 x i32>)
1253 declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>)
1254 declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
1255 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
1256 declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>)
1257 declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>)
1258 declare <8 x i32> @llvm.umin.v8i32(<8 x i32>, <8 x i32>)
1259 declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>)
1260 declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
1261 declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>)
1262 declare <4 x i64> @llvm.smin.v4i64(<4 x i64>, <4 x i64>)
1263 declare <4 x i64> @llvm.smax.v4i64(<4 x i64>, <4 x i64>)
1264 declare <4 x i64> @llvm.umin.v4i64(<4 x i64>, <4 x i64>)
1265 declare <2 x i128> @llvm.smin.v2i128(<2 x i128>, <2 x i128>)
1266 declare <2 x i128> @llvm.smax.v2i128(<2 x i128>, <2 x i128>)
1267 declare <2 x i128> @llvm.umin.v2i128(<2 x i128>, <2 x i128>)