1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming < %s | FileCheck %s
4 ; RUN: llc -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
7 target triple = "aarch64-unknown-linux-gnu"
9 define <4 x i8> @sdiv_v4i8(<4 x i8> %op1) {
10 ; CHECK-LABEL: sdiv_v4i8:
12 ; CHECK-NEXT: ptrue p0.h, vl4
13 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
14 ; CHECK-NEXT: sxtb z0.h, p0/m, z0.h
15 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
16 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
19 ; NONEON-NOSVE-LABEL: sdiv_v4i8:
20 ; NONEON-NOSVE: // %bb.0:
21 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
22 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
23 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
24 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #4]
25 ; NONEON-NOSVE-NEXT: ldrh w10, [sp, #2]
26 ; NONEON-NOSVE-NEXT: ldrh w12, [sp]
27 ; NONEON-NOSVE-NEXT: sxtb w11, w8
28 ; NONEON-NOSVE-NEXT: sxtb w13, w9
29 ; NONEON-NOSVE-NEXT: sxtb w14, w10
30 ; NONEON-NOSVE-NEXT: sxtb w15, w12
31 ; NONEON-NOSVE-NEXT: ubfx w11, w11, #10, #5
32 ; NONEON-NOSVE-NEXT: ubfx w13, w13, #10, #5
33 ; NONEON-NOSVE-NEXT: ubfx w14, w14, #10, #5
34 ; NONEON-NOSVE-NEXT: add w8, w8, w11
35 ; NONEON-NOSVE-NEXT: ubfx w11, w15, #10, #5
36 ; NONEON-NOSVE-NEXT: add w9, w9, w13
37 ; NONEON-NOSVE-NEXT: sxtb w8, w8
38 ; NONEON-NOSVE-NEXT: add w10, w10, w14
39 ; NONEON-NOSVE-NEXT: sxtb w9, w9
40 ; NONEON-NOSVE-NEXT: add w11, w12, w11
41 ; NONEON-NOSVE-NEXT: sxtb w10, w10
42 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
43 ; NONEON-NOSVE-NEXT: sxtb w11, w11
44 ; NONEON-NOSVE-NEXT: lsr w9, w9, #5
45 ; NONEON-NOSVE-NEXT: lsr w10, w10, #5
46 ; NONEON-NOSVE-NEXT: strh w8, [sp, #14]
47 ; NONEON-NOSVE-NEXT: lsr w8, w11, #5
48 ; NONEON-NOSVE-NEXT: strh w9, [sp, #12]
49 ; NONEON-NOSVE-NEXT: strh w10, [sp, #10]
50 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
51 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
52 ; NONEON-NOSVE-NEXT: add sp, sp, #16
53 ; NONEON-NOSVE-NEXT: ret
54 %res = sdiv <4 x i8> %op1, shufflevector (<4 x i8> insertelement (<4 x i8> poison, i8 32, i32 0), <4 x i8> poison, <4 x i32> zeroinitializer)
58 define <8 x i8> @sdiv_v8i8(<8 x i8> %op1) {
59 ; CHECK-LABEL: sdiv_v8i8:
61 ; CHECK-NEXT: ptrue p0.b, vl8
62 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
63 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
64 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
67 ; NONEON-NOSVE-LABEL: sdiv_v8i8:
68 ; NONEON-NOSVE: // %bb.0:
69 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
70 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
71 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #7]
72 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
73 ; NONEON-NOSVE-NEXT: add w8, w8, w9
74 ; NONEON-NOSVE-NEXT: sxtb w8, w8
75 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
76 ; NONEON-NOSVE-NEXT: strb w8, [sp, #15]
77 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #6]
78 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
79 ; NONEON-NOSVE-NEXT: add w8, w8, w9
80 ; NONEON-NOSVE-NEXT: sxtb w8, w8
81 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
82 ; NONEON-NOSVE-NEXT: strb w8, [sp, #14]
83 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #5]
84 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
85 ; NONEON-NOSVE-NEXT: add w8, w8, w9
86 ; NONEON-NOSVE-NEXT: sxtb w8, w8
87 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
88 ; NONEON-NOSVE-NEXT: strb w8, [sp, #13]
89 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #4]
90 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
91 ; NONEON-NOSVE-NEXT: add w8, w8, w9
92 ; NONEON-NOSVE-NEXT: sxtb w8, w8
93 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
94 ; NONEON-NOSVE-NEXT: strb w8, [sp, #12]
95 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #3]
96 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
97 ; NONEON-NOSVE-NEXT: add w8, w8, w9
98 ; NONEON-NOSVE-NEXT: sxtb w8, w8
99 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
100 ; NONEON-NOSVE-NEXT: strb w8, [sp, #11]
101 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #2]
102 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
103 ; NONEON-NOSVE-NEXT: add w8, w8, w9
104 ; NONEON-NOSVE-NEXT: sxtb w8, w8
105 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
106 ; NONEON-NOSVE-NEXT: strb w8, [sp, #10]
107 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #1]
108 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
109 ; NONEON-NOSVE-NEXT: add w8, w8, w9
110 ; NONEON-NOSVE-NEXT: sxtb w8, w8
111 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
112 ; NONEON-NOSVE-NEXT: strb w8, [sp, #9]
113 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp]
114 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
115 ; NONEON-NOSVE-NEXT: add w8, w8, w9
116 ; NONEON-NOSVE-NEXT: sxtb w8, w8
117 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
118 ; NONEON-NOSVE-NEXT: strb w8, [sp, #8]
119 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
120 ; NONEON-NOSVE-NEXT: add sp, sp, #16
121 ; NONEON-NOSVE-NEXT: ret
122 %res = sdiv <8 x i8> %op1, shufflevector (<8 x i8> insertelement (<8 x i8> poison, i8 32, i32 0), <8 x i8> poison, <8 x i32> zeroinitializer)
126 define <16 x i8> @sdiv_v16i8(<16 x i8> %op1) {
127 ; CHECK-LABEL: sdiv_v16i8:
129 ; CHECK-NEXT: ptrue p0.b, vl16
130 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
131 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
132 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
135 ; NONEON-NOSVE-LABEL: sdiv_v16i8:
136 ; NONEON-NOSVE: // %bb.0:
137 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
138 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
139 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #15]
140 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
141 ; NONEON-NOSVE-NEXT: add w8, w8, w9
142 ; NONEON-NOSVE-NEXT: sxtb w8, w8
143 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
144 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
145 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #14]
146 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
147 ; NONEON-NOSVE-NEXT: add w8, w8, w9
148 ; NONEON-NOSVE-NEXT: sxtb w8, w8
149 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
150 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
151 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #13]
152 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
153 ; NONEON-NOSVE-NEXT: add w8, w8, w9
154 ; NONEON-NOSVE-NEXT: sxtb w8, w8
155 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
156 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
157 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #12]
158 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
159 ; NONEON-NOSVE-NEXT: add w8, w8, w9
160 ; NONEON-NOSVE-NEXT: sxtb w8, w8
161 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
162 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
163 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #11]
164 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
165 ; NONEON-NOSVE-NEXT: add w8, w8, w9
166 ; NONEON-NOSVE-NEXT: sxtb w8, w8
167 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
168 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
169 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #10]
170 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
171 ; NONEON-NOSVE-NEXT: add w8, w8, w9
172 ; NONEON-NOSVE-NEXT: sxtb w8, w8
173 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
174 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
175 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #9]
176 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
177 ; NONEON-NOSVE-NEXT: add w8, w8, w9
178 ; NONEON-NOSVE-NEXT: sxtb w8, w8
179 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
180 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
181 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #8]
182 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
183 ; NONEON-NOSVE-NEXT: add w8, w8, w9
184 ; NONEON-NOSVE-NEXT: sxtb w8, w8
185 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
186 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
187 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #7]
188 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
189 ; NONEON-NOSVE-NEXT: add w8, w8, w9
190 ; NONEON-NOSVE-NEXT: sxtb w8, w8
191 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
192 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
193 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #6]
194 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
195 ; NONEON-NOSVE-NEXT: add w8, w8, w9
196 ; NONEON-NOSVE-NEXT: sxtb w8, w8
197 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
198 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
199 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #5]
200 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
201 ; NONEON-NOSVE-NEXT: add w8, w8, w9
202 ; NONEON-NOSVE-NEXT: sxtb w8, w8
203 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
204 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
205 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #4]
206 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
207 ; NONEON-NOSVE-NEXT: add w8, w8, w9
208 ; NONEON-NOSVE-NEXT: sxtb w8, w8
209 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
210 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
211 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #3]
212 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
213 ; NONEON-NOSVE-NEXT: add w8, w8, w9
214 ; NONEON-NOSVE-NEXT: sxtb w8, w8
215 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
216 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
217 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #2]
218 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
219 ; NONEON-NOSVE-NEXT: add w8, w8, w9
220 ; NONEON-NOSVE-NEXT: sxtb w8, w8
221 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
222 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
223 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #1]
224 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
225 ; NONEON-NOSVE-NEXT: add w8, w8, w9
226 ; NONEON-NOSVE-NEXT: sxtb w8, w8
227 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
228 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
229 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp]
230 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
231 ; NONEON-NOSVE-NEXT: add w8, w8, w9
232 ; NONEON-NOSVE-NEXT: sxtb w8, w8
233 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
234 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
235 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
236 ; NONEON-NOSVE-NEXT: add sp, sp, #32
237 ; NONEON-NOSVE-NEXT: ret
238 %res = sdiv <16 x i8> %op1, shufflevector (<16 x i8> insertelement (<16 x i8> poison, i8 32, i32 0), <16 x i8> poison, <16 x i32> zeroinitializer)
242 define void @sdiv_v32i8(ptr %a) {
243 ; CHECK-LABEL: sdiv_v32i8:
245 ; CHECK-NEXT: ldp q0, q1, [x0]
246 ; CHECK-NEXT: ptrue p0.b, vl16
247 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
248 ; CHECK-NEXT: asrd z1.b, p0/m, z1.b, #5
249 ; CHECK-NEXT: stp q0, q1, [x0]
252 ; NONEON-NOSVE-LABEL: sdiv_v32i8:
253 ; NONEON-NOSVE: // %bb.0:
254 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
255 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
256 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
257 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #31]
258 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
259 ; NONEON-NOSVE-NEXT: add w8, w8, w9
260 ; NONEON-NOSVE-NEXT: sxtb w8, w8
261 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
262 ; NONEON-NOSVE-NEXT: strb w8, [sp, #63]
263 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #30]
264 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
265 ; NONEON-NOSVE-NEXT: add w8, w8, w9
266 ; NONEON-NOSVE-NEXT: sxtb w8, w8
267 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
268 ; NONEON-NOSVE-NEXT: strb w8, [sp, #62]
269 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #29]
270 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
271 ; NONEON-NOSVE-NEXT: add w8, w8, w9
272 ; NONEON-NOSVE-NEXT: sxtb w8, w8
273 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
274 ; NONEON-NOSVE-NEXT: strb w8, [sp, #61]
275 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #28]
276 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
277 ; NONEON-NOSVE-NEXT: add w8, w8, w9
278 ; NONEON-NOSVE-NEXT: sxtb w8, w8
279 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
280 ; NONEON-NOSVE-NEXT: strb w8, [sp, #60]
281 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #27]
282 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
283 ; NONEON-NOSVE-NEXT: add w8, w8, w9
284 ; NONEON-NOSVE-NEXT: sxtb w8, w8
285 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
286 ; NONEON-NOSVE-NEXT: strb w8, [sp, #59]
287 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #26]
288 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
289 ; NONEON-NOSVE-NEXT: add w8, w8, w9
290 ; NONEON-NOSVE-NEXT: sxtb w8, w8
291 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
292 ; NONEON-NOSVE-NEXT: strb w8, [sp, #58]
293 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #25]
294 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
295 ; NONEON-NOSVE-NEXT: add w8, w8, w9
296 ; NONEON-NOSVE-NEXT: sxtb w8, w8
297 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
298 ; NONEON-NOSVE-NEXT: strb w8, [sp, #57]
299 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #24]
300 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
301 ; NONEON-NOSVE-NEXT: add w8, w8, w9
302 ; NONEON-NOSVE-NEXT: sxtb w8, w8
303 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
304 ; NONEON-NOSVE-NEXT: strb w8, [sp, #56]
305 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #23]
306 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
307 ; NONEON-NOSVE-NEXT: add w8, w8, w9
308 ; NONEON-NOSVE-NEXT: sxtb w8, w8
309 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
310 ; NONEON-NOSVE-NEXT: strb w8, [sp, #55]
311 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #22]
312 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
313 ; NONEON-NOSVE-NEXT: add w8, w8, w9
314 ; NONEON-NOSVE-NEXT: sxtb w8, w8
315 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
316 ; NONEON-NOSVE-NEXT: strb w8, [sp, #54]
317 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #21]
318 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
319 ; NONEON-NOSVE-NEXT: add w8, w8, w9
320 ; NONEON-NOSVE-NEXT: sxtb w8, w8
321 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
322 ; NONEON-NOSVE-NEXT: strb w8, [sp, #53]
323 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #20]
324 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
325 ; NONEON-NOSVE-NEXT: add w8, w8, w9
326 ; NONEON-NOSVE-NEXT: sxtb w8, w8
327 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
328 ; NONEON-NOSVE-NEXT: strb w8, [sp, #52]
329 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #19]
330 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
331 ; NONEON-NOSVE-NEXT: add w8, w8, w9
332 ; NONEON-NOSVE-NEXT: sxtb w8, w8
333 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
334 ; NONEON-NOSVE-NEXT: strb w8, [sp, #51]
335 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #18]
336 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
337 ; NONEON-NOSVE-NEXT: add w8, w8, w9
338 ; NONEON-NOSVE-NEXT: sxtb w8, w8
339 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
340 ; NONEON-NOSVE-NEXT: strb w8, [sp, #50]
341 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #17]
342 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
343 ; NONEON-NOSVE-NEXT: add w8, w8, w9
344 ; NONEON-NOSVE-NEXT: sxtb w8, w8
345 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
346 ; NONEON-NOSVE-NEXT: strb w8, [sp, #49]
347 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #16]
348 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
349 ; NONEON-NOSVE-NEXT: add w8, w8, w9
350 ; NONEON-NOSVE-NEXT: sxtb w8, w8
351 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
352 ; NONEON-NOSVE-NEXT: strb w8, [sp, #48]
353 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #15]
354 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
355 ; NONEON-NOSVE-NEXT: add w8, w8, w9
356 ; NONEON-NOSVE-NEXT: sxtb w8, w8
357 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
358 ; NONEON-NOSVE-NEXT: strb w8, [sp, #47]
359 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #14]
360 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
361 ; NONEON-NOSVE-NEXT: add w8, w8, w9
362 ; NONEON-NOSVE-NEXT: sxtb w8, w8
363 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
364 ; NONEON-NOSVE-NEXT: strb w8, [sp, #46]
365 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #13]
366 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
367 ; NONEON-NOSVE-NEXT: add w8, w8, w9
368 ; NONEON-NOSVE-NEXT: sxtb w8, w8
369 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
370 ; NONEON-NOSVE-NEXT: strb w8, [sp, #45]
371 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #12]
372 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
373 ; NONEON-NOSVE-NEXT: add w8, w8, w9
374 ; NONEON-NOSVE-NEXT: sxtb w8, w8
375 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
376 ; NONEON-NOSVE-NEXT: strb w8, [sp, #44]
377 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #11]
378 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
379 ; NONEON-NOSVE-NEXT: add w8, w8, w9
380 ; NONEON-NOSVE-NEXT: sxtb w8, w8
381 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
382 ; NONEON-NOSVE-NEXT: strb w8, [sp, #43]
383 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #10]
384 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
385 ; NONEON-NOSVE-NEXT: add w8, w8, w9
386 ; NONEON-NOSVE-NEXT: sxtb w8, w8
387 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
388 ; NONEON-NOSVE-NEXT: strb w8, [sp, #42]
389 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #9]
390 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
391 ; NONEON-NOSVE-NEXT: add w8, w8, w9
392 ; NONEON-NOSVE-NEXT: sxtb w8, w8
393 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
394 ; NONEON-NOSVE-NEXT: strb w8, [sp, #41]
395 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #8]
396 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
397 ; NONEON-NOSVE-NEXT: add w8, w8, w9
398 ; NONEON-NOSVE-NEXT: sxtb w8, w8
399 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
400 ; NONEON-NOSVE-NEXT: strb w8, [sp, #40]
401 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #7]
402 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
403 ; NONEON-NOSVE-NEXT: add w8, w8, w9
404 ; NONEON-NOSVE-NEXT: sxtb w8, w8
405 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
406 ; NONEON-NOSVE-NEXT: strb w8, [sp, #39]
407 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #6]
408 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
409 ; NONEON-NOSVE-NEXT: add w8, w8, w9
410 ; NONEON-NOSVE-NEXT: sxtb w8, w8
411 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
412 ; NONEON-NOSVE-NEXT: strb w8, [sp, #38]
413 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #5]
414 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
415 ; NONEON-NOSVE-NEXT: add w8, w8, w9
416 ; NONEON-NOSVE-NEXT: sxtb w8, w8
417 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
418 ; NONEON-NOSVE-NEXT: strb w8, [sp, #37]
419 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #4]
420 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
421 ; NONEON-NOSVE-NEXT: add w8, w8, w9
422 ; NONEON-NOSVE-NEXT: sxtb w8, w8
423 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
424 ; NONEON-NOSVE-NEXT: strb w8, [sp, #36]
425 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #3]
426 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
427 ; NONEON-NOSVE-NEXT: add w8, w8, w9
428 ; NONEON-NOSVE-NEXT: sxtb w8, w8
429 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
430 ; NONEON-NOSVE-NEXT: strb w8, [sp, #35]
431 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #2]
432 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
433 ; NONEON-NOSVE-NEXT: add w8, w8, w9
434 ; NONEON-NOSVE-NEXT: sxtb w8, w8
435 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
436 ; NONEON-NOSVE-NEXT: strb w8, [sp, #34]
437 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp, #1]
438 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
439 ; NONEON-NOSVE-NEXT: add w8, w8, w9
440 ; NONEON-NOSVE-NEXT: sxtb w8, w8
441 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
442 ; NONEON-NOSVE-NEXT: strb w8, [sp, #33]
443 ; NONEON-NOSVE-NEXT: ldrsb w8, [sp]
444 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #10, #5
445 ; NONEON-NOSVE-NEXT: add w8, w8, w9
446 ; NONEON-NOSVE-NEXT: sxtb w8, w8
447 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
448 ; NONEON-NOSVE-NEXT: strb w8, [sp, #32]
449 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
450 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
451 ; NONEON-NOSVE-NEXT: add sp, sp, #64
452 ; NONEON-NOSVE-NEXT: ret
453 %op1 = load <32 x i8>, ptr %a
454 %res = sdiv <32 x i8> %op1, shufflevector (<32 x i8> insertelement (<32 x i8> poison, i8 32, i32 0), <32 x i8> poison, <32 x i32> zeroinitializer)
455 store <32 x i8> %res, ptr %a
459 define <2 x i16> @sdiv_v2i16(<2 x i16> %op1) {
460 ; CHECK-LABEL: sdiv_v2i16:
462 ; CHECK-NEXT: ptrue p0.s, vl2
463 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
464 ; CHECK-NEXT: sxth z0.s, p0/m, z0.s
465 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
466 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
469 ; NONEON-NOSVE-LABEL: sdiv_v2i16:
470 ; NONEON-NOSVE: // %bb.0:
471 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
472 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
473 ; NONEON-NOSVE-NEXT: ldp w9, w8, [sp]
474 ; NONEON-NOSVE-NEXT: sxth w10, w8
475 ; NONEON-NOSVE-NEXT: sxth w11, w9
476 ; NONEON-NOSVE-NEXT: ubfx w10, w10, #26, #5
477 ; NONEON-NOSVE-NEXT: ubfx w11, w11, #26, #5
478 ; NONEON-NOSVE-NEXT: add w8, w8, w10
479 ; NONEON-NOSVE-NEXT: add w9, w9, w11
480 ; NONEON-NOSVE-NEXT: sbfx w8, w8, #5, #11
481 ; NONEON-NOSVE-NEXT: sbfx w9, w9, #5, #11
482 ; NONEON-NOSVE-NEXT: stp w9, w8, [sp, #8]
483 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
484 ; NONEON-NOSVE-NEXT: add sp, sp, #16
485 ; NONEON-NOSVE-NEXT: ret
486 %res = sdiv <2 x i16> %op1, shufflevector (<2 x i16> insertelement (<2 x i16> poison, i16 32, i32 0), <2 x i16> poison, <2 x i32> zeroinitializer)
490 define <4 x i16> @sdiv_v4i16(<4 x i16> %op1) {
491 ; CHECK-LABEL: sdiv_v4i16:
493 ; CHECK-NEXT: ptrue p0.h, vl4
494 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
495 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
496 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
499 ; NONEON-NOSVE-LABEL: sdiv_v4i16:
500 ; NONEON-NOSVE: // %bb.0:
501 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
502 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
503 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #6]
504 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
505 ; NONEON-NOSVE-NEXT: add w8, w8, w9
506 ; NONEON-NOSVE-NEXT: sxth w8, w8
507 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
508 ; NONEON-NOSVE-NEXT: strh w8, [sp, #14]
509 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #4]
510 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
511 ; NONEON-NOSVE-NEXT: add w8, w8, w9
512 ; NONEON-NOSVE-NEXT: sxth w8, w8
513 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
514 ; NONEON-NOSVE-NEXT: strh w8, [sp, #12]
515 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #2]
516 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
517 ; NONEON-NOSVE-NEXT: add w8, w8, w9
518 ; NONEON-NOSVE-NEXT: sxth w8, w8
519 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
520 ; NONEON-NOSVE-NEXT: strh w8, [sp, #10]
521 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp]
522 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
523 ; NONEON-NOSVE-NEXT: add w8, w8, w9
524 ; NONEON-NOSVE-NEXT: sxth w8, w8
525 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
526 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
527 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
528 ; NONEON-NOSVE-NEXT: add sp, sp, #16
529 ; NONEON-NOSVE-NEXT: ret
530 %res = sdiv <4 x i16> %op1, shufflevector (<4 x i16> insertelement (<4 x i16> poison, i16 32, i32 0), <4 x i16> poison, <4 x i32> zeroinitializer)
534 define <8 x i16> @sdiv_v8i16(<8 x i16> %op1) {
535 ; CHECK-LABEL: sdiv_v8i16:
537 ; CHECK-NEXT: ptrue p0.h, vl8
538 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
539 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
540 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
543 ; NONEON-NOSVE-LABEL: sdiv_v8i16:
544 ; NONEON-NOSVE: // %bb.0:
545 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
546 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
547 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #14]
548 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
549 ; NONEON-NOSVE-NEXT: add w8, w8, w9
550 ; NONEON-NOSVE-NEXT: sxth w8, w8
551 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
552 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
553 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #12]
554 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
555 ; NONEON-NOSVE-NEXT: add w8, w8, w9
556 ; NONEON-NOSVE-NEXT: sxth w8, w8
557 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
558 ; NONEON-NOSVE-NEXT: strh w8, [sp, #28]
559 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #10]
560 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
561 ; NONEON-NOSVE-NEXT: add w8, w8, w9
562 ; NONEON-NOSVE-NEXT: sxth w8, w8
563 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
564 ; NONEON-NOSVE-NEXT: strh w8, [sp, #26]
565 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #8]
566 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
567 ; NONEON-NOSVE-NEXT: add w8, w8, w9
568 ; NONEON-NOSVE-NEXT: sxth w8, w8
569 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
570 ; NONEON-NOSVE-NEXT: strh w8, [sp, #24]
571 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #6]
572 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
573 ; NONEON-NOSVE-NEXT: add w8, w8, w9
574 ; NONEON-NOSVE-NEXT: sxth w8, w8
575 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
576 ; NONEON-NOSVE-NEXT: strh w8, [sp, #22]
577 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #4]
578 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
579 ; NONEON-NOSVE-NEXT: add w8, w8, w9
580 ; NONEON-NOSVE-NEXT: sxth w8, w8
581 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
582 ; NONEON-NOSVE-NEXT: strh w8, [sp, #20]
583 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #2]
584 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
585 ; NONEON-NOSVE-NEXT: add w8, w8, w9
586 ; NONEON-NOSVE-NEXT: sxth w8, w8
587 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
588 ; NONEON-NOSVE-NEXT: strh w8, [sp, #18]
589 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp]
590 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
591 ; NONEON-NOSVE-NEXT: add w8, w8, w9
592 ; NONEON-NOSVE-NEXT: sxth w8, w8
593 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
594 ; NONEON-NOSVE-NEXT: strh w8, [sp, #16]
595 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
596 ; NONEON-NOSVE-NEXT: add sp, sp, #32
597 ; NONEON-NOSVE-NEXT: ret
598 %res = sdiv <8 x i16> %op1, shufflevector (<8 x i16> insertelement (<8 x i16> poison, i16 32, i32 0), <8 x i16> poison, <8 x i32> zeroinitializer)
602 define void @sdiv_v16i16(ptr %a) {
603 ; CHECK-LABEL: sdiv_v16i16:
605 ; CHECK-NEXT: ldp q0, q1, [x0]
606 ; CHECK-NEXT: ptrue p0.h, vl8
607 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
608 ; CHECK-NEXT: asrd z1.h, p0/m, z1.h, #5
609 ; CHECK-NEXT: stp q0, q1, [x0]
612 ; NONEON-NOSVE-LABEL: sdiv_v16i16:
613 ; NONEON-NOSVE: // %bb.0:
614 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
615 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
616 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
617 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #30]
618 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
619 ; NONEON-NOSVE-NEXT: add w8, w8, w9
620 ; NONEON-NOSVE-NEXT: sxth w8, w8
621 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
622 ; NONEON-NOSVE-NEXT: strh w8, [sp, #62]
623 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #28]
624 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
625 ; NONEON-NOSVE-NEXT: add w8, w8, w9
626 ; NONEON-NOSVE-NEXT: sxth w8, w8
627 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
628 ; NONEON-NOSVE-NEXT: strh w8, [sp, #60]
629 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #26]
630 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
631 ; NONEON-NOSVE-NEXT: add w8, w8, w9
632 ; NONEON-NOSVE-NEXT: sxth w8, w8
633 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
634 ; NONEON-NOSVE-NEXT: strh w8, [sp, #58]
635 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #24]
636 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
637 ; NONEON-NOSVE-NEXT: add w8, w8, w9
638 ; NONEON-NOSVE-NEXT: sxth w8, w8
639 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
640 ; NONEON-NOSVE-NEXT: strh w8, [sp, #56]
641 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #22]
642 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
643 ; NONEON-NOSVE-NEXT: add w8, w8, w9
644 ; NONEON-NOSVE-NEXT: sxth w8, w8
645 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
646 ; NONEON-NOSVE-NEXT: strh w8, [sp, #54]
647 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #20]
648 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
649 ; NONEON-NOSVE-NEXT: add w8, w8, w9
650 ; NONEON-NOSVE-NEXT: sxth w8, w8
651 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
652 ; NONEON-NOSVE-NEXT: strh w8, [sp, #52]
653 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #18]
654 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
655 ; NONEON-NOSVE-NEXT: add w8, w8, w9
656 ; NONEON-NOSVE-NEXT: sxth w8, w8
657 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
658 ; NONEON-NOSVE-NEXT: strh w8, [sp, #50]
659 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #16]
660 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
661 ; NONEON-NOSVE-NEXT: add w8, w8, w9
662 ; NONEON-NOSVE-NEXT: sxth w8, w8
663 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
664 ; NONEON-NOSVE-NEXT: strh w8, [sp, #48]
665 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #14]
666 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
667 ; NONEON-NOSVE-NEXT: add w8, w8, w9
668 ; NONEON-NOSVE-NEXT: sxth w8, w8
669 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
670 ; NONEON-NOSVE-NEXT: strh w8, [sp, #46]
671 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #12]
672 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
673 ; NONEON-NOSVE-NEXT: add w8, w8, w9
674 ; NONEON-NOSVE-NEXT: sxth w8, w8
675 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
676 ; NONEON-NOSVE-NEXT: strh w8, [sp, #44]
677 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #10]
678 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
679 ; NONEON-NOSVE-NEXT: add w8, w8, w9
680 ; NONEON-NOSVE-NEXT: sxth w8, w8
681 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
682 ; NONEON-NOSVE-NEXT: strh w8, [sp, #42]
683 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #8]
684 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
685 ; NONEON-NOSVE-NEXT: add w8, w8, w9
686 ; NONEON-NOSVE-NEXT: sxth w8, w8
687 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
688 ; NONEON-NOSVE-NEXT: strh w8, [sp, #40]
689 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #6]
690 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
691 ; NONEON-NOSVE-NEXT: add w8, w8, w9
692 ; NONEON-NOSVE-NEXT: sxth w8, w8
693 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
694 ; NONEON-NOSVE-NEXT: strh w8, [sp, #38]
695 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #4]
696 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
697 ; NONEON-NOSVE-NEXT: add w8, w8, w9
698 ; NONEON-NOSVE-NEXT: sxth w8, w8
699 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
700 ; NONEON-NOSVE-NEXT: strh w8, [sp, #36]
701 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp, #2]
702 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
703 ; NONEON-NOSVE-NEXT: add w8, w8, w9
704 ; NONEON-NOSVE-NEXT: sxth w8, w8
705 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
706 ; NONEON-NOSVE-NEXT: strh w8, [sp, #34]
707 ; NONEON-NOSVE-NEXT: ldrsh w8, [sp]
708 ; NONEON-NOSVE-NEXT: ubfx w9, w8, #26, #5
709 ; NONEON-NOSVE-NEXT: add w8, w8, w9
710 ; NONEON-NOSVE-NEXT: sxth w8, w8
711 ; NONEON-NOSVE-NEXT: lsr w8, w8, #5
712 ; NONEON-NOSVE-NEXT: strh w8, [sp, #32]
713 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
714 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
715 ; NONEON-NOSVE-NEXT: add sp, sp, #64
716 ; NONEON-NOSVE-NEXT: ret
717 %op1 = load <16 x i16>, ptr %a
718 %res = sdiv <16 x i16> %op1, shufflevector (<16 x i16> insertelement (<16 x i16> poison, i16 32, i32 0), <16 x i16> poison, <16 x i32> zeroinitializer)
719 store <16 x i16> %res, ptr %a
723 define <2 x i32> @sdiv_v2i32(<2 x i32> %op1) {
724 ; CHECK-LABEL: sdiv_v2i32:
726 ; CHECK-NEXT: ptrue p0.s, vl2
727 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
728 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
729 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
732 ; NONEON-NOSVE-LABEL: sdiv_v2i32:
733 ; NONEON-NOSVE: // %bb.0:
734 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
735 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
736 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
737 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
738 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
739 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
740 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
741 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
742 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
743 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
744 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #8]
745 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
746 ; NONEON-NOSVE-NEXT: add sp, sp, #16
747 ; NONEON-NOSVE-NEXT: ret
748 %res = sdiv <2 x i32> %op1, shufflevector (<2 x i32> insertelement (<2 x i32> poison, i32 32, i32 0), <2 x i32> poison, <2 x i32> zeroinitializer)
752 define <4 x i32> @sdiv_v4i32(<4 x i32> %op1) {
753 ; CHECK-LABEL: sdiv_v4i32:
755 ; CHECK-NEXT: ptrue p0.s, vl4
756 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
757 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
758 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
761 ; NONEON-NOSVE-LABEL: sdiv_v4i32:
762 ; NONEON-NOSVE: // %bb.0:
763 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
764 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
765 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
766 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
767 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
768 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
769 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
770 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
771 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
772 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
773 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #24]
774 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
775 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
776 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
777 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
778 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
779 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
780 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
781 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
782 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #16]
783 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
784 ; NONEON-NOSVE-NEXT: add sp, sp, #32
785 ; NONEON-NOSVE-NEXT: ret
786 %res = sdiv <4 x i32> %op1, shufflevector (<4 x i32> insertelement (<4 x i32> poison, i32 32, i32 0), <4 x i32> poison, <4 x i32> zeroinitializer)
790 define void @sdiv_v8i32(ptr %a) {
791 ; CHECK-LABEL: sdiv_v8i32:
793 ; CHECK-NEXT: ldp q0, q1, [x0]
794 ; CHECK-NEXT: ptrue p0.s, vl4
795 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
796 ; CHECK-NEXT: asrd z1.s, p0/m, z1.s, #5
797 ; CHECK-NEXT: stp q0, q1, [x0]
800 ; NONEON-NOSVE-LABEL: sdiv_v8i32:
801 ; NONEON-NOSVE: // %bb.0:
802 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
803 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
804 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
805 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #28]
806 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
807 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
808 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
809 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
810 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
811 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
812 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
813 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #56]
814 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
815 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
816 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
817 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
818 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
819 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
820 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
821 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
822 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #48]
823 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
824 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
825 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
826 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
827 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
828 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
829 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
830 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
831 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #40]
832 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
833 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
834 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
835 ; NONEON-NOSVE-NEXT: asr w10, w8, #5
836 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
837 ; NONEON-NOSVE-NEXT: asr w9, w8, #31
838 ; NONEON-NOSVE-NEXT: add w8, w8, w9, lsr #27
839 ; NONEON-NOSVE-NEXT: asr w8, w8, #5
840 ; NONEON-NOSVE-NEXT: stp w8, w10, [sp, #32]
841 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
842 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
843 ; NONEON-NOSVE-NEXT: add sp, sp, #64
844 ; NONEON-NOSVE-NEXT: ret
845 %op1 = load <8 x i32>, ptr %a
846 %res = sdiv <8 x i32> %op1, shufflevector (<8 x i32> insertelement (<8 x i32> poison, i32 32, i32 0), <8 x i32> poison, <8 x i32> zeroinitializer)
847 store <8 x i32> %res, ptr %a
851 define <1 x i64> @sdiv_v1i64(<1 x i64> %op1) {
852 ; CHECK-LABEL: sdiv_v1i64:
854 ; CHECK-NEXT: ptrue p0.d, vl1
855 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
856 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
857 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
860 ; NONEON-NOSVE-LABEL: sdiv_v1i64:
861 ; NONEON-NOSVE: // %bb.0:
862 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
863 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
864 ; NONEON-NOSVE-NEXT: fmov x8, d0
865 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
866 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
867 ; NONEON-NOSVE-NEXT: asr x8, x8, #5
868 ; NONEON-NOSVE-NEXT: str x8, [sp, #8]
869 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
870 ; NONEON-NOSVE-NEXT: add sp, sp, #16
871 ; NONEON-NOSVE-NEXT: ret
872 %res = sdiv <1 x i64> %op1, shufflevector (<1 x i64> insertelement (<1 x i64> poison, i64 32, i32 0), <1 x i64> poison, <1 x i32> zeroinitializer)
876 ; Vector i64 sdiv are not legal for NEON so use SVE when available.
877 define <2 x i64> @sdiv_v2i64(<2 x i64> %op1) {
878 ; CHECK-LABEL: sdiv_v2i64:
880 ; CHECK-NEXT: ptrue p0.d, vl2
881 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
882 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
883 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
886 ; NONEON-NOSVE-LABEL: sdiv_v2i64:
887 ; NONEON-NOSVE: // %bb.0:
888 ; NONEON-NOSVE-NEXT: str q0, [sp, #-32]!
889 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
890 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #8]
891 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
892 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
893 ; NONEON-NOSVE-NEXT: asr x10, x8, #5
894 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
895 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
896 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
897 ; NONEON-NOSVE-NEXT: asr x8, x8, #5
898 ; NONEON-NOSVE-NEXT: stp x8, x10, [sp, #16]
899 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
900 ; NONEON-NOSVE-NEXT: add sp, sp, #32
901 ; NONEON-NOSVE-NEXT: ret
902 %res = sdiv <2 x i64> %op1, shufflevector (<2 x i64> insertelement (<2 x i64> poison, i64 32, i32 0), <2 x i64> poison, <2 x i32> zeroinitializer)
906 define void @sdiv_v4i64(ptr %a) {
907 ; CHECK-LABEL: sdiv_v4i64:
909 ; CHECK-NEXT: ldp q0, q1, [x0]
910 ; CHECK-NEXT: ptrue p0.d, vl2
911 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
912 ; CHECK-NEXT: asrd z1.d, p0/m, z1.d, #5
913 ; CHECK-NEXT: stp q0, q1, [x0]
916 ; NONEON-NOSVE-LABEL: sdiv_v4i64:
917 ; NONEON-NOSVE: // %bb.0:
918 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
919 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #-64]!
920 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 64
921 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #24]
922 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
923 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
924 ; NONEON-NOSVE-NEXT: asr x10, x8, #5
925 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
926 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
927 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
928 ; NONEON-NOSVE-NEXT: asr x8, x8, #5
929 ; NONEON-NOSVE-NEXT: stp x8, x10, [sp, #48]
930 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #8]
931 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
932 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
933 ; NONEON-NOSVE-NEXT: asr x10, x8, #5
934 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
935 ; NONEON-NOSVE-NEXT: asr x9, x8, #63
936 ; NONEON-NOSVE-NEXT: add x8, x8, x9, lsr #59
937 ; NONEON-NOSVE-NEXT: asr x8, x8, #5
938 ; NONEON-NOSVE-NEXT: stp x8, x10, [sp, #32]
939 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #32]
940 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
941 ; NONEON-NOSVE-NEXT: add sp, sp, #64
942 ; NONEON-NOSVE-NEXT: ret
943 %op1 = load <4 x i64>, ptr %a
944 %res = sdiv <4 x i64> %op1, shufflevector (<4 x i64> insertelement (<4 x i64> poison, i64 32, i32 0), <4 x i64> poison, <4 x i32> zeroinitializer)
945 store <4 x i64> %res, ptr %a