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
4 target triple = "aarch64-unknown-linux-gnu"
10 define <4 x i8> @srem_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
11 ; CHECK-LABEL: srem_v4i8:
13 ; CHECK-NEXT: ptrue p0.h, vl4
14 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
15 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
16 ; CHECK-NEXT: ptrue p1.s, vl4
17 ; CHECK-NEXT: sxtb z0.h, p0/m, z0.h
18 ; CHECK-NEXT: sxtb z1.h, p0/m, z1.h
19 ; CHECK-NEXT: sunpklo z2.s, z1.h
20 ; CHECK-NEXT: sunpklo z3.s, z0.h
21 ; CHECK-NEXT: sdivr z2.s, p1/m, z2.s, z3.s
22 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
23 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
24 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
26 %res = srem <4 x i8> %op1, %op2
30 define <8 x i8> @srem_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
31 ; CHECK-LABEL: srem_v8i8:
33 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
34 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
35 ; CHECK-NEXT: sunpklo z2.h, z1.b
36 ; CHECK-NEXT: sunpklo z3.h, z0.b
37 ; CHECK-NEXT: ptrue p0.s, vl4
38 ; CHECK-NEXT: sunpklo z4.s, z2.h
39 ; CHECK-NEXT: sunpklo z5.s, z3.h
40 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
41 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
42 ; CHECK-NEXT: sunpklo z2.s, z2.h
43 ; CHECK-NEXT: sunpklo z3.s, z3.h
44 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
45 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
46 ; CHECK-NEXT: ptrue p0.h, vl4
47 ; CHECK-NEXT: uzp1 z3.h, z4.h, z4.h
48 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
49 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
50 ; CHECK-NEXT: ptrue p0.b, vl8
51 ; CHECK-NEXT: uzp1 z2.b, z3.b, z3.b
52 ; CHECK-NEXT: mls z0.b, p0/m, z2.b, z1.b
53 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
55 %res = srem <8 x i8> %op1, %op2
59 define <16 x i8> @srem_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
60 ; CHECK-LABEL: srem_v16i8:
62 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
63 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
64 ; CHECK-NEXT: mov z2.d, z1.d
65 ; CHECK-NEXT: mov z3.d, z0.d
66 ; CHECK-NEXT: ptrue p0.s, vl4
67 ; CHECK-NEXT: ptrue p1.b, vl16
68 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
69 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
70 ; CHECK-NEXT: sunpklo z2.h, z2.b
71 ; CHECK-NEXT: sunpklo z3.h, z3.b
72 ; CHECK-NEXT: sunpklo z4.s, z2.h
73 ; CHECK-NEXT: sunpklo z5.s, z3.h
74 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
75 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
76 ; CHECK-NEXT: sunpklo z2.s, z2.h
77 ; CHECK-NEXT: sunpklo z3.s, z3.h
78 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
79 ; CHECK-NEXT: sunpklo z5.h, z0.b
80 ; CHECK-NEXT: sunpklo z7.s, z5.h
81 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
82 ; CHECK-NEXT: sunpklo z5.s, z5.h
83 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
84 ; CHECK-NEXT: sunpklo z3.h, z1.b
85 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
86 ; CHECK-NEXT: sunpklo z6.s, z3.h
87 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
88 ; CHECK-NEXT: sunpklo z3.s, z3.h
89 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z7.s
90 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
91 ; CHECK-NEXT: sdivr z3.s, p0/m, z3.s, z5.s
92 ; CHECK-NEXT: ptrue p0.h, vl4
93 ; CHECK-NEXT: uzp1 z5.h, z6.h, z6.h
94 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
95 ; CHECK-NEXT: uzp1 z2.b, z4.b, z4.b
96 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
97 ; CHECK-NEXT: splice z5.h, p0, z5.h, z3.h
98 ; CHECK-NEXT: ptrue p0.b, vl8
99 ; CHECK-NEXT: uzp1 z3.b, z5.b, z5.b
100 ; CHECK-NEXT: splice z3.b, p0, z3.b, z2.b
101 ; CHECK-NEXT: mls z0.b, p1/m, z3.b, z1.b
102 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
104 %res = srem <16 x i8> %op1, %op2
108 define void @srem_v32i8(ptr %a, ptr %b) {
109 ; CHECK-LABEL: srem_v32i8:
111 ; CHECK-NEXT: ldr q0, [x0, #16]
112 ; CHECK-NEXT: ldr q1, [x1, #16]
113 ; CHECK-NEXT: ptrue p0.s, vl4
114 ; CHECK-NEXT: ptrue p1.b, vl16
115 ; CHECK-NEXT: mov z2.d, z1.d
116 ; CHECK-NEXT: mov z3.d, z0.d
117 ; CHECK-NEXT: sunpklo z6.h, z1.b
118 ; CHECK-NEXT: sunpklo z7.h, z0.b
119 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
120 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
121 ; CHECK-NEXT: sunpklo z16.s, z6.h
122 ; CHECK-NEXT: ext z6.b, z6.b, z6.b, #8
123 ; CHECK-NEXT: sunpklo z17.s, z7.h
124 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
125 ; CHECK-NEXT: sunpklo z4.h, z2.b
126 ; CHECK-NEXT: sunpklo z3.h, z3.b
127 ; CHECK-NEXT: sunpklo z6.s, z6.h
128 ; CHECK-NEXT: sunpklo z7.s, z7.h
129 ; CHECK-NEXT: sdivr z16.s, p0/m, z16.s, z17.s
130 ; CHECK-NEXT: sunpklo z2.s, z4.h
131 ; CHECK-NEXT: sunpklo z5.s, z3.h
132 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
133 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
134 ; CHECK-NEXT: sunpklo z4.s, z4.h
135 ; CHECK-NEXT: sunpklo z3.s, z3.h
136 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z5.s
137 ; CHECK-NEXT: ldr q5, [x1]
138 ; CHECK-NEXT: mov z17.d, z5.d
139 ; CHECK-NEXT: uzp1 z16.h, z16.h, z16.h
140 ; CHECK-NEXT: ext z17.b, z17.b, z5.b, #8
141 ; CHECK-NEXT: sunpklo z17.h, z17.b
142 ; CHECK-NEXT: sdiv z3.s, p0/m, z3.s, z4.s
143 ; CHECK-NEXT: ldr q4, [x0]
144 ; CHECK-NEXT: sunpklo z19.s, z17.h
145 ; CHECK-NEXT: ext z17.b, z17.b, z17.b, #8
146 ; CHECK-NEXT: mov z18.d, z4.d
147 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
148 ; CHECK-NEXT: sunpklo z17.s, z17.h
149 ; CHECK-NEXT: ext z18.b, z18.b, z4.b, #8
150 ; CHECK-NEXT: sunpklo z18.h, z18.b
151 ; CHECK-NEXT: sunpklo z20.s, z18.h
152 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
153 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z7.s
154 ; CHECK-NEXT: sunpklo z18.s, z18.h
155 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
156 ; CHECK-NEXT: sdivr z19.s, p0/m, z19.s, z20.s
157 ; CHECK-NEXT: sunpklo z20.h, z4.b
158 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
159 ; CHECK-NEXT: sunpklo z22.s, z20.h
160 ; CHECK-NEXT: ext z20.b, z20.b, z20.b, #8
161 ; CHECK-NEXT: sunpklo z20.s, z20.h
162 ; CHECK-NEXT: sdivr z17.s, p0/m, z17.s, z18.s
163 ; CHECK-NEXT: sunpklo z18.h, z5.b
164 ; CHECK-NEXT: uzp1 z7.h, z19.h, z19.h
165 ; CHECK-NEXT: sunpklo z21.s, z18.h
166 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
167 ; CHECK-NEXT: sunpklo z18.s, z18.h
168 ; CHECK-NEXT: sdivr z21.s, p0/m, z21.s, z22.s
169 ; CHECK-NEXT: uzp1 z17.h, z17.h, z17.h
170 ; CHECK-NEXT: sdivr z18.s, p0/m, z18.s, z20.s
171 ; CHECK-NEXT: ptrue p0.h, vl4
172 ; CHECK-NEXT: uzp1 z19.h, z21.h, z21.h
173 ; CHECK-NEXT: splice z7.h, p0, z7.h, z17.h
174 ; CHECK-NEXT: splice z2.h, p0, z2.h, z3.h
175 ; CHECK-NEXT: splice z16.h, p0, z16.h, z6.h
176 ; CHECK-NEXT: uzp1 z3.b, z7.b, z7.b
177 ; CHECK-NEXT: uzp1 z2.b, z2.b, z2.b
178 ; CHECK-NEXT: uzp1 z7.b, z16.b, z16.b
179 ; CHECK-NEXT: uzp1 z18.h, z18.h, z18.h
180 ; CHECK-NEXT: splice z19.h, p0, z19.h, z18.h
181 ; CHECK-NEXT: ptrue p0.b, vl8
182 ; CHECK-NEXT: uzp1 z6.b, z19.b, z19.b
183 ; CHECK-NEXT: splice z7.b, p0, z7.b, z2.b
184 ; CHECK-NEXT: splice z6.b, p0, z6.b, z3.b
185 ; CHECK-NEXT: movprfx z2, z4
186 ; CHECK-NEXT: mls z2.b, p1/m, z6.b, z5.b
187 ; CHECK-NEXT: mls z0.b, p1/m, z7.b, z1.b
188 ; CHECK-NEXT: stp q2, q0, [x0]
190 %op1 = load <32 x i8>, ptr %a
191 %op2 = load <32 x i8>, ptr %b
192 %res = srem <32 x i8> %op1, %op2
193 store <32 x i8> %res, ptr %a
197 define <4 x i16> @srem_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
198 ; CHECK-LABEL: srem_v4i16:
200 ; CHECK-NEXT: ptrue p0.s, vl4
201 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
202 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
203 ; CHECK-NEXT: sunpklo z2.s, z1.h
204 ; CHECK-NEXT: sunpklo z3.s, z0.h
205 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
206 ; CHECK-NEXT: ptrue p0.h, vl4
207 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
208 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
209 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
211 %res = srem <4 x i16> %op1, %op2
215 define <8 x i16> @srem_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
216 ; CHECK-LABEL: srem_v8i16:
218 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
219 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
220 ; CHECK-NEXT: mov z2.d, z1.d
221 ; CHECK-NEXT: mov z3.d, z0.d
222 ; CHECK-NEXT: ptrue p0.s, vl4
223 ; CHECK-NEXT: sunpklo z4.s, z0.h
224 ; CHECK-NEXT: ptrue p1.h, vl8
225 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
226 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
227 ; CHECK-NEXT: sunpklo z2.s, z2.h
228 ; CHECK-NEXT: sunpklo z3.s, z3.h
229 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
230 ; CHECK-NEXT: sunpklo z3.s, z1.h
231 ; CHECK-NEXT: sdivr z3.s, p0/m, z3.s, z4.s
232 ; CHECK-NEXT: ptrue p0.h, vl4
233 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
234 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
235 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
236 ; CHECK-NEXT: mls z0.h, p1/m, z3.h, z1.h
237 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
239 %res = srem <8 x i16> %op1, %op2
243 define void @srem_v16i16(ptr %a, ptr %b) {
244 ; CHECK-LABEL: srem_v16i16:
246 ; CHECK-NEXT: ldp q4, q1, [x1]
247 ; CHECK-NEXT: ptrue p0.s, vl4
248 ; CHECK-NEXT: ldr q0, [x0, #16]
249 ; CHECK-NEXT: ptrue p1.h, vl8
250 ; CHECK-NEXT: mov z2.d, z1.d
251 ; CHECK-NEXT: mov z3.d, z0.d
252 ; CHECK-NEXT: mov z5.d, z4.d
253 ; CHECK-NEXT: sunpklo z16.s, z0.h
254 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
255 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
256 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
257 ; CHECK-NEXT: sunpklo z2.s, z2.h
258 ; CHECK-NEXT: sunpklo z3.s, z3.h
259 ; CHECK-NEXT: sunpklo z5.s, z5.h
260 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
261 ; CHECK-NEXT: ldr q3, [x0]
262 ; CHECK-NEXT: mov z6.d, z3.d
263 ; CHECK-NEXT: sunpklo z7.s, z3.h
264 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
265 ; CHECK-NEXT: sunpklo z6.s, z6.h
266 ; CHECK-NEXT: sdivr z5.s, p0/m, z5.s, z6.s
267 ; CHECK-NEXT: sunpklo z6.s, z4.h
268 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
269 ; CHECK-NEXT: sdivr z6.s, p0/m, z6.s, z7.s
270 ; CHECK-NEXT: sunpklo z7.s, z1.h
271 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
272 ; CHECK-NEXT: sdivr z7.s, p0/m, z7.s, z16.s
273 ; CHECK-NEXT: ptrue p0.h, vl4
274 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
275 ; CHECK-NEXT: splice z6.h, p0, z6.h, z5.h
276 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
277 ; CHECK-NEXT: splice z7.h, p0, z7.h, z2.h
278 ; CHECK-NEXT: movprfx z2, z3
279 ; CHECK-NEXT: mls z2.h, p1/m, z6.h, z4.h
280 ; CHECK-NEXT: mls z0.h, p1/m, z7.h, z1.h
281 ; CHECK-NEXT: stp q2, q0, [x0]
283 %op1 = load <16 x i16>, ptr %a
284 %op2 = load <16 x i16>, ptr %b
285 %res = srem <16 x i16> %op1, %op2
286 store <16 x i16> %res, ptr %a
290 define <2 x i32> @srem_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
291 ; CHECK-LABEL: srem_v2i32:
293 ; CHECK-NEXT: ptrue p0.s, vl2
294 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
295 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
296 ; CHECK-NEXT: movprfx z2, z0
297 ; CHECK-NEXT: sdiv z2.s, p0/m, z2.s, z1.s
298 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
299 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
301 %res = srem <2 x i32> %op1, %op2
305 define <4 x i32> @srem_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
306 ; CHECK-LABEL: srem_v4i32:
308 ; CHECK-NEXT: ptrue p0.s, vl4
309 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
310 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
311 ; CHECK-NEXT: movprfx z2, z0
312 ; CHECK-NEXT: sdiv z2.s, p0/m, z2.s, z1.s
313 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
314 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
316 %res = srem <4 x i32> %op1, %op2
320 define void @srem_v8i32(ptr %a, ptr %b) {
321 ; CHECK-LABEL: srem_v8i32:
323 ; CHECK-NEXT: ptrue p0.s, vl4
324 ; CHECK-NEXT: ldp q0, q3, [x1]
325 ; CHECK-NEXT: ldp q1, q2, [x0]
326 ; CHECK-NEXT: movprfx z4, z1
327 ; CHECK-NEXT: sdiv z4.s, p0/m, z4.s, z0.s
328 ; CHECK-NEXT: movprfx z5, z2
329 ; CHECK-NEXT: sdiv z5.s, p0/m, z5.s, z3.s
330 ; CHECK-NEXT: msb z0.s, p0/m, z4.s, z1.s
331 ; CHECK-NEXT: movprfx z1, z2
332 ; CHECK-NEXT: mls z1.s, p0/m, z5.s, z3.s
333 ; CHECK-NEXT: stp q0, q1, [x0]
335 %op1 = load <8 x i32>, ptr %a
336 %op2 = load <8 x i32>, ptr %b
337 %res = srem <8 x i32> %op1, %op2
338 store <8 x i32> %res, ptr %a
342 define <1 x i64> @srem_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
343 ; CHECK-LABEL: srem_v1i64:
345 ; CHECK-NEXT: ptrue p0.d, vl1
346 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
347 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
348 ; CHECK-NEXT: movprfx z2, z0
349 ; CHECK-NEXT: sdiv z2.d, p0/m, z2.d, z1.d
350 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
351 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
353 %res = srem <1 x i64> %op1, %op2
357 define <2 x i64> @srem_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
358 ; CHECK-LABEL: srem_v2i64:
360 ; CHECK-NEXT: ptrue p0.d, vl2
361 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
362 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
363 ; CHECK-NEXT: movprfx z2, z0
364 ; CHECK-NEXT: sdiv z2.d, p0/m, z2.d, z1.d
365 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
366 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
368 %res = srem <2 x i64> %op1, %op2
372 define void @srem_v4i64(ptr %a, ptr %b) {
373 ; CHECK-LABEL: srem_v4i64:
375 ; CHECK-NEXT: ptrue p0.d, vl2
376 ; CHECK-NEXT: ldp q0, q3, [x1]
377 ; CHECK-NEXT: ldp q1, q2, [x0]
378 ; CHECK-NEXT: movprfx z4, z1
379 ; CHECK-NEXT: sdiv z4.d, p0/m, z4.d, z0.d
380 ; CHECK-NEXT: movprfx z5, z2
381 ; CHECK-NEXT: sdiv z5.d, p0/m, z5.d, z3.d
382 ; CHECK-NEXT: msb z0.d, p0/m, z4.d, z1.d
383 ; CHECK-NEXT: movprfx z1, z2
384 ; CHECK-NEXT: mls z1.d, p0/m, z5.d, z3.d
385 ; CHECK-NEXT: stp q0, q1, [x0]
387 %op1 = load <4 x i64>, ptr %a
388 %op2 = load <4 x i64>, ptr %b
389 %res = srem <4 x i64> %op1, %op2
390 store <4 x i64> %res, ptr %a
398 define <4 x i8> @urem_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
399 ; CHECK-LABEL: urem_v4i8:
401 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
402 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
403 ; CHECK-NEXT: ptrue p0.s, vl4
404 ; CHECK-NEXT: and z0.h, z0.h, #0xff
405 ; CHECK-NEXT: and z1.h, z1.h, #0xff
406 ; CHECK-NEXT: uunpklo z2.s, z1.h
407 ; CHECK-NEXT: uunpklo z3.s, z0.h
408 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
409 ; CHECK-NEXT: ptrue p0.h, vl4
410 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
411 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
412 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
414 %res = urem <4 x i8> %op1, %op2
418 define <8 x i8> @urem_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
419 ; CHECK-LABEL: urem_v8i8:
421 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
422 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
423 ; CHECK-NEXT: uunpklo z2.h, z1.b
424 ; CHECK-NEXT: uunpklo z3.h, z0.b
425 ; CHECK-NEXT: ptrue p0.s, vl4
426 ; CHECK-NEXT: uunpklo z4.s, z2.h
427 ; CHECK-NEXT: uunpklo z5.s, z3.h
428 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
429 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
430 ; CHECK-NEXT: uunpklo z2.s, z2.h
431 ; CHECK-NEXT: uunpklo z3.s, z3.h
432 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
433 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
434 ; CHECK-NEXT: ptrue p0.h, vl4
435 ; CHECK-NEXT: uzp1 z3.h, z4.h, z4.h
436 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
437 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
438 ; CHECK-NEXT: ptrue p0.b, vl8
439 ; CHECK-NEXT: uzp1 z2.b, z3.b, z3.b
440 ; CHECK-NEXT: mls z0.b, p0/m, z2.b, z1.b
441 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
443 %res = urem <8 x i8> %op1, %op2
447 define <16 x i8> @urem_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
448 ; CHECK-LABEL: urem_v16i8:
450 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
451 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
452 ; CHECK-NEXT: mov z2.d, z1.d
453 ; CHECK-NEXT: mov z3.d, z0.d
454 ; CHECK-NEXT: ptrue p0.s, vl4
455 ; CHECK-NEXT: ptrue p1.b, vl16
456 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
457 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
458 ; CHECK-NEXT: uunpklo z2.h, z2.b
459 ; CHECK-NEXT: uunpklo z3.h, z3.b
460 ; CHECK-NEXT: uunpklo z4.s, z2.h
461 ; CHECK-NEXT: uunpklo z5.s, z3.h
462 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
463 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
464 ; CHECK-NEXT: uunpklo z2.s, z2.h
465 ; CHECK-NEXT: uunpklo z3.s, z3.h
466 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
467 ; CHECK-NEXT: uunpklo z5.h, z0.b
468 ; CHECK-NEXT: uunpklo z7.s, z5.h
469 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
470 ; CHECK-NEXT: uunpklo z5.s, z5.h
471 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
472 ; CHECK-NEXT: uunpklo z3.h, z1.b
473 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
474 ; CHECK-NEXT: uunpklo z6.s, z3.h
475 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
476 ; CHECK-NEXT: uunpklo z3.s, z3.h
477 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z7.s
478 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
479 ; CHECK-NEXT: udivr z3.s, p0/m, z3.s, z5.s
480 ; CHECK-NEXT: ptrue p0.h, vl4
481 ; CHECK-NEXT: uzp1 z5.h, z6.h, z6.h
482 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
483 ; CHECK-NEXT: uzp1 z2.b, z4.b, z4.b
484 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
485 ; CHECK-NEXT: splice z5.h, p0, z5.h, z3.h
486 ; CHECK-NEXT: ptrue p0.b, vl8
487 ; CHECK-NEXT: uzp1 z3.b, z5.b, z5.b
488 ; CHECK-NEXT: splice z3.b, p0, z3.b, z2.b
489 ; CHECK-NEXT: mls z0.b, p1/m, z3.b, z1.b
490 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
492 %res = urem <16 x i8> %op1, %op2
496 define void @urem_v32i8(ptr %a, ptr %b) {
497 ; CHECK-LABEL: urem_v32i8:
499 ; CHECK-NEXT: ldr q0, [x0, #16]
500 ; CHECK-NEXT: ldr q1, [x1, #16]
501 ; CHECK-NEXT: ptrue p0.s, vl4
502 ; CHECK-NEXT: ptrue p1.b, vl16
503 ; CHECK-NEXT: mov z2.d, z1.d
504 ; CHECK-NEXT: mov z3.d, z0.d
505 ; CHECK-NEXT: uunpklo z6.h, z1.b
506 ; CHECK-NEXT: uunpklo z7.h, z0.b
507 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
508 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
509 ; CHECK-NEXT: uunpklo z16.s, z6.h
510 ; CHECK-NEXT: ext z6.b, z6.b, z6.b, #8
511 ; CHECK-NEXT: uunpklo z17.s, z7.h
512 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
513 ; CHECK-NEXT: uunpklo z4.h, z2.b
514 ; CHECK-NEXT: uunpklo z3.h, z3.b
515 ; CHECK-NEXT: uunpklo z6.s, z6.h
516 ; CHECK-NEXT: uunpklo z7.s, z7.h
517 ; CHECK-NEXT: udivr z16.s, p0/m, z16.s, z17.s
518 ; CHECK-NEXT: uunpklo z2.s, z4.h
519 ; CHECK-NEXT: uunpklo z5.s, z3.h
520 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
521 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
522 ; CHECK-NEXT: uunpklo z4.s, z4.h
523 ; CHECK-NEXT: uunpklo z3.s, z3.h
524 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z5.s
525 ; CHECK-NEXT: ldr q5, [x1]
526 ; CHECK-NEXT: mov z17.d, z5.d
527 ; CHECK-NEXT: uzp1 z16.h, z16.h, z16.h
528 ; CHECK-NEXT: ext z17.b, z17.b, z5.b, #8
529 ; CHECK-NEXT: uunpklo z17.h, z17.b
530 ; CHECK-NEXT: udiv z3.s, p0/m, z3.s, z4.s
531 ; CHECK-NEXT: ldr q4, [x0]
532 ; CHECK-NEXT: uunpklo z19.s, z17.h
533 ; CHECK-NEXT: ext z17.b, z17.b, z17.b, #8
534 ; CHECK-NEXT: mov z18.d, z4.d
535 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
536 ; CHECK-NEXT: uunpklo z17.s, z17.h
537 ; CHECK-NEXT: ext z18.b, z18.b, z4.b, #8
538 ; CHECK-NEXT: uunpklo z18.h, z18.b
539 ; CHECK-NEXT: uunpklo z20.s, z18.h
540 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
541 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z7.s
542 ; CHECK-NEXT: uunpklo z18.s, z18.h
543 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
544 ; CHECK-NEXT: udivr z19.s, p0/m, z19.s, z20.s
545 ; CHECK-NEXT: uunpklo z20.h, z4.b
546 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
547 ; CHECK-NEXT: uunpklo z22.s, z20.h
548 ; CHECK-NEXT: ext z20.b, z20.b, z20.b, #8
549 ; CHECK-NEXT: uunpklo z20.s, z20.h
550 ; CHECK-NEXT: udivr z17.s, p0/m, z17.s, z18.s
551 ; CHECK-NEXT: uunpklo z18.h, z5.b
552 ; CHECK-NEXT: uzp1 z7.h, z19.h, z19.h
553 ; CHECK-NEXT: uunpklo z21.s, z18.h
554 ; CHECK-NEXT: ext z18.b, z18.b, z18.b, #8
555 ; CHECK-NEXT: uunpklo z18.s, z18.h
556 ; CHECK-NEXT: udivr z21.s, p0/m, z21.s, z22.s
557 ; CHECK-NEXT: uzp1 z17.h, z17.h, z17.h
558 ; CHECK-NEXT: udivr z18.s, p0/m, z18.s, z20.s
559 ; CHECK-NEXT: ptrue p0.h, vl4
560 ; CHECK-NEXT: uzp1 z19.h, z21.h, z21.h
561 ; CHECK-NEXT: splice z7.h, p0, z7.h, z17.h
562 ; CHECK-NEXT: splice z2.h, p0, z2.h, z3.h
563 ; CHECK-NEXT: splice z16.h, p0, z16.h, z6.h
564 ; CHECK-NEXT: uzp1 z3.b, z7.b, z7.b
565 ; CHECK-NEXT: uzp1 z2.b, z2.b, z2.b
566 ; CHECK-NEXT: uzp1 z7.b, z16.b, z16.b
567 ; CHECK-NEXT: uzp1 z18.h, z18.h, z18.h
568 ; CHECK-NEXT: splice z19.h, p0, z19.h, z18.h
569 ; CHECK-NEXT: ptrue p0.b, vl8
570 ; CHECK-NEXT: uzp1 z6.b, z19.b, z19.b
571 ; CHECK-NEXT: splice z7.b, p0, z7.b, z2.b
572 ; CHECK-NEXT: splice z6.b, p0, z6.b, z3.b
573 ; CHECK-NEXT: movprfx z2, z4
574 ; CHECK-NEXT: mls z2.b, p1/m, z6.b, z5.b
575 ; CHECK-NEXT: mls z0.b, p1/m, z7.b, z1.b
576 ; CHECK-NEXT: stp q2, q0, [x0]
578 %op1 = load <32 x i8>, ptr %a
579 %op2 = load <32 x i8>, ptr %b
580 %res = urem <32 x i8> %op1, %op2
581 store <32 x i8> %res, ptr %a
585 define <4 x i16> @urem_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
586 ; CHECK-LABEL: urem_v4i16:
588 ; CHECK-NEXT: ptrue p0.s, vl4
589 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
590 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
591 ; CHECK-NEXT: uunpklo z2.s, z1.h
592 ; CHECK-NEXT: uunpklo z3.s, z0.h
593 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
594 ; CHECK-NEXT: ptrue p0.h, vl4
595 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
596 ; CHECK-NEXT: mls z0.h, p0/m, z2.h, z1.h
597 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
599 %res = urem <4 x i16> %op1, %op2
603 define <8 x i16> @urem_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
604 ; CHECK-LABEL: urem_v8i16:
606 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
607 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
608 ; CHECK-NEXT: mov z2.d, z1.d
609 ; CHECK-NEXT: mov z3.d, z0.d
610 ; CHECK-NEXT: ptrue p0.s, vl4
611 ; CHECK-NEXT: uunpklo z4.s, z0.h
612 ; CHECK-NEXT: ptrue p1.h, vl8
613 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
614 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
615 ; CHECK-NEXT: uunpklo z2.s, z2.h
616 ; CHECK-NEXT: uunpklo z3.s, z3.h
617 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
618 ; CHECK-NEXT: uunpklo z3.s, z1.h
619 ; CHECK-NEXT: udivr z3.s, p0/m, z3.s, z4.s
620 ; CHECK-NEXT: ptrue p0.h, vl4
621 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
622 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
623 ; CHECK-NEXT: splice z3.h, p0, z3.h, z2.h
624 ; CHECK-NEXT: mls z0.h, p1/m, z3.h, z1.h
625 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
627 %res = urem <8 x i16> %op1, %op2
631 define void @urem_v16i16(ptr %a, ptr %b) {
632 ; CHECK-LABEL: urem_v16i16:
634 ; CHECK-NEXT: ldp q4, q1, [x1]
635 ; CHECK-NEXT: ptrue p0.s, vl4
636 ; CHECK-NEXT: ldr q0, [x0, #16]
637 ; CHECK-NEXT: ptrue p1.h, vl8
638 ; CHECK-NEXT: mov z2.d, z1.d
639 ; CHECK-NEXT: mov z3.d, z0.d
640 ; CHECK-NEXT: mov z5.d, z4.d
641 ; CHECK-NEXT: uunpklo z16.s, z0.h
642 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
643 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
644 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
645 ; CHECK-NEXT: uunpklo z2.s, z2.h
646 ; CHECK-NEXT: uunpklo z3.s, z3.h
647 ; CHECK-NEXT: uunpklo z5.s, z5.h
648 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
649 ; CHECK-NEXT: ldr q3, [x0]
650 ; CHECK-NEXT: mov z6.d, z3.d
651 ; CHECK-NEXT: uunpklo z7.s, z3.h
652 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
653 ; CHECK-NEXT: uunpklo z6.s, z6.h
654 ; CHECK-NEXT: udivr z5.s, p0/m, z5.s, z6.s
655 ; CHECK-NEXT: uunpklo z6.s, z4.h
656 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
657 ; CHECK-NEXT: udivr z6.s, p0/m, z6.s, z7.s
658 ; CHECK-NEXT: uunpklo z7.s, z1.h
659 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
660 ; CHECK-NEXT: udivr z7.s, p0/m, z7.s, z16.s
661 ; CHECK-NEXT: ptrue p0.h, vl4
662 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
663 ; CHECK-NEXT: splice z6.h, p0, z6.h, z5.h
664 ; CHECK-NEXT: uzp1 z7.h, z7.h, z7.h
665 ; CHECK-NEXT: splice z7.h, p0, z7.h, z2.h
666 ; CHECK-NEXT: movprfx z2, z3
667 ; CHECK-NEXT: mls z2.h, p1/m, z6.h, z4.h
668 ; CHECK-NEXT: mls z0.h, p1/m, z7.h, z1.h
669 ; CHECK-NEXT: stp q2, q0, [x0]
671 %op1 = load <16 x i16>, ptr %a
672 %op2 = load <16 x i16>, ptr %b
673 %res = urem <16 x i16> %op1, %op2
674 store <16 x i16> %res, ptr %a
678 define <2 x i32> @urem_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
679 ; CHECK-LABEL: urem_v2i32:
681 ; CHECK-NEXT: ptrue p0.s, vl2
682 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
683 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
684 ; CHECK-NEXT: movprfx z2, z0
685 ; CHECK-NEXT: udiv z2.s, p0/m, z2.s, z1.s
686 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
687 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
689 %res = urem <2 x i32> %op1, %op2
693 define <4 x i32> @urem_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
694 ; CHECK-LABEL: urem_v4i32:
696 ; CHECK-NEXT: ptrue p0.s, vl4
697 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
698 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
699 ; CHECK-NEXT: movprfx z2, z0
700 ; CHECK-NEXT: udiv z2.s, p0/m, z2.s, z1.s
701 ; CHECK-NEXT: mls z0.s, p0/m, z2.s, z1.s
702 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
704 %res = urem <4 x i32> %op1, %op2
708 define void @urem_v8i32(ptr %a, ptr %b) {
709 ; CHECK-LABEL: urem_v8i32:
711 ; CHECK-NEXT: ptrue p0.s, vl4
712 ; CHECK-NEXT: ldp q0, q3, [x1]
713 ; CHECK-NEXT: ldp q1, q2, [x0]
714 ; CHECK-NEXT: movprfx z4, z1
715 ; CHECK-NEXT: udiv z4.s, p0/m, z4.s, z0.s
716 ; CHECK-NEXT: movprfx z5, z2
717 ; CHECK-NEXT: udiv z5.s, p0/m, z5.s, z3.s
718 ; CHECK-NEXT: msb z0.s, p0/m, z4.s, z1.s
719 ; CHECK-NEXT: movprfx z1, z2
720 ; CHECK-NEXT: mls z1.s, p0/m, z5.s, z3.s
721 ; CHECK-NEXT: stp q0, q1, [x0]
723 %op1 = load <8 x i32>, ptr %a
724 %op2 = load <8 x i32>, ptr %b
725 %res = urem <8 x i32> %op1, %op2
726 store <8 x i32> %res, ptr %a
730 define <1 x i64> @urem_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
731 ; CHECK-LABEL: urem_v1i64:
733 ; CHECK-NEXT: ptrue p0.d, vl1
734 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
735 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
736 ; CHECK-NEXT: movprfx z2, z0
737 ; CHECK-NEXT: udiv z2.d, p0/m, z2.d, z1.d
738 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
739 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
741 %res = urem <1 x i64> %op1, %op2
745 define <2 x i64> @urem_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
746 ; CHECK-LABEL: urem_v2i64:
748 ; CHECK-NEXT: ptrue p0.d, vl2
749 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
750 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
751 ; CHECK-NEXT: movprfx z2, z0
752 ; CHECK-NEXT: udiv z2.d, p0/m, z2.d, z1.d
753 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z1.d
754 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
756 %res = urem <2 x i64> %op1, %op2
760 define void @urem_v4i64(ptr %a, ptr %b) {
761 ; CHECK-LABEL: urem_v4i64:
763 ; CHECK-NEXT: ptrue p0.d, vl2
764 ; CHECK-NEXT: ldp q0, q3, [x1]
765 ; CHECK-NEXT: ldp q1, q2, [x0]
766 ; CHECK-NEXT: movprfx z4, z1
767 ; CHECK-NEXT: udiv z4.d, p0/m, z4.d, z0.d
768 ; CHECK-NEXT: movprfx z5, z2
769 ; CHECK-NEXT: udiv z5.d, p0/m, z5.d, z3.d
770 ; CHECK-NEXT: msb z0.d, p0/m, z4.d, z1.d
771 ; CHECK-NEXT: movprfx z1, z2
772 ; CHECK-NEXT: mls z1.d, p0/m, z5.d, z3.d
773 ; CHECK-NEXT: stp q0, q1, [x0]
775 %op1 = load <4 x i64>, ptr %a
776 %op2 = load <4 x i64>, ptr %b
777 %res = urem <4 x i64> %op1, %op2
778 store <4 x i64> %res, ptr %a