1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck %s -check-prefixes=RV64I
3 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s | FileCheck %s -check-prefixes=RV32I
5 define void @lshr_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
6 ; RV64I-LABEL: lshr_4bytes:
8 ; RV64I-NEXT: lbu a3, 1(a0)
9 ; RV64I-NEXT: lbu a4, 0(a0)
10 ; RV64I-NEXT: lbu a5, 2(a0)
11 ; RV64I-NEXT: slli a3, a3, 8
12 ; RV64I-NEXT: lb a0, 3(a0)
13 ; RV64I-NEXT: or a3, a3, a4
14 ; RV64I-NEXT: slli a5, a5, 16
15 ; RV64I-NEXT: lbu a1, 0(a1)
16 ; RV64I-NEXT: slli a0, a0, 24
17 ; RV64I-NEXT: or a0, a0, a5
18 ; RV64I-NEXT: or a0, a0, a3
19 ; RV64I-NEXT: slli a1, a1, 3
20 ; RV64I-NEXT: srlw a0, a0, a1
21 ; RV64I-NEXT: sb a0, 0(a2)
22 ; RV64I-NEXT: srli a1, a0, 16
23 ; RV64I-NEXT: sb a1, 2(a2)
24 ; RV64I-NEXT: srli a1, a0, 24
25 ; RV64I-NEXT: sb a1, 3(a2)
26 ; RV64I-NEXT: srli a0, a0, 8
27 ; RV64I-NEXT: sb a0, 1(a2)
30 ; RV32I-LABEL: lshr_4bytes:
32 ; RV32I-NEXT: lbu a3, 1(a0)
33 ; RV32I-NEXT: lbu a4, 0(a0)
34 ; RV32I-NEXT: lbu a5, 2(a0)
35 ; RV32I-NEXT: lbu a0, 3(a0)
36 ; RV32I-NEXT: slli a3, a3, 8
37 ; RV32I-NEXT: or a3, a3, a4
38 ; RV32I-NEXT: slli a5, a5, 16
39 ; RV32I-NEXT: slli a0, a0, 24
40 ; RV32I-NEXT: or a0, a0, a5
41 ; RV32I-NEXT: or a0, a0, a3
42 ; RV32I-NEXT: lbu a3, 1(a1)
43 ; RV32I-NEXT: lbu a4, 0(a1)
44 ; RV32I-NEXT: lbu a5, 2(a1)
45 ; RV32I-NEXT: lbu a1, 3(a1)
46 ; RV32I-NEXT: slli a3, a3, 8
47 ; RV32I-NEXT: or a3, a3, a4
48 ; RV32I-NEXT: slli a5, a5, 16
49 ; RV32I-NEXT: slli a1, a1, 24
50 ; RV32I-NEXT: or a1, a1, a5
51 ; RV32I-NEXT: or a1, a1, a3
52 ; RV32I-NEXT: slli a1, a1, 3
53 ; RV32I-NEXT: srl a0, a0, a1
54 ; RV32I-NEXT: sb a0, 0(a2)
55 ; RV32I-NEXT: srli a1, a0, 16
56 ; RV32I-NEXT: sb a1, 2(a2)
57 ; RV32I-NEXT: srli a1, a0, 24
58 ; RV32I-NEXT: sb a1, 3(a2)
59 ; RV32I-NEXT: srli a0, a0, 8
60 ; RV32I-NEXT: sb a0, 1(a2)
62 %src = load i32, ptr %src.ptr, align 1
63 %byteOff = load i32, ptr %byteOff.ptr, align 1
64 %bitOff = shl i32 %byteOff, 3
65 %res = lshr i32 %src, %bitOff
66 store i32 %res, ptr %dst, align 1
69 define void @shl_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
70 ; RV64I-LABEL: shl_4bytes:
72 ; RV64I-NEXT: lbu a3, 1(a0)
73 ; RV64I-NEXT: lbu a4, 0(a0)
74 ; RV64I-NEXT: lbu a5, 2(a0)
75 ; RV64I-NEXT: slli a3, a3, 8
76 ; RV64I-NEXT: lb a0, 3(a0)
77 ; RV64I-NEXT: or a3, a3, a4
78 ; RV64I-NEXT: slli a5, a5, 16
79 ; RV64I-NEXT: lbu a1, 0(a1)
80 ; RV64I-NEXT: slli a0, a0, 24
81 ; RV64I-NEXT: or a0, a0, a5
82 ; RV64I-NEXT: or a0, a0, a3
83 ; RV64I-NEXT: slli a1, a1, 3
84 ; RV64I-NEXT: sllw a0, a0, a1
85 ; RV64I-NEXT: sb a0, 0(a2)
86 ; RV64I-NEXT: srli a1, a0, 16
87 ; RV64I-NEXT: sb a1, 2(a2)
88 ; RV64I-NEXT: srli a1, a0, 24
89 ; RV64I-NEXT: sb a1, 3(a2)
90 ; RV64I-NEXT: srli a0, a0, 8
91 ; RV64I-NEXT: sb a0, 1(a2)
94 ; RV32I-LABEL: shl_4bytes:
96 ; RV32I-NEXT: lbu a3, 1(a0)
97 ; RV32I-NEXT: lbu a4, 0(a0)
98 ; RV32I-NEXT: lbu a5, 2(a0)
99 ; RV32I-NEXT: lbu a0, 3(a0)
100 ; RV32I-NEXT: slli a3, a3, 8
101 ; RV32I-NEXT: or a3, a3, a4
102 ; RV32I-NEXT: slli a5, a5, 16
103 ; RV32I-NEXT: slli a0, a0, 24
104 ; RV32I-NEXT: or a0, a0, a5
105 ; RV32I-NEXT: or a0, a0, a3
106 ; RV32I-NEXT: lbu a3, 1(a1)
107 ; RV32I-NEXT: lbu a4, 0(a1)
108 ; RV32I-NEXT: lbu a5, 2(a1)
109 ; RV32I-NEXT: lbu a1, 3(a1)
110 ; RV32I-NEXT: slli a3, a3, 8
111 ; RV32I-NEXT: or a3, a3, a4
112 ; RV32I-NEXT: slli a5, a5, 16
113 ; RV32I-NEXT: slli a1, a1, 24
114 ; RV32I-NEXT: or a1, a1, a5
115 ; RV32I-NEXT: or a1, a1, a3
116 ; RV32I-NEXT: slli a1, a1, 3
117 ; RV32I-NEXT: sll a0, a0, a1
118 ; RV32I-NEXT: sb a0, 0(a2)
119 ; RV32I-NEXT: srli a1, a0, 16
120 ; RV32I-NEXT: sb a1, 2(a2)
121 ; RV32I-NEXT: srli a1, a0, 24
122 ; RV32I-NEXT: sb a1, 3(a2)
123 ; RV32I-NEXT: srli a0, a0, 8
124 ; RV32I-NEXT: sb a0, 1(a2)
126 %src = load i32, ptr %src.ptr, align 1
127 %byteOff = load i32, ptr %byteOff.ptr, align 1
128 %bitOff = shl i32 %byteOff, 3
129 %res = shl i32 %src, %bitOff
130 store i32 %res, ptr %dst, align 1
133 define void @ashr_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
134 ; RV64I-LABEL: ashr_4bytes:
136 ; RV64I-NEXT: lbu a3, 1(a0)
137 ; RV64I-NEXT: lbu a4, 0(a0)
138 ; RV64I-NEXT: lbu a5, 2(a0)
139 ; RV64I-NEXT: slli a3, a3, 8
140 ; RV64I-NEXT: lb a0, 3(a0)
141 ; RV64I-NEXT: or a3, a3, a4
142 ; RV64I-NEXT: slli a5, a5, 16
143 ; RV64I-NEXT: lbu a1, 0(a1)
144 ; RV64I-NEXT: slli a0, a0, 24
145 ; RV64I-NEXT: or a0, a0, a5
146 ; RV64I-NEXT: or a0, a0, a3
147 ; RV64I-NEXT: slli a1, a1, 3
148 ; RV64I-NEXT: sraw a0, a0, a1
149 ; RV64I-NEXT: sb a0, 0(a2)
150 ; RV64I-NEXT: srli a1, a0, 16
151 ; RV64I-NEXT: sb a1, 2(a2)
152 ; RV64I-NEXT: srli a1, a0, 24
153 ; RV64I-NEXT: sb a1, 3(a2)
154 ; RV64I-NEXT: srli a0, a0, 8
155 ; RV64I-NEXT: sb a0, 1(a2)
158 ; RV32I-LABEL: ashr_4bytes:
160 ; RV32I-NEXT: lbu a3, 1(a0)
161 ; RV32I-NEXT: lbu a4, 0(a0)
162 ; RV32I-NEXT: lbu a5, 2(a0)
163 ; RV32I-NEXT: lbu a0, 3(a0)
164 ; RV32I-NEXT: slli a3, a3, 8
165 ; RV32I-NEXT: or a3, a3, a4
166 ; RV32I-NEXT: slli a5, a5, 16
167 ; RV32I-NEXT: slli a0, a0, 24
168 ; RV32I-NEXT: or a0, a0, a5
169 ; RV32I-NEXT: or a0, a0, a3
170 ; RV32I-NEXT: lbu a3, 1(a1)
171 ; RV32I-NEXT: lbu a4, 0(a1)
172 ; RV32I-NEXT: lbu a5, 2(a1)
173 ; RV32I-NEXT: lbu a1, 3(a1)
174 ; RV32I-NEXT: slli a3, a3, 8
175 ; RV32I-NEXT: or a3, a3, a4
176 ; RV32I-NEXT: slli a5, a5, 16
177 ; RV32I-NEXT: slli a1, a1, 24
178 ; RV32I-NEXT: or a1, a1, a5
179 ; RV32I-NEXT: or a1, a1, a3
180 ; RV32I-NEXT: slli a1, a1, 3
181 ; RV32I-NEXT: sra a0, a0, a1
182 ; RV32I-NEXT: sb a0, 0(a2)
183 ; RV32I-NEXT: srli a1, a0, 16
184 ; RV32I-NEXT: sb a1, 2(a2)
185 ; RV32I-NEXT: srli a1, a0, 24
186 ; RV32I-NEXT: sb a1, 3(a2)
187 ; RV32I-NEXT: srli a0, a0, 8
188 ; RV32I-NEXT: sb a0, 1(a2)
190 %src = load i32, ptr %src.ptr, align 1
191 %byteOff = load i32, ptr %byteOff.ptr, align 1
192 %bitOff = shl i32 %byteOff, 3
193 %res = ashr i32 %src, %bitOff
194 store i32 %res, ptr %dst, align 1
198 define void @lshr_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
199 ; RV64I-LABEL: lshr_8bytes:
201 ; RV64I-NEXT: lbu a3, 1(a0)
202 ; RV64I-NEXT: lbu a4, 0(a0)
203 ; RV64I-NEXT: lbu a5, 2(a0)
204 ; RV64I-NEXT: lbu a6, 3(a0)
205 ; RV64I-NEXT: slli a3, a3, 8
206 ; RV64I-NEXT: or a3, a3, a4
207 ; RV64I-NEXT: slli a5, a5, 16
208 ; RV64I-NEXT: slli a6, a6, 24
209 ; RV64I-NEXT: or a4, a6, a5
210 ; RV64I-NEXT: or a3, a4, a3
211 ; RV64I-NEXT: lbu a4, 5(a0)
212 ; RV64I-NEXT: lbu a5, 4(a0)
213 ; RV64I-NEXT: lbu a6, 6(a0)
214 ; RV64I-NEXT: lbu a0, 7(a0)
215 ; RV64I-NEXT: slli a4, a4, 8
216 ; RV64I-NEXT: or a4, a4, a5
217 ; RV64I-NEXT: slli a6, a6, 16
218 ; RV64I-NEXT: slli a0, a0, 24
219 ; RV64I-NEXT: or a0, a0, a6
220 ; RV64I-NEXT: or a0, a0, a4
221 ; RV64I-NEXT: slli a0, a0, 32
222 ; RV64I-NEXT: or a0, a0, a3
223 ; RV64I-NEXT: lbu a3, 5(a1)
224 ; RV64I-NEXT: lbu a4, 4(a1)
225 ; RV64I-NEXT: lbu a5, 6(a1)
226 ; RV64I-NEXT: lbu a6, 7(a1)
227 ; RV64I-NEXT: slli a3, a3, 8
228 ; RV64I-NEXT: or a3, a3, a4
229 ; RV64I-NEXT: slli a5, a5, 16
230 ; RV64I-NEXT: slli a6, a6, 24
231 ; RV64I-NEXT: or a4, a6, a5
232 ; RV64I-NEXT: or a3, a4, a3
233 ; RV64I-NEXT: lbu a4, 1(a1)
234 ; RV64I-NEXT: lbu a5, 0(a1)
235 ; RV64I-NEXT: lbu a6, 2(a1)
236 ; RV64I-NEXT: lbu a1, 3(a1)
237 ; RV64I-NEXT: slli a4, a4, 8
238 ; RV64I-NEXT: or a4, a4, a5
239 ; RV64I-NEXT: slli a6, a6, 16
240 ; RV64I-NEXT: slli a1, a1, 24
241 ; RV64I-NEXT: or a1, a1, a6
242 ; RV64I-NEXT: or a1, a1, a4
243 ; RV64I-NEXT: slli a1, a1, 3
244 ; RV64I-NEXT: slli a3, a3, 35
245 ; RV64I-NEXT: or a1, a3, a1
246 ; RV64I-NEXT: srl a0, a0, a1
247 ; RV64I-NEXT: sb a0, 0(a2)
248 ; RV64I-NEXT: srli a1, a0, 48
249 ; RV64I-NEXT: sb a1, 6(a2)
250 ; RV64I-NEXT: srli a1, a0, 56
251 ; RV64I-NEXT: sb a1, 7(a2)
252 ; RV64I-NEXT: srli a1, a0, 32
253 ; RV64I-NEXT: sb a1, 4(a2)
254 ; RV64I-NEXT: srli a1, a0, 40
255 ; RV64I-NEXT: sb a1, 5(a2)
256 ; RV64I-NEXT: srli a1, a0, 16
257 ; RV64I-NEXT: sb a1, 2(a2)
258 ; RV64I-NEXT: srli a1, a0, 24
259 ; RV64I-NEXT: sb a1, 3(a2)
260 ; RV64I-NEXT: srli a0, a0, 8
261 ; RV64I-NEXT: sb a0, 1(a2)
264 ; RV32I-LABEL: lshr_8bytes:
266 ; RV32I-NEXT: lbu a3, 5(a0)
267 ; RV32I-NEXT: lbu a4, 4(a0)
268 ; RV32I-NEXT: lbu a5, 6(a0)
269 ; RV32I-NEXT: lbu a6, 7(a0)
270 ; RV32I-NEXT: slli a3, a3, 8
271 ; RV32I-NEXT: or a3, a3, a4
272 ; RV32I-NEXT: slli a5, a5, 16
273 ; RV32I-NEXT: slli a6, a6, 24
274 ; RV32I-NEXT: or a4, a6, a5
275 ; RV32I-NEXT: or a3, a4, a3
276 ; RV32I-NEXT: lbu a4, 1(a1)
277 ; RV32I-NEXT: lbu a5, 0(a1)
278 ; RV32I-NEXT: lbu a6, 2(a1)
279 ; RV32I-NEXT: lbu a1, 3(a1)
280 ; RV32I-NEXT: slli a4, a4, 8
281 ; RV32I-NEXT: or a4, a4, a5
282 ; RV32I-NEXT: slli a6, a6, 16
283 ; RV32I-NEXT: slli a1, a1, 24
284 ; RV32I-NEXT: or a1, a1, a6
285 ; RV32I-NEXT: or a1, a1, a4
286 ; RV32I-NEXT: slli a5, a1, 3
287 ; RV32I-NEXT: addi a4, a5, -32
288 ; RV32I-NEXT: srl a1, a3, a5
289 ; RV32I-NEXT: bltz a4, .LBB3_2
290 ; RV32I-NEXT: # %bb.1:
291 ; RV32I-NEXT: mv a0, a1
292 ; RV32I-NEXT: j .LBB3_3
293 ; RV32I-NEXT: .LBB3_2:
294 ; RV32I-NEXT: lbu a6, 1(a0)
295 ; RV32I-NEXT: lbu a7, 0(a0)
296 ; RV32I-NEXT: lbu t0, 2(a0)
297 ; RV32I-NEXT: lbu a0, 3(a0)
298 ; RV32I-NEXT: slli a6, a6, 8
299 ; RV32I-NEXT: or a6, a6, a7
300 ; RV32I-NEXT: slli t0, t0, 16
301 ; RV32I-NEXT: slli a0, a0, 24
302 ; RV32I-NEXT: or a0, a0, t0
303 ; RV32I-NEXT: or a0, a0, a6
304 ; RV32I-NEXT: srl a0, a0, a5
305 ; RV32I-NEXT: slli a3, a3, 1
306 ; RV32I-NEXT: not a5, a5
307 ; RV32I-NEXT: sll a3, a3, a5
308 ; RV32I-NEXT: or a0, a0, a3
309 ; RV32I-NEXT: .LBB3_3:
310 ; RV32I-NEXT: srai a4, a4, 31
311 ; RV32I-NEXT: and a1, a4, a1
312 ; RV32I-NEXT: sb a1, 4(a2)
313 ; RV32I-NEXT: srli a3, a1, 16
314 ; RV32I-NEXT: sb a3, 6(a2)
315 ; RV32I-NEXT: srli a3, a1, 24
316 ; RV32I-NEXT: sb a3, 7(a2)
317 ; RV32I-NEXT: srli a1, a1, 8
318 ; RV32I-NEXT: sb a1, 5(a2)
319 ; RV32I-NEXT: sb a0, 0(a2)
320 ; RV32I-NEXT: srli a1, a0, 16
321 ; RV32I-NEXT: sb a1, 2(a2)
322 ; RV32I-NEXT: srli a1, a0, 24
323 ; RV32I-NEXT: sb a1, 3(a2)
324 ; RV32I-NEXT: srli a0, a0, 8
325 ; RV32I-NEXT: sb a0, 1(a2)
327 %src = load i64, ptr %src.ptr, align 1
328 %byteOff = load i64, ptr %byteOff.ptr, align 1
329 %bitOff = shl i64 %byteOff, 3
330 %res = lshr i64 %src, %bitOff
331 store i64 %res, ptr %dst, align 1
334 define void @shl_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
335 ; RV64I-LABEL: shl_8bytes:
337 ; RV64I-NEXT: lbu a3, 1(a0)
338 ; RV64I-NEXT: lbu a4, 0(a0)
339 ; RV64I-NEXT: lbu a5, 2(a0)
340 ; RV64I-NEXT: lbu a6, 3(a0)
341 ; RV64I-NEXT: slli a3, a3, 8
342 ; RV64I-NEXT: or a3, a3, a4
343 ; RV64I-NEXT: slli a5, a5, 16
344 ; RV64I-NEXT: slli a6, a6, 24
345 ; RV64I-NEXT: or a4, a6, a5
346 ; RV64I-NEXT: or a3, a4, a3
347 ; RV64I-NEXT: lbu a4, 5(a0)
348 ; RV64I-NEXT: lbu a5, 4(a0)
349 ; RV64I-NEXT: lbu a6, 6(a0)
350 ; RV64I-NEXT: lbu a0, 7(a0)
351 ; RV64I-NEXT: slli a4, a4, 8
352 ; RV64I-NEXT: or a4, a4, a5
353 ; RV64I-NEXT: slli a6, a6, 16
354 ; RV64I-NEXT: slli a0, a0, 24
355 ; RV64I-NEXT: or a0, a0, a6
356 ; RV64I-NEXT: or a0, a0, a4
357 ; RV64I-NEXT: slli a0, a0, 32
358 ; RV64I-NEXT: or a0, a0, a3
359 ; RV64I-NEXT: lbu a3, 5(a1)
360 ; RV64I-NEXT: lbu a4, 4(a1)
361 ; RV64I-NEXT: lbu a5, 6(a1)
362 ; RV64I-NEXT: lbu a6, 7(a1)
363 ; RV64I-NEXT: slli a3, a3, 8
364 ; RV64I-NEXT: or a3, a3, a4
365 ; RV64I-NEXT: slli a5, a5, 16
366 ; RV64I-NEXT: slli a6, a6, 24
367 ; RV64I-NEXT: or a4, a6, a5
368 ; RV64I-NEXT: or a3, a4, a3
369 ; RV64I-NEXT: lbu a4, 1(a1)
370 ; RV64I-NEXT: lbu a5, 0(a1)
371 ; RV64I-NEXT: lbu a6, 2(a1)
372 ; RV64I-NEXT: lbu a1, 3(a1)
373 ; RV64I-NEXT: slli a4, a4, 8
374 ; RV64I-NEXT: or a4, a4, a5
375 ; RV64I-NEXT: slli a6, a6, 16
376 ; RV64I-NEXT: slli a1, a1, 24
377 ; RV64I-NEXT: or a1, a1, a6
378 ; RV64I-NEXT: or a1, a1, a4
379 ; RV64I-NEXT: slli a1, a1, 3
380 ; RV64I-NEXT: slli a3, a3, 35
381 ; RV64I-NEXT: or a1, a3, a1
382 ; RV64I-NEXT: sll a0, a0, a1
383 ; RV64I-NEXT: sb a0, 0(a2)
384 ; RV64I-NEXT: srli a1, a0, 48
385 ; RV64I-NEXT: sb a1, 6(a2)
386 ; RV64I-NEXT: srli a1, a0, 56
387 ; RV64I-NEXT: sb a1, 7(a2)
388 ; RV64I-NEXT: srli a1, a0, 32
389 ; RV64I-NEXT: sb a1, 4(a2)
390 ; RV64I-NEXT: srli a1, a0, 40
391 ; RV64I-NEXT: sb a1, 5(a2)
392 ; RV64I-NEXT: srli a1, a0, 16
393 ; RV64I-NEXT: sb a1, 2(a2)
394 ; RV64I-NEXT: srli a1, a0, 24
395 ; RV64I-NEXT: sb a1, 3(a2)
396 ; RV64I-NEXT: srli a0, a0, 8
397 ; RV64I-NEXT: sb a0, 1(a2)
400 ; RV32I-LABEL: shl_8bytes:
402 ; RV32I-NEXT: lbu a3, 1(a0)
403 ; RV32I-NEXT: lbu a4, 0(a0)
404 ; RV32I-NEXT: lbu a5, 2(a0)
405 ; RV32I-NEXT: lbu a6, 3(a0)
406 ; RV32I-NEXT: slli a3, a3, 8
407 ; RV32I-NEXT: or a3, a3, a4
408 ; RV32I-NEXT: slli a5, a5, 16
409 ; RV32I-NEXT: slli a6, a6, 24
410 ; RV32I-NEXT: or a4, a6, a5
411 ; RV32I-NEXT: or a3, a4, a3
412 ; RV32I-NEXT: lbu a4, 1(a1)
413 ; RV32I-NEXT: lbu a5, 0(a1)
414 ; RV32I-NEXT: lbu a6, 2(a1)
415 ; RV32I-NEXT: lbu a1, 3(a1)
416 ; RV32I-NEXT: slli a4, a4, 8
417 ; RV32I-NEXT: or a4, a4, a5
418 ; RV32I-NEXT: slli a6, a6, 16
419 ; RV32I-NEXT: slli a1, a1, 24
420 ; RV32I-NEXT: or a1, a1, a6
421 ; RV32I-NEXT: or a1, a1, a4
422 ; RV32I-NEXT: slli a5, a1, 3
423 ; RV32I-NEXT: addi a4, a5, -32
424 ; RV32I-NEXT: sll a1, a3, a5
425 ; RV32I-NEXT: bltz a4, .LBB4_2
426 ; RV32I-NEXT: # %bb.1:
427 ; RV32I-NEXT: mv a0, a1
428 ; RV32I-NEXT: j .LBB4_3
429 ; RV32I-NEXT: .LBB4_2:
430 ; RV32I-NEXT: lbu a6, 5(a0)
431 ; RV32I-NEXT: lbu a7, 4(a0)
432 ; RV32I-NEXT: lbu t0, 6(a0)
433 ; RV32I-NEXT: lbu a0, 7(a0)
434 ; RV32I-NEXT: slli a6, a6, 8
435 ; RV32I-NEXT: or a6, a6, a7
436 ; RV32I-NEXT: slli t0, t0, 16
437 ; RV32I-NEXT: slli a0, a0, 24
438 ; RV32I-NEXT: or a0, a0, t0
439 ; RV32I-NEXT: or a0, a0, a6
440 ; RV32I-NEXT: sll a0, a0, a5
441 ; RV32I-NEXT: srli a3, a3, 1
442 ; RV32I-NEXT: not a5, a5
443 ; RV32I-NEXT: srl a3, a3, a5
444 ; RV32I-NEXT: or a0, a0, a3
445 ; RV32I-NEXT: .LBB4_3:
446 ; RV32I-NEXT: srai a4, a4, 31
447 ; RV32I-NEXT: and a1, a4, a1
448 ; RV32I-NEXT: sb a1, 0(a2)
449 ; RV32I-NEXT: sb a0, 4(a2)
450 ; RV32I-NEXT: srli a3, a1, 16
451 ; RV32I-NEXT: sb a3, 2(a2)
452 ; RV32I-NEXT: srli a3, a1, 24
453 ; RV32I-NEXT: sb a3, 3(a2)
454 ; RV32I-NEXT: srli a1, a1, 8
455 ; RV32I-NEXT: sb a1, 1(a2)
456 ; RV32I-NEXT: srli a1, a0, 16
457 ; RV32I-NEXT: sb a1, 6(a2)
458 ; RV32I-NEXT: srli a1, a0, 24
459 ; RV32I-NEXT: sb a1, 7(a2)
460 ; RV32I-NEXT: srli a0, a0, 8
461 ; RV32I-NEXT: sb a0, 5(a2)
463 %src = load i64, ptr %src.ptr, align 1
464 %byteOff = load i64, ptr %byteOff.ptr, align 1
465 %bitOff = shl i64 %byteOff, 3
466 %res = shl i64 %src, %bitOff
467 store i64 %res, ptr %dst, align 1
470 define void @ashr_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
471 ; RV64I-LABEL: ashr_8bytes:
473 ; RV64I-NEXT: lbu a3, 1(a0)
474 ; RV64I-NEXT: lbu a4, 0(a0)
475 ; RV64I-NEXT: lbu a5, 2(a0)
476 ; RV64I-NEXT: lbu a6, 3(a0)
477 ; RV64I-NEXT: slli a3, a3, 8
478 ; RV64I-NEXT: or a3, a3, a4
479 ; RV64I-NEXT: slli a5, a5, 16
480 ; RV64I-NEXT: slli a6, a6, 24
481 ; RV64I-NEXT: or a4, a6, a5
482 ; RV64I-NEXT: or a3, a4, a3
483 ; RV64I-NEXT: lbu a4, 5(a0)
484 ; RV64I-NEXT: lbu a5, 4(a0)
485 ; RV64I-NEXT: lbu a6, 6(a0)
486 ; RV64I-NEXT: lbu a0, 7(a0)
487 ; RV64I-NEXT: slli a4, a4, 8
488 ; RV64I-NEXT: or a4, a4, a5
489 ; RV64I-NEXT: slli a6, a6, 16
490 ; RV64I-NEXT: slli a0, a0, 24
491 ; RV64I-NEXT: or a0, a0, a6
492 ; RV64I-NEXT: or a0, a0, a4
493 ; RV64I-NEXT: slli a0, a0, 32
494 ; RV64I-NEXT: or a0, a0, a3
495 ; RV64I-NEXT: lbu a3, 5(a1)
496 ; RV64I-NEXT: lbu a4, 4(a1)
497 ; RV64I-NEXT: lbu a5, 6(a1)
498 ; RV64I-NEXT: lbu a6, 7(a1)
499 ; RV64I-NEXT: slli a3, a3, 8
500 ; RV64I-NEXT: or a3, a3, a4
501 ; RV64I-NEXT: slli a5, a5, 16
502 ; RV64I-NEXT: slli a6, a6, 24
503 ; RV64I-NEXT: or a4, a6, a5
504 ; RV64I-NEXT: or a3, a4, a3
505 ; RV64I-NEXT: lbu a4, 1(a1)
506 ; RV64I-NEXT: lbu a5, 0(a1)
507 ; RV64I-NEXT: lbu a6, 2(a1)
508 ; RV64I-NEXT: lbu a1, 3(a1)
509 ; RV64I-NEXT: slli a4, a4, 8
510 ; RV64I-NEXT: or a4, a4, a5
511 ; RV64I-NEXT: slli a6, a6, 16
512 ; RV64I-NEXT: slli a1, a1, 24
513 ; RV64I-NEXT: or a1, a1, a6
514 ; RV64I-NEXT: or a1, a1, a4
515 ; RV64I-NEXT: slli a1, a1, 3
516 ; RV64I-NEXT: slli a3, a3, 35
517 ; RV64I-NEXT: or a1, a3, a1
518 ; RV64I-NEXT: sra a0, a0, a1
519 ; RV64I-NEXT: sb a0, 0(a2)
520 ; RV64I-NEXT: srli a1, a0, 48
521 ; RV64I-NEXT: sb a1, 6(a2)
522 ; RV64I-NEXT: srli a1, a0, 56
523 ; RV64I-NEXT: sb a1, 7(a2)
524 ; RV64I-NEXT: srli a1, a0, 32
525 ; RV64I-NEXT: sb a1, 4(a2)
526 ; RV64I-NEXT: srli a1, a0, 40
527 ; RV64I-NEXT: sb a1, 5(a2)
528 ; RV64I-NEXT: srli a1, a0, 16
529 ; RV64I-NEXT: sb a1, 2(a2)
530 ; RV64I-NEXT: srli a1, a0, 24
531 ; RV64I-NEXT: sb a1, 3(a2)
532 ; RV64I-NEXT: srli a0, a0, 8
533 ; RV64I-NEXT: sb a0, 1(a2)
536 ; RV32I-LABEL: ashr_8bytes:
538 ; RV32I-NEXT: lbu a3, 5(a0)
539 ; RV32I-NEXT: lbu a4, 4(a0)
540 ; RV32I-NEXT: lbu a5, 6(a0)
541 ; RV32I-NEXT: lbu a6, 7(a0)
542 ; RV32I-NEXT: slli a3, a3, 8
543 ; RV32I-NEXT: or a3, a3, a4
544 ; RV32I-NEXT: slli a5, a5, 16
545 ; RV32I-NEXT: slli a4, a6, 24
546 ; RV32I-NEXT: or a5, a4, a5
547 ; RV32I-NEXT: or a3, a5, a3
548 ; RV32I-NEXT: lbu a5, 1(a1)
549 ; RV32I-NEXT: lbu a6, 0(a1)
550 ; RV32I-NEXT: lbu a7, 2(a1)
551 ; RV32I-NEXT: lbu a1, 3(a1)
552 ; RV32I-NEXT: slli a5, a5, 8
553 ; RV32I-NEXT: or a5, a5, a6
554 ; RV32I-NEXT: slli a7, a7, 16
555 ; RV32I-NEXT: slli a1, a1, 24
556 ; RV32I-NEXT: or a1, a1, a7
557 ; RV32I-NEXT: or a1, a1, a5
558 ; RV32I-NEXT: slli a5, a1, 3
559 ; RV32I-NEXT: addi a6, a5, -32
560 ; RV32I-NEXT: sra a1, a3, a5
561 ; RV32I-NEXT: bltz a6, .LBB5_2
562 ; RV32I-NEXT: # %bb.1:
563 ; RV32I-NEXT: srai a4, a4, 31
564 ; RV32I-NEXT: mv a0, a1
565 ; RV32I-NEXT: mv a1, a4
566 ; RV32I-NEXT: j .LBB5_3
567 ; RV32I-NEXT: .LBB5_2:
568 ; RV32I-NEXT: lbu a4, 1(a0)
569 ; RV32I-NEXT: lbu a6, 0(a0)
570 ; RV32I-NEXT: lbu a7, 2(a0)
571 ; RV32I-NEXT: lbu a0, 3(a0)
572 ; RV32I-NEXT: slli a4, a4, 8
573 ; RV32I-NEXT: or a4, a4, a6
574 ; RV32I-NEXT: slli a7, a7, 16
575 ; RV32I-NEXT: slli a0, a0, 24
576 ; RV32I-NEXT: or a0, a0, a7
577 ; RV32I-NEXT: or a0, a0, a4
578 ; RV32I-NEXT: srl a0, a0, a5
579 ; RV32I-NEXT: slli a3, a3, 1
580 ; RV32I-NEXT: not a4, a5
581 ; RV32I-NEXT: sll a3, a3, a4
582 ; RV32I-NEXT: or a0, a0, a3
583 ; RV32I-NEXT: .LBB5_3:
584 ; RV32I-NEXT: sb a1, 4(a2)
585 ; RV32I-NEXT: srli a3, a1, 16
586 ; RV32I-NEXT: sb a3, 6(a2)
587 ; RV32I-NEXT: srli a3, a1, 24
588 ; RV32I-NEXT: sb a3, 7(a2)
589 ; RV32I-NEXT: srli a1, a1, 8
590 ; RV32I-NEXT: sb a1, 5(a2)
591 ; RV32I-NEXT: sb a0, 0(a2)
592 ; RV32I-NEXT: srli a1, a0, 16
593 ; RV32I-NEXT: sb a1, 2(a2)
594 ; RV32I-NEXT: srli a1, a0, 24
595 ; RV32I-NEXT: sb a1, 3(a2)
596 ; RV32I-NEXT: srli a0, a0, 8
597 ; RV32I-NEXT: sb a0, 1(a2)
599 %src = load i64, ptr %src.ptr, align 1
600 %byteOff = load i64, ptr %byteOff.ptr, align 1
601 %bitOff = shl i64 %byteOff, 3
602 %res = ashr i64 %src, %bitOff
603 store i64 %res, ptr %dst, align 1
607 define void @lshr_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
608 ; RV64I-LABEL: lshr_16bytes:
610 ; RV64I-NEXT: lbu a3, 9(a0)
611 ; RV64I-NEXT: lbu a4, 8(a0)
612 ; RV64I-NEXT: lbu a5, 10(a0)
613 ; RV64I-NEXT: lbu a6, 11(a0)
614 ; RV64I-NEXT: slli a3, a3, 8
615 ; RV64I-NEXT: or a3, a3, a4
616 ; RV64I-NEXT: slli a5, a5, 16
617 ; RV64I-NEXT: slli a6, a6, 24
618 ; RV64I-NEXT: or a4, a6, a5
619 ; RV64I-NEXT: or a3, a4, a3
620 ; RV64I-NEXT: lbu a4, 13(a0)
621 ; RV64I-NEXT: lbu a5, 12(a0)
622 ; RV64I-NEXT: lbu a6, 14(a0)
623 ; RV64I-NEXT: lbu a7, 15(a0)
624 ; RV64I-NEXT: slli a4, a4, 8
625 ; RV64I-NEXT: or a4, a4, a5
626 ; RV64I-NEXT: slli a6, a6, 16
627 ; RV64I-NEXT: slli a7, a7, 24
628 ; RV64I-NEXT: or a5, a7, a6
629 ; RV64I-NEXT: or a4, a5, a4
630 ; RV64I-NEXT: slli a4, a4, 32
631 ; RV64I-NEXT: or a3, a4, a3
632 ; RV64I-NEXT: lbu a4, 5(a1)
633 ; RV64I-NEXT: lbu a5, 4(a1)
634 ; RV64I-NEXT: lbu a6, 6(a1)
635 ; RV64I-NEXT: lbu a7, 7(a1)
636 ; RV64I-NEXT: slli a4, a4, 8
637 ; RV64I-NEXT: or a4, a4, a5
638 ; RV64I-NEXT: slli a6, a6, 16
639 ; RV64I-NEXT: slli a7, a7, 24
640 ; RV64I-NEXT: or a5, a7, a6
641 ; RV64I-NEXT: or a4, a5, a4
642 ; RV64I-NEXT: lbu a5, 1(a1)
643 ; RV64I-NEXT: lbu a6, 0(a1)
644 ; RV64I-NEXT: lbu a7, 2(a1)
645 ; RV64I-NEXT: lbu a1, 3(a1)
646 ; RV64I-NEXT: slli a5, a5, 8
647 ; RV64I-NEXT: or a5, a5, a6
648 ; RV64I-NEXT: slli a7, a7, 16
649 ; RV64I-NEXT: slli a1, a1, 24
650 ; RV64I-NEXT: or a1, a1, a7
651 ; RV64I-NEXT: or a1, a1, a5
652 ; RV64I-NEXT: slli a1, a1, 3
653 ; RV64I-NEXT: slli a4, a4, 35
654 ; RV64I-NEXT: or a5, a4, a1
655 ; RV64I-NEXT: addi a4, a5, -64
656 ; RV64I-NEXT: srl a1, a3, a5
657 ; RV64I-NEXT: bltz a4, .LBB6_2
658 ; RV64I-NEXT: # %bb.1:
659 ; RV64I-NEXT: mv a0, a1
660 ; RV64I-NEXT: j .LBB6_3
661 ; RV64I-NEXT: .LBB6_2:
662 ; RV64I-NEXT: lbu a6, 1(a0)
663 ; RV64I-NEXT: lbu a7, 0(a0)
664 ; RV64I-NEXT: lbu t0, 2(a0)
665 ; RV64I-NEXT: lbu t1, 3(a0)
666 ; RV64I-NEXT: slli a6, a6, 8
667 ; RV64I-NEXT: or a6, a6, a7
668 ; RV64I-NEXT: slli t0, t0, 16
669 ; RV64I-NEXT: slli t1, t1, 24
670 ; RV64I-NEXT: or a7, t1, t0
671 ; RV64I-NEXT: or a6, a7, a6
672 ; RV64I-NEXT: lbu a7, 5(a0)
673 ; RV64I-NEXT: lbu t0, 4(a0)
674 ; RV64I-NEXT: lbu t1, 6(a0)
675 ; RV64I-NEXT: lbu a0, 7(a0)
676 ; RV64I-NEXT: slli a7, a7, 8
677 ; RV64I-NEXT: or a7, a7, t0
678 ; RV64I-NEXT: slli t1, t1, 16
679 ; RV64I-NEXT: slli a0, a0, 24
680 ; RV64I-NEXT: or a0, a0, t1
681 ; RV64I-NEXT: or a0, a0, a7
682 ; RV64I-NEXT: slli a0, a0, 32
683 ; RV64I-NEXT: or a0, a0, a6
684 ; RV64I-NEXT: srl a0, a0, a5
685 ; RV64I-NEXT: not a5, a5
686 ; RV64I-NEXT: slli a3, a3, 1
687 ; RV64I-NEXT: sll a3, a3, a5
688 ; RV64I-NEXT: or a0, a0, a3
689 ; RV64I-NEXT: .LBB6_3:
690 ; RV64I-NEXT: srai a4, a4, 63
691 ; RV64I-NEXT: and a1, a4, a1
692 ; RV64I-NEXT: sb a1, 8(a2)
693 ; RV64I-NEXT: srli a3, a1, 56
694 ; RV64I-NEXT: sb a3, 15(a2)
695 ; RV64I-NEXT: srli a3, a1, 48
696 ; RV64I-NEXT: sb a3, 14(a2)
697 ; RV64I-NEXT: srli a3, a1, 40
698 ; RV64I-NEXT: sb a3, 13(a2)
699 ; RV64I-NEXT: srli a3, a1, 32
700 ; RV64I-NEXT: sb a3, 12(a2)
701 ; RV64I-NEXT: srli a3, a1, 24
702 ; RV64I-NEXT: sb a3, 11(a2)
703 ; RV64I-NEXT: srli a3, a1, 16
704 ; RV64I-NEXT: sb a3, 10(a2)
705 ; RV64I-NEXT: srli a1, a1, 8
706 ; RV64I-NEXT: sb a1, 9(a2)
707 ; RV64I-NEXT: sb a0, 0(a2)
708 ; RV64I-NEXT: srli a1, a0, 56
709 ; RV64I-NEXT: sb a1, 7(a2)
710 ; RV64I-NEXT: srli a1, a0, 48
711 ; RV64I-NEXT: sb a1, 6(a2)
712 ; RV64I-NEXT: srli a1, a0, 40
713 ; RV64I-NEXT: sb a1, 5(a2)
714 ; RV64I-NEXT: srli a1, a0, 32
715 ; RV64I-NEXT: sb a1, 4(a2)
716 ; RV64I-NEXT: srli a1, a0, 24
717 ; RV64I-NEXT: sb a1, 3(a2)
718 ; RV64I-NEXT: srli a1, a0, 16
719 ; RV64I-NEXT: sb a1, 2(a2)
720 ; RV64I-NEXT: srli a0, a0, 8
721 ; RV64I-NEXT: sb a0, 1(a2)
724 ; RV32I-LABEL: lshr_16bytes:
726 ; RV32I-NEXT: addi sp, sp, -48
727 ; RV32I-NEXT: sw s0, 44(sp) # 4-byte Folded Spill
728 ; RV32I-NEXT: sw s1, 40(sp) # 4-byte Folded Spill
729 ; RV32I-NEXT: sw s2, 36(sp) # 4-byte Folded Spill
730 ; RV32I-NEXT: lbu a3, 0(a0)
731 ; RV32I-NEXT: lbu a4, 1(a0)
732 ; RV32I-NEXT: lbu a5, 2(a0)
733 ; RV32I-NEXT: lbu a6, 3(a0)
734 ; RV32I-NEXT: lbu a7, 4(a0)
735 ; RV32I-NEXT: lbu t0, 5(a0)
736 ; RV32I-NEXT: lbu t1, 6(a0)
737 ; RV32I-NEXT: lbu t2, 7(a0)
738 ; RV32I-NEXT: lbu t3, 8(a0)
739 ; RV32I-NEXT: lbu t4, 9(a0)
740 ; RV32I-NEXT: lbu t5, 10(a0)
741 ; RV32I-NEXT: lbu t6, 11(a0)
742 ; RV32I-NEXT: lbu s0, 12(a0)
743 ; RV32I-NEXT: lbu s1, 13(a0)
744 ; RV32I-NEXT: lbu s2, 14(a0)
745 ; RV32I-NEXT: lbu a0, 15(a0)
746 ; RV32I-NEXT: lbu a1, 0(a1)
747 ; RV32I-NEXT: sb zero, 35(sp)
748 ; RV32I-NEXT: sb zero, 34(sp)
749 ; RV32I-NEXT: sb zero, 33(sp)
750 ; RV32I-NEXT: sb zero, 32(sp)
751 ; RV32I-NEXT: sb zero, 31(sp)
752 ; RV32I-NEXT: sb zero, 30(sp)
753 ; RV32I-NEXT: sb zero, 29(sp)
754 ; RV32I-NEXT: sb zero, 28(sp)
755 ; RV32I-NEXT: sb zero, 27(sp)
756 ; RV32I-NEXT: sb zero, 26(sp)
757 ; RV32I-NEXT: sb zero, 25(sp)
758 ; RV32I-NEXT: sb zero, 24(sp)
759 ; RV32I-NEXT: sb zero, 23(sp)
760 ; RV32I-NEXT: sb zero, 22(sp)
761 ; RV32I-NEXT: sb zero, 21(sp)
762 ; RV32I-NEXT: sb zero, 20(sp)
763 ; RV32I-NEXT: sb a0, 19(sp)
764 ; RV32I-NEXT: sb s2, 18(sp)
765 ; RV32I-NEXT: sb s1, 17(sp)
766 ; RV32I-NEXT: sb s0, 16(sp)
767 ; RV32I-NEXT: sb t6, 15(sp)
768 ; RV32I-NEXT: sb t5, 14(sp)
769 ; RV32I-NEXT: sb t4, 13(sp)
770 ; RV32I-NEXT: sb t3, 12(sp)
771 ; RV32I-NEXT: sb t2, 11(sp)
772 ; RV32I-NEXT: sb t1, 10(sp)
773 ; RV32I-NEXT: sb t0, 9(sp)
774 ; RV32I-NEXT: sb a7, 8(sp)
775 ; RV32I-NEXT: sb a6, 7(sp)
776 ; RV32I-NEXT: sb a5, 6(sp)
777 ; RV32I-NEXT: sb a4, 5(sp)
778 ; RV32I-NEXT: sb a3, 4(sp)
779 ; RV32I-NEXT: andi a1, a1, 15
780 ; RV32I-NEXT: addi a0, sp, 4
781 ; RV32I-NEXT: add a0, a0, a1
782 ; RV32I-NEXT: lbu a1, 5(a0)
783 ; RV32I-NEXT: lbu a3, 4(a0)
784 ; RV32I-NEXT: lbu a4, 7(a0)
785 ; RV32I-NEXT: lbu a5, 6(a0)
786 ; RV32I-NEXT: lbu a6, 1(a0)
787 ; RV32I-NEXT: lbu a7, 0(a0)
788 ; RV32I-NEXT: lbu t0, 3(a0)
789 ; RV32I-NEXT: lbu t1, 2(a0)
790 ; RV32I-NEXT: lbu t2, 13(a0)
791 ; RV32I-NEXT: lbu t3, 12(a0)
792 ; RV32I-NEXT: lbu t4, 15(a0)
793 ; RV32I-NEXT: lbu t5, 14(a0)
794 ; RV32I-NEXT: lbu t6, 10(a0)
795 ; RV32I-NEXT: lbu s0, 11(a0)
796 ; RV32I-NEXT: lbu s1, 8(a0)
797 ; RV32I-NEXT: lbu a0, 9(a0)
798 ; RV32I-NEXT: sb t6, 10(a2)
799 ; RV32I-NEXT: sb s0, 11(a2)
800 ; RV32I-NEXT: sb s1, 8(a2)
801 ; RV32I-NEXT: sb a0, 9(a2)
802 ; RV32I-NEXT: sb t5, 14(a2)
803 ; RV32I-NEXT: sb t4, 15(a2)
804 ; RV32I-NEXT: sb t3, 12(a2)
805 ; RV32I-NEXT: sb t2, 13(a2)
806 ; RV32I-NEXT: sb t1, 2(a2)
807 ; RV32I-NEXT: sb t0, 3(a2)
808 ; RV32I-NEXT: sb a7, 0(a2)
809 ; RV32I-NEXT: sb a6, 1(a2)
810 ; RV32I-NEXT: sb a5, 6(a2)
811 ; RV32I-NEXT: sb a4, 7(a2)
812 ; RV32I-NEXT: sb a3, 4(a2)
813 ; RV32I-NEXT: sb a1, 5(a2)
814 ; RV32I-NEXT: lw s0, 44(sp) # 4-byte Folded Reload
815 ; RV32I-NEXT: lw s1, 40(sp) # 4-byte Folded Reload
816 ; RV32I-NEXT: lw s2, 36(sp) # 4-byte Folded Reload
817 ; RV32I-NEXT: addi sp, sp, 48
819 %src = load i128, ptr %src.ptr, align 1
820 %byteOff = load i128, ptr %byteOff.ptr, align 1
821 %bitOff = shl i128 %byteOff, 3
822 %res = lshr i128 %src, %bitOff
823 store i128 %res, ptr %dst, align 1
826 define void @shl_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
827 ; RV64I-LABEL: shl_16bytes:
829 ; RV64I-NEXT: lbu a3, 1(a0)
830 ; RV64I-NEXT: lbu a4, 0(a0)
831 ; RV64I-NEXT: lbu a5, 2(a0)
832 ; RV64I-NEXT: lbu a6, 3(a0)
833 ; RV64I-NEXT: slli a3, a3, 8
834 ; RV64I-NEXT: or a3, a3, a4
835 ; RV64I-NEXT: slli a5, a5, 16
836 ; RV64I-NEXT: slli a6, a6, 24
837 ; RV64I-NEXT: or a4, a6, a5
838 ; RV64I-NEXT: or a3, a4, a3
839 ; RV64I-NEXT: lbu a4, 5(a0)
840 ; RV64I-NEXT: lbu a5, 4(a0)
841 ; RV64I-NEXT: lbu a6, 6(a0)
842 ; RV64I-NEXT: lbu a7, 7(a0)
843 ; RV64I-NEXT: slli a4, a4, 8
844 ; RV64I-NEXT: or a4, a4, a5
845 ; RV64I-NEXT: slli a6, a6, 16
846 ; RV64I-NEXT: slli a7, a7, 24
847 ; RV64I-NEXT: or a5, a7, a6
848 ; RV64I-NEXT: or a4, a5, a4
849 ; RV64I-NEXT: slli a4, a4, 32
850 ; RV64I-NEXT: or a3, a4, a3
851 ; RV64I-NEXT: lbu a4, 5(a1)
852 ; RV64I-NEXT: lbu a5, 4(a1)
853 ; RV64I-NEXT: lbu a6, 6(a1)
854 ; RV64I-NEXT: lbu a7, 7(a1)
855 ; RV64I-NEXT: slli a4, a4, 8
856 ; RV64I-NEXT: or a4, a4, a5
857 ; RV64I-NEXT: slli a6, a6, 16
858 ; RV64I-NEXT: slli a7, a7, 24
859 ; RV64I-NEXT: or a5, a7, a6
860 ; RV64I-NEXT: or a4, a5, a4
861 ; RV64I-NEXT: lbu a5, 1(a1)
862 ; RV64I-NEXT: lbu a6, 0(a1)
863 ; RV64I-NEXT: lbu a7, 2(a1)
864 ; RV64I-NEXT: lbu a1, 3(a1)
865 ; RV64I-NEXT: slli a5, a5, 8
866 ; RV64I-NEXT: or a5, a5, a6
867 ; RV64I-NEXT: slli a7, a7, 16
868 ; RV64I-NEXT: slli a1, a1, 24
869 ; RV64I-NEXT: or a1, a1, a7
870 ; RV64I-NEXT: or a1, a1, a5
871 ; RV64I-NEXT: slli a1, a1, 3
872 ; RV64I-NEXT: slli a4, a4, 35
873 ; RV64I-NEXT: or a5, a4, a1
874 ; RV64I-NEXT: addi a4, a5, -64
875 ; RV64I-NEXT: sll a1, a3, a5
876 ; RV64I-NEXT: bltz a4, .LBB7_2
877 ; RV64I-NEXT: # %bb.1:
878 ; RV64I-NEXT: mv a0, a1
879 ; RV64I-NEXT: j .LBB7_3
880 ; RV64I-NEXT: .LBB7_2:
881 ; RV64I-NEXT: lbu a6, 9(a0)
882 ; RV64I-NEXT: lbu a7, 8(a0)
883 ; RV64I-NEXT: lbu t0, 10(a0)
884 ; RV64I-NEXT: lbu t1, 11(a0)
885 ; RV64I-NEXT: slli a6, a6, 8
886 ; RV64I-NEXT: or a6, a6, a7
887 ; RV64I-NEXT: slli t0, t0, 16
888 ; RV64I-NEXT: slli t1, t1, 24
889 ; RV64I-NEXT: or a7, t1, t0
890 ; RV64I-NEXT: or a6, a7, a6
891 ; RV64I-NEXT: lbu a7, 13(a0)
892 ; RV64I-NEXT: lbu t0, 12(a0)
893 ; RV64I-NEXT: lbu t1, 14(a0)
894 ; RV64I-NEXT: lbu a0, 15(a0)
895 ; RV64I-NEXT: slli a7, a7, 8
896 ; RV64I-NEXT: or a7, a7, t0
897 ; RV64I-NEXT: slli t1, t1, 16
898 ; RV64I-NEXT: slli a0, a0, 24
899 ; RV64I-NEXT: or a0, a0, t1
900 ; RV64I-NEXT: or a0, a0, a7
901 ; RV64I-NEXT: slli a0, a0, 32
902 ; RV64I-NEXT: or a0, a0, a6
903 ; RV64I-NEXT: sll a0, a0, a5
904 ; RV64I-NEXT: not a5, a5
905 ; RV64I-NEXT: srli a3, a3, 1
906 ; RV64I-NEXT: srl a3, a3, a5
907 ; RV64I-NEXT: or a0, a0, a3
908 ; RV64I-NEXT: .LBB7_3:
909 ; RV64I-NEXT: srai a4, a4, 63
910 ; RV64I-NEXT: and a1, a4, a1
911 ; RV64I-NEXT: sb a1, 0(a2)
912 ; RV64I-NEXT: sb a0, 8(a2)
913 ; RV64I-NEXT: srli a3, a1, 56
914 ; RV64I-NEXT: sb a3, 7(a2)
915 ; RV64I-NEXT: srli a3, a1, 48
916 ; RV64I-NEXT: sb a3, 6(a2)
917 ; RV64I-NEXT: srli a3, a1, 40
918 ; RV64I-NEXT: sb a3, 5(a2)
919 ; RV64I-NEXT: srli a3, a1, 32
920 ; RV64I-NEXT: sb a3, 4(a2)
921 ; RV64I-NEXT: srli a3, a1, 24
922 ; RV64I-NEXT: sb a3, 3(a2)
923 ; RV64I-NEXT: srli a3, a1, 16
924 ; RV64I-NEXT: sb a3, 2(a2)
925 ; RV64I-NEXT: srli a1, a1, 8
926 ; RV64I-NEXT: sb a1, 1(a2)
927 ; RV64I-NEXT: srli a1, a0, 56
928 ; RV64I-NEXT: sb a1, 15(a2)
929 ; RV64I-NEXT: srli a1, a0, 48
930 ; RV64I-NEXT: sb a1, 14(a2)
931 ; RV64I-NEXT: srli a1, a0, 40
932 ; RV64I-NEXT: sb a1, 13(a2)
933 ; RV64I-NEXT: srli a1, a0, 32
934 ; RV64I-NEXT: sb a1, 12(a2)
935 ; RV64I-NEXT: srli a1, a0, 24
936 ; RV64I-NEXT: sb a1, 11(a2)
937 ; RV64I-NEXT: srli a1, a0, 16
938 ; RV64I-NEXT: sb a1, 10(a2)
939 ; RV64I-NEXT: srli a0, a0, 8
940 ; RV64I-NEXT: sb a0, 9(a2)
943 ; RV32I-LABEL: shl_16bytes:
945 ; RV32I-NEXT: addi sp, sp, -48
946 ; RV32I-NEXT: sw s0, 44(sp) # 4-byte Folded Spill
947 ; RV32I-NEXT: sw s1, 40(sp) # 4-byte Folded Spill
948 ; RV32I-NEXT: sw s2, 36(sp) # 4-byte Folded Spill
949 ; RV32I-NEXT: lbu a3, 0(a0)
950 ; RV32I-NEXT: lbu a4, 1(a0)
951 ; RV32I-NEXT: lbu a5, 2(a0)
952 ; RV32I-NEXT: lbu a6, 3(a0)
953 ; RV32I-NEXT: lbu a7, 4(a0)
954 ; RV32I-NEXT: lbu t0, 5(a0)
955 ; RV32I-NEXT: lbu t1, 6(a0)
956 ; RV32I-NEXT: lbu t2, 7(a0)
957 ; RV32I-NEXT: lbu t3, 8(a0)
958 ; RV32I-NEXT: lbu t4, 9(a0)
959 ; RV32I-NEXT: lbu t5, 10(a0)
960 ; RV32I-NEXT: lbu t6, 11(a0)
961 ; RV32I-NEXT: lbu s0, 12(a0)
962 ; RV32I-NEXT: lbu s1, 13(a0)
963 ; RV32I-NEXT: lbu s2, 14(a0)
964 ; RV32I-NEXT: lbu a0, 15(a0)
965 ; RV32I-NEXT: lbu a1, 0(a1)
966 ; RV32I-NEXT: sb zero, 19(sp)
967 ; RV32I-NEXT: sb zero, 18(sp)
968 ; RV32I-NEXT: sb zero, 17(sp)
969 ; RV32I-NEXT: sb zero, 16(sp)
970 ; RV32I-NEXT: sb zero, 15(sp)
971 ; RV32I-NEXT: sb zero, 14(sp)
972 ; RV32I-NEXT: sb zero, 13(sp)
973 ; RV32I-NEXT: sb zero, 12(sp)
974 ; RV32I-NEXT: sb zero, 11(sp)
975 ; RV32I-NEXT: sb zero, 10(sp)
976 ; RV32I-NEXT: sb zero, 9(sp)
977 ; RV32I-NEXT: sb zero, 8(sp)
978 ; RV32I-NEXT: sb zero, 7(sp)
979 ; RV32I-NEXT: sb zero, 6(sp)
980 ; RV32I-NEXT: sb zero, 5(sp)
981 ; RV32I-NEXT: sb zero, 4(sp)
982 ; RV32I-NEXT: sb a0, 35(sp)
983 ; RV32I-NEXT: sb s2, 34(sp)
984 ; RV32I-NEXT: sb s1, 33(sp)
985 ; RV32I-NEXT: sb s0, 32(sp)
986 ; RV32I-NEXT: sb t6, 31(sp)
987 ; RV32I-NEXT: sb t5, 30(sp)
988 ; RV32I-NEXT: sb t4, 29(sp)
989 ; RV32I-NEXT: sb t3, 28(sp)
990 ; RV32I-NEXT: sb t2, 27(sp)
991 ; RV32I-NEXT: sb t1, 26(sp)
992 ; RV32I-NEXT: sb t0, 25(sp)
993 ; RV32I-NEXT: sb a7, 24(sp)
994 ; RV32I-NEXT: sb a6, 23(sp)
995 ; RV32I-NEXT: sb a5, 22(sp)
996 ; RV32I-NEXT: sb a4, 21(sp)
997 ; RV32I-NEXT: sb a3, 20(sp)
998 ; RV32I-NEXT: andi a1, a1, 15
999 ; RV32I-NEXT: addi a0, sp, 20
1000 ; RV32I-NEXT: sub a0, a0, a1
1001 ; RV32I-NEXT: lbu a1, 5(a0)
1002 ; RV32I-NEXT: lbu a3, 4(a0)
1003 ; RV32I-NEXT: lbu a4, 7(a0)
1004 ; RV32I-NEXT: lbu a5, 6(a0)
1005 ; RV32I-NEXT: lbu a6, 1(a0)
1006 ; RV32I-NEXT: lbu a7, 0(a0)
1007 ; RV32I-NEXT: lbu t0, 3(a0)
1008 ; RV32I-NEXT: lbu t1, 2(a0)
1009 ; RV32I-NEXT: lbu t2, 13(a0)
1010 ; RV32I-NEXT: lbu t3, 12(a0)
1011 ; RV32I-NEXT: lbu t4, 15(a0)
1012 ; RV32I-NEXT: lbu t5, 14(a0)
1013 ; RV32I-NEXT: lbu t6, 10(a0)
1014 ; RV32I-NEXT: lbu s0, 11(a0)
1015 ; RV32I-NEXT: lbu s1, 8(a0)
1016 ; RV32I-NEXT: lbu a0, 9(a0)
1017 ; RV32I-NEXT: sb t6, 10(a2)
1018 ; RV32I-NEXT: sb s0, 11(a2)
1019 ; RV32I-NEXT: sb s1, 8(a2)
1020 ; RV32I-NEXT: sb a0, 9(a2)
1021 ; RV32I-NEXT: sb t5, 14(a2)
1022 ; RV32I-NEXT: sb t4, 15(a2)
1023 ; RV32I-NEXT: sb t3, 12(a2)
1024 ; RV32I-NEXT: sb t2, 13(a2)
1025 ; RV32I-NEXT: sb t1, 2(a2)
1026 ; RV32I-NEXT: sb t0, 3(a2)
1027 ; RV32I-NEXT: sb a7, 0(a2)
1028 ; RV32I-NEXT: sb a6, 1(a2)
1029 ; RV32I-NEXT: sb a5, 6(a2)
1030 ; RV32I-NEXT: sb a4, 7(a2)
1031 ; RV32I-NEXT: sb a3, 4(a2)
1032 ; RV32I-NEXT: sb a1, 5(a2)
1033 ; RV32I-NEXT: lw s0, 44(sp) # 4-byte Folded Reload
1034 ; RV32I-NEXT: lw s1, 40(sp) # 4-byte Folded Reload
1035 ; RV32I-NEXT: lw s2, 36(sp) # 4-byte Folded Reload
1036 ; RV32I-NEXT: addi sp, sp, 48
1038 %src = load i128, ptr %src.ptr, align 1
1039 %byteOff = load i128, ptr %byteOff.ptr, align 1
1040 %bitOff = shl i128 %byteOff, 3
1041 %res = shl i128 %src, %bitOff
1042 store i128 %res, ptr %dst, align 1
1045 define void @ashr_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
1046 ; RV64I-LABEL: ashr_16bytes:
1048 ; RV64I-NEXT: lbu a3, 9(a0)
1049 ; RV64I-NEXT: lbu a4, 8(a0)
1050 ; RV64I-NEXT: lbu a5, 10(a0)
1051 ; RV64I-NEXT: lbu a6, 11(a0)
1052 ; RV64I-NEXT: slli a3, a3, 8
1053 ; RV64I-NEXT: or a3, a3, a4
1054 ; RV64I-NEXT: slli a5, a5, 16
1055 ; RV64I-NEXT: slli a6, a6, 24
1056 ; RV64I-NEXT: or a4, a6, a5
1057 ; RV64I-NEXT: or a3, a4, a3
1058 ; RV64I-NEXT: lbu a4, 13(a0)
1059 ; RV64I-NEXT: lbu a5, 12(a0)
1060 ; RV64I-NEXT: lbu a6, 14(a0)
1061 ; RV64I-NEXT: lbu a7, 15(a0)
1062 ; RV64I-NEXT: slli a4, a4, 8
1063 ; RV64I-NEXT: or a4, a4, a5
1064 ; RV64I-NEXT: slli a6, a6, 16
1065 ; RV64I-NEXT: slli a7, a7, 24
1066 ; RV64I-NEXT: or a5, a7, a6
1067 ; RV64I-NEXT: or a4, a5, a4
1068 ; RV64I-NEXT: slli a5, a4, 32
1069 ; RV64I-NEXT: or a3, a5, a3
1070 ; RV64I-NEXT: lbu a5, 5(a1)
1071 ; RV64I-NEXT: lbu a6, 4(a1)
1072 ; RV64I-NEXT: lbu a7, 6(a1)
1073 ; RV64I-NEXT: lbu t0, 7(a1)
1074 ; RV64I-NEXT: slli a5, a5, 8
1075 ; RV64I-NEXT: or a5, a5, a6
1076 ; RV64I-NEXT: slli a7, a7, 16
1077 ; RV64I-NEXT: slli t0, t0, 24
1078 ; RV64I-NEXT: or a6, t0, a7
1079 ; RV64I-NEXT: or a5, a6, a5
1080 ; RV64I-NEXT: lbu a6, 1(a1)
1081 ; RV64I-NEXT: lbu a7, 0(a1)
1082 ; RV64I-NEXT: lbu t0, 2(a1)
1083 ; RV64I-NEXT: lbu a1, 3(a1)
1084 ; RV64I-NEXT: slli a6, a6, 8
1085 ; RV64I-NEXT: or a6, a6, a7
1086 ; RV64I-NEXT: slli t0, t0, 16
1087 ; RV64I-NEXT: slli a1, a1, 24
1088 ; RV64I-NEXT: or a1, a1, t0
1089 ; RV64I-NEXT: or a1, a1, a6
1090 ; RV64I-NEXT: slli a1, a1, 3
1091 ; RV64I-NEXT: slli a5, a5, 35
1092 ; RV64I-NEXT: or a5, a5, a1
1093 ; RV64I-NEXT: addi a6, a5, -64
1094 ; RV64I-NEXT: sra a1, a3, a5
1095 ; RV64I-NEXT: bltz a6, .LBB8_2
1096 ; RV64I-NEXT: # %bb.1:
1097 ; RV64I-NEXT: sraiw a3, a4, 31
1098 ; RV64I-NEXT: mv a0, a1
1099 ; RV64I-NEXT: mv a1, a3
1100 ; RV64I-NEXT: j .LBB8_3
1101 ; RV64I-NEXT: .LBB8_2:
1102 ; RV64I-NEXT: lbu a4, 1(a0)
1103 ; RV64I-NEXT: lbu a6, 0(a0)
1104 ; RV64I-NEXT: lbu a7, 2(a0)
1105 ; RV64I-NEXT: lbu t0, 3(a0)
1106 ; RV64I-NEXT: slli a4, a4, 8
1107 ; RV64I-NEXT: or a4, a4, a6
1108 ; RV64I-NEXT: slli a7, a7, 16
1109 ; RV64I-NEXT: slli t0, t0, 24
1110 ; RV64I-NEXT: or a6, t0, a7
1111 ; RV64I-NEXT: or a4, a6, a4
1112 ; RV64I-NEXT: lbu a6, 5(a0)
1113 ; RV64I-NEXT: lbu a7, 4(a0)
1114 ; RV64I-NEXT: lbu t0, 6(a0)
1115 ; RV64I-NEXT: lbu a0, 7(a0)
1116 ; RV64I-NEXT: slli a6, a6, 8
1117 ; RV64I-NEXT: or a6, a6, a7
1118 ; RV64I-NEXT: slli t0, t0, 16
1119 ; RV64I-NEXT: slli a0, a0, 24
1120 ; RV64I-NEXT: or a0, a0, t0
1121 ; RV64I-NEXT: or a0, a0, a6
1122 ; RV64I-NEXT: slli a0, a0, 32
1123 ; RV64I-NEXT: or a0, a0, a4
1124 ; RV64I-NEXT: srl a0, a0, a5
1125 ; RV64I-NEXT: not a4, a5
1126 ; RV64I-NEXT: slli a3, a3, 1
1127 ; RV64I-NEXT: sll a3, a3, a4
1128 ; RV64I-NEXT: or a0, a0, a3
1129 ; RV64I-NEXT: .LBB8_3:
1130 ; RV64I-NEXT: sb a1, 8(a2)
1131 ; RV64I-NEXT: srli a3, a1, 56
1132 ; RV64I-NEXT: sb a3, 15(a2)
1133 ; RV64I-NEXT: srli a3, a1, 48
1134 ; RV64I-NEXT: sb a3, 14(a2)
1135 ; RV64I-NEXT: srli a3, a1, 40
1136 ; RV64I-NEXT: sb a3, 13(a2)
1137 ; RV64I-NEXT: srli a3, a1, 32
1138 ; RV64I-NEXT: sb a3, 12(a2)
1139 ; RV64I-NEXT: srli a3, a1, 24
1140 ; RV64I-NEXT: sb a3, 11(a2)
1141 ; RV64I-NEXT: srli a3, a1, 16
1142 ; RV64I-NEXT: sb a3, 10(a2)
1143 ; RV64I-NEXT: srli a1, a1, 8
1144 ; RV64I-NEXT: sb a1, 9(a2)
1145 ; RV64I-NEXT: sb a0, 0(a2)
1146 ; RV64I-NEXT: srli a1, a0, 56
1147 ; RV64I-NEXT: sb a1, 7(a2)
1148 ; RV64I-NEXT: srli a1, a0, 48
1149 ; RV64I-NEXT: sb a1, 6(a2)
1150 ; RV64I-NEXT: srli a1, a0, 40
1151 ; RV64I-NEXT: sb a1, 5(a2)
1152 ; RV64I-NEXT: srli a1, a0, 32
1153 ; RV64I-NEXT: sb a1, 4(a2)
1154 ; RV64I-NEXT: srli a1, a0, 24
1155 ; RV64I-NEXT: sb a1, 3(a2)
1156 ; RV64I-NEXT: srli a1, a0, 16
1157 ; RV64I-NEXT: sb a1, 2(a2)
1158 ; RV64I-NEXT: srli a0, a0, 8
1159 ; RV64I-NEXT: sb a0, 1(a2)
1162 ; RV32I-LABEL: ashr_16bytes:
1164 ; RV32I-NEXT: addi sp, sp, -48
1165 ; RV32I-NEXT: sw s0, 44(sp) # 4-byte Folded Spill
1166 ; RV32I-NEXT: sw s1, 40(sp) # 4-byte Folded Spill
1167 ; RV32I-NEXT: sw s2, 36(sp) # 4-byte Folded Spill
1168 ; RV32I-NEXT: sw s3, 32(sp) # 4-byte Folded Spill
1169 ; RV32I-NEXT: lbu a3, 15(a0)
1170 ; RV32I-NEXT: slli a4, a3, 24
1171 ; RV32I-NEXT: lbu a5, 0(a0)
1172 ; RV32I-NEXT: lbu a6, 1(a0)
1173 ; RV32I-NEXT: lbu a7, 2(a0)
1174 ; RV32I-NEXT: lbu t0, 3(a0)
1175 ; RV32I-NEXT: lbu t1, 4(a0)
1176 ; RV32I-NEXT: lbu t2, 5(a0)
1177 ; RV32I-NEXT: lbu t3, 6(a0)
1178 ; RV32I-NEXT: lbu t4, 7(a0)
1179 ; RV32I-NEXT: lbu t5, 8(a0)
1180 ; RV32I-NEXT: lbu t6, 9(a0)
1181 ; RV32I-NEXT: lbu s0, 10(a0)
1182 ; RV32I-NEXT: lbu s1, 11(a0)
1183 ; RV32I-NEXT: lbu s2, 12(a0)
1184 ; RV32I-NEXT: lbu s3, 14(a0)
1185 ; RV32I-NEXT: lbu a0, 13(a0)
1186 ; RV32I-NEXT: lbu a1, 0(a1)
1187 ; RV32I-NEXT: sb a3, 15(sp)
1188 ; RV32I-NEXT: sb s3, 14(sp)
1189 ; RV32I-NEXT: sb a0, 13(sp)
1190 ; RV32I-NEXT: sb s2, 12(sp)
1191 ; RV32I-NEXT: sb s1, 11(sp)
1192 ; RV32I-NEXT: sb s0, 10(sp)
1193 ; RV32I-NEXT: sb t6, 9(sp)
1194 ; RV32I-NEXT: sb t5, 8(sp)
1195 ; RV32I-NEXT: sb t4, 7(sp)
1196 ; RV32I-NEXT: sb t3, 6(sp)
1197 ; RV32I-NEXT: sb t2, 5(sp)
1198 ; RV32I-NEXT: sb t1, 4(sp)
1199 ; RV32I-NEXT: sb t0, 3(sp)
1200 ; RV32I-NEXT: sb a7, 2(sp)
1201 ; RV32I-NEXT: sb a6, 1(sp)
1202 ; RV32I-NEXT: sb a5, 0(sp)
1203 ; RV32I-NEXT: srai a4, a4, 31
1204 ; RV32I-NEXT: sb a4, 28(sp)
1205 ; RV32I-NEXT: sb a4, 24(sp)
1206 ; RV32I-NEXT: sb a4, 20(sp)
1207 ; RV32I-NEXT: sb a4, 16(sp)
1208 ; RV32I-NEXT: srli a0, a4, 24
1209 ; RV32I-NEXT: sb a0, 31(sp)
1210 ; RV32I-NEXT: srli a3, a4, 16
1211 ; RV32I-NEXT: sb a3, 30(sp)
1212 ; RV32I-NEXT: srli a4, a4, 8
1213 ; RV32I-NEXT: sb a4, 29(sp)
1214 ; RV32I-NEXT: sb a0, 27(sp)
1215 ; RV32I-NEXT: sb a3, 26(sp)
1216 ; RV32I-NEXT: sb a4, 25(sp)
1217 ; RV32I-NEXT: sb a0, 23(sp)
1218 ; RV32I-NEXT: sb a3, 22(sp)
1219 ; RV32I-NEXT: sb a4, 21(sp)
1220 ; RV32I-NEXT: sb a0, 19(sp)
1221 ; RV32I-NEXT: sb a3, 18(sp)
1222 ; RV32I-NEXT: sb a4, 17(sp)
1223 ; RV32I-NEXT: andi a1, a1, 15
1224 ; RV32I-NEXT: mv a0, sp
1225 ; RV32I-NEXT: add a0, a0, a1
1226 ; RV32I-NEXT: lbu a1, 5(a0)
1227 ; RV32I-NEXT: lbu a3, 4(a0)
1228 ; RV32I-NEXT: lbu a4, 7(a0)
1229 ; RV32I-NEXT: lbu a5, 6(a0)
1230 ; RV32I-NEXT: lbu a6, 1(a0)
1231 ; RV32I-NEXT: lbu a7, 0(a0)
1232 ; RV32I-NEXT: lbu t0, 3(a0)
1233 ; RV32I-NEXT: lbu t1, 2(a0)
1234 ; RV32I-NEXT: lbu t2, 13(a0)
1235 ; RV32I-NEXT: lbu t3, 12(a0)
1236 ; RV32I-NEXT: lbu t4, 15(a0)
1237 ; RV32I-NEXT: lbu t5, 14(a0)
1238 ; RV32I-NEXT: lbu t6, 10(a0)
1239 ; RV32I-NEXT: lbu s0, 11(a0)
1240 ; RV32I-NEXT: lbu s1, 8(a0)
1241 ; RV32I-NEXT: lbu a0, 9(a0)
1242 ; RV32I-NEXT: sb t6, 10(a2)
1243 ; RV32I-NEXT: sb s0, 11(a2)
1244 ; RV32I-NEXT: sb s1, 8(a2)
1245 ; RV32I-NEXT: sb a0, 9(a2)
1246 ; RV32I-NEXT: sb t5, 14(a2)
1247 ; RV32I-NEXT: sb t4, 15(a2)
1248 ; RV32I-NEXT: sb t3, 12(a2)
1249 ; RV32I-NEXT: sb t2, 13(a2)
1250 ; RV32I-NEXT: sb t1, 2(a2)
1251 ; RV32I-NEXT: sb t0, 3(a2)
1252 ; RV32I-NEXT: sb a7, 0(a2)
1253 ; RV32I-NEXT: sb a6, 1(a2)
1254 ; RV32I-NEXT: sb a5, 6(a2)
1255 ; RV32I-NEXT: sb a4, 7(a2)
1256 ; RV32I-NEXT: sb a3, 4(a2)
1257 ; RV32I-NEXT: sb a1, 5(a2)
1258 ; RV32I-NEXT: lw s0, 44(sp) # 4-byte Folded Reload
1259 ; RV32I-NEXT: lw s1, 40(sp) # 4-byte Folded Reload
1260 ; RV32I-NEXT: lw s2, 36(sp) # 4-byte Folded Reload
1261 ; RV32I-NEXT: lw s3, 32(sp) # 4-byte Folded Reload
1262 ; RV32I-NEXT: addi sp, sp, 48
1264 %src = load i128, ptr %src.ptr, align 1
1265 %byteOff = load i128, ptr %byteOff.ptr, align 1
1266 %bitOff = shl i128 %byteOff, 3
1267 %res = ashr i128 %src, %bitOff
1268 store i128 %res, ptr %dst, align 1
1272 define void @lshr_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
1273 ; RV64I-LABEL: lshr_32bytes:
1275 ; RV64I-NEXT: addi sp, sp, -224
1276 ; RV64I-NEXT: sd ra, 216(sp) # 8-byte Folded Spill
1277 ; RV64I-NEXT: sd s0, 208(sp) # 8-byte Folded Spill
1278 ; RV64I-NEXT: sd s1, 200(sp) # 8-byte Folded Spill
1279 ; RV64I-NEXT: sd s2, 192(sp) # 8-byte Folded Spill
1280 ; RV64I-NEXT: sd s3, 184(sp) # 8-byte Folded Spill
1281 ; RV64I-NEXT: sd s4, 176(sp) # 8-byte Folded Spill
1282 ; RV64I-NEXT: sd s5, 168(sp) # 8-byte Folded Spill
1283 ; RV64I-NEXT: sd s6, 160(sp) # 8-byte Folded Spill
1284 ; RV64I-NEXT: sd s7, 152(sp) # 8-byte Folded Spill
1285 ; RV64I-NEXT: sd s8, 144(sp) # 8-byte Folded Spill
1286 ; RV64I-NEXT: sd s9, 136(sp) # 8-byte Folded Spill
1287 ; RV64I-NEXT: sd s10, 128(sp) # 8-byte Folded Spill
1288 ; RV64I-NEXT: sd s11, 120(sp) # 8-byte Folded Spill
1289 ; RV64I-NEXT: lbu a3, 0(a0)
1290 ; RV64I-NEXT: sd a3, 48(sp) # 8-byte Folded Spill
1291 ; RV64I-NEXT: lbu a3, 1(a0)
1292 ; RV64I-NEXT: sd a3, 40(sp) # 8-byte Folded Spill
1293 ; RV64I-NEXT: lbu a3, 2(a0)
1294 ; RV64I-NEXT: sd a3, 32(sp) # 8-byte Folded Spill
1295 ; RV64I-NEXT: lbu a3, 3(a0)
1296 ; RV64I-NEXT: sd a3, 24(sp) # 8-byte Folded Spill
1297 ; RV64I-NEXT: lbu a3, 4(a0)
1298 ; RV64I-NEXT: sd a3, 16(sp) # 8-byte Folded Spill
1299 ; RV64I-NEXT: lbu a3, 5(a0)
1300 ; RV64I-NEXT: sd a3, 8(sp) # 8-byte Folded Spill
1301 ; RV64I-NEXT: lbu t1, 6(a0)
1302 ; RV64I-NEXT: lbu t2, 7(a0)
1303 ; RV64I-NEXT: lbu t3, 8(a0)
1304 ; RV64I-NEXT: lbu t4, 9(a0)
1305 ; RV64I-NEXT: lbu t5, 10(a0)
1306 ; RV64I-NEXT: lbu t6, 11(a0)
1307 ; RV64I-NEXT: lbu s0, 12(a0)
1308 ; RV64I-NEXT: lbu s1, 13(a0)
1309 ; RV64I-NEXT: lbu s2, 14(a0)
1310 ; RV64I-NEXT: lbu s3, 15(a0)
1311 ; RV64I-NEXT: lbu s4, 16(a0)
1312 ; RV64I-NEXT: lbu s5, 17(a0)
1313 ; RV64I-NEXT: lbu s6, 18(a0)
1314 ; RV64I-NEXT: lbu s7, 19(a0)
1315 ; RV64I-NEXT: lbu s8, 20(a0)
1316 ; RV64I-NEXT: lbu s9, 21(a0)
1317 ; RV64I-NEXT: lbu s10, 22(a0)
1318 ; RV64I-NEXT: lbu s11, 23(a0)
1319 ; RV64I-NEXT: lbu ra, 24(a0)
1320 ; RV64I-NEXT: lbu t0, 25(a0)
1321 ; RV64I-NEXT: lbu a7, 26(a0)
1322 ; RV64I-NEXT: lbu a6, 27(a0)
1323 ; RV64I-NEXT: lbu a5, 28(a0)
1324 ; RV64I-NEXT: lbu a3, 31(a0)
1325 ; RV64I-NEXT: lbu a4, 30(a0)
1326 ; RV64I-NEXT: lbu a0, 29(a0)
1327 ; RV64I-NEXT: lbu a1, 0(a1)
1328 ; RV64I-NEXT: sb a3, 87(sp)
1329 ; RV64I-NEXT: sb a4, 86(sp)
1330 ; RV64I-NEXT: sb a0, 85(sp)
1331 ; RV64I-NEXT: sb a5, 84(sp)
1332 ; RV64I-NEXT: sb a6, 83(sp)
1333 ; RV64I-NEXT: sb a7, 82(sp)
1334 ; RV64I-NEXT: sb zero, 119(sp)
1335 ; RV64I-NEXT: sb zero, 118(sp)
1336 ; RV64I-NEXT: sb zero, 117(sp)
1337 ; RV64I-NEXT: sb zero, 116(sp)
1338 ; RV64I-NEXT: sb zero, 115(sp)
1339 ; RV64I-NEXT: sb zero, 114(sp)
1340 ; RV64I-NEXT: sb zero, 113(sp)
1341 ; RV64I-NEXT: sb zero, 112(sp)
1342 ; RV64I-NEXT: sb zero, 111(sp)
1343 ; RV64I-NEXT: sb zero, 110(sp)
1344 ; RV64I-NEXT: sb zero, 109(sp)
1345 ; RV64I-NEXT: sb zero, 108(sp)
1346 ; RV64I-NEXT: sb zero, 107(sp)
1347 ; RV64I-NEXT: sb zero, 106(sp)
1348 ; RV64I-NEXT: sb zero, 105(sp)
1349 ; RV64I-NEXT: sb zero, 104(sp)
1350 ; RV64I-NEXT: sb zero, 103(sp)
1351 ; RV64I-NEXT: sb zero, 102(sp)
1352 ; RV64I-NEXT: sb zero, 101(sp)
1353 ; RV64I-NEXT: sb zero, 100(sp)
1354 ; RV64I-NEXT: sb zero, 99(sp)
1355 ; RV64I-NEXT: sb zero, 98(sp)
1356 ; RV64I-NEXT: sb zero, 97(sp)
1357 ; RV64I-NEXT: sb zero, 96(sp)
1358 ; RV64I-NEXT: sb zero, 95(sp)
1359 ; RV64I-NEXT: sb zero, 94(sp)
1360 ; RV64I-NEXT: sb zero, 93(sp)
1361 ; RV64I-NEXT: sb zero, 92(sp)
1362 ; RV64I-NEXT: sb zero, 91(sp)
1363 ; RV64I-NEXT: sb zero, 90(sp)
1364 ; RV64I-NEXT: sb zero, 89(sp)
1365 ; RV64I-NEXT: sb zero, 88(sp)
1366 ; RV64I-NEXT: sb t0, 81(sp)
1367 ; RV64I-NEXT: sb ra, 80(sp)
1368 ; RV64I-NEXT: sb s11, 79(sp)
1369 ; RV64I-NEXT: sb s10, 78(sp)
1370 ; RV64I-NEXT: sb s9, 77(sp)
1371 ; RV64I-NEXT: sb s8, 76(sp)
1372 ; RV64I-NEXT: sb s7, 75(sp)
1373 ; RV64I-NEXT: sb s6, 74(sp)
1374 ; RV64I-NEXT: sb s5, 73(sp)
1375 ; RV64I-NEXT: sb s4, 72(sp)
1376 ; RV64I-NEXT: sb s3, 71(sp)
1377 ; RV64I-NEXT: sb s2, 70(sp)
1378 ; RV64I-NEXT: sb s1, 69(sp)
1379 ; RV64I-NEXT: sb s0, 68(sp)
1380 ; RV64I-NEXT: sb t6, 67(sp)
1381 ; RV64I-NEXT: sb t5, 66(sp)
1382 ; RV64I-NEXT: sb t4, 65(sp)
1383 ; RV64I-NEXT: sb t3, 64(sp)
1384 ; RV64I-NEXT: sb t2, 63(sp)
1385 ; RV64I-NEXT: sb t1, 62(sp)
1386 ; RV64I-NEXT: ld a0, 8(sp) # 8-byte Folded Reload
1387 ; RV64I-NEXT: sb a0, 61(sp)
1388 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
1389 ; RV64I-NEXT: sb a0, 60(sp)
1390 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
1391 ; RV64I-NEXT: sb a0, 59(sp)
1392 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
1393 ; RV64I-NEXT: sb a0, 58(sp)
1394 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
1395 ; RV64I-NEXT: sb a0, 57(sp)
1396 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
1397 ; RV64I-NEXT: sb a0, 56(sp)
1398 ; RV64I-NEXT: andi a1, a1, 31
1399 ; RV64I-NEXT: addi a0, sp, 56
1400 ; RV64I-NEXT: add a6, a0, a1
1401 ; RV64I-NEXT: lbu a0, 8(a6)
1402 ; RV64I-NEXT: sd a0, 48(sp) # 8-byte Folded Spill
1403 ; RV64I-NEXT: lbu a0, 9(a6)
1404 ; RV64I-NEXT: sd a0, 40(sp) # 8-byte Folded Spill
1405 ; RV64I-NEXT: lbu a0, 10(a6)
1406 ; RV64I-NEXT: sd a0, 32(sp) # 8-byte Folded Spill
1407 ; RV64I-NEXT: lbu a0, 11(a6)
1408 ; RV64I-NEXT: sd a0, 24(sp) # 8-byte Folded Spill
1409 ; RV64I-NEXT: lbu a0, 12(a6)
1410 ; RV64I-NEXT: sd a0, 16(sp) # 8-byte Folded Spill
1411 ; RV64I-NEXT: lbu a7, 13(a6)
1412 ; RV64I-NEXT: lbu t0, 14(a6)
1413 ; RV64I-NEXT: lbu t1, 15(a6)
1414 ; RV64I-NEXT: lbu t2, 0(a6)
1415 ; RV64I-NEXT: lbu t3, 1(a6)
1416 ; RV64I-NEXT: lbu t4, 2(a6)
1417 ; RV64I-NEXT: lbu t5, 3(a6)
1418 ; RV64I-NEXT: lbu t6, 4(a6)
1419 ; RV64I-NEXT: lbu s0, 5(a6)
1420 ; RV64I-NEXT: lbu s1, 6(a6)
1421 ; RV64I-NEXT: lbu s2, 7(a6)
1422 ; RV64I-NEXT: lbu s3, 24(a6)
1423 ; RV64I-NEXT: lbu s4, 25(a6)
1424 ; RV64I-NEXT: lbu s5, 26(a6)
1425 ; RV64I-NEXT: lbu s6, 27(a6)
1426 ; RV64I-NEXT: lbu s7, 28(a6)
1427 ; RV64I-NEXT: lbu s8, 29(a6)
1428 ; RV64I-NEXT: lbu s9, 30(a6)
1429 ; RV64I-NEXT: lbu s10, 31(a6)
1430 ; RV64I-NEXT: lbu s11, 16(a6)
1431 ; RV64I-NEXT: lbu ra, 17(a6)
1432 ; RV64I-NEXT: lbu a5, 18(a6)
1433 ; RV64I-NEXT: lbu a4, 19(a6)
1434 ; RV64I-NEXT: lbu a0, 23(a6)
1435 ; RV64I-NEXT: lbu a1, 22(a6)
1436 ; RV64I-NEXT: lbu a3, 21(a6)
1437 ; RV64I-NEXT: lbu a6, 20(a6)
1438 ; RV64I-NEXT: sb a0, 23(a2)
1439 ; RV64I-NEXT: sb a1, 22(a2)
1440 ; RV64I-NEXT: sb a3, 21(a2)
1441 ; RV64I-NEXT: sb a6, 20(a2)
1442 ; RV64I-NEXT: sb a4, 19(a2)
1443 ; RV64I-NEXT: sb a5, 18(a2)
1444 ; RV64I-NEXT: sb ra, 17(a2)
1445 ; RV64I-NEXT: sb s11, 16(a2)
1446 ; RV64I-NEXT: sb s10, 31(a2)
1447 ; RV64I-NEXT: sb s9, 30(a2)
1448 ; RV64I-NEXT: sb s8, 29(a2)
1449 ; RV64I-NEXT: sb s7, 28(a2)
1450 ; RV64I-NEXT: sb s6, 27(a2)
1451 ; RV64I-NEXT: sb s5, 26(a2)
1452 ; RV64I-NEXT: sb s4, 25(a2)
1453 ; RV64I-NEXT: sb s3, 24(a2)
1454 ; RV64I-NEXT: sb s2, 7(a2)
1455 ; RV64I-NEXT: sb s1, 6(a2)
1456 ; RV64I-NEXT: sb s0, 5(a2)
1457 ; RV64I-NEXT: sb t6, 4(a2)
1458 ; RV64I-NEXT: sb t5, 3(a2)
1459 ; RV64I-NEXT: sb t4, 2(a2)
1460 ; RV64I-NEXT: sb t3, 1(a2)
1461 ; RV64I-NEXT: sb t2, 0(a2)
1462 ; RV64I-NEXT: sb t1, 15(a2)
1463 ; RV64I-NEXT: sb t0, 14(a2)
1464 ; RV64I-NEXT: sb a7, 13(a2)
1465 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
1466 ; RV64I-NEXT: sb a0, 12(a2)
1467 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
1468 ; RV64I-NEXT: sb a0, 11(a2)
1469 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
1470 ; RV64I-NEXT: sb a0, 10(a2)
1471 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
1472 ; RV64I-NEXT: sb a0, 9(a2)
1473 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
1474 ; RV64I-NEXT: sb a0, 8(a2)
1475 ; RV64I-NEXT: ld ra, 216(sp) # 8-byte Folded Reload
1476 ; RV64I-NEXT: ld s0, 208(sp) # 8-byte Folded Reload
1477 ; RV64I-NEXT: ld s1, 200(sp) # 8-byte Folded Reload
1478 ; RV64I-NEXT: ld s2, 192(sp) # 8-byte Folded Reload
1479 ; RV64I-NEXT: ld s3, 184(sp) # 8-byte Folded Reload
1480 ; RV64I-NEXT: ld s4, 176(sp) # 8-byte Folded Reload
1481 ; RV64I-NEXT: ld s5, 168(sp) # 8-byte Folded Reload
1482 ; RV64I-NEXT: ld s6, 160(sp) # 8-byte Folded Reload
1483 ; RV64I-NEXT: ld s7, 152(sp) # 8-byte Folded Reload
1484 ; RV64I-NEXT: ld s8, 144(sp) # 8-byte Folded Reload
1485 ; RV64I-NEXT: ld s9, 136(sp) # 8-byte Folded Reload
1486 ; RV64I-NEXT: ld s10, 128(sp) # 8-byte Folded Reload
1487 ; RV64I-NEXT: ld s11, 120(sp) # 8-byte Folded Reload
1488 ; RV64I-NEXT: addi sp, sp, 224
1491 ; RV32I-LABEL: lshr_32bytes:
1493 ; RV32I-NEXT: addi sp, sp, -144
1494 ; RV32I-NEXT: sw ra, 140(sp) # 4-byte Folded Spill
1495 ; RV32I-NEXT: sw s0, 136(sp) # 4-byte Folded Spill
1496 ; RV32I-NEXT: sw s1, 132(sp) # 4-byte Folded Spill
1497 ; RV32I-NEXT: sw s2, 128(sp) # 4-byte Folded Spill
1498 ; RV32I-NEXT: sw s3, 124(sp) # 4-byte Folded Spill
1499 ; RV32I-NEXT: sw s4, 120(sp) # 4-byte Folded Spill
1500 ; RV32I-NEXT: sw s5, 116(sp) # 4-byte Folded Spill
1501 ; RV32I-NEXT: sw s6, 112(sp) # 4-byte Folded Spill
1502 ; RV32I-NEXT: sw s7, 108(sp) # 4-byte Folded Spill
1503 ; RV32I-NEXT: sw s8, 104(sp) # 4-byte Folded Spill
1504 ; RV32I-NEXT: sw s9, 100(sp) # 4-byte Folded Spill
1505 ; RV32I-NEXT: sw s10, 96(sp) # 4-byte Folded Spill
1506 ; RV32I-NEXT: sw s11, 92(sp) # 4-byte Folded Spill
1507 ; RV32I-NEXT: lbu a3, 0(a0)
1508 ; RV32I-NEXT: sw a3, 24(sp) # 4-byte Folded Spill
1509 ; RV32I-NEXT: lbu a3, 1(a0)
1510 ; RV32I-NEXT: sw a3, 20(sp) # 4-byte Folded Spill
1511 ; RV32I-NEXT: lbu a3, 2(a0)
1512 ; RV32I-NEXT: sw a3, 16(sp) # 4-byte Folded Spill
1513 ; RV32I-NEXT: lbu a3, 3(a0)
1514 ; RV32I-NEXT: sw a3, 12(sp) # 4-byte Folded Spill
1515 ; RV32I-NEXT: lbu a3, 4(a0)
1516 ; RV32I-NEXT: sw a3, 8(sp) # 4-byte Folded Spill
1517 ; RV32I-NEXT: lbu a3, 5(a0)
1518 ; RV32I-NEXT: sw a3, 4(sp) # 4-byte Folded Spill
1519 ; RV32I-NEXT: lbu t1, 6(a0)
1520 ; RV32I-NEXT: lbu t2, 7(a0)
1521 ; RV32I-NEXT: lbu t3, 8(a0)
1522 ; RV32I-NEXT: lbu t4, 9(a0)
1523 ; RV32I-NEXT: lbu t5, 10(a0)
1524 ; RV32I-NEXT: lbu t6, 11(a0)
1525 ; RV32I-NEXT: lbu s0, 12(a0)
1526 ; RV32I-NEXT: lbu s1, 13(a0)
1527 ; RV32I-NEXT: lbu s2, 14(a0)
1528 ; RV32I-NEXT: lbu s3, 15(a0)
1529 ; RV32I-NEXT: lbu s4, 16(a0)
1530 ; RV32I-NEXT: lbu s5, 17(a0)
1531 ; RV32I-NEXT: lbu s6, 18(a0)
1532 ; RV32I-NEXT: lbu s7, 19(a0)
1533 ; RV32I-NEXT: lbu s8, 20(a0)
1534 ; RV32I-NEXT: lbu s9, 21(a0)
1535 ; RV32I-NEXT: lbu s10, 22(a0)
1536 ; RV32I-NEXT: lbu s11, 23(a0)
1537 ; RV32I-NEXT: lbu ra, 24(a0)
1538 ; RV32I-NEXT: lbu t0, 25(a0)
1539 ; RV32I-NEXT: lbu a7, 26(a0)
1540 ; RV32I-NEXT: lbu a6, 27(a0)
1541 ; RV32I-NEXT: lbu a5, 28(a0)
1542 ; RV32I-NEXT: lbu a3, 31(a0)
1543 ; RV32I-NEXT: lbu a4, 30(a0)
1544 ; RV32I-NEXT: lbu a0, 29(a0)
1545 ; RV32I-NEXT: lbu a1, 0(a1)
1546 ; RV32I-NEXT: sb a3, 59(sp)
1547 ; RV32I-NEXT: sb a4, 58(sp)
1548 ; RV32I-NEXT: sb a0, 57(sp)
1549 ; RV32I-NEXT: sb a5, 56(sp)
1550 ; RV32I-NEXT: sb a6, 55(sp)
1551 ; RV32I-NEXT: sb a7, 54(sp)
1552 ; RV32I-NEXT: sb zero, 91(sp)
1553 ; RV32I-NEXT: sb zero, 90(sp)
1554 ; RV32I-NEXT: sb zero, 89(sp)
1555 ; RV32I-NEXT: sb zero, 88(sp)
1556 ; RV32I-NEXT: sb zero, 87(sp)
1557 ; RV32I-NEXT: sb zero, 86(sp)
1558 ; RV32I-NEXT: sb zero, 85(sp)
1559 ; RV32I-NEXT: sb zero, 84(sp)
1560 ; RV32I-NEXT: sb zero, 83(sp)
1561 ; RV32I-NEXT: sb zero, 82(sp)
1562 ; RV32I-NEXT: sb zero, 81(sp)
1563 ; RV32I-NEXT: sb zero, 80(sp)
1564 ; RV32I-NEXT: sb zero, 79(sp)
1565 ; RV32I-NEXT: sb zero, 78(sp)
1566 ; RV32I-NEXT: sb zero, 77(sp)
1567 ; RV32I-NEXT: sb zero, 76(sp)
1568 ; RV32I-NEXT: sb zero, 75(sp)
1569 ; RV32I-NEXT: sb zero, 74(sp)
1570 ; RV32I-NEXT: sb zero, 73(sp)
1571 ; RV32I-NEXT: sb zero, 72(sp)
1572 ; RV32I-NEXT: sb zero, 71(sp)
1573 ; RV32I-NEXT: sb zero, 70(sp)
1574 ; RV32I-NEXT: sb zero, 69(sp)
1575 ; RV32I-NEXT: sb zero, 68(sp)
1576 ; RV32I-NEXT: sb zero, 67(sp)
1577 ; RV32I-NEXT: sb zero, 66(sp)
1578 ; RV32I-NEXT: sb zero, 65(sp)
1579 ; RV32I-NEXT: sb zero, 64(sp)
1580 ; RV32I-NEXT: sb zero, 63(sp)
1581 ; RV32I-NEXT: sb zero, 62(sp)
1582 ; RV32I-NEXT: sb zero, 61(sp)
1583 ; RV32I-NEXT: sb zero, 60(sp)
1584 ; RV32I-NEXT: sb t0, 53(sp)
1585 ; RV32I-NEXT: sb ra, 52(sp)
1586 ; RV32I-NEXT: sb s11, 51(sp)
1587 ; RV32I-NEXT: sb s10, 50(sp)
1588 ; RV32I-NEXT: sb s9, 49(sp)
1589 ; RV32I-NEXT: sb s8, 48(sp)
1590 ; RV32I-NEXT: sb s7, 47(sp)
1591 ; RV32I-NEXT: sb s6, 46(sp)
1592 ; RV32I-NEXT: sb s5, 45(sp)
1593 ; RV32I-NEXT: sb s4, 44(sp)
1594 ; RV32I-NEXT: sb s3, 43(sp)
1595 ; RV32I-NEXT: sb s2, 42(sp)
1596 ; RV32I-NEXT: sb s1, 41(sp)
1597 ; RV32I-NEXT: sb s0, 40(sp)
1598 ; RV32I-NEXT: sb t6, 39(sp)
1599 ; RV32I-NEXT: sb t5, 38(sp)
1600 ; RV32I-NEXT: sb t4, 37(sp)
1601 ; RV32I-NEXT: sb t3, 36(sp)
1602 ; RV32I-NEXT: sb t2, 35(sp)
1603 ; RV32I-NEXT: sb t1, 34(sp)
1604 ; RV32I-NEXT: lw a0, 4(sp) # 4-byte Folded Reload
1605 ; RV32I-NEXT: sb a0, 33(sp)
1606 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
1607 ; RV32I-NEXT: sb a0, 32(sp)
1608 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
1609 ; RV32I-NEXT: sb a0, 31(sp)
1610 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
1611 ; RV32I-NEXT: sb a0, 30(sp)
1612 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
1613 ; RV32I-NEXT: sb a0, 29(sp)
1614 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
1615 ; RV32I-NEXT: sb a0, 28(sp)
1616 ; RV32I-NEXT: andi a1, a1, 31
1617 ; RV32I-NEXT: addi a0, sp, 28
1618 ; RV32I-NEXT: add a6, a0, a1
1619 ; RV32I-NEXT: lbu a0, 6(a6)
1620 ; RV32I-NEXT: sw a0, 24(sp) # 4-byte Folded Spill
1621 ; RV32I-NEXT: lbu a0, 7(a6)
1622 ; RV32I-NEXT: sw a0, 20(sp) # 4-byte Folded Spill
1623 ; RV32I-NEXT: lbu a0, 4(a6)
1624 ; RV32I-NEXT: sw a0, 16(sp) # 4-byte Folded Spill
1625 ; RV32I-NEXT: lbu a0, 5(a6)
1626 ; RV32I-NEXT: sw a0, 12(sp) # 4-byte Folded Spill
1627 ; RV32I-NEXT: lbu a0, 0(a6)
1628 ; RV32I-NEXT: sw a0, 8(sp) # 4-byte Folded Spill
1629 ; RV32I-NEXT: lbu a7, 1(a6)
1630 ; RV32I-NEXT: lbu t0, 2(a6)
1631 ; RV32I-NEXT: lbu t1, 3(a6)
1632 ; RV32I-NEXT: lbu t2, 14(a6)
1633 ; RV32I-NEXT: lbu t3, 15(a6)
1634 ; RV32I-NEXT: lbu t4, 12(a6)
1635 ; RV32I-NEXT: lbu t5, 13(a6)
1636 ; RV32I-NEXT: lbu t6, 10(a6)
1637 ; RV32I-NEXT: lbu s0, 11(a6)
1638 ; RV32I-NEXT: lbu s1, 8(a6)
1639 ; RV32I-NEXT: lbu s2, 9(a6)
1640 ; RV32I-NEXT: lbu s3, 22(a6)
1641 ; RV32I-NEXT: lbu s4, 23(a6)
1642 ; RV32I-NEXT: lbu s5, 20(a6)
1643 ; RV32I-NEXT: lbu s6, 21(a6)
1644 ; RV32I-NEXT: lbu s7, 18(a6)
1645 ; RV32I-NEXT: lbu s8, 19(a6)
1646 ; RV32I-NEXT: lbu s9, 16(a6)
1647 ; RV32I-NEXT: lbu s10, 17(a6)
1648 ; RV32I-NEXT: lbu s11, 30(a6)
1649 ; RV32I-NEXT: lbu ra, 31(a6)
1650 ; RV32I-NEXT: lbu a5, 28(a6)
1651 ; RV32I-NEXT: lbu a4, 29(a6)
1652 ; RV32I-NEXT: lbu a0, 25(a6)
1653 ; RV32I-NEXT: lbu a1, 24(a6)
1654 ; RV32I-NEXT: lbu a3, 27(a6)
1655 ; RV32I-NEXT: lbu a6, 26(a6)
1656 ; RV32I-NEXT: sb a0, 25(a2)
1657 ; RV32I-NEXT: sb a1, 24(a2)
1658 ; RV32I-NEXT: sb a3, 27(a2)
1659 ; RV32I-NEXT: sb a6, 26(a2)
1660 ; RV32I-NEXT: sb a4, 29(a2)
1661 ; RV32I-NEXT: sb a5, 28(a2)
1662 ; RV32I-NEXT: sb ra, 31(a2)
1663 ; RV32I-NEXT: sb s11, 30(a2)
1664 ; RV32I-NEXT: sb s10, 17(a2)
1665 ; RV32I-NEXT: sb s9, 16(a2)
1666 ; RV32I-NEXT: sb s8, 19(a2)
1667 ; RV32I-NEXT: sb s7, 18(a2)
1668 ; RV32I-NEXT: sb s6, 21(a2)
1669 ; RV32I-NEXT: sb s5, 20(a2)
1670 ; RV32I-NEXT: sb s4, 23(a2)
1671 ; RV32I-NEXT: sb s3, 22(a2)
1672 ; RV32I-NEXT: sb s2, 9(a2)
1673 ; RV32I-NEXT: sb s1, 8(a2)
1674 ; RV32I-NEXT: sb s0, 11(a2)
1675 ; RV32I-NEXT: sb t6, 10(a2)
1676 ; RV32I-NEXT: sb t5, 13(a2)
1677 ; RV32I-NEXT: sb t4, 12(a2)
1678 ; RV32I-NEXT: sb t3, 15(a2)
1679 ; RV32I-NEXT: sb t2, 14(a2)
1680 ; RV32I-NEXT: sb t1, 3(a2)
1681 ; RV32I-NEXT: sb t0, 2(a2)
1682 ; RV32I-NEXT: sb a7, 1(a2)
1683 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
1684 ; RV32I-NEXT: sb a0, 0(a2)
1685 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
1686 ; RV32I-NEXT: sb a0, 5(a2)
1687 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
1688 ; RV32I-NEXT: sb a0, 4(a2)
1689 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
1690 ; RV32I-NEXT: sb a0, 7(a2)
1691 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
1692 ; RV32I-NEXT: sb a0, 6(a2)
1693 ; RV32I-NEXT: lw ra, 140(sp) # 4-byte Folded Reload
1694 ; RV32I-NEXT: lw s0, 136(sp) # 4-byte Folded Reload
1695 ; RV32I-NEXT: lw s1, 132(sp) # 4-byte Folded Reload
1696 ; RV32I-NEXT: lw s2, 128(sp) # 4-byte Folded Reload
1697 ; RV32I-NEXT: lw s3, 124(sp) # 4-byte Folded Reload
1698 ; RV32I-NEXT: lw s4, 120(sp) # 4-byte Folded Reload
1699 ; RV32I-NEXT: lw s5, 116(sp) # 4-byte Folded Reload
1700 ; RV32I-NEXT: lw s6, 112(sp) # 4-byte Folded Reload
1701 ; RV32I-NEXT: lw s7, 108(sp) # 4-byte Folded Reload
1702 ; RV32I-NEXT: lw s8, 104(sp) # 4-byte Folded Reload
1703 ; RV32I-NEXT: lw s9, 100(sp) # 4-byte Folded Reload
1704 ; RV32I-NEXT: lw s10, 96(sp) # 4-byte Folded Reload
1705 ; RV32I-NEXT: lw s11, 92(sp) # 4-byte Folded Reload
1706 ; RV32I-NEXT: addi sp, sp, 144
1708 %src = load i256, ptr %src.ptr, align 1
1709 %byteOff = load i256, ptr %byteOff.ptr, align 1
1710 %bitOff = shl i256 %byteOff, 3
1711 %res = lshr i256 %src, %bitOff
1712 store i256 %res, ptr %dst, align 1
1715 define void @shl_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
1716 ; RV64I-LABEL: shl_32bytes:
1718 ; RV64I-NEXT: addi sp, sp, -224
1719 ; RV64I-NEXT: sd ra, 216(sp) # 8-byte Folded Spill
1720 ; RV64I-NEXT: sd s0, 208(sp) # 8-byte Folded Spill
1721 ; RV64I-NEXT: sd s1, 200(sp) # 8-byte Folded Spill
1722 ; RV64I-NEXT: sd s2, 192(sp) # 8-byte Folded Spill
1723 ; RV64I-NEXT: sd s3, 184(sp) # 8-byte Folded Spill
1724 ; RV64I-NEXT: sd s4, 176(sp) # 8-byte Folded Spill
1725 ; RV64I-NEXT: sd s5, 168(sp) # 8-byte Folded Spill
1726 ; RV64I-NEXT: sd s6, 160(sp) # 8-byte Folded Spill
1727 ; RV64I-NEXT: sd s7, 152(sp) # 8-byte Folded Spill
1728 ; RV64I-NEXT: sd s8, 144(sp) # 8-byte Folded Spill
1729 ; RV64I-NEXT: sd s9, 136(sp) # 8-byte Folded Spill
1730 ; RV64I-NEXT: sd s10, 128(sp) # 8-byte Folded Spill
1731 ; RV64I-NEXT: sd s11, 120(sp) # 8-byte Folded Spill
1732 ; RV64I-NEXT: lbu a3, 0(a0)
1733 ; RV64I-NEXT: sd a3, 48(sp) # 8-byte Folded Spill
1734 ; RV64I-NEXT: lbu a3, 1(a0)
1735 ; RV64I-NEXT: sd a3, 40(sp) # 8-byte Folded Spill
1736 ; RV64I-NEXT: lbu a3, 2(a0)
1737 ; RV64I-NEXT: sd a3, 32(sp) # 8-byte Folded Spill
1738 ; RV64I-NEXT: lbu a3, 3(a0)
1739 ; RV64I-NEXT: sd a3, 24(sp) # 8-byte Folded Spill
1740 ; RV64I-NEXT: lbu a3, 4(a0)
1741 ; RV64I-NEXT: sd a3, 16(sp) # 8-byte Folded Spill
1742 ; RV64I-NEXT: lbu a3, 5(a0)
1743 ; RV64I-NEXT: sd a3, 8(sp) # 8-byte Folded Spill
1744 ; RV64I-NEXT: lbu t1, 6(a0)
1745 ; RV64I-NEXT: lbu t2, 7(a0)
1746 ; RV64I-NEXT: lbu t3, 8(a0)
1747 ; RV64I-NEXT: lbu t4, 9(a0)
1748 ; RV64I-NEXT: lbu t5, 10(a0)
1749 ; RV64I-NEXT: lbu t6, 11(a0)
1750 ; RV64I-NEXT: lbu s0, 12(a0)
1751 ; RV64I-NEXT: lbu s1, 13(a0)
1752 ; RV64I-NEXT: lbu s2, 14(a0)
1753 ; RV64I-NEXT: lbu s3, 15(a0)
1754 ; RV64I-NEXT: lbu s4, 16(a0)
1755 ; RV64I-NEXT: lbu s5, 17(a0)
1756 ; RV64I-NEXT: lbu s6, 18(a0)
1757 ; RV64I-NEXT: lbu s7, 19(a0)
1758 ; RV64I-NEXT: lbu s8, 20(a0)
1759 ; RV64I-NEXT: lbu s9, 21(a0)
1760 ; RV64I-NEXT: lbu s10, 22(a0)
1761 ; RV64I-NEXT: lbu s11, 23(a0)
1762 ; RV64I-NEXT: lbu ra, 24(a0)
1763 ; RV64I-NEXT: lbu t0, 25(a0)
1764 ; RV64I-NEXT: lbu a7, 26(a0)
1765 ; RV64I-NEXT: lbu a6, 27(a0)
1766 ; RV64I-NEXT: lbu a5, 28(a0)
1767 ; RV64I-NEXT: lbu a3, 31(a0)
1768 ; RV64I-NEXT: lbu a4, 30(a0)
1769 ; RV64I-NEXT: lbu a0, 29(a0)
1770 ; RV64I-NEXT: lbu a1, 0(a1)
1771 ; RV64I-NEXT: sb a3, 119(sp)
1772 ; RV64I-NEXT: sb a4, 118(sp)
1773 ; RV64I-NEXT: sb a0, 117(sp)
1774 ; RV64I-NEXT: sb a5, 116(sp)
1775 ; RV64I-NEXT: sb a6, 115(sp)
1776 ; RV64I-NEXT: sb a7, 114(sp)
1777 ; RV64I-NEXT: sb zero, 87(sp)
1778 ; RV64I-NEXT: sb zero, 86(sp)
1779 ; RV64I-NEXT: sb zero, 85(sp)
1780 ; RV64I-NEXT: sb zero, 84(sp)
1781 ; RV64I-NEXT: sb zero, 83(sp)
1782 ; RV64I-NEXT: sb zero, 82(sp)
1783 ; RV64I-NEXT: sb zero, 81(sp)
1784 ; RV64I-NEXT: sb zero, 80(sp)
1785 ; RV64I-NEXT: sb zero, 79(sp)
1786 ; RV64I-NEXT: sb zero, 78(sp)
1787 ; RV64I-NEXT: sb zero, 77(sp)
1788 ; RV64I-NEXT: sb zero, 76(sp)
1789 ; RV64I-NEXT: sb zero, 75(sp)
1790 ; RV64I-NEXT: sb zero, 74(sp)
1791 ; RV64I-NEXT: sb zero, 73(sp)
1792 ; RV64I-NEXT: sb zero, 72(sp)
1793 ; RV64I-NEXT: sb zero, 71(sp)
1794 ; RV64I-NEXT: sb zero, 70(sp)
1795 ; RV64I-NEXT: sb zero, 69(sp)
1796 ; RV64I-NEXT: sb zero, 68(sp)
1797 ; RV64I-NEXT: sb zero, 67(sp)
1798 ; RV64I-NEXT: sb zero, 66(sp)
1799 ; RV64I-NEXT: sb zero, 65(sp)
1800 ; RV64I-NEXT: sb zero, 64(sp)
1801 ; RV64I-NEXT: sb zero, 63(sp)
1802 ; RV64I-NEXT: sb zero, 62(sp)
1803 ; RV64I-NEXT: sb zero, 61(sp)
1804 ; RV64I-NEXT: sb zero, 60(sp)
1805 ; RV64I-NEXT: sb zero, 59(sp)
1806 ; RV64I-NEXT: sb zero, 58(sp)
1807 ; RV64I-NEXT: sb zero, 57(sp)
1808 ; RV64I-NEXT: sb zero, 56(sp)
1809 ; RV64I-NEXT: sb t0, 113(sp)
1810 ; RV64I-NEXT: sb ra, 112(sp)
1811 ; RV64I-NEXT: sb s11, 111(sp)
1812 ; RV64I-NEXT: sb s10, 110(sp)
1813 ; RV64I-NEXT: sb s9, 109(sp)
1814 ; RV64I-NEXT: sb s8, 108(sp)
1815 ; RV64I-NEXT: sb s7, 107(sp)
1816 ; RV64I-NEXT: sb s6, 106(sp)
1817 ; RV64I-NEXT: sb s5, 105(sp)
1818 ; RV64I-NEXT: sb s4, 104(sp)
1819 ; RV64I-NEXT: sb s3, 103(sp)
1820 ; RV64I-NEXT: sb s2, 102(sp)
1821 ; RV64I-NEXT: sb s1, 101(sp)
1822 ; RV64I-NEXT: sb s0, 100(sp)
1823 ; RV64I-NEXT: sb t6, 99(sp)
1824 ; RV64I-NEXT: sb t5, 98(sp)
1825 ; RV64I-NEXT: sb t4, 97(sp)
1826 ; RV64I-NEXT: sb t3, 96(sp)
1827 ; RV64I-NEXT: sb t2, 95(sp)
1828 ; RV64I-NEXT: sb t1, 94(sp)
1829 ; RV64I-NEXT: ld a0, 8(sp) # 8-byte Folded Reload
1830 ; RV64I-NEXT: sb a0, 93(sp)
1831 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
1832 ; RV64I-NEXT: sb a0, 92(sp)
1833 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
1834 ; RV64I-NEXT: sb a0, 91(sp)
1835 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
1836 ; RV64I-NEXT: sb a0, 90(sp)
1837 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
1838 ; RV64I-NEXT: sb a0, 89(sp)
1839 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
1840 ; RV64I-NEXT: sb a0, 88(sp)
1841 ; RV64I-NEXT: andi a1, a1, 31
1842 ; RV64I-NEXT: addi a0, sp, 88
1843 ; RV64I-NEXT: sub a6, a0, a1
1844 ; RV64I-NEXT: lbu a0, 8(a6)
1845 ; RV64I-NEXT: sd a0, 48(sp) # 8-byte Folded Spill
1846 ; RV64I-NEXT: lbu a0, 9(a6)
1847 ; RV64I-NEXT: sd a0, 40(sp) # 8-byte Folded Spill
1848 ; RV64I-NEXT: lbu a0, 10(a6)
1849 ; RV64I-NEXT: sd a0, 32(sp) # 8-byte Folded Spill
1850 ; RV64I-NEXT: lbu a0, 11(a6)
1851 ; RV64I-NEXT: sd a0, 24(sp) # 8-byte Folded Spill
1852 ; RV64I-NEXT: lbu a0, 12(a6)
1853 ; RV64I-NEXT: sd a0, 16(sp) # 8-byte Folded Spill
1854 ; RV64I-NEXT: lbu a7, 13(a6)
1855 ; RV64I-NEXT: lbu t0, 14(a6)
1856 ; RV64I-NEXT: lbu t1, 15(a6)
1857 ; RV64I-NEXT: lbu t2, 0(a6)
1858 ; RV64I-NEXT: lbu t3, 1(a6)
1859 ; RV64I-NEXT: lbu t4, 2(a6)
1860 ; RV64I-NEXT: lbu t5, 3(a6)
1861 ; RV64I-NEXT: lbu t6, 4(a6)
1862 ; RV64I-NEXT: lbu s0, 5(a6)
1863 ; RV64I-NEXT: lbu s1, 6(a6)
1864 ; RV64I-NEXT: lbu s2, 7(a6)
1865 ; RV64I-NEXT: lbu s3, 24(a6)
1866 ; RV64I-NEXT: lbu s4, 25(a6)
1867 ; RV64I-NEXT: lbu s5, 26(a6)
1868 ; RV64I-NEXT: lbu s6, 27(a6)
1869 ; RV64I-NEXT: lbu s7, 28(a6)
1870 ; RV64I-NEXT: lbu s8, 29(a6)
1871 ; RV64I-NEXT: lbu s9, 30(a6)
1872 ; RV64I-NEXT: lbu s10, 31(a6)
1873 ; RV64I-NEXT: lbu s11, 16(a6)
1874 ; RV64I-NEXT: lbu ra, 17(a6)
1875 ; RV64I-NEXT: lbu a5, 18(a6)
1876 ; RV64I-NEXT: lbu a4, 19(a6)
1877 ; RV64I-NEXT: lbu a0, 23(a6)
1878 ; RV64I-NEXT: lbu a1, 22(a6)
1879 ; RV64I-NEXT: lbu a3, 21(a6)
1880 ; RV64I-NEXT: lbu a6, 20(a6)
1881 ; RV64I-NEXT: sb a0, 23(a2)
1882 ; RV64I-NEXT: sb a1, 22(a2)
1883 ; RV64I-NEXT: sb a3, 21(a2)
1884 ; RV64I-NEXT: sb a6, 20(a2)
1885 ; RV64I-NEXT: sb a4, 19(a2)
1886 ; RV64I-NEXT: sb a5, 18(a2)
1887 ; RV64I-NEXT: sb ra, 17(a2)
1888 ; RV64I-NEXT: sb s11, 16(a2)
1889 ; RV64I-NEXT: sb s10, 31(a2)
1890 ; RV64I-NEXT: sb s9, 30(a2)
1891 ; RV64I-NEXT: sb s8, 29(a2)
1892 ; RV64I-NEXT: sb s7, 28(a2)
1893 ; RV64I-NEXT: sb s6, 27(a2)
1894 ; RV64I-NEXT: sb s5, 26(a2)
1895 ; RV64I-NEXT: sb s4, 25(a2)
1896 ; RV64I-NEXT: sb s3, 24(a2)
1897 ; RV64I-NEXT: sb s2, 7(a2)
1898 ; RV64I-NEXT: sb s1, 6(a2)
1899 ; RV64I-NEXT: sb s0, 5(a2)
1900 ; RV64I-NEXT: sb t6, 4(a2)
1901 ; RV64I-NEXT: sb t5, 3(a2)
1902 ; RV64I-NEXT: sb t4, 2(a2)
1903 ; RV64I-NEXT: sb t3, 1(a2)
1904 ; RV64I-NEXT: sb t2, 0(a2)
1905 ; RV64I-NEXT: sb t1, 15(a2)
1906 ; RV64I-NEXT: sb t0, 14(a2)
1907 ; RV64I-NEXT: sb a7, 13(a2)
1908 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
1909 ; RV64I-NEXT: sb a0, 12(a2)
1910 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
1911 ; RV64I-NEXT: sb a0, 11(a2)
1912 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
1913 ; RV64I-NEXT: sb a0, 10(a2)
1914 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
1915 ; RV64I-NEXT: sb a0, 9(a2)
1916 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
1917 ; RV64I-NEXT: sb a0, 8(a2)
1918 ; RV64I-NEXT: ld ra, 216(sp) # 8-byte Folded Reload
1919 ; RV64I-NEXT: ld s0, 208(sp) # 8-byte Folded Reload
1920 ; RV64I-NEXT: ld s1, 200(sp) # 8-byte Folded Reload
1921 ; RV64I-NEXT: ld s2, 192(sp) # 8-byte Folded Reload
1922 ; RV64I-NEXT: ld s3, 184(sp) # 8-byte Folded Reload
1923 ; RV64I-NEXT: ld s4, 176(sp) # 8-byte Folded Reload
1924 ; RV64I-NEXT: ld s5, 168(sp) # 8-byte Folded Reload
1925 ; RV64I-NEXT: ld s6, 160(sp) # 8-byte Folded Reload
1926 ; RV64I-NEXT: ld s7, 152(sp) # 8-byte Folded Reload
1927 ; RV64I-NEXT: ld s8, 144(sp) # 8-byte Folded Reload
1928 ; RV64I-NEXT: ld s9, 136(sp) # 8-byte Folded Reload
1929 ; RV64I-NEXT: ld s10, 128(sp) # 8-byte Folded Reload
1930 ; RV64I-NEXT: ld s11, 120(sp) # 8-byte Folded Reload
1931 ; RV64I-NEXT: addi sp, sp, 224
1934 ; RV32I-LABEL: shl_32bytes:
1936 ; RV32I-NEXT: addi sp, sp, -144
1937 ; RV32I-NEXT: sw ra, 140(sp) # 4-byte Folded Spill
1938 ; RV32I-NEXT: sw s0, 136(sp) # 4-byte Folded Spill
1939 ; RV32I-NEXT: sw s1, 132(sp) # 4-byte Folded Spill
1940 ; RV32I-NEXT: sw s2, 128(sp) # 4-byte Folded Spill
1941 ; RV32I-NEXT: sw s3, 124(sp) # 4-byte Folded Spill
1942 ; RV32I-NEXT: sw s4, 120(sp) # 4-byte Folded Spill
1943 ; RV32I-NEXT: sw s5, 116(sp) # 4-byte Folded Spill
1944 ; RV32I-NEXT: sw s6, 112(sp) # 4-byte Folded Spill
1945 ; RV32I-NEXT: sw s7, 108(sp) # 4-byte Folded Spill
1946 ; RV32I-NEXT: sw s8, 104(sp) # 4-byte Folded Spill
1947 ; RV32I-NEXT: sw s9, 100(sp) # 4-byte Folded Spill
1948 ; RV32I-NEXT: sw s10, 96(sp) # 4-byte Folded Spill
1949 ; RV32I-NEXT: sw s11, 92(sp) # 4-byte Folded Spill
1950 ; RV32I-NEXT: lbu a3, 0(a0)
1951 ; RV32I-NEXT: sw a3, 24(sp) # 4-byte Folded Spill
1952 ; RV32I-NEXT: lbu a3, 1(a0)
1953 ; RV32I-NEXT: sw a3, 20(sp) # 4-byte Folded Spill
1954 ; RV32I-NEXT: lbu a3, 2(a0)
1955 ; RV32I-NEXT: sw a3, 16(sp) # 4-byte Folded Spill
1956 ; RV32I-NEXT: lbu a3, 3(a0)
1957 ; RV32I-NEXT: sw a3, 12(sp) # 4-byte Folded Spill
1958 ; RV32I-NEXT: lbu a3, 4(a0)
1959 ; RV32I-NEXT: sw a3, 8(sp) # 4-byte Folded Spill
1960 ; RV32I-NEXT: lbu a3, 5(a0)
1961 ; RV32I-NEXT: sw a3, 4(sp) # 4-byte Folded Spill
1962 ; RV32I-NEXT: lbu t1, 6(a0)
1963 ; RV32I-NEXT: lbu t2, 7(a0)
1964 ; RV32I-NEXT: lbu t3, 8(a0)
1965 ; RV32I-NEXT: lbu t4, 9(a0)
1966 ; RV32I-NEXT: lbu t5, 10(a0)
1967 ; RV32I-NEXT: lbu t6, 11(a0)
1968 ; RV32I-NEXT: lbu s0, 12(a0)
1969 ; RV32I-NEXT: lbu s1, 13(a0)
1970 ; RV32I-NEXT: lbu s2, 14(a0)
1971 ; RV32I-NEXT: lbu s3, 15(a0)
1972 ; RV32I-NEXT: lbu s4, 16(a0)
1973 ; RV32I-NEXT: lbu s5, 17(a0)
1974 ; RV32I-NEXT: lbu s6, 18(a0)
1975 ; RV32I-NEXT: lbu s7, 19(a0)
1976 ; RV32I-NEXT: lbu s8, 20(a0)
1977 ; RV32I-NEXT: lbu s9, 21(a0)
1978 ; RV32I-NEXT: lbu s10, 22(a0)
1979 ; RV32I-NEXT: lbu s11, 23(a0)
1980 ; RV32I-NEXT: lbu ra, 24(a0)
1981 ; RV32I-NEXT: lbu t0, 25(a0)
1982 ; RV32I-NEXT: lbu a7, 26(a0)
1983 ; RV32I-NEXT: lbu a6, 27(a0)
1984 ; RV32I-NEXT: lbu a5, 28(a0)
1985 ; RV32I-NEXT: lbu a3, 31(a0)
1986 ; RV32I-NEXT: lbu a4, 30(a0)
1987 ; RV32I-NEXT: lbu a0, 29(a0)
1988 ; RV32I-NEXT: lbu a1, 0(a1)
1989 ; RV32I-NEXT: sb a3, 91(sp)
1990 ; RV32I-NEXT: sb a4, 90(sp)
1991 ; RV32I-NEXT: sb a0, 89(sp)
1992 ; RV32I-NEXT: sb a5, 88(sp)
1993 ; RV32I-NEXT: sb a6, 87(sp)
1994 ; RV32I-NEXT: sb a7, 86(sp)
1995 ; RV32I-NEXT: sb zero, 59(sp)
1996 ; RV32I-NEXT: sb zero, 58(sp)
1997 ; RV32I-NEXT: sb zero, 57(sp)
1998 ; RV32I-NEXT: sb zero, 56(sp)
1999 ; RV32I-NEXT: sb zero, 55(sp)
2000 ; RV32I-NEXT: sb zero, 54(sp)
2001 ; RV32I-NEXT: sb zero, 53(sp)
2002 ; RV32I-NEXT: sb zero, 52(sp)
2003 ; RV32I-NEXT: sb zero, 51(sp)
2004 ; RV32I-NEXT: sb zero, 50(sp)
2005 ; RV32I-NEXT: sb zero, 49(sp)
2006 ; RV32I-NEXT: sb zero, 48(sp)
2007 ; RV32I-NEXT: sb zero, 47(sp)
2008 ; RV32I-NEXT: sb zero, 46(sp)
2009 ; RV32I-NEXT: sb zero, 45(sp)
2010 ; RV32I-NEXT: sb zero, 44(sp)
2011 ; RV32I-NEXT: sb zero, 43(sp)
2012 ; RV32I-NEXT: sb zero, 42(sp)
2013 ; RV32I-NEXT: sb zero, 41(sp)
2014 ; RV32I-NEXT: sb zero, 40(sp)
2015 ; RV32I-NEXT: sb zero, 39(sp)
2016 ; RV32I-NEXT: sb zero, 38(sp)
2017 ; RV32I-NEXT: sb zero, 37(sp)
2018 ; RV32I-NEXT: sb zero, 36(sp)
2019 ; RV32I-NEXT: sb zero, 35(sp)
2020 ; RV32I-NEXT: sb zero, 34(sp)
2021 ; RV32I-NEXT: sb zero, 33(sp)
2022 ; RV32I-NEXT: sb zero, 32(sp)
2023 ; RV32I-NEXT: sb zero, 31(sp)
2024 ; RV32I-NEXT: sb zero, 30(sp)
2025 ; RV32I-NEXT: sb zero, 29(sp)
2026 ; RV32I-NEXT: sb zero, 28(sp)
2027 ; RV32I-NEXT: sb t0, 85(sp)
2028 ; RV32I-NEXT: sb ra, 84(sp)
2029 ; RV32I-NEXT: sb s11, 83(sp)
2030 ; RV32I-NEXT: sb s10, 82(sp)
2031 ; RV32I-NEXT: sb s9, 81(sp)
2032 ; RV32I-NEXT: sb s8, 80(sp)
2033 ; RV32I-NEXT: sb s7, 79(sp)
2034 ; RV32I-NEXT: sb s6, 78(sp)
2035 ; RV32I-NEXT: sb s5, 77(sp)
2036 ; RV32I-NEXT: sb s4, 76(sp)
2037 ; RV32I-NEXT: sb s3, 75(sp)
2038 ; RV32I-NEXT: sb s2, 74(sp)
2039 ; RV32I-NEXT: sb s1, 73(sp)
2040 ; RV32I-NEXT: sb s0, 72(sp)
2041 ; RV32I-NEXT: sb t6, 71(sp)
2042 ; RV32I-NEXT: sb t5, 70(sp)
2043 ; RV32I-NEXT: sb t4, 69(sp)
2044 ; RV32I-NEXT: sb t3, 68(sp)
2045 ; RV32I-NEXT: sb t2, 67(sp)
2046 ; RV32I-NEXT: sb t1, 66(sp)
2047 ; RV32I-NEXT: lw a0, 4(sp) # 4-byte Folded Reload
2048 ; RV32I-NEXT: sb a0, 65(sp)
2049 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
2050 ; RV32I-NEXT: sb a0, 64(sp)
2051 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
2052 ; RV32I-NEXT: sb a0, 63(sp)
2053 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
2054 ; RV32I-NEXT: sb a0, 62(sp)
2055 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
2056 ; RV32I-NEXT: sb a0, 61(sp)
2057 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
2058 ; RV32I-NEXT: sb a0, 60(sp)
2059 ; RV32I-NEXT: andi a1, a1, 31
2060 ; RV32I-NEXT: addi a0, sp, 60
2061 ; RV32I-NEXT: sub a6, a0, a1
2062 ; RV32I-NEXT: lbu a0, 6(a6)
2063 ; RV32I-NEXT: sw a0, 24(sp) # 4-byte Folded Spill
2064 ; RV32I-NEXT: lbu a0, 7(a6)
2065 ; RV32I-NEXT: sw a0, 20(sp) # 4-byte Folded Spill
2066 ; RV32I-NEXT: lbu a0, 4(a6)
2067 ; RV32I-NEXT: sw a0, 16(sp) # 4-byte Folded Spill
2068 ; RV32I-NEXT: lbu a0, 5(a6)
2069 ; RV32I-NEXT: sw a0, 12(sp) # 4-byte Folded Spill
2070 ; RV32I-NEXT: lbu a0, 0(a6)
2071 ; RV32I-NEXT: sw a0, 8(sp) # 4-byte Folded Spill
2072 ; RV32I-NEXT: lbu a7, 1(a6)
2073 ; RV32I-NEXT: lbu t0, 2(a6)
2074 ; RV32I-NEXT: lbu t1, 3(a6)
2075 ; RV32I-NEXT: lbu t2, 14(a6)
2076 ; RV32I-NEXT: lbu t3, 15(a6)
2077 ; RV32I-NEXT: lbu t4, 12(a6)
2078 ; RV32I-NEXT: lbu t5, 13(a6)
2079 ; RV32I-NEXT: lbu t6, 10(a6)
2080 ; RV32I-NEXT: lbu s0, 11(a6)
2081 ; RV32I-NEXT: lbu s1, 8(a6)
2082 ; RV32I-NEXT: lbu s2, 9(a6)
2083 ; RV32I-NEXT: lbu s3, 22(a6)
2084 ; RV32I-NEXT: lbu s4, 23(a6)
2085 ; RV32I-NEXT: lbu s5, 20(a6)
2086 ; RV32I-NEXT: lbu s6, 21(a6)
2087 ; RV32I-NEXT: lbu s7, 18(a6)
2088 ; RV32I-NEXT: lbu s8, 19(a6)
2089 ; RV32I-NEXT: lbu s9, 16(a6)
2090 ; RV32I-NEXT: lbu s10, 17(a6)
2091 ; RV32I-NEXT: lbu s11, 30(a6)
2092 ; RV32I-NEXT: lbu ra, 31(a6)
2093 ; RV32I-NEXT: lbu a5, 28(a6)
2094 ; RV32I-NEXT: lbu a4, 29(a6)
2095 ; RV32I-NEXT: lbu a0, 25(a6)
2096 ; RV32I-NEXT: lbu a1, 24(a6)
2097 ; RV32I-NEXT: lbu a3, 27(a6)
2098 ; RV32I-NEXT: lbu a6, 26(a6)
2099 ; RV32I-NEXT: sb a0, 25(a2)
2100 ; RV32I-NEXT: sb a1, 24(a2)
2101 ; RV32I-NEXT: sb a3, 27(a2)
2102 ; RV32I-NEXT: sb a6, 26(a2)
2103 ; RV32I-NEXT: sb a4, 29(a2)
2104 ; RV32I-NEXT: sb a5, 28(a2)
2105 ; RV32I-NEXT: sb ra, 31(a2)
2106 ; RV32I-NEXT: sb s11, 30(a2)
2107 ; RV32I-NEXT: sb s10, 17(a2)
2108 ; RV32I-NEXT: sb s9, 16(a2)
2109 ; RV32I-NEXT: sb s8, 19(a2)
2110 ; RV32I-NEXT: sb s7, 18(a2)
2111 ; RV32I-NEXT: sb s6, 21(a2)
2112 ; RV32I-NEXT: sb s5, 20(a2)
2113 ; RV32I-NEXT: sb s4, 23(a2)
2114 ; RV32I-NEXT: sb s3, 22(a2)
2115 ; RV32I-NEXT: sb s2, 9(a2)
2116 ; RV32I-NEXT: sb s1, 8(a2)
2117 ; RV32I-NEXT: sb s0, 11(a2)
2118 ; RV32I-NEXT: sb t6, 10(a2)
2119 ; RV32I-NEXT: sb t5, 13(a2)
2120 ; RV32I-NEXT: sb t4, 12(a2)
2121 ; RV32I-NEXT: sb t3, 15(a2)
2122 ; RV32I-NEXT: sb t2, 14(a2)
2123 ; RV32I-NEXT: sb t1, 3(a2)
2124 ; RV32I-NEXT: sb t0, 2(a2)
2125 ; RV32I-NEXT: sb a7, 1(a2)
2126 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
2127 ; RV32I-NEXT: sb a0, 0(a2)
2128 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
2129 ; RV32I-NEXT: sb a0, 5(a2)
2130 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
2131 ; RV32I-NEXT: sb a0, 4(a2)
2132 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
2133 ; RV32I-NEXT: sb a0, 7(a2)
2134 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
2135 ; RV32I-NEXT: sb a0, 6(a2)
2136 ; RV32I-NEXT: lw ra, 140(sp) # 4-byte Folded Reload
2137 ; RV32I-NEXT: lw s0, 136(sp) # 4-byte Folded Reload
2138 ; RV32I-NEXT: lw s1, 132(sp) # 4-byte Folded Reload
2139 ; RV32I-NEXT: lw s2, 128(sp) # 4-byte Folded Reload
2140 ; RV32I-NEXT: lw s3, 124(sp) # 4-byte Folded Reload
2141 ; RV32I-NEXT: lw s4, 120(sp) # 4-byte Folded Reload
2142 ; RV32I-NEXT: lw s5, 116(sp) # 4-byte Folded Reload
2143 ; RV32I-NEXT: lw s6, 112(sp) # 4-byte Folded Reload
2144 ; RV32I-NEXT: lw s7, 108(sp) # 4-byte Folded Reload
2145 ; RV32I-NEXT: lw s8, 104(sp) # 4-byte Folded Reload
2146 ; RV32I-NEXT: lw s9, 100(sp) # 4-byte Folded Reload
2147 ; RV32I-NEXT: lw s10, 96(sp) # 4-byte Folded Reload
2148 ; RV32I-NEXT: lw s11, 92(sp) # 4-byte Folded Reload
2149 ; RV32I-NEXT: addi sp, sp, 144
2151 %src = load i256, ptr %src.ptr, align 1
2152 %byteOff = load i256, ptr %byteOff.ptr, align 1
2153 %bitOff = shl i256 %byteOff, 3
2154 %res = shl i256 %src, %bitOff
2155 store i256 %res, ptr %dst, align 1
2158 define void @ashr_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
2159 ; RV64I-LABEL: ashr_32bytes:
2161 ; RV64I-NEXT: addi sp, sp, -224
2162 ; RV64I-NEXT: sd ra, 216(sp) # 8-byte Folded Spill
2163 ; RV64I-NEXT: sd s0, 208(sp) # 8-byte Folded Spill
2164 ; RV64I-NEXT: sd s1, 200(sp) # 8-byte Folded Spill
2165 ; RV64I-NEXT: sd s2, 192(sp) # 8-byte Folded Spill
2166 ; RV64I-NEXT: sd s3, 184(sp) # 8-byte Folded Spill
2167 ; RV64I-NEXT: sd s4, 176(sp) # 8-byte Folded Spill
2168 ; RV64I-NEXT: sd s5, 168(sp) # 8-byte Folded Spill
2169 ; RV64I-NEXT: sd s6, 160(sp) # 8-byte Folded Spill
2170 ; RV64I-NEXT: sd s7, 152(sp) # 8-byte Folded Spill
2171 ; RV64I-NEXT: sd s8, 144(sp) # 8-byte Folded Spill
2172 ; RV64I-NEXT: sd s9, 136(sp) # 8-byte Folded Spill
2173 ; RV64I-NEXT: sd s10, 128(sp) # 8-byte Folded Spill
2174 ; RV64I-NEXT: sd s11, 120(sp) # 8-byte Folded Spill
2175 ; RV64I-NEXT: mv t0, a1
2176 ; RV64I-NEXT: lbu t1, 31(a0)
2177 ; RV64I-NEXT: lbu a1, 0(a0)
2178 ; RV64I-NEXT: sd a1, 48(sp) # 8-byte Folded Spill
2179 ; RV64I-NEXT: lbu a1, 1(a0)
2180 ; RV64I-NEXT: sd a1, 40(sp) # 8-byte Folded Spill
2181 ; RV64I-NEXT: lbu a1, 2(a0)
2182 ; RV64I-NEXT: sd a1, 32(sp) # 8-byte Folded Spill
2183 ; RV64I-NEXT: lbu a1, 3(a0)
2184 ; RV64I-NEXT: sd a1, 24(sp) # 8-byte Folded Spill
2185 ; RV64I-NEXT: lbu a1, 4(a0)
2186 ; RV64I-NEXT: sd a1, 16(sp) # 8-byte Folded Spill
2187 ; RV64I-NEXT: lbu a1, 5(a0)
2188 ; RV64I-NEXT: sd a1, 8(sp) # 8-byte Folded Spill
2189 ; RV64I-NEXT: lbu t2, 6(a0)
2190 ; RV64I-NEXT: lbu t3, 7(a0)
2191 ; RV64I-NEXT: lbu t4, 8(a0)
2192 ; RV64I-NEXT: lbu t5, 9(a0)
2193 ; RV64I-NEXT: lbu t6, 10(a0)
2194 ; RV64I-NEXT: lbu s0, 11(a0)
2195 ; RV64I-NEXT: lbu s1, 12(a0)
2196 ; RV64I-NEXT: lbu s2, 13(a0)
2197 ; RV64I-NEXT: lbu s3, 14(a0)
2198 ; RV64I-NEXT: lbu s4, 15(a0)
2199 ; RV64I-NEXT: lbu s5, 16(a0)
2200 ; RV64I-NEXT: lbu s6, 17(a0)
2201 ; RV64I-NEXT: lbu s7, 18(a0)
2202 ; RV64I-NEXT: lbu s8, 19(a0)
2203 ; RV64I-NEXT: lbu s9, 20(a0)
2204 ; RV64I-NEXT: lbu s10, 21(a0)
2205 ; RV64I-NEXT: lbu s11, 22(a0)
2206 ; RV64I-NEXT: lbu ra, 23(a0)
2207 ; RV64I-NEXT: lbu a7, 24(a0)
2208 ; RV64I-NEXT: lbu a6, 25(a0)
2209 ; RV64I-NEXT: lbu a5, 26(a0)
2210 ; RV64I-NEXT: lbu a4, 27(a0)
2211 ; RV64I-NEXT: lbu a1, 30(a0)
2212 ; RV64I-NEXT: lbu a3, 29(a0)
2213 ; RV64I-NEXT: lbu a0, 28(a0)
2214 ; RV64I-NEXT: lbu t0, 0(t0)
2215 ; RV64I-NEXT: sb a1, 86(sp)
2216 ; RV64I-NEXT: sb a3, 85(sp)
2217 ; RV64I-NEXT: sb a0, 84(sp)
2218 ; RV64I-NEXT: sb a4, 83(sp)
2219 ; RV64I-NEXT: sb a5, 82(sp)
2220 ; RV64I-NEXT: sb a6, 81(sp)
2221 ; RV64I-NEXT: sb t1, 87(sp)
2222 ; RV64I-NEXT: slli t1, t1, 56
2223 ; RV64I-NEXT: sb a7, 80(sp)
2224 ; RV64I-NEXT: sb ra, 79(sp)
2225 ; RV64I-NEXT: sb s11, 78(sp)
2226 ; RV64I-NEXT: sb s10, 77(sp)
2227 ; RV64I-NEXT: sb s9, 76(sp)
2228 ; RV64I-NEXT: sb s8, 75(sp)
2229 ; RV64I-NEXT: sb s7, 74(sp)
2230 ; RV64I-NEXT: sb s6, 73(sp)
2231 ; RV64I-NEXT: sb s5, 72(sp)
2232 ; RV64I-NEXT: sb s4, 71(sp)
2233 ; RV64I-NEXT: sb s3, 70(sp)
2234 ; RV64I-NEXT: sb s2, 69(sp)
2235 ; RV64I-NEXT: sb s1, 68(sp)
2236 ; RV64I-NEXT: sb s0, 67(sp)
2237 ; RV64I-NEXT: sb t6, 66(sp)
2238 ; RV64I-NEXT: sb t5, 65(sp)
2239 ; RV64I-NEXT: sb t4, 64(sp)
2240 ; RV64I-NEXT: sb t3, 63(sp)
2241 ; RV64I-NEXT: sb t2, 62(sp)
2242 ; RV64I-NEXT: ld a0, 8(sp) # 8-byte Folded Reload
2243 ; RV64I-NEXT: sb a0, 61(sp)
2244 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
2245 ; RV64I-NEXT: sb a0, 60(sp)
2246 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
2247 ; RV64I-NEXT: sb a0, 59(sp)
2248 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
2249 ; RV64I-NEXT: sb a0, 58(sp)
2250 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
2251 ; RV64I-NEXT: sb a0, 57(sp)
2252 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
2253 ; RV64I-NEXT: sb a0, 56(sp)
2254 ; RV64I-NEXT: srai a0, t1, 63
2255 ; RV64I-NEXT: sb a0, 112(sp)
2256 ; RV64I-NEXT: sb a0, 104(sp)
2257 ; RV64I-NEXT: sb a0, 96(sp)
2258 ; RV64I-NEXT: sb a0, 88(sp)
2259 ; RV64I-NEXT: srli a1, a0, 56
2260 ; RV64I-NEXT: sb a1, 119(sp)
2261 ; RV64I-NEXT: srli a3, a0, 48
2262 ; RV64I-NEXT: sb a3, 118(sp)
2263 ; RV64I-NEXT: srli a4, a0, 40
2264 ; RV64I-NEXT: sb a4, 117(sp)
2265 ; RV64I-NEXT: srli a5, a0, 32
2266 ; RV64I-NEXT: sb a5, 116(sp)
2267 ; RV64I-NEXT: srli a6, a0, 24
2268 ; RV64I-NEXT: sb a6, 115(sp)
2269 ; RV64I-NEXT: srli a7, a0, 16
2270 ; RV64I-NEXT: sb a7, 114(sp)
2271 ; RV64I-NEXT: srli a0, a0, 8
2272 ; RV64I-NEXT: sb a0, 113(sp)
2273 ; RV64I-NEXT: sb a1, 111(sp)
2274 ; RV64I-NEXT: sb a3, 110(sp)
2275 ; RV64I-NEXT: sb a4, 109(sp)
2276 ; RV64I-NEXT: sb a5, 108(sp)
2277 ; RV64I-NEXT: sb a6, 107(sp)
2278 ; RV64I-NEXT: sb a7, 106(sp)
2279 ; RV64I-NEXT: sb a0, 105(sp)
2280 ; RV64I-NEXT: sb a1, 103(sp)
2281 ; RV64I-NEXT: sb a3, 102(sp)
2282 ; RV64I-NEXT: sb a4, 101(sp)
2283 ; RV64I-NEXT: sb a5, 100(sp)
2284 ; RV64I-NEXT: sb a6, 99(sp)
2285 ; RV64I-NEXT: sb a7, 98(sp)
2286 ; RV64I-NEXT: sb a0, 97(sp)
2287 ; RV64I-NEXT: sb a1, 95(sp)
2288 ; RV64I-NEXT: sb a3, 94(sp)
2289 ; RV64I-NEXT: sb a4, 93(sp)
2290 ; RV64I-NEXT: sb a5, 92(sp)
2291 ; RV64I-NEXT: sb a6, 91(sp)
2292 ; RV64I-NEXT: sb a7, 90(sp)
2293 ; RV64I-NEXT: sb a0, 89(sp)
2294 ; RV64I-NEXT: andi a0, t0, 31
2295 ; RV64I-NEXT: addi a1, sp, 56
2296 ; RV64I-NEXT: add a6, a1, a0
2297 ; RV64I-NEXT: lbu a0, 8(a6)
2298 ; RV64I-NEXT: sd a0, 48(sp) # 8-byte Folded Spill
2299 ; RV64I-NEXT: lbu a0, 9(a6)
2300 ; RV64I-NEXT: sd a0, 40(sp) # 8-byte Folded Spill
2301 ; RV64I-NEXT: lbu a0, 10(a6)
2302 ; RV64I-NEXT: sd a0, 32(sp) # 8-byte Folded Spill
2303 ; RV64I-NEXT: lbu a0, 11(a6)
2304 ; RV64I-NEXT: sd a0, 24(sp) # 8-byte Folded Spill
2305 ; RV64I-NEXT: lbu a0, 12(a6)
2306 ; RV64I-NEXT: sd a0, 16(sp) # 8-byte Folded Spill
2307 ; RV64I-NEXT: lbu a7, 13(a6)
2308 ; RV64I-NEXT: lbu t0, 14(a6)
2309 ; RV64I-NEXT: lbu t1, 15(a6)
2310 ; RV64I-NEXT: lbu t2, 0(a6)
2311 ; RV64I-NEXT: lbu t3, 1(a6)
2312 ; RV64I-NEXT: lbu t4, 2(a6)
2313 ; RV64I-NEXT: lbu t5, 3(a6)
2314 ; RV64I-NEXT: lbu t6, 4(a6)
2315 ; RV64I-NEXT: lbu s0, 5(a6)
2316 ; RV64I-NEXT: lbu s1, 6(a6)
2317 ; RV64I-NEXT: lbu s2, 7(a6)
2318 ; RV64I-NEXT: lbu s3, 24(a6)
2319 ; RV64I-NEXT: lbu s4, 25(a6)
2320 ; RV64I-NEXT: lbu s5, 26(a6)
2321 ; RV64I-NEXT: lbu s6, 27(a6)
2322 ; RV64I-NEXT: lbu s7, 28(a6)
2323 ; RV64I-NEXT: lbu s8, 29(a6)
2324 ; RV64I-NEXT: lbu s9, 30(a6)
2325 ; RV64I-NEXT: lbu s10, 31(a6)
2326 ; RV64I-NEXT: lbu s11, 16(a6)
2327 ; RV64I-NEXT: lbu ra, 17(a6)
2328 ; RV64I-NEXT: lbu a5, 18(a6)
2329 ; RV64I-NEXT: lbu a4, 19(a6)
2330 ; RV64I-NEXT: lbu a0, 23(a6)
2331 ; RV64I-NEXT: lbu a1, 22(a6)
2332 ; RV64I-NEXT: lbu a3, 21(a6)
2333 ; RV64I-NEXT: lbu a6, 20(a6)
2334 ; RV64I-NEXT: sb a0, 23(a2)
2335 ; RV64I-NEXT: sb a1, 22(a2)
2336 ; RV64I-NEXT: sb a3, 21(a2)
2337 ; RV64I-NEXT: sb a6, 20(a2)
2338 ; RV64I-NEXT: sb a4, 19(a2)
2339 ; RV64I-NEXT: sb a5, 18(a2)
2340 ; RV64I-NEXT: sb ra, 17(a2)
2341 ; RV64I-NEXT: sb s11, 16(a2)
2342 ; RV64I-NEXT: sb s10, 31(a2)
2343 ; RV64I-NEXT: sb s9, 30(a2)
2344 ; RV64I-NEXT: sb s8, 29(a2)
2345 ; RV64I-NEXT: sb s7, 28(a2)
2346 ; RV64I-NEXT: sb s6, 27(a2)
2347 ; RV64I-NEXT: sb s5, 26(a2)
2348 ; RV64I-NEXT: sb s4, 25(a2)
2349 ; RV64I-NEXT: sb s3, 24(a2)
2350 ; RV64I-NEXT: sb s2, 7(a2)
2351 ; RV64I-NEXT: sb s1, 6(a2)
2352 ; RV64I-NEXT: sb s0, 5(a2)
2353 ; RV64I-NEXT: sb t6, 4(a2)
2354 ; RV64I-NEXT: sb t5, 3(a2)
2355 ; RV64I-NEXT: sb t4, 2(a2)
2356 ; RV64I-NEXT: sb t3, 1(a2)
2357 ; RV64I-NEXT: sb t2, 0(a2)
2358 ; RV64I-NEXT: sb t1, 15(a2)
2359 ; RV64I-NEXT: sb t0, 14(a2)
2360 ; RV64I-NEXT: sb a7, 13(a2)
2361 ; RV64I-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
2362 ; RV64I-NEXT: sb a0, 12(a2)
2363 ; RV64I-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
2364 ; RV64I-NEXT: sb a0, 11(a2)
2365 ; RV64I-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
2366 ; RV64I-NEXT: sb a0, 10(a2)
2367 ; RV64I-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
2368 ; RV64I-NEXT: sb a0, 9(a2)
2369 ; RV64I-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
2370 ; RV64I-NEXT: sb a0, 8(a2)
2371 ; RV64I-NEXT: ld ra, 216(sp) # 8-byte Folded Reload
2372 ; RV64I-NEXT: ld s0, 208(sp) # 8-byte Folded Reload
2373 ; RV64I-NEXT: ld s1, 200(sp) # 8-byte Folded Reload
2374 ; RV64I-NEXT: ld s2, 192(sp) # 8-byte Folded Reload
2375 ; RV64I-NEXT: ld s3, 184(sp) # 8-byte Folded Reload
2376 ; RV64I-NEXT: ld s4, 176(sp) # 8-byte Folded Reload
2377 ; RV64I-NEXT: ld s5, 168(sp) # 8-byte Folded Reload
2378 ; RV64I-NEXT: ld s6, 160(sp) # 8-byte Folded Reload
2379 ; RV64I-NEXT: ld s7, 152(sp) # 8-byte Folded Reload
2380 ; RV64I-NEXT: ld s8, 144(sp) # 8-byte Folded Reload
2381 ; RV64I-NEXT: ld s9, 136(sp) # 8-byte Folded Reload
2382 ; RV64I-NEXT: ld s10, 128(sp) # 8-byte Folded Reload
2383 ; RV64I-NEXT: ld s11, 120(sp) # 8-byte Folded Reload
2384 ; RV64I-NEXT: addi sp, sp, 224
2387 ; RV32I-LABEL: ashr_32bytes:
2389 ; RV32I-NEXT: addi sp, sp, -144
2390 ; RV32I-NEXT: sw ra, 140(sp) # 4-byte Folded Spill
2391 ; RV32I-NEXT: sw s0, 136(sp) # 4-byte Folded Spill
2392 ; RV32I-NEXT: sw s1, 132(sp) # 4-byte Folded Spill
2393 ; RV32I-NEXT: sw s2, 128(sp) # 4-byte Folded Spill
2394 ; RV32I-NEXT: sw s3, 124(sp) # 4-byte Folded Spill
2395 ; RV32I-NEXT: sw s4, 120(sp) # 4-byte Folded Spill
2396 ; RV32I-NEXT: sw s5, 116(sp) # 4-byte Folded Spill
2397 ; RV32I-NEXT: sw s6, 112(sp) # 4-byte Folded Spill
2398 ; RV32I-NEXT: sw s7, 108(sp) # 4-byte Folded Spill
2399 ; RV32I-NEXT: sw s8, 104(sp) # 4-byte Folded Spill
2400 ; RV32I-NEXT: sw s9, 100(sp) # 4-byte Folded Spill
2401 ; RV32I-NEXT: sw s10, 96(sp) # 4-byte Folded Spill
2402 ; RV32I-NEXT: sw s11, 92(sp) # 4-byte Folded Spill
2403 ; RV32I-NEXT: mv t0, a1
2404 ; RV32I-NEXT: lbu t1, 31(a0)
2405 ; RV32I-NEXT: lbu a1, 0(a0)
2406 ; RV32I-NEXT: sw a1, 24(sp) # 4-byte Folded Spill
2407 ; RV32I-NEXT: lbu a1, 1(a0)
2408 ; RV32I-NEXT: sw a1, 20(sp) # 4-byte Folded Spill
2409 ; RV32I-NEXT: lbu a1, 2(a0)
2410 ; RV32I-NEXT: sw a1, 16(sp) # 4-byte Folded Spill
2411 ; RV32I-NEXT: lbu a1, 3(a0)
2412 ; RV32I-NEXT: sw a1, 12(sp) # 4-byte Folded Spill
2413 ; RV32I-NEXT: lbu a1, 4(a0)
2414 ; RV32I-NEXT: sw a1, 8(sp) # 4-byte Folded Spill
2415 ; RV32I-NEXT: lbu a1, 5(a0)
2416 ; RV32I-NEXT: sw a1, 4(sp) # 4-byte Folded Spill
2417 ; RV32I-NEXT: lbu t2, 6(a0)
2418 ; RV32I-NEXT: lbu t3, 7(a0)
2419 ; RV32I-NEXT: lbu t4, 8(a0)
2420 ; RV32I-NEXT: lbu t5, 9(a0)
2421 ; RV32I-NEXT: lbu t6, 10(a0)
2422 ; RV32I-NEXT: lbu s0, 11(a0)
2423 ; RV32I-NEXT: lbu s1, 12(a0)
2424 ; RV32I-NEXT: lbu s2, 13(a0)
2425 ; RV32I-NEXT: lbu s3, 14(a0)
2426 ; RV32I-NEXT: lbu s4, 15(a0)
2427 ; RV32I-NEXT: lbu s5, 16(a0)
2428 ; RV32I-NEXT: lbu s6, 17(a0)
2429 ; RV32I-NEXT: lbu s7, 18(a0)
2430 ; RV32I-NEXT: lbu s8, 19(a0)
2431 ; RV32I-NEXT: lbu s9, 20(a0)
2432 ; RV32I-NEXT: lbu s10, 21(a0)
2433 ; RV32I-NEXT: lbu s11, 22(a0)
2434 ; RV32I-NEXT: lbu ra, 23(a0)
2435 ; RV32I-NEXT: lbu a7, 24(a0)
2436 ; RV32I-NEXT: lbu a6, 25(a0)
2437 ; RV32I-NEXT: lbu a5, 26(a0)
2438 ; RV32I-NEXT: lbu a4, 27(a0)
2439 ; RV32I-NEXT: lbu a1, 30(a0)
2440 ; RV32I-NEXT: lbu a3, 29(a0)
2441 ; RV32I-NEXT: lbu a0, 28(a0)
2442 ; RV32I-NEXT: lbu t0, 0(t0)
2443 ; RV32I-NEXT: sb a1, 58(sp)
2444 ; RV32I-NEXT: sb a3, 57(sp)
2445 ; RV32I-NEXT: sb a0, 56(sp)
2446 ; RV32I-NEXT: sb a4, 55(sp)
2447 ; RV32I-NEXT: sb a5, 54(sp)
2448 ; RV32I-NEXT: sb a6, 53(sp)
2449 ; RV32I-NEXT: sb t1, 59(sp)
2450 ; RV32I-NEXT: slli t1, t1, 24
2451 ; RV32I-NEXT: sb a7, 52(sp)
2452 ; RV32I-NEXT: sb ra, 51(sp)
2453 ; RV32I-NEXT: sb s11, 50(sp)
2454 ; RV32I-NEXT: sb s10, 49(sp)
2455 ; RV32I-NEXT: sb s9, 48(sp)
2456 ; RV32I-NEXT: sb s8, 47(sp)
2457 ; RV32I-NEXT: sb s7, 46(sp)
2458 ; RV32I-NEXT: sb s6, 45(sp)
2459 ; RV32I-NEXT: sb s5, 44(sp)
2460 ; RV32I-NEXT: sb s4, 43(sp)
2461 ; RV32I-NEXT: sb s3, 42(sp)
2462 ; RV32I-NEXT: sb s2, 41(sp)
2463 ; RV32I-NEXT: sb s1, 40(sp)
2464 ; RV32I-NEXT: sb s0, 39(sp)
2465 ; RV32I-NEXT: sb t6, 38(sp)
2466 ; RV32I-NEXT: sb t5, 37(sp)
2467 ; RV32I-NEXT: sb t4, 36(sp)
2468 ; RV32I-NEXT: sb t3, 35(sp)
2469 ; RV32I-NEXT: sb t2, 34(sp)
2470 ; RV32I-NEXT: lw a0, 4(sp) # 4-byte Folded Reload
2471 ; RV32I-NEXT: sb a0, 33(sp)
2472 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
2473 ; RV32I-NEXT: sb a0, 32(sp)
2474 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
2475 ; RV32I-NEXT: sb a0, 31(sp)
2476 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
2477 ; RV32I-NEXT: sb a0, 30(sp)
2478 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
2479 ; RV32I-NEXT: sb a0, 29(sp)
2480 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
2481 ; RV32I-NEXT: sb a0, 28(sp)
2482 ; RV32I-NEXT: srai a0, t1, 31
2483 ; RV32I-NEXT: sb a0, 88(sp)
2484 ; RV32I-NEXT: sb a0, 84(sp)
2485 ; RV32I-NEXT: sb a0, 80(sp)
2486 ; RV32I-NEXT: sb a0, 76(sp)
2487 ; RV32I-NEXT: sb a0, 72(sp)
2488 ; RV32I-NEXT: sb a0, 68(sp)
2489 ; RV32I-NEXT: sb a0, 64(sp)
2490 ; RV32I-NEXT: sb a0, 60(sp)
2491 ; RV32I-NEXT: srli a1, a0, 24
2492 ; RV32I-NEXT: sb a1, 91(sp)
2493 ; RV32I-NEXT: srli a3, a0, 16
2494 ; RV32I-NEXT: sb a3, 90(sp)
2495 ; RV32I-NEXT: srli a0, a0, 8
2496 ; RV32I-NEXT: sb a0, 89(sp)
2497 ; RV32I-NEXT: sb a1, 87(sp)
2498 ; RV32I-NEXT: sb a3, 86(sp)
2499 ; RV32I-NEXT: sb a0, 85(sp)
2500 ; RV32I-NEXT: sb a1, 83(sp)
2501 ; RV32I-NEXT: sb a3, 82(sp)
2502 ; RV32I-NEXT: sb a0, 81(sp)
2503 ; RV32I-NEXT: sb a1, 79(sp)
2504 ; RV32I-NEXT: sb a3, 78(sp)
2505 ; RV32I-NEXT: sb a0, 77(sp)
2506 ; RV32I-NEXT: sb a1, 75(sp)
2507 ; RV32I-NEXT: sb a3, 74(sp)
2508 ; RV32I-NEXT: sb a0, 73(sp)
2509 ; RV32I-NEXT: sb a1, 71(sp)
2510 ; RV32I-NEXT: sb a3, 70(sp)
2511 ; RV32I-NEXT: sb a0, 69(sp)
2512 ; RV32I-NEXT: sb a1, 67(sp)
2513 ; RV32I-NEXT: sb a3, 66(sp)
2514 ; RV32I-NEXT: sb a0, 65(sp)
2515 ; RV32I-NEXT: sb a1, 63(sp)
2516 ; RV32I-NEXT: sb a3, 62(sp)
2517 ; RV32I-NEXT: sb a0, 61(sp)
2518 ; RV32I-NEXT: andi a0, t0, 31
2519 ; RV32I-NEXT: addi a1, sp, 28
2520 ; RV32I-NEXT: add a6, a1, a0
2521 ; RV32I-NEXT: lbu a0, 6(a6)
2522 ; RV32I-NEXT: sw a0, 24(sp) # 4-byte Folded Spill
2523 ; RV32I-NEXT: lbu a0, 7(a6)
2524 ; RV32I-NEXT: sw a0, 20(sp) # 4-byte Folded Spill
2525 ; RV32I-NEXT: lbu a0, 4(a6)
2526 ; RV32I-NEXT: sw a0, 16(sp) # 4-byte Folded Spill
2527 ; RV32I-NEXT: lbu a0, 5(a6)
2528 ; RV32I-NEXT: sw a0, 12(sp) # 4-byte Folded Spill
2529 ; RV32I-NEXT: lbu a0, 0(a6)
2530 ; RV32I-NEXT: sw a0, 8(sp) # 4-byte Folded Spill
2531 ; RV32I-NEXT: lbu a7, 1(a6)
2532 ; RV32I-NEXT: lbu t0, 2(a6)
2533 ; RV32I-NEXT: lbu t1, 3(a6)
2534 ; RV32I-NEXT: lbu t2, 14(a6)
2535 ; RV32I-NEXT: lbu t3, 15(a6)
2536 ; RV32I-NEXT: lbu t4, 12(a6)
2537 ; RV32I-NEXT: lbu t5, 13(a6)
2538 ; RV32I-NEXT: lbu t6, 10(a6)
2539 ; RV32I-NEXT: lbu s0, 11(a6)
2540 ; RV32I-NEXT: lbu s1, 8(a6)
2541 ; RV32I-NEXT: lbu s2, 9(a6)
2542 ; RV32I-NEXT: lbu s3, 22(a6)
2543 ; RV32I-NEXT: lbu s4, 23(a6)
2544 ; RV32I-NEXT: lbu s5, 20(a6)
2545 ; RV32I-NEXT: lbu s6, 21(a6)
2546 ; RV32I-NEXT: lbu s7, 18(a6)
2547 ; RV32I-NEXT: lbu s8, 19(a6)
2548 ; RV32I-NEXT: lbu s9, 16(a6)
2549 ; RV32I-NEXT: lbu s10, 17(a6)
2550 ; RV32I-NEXT: lbu s11, 30(a6)
2551 ; RV32I-NEXT: lbu ra, 31(a6)
2552 ; RV32I-NEXT: lbu a5, 28(a6)
2553 ; RV32I-NEXT: lbu a4, 29(a6)
2554 ; RV32I-NEXT: lbu a0, 25(a6)
2555 ; RV32I-NEXT: lbu a1, 24(a6)
2556 ; RV32I-NEXT: lbu a3, 27(a6)
2557 ; RV32I-NEXT: lbu a6, 26(a6)
2558 ; RV32I-NEXT: sb a0, 25(a2)
2559 ; RV32I-NEXT: sb a1, 24(a2)
2560 ; RV32I-NEXT: sb a3, 27(a2)
2561 ; RV32I-NEXT: sb a6, 26(a2)
2562 ; RV32I-NEXT: sb a4, 29(a2)
2563 ; RV32I-NEXT: sb a5, 28(a2)
2564 ; RV32I-NEXT: sb ra, 31(a2)
2565 ; RV32I-NEXT: sb s11, 30(a2)
2566 ; RV32I-NEXT: sb s10, 17(a2)
2567 ; RV32I-NEXT: sb s9, 16(a2)
2568 ; RV32I-NEXT: sb s8, 19(a2)
2569 ; RV32I-NEXT: sb s7, 18(a2)
2570 ; RV32I-NEXT: sb s6, 21(a2)
2571 ; RV32I-NEXT: sb s5, 20(a2)
2572 ; RV32I-NEXT: sb s4, 23(a2)
2573 ; RV32I-NEXT: sb s3, 22(a2)
2574 ; RV32I-NEXT: sb s2, 9(a2)
2575 ; RV32I-NEXT: sb s1, 8(a2)
2576 ; RV32I-NEXT: sb s0, 11(a2)
2577 ; RV32I-NEXT: sb t6, 10(a2)
2578 ; RV32I-NEXT: sb t5, 13(a2)
2579 ; RV32I-NEXT: sb t4, 12(a2)
2580 ; RV32I-NEXT: sb t3, 15(a2)
2581 ; RV32I-NEXT: sb t2, 14(a2)
2582 ; RV32I-NEXT: sb t1, 3(a2)
2583 ; RV32I-NEXT: sb t0, 2(a2)
2584 ; RV32I-NEXT: sb a7, 1(a2)
2585 ; RV32I-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
2586 ; RV32I-NEXT: sb a0, 0(a2)
2587 ; RV32I-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
2588 ; RV32I-NEXT: sb a0, 5(a2)
2589 ; RV32I-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
2590 ; RV32I-NEXT: sb a0, 4(a2)
2591 ; RV32I-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
2592 ; RV32I-NEXT: sb a0, 7(a2)
2593 ; RV32I-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
2594 ; RV32I-NEXT: sb a0, 6(a2)
2595 ; RV32I-NEXT: lw ra, 140(sp) # 4-byte Folded Reload
2596 ; RV32I-NEXT: lw s0, 136(sp) # 4-byte Folded Reload
2597 ; RV32I-NEXT: lw s1, 132(sp) # 4-byte Folded Reload
2598 ; RV32I-NEXT: lw s2, 128(sp) # 4-byte Folded Reload
2599 ; RV32I-NEXT: lw s3, 124(sp) # 4-byte Folded Reload
2600 ; RV32I-NEXT: lw s4, 120(sp) # 4-byte Folded Reload
2601 ; RV32I-NEXT: lw s5, 116(sp) # 4-byte Folded Reload
2602 ; RV32I-NEXT: lw s6, 112(sp) # 4-byte Folded Reload
2603 ; RV32I-NEXT: lw s7, 108(sp) # 4-byte Folded Reload
2604 ; RV32I-NEXT: lw s8, 104(sp) # 4-byte Folded Reload
2605 ; RV32I-NEXT: lw s9, 100(sp) # 4-byte Folded Reload
2606 ; RV32I-NEXT: lw s10, 96(sp) # 4-byte Folded Reload
2607 ; RV32I-NEXT: lw s11, 92(sp) # 4-byte Folded Reload
2608 ; RV32I-NEXT: addi sp, sp, 144
2610 %src = load i256, ptr %src.ptr, align 1
2611 %byteOff = load i256, ptr %byteOff.ptr, align 1
2612 %bitOff = shl i256 %byteOff, 3
2613 %res = ashr i256 %src, %bitOff
2614 store i256 %res, ptr %dst, align 1