1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <4 x i32> @sext_v4i1_v4i32(<4 x i32> %src) {
5 ; CHECK-LABEL: sext_v4i1_v4i32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vmov.i32 q1, #0x0
8 ; CHECK-NEXT: vmov.i8 q2, #0xff
9 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
10 ; CHECK-NEXT: vpsel q0, q2, q1
13 %c = icmp sgt <4 x i32> %src, zeroinitializer
14 %0 = sext <4 x i1> %c to <4 x i32>
18 define arm_aapcs_vfpcc <8 x i16> @sext_v8i1_v8i16(<8 x i16> %src) {
19 ; CHECK-LABEL: sext_v8i1_v8i16:
20 ; CHECK: @ %bb.0: @ %entry
21 ; CHECK-NEXT: vmov.i16 q1, #0x0
22 ; CHECK-NEXT: vmov.i8 q2, #0xff
23 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
24 ; CHECK-NEXT: vpsel q0, q2, q1
27 %c = icmp sgt <8 x i16> %src, zeroinitializer
28 %0 = sext <8 x i1> %c to <8 x i16>
32 define arm_aapcs_vfpcc <16 x i8> @sext_v16i1_v16i8(<16 x i8> %src) {
33 ; CHECK-LABEL: sext_v16i1_v16i8:
34 ; CHECK: @ %bb.0: @ %entry
35 ; CHECK-NEXT: vmov.i8 q1, #0x0
36 ; CHECK-NEXT: vmov.i8 q2, #0xff
37 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
38 ; CHECK-NEXT: vpsel q0, q2, q1
41 %c = icmp sgt <16 x i8> %src, zeroinitializer
42 %0 = sext <16 x i1> %c to <16 x i8>
46 define arm_aapcs_vfpcc <2 x i64> @sext_v2i1_v2i64(<2 x i64> %src) {
47 ; CHECK-LABEL: sext_v2i1_v2i64:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: vmov r1, s2
50 ; CHECK-NEXT: movs r2, #0
51 ; CHECK-NEXT: vmov r0, s3
52 ; CHECK-NEXT: vmov r3, s0
53 ; CHECK-NEXT: rsbs r1, r1, #0
54 ; CHECK-NEXT: vmov r1, s1
55 ; CHECK-NEXT: sbcs.w r0, r2, r0
56 ; CHECK-NEXT: mov.w r0, #0
58 ; CHECK-NEXT: movlt r0, #1
59 ; CHECK-NEXT: cmp r0, #0
61 ; CHECK-NEXT: movne.w r0, #-1
62 ; CHECK-NEXT: rsbs r3, r3, #0
63 ; CHECK-NEXT: sbcs.w r1, r2, r1
65 ; CHECK-NEXT: movlt r2, #1
66 ; CHECK-NEXT: cmp r2, #0
68 ; CHECK-NEXT: movne.w r2, #-1
69 ; CHECK-NEXT: vmov.32 q0[0], r2
70 ; CHECK-NEXT: vmov.32 q0[1], r2
71 ; CHECK-NEXT: vmov.32 q0[2], r0
72 ; CHECK-NEXT: vmov.32 q0[3], r0
75 %c = icmp sgt <2 x i64> %src, zeroinitializer
76 %0 = sext <2 x i1> %c to <2 x i64>
81 define arm_aapcs_vfpcc <4 x i32> @zext_v4i1_v4i32(<4 x i32> %src) {
82 ; CHECK-LABEL: zext_v4i1_v4i32:
83 ; CHECK: @ %bb.0: @ %entry
84 ; CHECK-NEXT: vmov.i32 q1, #0x0
85 ; CHECK-NEXT: vmov.i32 q2, #0x1
86 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
87 ; CHECK-NEXT: vpsel q0, q2, q1
90 %c = icmp sgt <4 x i32> %src, zeroinitializer
91 %0 = zext <4 x i1> %c to <4 x i32>
95 define arm_aapcs_vfpcc <8 x i16> @zext_v8i1_v8i16(<8 x i16> %src) {
96 ; CHECK-LABEL: zext_v8i1_v8i16:
97 ; CHECK: @ %bb.0: @ %entry
98 ; CHECK-NEXT: vmov.i16 q1, #0x0
99 ; CHECK-NEXT: vmov.i16 q2, #0x1
100 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
101 ; CHECK-NEXT: vpsel q0, q2, q1
104 %c = icmp sgt <8 x i16> %src, zeroinitializer
105 %0 = zext <8 x i1> %c to <8 x i16>
109 define arm_aapcs_vfpcc <16 x i8> @zext_v16i1_v16i8(<16 x i8> %src) {
110 ; CHECK-LABEL: zext_v16i1_v16i8:
111 ; CHECK: @ %bb.0: @ %entry
112 ; CHECK-NEXT: vmov.i8 q1, #0x0
113 ; CHECK-NEXT: vmov.i8 q2, #0x1
114 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
115 ; CHECK-NEXT: vpsel q0, q2, q1
118 %c = icmp sgt <16 x i8> %src, zeroinitializer
119 %0 = zext <16 x i1> %c to <16 x i8>
123 define arm_aapcs_vfpcc <2 x i64> @zext_v2i1_v2i64(<2 x i64> %src) {
124 ; CHECK-LABEL: zext_v2i1_v2i64:
125 ; CHECK: @ %bb.0: @ %entry
126 ; CHECK-NEXT: vmov r2, s2
127 ; CHECK-NEXT: adr r1, .LCPI7_0
128 ; CHECK-NEXT: vldrw.u32 q1, [r1]
129 ; CHECK-NEXT: vmov r1, s3
130 ; CHECK-NEXT: vmov r3, s0
131 ; CHECK-NEXT: movs r0, #0
132 ; CHECK-NEXT: rsbs r2, r2, #0
133 ; CHECK-NEXT: vmov r2, s1
134 ; CHECK-NEXT: sbcs.w r1, r0, r1
135 ; CHECK-NEXT: mov.w r1, #0
137 ; CHECK-NEXT: movlt r1, #1
138 ; CHECK-NEXT: cmp r1, #0
140 ; CHECK-NEXT: movne.w r1, #-1
141 ; CHECK-NEXT: rsbs r3, r3, #0
142 ; CHECK-NEXT: sbcs.w r2, r0, r2
144 ; CHECK-NEXT: movlt r0, #1
145 ; CHECK-NEXT: cmp r0, #0
147 ; CHECK-NEXT: movne.w r0, #-1
148 ; CHECK-NEXT: vmov.32 q0[0], r0
149 ; CHECK-NEXT: vmov.32 q0[2], r1
150 ; CHECK-NEXT: vand q0, q0, q1
152 ; CHECK-NEXT: .p2align 4
153 ; CHECK-NEXT: @ %bb.1:
154 ; CHECK-NEXT: .LCPI7_0:
155 ; CHECK-NEXT: .long 1 @ 0x1
156 ; CHECK-NEXT: .long 0 @ 0x0
157 ; CHECK-NEXT: .long 1 @ 0x1
158 ; CHECK-NEXT: .long 0 @ 0x0
160 %c = icmp sgt <2 x i64> %src, zeroinitializer
161 %0 = zext <2 x i1> %c to <2 x i64>
166 define arm_aapcs_vfpcc <4 x i32> @trunc_v4i1_v4i32(<4 x i32> %src) {
167 ; CHECK-LABEL: trunc_v4i1_v4i32:
168 ; CHECK: @ %bb.0: @ %entry
169 ; CHECK-NEXT: vmov.i32 q1, #0x0
170 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
171 ; CHECK-NEXT: vpsel q0, q0, q1
174 %0 = trunc <4 x i32> %src to <4 x i1>
175 %1 = select <4 x i1> %0, <4 x i32> %src, <4 x i32> zeroinitializer
179 define arm_aapcs_vfpcc <8 x i16> @trunc_v8i1_v8i16(<8 x i16> %src) {
180 ; CHECK-LABEL: trunc_v8i1_v8i16:
181 ; CHECK: @ %bb.0: @ %entry
182 ; CHECK-NEXT: vmov.i32 q1, #0x0
183 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
184 ; CHECK-NEXT: vpsel q0, q0, q1
187 %0 = trunc <8 x i16> %src to <8 x i1>
188 %1 = select <8 x i1> %0, <8 x i16> %src, <8 x i16> zeroinitializer
192 define arm_aapcs_vfpcc <16 x i8> @trunc_v16i1_v16i8(<16 x i8> %src) {
193 ; CHECK-LABEL: trunc_v16i1_v16i8:
194 ; CHECK: @ %bb.0: @ %entry
195 ; CHECK-NEXT: vmov.i32 q1, #0x0
196 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
197 ; CHECK-NEXT: vpsel q0, q0, q1
200 %0 = trunc <16 x i8> %src to <16 x i1>
201 %1 = select <16 x i1> %0, <16 x i8> %src, <16 x i8> zeroinitializer
205 define arm_aapcs_vfpcc <2 x i64> @trunc_v2i1_v2i64(<2 x i64> %src) {
206 ; CHECK-LABEL: trunc_v2i1_v2i64:
207 ; CHECK: @ %bb.0: @ %entry
208 ; CHECK-NEXT: vmov r1, s0
209 ; CHECK-NEXT: vmov r0, s2
210 ; CHECK-NEXT: and r1, r1, #1
211 ; CHECK-NEXT: rsbs r1, r1, #0
212 ; CHECK-NEXT: and r0, r0, #1
213 ; CHECK-NEXT: vmov.32 q1[0], r1
214 ; CHECK-NEXT: rsbs r0, r0, #0
215 ; CHECK-NEXT: vmov.32 q1[1], r1
216 ; CHECK-NEXT: vmov.32 q1[2], r0
217 ; CHECK-NEXT: vmov.32 q1[3], r0
218 ; CHECK-NEXT: vand q0, q0, q1
221 %0 = trunc <2 x i64> %src to <2 x i1>
222 %1 = select <2 x i1> %0, <2 x i64> %src, <2 x i64> zeroinitializer
227 define arm_aapcs_vfpcc <4 x float> @uitofp_v4i1_v4f32(<4 x i32> %src) {
228 ; CHECK-LABEL: uitofp_v4i1_v4f32:
229 ; CHECK: @ %bb.0: @ %entry
230 ; CHECK-NEXT: vmov.i32 q1, #0x0
231 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
232 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
233 ; CHECK-NEXT: vpsel q0, q2, q1
236 %c = icmp sgt <4 x i32> %src, zeroinitializer
237 %0 = uitofp <4 x i1> %c to <4 x float>
241 define arm_aapcs_vfpcc <4 x float> @sitofp_v4i1_v4f32(<4 x i32> %src) {
242 ; CHECK-LABEL: sitofp_v4i1_v4f32:
243 ; CHECK: @ %bb.0: @ %entry
244 ; CHECK-NEXT: vmov.i32 q1, #0x0
245 ; CHECK-NEXT: vmov.f32 q2, #-1.000000e+00
246 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
247 ; CHECK-NEXT: vpsel q0, q2, q1
250 %c = icmp sgt <4 x i32> %src, zeroinitializer
251 %0 = sitofp <4 x i1> %c to <4 x float>
255 define arm_aapcs_vfpcc <4 x float> @fptoui_v4i1_v4f32(<4 x float> %src) {
256 ; CHECK-LABEL: fptoui_v4i1_v4f32:
257 ; CHECK: @ %bb.0: @ %entry
258 ; CHECK-NEXT: vmov.i32 q1, #0x0
259 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
260 ; CHECK-NEXT: vcmp.f32 ne, q0, zr
261 ; CHECK-NEXT: vpsel q0, q2, q1
264 %0 = fptoui <4 x float> %src to <4 x i1>
265 %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
269 define arm_aapcs_vfpcc <4 x float> @fptosi_v4i1_v4f32(<4 x float> %src) {
270 ; CHECK-LABEL: fptosi_v4i1_v4f32:
271 ; CHECK: @ %bb.0: @ %entry
272 ; CHECK-NEXT: vmov.i32 q1, #0x0
273 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
274 ; CHECK-NEXT: vcmp.f32 ne, q0, zr
275 ; CHECK-NEXT: vpsel q0, q2, q1
278 %0 = fptosi <4 x float> %src to <4 x i1>
279 %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
285 define arm_aapcs_vfpcc <8 x half> @uitofp_v8i1_v8f16(<8 x i16> %src) {
286 ; CHECK-LABEL: uitofp_v8i1_v8f16:
287 ; CHECK: @ %bb.0: @ %entry
288 ; CHECK-NEXT: vmov.i16 q1, #0x0
289 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
290 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
291 ; CHECK-NEXT: vpsel q0, q2, q1
294 %c = icmp sgt <8 x i16> %src, zeroinitializer
295 %0 = uitofp <8 x i1> %c to <8 x half>
299 define arm_aapcs_vfpcc <8 x half> @sitofp_v8i1_v8f16(<8 x i16> %src) {
300 ; CHECK-LABEL: sitofp_v8i1_v8f16:
301 ; CHECK: @ %bb.0: @ %entry
302 ; CHECK-NEXT: vmov.i16 q1, #0x0
303 ; CHECK-NEXT: vmov.i16 q2, #0xbc00
304 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
305 ; CHECK-NEXT: vpsel q0, q2, q1
308 %c = icmp sgt <8 x i16> %src, zeroinitializer
309 %0 = sitofp <8 x i1> %c to <8 x half>
313 define arm_aapcs_vfpcc <8 x half> @fptoui_v8i1_v8f16(<8 x half> %src) {
314 ; CHECK-LABEL: fptoui_v8i1_v8f16:
315 ; CHECK: @ %bb.0: @ %entry
316 ; CHECK-NEXT: vmov.i32 q1, #0x0
317 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
318 ; CHECK-NEXT: vcmp.f16 ne, q0, zr
319 ; CHECK-NEXT: vpsel q0, q2, q1
322 %0 = fptoui <8 x half> %src to <8 x i1>
323 %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
327 define arm_aapcs_vfpcc <8 x half> @fptosi_v8i1_v8f16(<8 x half> %src) {
328 ; CHECK-LABEL: fptosi_v8i1_v8f16:
329 ; CHECK: @ %bb.0: @ %entry
330 ; CHECK-NEXT: vmov.i32 q1, #0x0
331 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
332 ; CHECK-NEXT: vcmp.f16 ne, q0, zr
333 ; CHECK-NEXT: vpsel q0, q2, q1
336 %0 = fptosi <8 x half> %src to <8 x i1>
337 %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