1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
11 define <4 x i8> @srem_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
12 ; CHECK-LABEL: srem_v4i8:
14 ; CHECK-NEXT: ptrue p0.h, vl4
15 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
16 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
17 ; CHECK-NEXT: ptrue p1.s, vl4
18 ; CHECK-NEXT: sxtb z0.h, p0/m, z0.h
19 ; CHECK-NEXT: sxtb z1.h, p0/m, z1.h
20 ; CHECK-NEXT: sunpklo z2.s, z1.h
21 ; CHECK-NEXT: sunpklo z3.s, z0.h
22 ; CHECK-NEXT: sdivr z2.s, p1/m, z2.s, z3.s
23 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
24 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
25 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
27 %res = srem <4 x i8> %op1, %op2
31 define <8 x i8> @srem_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
32 ; CHECK-LABEL: srem_v8i8:
34 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
35 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
36 ; CHECK-NEXT: sunpklo z2.h, z1.b
37 ; CHECK-NEXT: sunpklo z3.h, z0.b
38 ; CHECK-NEXT: ptrue p0.s, vl4
39 ; CHECK-NEXT: sunpklo z4.s, z2.h
40 ; CHECK-NEXT: sunpklo z5.s, z3.h
41 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
42 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
43 ; CHECK-NEXT: sunpklo z2.s, z2.h
44 ; CHECK-NEXT: sunpklo z3.s, z3.h
45 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
46 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
47 ; CHECK-NEXT: ptrue p0.h, vl4
48 ; CHECK-NEXT: uzp1 z3.h, z4.h, z4.h
49 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
50 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
51 ; CHECK-NEXT: ptrue p0.b, vl8
52 ; CHECK-NEXT: uzp1 z2.b, z3.b, z3.b
53 ; CHECK-NEXT: mls z0.b, p0/m, z2.b, z1.b
54 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
56 %res = srem <8 x i8> %op1, %op2
60 define <16 x i8> @srem_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
61 ; CHECK-LABEL: srem_v16i8:
63 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
64 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
65 ; CHECK-NEXT: mov z2.d, z1.d
66 ; CHECK-NEXT: mov z3.d, z0.d
67 ; CHECK-NEXT: ptrue p0.s, vl4
68 ; CHECK-NEXT: ptrue p1.b, vl16
69 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
70 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
71 ; CHECK-NEXT: sunpklo z2.h, z2.b
72 ; CHECK-NEXT: sunpklo z3.h, z3.b
73 ; CHECK-NEXT: sunpklo z4.s, z2.h
74 ; CHECK-NEXT: sunpklo z5.s, z3.h
75 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
76 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
77 ; CHECK-NEXT: sunpklo z2.s, z2.h
78 ; CHECK-NEXT: sunpklo z3.s, z3.h
79 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
80 ; CHECK-NEXT: sunpklo z5.h, z0.b
81 ; CHECK-NEXT: sunpklo z7.s, z5.h
82 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
83 ; CHECK-NEXT: sunpklo z5.s, z5.h
84 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
85 ; CHECK-NEXT: sunpklo z3.h, z1.b
86 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
87 ; CHECK-NEXT: sunpklo z6.s, z3.h
88 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
89 ; CHECK-NEXT: sunpklo z3.s, z3.h
90 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z7.s
91 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
92 ; CHECK-NEXT: sdivr z3.s, p0/m, z3.s, z5.s
93 ; CHECK-NEXT: ptrue p0.h, vl4
94 ; CHECK-NEXT: uzp1 z5.h, z6.h, z6.h
95 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
96 ; CHECK-NEXT: uzp1 z2.b, z4.b, z4.b
97 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
98 ; CHECK-NEXT: splice z5.h, p0, z5.h, z3.h
99 ; CHECK-NEXT: ptrue p0.b, vl8
100 ; CHECK-NEXT: uzp1 z3.b, z5.b, z5.b
101 ; CHECK-NEXT: splice z3.b, p0, z3.b, z2.b
102 ; CHECK-NEXT: mls z0.b, p1/m, z3.b, z1.b
103 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
105 %res = srem <16 x i8> %op1, %op2
109 define void @srem_v32i8(ptr %a, ptr %b) {
110 ; CHECK-LABEL: srem_v32i8:
112 ; CHECK-NEXT: ldr q0, [x0, #16]
113 ; CHECK-NEXT: ldr q1, [x1, #16]
114 ; CHECK-NEXT: ptrue p0.s, vl4
115 ; CHECK-NEXT: ptrue p1.b, vl16
116 ; CHECK-NEXT: mov z2.d, z1.d
117 ; CHECK-NEXT: mov z3.d, z0.d
118 ; CHECK-NEXT: sunpklo z7.h, z1.b
119 ; CHECK-NEXT: sunpklo z16.h, z0.b
120 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
121 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
122 ; CHECK-NEXT: sunpklo z6.s, z7.h
123 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
124 ; CHECK-NEXT: sunpklo z17.s, z16.h
125 ; CHECK-NEXT: ext z16.b, z16.b, z16.b, #8
126 ; CHECK-NEXT: sunpklo z4.h, z2.b
127 ; CHECK-NEXT: sunpklo z3.h, z3.b
128 ; CHECK-NEXT: sunpklo z7.s, z7.h
129 ; CHECK-NEXT: sunpklo z16.s, z16.h
130 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z17.s
131 ; CHECK-NEXT: sunpklo z2.s, z4.h
132 ; CHECK-NEXT: sunpklo z5.s, z3.h
133 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
134 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
135 ; CHECK-NEXT: sunpklo z4.s, z4.h
136 ; CHECK-NEXT: sunpklo z3.s, z3.h
137 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z5.s
138 ; CHECK-NEXT: movprfx z5, z3
139 ; CHECK-NEXT: sdiv z5.s, p0/m, z5.s, z4.s
140 ; CHECK-NEXT: ldr q3, [x0]
141 ; CHECK-NEXT: ldr q4, [x1]
142 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
143 ; CHECK-NEXT: mov z18.d, z3.d
144 ; CHECK-NEXT: mov z17.d, z4.d
145 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
146 ; CHECK-NEXT: ext z18.b, z18.b, z3.b, #8
147 ; CHECK-NEXT: ext z17.b, z17.b, z4.b, #8
148 ; CHECK-NEXT: sunpklo z18.h, z18.b
149 ; CHECK-NEXT: sunpklo z17.h, z17.b
150 ; CHECK-NEXT: sunpklo z20.s, z18.h
151 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
152 ; CHECK-NEXT: sunpklo z19.s, z17.h
153 ; CHECK-NEXT: ext z17.b, z17.b, z17.b, #8
154 ; CHECK-NEXT: sdivr z7.s, p0/m, z7.s, z16.s
155 ; CHECK-NEXT: sunpklo z18.s, z18.h
156 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
157 ; CHECK-NEXT: sunpklo z17.s, z17.h
158 ; CHECK-NEXT: sdivr z19.s, p0/m, z19.s, z20.s
159 ; CHECK-NEXT: sunpklo z20.h, z3.b
160 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
161 ; CHECK-NEXT: sunpklo z22.s, z20.h
162 ; CHECK-NEXT: ext z20.b, z20.b, z20.b, #8
163 ; CHECK-NEXT: sunpklo z20.s, z20.h
164 ; CHECK-NEXT: sdivr z17.s, p0/m, z17.s, z18.s
165 ; CHECK-NEXT: sunpklo z18.h, z4.b
166 ; CHECK-NEXT: uzp1 z16.h, z19.h, z19.h
167 ; CHECK-NEXT: sunpklo z21.s, z18.h
168 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
169 ; CHECK-NEXT: sunpklo z18.s, z18.h
170 ; CHECK-NEXT: sdivr z21.s, p0/m, z21.s, z22.s
171 ; CHECK-NEXT: uzp1 z17.h, z17.h, z17.h
172 ; CHECK-NEXT: sdivr z18.s, p0/m, z18.s, z20.s
173 ; CHECK-NEXT: ptrue p0.h, vl4
174 ; CHECK-NEXT: uzp1 z19.h, z21.h, z21.h
175 ; CHECK-NEXT: splice z2.h, p0, z2.h, z5.h
176 ; CHECK-NEXT: splice z6.h, p0, z6.h, z7.h
177 ; CHECK-NEXT: splice z16.h, p0, z16.h, z17.h
178 ; CHECK-NEXT: uzp1 z2.b, z2.b, z2.b
179 ; CHECK-NEXT: uzp1 z6.b, z6.b, z6.b
180 ; CHECK-NEXT: uzp1 z5.b, z16.b, z16.b
181 ; CHECK-NEXT: uzp1 z18.h, z18.h, z18.h
182 ; CHECK-NEXT: splice z19.h, p0, z19.h, z18.h
183 ; CHECK-NEXT: ptrue p0.b, vl8
184 ; CHECK-NEXT: uzp1 z7.b, z19.b, z19.b
185 ; CHECK-NEXT: splice z6.b, p0, z6.b, z2.b
186 ; CHECK-NEXT: splice z7.b, p0, z7.b, z5.b
187 ; CHECK-NEXT: movprfx z2, z3
188 ; CHECK-NEXT: mls z2.b, p1/m, z7.b, z4.b
189 ; CHECK-NEXT: mls z0.b, p1/m, z6.b, z1.b
190 ; CHECK-NEXT: stp q2, q0, [x0]
192 %op1 = load <32 x i8>, ptr %a
193 %op2 = load <32 x i8>, ptr %b
194 %res = srem <32 x i8> %op1, %op2
195 store <32 x i8> %res, ptr %a
199 define <4 x i16> @srem_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
200 ; CHECK-LABEL: srem_v4i16:
202 ; CHECK-NEXT: ptrue p0.s, vl4
203 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
204 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
205 ; CHECK-NEXT: sunpklo z2.s, z1.h
206 ; CHECK-NEXT: sunpklo z3.s, z0.h
207 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
208 ; CHECK-NEXT: ptrue p0.h, vl4
209 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
210 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
211 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
213 %res = srem <4 x i16> %op1, %op2
217 define <8 x i16> @srem_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
218 ; CHECK-LABEL: srem_v8i16:
220 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
221 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
222 ; CHECK-NEXT: mov z2.d, z1.d
223 ; CHECK-NEXT: mov z3.d, z0.d
224 ; CHECK-NEXT: ptrue p0.s, vl4
225 ; CHECK-NEXT: sunpklo z4.s, z0.h
226 ; CHECK-NEXT: ptrue p1.h, vl8
227 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
228 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
229 ; CHECK-NEXT: sunpklo z2.s, z2.h
230 ; CHECK-NEXT: sunpklo z3.s, z3.h
231 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
232 ; CHECK-NEXT: sunpklo z3.s, z1.h
233 ; CHECK-NEXT: sdivr z3.s, p0/m, z3.s, z4.s
234 ; CHECK-NEXT: ptrue p0.h, vl4
235 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
236 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
237 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
238 ; CHECK-NEXT: mls z0.h, p1/m, z3.h, z1.h
239 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
241 %res = srem <8 x i16> %op1, %op2
245 define void @srem_v16i16(ptr %a, ptr %b) {
246 ; CHECK-LABEL: srem_v16i16:
248 ; CHECK-NEXT: ldp q4, q1, [x1]
249 ; CHECK-NEXT: ptrue p0.s, vl4
250 ; CHECK-NEXT: ldr q0, [x0, #16]
251 ; CHECK-NEXT: ptrue p1.h, vl8
252 ; CHECK-NEXT: mov z2.d, z1.d
253 ; CHECK-NEXT: mov z3.d, z0.d
254 ; CHECK-NEXT: mov z5.d, z4.d
255 ; CHECK-NEXT: sunpklo z16.s, z0.h
256 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
257 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
258 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
259 ; CHECK-NEXT: sunpklo z2.s, z2.h
260 ; CHECK-NEXT: sunpklo z3.s, z3.h
261 ; CHECK-NEXT: sunpklo z5.s, z5.h
262 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
263 ; CHECK-NEXT: ldr q3, [x0]
264 ; CHECK-NEXT: mov z6.d, z3.d
265 ; CHECK-NEXT: sunpklo z7.s, z3.h
266 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
267 ; CHECK-NEXT: sunpklo z6.s, z6.h
268 ; CHECK-NEXT: sdivr z5.s, p0/m, z5.s, z6.s
269 ; CHECK-NEXT: sunpklo z6.s, z4.h
270 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
271 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z7.s
272 ; CHECK-NEXT: sunpklo z7.s, z1.h
273 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
274 ; CHECK-NEXT: sdivr z7.s, p0/m, z7.s, z16.s
275 ; CHECK-NEXT: ptrue p0.h, vl4
276 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
277 ; CHECK-NEXT: splice z6.h, p0, z6.h, z5.h
278 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
279 ; CHECK-NEXT: splice z7.h, p0, z7.h, z2.h
280 ; CHECK-NEXT: movprfx z2, z3
281 ; CHECK-NEXT: mls z2.h, p1/m, z6.h, z4.h
282 ; CHECK-NEXT: mls z0.h, p1/m, z7.h, z1.h
283 ; CHECK-NEXT: stp q2, q0, [x0]
285 %op1 = load <16 x i16>, ptr %a
286 %op2 = load <16 x i16>, ptr %b
287 %res = srem <16 x i16> %op1, %op2
288 store <16 x i16> %res, ptr %a
292 define <2 x i32> @srem_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
293 ; CHECK-LABEL: srem_v2i32:
295 ; CHECK-NEXT: ptrue p0.s, vl2
296 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
297 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
298 ; CHECK-NEXT: movprfx z2, z0
299 ; CHECK-NEXT: sdiv z2.s, p0/m, z2.s, z1.s
300 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
301 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
303 %res = srem <2 x i32> %op1, %op2
307 define <4 x i32> @srem_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
308 ; CHECK-LABEL: srem_v4i32:
310 ; CHECK-NEXT: ptrue p0.s, vl4
311 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
312 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
313 ; CHECK-NEXT: movprfx z2, z0
314 ; CHECK-NEXT: sdiv z2.s, p0/m, z2.s, z1.s
315 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
316 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
318 %res = srem <4 x i32> %op1, %op2
322 define void @srem_v8i32(ptr %a, ptr %b) {
323 ; CHECK-LABEL: srem_v8i32:
325 ; CHECK-NEXT: ptrue p0.s, vl4
326 ; CHECK-NEXT: ldp q0, q3, [x1]
327 ; CHECK-NEXT: ldp q1, q2, [x0]
328 ; CHECK-NEXT: movprfx z4, z1
329 ; CHECK-NEXT: sdiv z4.s, p0/m, z4.s, z0.s
330 ; CHECK-NEXT: movprfx z5, z2
331 ; CHECK-NEXT: sdiv z5.s, p0/m, z5.s, z3.s
332 ; CHECK-NEXT: msb z0.s, p0/m, z4.s, z1.s
333 ; CHECK-NEXT: movprfx z1, z2
334 ; CHECK-NEXT: mls z1.s, p0/m, z5.s, z3.s
335 ; CHECK-NEXT: stp q0, q1, [x0]
337 %op1 = load <8 x i32>, ptr %a
338 %op2 = load <8 x i32>, ptr %b
339 %res = srem <8 x i32> %op1, %op2
340 store <8 x i32> %res, ptr %a
344 define <1 x i64> @srem_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
345 ; CHECK-LABEL: srem_v1i64:
347 ; CHECK-NEXT: ptrue p0.d, vl1
348 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
349 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
350 ; CHECK-NEXT: movprfx z2, z0
351 ; CHECK-NEXT: sdiv z2.d, p0/m, z2.d, z1.d
352 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
353 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
355 %res = srem <1 x i64> %op1, %op2
359 define <2 x i64> @srem_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
360 ; CHECK-LABEL: srem_v2i64:
362 ; CHECK-NEXT: ptrue p0.d, vl2
363 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
364 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
365 ; CHECK-NEXT: movprfx z2, z0
366 ; CHECK-NEXT: sdiv z2.d, p0/m, z2.d, z1.d
367 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
368 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
370 %res = srem <2 x i64> %op1, %op2
374 define void @srem_v4i64(ptr %a, ptr %b) {
375 ; CHECK-LABEL: srem_v4i64:
377 ; CHECK-NEXT: ptrue p0.d, vl2
378 ; CHECK-NEXT: ldp q0, q3, [x1]
379 ; CHECK-NEXT: ldp q1, q2, [x0]
380 ; CHECK-NEXT: movprfx z4, z1
381 ; CHECK-NEXT: sdiv z4.d, p0/m, z4.d, z0.d
382 ; CHECK-NEXT: movprfx z5, z2
383 ; CHECK-NEXT: sdiv z5.d, p0/m, z5.d, z3.d
384 ; CHECK-NEXT: msb z0.d, p0/m, z4.d, z1.d
385 ; CHECK-NEXT: movprfx z1, z2
386 ; CHECK-NEXT: mls z1.d, p0/m, z5.d, z3.d
387 ; CHECK-NEXT: stp q0, q1, [x0]
389 %op1 = load <4 x i64>, ptr %a
390 %op2 = load <4 x i64>, ptr %b
391 %res = srem <4 x i64> %op1, %op2
392 store <4 x i64> %res, ptr %a
400 define <4 x i8> @urem_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
401 ; CHECK-LABEL: urem_v4i8:
403 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
404 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
405 ; CHECK-NEXT: ptrue p0.s, vl4
406 ; CHECK-NEXT: and z0.h, z0.h, #0xff
407 ; CHECK-NEXT: and z1.h, z1.h, #0xff
408 ; CHECK-NEXT: uunpklo z2.s, z1.h
409 ; CHECK-NEXT: uunpklo z3.s, z0.h
410 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
411 ; CHECK-NEXT: ptrue p0.h, vl4
412 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
413 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
414 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
416 %res = urem <4 x i8> %op1, %op2
420 define <8 x i8> @urem_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
421 ; CHECK-LABEL: urem_v8i8:
423 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
424 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
425 ; CHECK-NEXT: uunpklo z2.h, z1.b
426 ; CHECK-NEXT: uunpklo z3.h, z0.b
427 ; CHECK-NEXT: ptrue p0.s, vl4
428 ; CHECK-NEXT: uunpklo z4.s, z2.h
429 ; CHECK-NEXT: uunpklo z5.s, z3.h
430 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
431 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
432 ; CHECK-NEXT: uunpklo z2.s, z2.h
433 ; CHECK-NEXT: uunpklo z3.s, z3.h
434 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
435 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
436 ; CHECK-NEXT: ptrue p0.h, vl4
437 ; CHECK-NEXT: uzp1 z3.h, z4.h, z4.h
438 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
439 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
440 ; CHECK-NEXT: ptrue p0.b, vl8
441 ; CHECK-NEXT: uzp1 z2.b, z3.b, z3.b
442 ; CHECK-NEXT: mls z0.b, p0/m, z2.b, z1.b
443 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
445 %res = urem <8 x i8> %op1, %op2
449 define <16 x i8> @urem_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
450 ; CHECK-LABEL: urem_v16i8:
452 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
453 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
454 ; CHECK-NEXT: mov z2.d, z1.d
455 ; CHECK-NEXT: mov z3.d, z0.d
456 ; CHECK-NEXT: ptrue p0.s, vl4
457 ; CHECK-NEXT: ptrue p1.b, vl16
458 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
459 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
460 ; CHECK-NEXT: uunpklo z2.h, z2.b
461 ; CHECK-NEXT: uunpklo z3.h, z3.b
462 ; CHECK-NEXT: uunpklo z4.s, z2.h
463 ; CHECK-NEXT: uunpklo z5.s, z3.h
464 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
465 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
466 ; CHECK-NEXT: uunpklo z2.s, z2.h
467 ; CHECK-NEXT: uunpklo z3.s, z3.h
468 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
469 ; CHECK-NEXT: uunpklo z5.h, z0.b
470 ; CHECK-NEXT: uunpklo z7.s, z5.h
471 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
472 ; CHECK-NEXT: uunpklo z5.s, z5.h
473 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
474 ; CHECK-NEXT: uunpklo z3.h, z1.b
475 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
476 ; CHECK-NEXT: uunpklo z6.s, z3.h
477 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
478 ; CHECK-NEXT: uunpklo z3.s, z3.h
479 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z7.s
480 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
481 ; CHECK-NEXT: udivr z3.s, p0/m, z3.s, z5.s
482 ; CHECK-NEXT: ptrue p0.h, vl4
483 ; CHECK-NEXT: uzp1 z5.h, z6.h, z6.h
484 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
485 ; CHECK-NEXT: uzp1 z2.b, z4.b, z4.b
486 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
487 ; CHECK-NEXT: splice z5.h, p0, z5.h, z3.h
488 ; CHECK-NEXT: ptrue p0.b, vl8
489 ; CHECK-NEXT: uzp1 z3.b, z5.b, z5.b
490 ; CHECK-NEXT: splice z3.b, p0, z3.b, z2.b
491 ; CHECK-NEXT: mls z0.b, p1/m, z3.b, z1.b
492 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
494 %res = urem <16 x i8> %op1, %op2
498 define void @urem_v32i8(ptr %a, ptr %b) {
499 ; CHECK-LABEL: urem_v32i8:
501 ; CHECK-NEXT: ldr q0, [x0, #16]
502 ; CHECK-NEXT: ldr q1, [x1, #16]
503 ; CHECK-NEXT: ptrue p0.s, vl4
504 ; CHECK-NEXT: ptrue p1.b, vl16
505 ; CHECK-NEXT: mov z2.d, z1.d
506 ; CHECK-NEXT: mov z3.d, z0.d
507 ; CHECK-NEXT: uunpklo z7.h, z1.b
508 ; CHECK-NEXT: uunpklo z16.h, z0.b
509 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
510 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
511 ; CHECK-NEXT: uunpklo z6.s, z7.h
512 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
513 ; CHECK-NEXT: uunpklo z17.s, z16.h
514 ; CHECK-NEXT: ext z16.b, z16.b, z16.b, #8
515 ; CHECK-NEXT: uunpklo z4.h, z2.b
516 ; CHECK-NEXT: uunpklo z3.h, z3.b
517 ; CHECK-NEXT: uunpklo z7.s, z7.h
518 ; CHECK-NEXT: uunpklo z16.s, z16.h
519 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z17.s
520 ; CHECK-NEXT: uunpklo z2.s, z4.h
521 ; CHECK-NEXT: uunpklo z5.s, z3.h
522 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
523 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
524 ; CHECK-NEXT: uunpklo z4.s, z4.h
525 ; CHECK-NEXT: uunpklo z3.s, z3.h
526 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z5.s
527 ; CHECK-NEXT: movprfx z5, z3
528 ; CHECK-NEXT: udiv z5.s, p0/m, z5.s, z4.s
529 ; CHECK-NEXT: ldr q3, [x0]
530 ; CHECK-NEXT: ldr q4, [x1]
531 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
532 ; CHECK-NEXT: mov z18.d, z3.d
533 ; CHECK-NEXT: mov z17.d, z4.d
534 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
535 ; CHECK-NEXT: ext z18.b, z18.b, z3.b, #8
536 ; CHECK-NEXT: ext z17.b, z17.b, z4.b, #8
537 ; CHECK-NEXT: uunpklo z18.h, z18.b
538 ; CHECK-NEXT: uunpklo z17.h, z17.b
539 ; CHECK-NEXT: uunpklo z20.s, z18.h
540 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
541 ; CHECK-NEXT: uunpklo z19.s, z17.h
542 ; CHECK-NEXT: ext z17.b, z17.b, z17.b, #8
543 ; CHECK-NEXT: udivr z7.s, p0/m, z7.s, z16.s
544 ; CHECK-NEXT: uunpklo z18.s, z18.h
545 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
546 ; CHECK-NEXT: uunpklo z17.s, z17.h
547 ; CHECK-NEXT: udivr z19.s, p0/m, z19.s, z20.s
548 ; CHECK-NEXT: uunpklo z20.h, z3.b
549 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
550 ; CHECK-NEXT: uunpklo z22.s, z20.h
551 ; CHECK-NEXT: ext z20.b, z20.b, z20.b, #8
552 ; CHECK-NEXT: uunpklo z20.s, z20.h
553 ; CHECK-NEXT: udivr z17.s, p0/m, z17.s, z18.s
554 ; CHECK-NEXT: uunpklo z18.h, z4.b
555 ; CHECK-NEXT: uzp1 z16.h, z19.h, z19.h
556 ; CHECK-NEXT: uunpklo z21.s, z18.h
557 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
558 ; CHECK-NEXT: uunpklo z18.s, z18.h
559 ; CHECK-NEXT: udivr z21.s, p0/m, z21.s, z22.s
560 ; CHECK-NEXT: uzp1 z17.h, z17.h, z17.h
561 ; CHECK-NEXT: udivr z18.s, p0/m, z18.s, z20.s
562 ; CHECK-NEXT: ptrue p0.h, vl4
563 ; CHECK-NEXT: uzp1 z19.h, z21.h, z21.h
564 ; CHECK-NEXT: splice z2.h, p0, z2.h, z5.h
565 ; CHECK-NEXT: splice z6.h, p0, z6.h, z7.h
566 ; CHECK-NEXT: splice z16.h, p0, z16.h, z17.h
567 ; CHECK-NEXT: uzp1 z2.b, z2.b, z2.b
568 ; CHECK-NEXT: uzp1 z6.b, z6.b, z6.b
569 ; CHECK-NEXT: uzp1 z5.b, z16.b, z16.b
570 ; CHECK-NEXT: uzp1 z18.h, z18.h, z18.h
571 ; CHECK-NEXT: splice z19.h, p0, z19.h, z18.h
572 ; CHECK-NEXT: ptrue p0.b, vl8
573 ; CHECK-NEXT: uzp1 z7.b, z19.b, z19.b
574 ; CHECK-NEXT: splice z6.b, p0, z6.b, z2.b
575 ; CHECK-NEXT: splice z7.b, p0, z7.b, z5.b
576 ; CHECK-NEXT: movprfx z2, z3
577 ; CHECK-NEXT: mls z2.b, p1/m, z7.b, z4.b
578 ; CHECK-NEXT: mls z0.b, p1/m, z6.b, z1.b
579 ; CHECK-NEXT: stp q2, q0, [x0]
581 %op1 = load <32 x i8>, ptr %a
582 %op2 = load <32 x i8>, ptr %b
583 %res = urem <32 x i8> %op1, %op2
584 store <32 x i8> %res, ptr %a
588 define <4 x i16> @urem_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
589 ; CHECK-LABEL: urem_v4i16:
591 ; CHECK-NEXT: ptrue p0.s, vl4
592 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
593 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
594 ; CHECK-NEXT: uunpklo z2.s, z1.h
595 ; CHECK-NEXT: uunpklo z3.s, z0.h
596 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
597 ; CHECK-NEXT: ptrue p0.h, vl4
598 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
599 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
600 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
602 %res = urem <4 x i16> %op1, %op2
606 define <8 x i16> @urem_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
607 ; CHECK-LABEL: urem_v8i16:
609 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
610 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
611 ; CHECK-NEXT: mov z2.d, z1.d
612 ; CHECK-NEXT: mov z3.d, z0.d
613 ; CHECK-NEXT: ptrue p0.s, vl4
614 ; CHECK-NEXT: uunpklo z4.s, z0.h
615 ; CHECK-NEXT: ptrue p1.h, vl8
616 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
617 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
618 ; CHECK-NEXT: uunpklo z2.s, z2.h
619 ; CHECK-NEXT: uunpklo z3.s, z3.h
620 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
621 ; CHECK-NEXT: uunpklo z3.s, z1.h
622 ; CHECK-NEXT: udivr z3.s, p0/m, z3.s, z4.s
623 ; CHECK-NEXT: ptrue p0.h, vl4
624 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
625 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
626 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
627 ; CHECK-NEXT: mls z0.h, p1/m, z3.h, z1.h
628 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
630 %res = urem <8 x i16> %op1, %op2
634 define void @urem_v16i16(ptr %a, ptr %b) {
635 ; CHECK-LABEL: urem_v16i16:
637 ; CHECK-NEXT: ldp q4, q1, [x1]
638 ; CHECK-NEXT: ptrue p0.s, vl4
639 ; CHECK-NEXT: ldr q0, [x0, #16]
640 ; CHECK-NEXT: ptrue p1.h, vl8
641 ; CHECK-NEXT: mov z2.d, z1.d
642 ; CHECK-NEXT: mov z3.d, z0.d
643 ; CHECK-NEXT: mov z5.d, z4.d
644 ; CHECK-NEXT: uunpklo z16.s, z0.h
645 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
646 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
647 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
648 ; CHECK-NEXT: uunpklo z2.s, z2.h
649 ; CHECK-NEXT: uunpklo z3.s, z3.h
650 ; CHECK-NEXT: uunpklo z5.s, z5.h
651 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
652 ; CHECK-NEXT: ldr q3, [x0]
653 ; CHECK-NEXT: mov z6.d, z3.d
654 ; CHECK-NEXT: uunpklo z7.s, z3.h
655 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
656 ; CHECK-NEXT: uunpklo z6.s, z6.h
657 ; CHECK-NEXT: udivr z5.s, p0/m, z5.s, z6.s
658 ; CHECK-NEXT: uunpklo z6.s, z4.h
659 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
660 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z7.s
661 ; CHECK-NEXT: uunpklo z7.s, z1.h
662 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
663 ; CHECK-NEXT: udivr z7.s, p0/m, z7.s, z16.s
664 ; CHECK-NEXT: ptrue p0.h, vl4
665 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
666 ; CHECK-NEXT: splice z6.h, p0, z6.h, z5.h
667 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
668 ; CHECK-NEXT: splice z7.h, p0, z7.h, z2.h
669 ; CHECK-NEXT: movprfx z2, z3
670 ; CHECK-NEXT: mls z2.h, p1/m, z6.h, z4.h
671 ; CHECK-NEXT: mls z0.h, p1/m, z7.h, z1.h
672 ; CHECK-NEXT: stp q2, q0, [x0]
674 %op1 = load <16 x i16>, ptr %a
675 %op2 = load <16 x i16>, ptr %b
676 %res = urem <16 x i16> %op1, %op2
677 store <16 x i16> %res, ptr %a
681 define <2 x i32> @urem_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
682 ; CHECK-LABEL: urem_v2i32:
684 ; CHECK-NEXT: ptrue p0.s, vl2
685 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
686 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
687 ; CHECK-NEXT: movprfx z2, z0
688 ; CHECK-NEXT: udiv z2.s, p0/m, z2.s, z1.s
689 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
690 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
692 %res = urem <2 x i32> %op1, %op2
696 define <4 x i32> @urem_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
697 ; CHECK-LABEL: urem_v4i32:
699 ; CHECK-NEXT: ptrue p0.s, vl4
700 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
701 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
702 ; CHECK-NEXT: movprfx z2, z0
703 ; CHECK-NEXT: udiv z2.s, p0/m, z2.s, z1.s
704 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
705 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
707 %res = urem <4 x i32> %op1, %op2
711 define void @urem_v8i32(ptr %a, ptr %b) {
712 ; CHECK-LABEL: urem_v8i32:
714 ; CHECK-NEXT: ptrue p0.s, vl4
715 ; CHECK-NEXT: ldp q0, q3, [x1]
716 ; CHECK-NEXT: ldp q1, q2, [x0]
717 ; CHECK-NEXT: movprfx z4, z1
718 ; CHECK-NEXT: udiv z4.s, p0/m, z4.s, z0.s
719 ; CHECK-NEXT: movprfx z5, z2
720 ; CHECK-NEXT: udiv z5.s, p0/m, z5.s, z3.s
721 ; CHECK-NEXT: msb z0.s, p0/m, z4.s, z1.s
722 ; CHECK-NEXT: movprfx z1, z2
723 ; CHECK-NEXT: mls z1.s, p0/m, z5.s, z3.s
724 ; CHECK-NEXT: stp q0, q1, [x0]
726 %op1 = load <8 x i32>, ptr %a
727 %op2 = load <8 x i32>, ptr %b
728 %res = urem <8 x i32> %op1, %op2
729 store <8 x i32> %res, ptr %a
733 define <1 x i64> @urem_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
734 ; CHECK-LABEL: urem_v1i64:
736 ; CHECK-NEXT: ptrue p0.d, vl1
737 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
738 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
739 ; CHECK-NEXT: movprfx z2, z0
740 ; CHECK-NEXT: udiv z2.d, p0/m, z2.d, z1.d
741 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
742 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
744 %res = urem <1 x i64> %op1, %op2
748 define <2 x i64> @urem_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
749 ; CHECK-LABEL: urem_v2i64:
751 ; CHECK-NEXT: ptrue p0.d, vl2
752 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
753 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
754 ; CHECK-NEXT: movprfx z2, z0
755 ; CHECK-NEXT: udiv z2.d, p0/m, z2.d, z1.d
756 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
757 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
759 %res = urem <2 x i64> %op1, %op2
763 define void @urem_v4i64(ptr %a, ptr %b) {
764 ; CHECK-LABEL: urem_v4i64:
766 ; CHECK-NEXT: ptrue p0.d, vl2
767 ; CHECK-NEXT: ldp q0, q3, [x1]
768 ; CHECK-NEXT: ldp q1, q2, [x0]
769 ; CHECK-NEXT: movprfx z4, z1
770 ; CHECK-NEXT: udiv z4.d, p0/m, z4.d, z0.d
771 ; CHECK-NEXT: movprfx z5, z2
772 ; CHECK-NEXT: udiv z5.d, p0/m, z5.d, z3.d
773 ; CHECK-NEXT: msb z0.d, p0/m, z4.d, z1.d
774 ; CHECK-NEXT: movprfx z1, z2
775 ; CHECK-NEXT: mls z1.d, p0/m, z5.d, z3.d
776 ; CHECK-NEXT: stp q0, q1, [x0]
778 %op1 = load <4 x i64>, ptr %a
779 %op2 = load <4 x i64>, ptr %b
780 %res = urem <4 x i64> %op1, %op2
781 store <4 x i64> %res, ptr %a