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 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-LE
3 ; RUN: llc -mtriple=thumbebv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-BE
5 define arm_aapcs_vfpcc <4 x i32> @load_v4i1(<4 x i1> *%src, <4 x i32> %a) {
6 ; CHECK-LE-LABEL: load_v4i1:
7 ; CHECK-LE: @ %bb.0: @ %entry
8 ; CHECK-LE-NEXT: ldrb r0, [r0]
9 ; CHECK-LE-NEXT: vmov.i8 q1, #0x0
10 ; CHECK-LE-NEXT: vmov.i8 q2, #0xff
11 ; CHECK-LE-NEXT: vmsr p0, r0
12 ; CHECK-LE-NEXT: vpsel q1, q2, q1
13 ; CHECK-LE-NEXT: vmov.u8 r0, q1[0]
14 ; CHECK-LE-NEXT: vmov.32 q2[0], r0
15 ; CHECK-LE-NEXT: vmov.u8 r0, q1[1]
16 ; CHECK-LE-NEXT: vmov.32 q2[1], r0
17 ; CHECK-LE-NEXT: vmov.u8 r0, q1[2]
18 ; CHECK-LE-NEXT: vmov.32 q2[2], r0
19 ; CHECK-LE-NEXT: vmov.u8 r0, q1[3]
20 ; CHECK-LE-NEXT: vmov.32 q2[3], r0
21 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
22 ; CHECK-LE-NEXT: vcmp.i32 ne, q2, zr
23 ; CHECK-LE-NEXT: vpsel q0, q0, q1
24 ; CHECK-LE-NEXT: bx lr
26 ; CHECK-BE-LABEL: load_v4i1:
27 ; CHECK-BE: @ %bb.0: @ %entry
28 ; CHECK-BE-NEXT: ldrb r0, [r0]
29 ; CHECK-BE-NEXT: vmov.i8 q1, #0x0
30 ; CHECK-BE-NEXT: vmov.i8 q2, #0xff
31 ; CHECK-BE-NEXT: vmsr p0, r0
32 ; CHECK-BE-NEXT: vpsel q1, q2, q1
33 ; CHECK-BE-NEXT: vmov.u8 r0, q1[0]
34 ; CHECK-BE-NEXT: vmov.32 q2[0], r0
35 ; CHECK-BE-NEXT: vmov.u8 r0, q1[1]
36 ; CHECK-BE-NEXT: vmov.32 q2[1], r0
37 ; CHECK-BE-NEXT: vmov.u8 r0, q1[2]
38 ; CHECK-BE-NEXT: vmov.32 q2[2], r0
39 ; CHECK-BE-NEXT: vmov.u8 r0, q1[3]
40 ; CHECK-BE-NEXT: vmov.32 q2[3], r0
41 ; CHECK-BE-NEXT: vrev64.32 q1, q0
42 ; CHECK-BE-NEXT: vcmp.i32 ne, q2, zr
43 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
44 ; CHECK-BE-NEXT: vpsel q1, q1, q0
45 ; CHECK-BE-NEXT: vrev64.32 q0, q1
46 ; CHECK-BE-NEXT: bx lr
48 %c = load <4 x i1>, <4 x i1>* %src
49 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> zeroinitializer
53 define arm_aapcs_vfpcc <8 x i16> @load_v8i1(<8 x i1> *%src, <8 x i16> %a) {
54 ; CHECK-LE-LABEL: load_v8i1:
55 ; CHECK-LE: @ %bb.0: @ %entry
56 ; CHECK-LE-NEXT: ldrb r0, [r0]
57 ; CHECK-LE-NEXT: vmov.i8 q1, #0x0
58 ; CHECK-LE-NEXT: vmov.i8 q2, #0xff
59 ; CHECK-LE-NEXT: vmsr p0, r0
60 ; CHECK-LE-NEXT: vpsel q2, q2, q1
61 ; CHECK-LE-NEXT: vmov.u8 r0, q2[0]
62 ; CHECK-LE-NEXT: vmov.16 q1[0], r0
63 ; CHECK-LE-NEXT: vmov.u8 r0, q2[1]
64 ; CHECK-LE-NEXT: vmov.16 q1[1], r0
65 ; CHECK-LE-NEXT: vmov.u8 r0, q2[2]
66 ; CHECK-LE-NEXT: vmov.16 q1[2], r0
67 ; CHECK-LE-NEXT: vmov.u8 r0, q2[3]
68 ; CHECK-LE-NEXT: vmov.16 q1[3], r0
69 ; CHECK-LE-NEXT: vmov.u8 r0, q2[4]
70 ; CHECK-LE-NEXT: vmov.16 q1[4], r0
71 ; CHECK-LE-NEXT: vmov.u8 r0, q2[5]
72 ; CHECK-LE-NEXT: vmov.16 q1[5], r0
73 ; CHECK-LE-NEXT: vmov.u8 r0, q2[6]
74 ; CHECK-LE-NEXT: vmov.16 q1[6], r0
75 ; CHECK-LE-NEXT: vmov.u8 r0, q2[7]
76 ; CHECK-LE-NEXT: vmov.16 q1[7], r0
77 ; CHECK-LE-NEXT: vcmp.i16 ne, q1, zr
78 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
79 ; CHECK-LE-NEXT: vpsel q0, q0, q1
80 ; CHECK-LE-NEXT: bx lr
82 ; CHECK-BE-LABEL: load_v8i1:
83 ; CHECK-BE: @ %bb.0: @ %entry
84 ; CHECK-BE-NEXT: ldrb r0, [r0]
85 ; CHECK-BE-NEXT: vmov.i8 q1, #0x0
86 ; CHECK-BE-NEXT: vmov.i8 q2, #0xff
87 ; CHECK-BE-NEXT: vmsr p0, r0
88 ; CHECK-BE-NEXT: vpsel q2, q2, q1
89 ; CHECK-BE-NEXT: vmov.u8 r0, q2[0]
90 ; CHECK-BE-NEXT: vmov.16 q1[0], r0
91 ; CHECK-BE-NEXT: vmov.u8 r0, q2[1]
92 ; CHECK-BE-NEXT: vmov.16 q1[1], r0
93 ; CHECK-BE-NEXT: vmov.u8 r0, q2[2]
94 ; CHECK-BE-NEXT: vmov.16 q1[2], r0
95 ; CHECK-BE-NEXT: vmov.u8 r0, q2[3]
96 ; CHECK-BE-NEXT: vmov.16 q1[3], r0
97 ; CHECK-BE-NEXT: vmov.u8 r0, q2[4]
98 ; CHECK-BE-NEXT: vmov.16 q1[4], r0
99 ; CHECK-BE-NEXT: vmov.u8 r0, q2[5]
100 ; CHECK-BE-NEXT: vmov.16 q1[5], r0
101 ; CHECK-BE-NEXT: vmov.u8 r0, q2[6]
102 ; CHECK-BE-NEXT: vmov.16 q1[6], r0
103 ; CHECK-BE-NEXT: vmov.u8 r0, q2[7]
104 ; CHECK-BE-NEXT: vmov.16 q1[7], r0
105 ; CHECK-BE-NEXT: vcmp.i16 ne, q1, zr
106 ; CHECK-BE-NEXT: vrev64.16 q1, q0
107 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
108 ; CHECK-BE-NEXT: vrev32.16 q0, q0
109 ; CHECK-BE-NEXT: vpsel q1, q1, q0
110 ; CHECK-BE-NEXT: vrev64.16 q0, q1
111 ; CHECK-BE-NEXT: bx lr
113 %c = load <8 x i1>, <8 x i1>* %src
114 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> zeroinitializer
118 define arm_aapcs_vfpcc <16 x i8> @load_v16i1(<16 x i1> *%src, <16 x i8> %a) {
119 ; CHECK-LE-LABEL: load_v16i1:
120 ; CHECK-LE: @ %bb.0: @ %entry
121 ; CHECK-LE-NEXT: ldrh r0, [r0]
122 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
123 ; CHECK-LE-NEXT: vmsr p0, r0
124 ; CHECK-LE-NEXT: vpsel q0, q0, q1
125 ; CHECK-LE-NEXT: bx lr
127 ; CHECK-BE-LABEL: load_v16i1:
128 ; CHECK-BE: @ %bb.0: @ %entry
129 ; CHECK-BE-NEXT: ldrh r0, [r0]
130 ; CHECK-BE-NEXT: vrev64.8 q1, q0
131 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
132 ; CHECK-BE-NEXT: vrev32.8 q0, q0
133 ; CHECK-BE-NEXT: vmsr p0, r0
134 ; CHECK-BE-NEXT: vpsel q1, q1, q0
135 ; CHECK-BE-NEXT: vrev64.8 q0, q1
136 ; CHECK-BE-NEXT: bx lr
138 %c = load <16 x i1>, <16 x i1>* %src
139 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> zeroinitializer
143 define arm_aapcs_vfpcc <2 x i64> @load_v2i1(<2 x i1> *%src, <2 x i64> %a) {
144 ; CHECK-LE-LABEL: load_v2i1:
145 ; CHECK-LE: @ %bb.0: @ %entry
146 ; CHECK-LE-NEXT: ldrb r0, [r0]
147 ; CHECK-LE-NEXT: sbfx r1, r0, #0, #1
148 ; CHECK-LE-NEXT: sbfx r0, r0, #1, #1
149 ; CHECK-LE-NEXT: vmov.32 q1[0], r1
150 ; CHECK-LE-NEXT: vmov.32 q1[1], r1
151 ; CHECK-LE-NEXT: vmov.32 q1[2], r0
152 ; CHECK-LE-NEXT: vmov.32 q1[3], r0
153 ; CHECK-LE-NEXT: vand q0, q0, q1
154 ; CHECK-LE-NEXT: bx lr
156 ; CHECK-BE-LABEL: load_v2i1:
157 ; CHECK-BE: @ %bb.0: @ %entry
158 ; CHECK-BE-NEXT: ldrb r0, [r0]
159 ; CHECK-BE-NEXT: sbfx r1, r0, #0, #1
160 ; CHECK-BE-NEXT: sbfx r0, r0, #1, #1
161 ; CHECK-BE-NEXT: vmov.32 q1[0], r1
162 ; CHECK-BE-NEXT: vmov.32 q1[1], r1
163 ; CHECK-BE-NEXT: vmov.32 q1[2], r0
164 ; CHECK-BE-NEXT: vmov.32 q1[3], r0
165 ; CHECK-BE-NEXT: vrev64.32 q2, q1
166 ; CHECK-BE-NEXT: vand q0, q0, q2
167 ; CHECK-BE-NEXT: bx lr
169 %c = load <2 x i1>, <2 x i1>* %src
170 %s = select <2 x i1> %c, <2 x i64> %a, <2 x i64> zeroinitializer
175 define arm_aapcs_vfpcc void @store_v4i1(<4 x i1> *%dst, <4 x i32> %a) {
176 ; CHECK-LE-LABEL: store_v4i1:
177 ; CHECK-LE: @ %bb.0: @ %entry
178 ; CHECK-LE-NEXT: vcmp.i32 eq, q0, zr
179 ; CHECK-LE-NEXT: movs r3, #0
180 ; CHECK-LE-NEXT: vmrs r1, p0
181 ; CHECK-LE-NEXT: and r2, r1, #1
182 ; CHECK-LE-NEXT: rsbs r2, r2, #0
183 ; CHECK-LE-NEXT: bfi r3, r2, #0, #1
184 ; CHECK-LE-NEXT: ubfx r2, r1, #4, #1
185 ; CHECK-LE-NEXT: rsbs r2, r2, #0
186 ; CHECK-LE-NEXT: bfi r3, r2, #1, #1
187 ; CHECK-LE-NEXT: ubfx r2, r1, #8, #1
188 ; CHECK-LE-NEXT: ubfx r1, r1, #12, #1
189 ; CHECK-LE-NEXT: rsbs r2, r2, #0
190 ; CHECK-LE-NEXT: bfi r3, r2, #2, #1
191 ; CHECK-LE-NEXT: rsbs r1, r1, #0
192 ; CHECK-LE-NEXT: bfi r3, r1, #3, #1
193 ; CHECK-LE-NEXT: strb r3, [r0]
194 ; CHECK-LE-NEXT: bx lr
196 ; CHECK-BE-LABEL: store_v4i1:
197 ; CHECK-BE: @ %bb.0: @ %entry
198 ; CHECK-BE-NEXT: vrev64.32 q1, q0
199 ; CHECK-BE-NEXT: movs r3, #0
200 ; CHECK-BE-NEXT: vcmp.i32 eq, q1, zr
201 ; CHECK-BE-NEXT: vmrs r1, p0
202 ; CHECK-BE-NEXT: and r2, r1, #1
203 ; CHECK-BE-NEXT: rsbs r2, r2, #0
204 ; CHECK-BE-NEXT: bfi r3, r2, #0, #1
205 ; CHECK-BE-NEXT: ubfx r2, r1, #4, #1
206 ; CHECK-BE-NEXT: rsbs r2, r2, #0
207 ; CHECK-BE-NEXT: bfi r3, r2, #1, #1
208 ; CHECK-BE-NEXT: ubfx r2, r1, #8, #1
209 ; CHECK-BE-NEXT: ubfx r1, r1, #12, #1
210 ; CHECK-BE-NEXT: rsbs r2, r2, #0
211 ; CHECK-BE-NEXT: bfi r3, r2, #2, #1
212 ; CHECK-BE-NEXT: rsbs r1, r1, #0
213 ; CHECK-BE-NEXT: bfi r3, r1, #3, #1
214 ; CHECK-BE-NEXT: strb r3, [r0]
215 ; CHECK-BE-NEXT: bx lr
217 %c = icmp eq <4 x i32> %a, zeroinitializer
218 store <4 x i1> %c, <4 x i1>* %dst
222 define arm_aapcs_vfpcc void @store_v8i1(<8 x i1> *%dst, <8 x i16> %a) {
223 ; CHECK-LE-LABEL: store_v8i1:
224 ; CHECK-LE: @ %bb.0: @ %entry
225 ; CHECK-LE-NEXT: vcmp.i16 eq, q0, zr
226 ; CHECK-LE-NEXT: vmrs r2, p0
227 ; CHECK-LE-NEXT: and r1, r2, #1
228 ; CHECK-LE-NEXT: rsbs r3, r1, #0
229 ; CHECK-LE-NEXT: movs r1, #0
230 ; CHECK-LE-NEXT: bfi r1, r3, #0, #1
231 ; CHECK-LE-NEXT: ubfx r3, r2, #2, #1
232 ; CHECK-LE-NEXT: rsbs r3, r3, #0
233 ; CHECK-LE-NEXT: bfi r1, r3, #1, #1
234 ; CHECK-LE-NEXT: ubfx r3, r2, #4, #1
235 ; CHECK-LE-NEXT: rsbs r3, r3, #0
236 ; CHECK-LE-NEXT: bfi r1, r3, #2, #1
237 ; CHECK-LE-NEXT: ubfx r3, r2, #6, #1
238 ; CHECK-LE-NEXT: rsbs r3, r3, #0
239 ; CHECK-LE-NEXT: bfi r1, r3, #3, #1
240 ; CHECK-LE-NEXT: ubfx r3, r2, #8, #1
241 ; CHECK-LE-NEXT: rsbs r3, r3, #0
242 ; CHECK-LE-NEXT: bfi r1, r3, #4, #1
243 ; CHECK-LE-NEXT: ubfx r3, r2, #10, #1
244 ; CHECK-LE-NEXT: rsbs r3, r3, #0
245 ; CHECK-LE-NEXT: bfi r1, r3, #5, #1
246 ; CHECK-LE-NEXT: ubfx r3, r2, #12, #1
247 ; CHECK-LE-NEXT: ubfx r2, r2, #14, #1
248 ; CHECK-LE-NEXT: rsbs r3, r3, #0
249 ; CHECK-LE-NEXT: bfi r1, r3, #6, #1
250 ; CHECK-LE-NEXT: rsbs r2, r2, #0
251 ; CHECK-LE-NEXT: bfi r1, r2, #7, #1
252 ; CHECK-LE-NEXT: strb r1, [r0]
253 ; CHECK-LE-NEXT: bx lr
255 ; CHECK-BE-LABEL: store_v8i1:
256 ; CHECK-BE: @ %bb.0: @ %entry
257 ; CHECK-BE-NEXT: vrev64.16 q1, q0
258 ; CHECK-BE-NEXT: vcmp.i16 eq, q1, zr
259 ; CHECK-BE-NEXT: vmrs r2, p0
260 ; CHECK-BE-NEXT: and r1, r2, #1
261 ; CHECK-BE-NEXT: rsbs r3, r1, #0
262 ; CHECK-BE-NEXT: movs r1, #0
263 ; CHECK-BE-NEXT: bfi r1, r3, #0, #1
264 ; CHECK-BE-NEXT: ubfx r3, r2, #2, #1
265 ; CHECK-BE-NEXT: rsbs r3, r3, #0
266 ; CHECK-BE-NEXT: bfi r1, r3, #1, #1
267 ; CHECK-BE-NEXT: ubfx r3, r2, #4, #1
268 ; CHECK-BE-NEXT: rsbs r3, r3, #0
269 ; CHECK-BE-NEXT: bfi r1, r3, #2, #1
270 ; CHECK-BE-NEXT: ubfx r3, r2, #6, #1
271 ; CHECK-BE-NEXT: rsbs r3, r3, #0
272 ; CHECK-BE-NEXT: bfi r1, r3, #3, #1
273 ; CHECK-BE-NEXT: ubfx r3, r2, #8, #1
274 ; CHECK-BE-NEXT: rsbs r3, r3, #0
275 ; CHECK-BE-NEXT: bfi r1, r3, #4, #1
276 ; CHECK-BE-NEXT: ubfx r3, r2, #10, #1
277 ; CHECK-BE-NEXT: rsbs r3, r3, #0
278 ; CHECK-BE-NEXT: bfi r1, r3, #5, #1
279 ; CHECK-BE-NEXT: ubfx r3, r2, #12, #1
280 ; CHECK-BE-NEXT: ubfx r2, r2, #14, #1
281 ; CHECK-BE-NEXT: rsbs r3, r3, #0
282 ; CHECK-BE-NEXT: bfi r1, r3, #6, #1
283 ; CHECK-BE-NEXT: rsbs r2, r2, #0
284 ; CHECK-BE-NEXT: bfi r1, r2, #7, #1
285 ; CHECK-BE-NEXT: strb r1, [r0]
286 ; CHECK-BE-NEXT: bx lr
288 %c = icmp eq <8 x i16> %a, zeroinitializer
289 store <8 x i1> %c, <8 x i1>* %dst
293 define arm_aapcs_vfpcc void @store_v16i1(<16 x i1> *%dst, <16 x i8> %a) {
294 ; CHECK-LE-LABEL: store_v16i1:
295 ; CHECK-LE: @ %bb.0: @ %entry
296 ; CHECK-LE-NEXT: vcmp.i8 eq, q0, zr
297 ; CHECK-LE-NEXT: vmrs r1, p0
298 ; CHECK-LE-NEXT: strh r1, [r0]
299 ; CHECK-LE-NEXT: bx lr
301 ; CHECK-BE-LABEL: store_v16i1:
302 ; CHECK-BE: @ %bb.0: @ %entry
303 ; CHECK-BE-NEXT: vrev64.8 q1, q0
304 ; CHECK-BE-NEXT: vcmp.i8 eq, q1, zr
305 ; CHECK-BE-NEXT: vmrs r1, p0
306 ; CHECK-BE-NEXT: strh r1, [r0]
307 ; CHECK-BE-NEXT: bx lr
309 %c = icmp eq <16 x i8> %a, zeroinitializer
310 store <16 x i1> %c, <16 x i1>* %dst
314 define arm_aapcs_vfpcc void @store_v2i1(<2 x i1> *%dst, <2 x i64> %a) {
315 ; CHECK-LE-LABEL: store_v2i1:
316 ; CHECK-LE: @ %bb.0: @ %entry
317 ; CHECK-LE-NEXT: vmov r1, s1
318 ; CHECK-LE-NEXT: vmov r2, s0
319 ; CHECK-LE-NEXT: vmov r3, s2
320 ; CHECK-LE-NEXT: orrs r1, r2
321 ; CHECK-LE-NEXT: vmov r2, s3
322 ; CHECK-LE-NEXT: cset r1, eq
323 ; CHECK-LE-NEXT: orrs r2, r3
324 ; CHECK-LE-NEXT: cset r2, eq
325 ; CHECK-LE-NEXT: ands r2, r2, #1
326 ; CHECK-LE-NEXT: it ne
327 ; CHECK-LE-NEXT: mvnne r2, #1
328 ; CHECK-LE-NEXT: bfi r2, r1, #0, #1
329 ; CHECK-LE-NEXT: and r1, r2, #3
330 ; CHECK-LE-NEXT: strb r1, [r0]
331 ; CHECK-LE-NEXT: bx lr
333 ; CHECK-BE-LABEL: store_v2i1:
334 ; CHECK-BE: @ %bb.0: @ %entry
335 ; CHECK-BE-NEXT: vrev64.32 q1, q0
336 ; CHECK-BE-NEXT: vmov r1, s6
337 ; CHECK-BE-NEXT: vmov r2, s7
338 ; CHECK-BE-NEXT: vmov r3, s5
339 ; CHECK-BE-NEXT: orrs r1, r2
340 ; CHECK-BE-NEXT: vmov r2, s4
341 ; CHECK-BE-NEXT: cset r1, eq
342 ; CHECK-BE-NEXT: orrs r2, r3
343 ; CHECK-BE-NEXT: cset r2, eq
344 ; CHECK-BE-NEXT: ands r2, r2, #1
345 ; CHECK-BE-NEXT: it ne
346 ; CHECK-BE-NEXT: mvnne r2, #1
347 ; CHECK-BE-NEXT: bfi r2, r1, #0, #1
348 ; CHECK-BE-NEXT: and r1, r2, #3
349 ; CHECK-BE-NEXT: strb r1, [r0]
350 ; CHECK-BE-NEXT: bx lr
352 %c = icmp eq <2 x i64> %a, zeroinitializer
353 store <2 x i1> %c, <2 x i1>* %dst