1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve,+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-MVE
3 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-MVEFP
5 define arm_aapcs_vfpcc <4 x i32> @sext_v4i1_v4i32(<4 x i32> %src) {
6 ; CHECK-LABEL: sext_v4i1_v4i32:
7 ; CHECK: @ %bb.0: @ %entry
8 ; CHECK-NEXT: vmov.i32 q1, #0x0
9 ; CHECK-NEXT: vmov.i8 q2, #0xff
10 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
11 ; CHECK-NEXT: vpsel q0, q2, q1
14 %c = icmp sgt <4 x i32> %src, zeroinitializer
15 %0 = sext <4 x i1> %c to <4 x i32>
19 define arm_aapcs_vfpcc <4 x i32> @sext_v4i1_v4f32(<4 x float> %src1, <4 x float> %src2) {
20 ; CHECK-MVE-LABEL: sext_v4i1_v4f32:
21 ; CHECK-MVE: @ %bb.0: @ %entry
22 ; CHECK-MVE-NEXT: vcmp.f32 s2, s6
23 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
24 ; CHECK-MVE-NEXT: vcmp.f32 s0, s4
25 ; CHECK-MVE-NEXT: csetm r0, ne
26 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
27 ; CHECK-MVE-NEXT: vcmp.f32 s3, s7
28 ; CHECK-MVE-NEXT: csetm r1, ne
29 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
30 ; CHECK-MVE-NEXT: vcmp.f32 s1, s5
31 ; CHECK-MVE-NEXT: vmov q0[2], q0[0], r1, r0
32 ; CHECK-MVE-NEXT: csetm r2, ne
33 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
34 ; CHECK-MVE-NEXT: csetm r3, ne
35 ; CHECK-MVE-NEXT: vmov q0[3], q0[1], r3, r2
36 ; CHECK-MVE-NEXT: bx lr
38 ; CHECK-MVEFP-LABEL: sext_v4i1_v4f32:
39 ; CHECK-MVEFP: @ %bb.0: @ %entry
40 ; CHECK-MVEFP-NEXT: vmov.i32 q2, #0x0
41 ; CHECK-MVEFP-NEXT: vmov.i8 q3, #0xff
42 ; CHECK-MVEFP-NEXT: vcmp.f32 ne, q0, q1
43 ; CHECK-MVEFP-NEXT: vpsel q0, q3, q2
44 ; CHECK-MVEFP-NEXT: bx lr
46 %c = fcmp une <4 x float> %src1, %src2
47 %0 = sext <4 x i1> %c to <4 x i32>
51 define arm_aapcs_vfpcc <8 x i16> @sext_v8i1_v8i16(<8 x i16> %src) {
52 ; CHECK-LABEL: sext_v8i1_v8i16:
53 ; CHECK: @ %bb.0: @ %entry
54 ; CHECK-NEXT: vmov.i16 q1, #0x0
55 ; CHECK-NEXT: vmov.i8 q2, #0xff
56 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
57 ; CHECK-NEXT: vpsel q0, q2, q1
60 %c = icmp sgt <8 x i16> %src, zeroinitializer
61 %0 = sext <8 x i1> %c to <8 x i16>
65 define arm_aapcs_vfpcc <8 x i16> @sext_v8i1_v8f32(<8 x half> %src1, <8 x half> %src2) {
66 ; CHECK-MVE-LABEL: sext_v8i1_v8f32:
67 ; CHECK-MVE: @ %bb.0: @ %entry
68 ; CHECK-MVE-NEXT: .save {r4, r5, r7, lr}
69 ; CHECK-MVE-NEXT: push {r4, r5, r7, lr}
70 ; CHECK-MVE-NEXT: vcmp.f16 s3, s7
71 ; CHECK-MVE-NEXT: vmovx.f16 s8, s7
72 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
73 ; CHECK-MVE-NEXT: vmovx.f16 s10, s3
74 ; CHECK-MVE-NEXT: vcmp.f16 s10, s8
75 ; CHECK-MVE-NEXT: csetm r12, ne
76 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
77 ; CHECK-MVE-NEXT: vcmp.f16 s2, s6
78 ; CHECK-MVE-NEXT: vmovx.f16 s6, s6
79 ; CHECK-MVE-NEXT: vmovx.f16 s2, s2
80 ; CHECK-MVE-NEXT: csetm lr, ne
81 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
82 ; CHECK-MVE-NEXT: vcmp.f16 s2, s6
83 ; CHECK-MVE-NEXT: vmovx.f16 s2, s5
84 ; CHECK-MVE-NEXT: vmovx.f16 s6, s1
85 ; CHECK-MVE-NEXT: csetm r2, ne
86 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
87 ; CHECK-MVE-NEXT: vcmp.f16 s1, s5
88 ; CHECK-MVE-NEXT: csetm r3, ne
89 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
90 ; CHECK-MVE-NEXT: vcmp.f16 s6, s2
91 ; CHECK-MVE-NEXT: vmovx.f16 s2, s4
92 ; CHECK-MVE-NEXT: csetm r0, ne
93 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
94 ; CHECK-MVE-NEXT: vcmp.f16 s0, s4
95 ; CHECK-MVE-NEXT: vmovx.f16 s0, s0
96 ; CHECK-MVE-NEXT: csetm r1, ne
97 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
98 ; CHECK-MVE-NEXT: vcmp.f16 s0, s2
99 ; CHECK-MVE-NEXT: csetm r4, ne
100 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
101 ; CHECK-MVE-NEXT: vmov.16 q0[0], r4
102 ; CHECK-MVE-NEXT: csetm r5, ne
103 ; CHECK-MVE-NEXT: vmov.16 q0[1], r5
104 ; CHECK-MVE-NEXT: vmov.16 q0[2], r0
105 ; CHECK-MVE-NEXT: vmov.16 q0[3], r1
106 ; CHECK-MVE-NEXT: vmov.16 q0[4], r2
107 ; CHECK-MVE-NEXT: vmov.16 q0[5], r3
108 ; CHECK-MVE-NEXT: vmov.16 q0[6], r12
109 ; CHECK-MVE-NEXT: vmov.16 q0[7], lr
110 ; CHECK-MVE-NEXT: pop {r4, r5, r7, pc}
112 ; CHECK-MVEFP-LABEL: sext_v8i1_v8f32:
113 ; CHECK-MVEFP: @ %bb.0: @ %entry
114 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0x0
115 ; CHECK-MVEFP-NEXT: vmov.i8 q3, #0xff
116 ; CHECK-MVEFP-NEXT: vcmp.f16 ne, q0, q1
117 ; CHECK-MVEFP-NEXT: vpsel q0, q3, q2
118 ; CHECK-MVEFP-NEXT: bx lr
120 %c = fcmp une <8 x half> %src1, %src2
121 %0 = sext <8 x i1> %c to <8 x i16>
125 define arm_aapcs_vfpcc <16 x i8> @sext_v16i1_v16i8(<16 x i8> %src) {
126 ; CHECK-LABEL: sext_v16i1_v16i8:
127 ; CHECK: @ %bb.0: @ %entry
128 ; CHECK-NEXT: vmov.i8 q1, #0x0
129 ; CHECK-NEXT: vmov.i8 q2, #0xff
130 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
131 ; CHECK-NEXT: vpsel q0, q2, q1
134 %c = icmp sgt <16 x i8> %src, zeroinitializer
135 %0 = sext <16 x i1> %c to <16 x i8>
139 define arm_aapcs_vfpcc <2 x i64> @sext_v2i1_v2i64(<2 x i64> %src) {
140 ; CHECK-LABEL: sext_v2i1_v2i64:
141 ; CHECK: @ %bb.0: @ %entry
142 ; CHECK-NEXT: vmov r0, r1, d1
143 ; CHECK-NEXT: mov.w r12, #0
144 ; CHECK-NEXT: vmov r2, r3, d0
145 ; CHECK-NEXT: rsbs r0, r0, #0
146 ; CHECK-NEXT: sbcs.w r0, r12, r1
147 ; CHECK-NEXT: csetm r0, lt
148 ; CHECK-NEXT: rsbs r1, r2, #0
149 ; CHECK-NEXT: sbcs.w r1, r12, r3
150 ; CHECK-NEXT: csetm r1, lt
151 ; CHECK-NEXT: vmov q0[2], q0[0], r1, r0
152 ; CHECK-NEXT: vmov q0[3], q0[1], r1, r0
155 %c = icmp sgt <2 x i64> %src, zeroinitializer
156 %0 = sext <2 x i1> %c to <2 x i64>
160 define arm_aapcs_vfpcc <2 x i64> @sext_v2i1_v2f64(<2 x double> %src) {
161 ; CHECK-MVE-LABEL: sext_v2i1_v2f64:
162 ; CHECK-MVE: @ %bb.0: @ %entry
163 ; CHECK-MVE-NEXT: .save {r4, r5, r6, lr}
164 ; CHECK-MVE-NEXT: push {r4, r5, r6, lr}
165 ; CHECK-MVE-NEXT: .vsave {d8, d9}
166 ; CHECK-MVE-NEXT: vpush {d8, d9}
167 ; CHECK-MVE-NEXT: vmov q4, q0
168 ; CHECK-MVE-NEXT: vldr d0, .LCPI6_0
169 ; CHECK-MVE-NEXT: vmov r0, r1, d9
170 ; CHECK-MVE-NEXT: vmov r4, r5, d0
171 ; CHECK-MVE-NEXT: mov r2, r4
172 ; CHECK-MVE-NEXT: mov r3, r5
173 ; CHECK-MVE-NEXT: bl __aeabi_dcmpeq
174 ; CHECK-MVE-NEXT: vmov r2, r1, d8
175 ; CHECK-MVE-NEXT: cmp r0, #0
176 ; CHECK-MVE-NEXT: mov r3, r5
177 ; CHECK-MVE-NEXT: csetm r6, eq
178 ; CHECK-MVE-NEXT: mov r0, r2
179 ; CHECK-MVE-NEXT: mov r2, r4
180 ; CHECK-MVE-NEXT: bl __aeabi_dcmpeq
181 ; CHECK-MVE-NEXT: cmp r0, #0
182 ; CHECK-MVE-NEXT: csetm r0, eq
183 ; CHECK-MVE-NEXT: vmov q0[2], q0[0], r0, r6
184 ; CHECK-MVE-NEXT: vmov q0[3], q0[1], r0, r6
185 ; CHECK-MVE-NEXT: vpop {d8, d9}
186 ; CHECK-MVE-NEXT: pop {r4, r5, r6, pc}
187 ; CHECK-MVE-NEXT: .p2align 3
188 ; CHECK-MVE-NEXT: @ %bb.1:
189 ; CHECK-MVE-NEXT: .LCPI6_0:
190 ; CHECK-MVE-NEXT: .long 0 @ double 0
191 ; CHECK-MVE-NEXT: .long 0
193 ; CHECK-MVEFP-LABEL: sext_v2i1_v2f64:
194 ; CHECK-MVEFP: @ %bb.0: @ %entry
195 ; CHECK-MVEFP-NEXT: .save {r4, r5, r6, lr}
196 ; CHECK-MVEFP-NEXT: push {r4, r5, r6, lr}
197 ; CHECK-MVEFP-NEXT: .vsave {d8, d9}
198 ; CHECK-MVEFP-NEXT: vpush {d8, d9}
199 ; CHECK-MVEFP-NEXT: vmov q4, q0
200 ; CHECK-MVEFP-NEXT: vldr d0, .LCPI6_0
201 ; CHECK-MVEFP-NEXT: vmov r0, r1, d9
202 ; CHECK-MVEFP-NEXT: vmov r4, r5, d0
203 ; CHECK-MVEFP-NEXT: mov r2, r4
204 ; CHECK-MVEFP-NEXT: mov r3, r5
205 ; CHECK-MVEFP-NEXT: bl __aeabi_dcmpeq
206 ; CHECK-MVEFP-NEXT: mov r6, r0
207 ; CHECK-MVEFP-NEXT: vmov r0, r1, d8
208 ; CHECK-MVEFP-NEXT: mov r2, r4
209 ; CHECK-MVEFP-NEXT: mov r3, r5
210 ; CHECK-MVEFP-NEXT: bl __aeabi_dcmpeq
211 ; CHECK-MVEFP-NEXT: cmp r6, #0
212 ; CHECK-MVEFP-NEXT: csetm r1, eq
213 ; CHECK-MVEFP-NEXT: cmp r0, #0
214 ; CHECK-MVEFP-NEXT: csetm r0, eq
215 ; CHECK-MVEFP-NEXT: vmov q0[2], q0[0], r0, r1
216 ; CHECK-MVEFP-NEXT: vmov q0[3], q0[1], r0, r1
217 ; CHECK-MVEFP-NEXT: vpop {d8, d9}
218 ; CHECK-MVEFP-NEXT: pop {r4, r5, r6, pc}
219 ; CHECK-MVEFP-NEXT: .p2align 3
220 ; CHECK-MVEFP-NEXT: @ %bb.1:
221 ; CHECK-MVEFP-NEXT: .LCPI6_0:
222 ; CHECK-MVEFP-NEXT: .long 0 @ double 0
223 ; CHECK-MVEFP-NEXT: .long 0
225 %c = fcmp une <2 x double> %src, zeroinitializer
226 %0 = sext <2 x i1> %c to <2 x i64>
231 define arm_aapcs_vfpcc <4 x i32> @zext_v4i1_v4i32(<4 x i32> %src) {
232 ; CHECK-LABEL: zext_v4i1_v4i32:
233 ; CHECK: @ %bb.0: @ %entry
234 ; CHECK-NEXT: vmov.i32 q1, #0x0
235 ; CHECK-NEXT: vmov.i32 q2, #0x1
236 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
237 ; CHECK-NEXT: vpsel q0, q2, q1
240 %c = icmp sgt <4 x i32> %src, zeroinitializer
241 %0 = zext <4 x i1> %c to <4 x i32>
245 define arm_aapcs_vfpcc <4 x i32> @zext_v4i1_v4f32(<4 x float> %src1, <4 x float> %src2) {
246 ; CHECK-MVE-LABEL: zext_v4i1_v4f32:
247 ; CHECK-MVE: @ %bb.0: @ %entry
248 ; CHECK-MVE-NEXT: vcmp.f32 s3, s7
249 ; CHECK-MVE-NEXT: vmov.i32 q2, #0x1
250 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
251 ; CHECK-MVE-NEXT: vcmp.f32 s1, s5
252 ; CHECK-MVE-NEXT: csetm r0, ne
253 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
254 ; CHECK-MVE-NEXT: vcmp.f32 s2, s6
255 ; CHECK-MVE-NEXT: csetm r1, ne
256 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
257 ; CHECK-MVE-NEXT: vcmp.f32 s0, s4
258 ; CHECK-MVE-NEXT: csetm r2, ne
259 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
260 ; CHECK-MVE-NEXT: csetm r3, ne
261 ; CHECK-MVE-NEXT: vmov q0[2], q0[0], r3, r2
262 ; CHECK-MVE-NEXT: vmov q0[3], q0[1], r1, r0
263 ; CHECK-MVE-NEXT: vand q0, q0, q2
264 ; CHECK-MVE-NEXT: bx lr
266 ; CHECK-MVEFP-LABEL: zext_v4i1_v4f32:
267 ; CHECK-MVEFP: @ %bb.0: @ %entry
268 ; CHECK-MVEFP-NEXT: vmov.i32 q2, #0x0
269 ; CHECK-MVEFP-NEXT: vmov.i32 q3, #0x1
270 ; CHECK-MVEFP-NEXT: vcmp.f32 ne, q0, q1
271 ; CHECK-MVEFP-NEXT: vpsel q0, q3, q2
272 ; CHECK-MVEFP-NEXT: bx lr
274 %c = fcmp une <4 x float> %src1, %src2
275 %0 = zext <4 x i1> %c to <4 x i32>
279 define arm_aapcs_vfpcc <8 x i16> @zext_v8i1_v8i16(<8 x i16> %src) {
280 ; CHECK-LABEL: zext_v8i1_v8i16:
281 ; CHECK: @ %bb.0: @ %entry
282 ; CHECK-NEXT: vmov.i16 q1, #0x0
283 ; CHECK-NEXT: vmov.i16 q2, #0x1
284 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
285 ; CHECK-NEXT: vpsel q0, q2, q1
288 %c = icmp sgt <8 x i16> %src, zeroinitializer
289 %0 = zext <8 x i1> %c to <8 x i16>
293 define arm_aapcs_vfpcc <8 x i16> @zext_v8i1_v8f32(<8 x half> %src1, <8 x half> %src2) {
294 ; CHECK-MVE-LABEL: zext_v8i1_v8f32:
295 ; CHECK-MVE: @ %bb.0: @ %entry
296 ; CHECK-MVE-NEXT: .save {r4, r5, r7, lr}
297 ; CHECK-MVE-NEXT: push {r4, r5, r7, lr}
298 ; CHECK-MVE-NEXT: vmovx.f16 s8, s7
299 ; CHECK-MVE-NEXT: vmovx.f16 s10, s3
300 ; CHECK-MVE-NEXT: vcmp.f16 s10, s8
301 ; CHECK-MVE-NEXT: vmovx.f16 s8, s6
302 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
303 ; CHECK-MVE-NEXT: vmovx.f16 s10, s2
304 ; CHECK-MVE-NEXT: vcmp.f16 s10, s8
305 ; CHECK-MVE-NEXT: vmovx.f16 s8, s5
306 ; CHECK-MVE-NEXT: vmovx.f16 s10, s1
307 ; CHECK-MVE-NEXT: csetm r12, ne
308 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
309 ; CHECK-MVE-NEXT: vcmp.f16 s3, s7
310 ; CHECK-MVE-NEXT: csetm lr, ne
311 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
312 ; CHECK-MVE-NEXT: vcmp.f16 s10, s8
313 ; CHECK-MVE-NEXT: csetm r2, ne
314 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
315 ; CHECK-MVE-NEXT: vcmp.f16 s2, s6
316 ; CHECK-MVE-NEXT: vmovx.f16 s2, s4
317 ; CHECK-MVE-NEXT: vmovx.f16 s6, s0
318 ; CHECK-MVE-NEXT: csetm r3, ne
319 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
320 ; CHECK-MVE-NEXT: vcmp.f16 s6, s2
321 ; CHECK-MVE-NEXT: csetm r0, ne
322 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
323 ; CHECK-MVE-NEXT: vcmp.f16 s1, s5
324 ; CHECK-MVE-NEXT: csetm r1, ne
325 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
326 ; CHECK-MVE-NEXT: vcmp.f16 s0, s4
327 ; CHECK-MVE-NEXT: vmov.i16 q0, #0x1
328 ; CHECK-MVE-NEXT: csetm r4, ne
329 ; CHECK-MVE-NEXT: vmrs APSR_nzcv, fpscr
330 ; CHECK-MVE-NEXT: csetm r5, ne
331 ; CHECK-MVE-NEXT: vmov.16 q1[0], r5
332 ; CHECK-MVE-NEXT: vmov.16 q1[1], r1
333 ; CHECK-MVE-NEXT: vmov.16 q1[2], r4
334 ; CHECK-MVE-NEXT: vmov.16 q1[3], r3
335 ; CHECK-MVE-NEXT: vmov.16 q1[4], r0
336 ; CHECK-MVE-NEXT: vmov.16 q1[5], lr
337 ; CHECK-MVE-NEXT: vmov.16 q1[6], r2
338 ; CHECK-MVE-NEXT: vmov.16 q1[7], r12
339 ; CHECK-MVE-NEXT: vand q0, q1, q0
340 ; CHECK-MVE-NEXT: pop {r4, r5, r7, pc}
342 ; CHECK-MVEFP-LABEL: zext_v8i1_v8f32:
343 ; CHECK-MVEFP: @ %bb.0: @ %entry
344 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0x0
345 ; CHECK-MVEFP-NEXT: vmov.i16 q3, #0x1
346 ; CHECK-MVEFP-NEXT: vcmp.f16 ne, q0, q1
347 ; CHECK-MVEFP-NEXT: vpsel q0, q3, q2
348 ; CHECK-MVEFP-NEXT: bx lr
350 %c = fcmp une <8 x half> %src1, %src2
351 %0 = zext <8 x i1> %c to <8 x i16>
355 define arm_aapcs_vfpcc <16 x i8> @zext_v16i1_v16i8(<16 x i8> %src) {
356 ; CHECK-LABEL: zext_v16i1_v16i8:
357 ; CHECK: @ %bb.0: @ %entry
358 ; CHECK-NEXT: vmov.i8 q1, #0x0
359 ; CHECK-NEXT: vmov.i8 q2, #0x1
360 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
361 ; CHECK-NEXT: vpsel q0, q2, q1
364 %c = icmp sgt <16 x i8> %src, zeroinitializer
365 %0 = zext <16 x i1> %c to <16 x i8>
369 define arm_aapcs_vfpcc <2 x i64> @zext_v2i1_v2i64(<2 x i64> %src) {
370 ; CHECK-LABEL: zext_v2i1_v2i64:
371 ; CHECK: @ %bb.0: @ %entry
372 ; CHECK-NEXT: vmov r0, r1, d1
373 ; CHECK-NEXT: mov.w r12, #0
374 ; CHECK-NEXT: vmov r2, r3, d0
375 ; CHECK-NEXT: vldr s1, .LCPI12_0
376 ; CHECK-NEXT: vmov.f32 s3, s1
377 ; CHECK-NEXT: rsbs r0, r0, #0
378 ; CHECK-NEXT: sbcs.w r0, r12, r1
379 ; CHECK-NEXT: cset r0, lt
380 ; CHECK-NEXT: rsbs r1, r2, #0
381 ; CHECK-NEXT: sbcs.w r1, r12, r3
382 ; CHECK-NEXT: vmov s2, r0
383 ; CHECK-NEXT: cset r0, lt
384 ; CHECK-NEXT: vmov s0, r0
386 ; CHECK-NEXT: .p2align 2
387 ; CHECK-NEXT: @ %bb.1:
388 ; CHECK-NEXT: .LCPI12_0:
389 ; CHECK-NEXT: .long 0x00000000 @ float 0
391 %c = icmp sgt <2 x i64> %src, zeroinitializer
392 %0 = zext <2 x i1> %c to <2 x i64>
396 define arm_aapcs_vfpcc <2 x i64> @zext_v2i1_v2f64(<2 x double> %src) {
397 ; CHECK-MVE-LABEL: zext_v2i1_v2f64:
398 ; CHECK-MVE: @ %bb.0: @ %entry
399 ; CHECK-MVE-NEXT: .save {r4, r5, r6, lr}
400 ; CHECK-MVE-NEXT: push {r4, r5, r6, lr}
401 ; CHECK-MVE-NEXT: .vsave {d8, d9}
402 ; CHECK-MVE-NEXT: vpush {d8, d9}
403 ; CHECK-MVE-NEXT: vmov q4, q0
404 ; CHECK-MVE-NEXT: vldr d0, .LCPI13_0
405 ; CHECK-MVE-NEXT: vmov r0, r1, d9
406 ; CHECK-MVE-NEXT: vmov r4, r5, d0
407 ; CHECK-MVE-NEXT: mov r2, r4
408 ; CHECK-MVE-NEXT: mov r3, r5
409 ; CHECK-MVE-NEXT: bl __aeabi_dcmpeq
410 ; CHECK-MVE-NEXT: vmov r2, r1, d8
411 ; CHECK-MVE-NEXT: adr r3, .LCPI13_1
412 ; CHECK-MVE-NEXT: cmp r0, #0
413 ; CHECK-MVE-NEXT: vldrw.u32 q4, [r3]
414 ; CHECK-MVE-NEXT: mov r3, r5
415 ; CHECK-MVE-NEXT: csetm r6, eq
416 ; CHECK-MVE-NEXT: mov r0, r2
417 ; CHECK-MVE-NEXT: mov r2, r4
418 ; CHECK-MVE-NEXT: bl __aeabi_dcmpeq
419 ; CHECK-MVE-NEXT: cmp r0, #0
420 ; CHECK-MVE-NEXT: csetm r0, eq
421 ; CHECK-MVE-NEXT: vmov q0[2], q0[0], r0, r6
422 ; CHECK-MVE-NEXT: vand q0, q0, q4
423 ; CHECK-MVE-NEXT: vpop {d8, d9}
424 ; CHECK-MVE-NEXT: pop {r4, r5, r6, pc}
425 ; CHECK-MVE-NEXT: .p2align 4
426 ; CHECK-MVE-NEXT: @ %bb.1:
427 ; CHECK-MVE-NEXT: .LCPI13_1:
428 ; CHECK-MVE-NEXT: .long 1 @ 0x1
429 ; CHECK-MVE-NEXT: .long 0 @ 0x0
430 ; CHECK-MVE-NEXT: .long 1 @ 0x1
431 ; CHECK-MVE-NEXT: .long 0 @ 0x0
432 ; CHECK-MVE-NEXT: .LCPI13_0:
433 ; CHECK-MVE-NEXT: .long 0 @ double 0
434 ; CHECK-MVE-NEXT: .long 0
436 ; CHECK-MVEFP-LABEL: zext_v2i1_v2f64:
437 ; CHECK-MVEFP: @ %bb.0: @ %entry
438 ; CHECK-MVEFP-NEXT: .save {r4, r5, r6, lr}
439 ; CHECK-MVEFP-NEXT: push {r4, r5, r6, lr}
440 ; CHECK-MVEFP-NEXT: .vsave {d8, d9}
441 ; CHECK-MVEFP-NEXT: vpush {d8, d9}
442 ; CHECK-MVEFP-NEXT: vmov q4, q0
443 ; CHECK-MVEFP-NEXT: vldr d0, .LCPI13_0
444 ; CHECK-MVEFP-NEXT: vmov r0, r1, d8
445 ; CHECK-MVEFP-NEXT: vmov r4, r5, d0
446 ; CHECK-MVEFP-NEXT: mov r2, r4
447 ; CHECK-MVEFP-NEXT: mov r3, r5
448 ; CHECK-MVEFP-NEXT: bl __aeabi_dcmpeq
449 ; CHECK-MVEFP-NEXT: mov r6, r0
450 ; CHECK-MVEFP-NEXT: vmov r0, r1, d9
451 ; CHECK-MVEFP-NEXT: mov r2, r4
452 ; CHECK-MVEFP-NEXT: mov r3, r5
453 ; CHECK-MVEFP-NEXT: bl __aeabi_dcmpeq
454 ; CHECK-MVEFP-NEXT: cmp r0, #0
455 ; CHECK-MVEFP-NEXT: vldr s1, .LCPI13_1
456 ; CHECK-MVEFP-NEXT: cset r0, eq
457 ; CHECK-MVEFP-NEXT: cmp r6, #0
458 ; CHECK-MVEFP-NEXT: vmov s2, r0
459 ; CHECK-MVEFP-NEXT: cset r0, eq
460 ; CHECK-MVEFP-NEXT: vmov s0, r0
461 ; CHECK-MVEFP-NEXT: vmov.f32 s3, s1
462 ; CHECK-MVEFP-NEXT: vpop {d8, d9}
463 ; CHECK-MVEFP-NEXT: pop {r4, r5, r6, pc}
464 ; CHECK-MVEFP-NEXT: .p2align 3
465 ; CHECK-MVEFP-NEXT: @ %bb.1:
466 ; CHECK-MVEFP-NEXT: .LCPI13_0:
467 ; CHECK-MVEFP-NEXT: .long 0 @ double 0
468 ; CHECK-MVEFP-NEXT: .long 0
469 ; CHECK-MVEFP-NEXT: .LCPI13_1:
470 ; CHECK-MVEFP-NEXT: .long 0x00000000 @ float 0
472 %c = fcmp une <2 x double> %src, zeroinitializer
473 %0 = zext <2 x i1> %c to <2 x i64>
478 define arm_aapcs_vfpcc <4 x i32> @trunc_v4i1_v4i32(<4 x i32> %src) {
479 ; CHECK-LABEL: trunc_v4i1_v4i32:
480 ; CHECK: @ %bb.0: @ %entry
481 ; CHECK-NEXT: vmov.i32 q2, #0x1
482 ; CHECK-NEXT: vmov.i32 q1, #0x0
483 ; CHECK-NEXT: vand q2, q0, q2
484 ; CHECK-NEXT: vcmp.i32 ne, q2, zr
485 ; CHECK-NEXT: vpsel q0, q0, q1
488 %0 = trunc <4 x i32> %src to <4 x i1>
489 %1 = select <4 x i1> %0, <4 x i32> %src, <4 x i32> zeroinitializer
493 define arm_aapcs_vfpcc <8 x i16> @trunc_v8i1_v8i16(<8 x i16> %src) {
494 ; CHECK-LABEL: trunc_v8i1_v8i16:
495 ; CHECK: @ %bb.0: @ %entry
496 ; CHECK-NEXT: vmov.i16 q2, #0x1
497 ; CHECK-NEXT: vmov.i32 q1, #0x0
498 ; CHECK-NEXT: vand q2, q0, q2
499 ; CHECK-NEXT: vcmp.i16 ne, q2, zr
500 ; CHECK-NEXT: vpsel q0, q0, q1
503 %0 = trunc <8 x i16> %src to <8 x i1>
504 %1 = select <8 x i1> %0, <8 x i16> %src, <8 x i16> zeroinitializer
508 define arm_aapcs_vfpcc <16 x i8> @trunc_v16i1_v16i8(<16 x i8> %src) {
509 ; CHECK-LABEL: trunc_v16i1_v16i8:
510 ; CHECK: @ %bb.0: @ %entry
511 ; CHECK-NEXT: vmov.i8 q2, #0x1
512 ; CHECK-NEXT: vmov.i32 q1, #0x0
513 ; CHECK-NEXT: vand q2, q0, q2
514 ; CHECK-NEXT: vcmp.i8 ne, q2, zr
515 ; CHECK-NEXT: vpsel q0, q0, q1
518 %0 = trunc <16 x i8> %src to <16 x i1>
519 %1 = select <16 x i1> %0, <16 x i8> %src, <16 x i8> zeroinitializer
523 define arm_aapcs_vfpcc <2 x i64> @trunc_v2i1_v2i64(<2 x i64> %src) {
524 ; CHECK-LABEL: trunc_v2i1_v2i64:
525 ; CHECK: @ %bb.0: @ %entry
526 ; CHECK-NEXT: vmov r1, s0
527 ; CHECK-NEXT: movs r0, #0
528 ; CHECK-NEXT: vmov.i32 q1, #0x0
529 ; CHECK-NEXT: and r1, r1, #1
530 ; CHECK-NEXT: rsbs r1, r1, #0
531 ; CHECK-NEXT: bfi r0, r1, #0, #8
532 ; CHECK-NEXT: vmov r1, s2
533 ; CHECK-NEXT: and r1, r1, #1
534 ; CHECK-NEXT: rsbs r1, r1, #0
535 ; CHECK-NEXT: bfi r0, r1, #8, #8
536 ; CHECK-NEXT: vmsr p0, r0
537 ; CHECK-NEXT: vpsel q0, q0, q1
540 %0 = trunc <2 x i64> %src to <2 x i1>
541 %1 = select <2 x i1> %0, <2 x i64> %src, <2 x i64> zeroinitializer
546 define arm_aapcs_vfpcc <4 x float> @uitofp_v4i1_v4f32(<4 x i32> %src) {
547 ; CHECK-MVE-LABEL: uitofp_v4i1_v4f32:
548 ; CHECK-MVE: @ %bb.0: @ %entry
549 ; CHECK-MVE-NEXT: vcmp.s32 gt, q0, zr
550 ; CHECK-MVE-NEXT: vmrs r0, p0
551 ; CHECK-MVE-NEXT: ubfx r2, r0, #12, #1
552 ; CHECK-MVE-NEXT: ubfx r1, r0, #8, #1
553 ; CHECK-MVE-NEXT: vmov s0, r2
554 ; CHECK-MVE-NEXT: ubfx r2, r0, #4, #1
555 ; CHECK-MVE-NEXT: and r0, r0, #1
556 ; CHECK-MVE-NEXT: vcvt.f32.u32 s3, s0
557 ; CHECK-MVE-NEXT: vmov s0, r1
558 ; CHECK-MVE-NEXT: vcvt.f32.u32 s2, s0
559 ; CHECK-MVE-NEXT: vmov s0, r2
560 ; CHECK-MVE-NEXT: vcvt.f32.u32 s1, s0
561 ; CHECK-MVE-NEXT: vmov s0, r0
562 ; CHECK-MVE-NEXT: vcvt.f32.u32 s0, s0
563 ; CHECK-MVE-NEXT: bx lr
565 ; CHECK-MVEFP-LABEL: uitofp_v4i1_v4f32:
566 ; CHECK-MVEFP: @ %bb.0: @ %entry
567 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
568 ; CHECK-MVEFP-NEXT: vmov.f32 q2, #1.000000e+00
569 ; CHECK-MVEFP-NEXT: vcmp.s32 gt, q0, zr
570 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
571 ; CHECK-MVEFP-NEXT: bx lr
573 %c = icmp sgt <4 x i32> %src, zeroinitializer
574 %0 = uitofp <4 x i1> %c to <4 x float>
578 define arm_aapcs_vfpcc <4 x float> @sitofp_v4i1_v4f32(<4 x i32> %src) {
579 ; CHECK-MVE-LABEL: sitofp_v4i1_v4f32:
580 ; CHECK-MVE: @ %bb.0: @ %entry
581 ; CHECK-MVE-NEXT: vcmp.s32 gt, q0, zr
582 ; CHECK-MVE-NEXT: vmrs r0, p0
583 ; CHECK-MVE-NEXT: and r1, r0, #1
584 ; CHECK-MVE-NEXT: ubfx r2, r0, #8, #1
585 ; CHECK-MVE-NEXT: ubfx r3, r0, #4, #1
586 ; CHECK-MVE-NEXT: ubfx r0, r0, #12, #1
587 ; CHECK-MVE-NEXT: rsbs r2, r2, #0
588 ; CHECK-MVE-NEXT: rsbs r0, r0, #0
589 ; CHECK-MVE-NEXT: vmov s0, r0
590 ; CHECK-MVE-NEXT: rsbs r0, r3, #0
591 ; CHECK-MVE-NEXT: vcvt.f32.s32 s3, s0
592 ; CHECK-MVE-NEXT: vmov s0, r2
593 ; CHECK-MVE-NEXT: vcvt.f32.s32 s2, s0
594 ; CHECK-MVE-NEXT: vmov s0, r0
595 ; CHECK-MVE-NEXT: rsbs r0, r1, #0
596 ; CHECK-MVE-NEXT: vcvt.f32.s32 s1, s0
597 ; CHECK-MVE-NEXT: vmov s0, r0
598 ; CHECK-MVE-NEXT: vcvt.f32.s32 s0, s0
599 ; CHECK-MVE-NEXT: bx lr
601 ; CHECK-MVEFP-LABEL: sitofp_v4i1_v4f32:
602 ; CHECK-MVEFP: @ %bb.0: @ %entry
603 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
604 ; CHECK-MVEFP-NEXT: vmov.f32 q2, #-1.000000e+00
605 ; CHECK-MVEFP-NEXT: vcmp.s32 gt, q0, zr
606 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
607 ; CHECK-MVEFP-NEXT: bx lr
609 %c = icmp sgt <4 x i32> %src, zeroinitializer
610 %0 = sitofp <4 x i1> %c to <4 x float>
614 define arm_aapcs_vfpcc <4 x float> @fptoui_v4i1_v4f32(<4 x float> %src) {
615 ; CHECK-MVE-LABEL: fptoui_v4i1_v4f32:
616 ; CHECK-MVE: @ %bb.0: @ %entry
617 ; CHECK-MVE-NEXT: vcvt.s32.f32 s6, s3
618 ; CHECK-MVE-NEXT: vldr s8, .LCPI20_0
619 ; CHECK-MVE-NEXT: vcvt.s32.f32 s2, s2
620 ; CHECK-MVE-NEXT: vcvt.s32.f32 s10, s1
621 ; CHECK-MVE-NEXT: vmov.f32 s4, #1.000000e+00
622 ; CHECK-MVE-NEXT: vcvt.s32.f32 s0, s0
623 ; CHECK-MVE-NEXT: vmov r0, s6
624 ; CHECK-MVE-NEXT: cmp r0, #0
625 ; CHECK-MVE-NEXT: vmov r0, s2
626 ; CHECK-MVE-NEXT: vseleq.f32 s3, s8, s4
627 ; CHECK-MVE-NEXT: cmp r0, #0
628 ; CHECK-MVE-NEXT: vmov r0, s10
629 ; CHECK-MVE-NEXT: vseleq.f32 s2, s8, s4
630 ; CHECK-MVE-NEXT: cmp r0, #0
631 ; CHECK-MVE-NEXT: vmov r0, s0
632 ; CHECK-MVE-NEXT: vseleq.f32 s1, s8, s4
633 ; CHECK-MVE-NEXT: cmp r0, #0
634 ; CHECK-MVE-NEXT: vseleq.f32 s0, s8, s4
635 ; CHECK-MVE-NEXT: bx lr
636 ; CHECK-MVE-NEXT: .p2align 2
637 ; CHECK-MVE-NEXT: @ %bb.1:
638 ; CHECK-MVE-NEXT: .LCPI20_0:
639 ; CHECK-MVE-NEXT: .long 0x00000000 @ float 0
641 ; CHECK-MVEFP-LABEL: fptoui_v4i1_v4f32:
642 ; CHECK-MVEFP: @ %bb.0: @ %entry
643 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
644 ; CHECK-MVEFP-NEXT: vmov.f32 q2, #1.000000e+00
645 ; CHECK-MVEFP-NEXT: vcmp.f32 ne, q0, zr
646 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
647 ; CHECK-MVEFP-NEXT: bx lr
649 %0 = fptoui <4 x float> %src to <4 x i1>
650 %s = select <4 x i1> %0, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> zeroinitializer
654 define arm_aapcs_vfpcc <4 x float> @fptosi_v4i1_v4f32(<4 x float> %src) {
655 ; CHECK-MVE-LABEL: fptosi_v4i1_v4f32:
656 ; CHECK-MVE: @ %bb.0: @ %entry
657 ; CHECK-MVE-NEXT: vcvt.s32.f32 s8, s3
658 ; CHECK-MVE-NEXT: vldr s10, .LCPI21_0
659 ; CHECK-MVE-NEXT: vcvt.s32.f32 s2, s2
660 ; CHECK-MVE-NEXT: vcvt.s32.f32 s6, s1
661 ; CHECK-MVE-NEXT: vmov.f32 s4, #1.000000e+00
662 ; CHECK-MVE-NEXT: vcvt.s32.f32 s0, s0
663 ; CHECK-MVE-NEXT: vmov r0, s8
664 ; CHECK-MVE-NEXT: lsls r0, r0, #31
665 ; CHECK-MVE-NEXT: vmov r0, s2
666 ; CHECK-MVE-NEXT: vseleq.f32 s3, s10, s4
667 ; CHECK-MVE-NEXT: lsls r0, r0, #31
668 ; CHECK-MVE-NEXT: vmov r0, s6
669 ; CHECK-MVE-NEXT: vseleq.f32 s2, s10, s4
670 ; CHECK-MVE-NEXT: lsls r0, r0, #31
671 ; CHECK-MVE-NEXT: vmov r0, s0
672 ; CHECK-MVE-NEXT: vseleq.f32 s1, s10, s4
673 ; CHECK-MVE-NEXT: lsls r0, r0, #31
674 ; CHECK-MVE-NEXT: vseleq.f32 s0, s10, s4
675 ; CHECK-MVE-NEXT: bx lr
676 ; CHECK-MVE-NEXT: .p2align 2
677 ; CHECK-MVE-NEXT: @ %bb.1:
678 ; CHECK-MVE-NEXT: .LCPI21_0:
679 ; CHECK-MVE-NEXT: .long 0x00000000 @ float 0
681 ; CHECK-MVEFP-LABEL: fptosi_v4i1_v4f32:
682 ; CHECK-MVEFP: @ %bb.0: @ %entry
683 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
684 ; CHECK-MVEFP-NEXT: vmov.f32 q2, #1.000000e+00
685 ; CHECK-MVEFP-NEXT: vcmp.f32 ne, q0, zr
686 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
687 ; CHECK-MVEFP-NEXT: bx lr
689 %0 = fptosi <4 x float> %src to <4 x i1>
690 %s = select <4 x i1> %0, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> zeroinitializer
694 define arm_aapcs_vfpcc <8 x half> @uitofp_v8i1_v8f16(<8 x i16> %src) {
695 ; CHECK-MVE-LABEL: uitofp_v8i1_v8f16:
696 ; CHECK-MVE: @ %bb.0: @ %entry
697 ; CHECK-MVE-NEXT: vcmp.s16 gt, q0, zr
698 ; CHECK-MVE-NEXT: vmrs r0, p0
699 ; CHECK-MVE-NEXT: and r1, r0, #1
700 ; CHECK-MVE-NEXT: ubfx r2, r0, #2, #1
701 ; CHECK-MVE-NEXT: vmov s0, r1
702 ; CHECK-MVE-NEXT: ubfx r1, r0, #4, #1
703 ; CHECK-MVE-NEXT: vmov s2, r2
704 ; CHECK-MVE-NEXT: ubfx r2, r0, #6, #1
705 ; CHECK-MVE-NEXT: vcvt.f16.u32 s2, s2
706 ; CHECK-MVE-NEXT: vcvt.f16.u32 s0, s0
707 ; CHECK-MVE-NEXT: vmov s4, r2
708 ; CHECK-MVE-NEXT: vins.f16 s0, s2
709 ; CHECK-MVE-NEXT: vmov s2, r1
710 ; CHECK-MVE-NEXT: ubfx r1, r0, #8, #1
711 ; CHECK-MVE-NEXT: ubfx r2, r0, #10, #1
712 ; CHECK-MVE-NEXT: vcvt.f16.u32 s1, s2
713 ; CHECK-MVE-NEXT: vcvt.f16.u32 s4, s4
714 ; CHECK-MVE-NEXT: vmov s2, r1
715 ; CHECK-MVE-NEXT: ubfx r1, r0, #12, #1
716 ; CHECK-MVE-NEXT: vins.f16 s1, s4
717 ; CHECK-MVE-NEXT: vmov s4, r2
718 ; CHECK-MVE-NEXT: ubfx r0, r0, #14, #1
719 ; CHECK-MVE-NEXT: vcvt.f16.u32 s4, s4
720 ; CHECK-MVE-NEXT: vcvt.f16.u32 s2, s2
721 ; CHECK-MVE-NEXT: vins.f16 s2, s4
722 ; CHECK-MVE-NEXT: vmov s4, r0
723 ; CHECK-MVE-NEXT: vmov s6, r1
724 ; CHECK-MVE-NEXT: vcvt.f16.u32 s4, s4
725 ; CHECK-MVE-NEXT: vcvt.f16.u32 s3, s6
726 ; CHECK-MVE-NEXT: vins.f16 s3, s4
727 ; CHECK-MVE-NEXT: bx lr
729 ; CHECK-MVEFP-LABEL: uitofp_v8i1_v8f16:
730 ; CHECK-MVEFP: @ %bb.0: @ %entry
731 ; CHECK-MVEFP-NEXT: vmov.i16 q1, #0x0
732 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0x3c00
733 ; CHECK-MVEFP-NEXT: vcmp.s16 gt, q0, zr
734 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
735 ; CHECK-MVEFP-NEXT: bx lr
737 %c = icmp sgt <8 x i16> %src, zeroinitializer
738 %0 = uitofp <8 x i1> %c to <8 x half>
742 define arm_aapcs_vfpcc <8 x half> @sitofp_v8i1_v8f16(<8 x i16> %src) {
743 ; CHECK-MVE-LABEL: sitofp_v8i1_v8f16:
744 ; CHECK-MVE: @ %bb.0: @ %entry
745 ; CHECK-MVE-NEXT: vcmp.s16 gt, q0, zr
746 ; CHECK-MVE-NEXT: vmrs r0, p0
747 ; CHECK-MVE-NEXT: and r1, r0, #1
748 ; CHECK-MVE-NEXT: ubfx r2, r0, #2, #1
749 ; CHECK-MVE-NEXT: rsbs r1, r1, #0
750 ; CHECK-MVE-NEXT: rsbs r2, r2, #0
751 ; CHECK-MVE-NEXT: vmov s0, r2
752 ; CHECK-MVE-NEXT: ubfx r2, r0, #6, #1
753 ; CHECK-MVE-NEXT: vcvt.f16.s32 s2, s0
754 ; CHECK-MVE-NEXT: vmov s0, r1
755 ; CHECK-MVE-NEXT: ubfx r1, r0, #4, #1
756 ; CHECK-MVE-NEXT: rsbs r2, r2, #0
757 ; CHECK-MVE-NEXT: vcvt.f16.s32 s0, s0
758 ; CHECK-MVE-NEXT: rsbs r1, r1, #0
759 ; CHECK-MVE-NEXT: vins.f16 s0, s2
760 ; CHECK-MVE-NEXT: vmov s2, r2
761 ; CHECK-MVE-NEXT: ubfx r2, r0, #10, #1
762 ; CHECK-MVE-NEXT: vmov s4, r1
763 ; CHECK-MVE-NEXT: ubfx r1, r0, #8, #1
764 ; CHECK-MVE-NEXT: rsbs r2, r2, #0
765 ; CHECK-MVE-NEXT: vcvt.f16.s32 s2, s2
766 ; CHECK-MVE-NEXT: vcvt.f16.s32 s1, s4
767 ; CHECK-MVE-NEXT: rsbs r1, r1, #0
768 ; CHECK-MVE-NEXT: vins.f16 s1, s2
769 ; CHECK-MVE-NEXT: vmov s2, r2
770 ; CHECK-MVE-NEXT: vcvt.f16.s32 s4, s2
771 ; CHECK-MVE-NEXT: vmov s2, r1
772 ; CHECK-MVE-NEXT: ubfx r1, r0, #12, #1
773 ; CHECK-MVE-NEXT: ubfx r0, r0, #14, #1
774 ; CHECK-MVE-NEXT: rsbs r1, r1, #0
775 ; CHECK-MVE-NEXT: rsbs r0, r0, #0
776 ; CHECK-MVE-NEXT: vcvt.f16.s32 s2, s2
777 ; CHECK-MVE-NEXT: vins.f16 s2, s4
778 ; CHECK-MVE-NEXT: vmov s4, r0
779 ; CHECK-MVE-NEXT: vmov s6, r1
780 ; CHECK-MVE-NEXT: vcvt.f16.s32 s4, s4
781 ; CHECK-MVE-NEXT: vcvt.f16.s32 s3, s6
782 ; CHECK-MVE-NEXT: vins.f16 s3, s4
783 ; CHECK-MVE-NEXT: bx lr
785 ; CHECK-MVEFP-LABEL: sitofp_v8i1_v8f16:
786 ; CHECK-MVEFP: @ %bb.0: @ %entry
787 ; CHECK-MVEFP-NEXT: vmov.i16 q1, #0x0
788 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0xbc00
789 ; CHECK-MVEFP-NEXT: vcmp.s16 gt, q0, zr
790 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
791 ; CHECK-MVEFP-NEXT: bx lr
793 %c = icmp sgt <8 x i16> %src, zeroinitializer
794 %0 = sitofp <8 x i1> %c to <8 x half>
798 define arm_aapcs_vfpcc <8 x half> @fptoui_v8i1_v8f16(<8 x half> %src) {
799 ; CHECK-MVE-LABEL: fptoui_v8i1_v8f16:
800 ; CHECK-MVE: @ %bb.0: @ %entry
801 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s0
802 ; CHECK-MVE-NEXT: vmovx.f16 s0, s0
803 ; CHECK-MVE-NEXT: vcvt.s32.f16 s0, s0
804 ; CHECK-MVE-NEXT: vldr.16 s8, .LCPI24_0
805 ; CHECK-MVE-NEXT: vmov r0, s0
806 ; CHECK-MVE-NEXT: vmov.f16 s6, #1.000000e+00
807 ; CHECK-MVE-NEXT: cmp r0, #0
808 ; CHECK-MVE-NEXT: vmov r0, s4
809 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
810 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s1
811 ; CHECK-MVE-NEXT: cmp r0, #0
812 ; CHECK-MVE-NEXT: vseleq.f16 s0, s8, s6
813 ; CHECK-MVE-NEXT: vins.f16 s0, s10
814 ; CHECK-MVE-NEXT: vmovx.f16 s10, s1
815 ; CHECK-MVE-NEXT: vcvt.s32.f16 s10, s10
816 ; CHECK-MVE-NEXT: vmov r0, s10
817 ; CHECK-MVE-NEXT: cmp r0, #0
818 ; CHECK-MVE-NEXT: vmov r0, s4
819 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s2
820 ; CHECK-MVE-NEXT: vmovx.f16 s2, s2
821 ; CHECK-MVE-NEXT: vcvt.s32.f16 s2, s2
822 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
823 ; CHECK-MVE-NEXT: cmp r0, #0
824 ; CHECK-MVE-NEXT: vmov r0, s2
825 ; CHECK-MVE-NEXT: vseleq.f16 s1, s8, s6
826 ; CHECK-MVE-NEXT: vins.f16 s1, s10
827 ; CHECK-MVE-NEXT: cmp r0, #0
828 ; CHECK-MVE-NEXT: vmov r0, s4
829 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
830 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s3
831 ; CHECK-MVE-NEXT: cmp r0, #0
832 ; CHECK-MVE-NEXT: vseleq.f16 s2, s8, s6
833 ; CHECK-MVE-NEXT: vins.f16 s2, s10
834 ; CHECK-MVE-NEXT: vmovx.f16 s10, s3
835 ; CHECK-MVE-NEXT: vcvt.s32.f16 s10, s10
836 ; CHECK-MVE-NEXT: vmov r0, s10
837 ; CHECK-MVE-NEXT: cmp r0, #0
838 ; CHECK-MVE-NEXT: vmov r0, s4
839 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
840 ; CHECK-MVE-NEXT: cmp r0, #0
841 ; CHECK-MVE-NEXT: vseleq.f16 s3, s8, s6
842 ; CHECK-MVE-NEXT: vins.f16 s3, s10
843 ; CHECK-MVE-NEXT: bx lr
844 ; CHECK-MVE-NEXT: .p2align 1
845 ; CHECK-MVE-NEXT: @ %bb.1:
846 ; CHECK-MVE-NEXT: .LCPI24_0:
847 ; CHECK-MVE-NEXT: .short 0x0000 @ half 0
849 ; CHECK-MVEFP-LABEL: fptoui_v8i1_v8f16:
850 ; CHECK-MVEFP: @ %bb.0: @ %entry
851 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
852 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0x3c00
853 ; CHECK-MVEFP-NEXT: vcmp.f16 ne, q0, zr
854 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
855 ; CHECK-MVEFP-NEXT: bx lr
857 %0 = fptoui <8 x half> %src to <8 x i1>
858 %s = select <8 x i1> %0, <8 x half> <half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0>, <8 x half> zeroinitializer
862 define arm_aapcs_vfpcc <8 x half> @fptosi_v8i1_v8f16(<8 x half> %src) {
863 ; CHECK-MVE-LABEL: fptosi_v8i1_v8f16:
864 ; CHECK-MVE: @ %bb.0: @ %entry
865 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s0
866 ; CHECK-MVE-NEXT: vmovx.f16 s0, s0
867 ; CHECK-MVE-NEXT: vcvt.s32.f16 s0, s0
868 ; CHECK-MVE-NEXT: vldr.16 s8, .LCPI25_0
869 ; CHECK-MVE-NEXT: vmov r0, s0
870 ; CHECK-MVE-NEXT: vmov.f16 s6, #1.000000e+00
871 ; CHECK-MVE-NEXT: lsls r0, r0, #31
872 ; CHECK-MVE-NEXT: vmov r0, s4
873 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
874 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s1
875 ; CHECK-MVE-NEXT: lsls r0, r0, #31
876 ; CHECK-MVE-NEXT: vseleq.f16 s0, s8, s6
877 ; CHECK-MVE-NEXT: vins.f16 s0, s10
878 ; CHECK-MVE-NEXT: vmovx.f16 s10, s1
879 ; CHECK-MVE-NEXT: vcvt.s32.f16 s10, s10
880 ; CHECK-MVE-NEXT: vmov r0, s10
881 ; CHECK-MVE-NEXT: lsls r0, r0, #31
882 ; CHECK-MVE-NEXT: vmov r0, s4
883 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s2
884 ; CHECK-MVE-NEXT: vmovx.f16 s2, s2
885 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
886 ; CHECK-MVE-NEXT: vcvt.s32.f16 s2, s2
887 ; CHECK-MVE-NEXT: lsls r0, r0, #31
888 ; CHECK-MVE-NEXT: vmov r0, s2
889 ; CHECK-MVE-NEXT: vseleq.f16 s1, s8, s6
890 ; CHECK-MVE-NEXT: vins.f16 s1, s10
891 ; CHECK-MVE-NEXT: lsls r0, r0, #31
892 ; CHECK-MVE-NEXT: vmov r0, s4
893 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
894 ; CHECK-MVE-NEXT: vcvt.s32.f16 s4, s3
895 ; CHECK-MVE-NEXT: lsls r0, r0, #31
896 ; CHECK-MVE-NEXT: vseleq.f16 s2, s8, s6
897 ; CHECK-MVE-NEXT: vins.f16 s2, s10
898 ; CHECK-MVE-NEXT: vmovx.f16 s10, s3
899 ; CHECK-MVE-NEXT: vcvt.s32.f16 s10, s10
900 ; CHECK-MVE-NEXT: vmov r0, s10
901 ; CHECK-MVE-NEXT: lsls r0, r0, #31
902 ; CHECK-MVE-NEXT: vmov r0, s4
903 ; CHECK-MVE-NEXT: vseleq.f16 s10, s8, s6
904 ; CHECK-MVE-NEXT: lsls r0, r0, #31
905 ; CHECK-MVE-NEXT: vseleq.f16 s3, s8, s6
906 ; CHECK-MVE-NEXT: vins.f16 s3, s10
907 ; CHECK-MVE-NEXT: bx lr
908 ; CHECK-MVE-NEXT: .p2align 1
909 ; CHECK-MVE-NEXT: @ %bb.1:
910 ; CHECK-MVE-NEXT: .LCPI25_0:
911 ; CHECK-MVE-NEXT: .short 0x0000 @ half 0
913 ; CHECK-MVEFP-LABEL: fptosi_v8i1_v8f16:
914 ; CHECK-MVEFP: @ %bb.0: @ %entry
915 ; CHECK-MVEFP-NEXT: vmov.i32 q1, #0x0
916 ; CHECK-MVEFP-NEXT: vmov.i16 q2, #0x3c00
917 ; CHECK-MVEFP-NEXT: vcmp.f16 ne, q0, zr
918 ; CHECK-MVEFP-NEXT: vpsel q0, q2, q1
919 ; CHECK-MVEFP-NEXT: bx lr
921 %0 = fptosi <8 x half> %src to <8 x i1>
922 %s = select <8 x i1> %0, <8 x half> <half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0>, <8 x half> zeroinitializer
927 define arm_aapcs_vfpcc <2 x double> @uitofp_v2i1_v2f64(<2 x i64> %src) {
928 ; CHECK-LABEL: uitofp_v2i1_v2f64:
929 ; CHECK: @ %bb.0: @ %entry
930 ; CHECK-NEXT: .save {r4, lr}
931 ; CHECK-NEXT: push {r4, lr}
932 ; CHECK-NEXT: .vsave {d8, d9}
933 ; CHECK-NEXT: vpush {d8, d9}
934 ; CHECK-NEXT: vmov q4, q0
935 ; CHECK-NEXT: movs r4, #0
936 ; CHECK-NEXT: vmov r0, r1, d9
937 ; CHECK-NEXT: rsbs r0, r0, #0
938 ; CHECK-NEXT: sbcs.w r0, r4, r1
939 ; CHECK-NEXT: cset r0, lt
940 ; CHECK-NEXT: bl __aeabi_ui2d
941 ; CHECK-NEXT: vmov r2, r3, d8
942 ; CHECK-NEXT: vmov d9, r0, r1
943 ; CHECK-NEXT: rsbs r2, r2, #0
944 ; CHECK-NEXT: sbcs.w r2, r4, r3
945 ; CHECK-NEXT: cset r2, lt
946 ; CHECK-NEXT: mov r0, r2
947 ; CHECK-NEXT: bl __aeabi_ui2d
948 ; CHECK-NEXT: vmov d8, r0, r1
949 ; CHECK-NEXT: vmov q0, q4
950 ; CHECK-NEXT: vpop {d8, d9}
951 ; CHECK-NEXT: pop {r4, pc}
953 %c = icmp sgt <2 x i64> %src, zeroinitializer
954 %0 = uitofp <2 x i1> %c to <2 x double>
958 define arm_aapcs_vfpcc <2 x double> @sitofp_v2i1_v2f64(<2 x i64> %src) {
959 ; CHECK-LABEL: sitofp_v2i1_v2f64:
960 ; CHECK: @ %bb.0: @ %entry
961 ; CHECK-NEXT: .save {r4, lr}
962 ; CHECK-NEXT: push {r4, lr}
963 ; CHECK-NEXT: .vsave {d8, d9}
964 ; CHECK-NEXT: vpush {d8, d9}
965 ; CHECK-NEXT: vmov q4, q0
966 ; CHECK-NEXT: movs r4, #0
967 ; CHECK-NEXT: vmov r0, r1, d9
968 ; CHECK-NEXT: rsbs r0, r0, #0
969 ; CHECK-NEXT: sbcs.w r0, r4, r1
970 ; CHECK-NEXT: csetm r0, lt
971 ; CHECK-NEXT: bl __aeabi_i2d
972 ; CHECK-NEXT: vmov r2, r3, d8
973 ; CHECK-NEXT: vmov d9, r0, r1
974 ; CHECK-NEXT: rsbs r2, r2, #0
975 ; CHECK-NEXT: sbcs.w r2, r4, r3
976 ; CHECK-NEXT: csetm r2, lt
977 ; CHECK-NEXT: mov r0, r2
978 ; CHECK-NEXT: bl __aeabi_i2d
979 ; CHECK-NEXT: vmov d8, r0, r1
980 ; CHECK-NEXT: vmov q0, q4
981 ; CHECK-NEXT: vpop {d8, d9}
982 ; CHECK-NEXT: pop {r4, pc}
984 %c = icmp sgt <2 x i64> %src, zeroinitializer
985 %0 = sitofp <2 x i1> %c to <2 x double>
989 define arm_aapcs_vfpcc <2 x double> @fptoui_v2i1_v2f64(<2 x double> %src) {
990 ; CHECK-LABEL: fptoui_v2i1_v2f64:
991 ; CHECK: @ %bb.0: @ %entry
992 ; CHECK-NEXT: .save {r4, lr}
993 ; CHECK-NEXT: push {r4, lr}
994 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
995 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
996 ; CHECK-NEXT: vmov q4, q0
997 ; CHECK-NEXT: vmov r0, r1, d8
998 ; CHECK-NEXT: bl __aeabi_d2iz
999 ; CHECK-NEXT: vmov r2, r1, d9
1000 ; CHECK-NEXT: movs r4, #0
1001 ; CHECK-NEXT: rsbs r0, r0, #0
1002 ; CHECK-NEXT: adr r3, .LCPI28_0
1003 ; CHECK-NEXT: bfi r4, r0, #0, #8
1004 ; CHECK-NEXT: vmov.i32 q4, #0x0
1005 ; CHECK-NEXT: vldrw.u32 q5, [r3]
1006 ; CHECK-NEXT: mov r0, r2
1007 ; CHECK-NEXT: bl __aeabi_d2iz
1008 ; CHECK-NEXT: rsbs r0, r0, #0
1009 ; CHECK-NEXT: bfi r4, r0, #8, #8
1010 ; CHECK-NEXT: vmsr p0, r4
1011 ; CHECK-NEXT: vpsel q0, q5, q4
1012 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
1013 ; CHECK-NEXT: pop {r4, pc}
1014 ; CHECK-NEXT: .p2align 4
1015 ; CHECK-NEXT: @ %bb.1:
1016 ; CHECK-NEXT: .LCPI28_0:
1017 ; CHECK-NEXT: .long 0 @ double 1
1018 ; CHECK-NEXT: .long 1072693248
1019 ; CHECK-NEXT: .long 0 @ double 1
1020 ; CHECK-NEXT: .long 1072693248
1022 %0 = fptoui <2 x double> %src to <2 x i1>
1023 %s = select <2 x i1> %0, <2 x double> <double 1.0, double 1.0>, <2 x double> zeroinitializer
1027 define arm_aapcs_vfpcc <2 x double> @fptosi_v2i1_v2f64(<2 x double> %src) {
1028 ; CHECK-LABEL: fptosi_v2i1_v2f64:
1029 ; CHECK: @ %bb.0: @ %entry
1030 ; CHECK-NEXT: .save {r4, lr}
1031 ; CHECK-NEXT: push {r4, lr}
1032 ; CHECK-NEXT: .vsave {d8, d9, d10, d11}
1033 ; CHECK-NEXT: vpush {d8, d9, d10, d11}
1034 ; CHECK-NEXT: vmov q4, q0
1035 ; CHECK-NEXT: vmov r0, r1, d8
1036 ; CHECK-NEXT: bl __aeabi_d2iz
1037 ; CHECK-NEXT: vmov r2, r1, d9
1038 ; CHECK-NEXT: movs r4, #0
1039 ; CHECK-NEXT: adr r3, .LCPI29_0
1040 ; CHECK-NEXT: bfi r4, r0, #0, #8
1041 ; CHECK-NEXT: vmov.i32 q4, #0x0
1042 ; CHECK-NEXT: vldrw.u32 q5, [r3]
1043 ; CHECK-NEXT: mov r0, r2
1044 ; CHECK-NEXT: bl __aeabi_d2iz
1045 ; CHECK-NEXT: bfi r4, r0, #8, #8
1046 ; CHECK-NEXT: vmsr p0, r4
1047 ; CHECK-NEXT: vpsel q0, q5, q4
1048 ; CHECK-NEXT: vpop {d8, d9, d10, d11}
1049 ; CHECK-NEXT: pop {r4, pc}
1050 ; CHECK-NEXT: .p2align 4
1051 ; CHECK-NEXT: @ %bb.1:
1052 ; CHECK-NEXT: .LCPI29_0:
1053 ; CHECK-NEXT: .long 0 @ double 1
1054 ; CHECK-NEXT: .long 1072693248
1055 ; CHECK-NEXT: .long 0 @ double 1
1056 ; CHECK-NEXT: .long 1072693248
1058 %0 = fptosi <2 x double> %src to <2 x i1>
1059 %s = select <2 x i1> %0, <2 x double> <double 1.0, double 1.0>, <2 x double> zeroinitializer