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 --check-prefixes=CHECK,SVE
3 ; RUN: llc -mattr=+sve2 -force-streaming-compatible-sve < %s | FileCheck %s --check-prefixes=CHECK,SVE2
5 target triple = "aarch64-unknown-linux-gnu"
11 define <4 x i8> @sdiv_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
12 ; CHECK-LABEL: sdiv_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: sxtb z0.h, p0/m, z0.h
18 ; CHECK-NEXT: sxtb z1.h, p0/m, z1.h
19 ; CHECK-NEXT: ptrue p0.s, vl4
20 ; CHECK-NEXT: sunpklo z1.s, z1.h
21 ; CHECK-NEXT: sunpklo z0.s, z0.h
22 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
23 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
24 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
26 %res = sdiv <4 x i8> %op1, %op2
30 define <8 x i8> @sdiv_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
31 ; CHECK-LABEL: sdiv_v8i8:
33 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
34 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
35 ; CHECK-NEXT: ptrue p0.s, vl4
36 ; CHECK-NEXT: sunpklo z1.h, z1.b
37 ; CHECK-NEXT: sunpklo z0.h, z0.b
38 ; CHECK-NEXT: sunpklo z2.s, z1.h
39 ; CHECK-NEXT: sunpklo z3.s, z0.h
40 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
41 ; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
42 ; CHECK-NEXT: sunpklo z1.s, z1.h
43 ; CHECK-NEXT: sunpklo z0.s, z0.h
44 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
45 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
46 ; CHECK-NEXT: ptrue p0.h, vl4
47 ; CHECK-NEXT: uzp1 z1.h, z2.h, z2.h
48 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
49 ; CHECK-NEXT: splice z1.h, p0, z1.h, z0.h
50 ; CHECK-NEXT: uzp1 z0.b, z1.b, z1.b
51 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
53 %res = sdiv <8 x i8> %op1, %op2
57 define <16 x i8> @sdiv_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
58 ; CHECK-LABEL: sdiv_v16i8:
60 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
61 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
62 ; CHECK-NEXT: mov z2.d, z1.d
63 ; CHECK-NEXT: mov z3.d, z0.d
64 ; CHECK-NEXT: ptrue p0.s, vl4
65 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
66 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
67 ; CHECK-NEXT: sunpklo z1.h, z1.b
68 ; CHECK-NEXT: sunpklo z0.h, z0.b
69 ; CHECK-NEXT: sunpklo z2.h, z2.b
70 ; CHECK-NEXT: sunpklo z3.h, z3.b
71 ; CHECK-NEXT: sunpklo z4.s, z2.h
72 ; CHECK-NEXT: sunpklo z5.s, z3.h
73 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
74 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
75 ; CHECK-NEXT: sunpklo z2.s, z2.h
76 ; CHECK-NEXT: sunpklo z3.s, z3.h
77 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
78 ; CHECK-NEXT: sunpklo z5.s, z0.h
79 ; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
80 ; CHECK-NEXT: sunpklo z0.s, z0.h
81 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
82 ; CHECK-NEXT: sunpklo z3.s, z1.h
83 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
84 ; CHECK-NEXT: sunpklo z1.s, z1.h
85 ; CHECK-NEXT: sdivr z3.s, p0/m, z3.s, z5.s
86 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
87 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
88 ; CHECK-NEXT: ptrue p0.h, vl4
89 ; CHECK-NEXT: uzp1 z1.h, z4.h, z4.h
90 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
91 ; CHECK-NEXT: splice z1.h, p0, z1.h, z2.h
92 ; CHECK-NEXT: uzp1 z1.b, z1.b, z1.b
93 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
94 ; CHECK-NEXT: splice z3.h, p0, z3.h, z0.h
95 ; CHECK-NEXT: ptrue p0.b, vl8
96 ; CHECK-NEXT: uzp1 z0.b, z3.b, z3.b
97 ; CHECK-NEXT: splice z0.b, p0, z0.b, z1.b
98 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
100 %res = sdiv <16 x i8> %op1, %op2
104 define void @sdiv_v32i8(ptr %a, ptr %b) {
105 ; CHECK-LABEL: sdiv_v32i8:
107 ; CHECK-NEXT: ldp q6, q2, [x0]
108 ; CHECK-NEXT: ptrue p0.s, vl4
109 ; CHECK-NEXT: ldp q7, q3, [x1]
110 ; CHECK-NEXT: mov z1.d, z2.d
111 ; CHECK-NEXT: mov z16.d, z6.d
112 ; CHECK-NEXT: mov z0.d, z3.d
113 ; CHECK-NEXT: ext z1.b, z1.b, z2.b, #8
114 ; CHECK-NEXT: sunpklo z2.h, z2.b
115 ; CHECK-NEXT: ext z16.b, z16.b, z6.b, #8
116 ; CHECK-NEXT: ext z0.b, z0.b, z3.b, #8
117 ; CHECK-NEXT: sunpklo z3.h, z3.b
118 ; CHECK-NEXT: sunpklo z6.h, z6.b
119 ; CHECK-NEXT: sunpklo z1.h, z1.b
120 ; CHECK-NEXT: sunpklo z16.h, z16.b
121 ; CHECK-NEXT: sunpklo z4.h, z0.b
122 ; CHECK-NEXT: sunpklo z5.s, z1.h
123 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
124 ; CHECK-NEXT: sunpklo z18.s, z16.h
125 ; CHECK-NEXT: sunpklo z0.s, z4.h
126 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
127 ; CHECK-NEXT: ext z16.b, z16.b, z16.b, #8
128 ; CHECK-NEXT: sunpklo z1.s, z1.h
129 ; CHECK-NEXT: sunpklo z4.s, z4.h
130 ; CHECK-NEXT: sunpklo z16.s, z16.h
131 ; CHECK-NEXT: sdivr z0.s, p0/m, z0.s, z5.s
132 ; CHECK-NEXT: sunpklo z5.s, z2.h
133 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
134 ; CHECK-NEXT: sunpklo z2.s, z2.h
135 ; CHECK-NEXT: sdiv z1.s, p0/m, z1.s, z4.s
136 ; CHECK-NEXT: sunpklo z4.s, z3.h
137 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
138 ; CHECK-NEXT: sunpklo z3.s, z3.h
139 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
140 ; CHECK-NEXT: sdivr z4.s, p0/m, z4.s, z5.s
141 ; CHECK-NEXT: mov z5.d, z7.d
142 ; CHECK-NEXT: ext z5.b, z5.b, z7.b, #8
143 ; CHECK-NEXT: sunpklo z7.h, z7.b
144 ; CHECK-NEXT: uzp1 z1.h, z1.h, z1.h
145 ; CHECK-NEXT: sunpklo z5.h, z5.b
146 ; CHECK-NEXT: sunpklo z17.s, z5.h
147 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
148 ; CHECK-NEXT: sdiv z2.s, p0/m, z2.s, z3.s
149 ; CHECK-NEXT: sunpklo z5.s, z5.h
150 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
151 ; CHECK-NEXT: sdivr z17.s, p0/m, z17.s, z18.s
152 ; CHECK-NEXT: sunpklo z18.s, z6.h
153 ; CHECK-NEXT: ext z6.b, z6.b, z6.b, #8
154 ; CHECK-NEXT: sunpklo z6.s, z6.h
155 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
156 ; CHECK-NEXT: sdivr z5.s, p0/m, z5.s, z16.s
157 ; CHECK-NEXT: sunpklo z16.s, z7.h
158 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
159 ; CHECK-NEXT: sunpklo z7.s, z7.h
160 ; CHECK-NEXT: uzp1 z3.h, z17.h, z17.h
161 ; CHECK-NEXT: sdivr z16.s, p0/m, z16.s, z18.s
162 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
163 ; CHECK-NEXT: sdiv z6.s, p0/m, z6.s, z7.s
164 ; CHECK-NEXT: ptrue p0.h, vl4
165 ; CHECK-NEXT: uzp1 z7.h, z16.h, z16.h
166 ; CHECK-NEXT: splice z3.h, p0, z3.h, z5.h
167 ; CHECK-NEXT: splice z0.h, p0, z0.h, z1.h
168 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
169 ; CHECK-NEXT: uzp1 z1.b, z3.b, z3.b
170 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
171 ; CHECK-NEXT: uzp1 z3.b, z4.b, z4.b
172 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
173 ; CHECK-NEXT: splice z7.h, p0, z7.h, z6.h
174 ; CHECK-NEXT: ptrue p0.b, vl8
175 ; CHECK-NEXT: uzp1 z2.b, z7.b, z7.b
176 ; CHECK-NEXT: splice z3.b, p0, z3.b, z0.b
177 ; CHECK-NEXT: splice z2.b, p0, z2.b, z1.b
178 ; CHECK-NEXT: stp q2, q3, [x0]
180 %op1 = load <32 x i8>, ptr %a
181 %op2 = load <32 x i8>, ptr %b
182 %res = sdiv <32 x i8> %op1, %op2
183 store <32 x i8> %res, ptr %a
187 define <2 x i16> @sdiv_v2i16(<2 x i16> %op1, <2 x i16> %op2) {
188 ; CHECK-LABEL: sdiv_v2i16:
190 ; CHECK-NEXT: ptrue p0.s, vl2
191 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
192 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
193 ; CHECK-NEXT: sxth z1.s, p0/m, z1.s
194 ; CHECK-NEXT: sxth z0.s, p0/m, z0.s
195 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
196 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
198 %res = sdiv <2 x i16> %op1, %op2
202 define <4 x i16> @sdiv_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
203 ; CHECK-LABEL: sdiv_v4i16:
205 ; CHECK-NEXT: ptrue p0.s, vl4
206 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
207 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
208 ; CHECK-NEXT: sunpklo z1.s, z1.h
209 ; CHECK-NEXT: sunpklo z0.s, z0.h
210 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
211 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
212 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
214 %res = sdiv <4 x i16> %op1, %op2
218 define <8 x i16> @sdiv_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
219 ; CHECK-LABEL: sdiv_v8i16:
221 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
222 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
223 ; CHECK-NEXT: mov z2.d, z1.d
224 ; CHECK-NEXT: mov z3.d, z0.d
225 ; CHECK-NEXT: ptrue p0.s, vl4
226 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
227 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
228 ; CHECK-NEXT: sunpklo z1.s, z1.h
229 ; CHECK-NEXT: sunpklo z0.s, z0.h
230 ; CHECK-NEXT: sunpklo z2.s, z2.h
231 ; CHECK-NEXT: sunpklo z3.s, z3.h
232 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
233 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
234 ; CHECK-NEXT: ptrue p0.h, vl4
235 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
236 ; CHECK-NEXT: uzp1 z1.h, z2.h, z2.h
237 ; CHECK-NEXT: splice z0.h, p0, z0.h, z1.h
238 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
240 %res = sdiv <8 x i16> %op1, %op2
244 define void @sdiv_v16i16(ptr %a, ptr %b) {
245 ; CHECK-LABEL: sdiv_v16i16:
247 ; CHECK-NEXT: ldp q4, q1, [x1]
248 ; CHECK-NEXT: ptrue p0.s, vl4
249 ; CHECK-NEXT: ldr q0, [x0, #16]
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: ext z2.b, z2.b, z1.b, #8
254 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
255 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
256 ; CHECK-NEXT: sunpklo z4.s, z4.h
257 ; CHECK-NEXT: sunpklo z1.s, z1.h
258 ; CHECK-NEXT: sunpklo z0.s, z0.h
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: sdiv z0.s, p0/m, z0.s, z1.s
263 ; CHECK-NEXT: sdivr z2.s, p0/m, z2.s, z3.s
264 ; CHECK-NEXT: ldr q3, [x0]
265 ; CHECK-NEXT: mov z6.d, z3.d
266 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
267 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
268 ; CHECK-NEXT: sunpklo z3.s, z3.h
269 ; CHECK-NEXT: sunpklo z6.s, z6.h
270 ; CHECK-NEXT: sdivr z5.s, p0/m, z5.s, z6.s
271 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
272 ; CHECK-NEXT: sdiv z3.s, p0/m, z3.s, z4.s
273 ; CHECK-NEXT: ptrue p0.h, vl4
274 ; CHECK-NEXT: uzp1 z1.h, z5.h, z5.h
275 ; CHECK-NEXT: splice z0.h, p0, z0.h, z2.h
276 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
277 ; CHECK-NEXT: splice z3.h, p0, z3.h, z1.h
278 ; CHECK-NEXT: stp q3, q0, [x0]
280 %op1 = load <16 x i16>, ptr %a
281 %op2 = load <16 x i16>, ptr %b
282 %res = sdiv <16 x i16> %op1, %op2
283 store <16 x i16> %res, ptr %a
287 define <2 x i32> @sdiv_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
288 ; CHECK-LABEL: sdiv_v2i32:
290 ; CHECK-NEXT: ptrue p0.s, vl2
291 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
292 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
293 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
294 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
296 %res = sdiv <2 x i32> %op1, %op2
300 define <4 x i32> @sdiv_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
301 ; CHECK-LABEL: sdiv_v4i32:
303 ; CHECK-NEXT: ptrue p0.s, vl4
304 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
305 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
306 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
307 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
309 %res = sdiv <4 x i32> %op1, %op2
313 define void @sdiv_v8i32(ptr %a, ptr %b) {
314 ; CHECK-LABEL: sdiv_v8i32:
316 ; CHECK-NEXT: ptrue p0.s, vl4
317 ; CHECK-NEXT: ldp q0, q3, [x1]
318 ; CHECK-NEXT: ldp q1, q2, [x0]
319 ; CHECK-NEXT: sdivr z0.s, p0/m, z0.s, z1.s
320 ; CHECK-NEXT: movprfx z1, z2
321 ; CHECK-NEXT: sdiv z1.s, p0/m, z1.s, z3.s
322 ; CHECK-NEXT: stp q0, q1, [x0]
324 %op1 = load <8 x i32>, ptr %a
325 %op2 = load <8 x i32>, ptr %b
326 %res = sdiv <8 x i32> %op1, %op2
327 store <8 x i32> %res, ptr %a
331 define <1 x i64> @sdiv_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
332 ; CHECK-LABEL: sdiv_v1i64:
334 ; CHECK-NEXT: ptrue p0.d, vl1
335 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
336 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
337 ; CHECK-NEXT: sdiv z0.d, p0/m, z0.d, z1.d
338 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
340 %res = sdiv <1 x i64> %op1, %op2
344 define <2 x i64> @sdiv_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
345 ; CHECK-LABEL: sdiv_v2i64:
347 ; CHECK-NEXT: ptrue p0.d, vl2
348 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
349 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
350 ; CHECK-NEXT: sdiv z0.d, p0/m, z0.d, z1.d
351 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
353 %res = sdiv <2 x i64> %op1, %op2
357 define void @sdiv_v4i64(ptr %a, ptr %b) {
358 ; CHECK-LABEL: sdiv_v4i64:
360 ; CHECK-NEXT: ptrue p0.d, vl2
361 ; CHECK-NEXT: ldp q0, q3, [x1]
362 ; CHECK-NEXT: ldp q1, q2, [x0]
363 ; CHECK-NEXT: sdivr z0.d, p0/m, z0.d, z1.d
364 ; CHECK-NEXT: movprfx z1, z2
365 ; CHECK-NEXT: sdiv z1.d, p0/m, z1.d, z3.d
366 ; CHECK-NEXT: stp q0, q1, [x0]
368 %op1 = load <4 x i64>, ptr %a
369 %op2 = load <4 x i64>, ptr %b
370 %res = sdiv <4 x i64> %op1, %op2
371 store <4 x i64> %res, ptr %a
379 define <4 x i8> @udiv_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
380 ; CHECK-LABEL: udiv_v4i8:
382 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
383 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
384 ; CHECK-NEXT: ptrue p0.s, vl4
385 ; CHECK-NEXT: and z0.h, z0.h, #0xff
386 ; CHECK-NEXT: and z1.h, z1.h, #0xff
387 ; CHECK-NEXT: uunpklo z1.s, z1.h
388 ; CHECK-NEXT: uunpklo z0.s, z0.h
389 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
390 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
391 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
393 %res = udiv <4 x i8> %op1, %op2
397 define <8 x i8> @udiv_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
398 ; CHECK-LABEL: udiv_v8i8:
400 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
401 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
402 ; CHECK-NEXT: ptrue p0.s, vl4
403 ; CHECK-NEXT: uunpklo z1.h, z1.b
404 ; CHECK-NEXT: uunpklo z0.h, z0.b
405 ; CHECK-NEXT: uunpklo z2.s, z1.h
406 ; CHECK-NEXT: uunpklo z3.s, z0.h
407 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
408 ; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
409 ; CHECK-NEXT: uunpklo z1.s, z1.h
410 ; CHECK-NEXT: uunpklo z0.s, z0.h
411 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
412 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
413 ; CHECK-NEXT: ptrue p0.h, vl4
414 ; CHECK-NEXT: uzp1 z1.h, z2.h, z2.h
415 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
416 ; CHECK-NEXT: splice z1.h, p0, z1.h, z0.h
417 ; CHECK-NEXT: uzp1 z0.b, z1.b, z1.b
418 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
420 %res = udiv <8 x i8> %op1, %op2
424 define <16 x i8> @udiv_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
425 ; CHECK-LABEL: udiv_v16i8:
427 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
428 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
429 ; CHECK-NEXT: mov z2.d, z1.d
430 ; CHECK-NEXT: mov z3.d, z0.d
431 ; CHECK-NEXT: ptrue p0.s, vl4
432 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
433 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
434 ; CHECK-NEXT: uunpklo z1.h, z1.b
435 ; CHECK-NEXT: uunpklo z0.h, z0.b
436 ; CHECK-NEXT: uunpklo z2.h, z2.b
437 ; CHECK-NEXT: uunpklo z3.h, z3.b
438 ; CHECK-NEXT: uunpklo z4.s, z2.h
439 ; CHECK-NEXT: uunpklo z5.s, z3.h
440 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
441 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
442 ; CHECK-NEXT: uunpklo z2.s, z2.h
443 ; CHECK-NEXT: uunpklo z3.s, z3.h
444 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
445 ; CHECK-NEXT: uunpklo z5.s, z0.h
446 ; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
447 ; CHECK-NEXT: uunpklo z0.s, z0.h
448 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
449 ; CHECK-NEXT: uunpklo z3.s, z1.h
450 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
451 ; CHECK-NEXT: uunpklo z1.s, z1.h
452 ; CHECK-NEXT: udivr z3.s, p0/m, z3.s, z5.s
453 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
454 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
455 ; CHECK-NEXT: ptrue p0.h, vl4
456 ; CHECK-NEXT: uzp1 z1.h, z4.h, z4.h
457 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
458 ; CHECK-NEXT: splice z1.h, p0, z1.h, z2.h
459 ; CHECK-NEXT: uzp1 z1.b, z1.b, z1.b
460 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
461 ; CHECK-NEXT: splice z3.h, p0, z3.h, z0.h
462 ; CHECK-NEXT: ptrue p0.b, vl8
463 ; CHECK-NEXT: uzp1 z0.b, z3.b, z3.b
464 ; CHECK-NEXT: splice z0.b, p0, z0.b, z1.b
465 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
467 %res = udiv <16 x i8> %op1, %op2
471 define void @udiv_v32i8(ptr %a, ptr %b) {
472 ; CHECK-LABEL: udiv_v32i8:
474 ; CHECK-NEXT: ldp q6, q2, [x0]
475 ; CHECK-NEXT: ptrue p0.s, vl4
476 ; CHECK-NEXT: ldp q7, q3, [x1]
477 ; CHECK-NEXT: mov z1.d, z2.d
478 ; CHECK-NEXT: mov z16.d, z6.d
479 ; CHECK-NEXT: mov z0.d, z3.d
480 ; CHECK-NEXT: ext z1.b, z1.b, z2.b, #8
481 ; CHECK-NEXT: uunpklo z2.h, z2.b
482 ; CHECK-NEXT: ext z16.b, z16.b, z6.b, #8
483 ; CHECK-NEXT: ext z0.b, z0.b, z3.b, #8
484 ; CHECK-NEXT: uunpklo z3.h, z3.b
485 ; CHECK-NEXT: uunpklo z6.h, z6.b
486 ; CHECK-NEXT: uunpklo z1.h, z1.b
487 ; CHECK-NEXT: uunpklo z16.h, z16.b
488 ; CHECK-NEXT: uunpklo z4.h, z0.b
489 ; CHECK-NEXT: uunpklo z5.s, z1.h
490 ; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
491 ; CHECK-NEXT: uunpklo z18.s, z16.h
492 ; CHECK-NEXT: uunpklo z0.s, z4.h
493 ; CHECK-NEXT: ext z4.b, z4.b, z4.b, #8
494 ; CHECK-NEXT: ext z16.b, z16.b, z16.b, #8
495 ; CHECK-NEXT: uunpklo z1.s, z1.h
496 ; CHECK-NEXT: uunpklo z4.s, z4.h
497 ; CHECK-NEXT: uunpklo z16.s, z16.h
498 ; CHECK-NEXT: udivr z0.s, p0/m, z0.s, z5.s
499 ; CHECK-NEXT: uunpklo z5.s, z2.h
500 ; CHECK-NEXT: ext z2.b, z2.b, z2.b, #8
501 ; CHECK-NEXT: uunpklo z2.s, z2.h
502 ; CHECK-NEXT: udiv z1.s, p0/m, z1.s, z4.s
503 ; CHECK-NEXT: uunpklo z4.s, z3.h
504 ; CHECK-NEXT: ext z3.b, z3.b, z3.b, #8
505 ; CHECK-NEXT: uunpklo z3.s, z3.h
506 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
507 ; CHECK-NEXT: udivr z4.s, p0/m, z4.s, z5.s
508 ; CHECK-NEXT: mov z5.d, z7.d
509 ; CHECK-NEXT: ext z5.b, z5.b, z7.b, #8
510 ; CHECK-NEXT: uunpklo z7.h, z7.b
511 ; CHECK-NEXT: uzp1 z1.h, z1.h, z1.h
512 ; CHECK-NEXT: uunpklo z5.h, z5.b
513 ; CHECK-NEXT: uunpklo z17.s, z5.h
514 ; CHECK-NEXT: ext z5.b, z5.b, z5.b, #8
515 ; CHECK-NEXT: udiv z2.s, p0/m, z2.s, z3.s
516 ; CHECK-NEXT: uunpklo z5.s, z5.h
517 ; CHECK-NEXT: uzp1 z4.h, z4.h, z4.h
518 ; CHECK-NEXT: udivr z17.s, p0/m, z17.s, z18.s
519 ; CHECK-NEXT: uunpklo z18.s, z6.h
520 ; CHECK-NEXT: ext z6.b, z6.b, z6.b, #8
521 ; CHECK-NEXT: uunpklo z6.s, z6.h
522 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
523 ; CHECK-NEXT: udivr z5.s, p0/m, z5.s, z16.s
524 ; CHECK-NEXT: uunpklo z16.s, z7.h
525 ; CHECK-NEXT: ext z7.b, z7.b, z7.b, #8
526 ; CHECK-NEXT: uunpklo z7.s, z7.h
527 ; CHECK-NEXT: uzp1 z3.h, z17.h, z17.h
528 ; CHECK-NEXT: udivr z16.s, p0/m, z16.s, z18.s
529 ; CHECK-NEXT: uzp1 z5.h, z5.h, z5.h
530 ; CHECK-NEXT: udiv z6.s, p0/m, z6.s, z7.s
531 ; CHECK-NEXT: ptrue p0.h, vl4
532 ; CHECK-NEXT: uzp1 z7.h, z16.h, z16.h
533 ; CHECK-NEXT: splice z3.h, p0, z3.h, z5.h
534 ; CHECK-NEXT: splice z0.h, p0, z0.h, z1.h
535 ; CHECK-NEXT: splice z4.h, p0, z4.h, z2.h
536 ; CHECK-NEXT: uzp1 z1.b, z3.b, z3.b
537 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
538 ; CHECK-NEXT: uzp1 z3.b, z4.b, z4.b
539 ; CHECK-NEXT: uzp1 z6.h, z6.h, z6.h
540 ; CHECK-NEXT: splice z7.h, p0, z7.h, z6.h
541 ; CHECK-NEXT: ptrue p0.b, vl8
542 ; CHECK-NEXT: uzp1 z2.b, z7.b, z7.b
543 ; CHECK-NEXT: splice z3.b, p0, z3.b, z0.b
544 ; CHECK-NEXT: splice z2.b, p0, z2.b, z1.b
545 ; CHECK-NEXT: stp q2, q3, [x0]
547 %op1 = load <32 x i8>, ptr %a
548 %op2 = load <32 x i8>, ptr %b
549 %res = udiv <32 x i8> %op1, %op2
550 store <32 x i8> %res, ptr %a
554 define <2 x i16> @udiv_v2i16(<2 x i16> %op1, <2 x i16> %op2) {
555 ; CHECK-LABEL: udiv_v2i16:
557 ; CHECK-NEXT: ptrue p0.s, vl2
558 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
559 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
560 ; CHECK-NEXT: and z1.s, z1.s, #0xffff
561 ; CHECK-NEXT: and z0.s, z0.s, #0xffff
562 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
563 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
565 %res = udiv <2 x i16> %op1, %op2
569 define <4 x i16> @udiv_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
570 ; CHECK-LABEL: udiv_v4i16:
572 ; CHECK-NEXT: ptrue p0.s, vl4
573 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
574 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
575 ; CHECK-NEXT: uunpklo z1.s, z1.h
576 ; CHECK-NEXT: uunpklo z0.s, z0.h
577 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
578 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
579 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
581 %res = udiv <4 x i16> %op1, %op2
585 define <8 x i16> @udiv_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
586 ; CHECK-LABEL: udiv_v8i16:
588 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
589 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
590 ; CHECK-NEXT: mov z2.d, z1.d
591 ; CHECK-NEXT: mov z3.d, z0.d
592 ; CHECK-NEXT: ptrue p0.s, vl4
593 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
594 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
595 ; CHECK-NEXT: uunpklo z1.s, z1.h
596 ; CHECK-NEXT: uunpklo z0.s, z0.h
597 ; CHECK-NEXT: uunpklo z2.s, z2.h
598 ; CHECK-NEXT: uunpklo z3.s, z3.h
599 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
600 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
601 ; CHECK-NEXT: ptrue p0.h, vl4
602 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
603 ; CHECK-NEXT: uzp1 z1.h, z2.h, z2.h
604 ; CHECK-NEXT: splice z0.h, p0, z0.h, z1.h
605 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
607 %res = udiv <8 x i16> %op1, %op2
611 define void @udiv_v16i16(ptr %a, ptr %b) {
612 ; CHECK-LABEL: udiv_v16i16:
614 ; CHECK-NEXT: ldp q4, q1, [x1]
615 ; CHECK-NEXT: ptrue p0.s, vl4
616 ; CHECK-NEXT: ldr q0, [x0, #16]
617 ; CHECK-NEXT: mov z2.d, z1.d
618 ; CHECK-NEXT: mov z3.d, z0.d
619 ; CHECK-NEXT: mov z5.d, z4.d
620 ; CHECK-NEXT: ext z2.b, z2.b, z1.b, #8
621 ; CHECK-NEXT: ext z3.b, z3.b, z0.b, #8
622 ; CHECK-NEXT: ext z5.b, z5.b, z4.b, #8
623 ; CHECK-NEXT: uunpklo z4.s, z4.h
624 ; CHECK-NEXT: uunpklo z1.s, z1.h
625 ; CHECK-NEXT: uunpklo z0.s, z0.h
626 ; CHECK-NEXT: uunpklo z2.s, z2.h
627 ; CHECK-NEXT: uunpklo z3.s, z3.h
628 ; CHECK-NEXT: uunpklo z5.s, z5.h
629 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
630 ; CHECK-NEXT: udivr z2.s, p0/m, z2.s, z3.s
631 ; CHECK-NEXT: ldr q3, [x0]
632 ; CHECK-NEXT: mov z6.d, z3.d
633 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
634 ; CHECK-NEXT: ext z6.b, z6.b, z3.b, #8
635 ; CHECK-NEXT: uunpklo z3.s, z3.h
636 ; CHECK-NEXT: uunpklo z6.s, z6.h
637 ; CHECK-NEXT: udivr z5.s, p0/m, z5.s, z6.s
638 ; CHECK-NEXT: uzp1 z2.h, z2.h, z2.h
639 ; CHECK-NEXT: udiv z3.s, p0/m, z3.s, z4.s
640 ; CHECK-NEXT: ptrue p0.h, vl4
641 ; CHECK-NEXT: uzp1 z1.h, z5.h, z5.h
642 ; CHECK-NEXT: splice z0.h, p0, z0.h, z2.h
643 ; CHECK-NEXT: uzp1 z3.h, z3.h, z3.h
644 ; CHECK-NEXT: splice z3.h, p0, z3.h, z1.h
645 ; CHECK-NEXT: stp q3, q0, [x0]
647 %op1 = load <16 x i16>, ptr %a
648 %op2 = load <16 x i16>, ptr %b
649 %res = udiv <16 x i16> %op1, %op2
650 store <16 x i16> %res, ptr %a
654 define <2 x i32> @udiv_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
655 ; CHECK-LABEL: udiv_v2i32:
657 ; CHECK-NEXT: ptrue p0.s, vl2
658 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
659 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
660 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
661 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
663 %res = udiv <2 x i32> %op1, %op2
667 define <4 x i32> @udiv_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
668 ; CHECK-LABEL: udiv_v4i32:
670 ; CHECK-NEXT: ptrue p0.s, vl4
671 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
672 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
673 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
674 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
676 %res = udiv <4 x i32> %op1, %op2
680 define void @udiv_v8i32(ptr %a, ptr %b) {
681 ; CHECK-LABEL: udiv_v8i32:
683 ; CHECK-NEXT: ptrue p0.s, vl4
684 ; CHECK-NEXT: ldp q0, q3, [x1]
685 ; CHECK-NEXT: ldp q1, q2, [x0]
686 ; CHECK-NEXT: udivr z0.s, p0/m, z0.s, z1.s
687 ; CHECK-NEXT: movprfx z1, z2
688 ; CHECK-NEXT: udiv z1.s, p0/m, z1.s, z3.s
689 ; CHECK-NEXT: stp q0, q1, [x0]
691 %op1 = load <8 x i32>, ptr %a
692 %op2 = load <8 x i32>, ptr %b
693 %res = udiv <8 x i32> %op1, %op2
694 store <8 x i32> %res, ptr %a
698 define <1 x i64> @udiv_v1i64(<1 x i64> %op1, <1 x i64> %op2) {
699 ; CHECK-LABEL: udiv_v1i64:
701 ; CHECK-NEXT: ptrue p0.d, vl1
702 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
703 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
704 ; CHECK-NEXT: udiv z0.d, p0/m, z0.d, z1.d
705 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
707 %res = udiv <1 x i64> %op1, %op2
711 define <2 x i64> @udiv_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
712 ; CHECK-LABEL: udiv_v2i64:
714 ; CHECK-NEXT: ptrue p0.d, vl2
715 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
716 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
717 ; CHECK-NEXT: udiv z0.d, p0/m, z0.d, z1.d
718 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
720 %res = udiv <2 x i64> %op1, %op2
724 define void @udiv_v4i64(ptr %a, ptr %b) {
725 ; CHECK-LABEL: udiv_v4i64:
727 ; CHECK-NEXT: ptrue p0.d, vl2
728 ; CHECK-NEXT: ldp q0, q3, [x1]
729 ; CHECK-NEXT: ldp q1, q2, [x0]
730 ; CHECK-NEXT: udivr z0.d, p0/m, z0.d, z1.d
731 ; CHECK-NEXT: movprfx z1, z2
732 ; CHECK-NEXT: udiv z1.d, p0/m, z1.d, z3.d
733 ; CHECK-NEXT: stp q0, q1, [x0]
735 %op1 = load <4 x i64>, ptr %a
736 %op2 = load <4 x i64>, ptr %b
737 %res = udiv <4 x i64> %op1, %op2
738 store <4 x i64> %res, ptr %a
742 define void @udiv_constantsplat_v8i32(ptr %a) {
743 ; SVE-LABEL: udiv_constantsplat_v8i32:
745 ; SVE-NEXT: ptrue p0.s, vl4
746 ; SVE-NEXT: mov w8, #8969 // =0x2309
747 ; SVE-NEXT: movk w8, #22765, lsl #16
748 ; SVE-NEXT: ldp q1, q2, [x0]
749 ; SVE-NEXT: mov z0.s, w8
750 ; SVE-NEXT: movprfx z3, z1
751 ; SVE-NEXT: umulh z3.s, p0/m, z3.s, z0.s
752 ; SVE-NEXT: sub z1.s, z1.s, z3.s
753 ; SVE-NEXT: umulh z0.s, p0/m, z0.s, z2.s
754 ; SVE-NEXT: lsr z1.s, z1.s, #1
755 ; SVE-NEXT: sub z2.s, z2.s, z0.s
756 ; SVE-NEXT: add z1.s, z1.s, z3.s
757 ; SVE-NEXT: lsr z2.s, z2.s, #1
758 ; SVE-NEXT: lsr z1.s, z1.s, #6
759 ; SVE-NEXT: add z0.s, z2.s, z0.s
760 ; SVE-NEXT: lsr z0.s, z0.s, #6
761 ; SVE-NEXT: stp q1, q0, [x0]
764 ; SVE2-LABEL: udiv_constantsplat_v8i32:
766 ; SVE2-NEXT: mov w8, #8969 // =0x2309
767 ; SVE2-NEXT: ldp q1, q2, [x0]
768 ; SVE2-NEXT: movk w8, #22765, lsl #16
769 ; SVE2-NEXT: mov z0.s, w8
770 ; SVE2-NEXT: umulh z3.s, z1.s, z0.s
771 ; SVE2-NEXT: umulh z0.s, z2.s, z0.s
772 ; SVE2-NEXT: sub z1.s, z1.s, z3.s
773 ; SVE2-NEXT: sub z2.s, z2.s, z0.s
774 ; SVE2-NEXT: usra z3.s, z1.s, #1
775 ; SVE2-NEXT: usra z0.s, z2.s, #1
776 ; SVE2-NEXT: lsr z1.s, z3.s, #6
777 ; SVE2-NEXT: lsr z0.s, z0.s, #6
778 ; SVE2-NEXT: stp q1, q0, [x0]
780 %op1 = load <8 x i32>, ptr %a
781 %res = udiv <8 x i32> %op1, <i32 95, i32 95, i32 95, i32 95, i32 95, i32 95, i32 95, i32 95>
782 store <8 x i32> %res, ptr %a