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: xtn v0.2s, v0.2d
198 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
199 ; CHECK-NEXT: movi v1.2d, #0000000000000000
200 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.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: fcvtl2 v2.4s, v0.8h
287 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
288 ; CHECK-CVT-NEXT: movi v1.2d, #0x00ffff0000ffff
289 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v2.4s
290 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
291 ; CHECK-CVT-NEXT: umin v2.4s, v2.4s, v1.4s
292 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
293 ; CHECK-CVT-NEXT: uzp1 v0.8h, v0.8h, v2.8h
294 ; CHECK-CVT-NEXT: ret
296 ; CHECK-FP16-LABEL: utesth_f16i16:
297 ; CHECK-FP16: // %bb.0: // %entry
298 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
299 ; CHECK-FP16-NEXT: ret
301 %conv = fptoui <8 x half> %x to <8 x i32>
302 %0 = icmp ult <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
303 %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>
304 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
308 define <8 x i16> @ustest_f16i16(<8 x half> %x) {
309 ; CHECK-CVT-LABEL: ustest_f16i16:
310 ; CHECK-CVT: // %bb.0: // %entry
311 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
312 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
313 ; CHECK-CVT-NEXT: movi v1.2d, #0x00ffff0000ffff
314 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v2.4s
315 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
316 ; CHECK-CVT-NEXT: umin v2.4s, v2.4s, v1.4s
317 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
318 ; CHECK-CVT-NEXT: uzp1 v0.8h, v0.8h, v2.8h
319 ; CHECK-CVT-NEXT: ret
321 ; CHECK-FP16-LABEL: ustest_f16i16:
322 ; CHECK-FP16: // %bb.0: // %entry
323 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
324 ; CHECK-FP16-NEXT: ret
326 %conv = fptosi <8 x half> %x to <8 x i32>
327 %0 = icmp slt <8 x i32> %conv, <i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535, i32 65535>
328 %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>
329 %1 = icmp sgt <8 x i32> %spec.store.select, zeroinitializer
330 %spec.store.select7 = select <8 x i1> %1, <8 x i32> %spec.store.select, <8 x i32> zeroinitializer
331 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
337 define <2 x i64> @stest_f64i64(<2 x double> %x) {
338 ; CHECK-LABEL: stest_f64i64:
339 ; CHECK: // %bb.0: // %entry
340 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
343 %conv = fptosi <2 x double> %x to <2 x i128>
344 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
345 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
346 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
347 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
348 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
352 define <2 x i64> @utest_f64i64(<2 x double> %x) {
353 ; CHECK-LABEL: utest_f64i64:
354 ; CHECK: // %bb.0: // %entry
355 ; CHECK-NEXT: sub sp, sp, #48
356 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
357 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
358 ; CHECK-NEXT: .cfi_def_cfa_offset 48
359 ; CHECK-NEXT: .cfi_offset w19, -8
360 ; CHECK-NEXT: .cfi_offset w20, -16
361 ; CHECK-NEXT: .cfi_offset w30, -32
362 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
363 ; CHECK-NEXT: mov d0, v0.d[1]
364 ; CHECK-NEXT: bl __fixunsdfti
365 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
366 ; CHECK-NEXT: mov x19, x0
367 ; CHECK-NEXT: mov x20, x1
368 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
369 ; CHECK-NEXT: bl __fixunsdfti
370 ; CHECK-NEXT: cmp x1, #0
371 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
372 ; CHECK-NEXT: csel x8, x0, xzr, eq
373 ; CHECK-NEXT: cmp x20, #0
374 ; CHECK-NEXT: csel x9, x19, xzr, eq
375 ; CHECK-NEXT: fmov d0, x8
376 ; CHECK-NEXT: fmov d1, x9
377 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
378 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
379 ; CHECK-NEXT: add sp, sp, #48
382 %conv = fptoui <2 x double> %x to <2 x i128>
383 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
384 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
385 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
389 define <2 x i64> @ustest_f64i64(<2 x double> %x) {
390 ; CHECK-LABEL: ustest_f64i64:
391 ; CHECK: // %bb.0: // %entry
392 ; CHECK-NEXT: sub sp, sp, #48
393 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
394 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
395 ; CHECK-NEXT: .cfi_def_cfa_offset 48
396 ; CHECK-NEXT: .cfi_offset w19, -8
397 ; CHECK-NEXT: .cfi_offset w20, -16
398 ; CHECK-NEXT: .cfi_offset w30, -32
399 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
400 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
401 ; CHECK-NEXT: bl __fixdfti
402 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
403 ; CHECK-NEXT: mov x19, x0
404 ; CHECK-NEXT: mov x20, x1
405 ; CHECK-NEXT: mov d0, v0.d[1]
406 ; CHECK-NEXT: bl __fixdfti
407 ; CHECK-NEXT: cmp x1, #1
408 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
409 ; CHECK-NEXT: csel x8, x0, xzr, lt
410 ; CHECK-NEXT: csinc x9, x1, xzr, lt
411 ; CHECK-NEXT: cmp x20, #1
412 ; CHECK-NEXT: csel x10, x19, xzr, lt
413 ; CHECK-NEXT: csinc x11, x20, xzr, lt
414 ; CHECK-NEXT: cmp xzr, x10
415 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
416 ; CHECK-NEXT: ngcs xzr, x11
417 ; CHECK-NEXT: csel x10, x10, xzr, lt
418 ; CHECK-NEXT: cmp xzr, x8
419 ; CHECK-NEXT: ngcs xzr, x9
420 ; CHECK-NEXT: fmov d0, x10
421 ; CHECK-NEXT: csel x8, x8, xzr, lt
422 ; CHECK-NEXT: fmov d1, x8
423 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
424 ; CHECK-NEXT: add sp, sp, #48
427 %conv = fptosi <2 x double> %x to <2 x i128>
428 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
429 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
430 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
431 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
432 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
436 define <2 x i64> @stest_f32i64(<2 x float> %x) {
437 ; CHECK-LABEL: stest_f32i64:
438 ; CHECK: // %bb.0: // %entry
439 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
440 ; CHECK-NEXT: mov s1, v0.s[1]
441 ; CHECK-NEXT: fcvtzs x8, s0
442 ; CHECK-NEXT: fcvtzs x9, s1
443 ; CHECK-NEXT: fmov d0, x8
444 ; CHECK-NEXT: mov v0.d[1], x9
447 %conv = fptosi <2 x float> %x to <2 x i128>
448 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
449 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
450 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
451 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
452 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
456 define <2 x i64> @utest_f32i64(<2 x float> %x) {
457 ; CHECK-LABEL: utest_f32i64:
458 ; CHECK: // %bb.0: // %entry
459 ; CHECK-NEXT: sub sp, sp, #48
460 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
461 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
462 ; CHECK-NEXT: .cfi_def_cfa_offset 48
463 ; CHECK-NEXT: .cfi_offset w19, -8
464 ; CHECK-NEXT: .cfi_offset w20, -16
465 ; CHECK-NEXT: .cfi_offset w30, -32
466 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
467 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
468 ; CHECK-NEXT: mov s0, v0.s[1]
469 ; CHECK-NEXT: bl __fixunssfti
470 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
471 ; CHECK-NEXT: mov x19, x0
472 ; CHECK-NEXT: mov x20, x1
473 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
474 ; CHECK-NEXT: bl __fixunssfti
475 ; CHECK-NEXT: cmp x1, #0
476 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
477 ; CHECK-NEXT: csel x8, x0, xzr, eq
478 ; CHECK-NEXT: cmp x20, #0
479 ; CHECK-NEXT: csel x9, x19, xzr, eq
480 ; CHECK-NEXT: fmov d0, x8
481 ; CHECK-NEXT: fmov d1, x9
482 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
483 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
484 ; CHECK-NEXT: add sp, sp, #48
487 %conv = fptoui <2 x float> %x to <2 x i128>
488 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
489 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
490 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
494 define <2 x i64> @ustest_f32i64(<2 x float> %x) {
495 ; CHECK-LABEL: ustest_f32i64:
496 ; CHECK: // %bb.0: // %entry
497 ; CHECK-NEXT: sub sp, sp, #48
498 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
499 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
500 ; CHECK-NEXT: .cfi_def_cfa_offset 48
501 ; CHECK-NEXT: .cfi_offset w19, -8
502 ; CHECK-NEXT: .cfi_offset w20, -16
503 ; CHECK-NEXT: .cfi_offset w30, -32
504 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
505 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
506 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
507 ; CHECK-NEXT: bl __fixsfti
508 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
509 ; CHECK-NEXT: mov x19, x0
510 ; CHECK-NEXT: mov x20, x1
511 ; CHECK-NEXT: mov s0, v0.s[1]
512 ; CHECK-NEXT: bl __fixsfti
513 ; CHECK-NEXT: cmp x1, #1
514 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
515 ; CHECK-NEXT: csinc x8, x1, xzr, lt
516 ; CHECK-NEXT: csel x9, x0, xzr, lt
517 ; CHECK-NEXT: cmp x20, #1
518 ; CHECK-NEXT: csel x10, x19, xzr, lt
519 ; CHECK-NEXT: csinc x11, x20, xzr, lt
520 ; CHECK-NEXT: cmp xzr, x10
521 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
522 ; CHECK-NEXT: ngcs xzr, x11
523 ; CHECK-NEXT: csel x10, x10, xzr, lt
524 ; CHECK-NEXT: cmp xzr, x9
525 ; CHECK-NEXT: ngcs xzr, x8
526 ; CHECK-NEXT: fmov d0, x10
527 ; CHECK-NEXT: csel x8, x9, xzr, lt
528 ; CHECK-NEXT: fmov d1, x8
529 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
530 ; CHECK-NEXT: add sp, sp, #48
533 %conv = fptosi <2 x float> %x to <2 x i128>
534 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
535 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
536 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
537 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
538 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
542 define <2 x i64> @stest_f16i64(<2 x half> %x) {
543 ; CHECK-CVT-LABEL: stest_f16i64:
544 ; CHECK-CVT: // %bb.0: // %entry
545 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
546 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
547 ; CHECK-CVT-NEXT: fcvt s0, h0
548 ; CHECK-CVT-NEXT: fcvt s1, h1
549 ; CHECK-CVT-NEXT: fcvtzs x8, s0
550 ; CHECK-CVT-NEXT: fcvtzs x9, s1
551 ; CHECK-CVT-NEXT: fmov d0, x8
552 ; CHECK-CVT-NEXT: mov v0.d[1], x9
553 ; CHECK-CVT-NEXT: ret
555 ; CHECK-FP16-LABEL: stest_f16i64:
556 ; CHECK-FP16: // %bb.0: // %entry
557 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
558 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
559 ; CHECK-FP16-NEXT: fcvtzs x8, h0
560 ; CHECK-FP16-NEXT: fcvtzs x9, h1
561 ; CHECK-FP16-NEXT: fmov d0, x8
562 ; CHECK-FP16-NEXT: mov v0.d[1], x9
563 ; CHECK-FP16-NEXT: ret
565 %conv = fptosi <2 x half> %x to <2 x i128>
566 %0 = icmp slt <2 x i128> %conv, <i128 9223372036854775807, i128 9223372036854775807>
567 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>
568 %1 = icmp sgt <2 x i128> %spec.store.select, <i128 -9223372036854775808, i128 -9223372036854775808>
569 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>
570 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
574 define <2 x i64> @utesth_f16i64(<2 x half> %x) {
575 ; CHECK-LABEL: utesth_f16i64:
576 ; CHECK: // %bb.0: // %entry
577 ; CHECK-NEXT: sub sp, sp, #48
578 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
579 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
580 ; CHECK-NEXT: .cfi_def_cfa_offset 48
581 ; CHECK-NEXT: .cfi_offset w19, -8
582 ; CHECK-NEXT: .cfi_offset w20, -16
583 ; CHECK-NEXT: .cfi_offset w30, -32
584 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
585 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
586 ; CHECK-NEXT: mov h0, v0.h[1]
587 ; CHECK-NEXT: bl __fixunshfti
588 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
589 ; CHECK-NEXT: mov x19, x0
590 ; CHECK-NEXT: mov x20, x1
591 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
592 ; CHECK-NEXT: bl __fixunshfti
593 ; CHECK-NEXT: cmp x1, #0
594 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
595 ; CHECK-NEXT: csel x8, x0, xzr, eq
596 ; CHECK-NEXT: cmp x20, #0
597 ; CHECK-NEXT: csel x9, x19, xzr, eq
598 ; CHECK-NEXT: fmov d0, x8
599 ; CHECK-NEXT: fmov d1, x9
600 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
601 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
602 ; CHECK-NEXT: add sp, sp, #48
605 %conv = fptoui <2 x half> %x to <2 x i128>
606 %0 = icmp ult <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
607 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
608 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
612 define <2 x i64> @ustest_f16i64(<2 x half> %x) {
613 ; CHECK-LABEL: ustest_f16i64:
614 ; CHECK: // %bb.0: // %entry
615 ; CHECK-NEXT: sub sp, sp, #48
616 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
617 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
618 ; CHECK-NEXT: .cfi_def_cfa_offset 48
619 ; CHECK-NEXT: .cfi_offset w19, -8
620 ; CHECK-NEXT: .cfi_offset w20, -16
621 ; CHECK-NEXT: .cfi_offset w30, -32
622 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
623 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
624 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
625 ; CHECK-NEXT: bl __fixhfti
626 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
627 ; CHECK-NEXT: mov x19, x0
628 ; CHECK-NEXT: mov x20, x1
629 ; CHECK-NEXT: mov h0, v0.h[1]
630 ; CHECK-NEXT: bl __fixhfti
631 ; CHECK-NEXT: cmp x1, #1
632 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
633 ; CHECK-NEXT: csinc x8, x1, xzr, lt
634 ; CHECK-NEXT: csel x9, x0, xzr, lt
635 ; CHECK-NEXT: cmp x20, #1
636 ; CHECK-NEXT: csel x10, x19, xzr, lt
637 ; CHECK-NEXT: csinc x11, x20, xzr, lt
638 ; CHECK-NEXT: cmp xzr, x10
639 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
640 ; CHECK-NEXT: ngcs xzr, x11
641 ; CHECK-NEXT: csel x10, x10, xzr, lt
642 ; CHECK-NEXT: cmp xzr, x9
643 ; CHECK-NEXT: ngcs xzr, x8
644 ; CHECK-NEXT: fmov d0, x10
645 ; CHECK-NEXT: csel x8, x9, xzr, lt
646 ; CHECK-NEXT: fmov d1, x8
647 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
648 ; CHECK-NEXT: add sp, sp, #48
651 %conv = fptosi <2 x half> %x to <2 x i128>
652 %0 = icmp slt <2 x i128> %conv, <i128 18446744073709551616, i128 18446744073709551616>
653 %spec.store.select = select <2 x i1> %0, <2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>
654 %1 = icmp sgt <2 x i128> %spec.store.select, zeroinitializer
655 %spec.store.select7 = select <2 x i1> %1, <2 x i128> %spec.store.select, <2 x i128> zeroinitializer
656 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
664 define <2 x i32> @stest_f64i32_mm(<2 x double> %x) {
665 ; CHECK-LABEL: stest_f64i32_mm:
666 ; CHECK: // %bb.0: // %entry
667 ; CHECK-NEXT: mov d1, v0.d[1]
668 ; CHECK-NEXT: fcvtzs w8, d0
669 ; CHECK-NEXT: fcvtzs w9, d1
670 ; CHECK-NEXT: fmov s0, w8
671 ; CHECK-NEXT: mov v0.s[1], w9
672 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
675 %conv = fptosi <2 x double> %x to <2 x i64>
676 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 2147483647, i64 2147483647>)
677 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> <i64 -2147483648, i64 -2147483648>)
678 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
682 define <2 x i32> @utest_f64i32_mm(<2 x double> %x) {
683 ; CHECK-LABEL: utest_f64i32_mm:
684 ; CHECK: // %bb.0: // %entry
685 ; CHECK-NEXT: mov d1, v0.d[1]
686 ; CHECK-NEXT: fcvtzu w8, d0
687 ; CHECK-NEXT: fcvtzu w9, d1
688 ; CHECK-NEXT: fmov s0, w8
689 ; CHECK-NEXT: mov v0.s[1], w9
690 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
693 %conv = fptoui <2 x double> %x to <2 x i64>
694 %spec.store.select = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
695 %conv6 = trunc <2 x i64> %spec.store.select to <2 x i32>
699 define <2 x i32> @ustest_f64i32_mm(<2 x double> %x) {
700 ; CHECK-LABEL: ustest_f64i32_mm:
701 ; CHECK: // %bb.0: // %entry
702 ; CHECK-NEXT: mov d1, v0.d[1]
703 ; CHECK-NEXT: fcvtzu w8, d0
704 ; CHECK-NEXT: fcvtzu w9, d1
705 ; CHECK-NEXT: fmov s0, w8
706 ; CHECK-NEXT: mov v0.s[1], w9
707 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
710 %conv = fptosi <2 x double> %x to <2 x i64>
711 %spec.store.select = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %conv, <2 x i64> <i64 4294967295, i64 4294967295>)
712 %spec.store.select7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %spec.store.select, <2 x i64> zeroinitializer)
713 %conv6 = trunc <2 x i64> %spec.store.select7 to <2 x i32>
717 define <4 x i32> @stest_f32i32_mm(<4 x float> %x) {
718 ; CHECK-LABEL: stest_f32i32_mm:
719 ; CHECK: // %bb.0: // %entry
720 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
723 %conv = fptosi <4 x float> %x to <4 x i64>
724 %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>)
725 %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>)
726 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
730 define <4 x i32> @utest_f32i32_mm(<4 x float> %x) {
731 ; CHECK-LABEL: utest_f32i32_mm:
732 ; CHECK: // %bb.0: // %entry
733 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
736 %conv = fptoui <4 x float> %x to <4 x i64>
737 %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>)
738 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
742 define <4 x i32> @ustest_f32i32_mm(<4 x float> %x) {
743 ; CHECK-LABEL: ustest_f32i32_mm:
744 ; CHECK: // %bb.0: // %entry
745 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
748 %conv = fptosi <4 x float> %x to <4 x i64>
749 %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>)
750 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
751 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
755 define <4 x i32> @stest_f16i32_mm(<4 x half> %x) {
756 ; CHECK-LABEL: stest_f16i32_mm:
757 ; CHECK: // %bb.0: // %entry
758 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
759 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
762 %conv = fptosi <4 x half> %x to <4 x i64>
763 %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>)
764 %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>)
765 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
769 define <4 x i32> @utesth_f16i32_mm(<4 x half> %x) {
770 ; CHECK-LABEL: utesth_f16i32_mm:
771 ; CHECK: // %bb.0: // %entry
772 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
773 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
776 %conv = fptoui <4 x half> %x to <4 x i64>
777 %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>)
778 %conv6 = trunc <4 x i64> %spec.store.select to <4 x i32>
782 define <4 x i32> @ustest_f16i32_mm(<4 x half> %x) {
783 ; CHECK-LABEL: ustest_f16i32_mm:
784 ; CHECK: // %bb.0: // %entry
785 ; CHECK-NEXT: fcvtl v0.4s, v0.4h
786 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
789 %conv = fptosi <4 x half> %x to <4 x i64>
790 %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>)
791 %spec.store.select7 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> %spec.store.select, <4 x i64> zeroinitializer)
792 %conv6 = trunc <4 x i64> %spec.store.select7 to <4 x i32>
798 define <2 x i16> @stest_f64i16_mm(<2 x double> %x) {
799 ; CHECK-LABEL: stest_f64i16_mm:
800 ; CHECK: // %bb.0: // %entry
801 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
802 ; CHECK-NEXT: movi v1.2s, #127, msl #8
803 ; CHECK-NEXT: xtn v0.2s, v0.2d
804 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
805 ; CHECK-NEXT: mvni v1.2s, #127, msl #8
806 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
809 %conv = fptosi <2 x double> %x to <2 x i32>
810 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 32767, i32 32767>)
811 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> <i32 -32768, i32 -32768>)
812 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
816 define <2 x i16> @utest_f64i16_mm(<2 x double> %x) {
817 ; CHECK-LABEL: utest_f64i16_mm:
818 ; CHECK: // %bb.0: // %entry
819 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
820 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
821 ; CHECK-NEXT: xtn v0.2s, v0.2d
822 ; CHECK-NEXT: umin v0.2s, v0.2s, v1.2s
825 %conv = fptoui <2 x double> %x to <2 x i32>
826 %spec.store.select = call <2 x i32> @llvm.umin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
827 %conv6 = trunc <2 x i32> %spec.store.select to <2 x i16>
831 define <2 x i16> @ustest_f64i16_mm(<2 x double> %x) {
832 ; CHECK-LABEL: ustest_f64i16_mm:
833 ; CHECK: // %bb.0: // %entry
834 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
835 ; CHECK-NEXT: movi d1, #0x00ffff0000ffff
836 ; CHECK-NEXT: xtn v0.2s, v0.2d
837 ; CHECK-NEXT: smin v0.2s, v0.2s, v1.2s
838 ; CHECK-NEXT: movi v1.2d, #0000000000000000
839 ; CHECK-NEXT: smax v0.2s, v0.2s, v1.2s
842 %conv = fptosi <2 x double> %x to <2 x i32>
843 %spec.store.select = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %conv, <2 x i32> <i32 65535, i32 65535>)
844 %spec.store.select7 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %spec.store.select, <2 x i32> zeroinitializer)
845 %conv6 = trunc <2 x i32> %spec.store.select7 to <2 x i16>
849 define <4 x i16> @stest_f32i16_mm(<4 x float> %x) {
850 ; CHECK-LABEL: stest_f32i16_mm:
851 ; CHECK: // %bb.0: // %entry
852 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
853 ; CHECK-NEXT: sqxtn v0.4h, v0.4s
856 %conv = fptosi <4 x float> %x to <4 x i32>
857 %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>)
858 %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>)
859 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
863 define <4 x i16> @utest_f32i16_mm(<4 x float> %x) {
864 ; CHECK-LABEL: utest_f32i16_mm:
865 ; CHECK: // %bb.0: // %entry
866 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
867 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
870 %conv = fptoui <4 x float> %x to <4 x i32>
871 %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>)
872 %conv6 = trunc <4 x i32> %spec.store.select to <4 x i16>
876 define <4 x i16> @ustest_f32i16_mm(<4 x float> %x) {
877 ; CHECK-LABEL: ustest_f32i16_mm:
878 ; CHECK: // %bb.0: // %entry
879 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
880 ; CHECK-NEXT: uqxtn v0.4h, v0.4s
883 %conv = fptosi <4 x float> %x to <4 x i32>
884 %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>)
885 %spec.store.select7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %spec.store.select, <4 x i32> zeroinitializer)
886 %conv6 = trunc <4 x i32> %spec.store.select7 to <4 x i16>
890 define <8 x i16> @stest_f16i16_mm(<8 x half> %x) {
891 ; CHECK-CVT-LABEL: stest_f16i16_mm:
892 ; CHECK-CVT: // %bb.0: // %entry
893 ; CHECK-CVT-NEXT: fcvtl v1.4s, v0.4h
894 ; CHECK-CVT-NEXT: fcvtl2 v0.4s, v0.8h
895 ; CHECK-CVT-NEXT: fcvtzs v1.4s, v1.4s
896 ; CHECK-CVT-NEXT: fcvtzs v2.4s, v0.4s
897 ; CHECK-CVT-NEXT: sqxtn v0.4h, v1.4s
898 ; CHECK-CVT-NEXT: sqxtn2 v0.8h, v2.4s
899 ; CHECK-CVT-NEXT: ret
901 ; CHECK-FP16-LABEL: stest_f16i16_mm:
902 ; CHECK-FP16: // %bb.0: // %entry
903 ; CHECK-FP16-NEXT: fcvtzs v0.8h, v0.8h
904 ; CHECK-FP16-NEXT: ret
906 %conv = fptosi <8 x half> %x to <8 x i32>
907 %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>)
908 %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>)
909 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
913 define <8 x i16> @utesth_f16i16_mm(<8 x half> %x) {
914 ; CHECK-CVT-LABEL: utesth_f16i16_mm:
915 ; CHECK-CVT: // %bb.0: // %entry
916 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
917 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
918 ; CHECK-CVT-NEXT: movi v1.2d, #0x00ffff0000ffff
919 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v2.4s
920 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
921 ; CHECK-CVT-NEXT: umin v2.4s, v2.4s, v1.4s
922 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
923 ; CHECK-CVT-NEXT: uzp1 v0.8h, v0.8h, v2.8h
924 ; CHECK-CVT-NEXT: ret
926 ; CHECK-FP16-LABEL: utesth_f16i16_mm:
927 ; CHECK-FP16: // %bb.0: // %entry
928 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
929 ; CHECK-FP16-NEXT: ret
931 %conv = fptoui <8 x half> %x to <8 x i32>
932 %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>)
933 %conv6 = trunc <8 x i32> %spec.store.select to <8 x i16>
937 define <8 x i16> @ustest_f16i16_mm(<8 x half> %x) {
938 ; CHECK-CVT-LABEL: ustest_f16i16_mm:
939 ; CHECK-CVT: // %bb.0: // %entry
940 ; CHECK-CVT-NEXT: fcvtl2 v2.4s, v0.8h
941 ; CHECK-CVT-NEXT: fcvtl v0.4s, v0.4h
942 ; CHECK-CVT-NEXT: movi v1.2d, #0x00ffff0000ffff
943 ; CHECK-CVT-NEXT: fcvtzu v2.4s, v2.4s
944 ; CHECK-CVT-NEXT: fcvtzu v0.4s, v0.4s
945 ; CHECK-CVT-NEXT: umin v2.4s, v2.4s, v1.4s
946 ; CHECK-CVT-NEXT: umin v0.4s, v0.4s, v1.4s
947 ; CHECK-CVT-NEXT: uzp1 v0.8h, v0.8h, v2.8h
948 ; CHECK-CVT-NEXT: ret
950 ; CHECK-FP16-LABEL: ustest_f16i16_mm:
951 ; CHECK-FP16: // %bb.0: // %entry
952 ; CHECK-FP16-NEXT: fcvtzu v0.8h, v0.8h
953 ; CHECK-FP16-NEXT: ret
955 %conv = fptosi <8 x half> %x to <8 x i32>
956 %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>)
957 %spec.store.select7 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %spec.store.select, <8 x i32> zeroinitializer)
958 %conv6 = trunc <8 x i32> %spec.store.select7 to <8 x i16>
964 define <2 x i64> @stest_f64i64_mm(<2 x double> %x) {
965 ; CHECK-LABEL: stest_f64i64_mm:
966 ; CHECK: // %bb.0: // %entry
967 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
970 %conv = fptosi <2 x double> %x to <2 x i128>
971 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
972 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
973 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
977 define <2 x i64> @utest_f64i64_mm(<2 x double> %x) {
978 ; CHECK-LABEL: utest_f64i64_mm:
979 ; CHECK: // %bb.0: // %entry
980 ; CHECK-NEXT: sub sp, sp, #48
981 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
982 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
983 ; CHECK-NEXT: .cfi_def_cfa_offset 48
984 ; CHECK-NEXT: .cfi_offset w19, -8
985 ; CHECK-NEXT: .cfi_offset w20, -16
986 ; CHECK-NEXT: .cfi_offset w30, -32
987 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
988 ; CHECK-NEXT: mov d0, v0.d[1]
989 ; CHECK-NEXT: bl __fixunsdfti
990 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
991 ; CHECK-NEXT: mov x19, x0
992 ; CHECK-NEXT: mov x20, x1
993 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
994 ; CHECK-NEXT: bl __fixunsdfti
995 ; CHECK-NEXT: cmp x1, #0
996 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
997 ; CHECK-NEXT: csel x8, x0, xzr, eq
998 ; CHECK-NEXT: cmp x20, #0
999 ; CHECK-NEXT: csel x9, x19, xzr, eq
1000 ; CHECK-NEXT: fmov d0, x8
1001 ; CHECK-NEXT: fmov d1, x9
1002 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1003 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1004 ; CHECK-NEXT: add sp, sp, #48
1007 %conv = fptoui <2 x double> %x to <2 x i128>
1008 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1009 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1010 ret <2 x i64> %conv6
1013 define <2 x i64> @ustest_f64i64_mm(<2 x double> %x) {
1014 ; CHECK-LABEL: ustest_f64i64_mm:
1015 ; CHECK: // %bb.0: // %entry
1016 ; CHECK-NEXT: sub sp, sp, #48
1017 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1018 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1019 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1020 ; CHECK-NEXT: .cfi_offset w19, -8
1021 ; CHECK-NEXT: .cfi_offset w20, -16
1022 ; CHECK-NEXT: .cfi_offset w30, -32
1023 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1024 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1025 ; CHECK-NEXT: bl __fixdfti
1026 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1027 ; CHECK-NEXT: mov x19, x0
1028 ; CHECK-NEXT: mov x20, x1
1029 ; CHECK-NEXT: mov d0, v0.d[1]
1030 ; CHECK-NEXT: bl __fixdfti
1031 ; CHECK-NEXT: cmp x1, #1
1032 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1033 ; CHECK-NEXT: csel x8, x0, xzr, lt
1034 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1035 ; CHECK-NEXT: cmp x20, #1
1036 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1037 ; CHECK-NEXT: csel x11, x19, xzr, lt
1038 ; CHECK-NEXT: cmp x10, #0
1039 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1040 ; CHECK-NEXT: csel x10, xzr, x11, lt
1041 ; CHECK-NEXT: cmp x9, #0
1042 ; CHECK-NEXT: csel x8, xzr, x8, lt
1043 ; CHECK-NEXT: fmov d0, x10
1044 ; CHECK-NEXT: fmov d1, x8
1045 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1046 ; CHECK-NEXT: add sp, sp, #48
1049 %conv = fptosi <2 x double> %x to <2 x i128>
1050 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1051 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1052 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1053 ret <2 x i64> %conv6
1056 define <2 x i64> @stest_f32i64_mm(<2 x float> %x) {
1057 ; CHECK-LABEL: stest_f32i64_mm:
1058 ; CHECK: // %bb.0: // %entry
1059 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1060 ; CHECK-NEXT: mov s1, v0.s[1]
1061 ; CHECK-NEXT: fcvtzs x8, s0
1062 ; CHECK-NEXT: fcvtzs x9, s1
1063 ; CHECK-NEXT: fmov d0, x8
1064 ; CHECK-NEXT: mov v0.d[1], x9
1067 %conv = fptosi <2 x float> %x to <2 x i128>
1068 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1069 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1070 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1071 ret <2 x i64> %conv6
1074 define <2 x i64> @utest_f32i64_mm(<2 x float> %x) {
1075 ; CHECK-LABEL: utest_f32i64_mm:
1076 ; CHECK: // %bb.0: // %entry
1077 ; CHECK-NEXT: sub sp, sp, #48
1078 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1079 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1080 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1081 ; CHECK-NEXT: .cfi_offset w19, -8
1082 ; CHECK-NEXT: .cfi_offset w20, -16
1083 ; CHECK-NEXT: .cfi_offset w30, -32
1084 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1085 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1086 ; CHECK-NEXT: mov s0, v0.s[1]
1087 ; CHECK-NEXT: bl __fixunssfti
1088 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1089 ; CHECK-NEXT: mov x19, x0
1090 ; CHECK-NEXT: mov x20, x1
1091 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1092 ; CHECK-NEXT: bl __fixunssfti
1093 ; CHECK-NEXT: cmp x1, #0
1094 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1095 ; CHECK-NEXT: csel x8, x0, xzr, eq
1096 ; CHECK-NEXT: cmp x20, #0
1097 ; CHECK-NEXT: csel x9, x19, xzr, eq
1098 ; CHECK-NEXT: fmov d0, x8
1099 ; CHECK-NEXT: fmov d1, x9
1100 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1101 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1102 ; CHECK-NEXT: add sp, sp, #48
1105 %conv = fptoui <2 x float> %x to <2 x i128>
1106 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1107 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1108 ret <2 x i64> %conv6
1111 define <2 x i64> @ustest_f32i64_mm(<2 x float> %x) {
1112 ; CHECK-LABEL: ustest_f32i64_mm:
1113 ; CHECK: // %bb.0: // %entry
1114 ; CHECK-NEXT: sub sp, sp, #48
1115 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1116 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1117 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1118 ; CHECK-NEXT: .cfi_offset w19, -8
1119 ; CHECK-NEXT: .cfi_offset w20, -16
1120 ; CHECK-NEXT: .cfi_offset w30, -32
1121 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1122 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1123 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1124 ; CHECK-NEXT: bl __fixsfti
1125 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1126 ; CHECK-NEXT: mov x19, x0
1127 ; CHECK-NEXT: mov x20, x1
1128 ; CHECK-NEXT: mov s0, v0.s[1]
1129 ; CHECK-NEXT: bl __fixsfti
1130 ; CHECK-NEXT: cmp x1, #1
1131 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1132 ; CHECK-NEXT: csel x8, x0, xzr, lt
1133 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1134 ; CHECK-NEXT: cmp x20, #1
1135 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1136 ; CHECK-NEXT: csel x11, x19, xzr, lt
1137 ; CHECK-NEXT: cmp x10, #0
1138 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1139 ; CHECK-NEXT: csel x10, xzr, x11, lt
1140 ; CHECK-NEXT: cmp x9, #0
1141 ; CHECK-NEXT: csel x8, xzr, x8, lt
1142 ; CHECK-NEXT: fmov d0, x10
1143 ; CHECK-NEXT: fmov d1, x8
1144 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1145 ; CHECK-NEXT: add sp, sp, #48
1148 %conv = fptosi <2 x float> %x to <2 x i128>
1149 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1150 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1151 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1152 ret <2 x i64> %conv6
1155 define <2 x i64> @stest_f16i64_mm(<2 x half> %x) {
1156 ; CHECK-CVT-LABEL: stest_f16i64_mm:
1157 ; CHECK-CVT: // %bb.0: // %entry
1158 ; CHECK-CVT-NEXT: // kill: def $d0 killed $d0 def $q0
1159 ; CHECK-CVT-NEXT: mov h1, v0.h[1]
1160 ; CHECK-CVT-NEXT: fcvt s0, h0
1161 ; CHECK-CVT-NEXT: fcvt s1, h1
1162 ; CHECK-CVT-NEXT: fcvtzs x8, s0
1163 ; CHECK-CVT-NEXT: fcvtzs x9, s1
1164 ; CHECK-CVT-NEXT: fmov d0, x8
1165 ; CHECK-CVT-NEXT: mov v0.d[1], x9
1166 ; CHECK-CVT-NEXT: ret
1168 ; CHECK-FP16-LABEL: stest_f16i64_mm:
1169 ; CHECK-FP16: // %bb.0: // %entry
1170 ; CHECK-FP16-NEXT: // kill: def $d0 killed $d0 def $q0
1171 ; CHECK-FP16-NEXT: mov h1, v0.h[1]
1172 ; CHECK-FP16-NEXT: fcvtzs x8, h0
1173 ; CHECK-FP16-NEXT: fcvtzs x9, h1
1174 ; CHECK-FP16-NEXT: fmov d0, x8
1175 ; CHECK-FP16-NEXT: mov v0.d[1], x9
1176 ; CHECK-FP16-NEXT: ret
1178 %conv = fptosi <2 x half> %x to <2 x i128>
1179 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 9223372036854775807, i128 9223372036854775807>)
1180 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> <i128 -9223372036854775808, i128 -9223372036854775808>)
1181 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1182 ret <2 x i64> %conv6
1185 define <2 x i64> @utesth_f16i64_mm(<2 x half> %x) {
1186 ; CHECK-LABEL: utesth_f16i64_mm:
1187 ; CHECK: // %bb.0: // %entry
1188 ; CHECK-NEXT: sub sp, sp, #48
1189 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1190 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1191 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1192 ; CHECK-NEXT: .cfi_offset w19, -8
1193 ; CHECK-NEXT: .cfi_offset w20, -16
1194 ; CHECK-NEXT: .cfi_offset w30, -32
1195 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1196 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1197 ; CHECK-NEXT: mov h0, v0.h[1]
1198 ; CHECK-NEXT: bl __fixunshfti
1199 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1200 ; CHECK-NEXT: mov x19, x0
1201 ; CHECK-NEXT: mov x20, x1
1202 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1203 ; CHECK-NEXT: bl __fixunshfti
1204 ; CHECK-NEXT: cmp x1, #0
1205 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1206 ; CHECK-NEXT: csel x8, x0, xzr, eq
1207 ; CHECK-NEXT: cmp x20, #0
1208 ; CHECK-NEXT: csel x9, x19, xzr, eq
1209 ; CHECK-NEXT: fmov d0, x8
1210 ; CHECK-NEXT: fmov d1, x9
1211 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1212 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1213 ; CHECK-NEXT: add sp, sp, #48
1216 %conv = fptoui <2 x half> %x to <2 x i128>
1217 %spec.store.select = call <2 x i128> @llvm.umin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1218 %conv6 = trunc <2 x i128> %spec.store.select to <2 x i64>
1219 ret <2 x i64> %conv6
1222 define <2 x i64> @ustest_f16i64_mm(<2 x half> %x) {
1223 ; CHECK-LABEL: ustest_f16i64_mm:
1224 ; CHECK: // %bb.0: // %entry
1225 ; CHECK-NEXT: sub sp, sp, #48
1226 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
1227 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
1228 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1229 ; CHECK-NEXT: .cfi_offset w19, -8
1230 ; CHECK-NEXT: .cfi_offset w20, -16
1231 ; CHECK-NEXT: .cfi_offset w30, -32
1232 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1233 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
1234 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1235 ; CHECK-NEXT: bl __fixhfti
1236 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1237 ; CHECK-NEXT: mov x19, x0
1238 ; CHECK-NEXT: mov x20, x1
1239 ; CHECK-NEXT: mov h0, v0.h[1]
1240 ; CHECK-NEXT: bl __fixhfti
1241 ; CHECK-NEXT: cmp x1, #1
1242 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
1243 ; CHECK-NEXT: csel x8, x0, xzr, lt
1244 ; CHECK-NEXT: csinc x9, x1, xzr, lt
1245 ; CHECK-NEXT: cmp x20, #1
1246 ; CHECK-NEXT: csinc x10, x20, xzr, lt
1247 ; CHECK-NEXT: csel x11, x19, xzr, lt
1248 ; CHECK-NEXT: cmp x10, #0
1249 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
1250 ; CHECK-NEXT: csel x10, xzr, x11, lt
1251 ; CHECK-NEXT: cmp x9, #0
1252 ; CHECK-NEXT: csel x8, xzr, x8, lt
1253 ; CHECK-NEXT: fmov d0, x10
1254 ; CHECK-NEXT: fmov d1, x8
1255 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
1256 ; CHECK-NEXT: add sp, sp, #48
1259 %conv = fptosi <2 x half> %x to <2 x i128>
1260 %spec.store.select = call <2 x i128> @llvm.smin.v2i128(<2 x i128> %conv, <2 x i128> <i128 18446744073709551616, i128 18446744073709551616>)
1261 %spec.store.select7 = call <2 x i128> @llvm.smax.v2i128(<2 x i128> %spec.store.select, <2 x i128> zeroinitializer)
1262 %conv6 = trunc <2 x i128> %spec.store.select7 to <2 x i64>
1263 ret <2 x i64> %conv6
1266 declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>)
1267 declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>)
1268 declare <2 x i32> @llvm.umin.v2i32(<2 x i32>, <2 x i32>)
1269 declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>)
1270 declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
1271 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
1272 declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>)
1273 declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>)
1274 declare <8 x i32> @llvm.umin.v8i32(<8 x i32>, <8 x i32>)
1275 declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>)
1276 declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
1277 declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>)
1278 declare <4 x i64> @llvm.smin.v4i64(<4 x i64>, <4 x i64>)
1279 declare <4 x i64> @llvm.smax.v4i64(<4 x i64>, <4 x i64>)
1280 declare <4 x i64> @llvm.umin.v4i64(<4 x i64>, <4 x i64>)
1281 declare <2 x i128> @llvm.smin.v2i128(<2 x i128>, <2 x i128>)
1282 declare <2 x i128> @llvm.smax.v2i128(<2 x i128>, <2 x i128>)
1283 declare <2 x i128> @llvm.umin.v2i128(<2 x i128>, <2 x i128>)