1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu | FileCheck %s --check-prefixes=ALL,LE,LE-64BIT
3 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu | FileCheck %s --check-prefixes=ALL,BE
4 ; RUN: llc < %s -mtriple=ppc32-- | FileCheck %s --check-prefixes=ALL,LE,LE-32BIT
6 define void @lshr_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
7 ; ALL-LABEL: lshr_4bytes:
9 ; ALL-NEXT: lwz 4, 0(4)
10 ; ALL-NEXT: lwz 3, 0(3)
11 ; ALL-NEXT: slwi 4, 4, 3
12 ; ALL-NEXT: srw 3, 3, 4
13 ; ALL-NEXT: stw 3, 0(5)
15 %src = load i32, ptr %src.ptr, align 1
16 %byteOff = load i32, ptr %byteOff.ptr, align 1
17 %bitOff = shl i32 %byteOff, 3
18 %res = lshr i32 %src, %bitOff
19 store i32 %res, ptr %dst, align 1
22 define void @shl_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
23 ; ALL-LABEL: shl_4bytes:
25 ; ALL-NEXT: lwz 4, 0(4)
26 ; ALL-NEXT: lwz 3, 0(3)
27 ; ALL-NEXT: slwi 4, 4, 3
28 ; ALL-NEXT: slw 3, 3, 4
29 ; ALL-NEXT: stw 3, 0(5)
31 %src = load i32, ptr %src.ptr, align 1
32 %byteOff = load i32, ptr %byteOff.ptr, align 1
33 %bitOff = shl i32 %byteOff, 3
34 %res = shl i32 %src, %bitOff
35 store i32 %res, ptr %dst, align 1
38 define void @ashr_4bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
39 ; ALL-LABEL: ashr_4bytes:
41 ; ALL-NEXT: lwz 4, 0(4)
42 ; ALL-NEXT: lwz 3, 0(3)
43 ; ALL-NEXT: slwi 4, 4, 3
44 ; ALL-NEXT: sraw 3, 3, 4
45 ; ALL-NEXT: stw 3, 0(5)
47 %src = load i32, ptr %src.ptr, align 1
48 %byteOff = load i32, ptr %byteOff.ptr, align 1
49 %bitOff = shl i32 %byteOff, 3
50 %res = ashr i32 %src, %bitOff
51 store i32 %res, ptr %dst, align 1
55 define void @lshr_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
56 ; LE-64BIT-LABEL: lshr_8bytes:
58 ; LE-64BIT-NEXT: lwz 4, 0(4)
59 ; LE-64BIT-NEXT: ld 3, 0(3)
60 ; LE-64BIT-NEXT: slwi 4, 4, 3
61 ; LE-64BIT-NEXT: srd 3, 3, 4
62 ; LE-64BIT-NEXT: std 3, 0(5)
65 ; BE-LABEL: lshr_8bytes:
67 ; BE-NEXT: lwz 4, 4(4)
69 ; BE-NEXT: slwi 4, 4, 3
70 ; BE-NEXT: srd 3, 3, 4
71 ; BE-NEXT: std 3, 0(5)
74 ; LE-32BIT-LABEL: lshr_8bytes:
76 ; LE-32BIT-NEXT: lwz 4, 4(4)
77 ; LE-32BIT-NEXT: lwz 6, 4(3)
78 ; LE-32BIT-NEXT: lwz 3, 0(3)
79 ; LE-32BIT-NEXT: slwi 4, 4, 3
80 ; LE-32BIT-NEXT: subfic 7, 4, 32
81 ; LE-32BIT-NEXT: srw 6, 6, 4
82 ; LE-32BIT-NEXT: addi 8, 4, -32
83 ; LE-32BIT-NEXT: slw 7, 3, 7
84 ; LE-32BIT-NEXT: srw 4, 3, 4
85 ; LE-32BIT-NEXT: srw 3, 3, 8
86 ; LE-32BIT-NEXT: or 6, 6, 7
87 ; LE-32BIT-NEXT: or 3, 6, 3
88 ; LE-32BIT-NEXT: stw 4, 0(5)
89 ; LE-32BIT-NEXT: stw 3, 4(5)
91 %src = load i64, ptr %src.ptr, align 1
92 %byteOff = load i64, ptr %byteOff.ptr, align 1
93 %bitOff = shl i64 %byteOff, 3
94 %res = lshr i64 %src, %bitOff
95 store i64 %res, ptr %dst, align 1
98 define void @shl_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
99 ; LE-64BIT-LABEL: shl_8bytes:
101 ; LE-64BIT-NEXT: lwz 4, 0(4)
102 ; LE-64BIT-NEXT: ld 3, 0(3)
103 ; LE-64BIT-NEXT: slwi 4, 4, 3
104 ; LE-64BIT-NEXT: sld 3, 3, 4
105 ; LE-64BIT-NEXT: std 3, 0(5)
108 ; BE-LABEL: shl_8bytes:
110 ; BE-NEXT: lwz 4, 4(4)
111 ; BE-NEXT: ld 3, 0(3)
112 ; BE-NEXT: slwi 4, 4, 3
113 ; BE-NEXT: sld 3, 3, 4
114 ; BE-NEXT: std 3, 0(5)
117 ; LE-32BIT-LABEL: shl_8bytes:
119 ; LE-32BIT-NEXT: lwz 4, 4(4)
120 ; LE-32BIT-NEXT: lwz 6, 0(3)
121 ; LE-32BIT-NEXT: lwz 3, 4(3)
122 ; LE-32BIT-NEXT: slwi 4, 4, 3
123 ; LE-32BIT-NEXT: subfic 7, 4, 32
124 ; LE-32BIT-NEXT: slw 6, 6, 4
125 ; LE-32BIT-NEXT: addi 8, 4, -32
126 ; LE-32BIT-NEXT: srw 7, 3, 7
127 ; LE-32BIT-NEXT: slw 4, 3, 4
128 ; LE-32BIT-NEXT: slw 3, 3, 8
129 ; LE-32BIT-NEXT: or 6, 6, 7
130 ; LE-32BIT-NEXT: or 3, 6, 3
131 ; LE-32BIT-NEXT: stw 4, 4(5)
132 ; LE-32BIT-NEXT: stw 3, 0(5)
134 %src = load i64, ptr %src.ptr, align 1
135 %byteOff = load i64, ptr %byteOff.ptr, align 1
136 %bitOff = shl i64 %byteOff, 3
137 %res = shl i64 %src, %bitOff
138 store i64 %res, ptr %dst, align 1
141 define void @ashr_8bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
142 ; LE-64BIT-LABEL: ashr_8bytes:
144 ; LE-64BIT-NEXT: lwz 4, 0(4)
145 ; LE-64BIT-NEXT: ld 3, 0(3)
146 ; LE-64BIT-NEXT: slwi 4, 4, 3
147 ; LE-64BIT-NEXT: srad 3, 3, 4
148 ; LE-64BIT-NEXT: std 3, 0(5)
151 ; BE-LABEL: ashr_8bytes:
153 ; BE-NEXT: lwz 4, 4(4)
154 ; BE-NEXT: ld 3, 0(3)
155 ; BE-NEXT: slwi 4, 4, 3
156 ; BE-NEXT: srad 3, 3, 4
157 ; BE-NEXT: std 3, 0(5)
160 ; LE-32BIT-LABEL: ashr_8bytes:
162 ; LE-32BIT-NEXT: lwz 4, 4(4)
163 ; LE-32BIT-NEXT: lwz 6, 0(3)
164 ; LE-32BIT-NEXT: slwi 4, 4, 3
165 ; LE-32BIT-NEXT: addi 7, 4, -32
166 ; LE-32BIT-NEXT: cmpwi 7, 0
167 ; LE-32BIT-NEXT: ble 0, .LBB5_2
168 ; LE-32BIT-NEXT: # %bb.1:
169 ; LE-32BIT-NEXT: sraw 3, 6, 7
170 ; LE-32BIT-NEXT: b .LBB5_3
171 ; LE-32BIT-NEXT: .LBB5_2:
172 ; LE-32BIT-NEXT: lwz 3, 4(3)
173 ; LE-32BIT-NEXT: subfic 7, 4, 32
174 ; LE-32BIT-NEXT: slw 7, 6, 7
175 ; LE-32BIT-NEXT: srw 3, 3, 4
176 ; LE-32BIT-NEXT: or 3, 3, 7
177 ; LE-32BIT-NEXT: .LBB5_3:
178 ; LE-32BIT-NEXT: sraw 4, 6, 4
179 ; LE-32BIT-NEXT: stw 4, 0(5)
180 ; LE-32BIT-NEXT: stw 3, 4(5)
182 %src = load i64, ptr %src.ptr, align 1
183 %byteOff = load i64, ptr %byteOff.ptr, align 1
184 %bitOff = shl i64 %byteOff, 3
185 %res = ashr i64 %src, %bitOff
186 store i64 %res, ptr %dst, align 1
190 define void @lshr_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
191 ; LE-64BIT-LABEL: lshr_16bytes:
193 ; LE-64BIT-NEXT: lwz 4, 0(4)
194 ; LE-64BIT-NEXT: ld 6, 8(3)
195 ; LE-64BIT-NEXT: ld 3, 0(3)
196 ; LE-64BIT-NEXT: slwi 4, 4, 3
197 ; LE-64BIT-NEXT: subfic 7, 4, 64
198 ; LE-64BIT-NEXT: srd 3, 3, 4
199 ; LE-64BIT-NEXT: sld 7, 6, 7
200 ; LE-64BIT-NEXT: or 3, 3, 7
201 ; LE-64BIT-NEXT: addi 7, 4, -64
202 ; LE-64BIT-NEXT: srd 4, 6, 4
203 ; LE-64BIT-NEXT: srd 7, 6, 7
204 ; LE-64BIT-NEXT: std 4, 8(5)
205 ; LE-64BIT-NEXT: or 3, 3, 7
206 ; LE-64BIT-NEXT: std 3, 0(5)
209 ; BE-LABEL: lshr_16bytes:
211 ; BE-NEXT: lwz 4, 12(4)
212 ; BE-NEXT: ld 6, 0(3)
213 ; BE-NEXT: ld 3, 8(3)
214 ; BE-NEXT: slwi 4, 4, 3
215 ; BE-NEXT: subfic 7, 4, 64
216 ; BE-NEXT: srd 3, 3, 4
217 ; BE-NEXT: sld 7, 6, 7
218 ; BE-NEXT: addi 8, 4, -64
219 ; BE-NEXT: or 3, 3, 7
220 ; BE-NEXT: srd 7, 6, 8
221 ; BE-NEXT: srd 4, 6, 4
222 ; BE-NEXT: or 3, 3, 7
223 ; BE-NEXT: std 4, 0(5)
224 ; BE-NEXT: std 3, 8(5)
227 ; LE-32BIT-LABEL: lshr_16bytes:
229 ; LE-32BIT-NEXT: stwu 1, -48(1)
230 ; LE-32BIT-NEXT: lwz 7, 0(3)
231 ; LE-32BIT-NEXT: li 6, 0
232 ; LE-32BIT-NEXT: lwz 8, 4(3)
233 ; LE-32BIT-NEXT: lwz 9, 8(3)
234 ; LE-32BIT-NEXT: lwz 3, 12(3)
235 ; LE-32BIT-NEXT: lwz 4, 12(4)
236 ; LE-32BIT-NEXT: stw 3, 44(1)
237 ; LE-32BIT-NEXT: addi 3, 1, 32
238 ; LE-32BIT-NEXT: clrlwi 4, 4, 28
239 ; LE-32BIT-NEXT: stw 6, 28(1)
240 ; LE-32BIT-NEXT: sub 3, 3, 4
241 ; LE-32BIT-NEXT: stw 6, 24(1)
242 ; LE-32BIT-NEXT: stw 6, 20(1)
243 ; LE-32BIT-NEXT: stw 6, 16(1)
244 ; LE-32BIT-NEXT: stw 9, 40(1)
245 ; LE-32BIT-NEXT: stw 8, 36(1)
246 ; LE-32BIT-NEXT: stw 7, 32(1)
247 ; LE-32BIT-NEXT: lwz 4, 4(3)
248 ; LE-32BIT-NEXT: lwz 6, 0(3)
249 ; LE-32BIT-NEXT: lwz 7, 8(3)
250 ; LE-32BIT-NEXT: lwz 3, 12(3)
251 ; LE-32BIT-NEXT: stw 7, 8(5)
252 ; LE-32BIT-NEXT: stw 3, 12(5)
253 ; LE-32BIT-NEXT: stw 6, 0(5)
254 ; LE-32BIT-NEXT: stw 4, 4(5)
255 ; LE-32BIT-NEXT: addi 1, 1, 48
257 %src = load i128, ptr %src.ptr, align 1
258 %byteOff = load i128, ptr %byteOff.ptr, align 1
259 %bitOff = shl i128 %byteOff, 3
260 %res = lshr i128 %src, %bitOff
261 store i128 %res, ptr %dst, align 1
264 define void @shl_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
265 ; LE-64BIT-LABEL: shl_16bytes:
267 ; LE-64BIT-NEXT: lwz 4, 0(4)
268 ; LE-64BIT-NEXT: ld 6, 0(3)
269 ; LE-64BIT-NEXT: ld 3, 8(3)
270 ; LE-64BIT-NEXT: slwi 4, 4, 3
271 ; LE-64BIT-NEXT: subfic 7, 4, 64
272 ; LE-64BIT-NEXT: sld 3, 3, 4
273 ; LE-64BIT-NEXT: srd 7, 6, 7
274 ; LE-64BIT-NEXT: or 3, 3, 7
275 ; LE-64BIT-NEXT: addi 7, 4, -64
276 ; LE-64BIT-NEXT: sld 4, 6, 4
277 ; LE-64BIT-NEXT: sld 7, 6, 7
278 ; LE-64BIT-NEXT: std 4, 0(5)
279 ; LE-64BIT-NEXT: or 3, 3, 7
280 ; LE-64BIT-NEXT: std 3, 8(5)
283 ; BE-LABEL: shl_16bytes:
285 ; BE-NEXT: lwz 4, 12(4)
286 ; BE-NEXT: ld 6, 8(3)
287 ; BE-NEXT: ld 3, 0(3)
288 ; BE-NEXT: slwi 4, 4, 3
289 ; BE-NEXT: subfic 7, 4, 64
290 ; BE-NEXT: sld 3, 3, 4
291 ; BE-NEXT: srd 7, 6, 7
292 ; BE-NEXT: addi 8, 4, -64
293 ; BE-NEXT: or 3, 3, 7
294 ; BE-NEXT: sld 7, 6, 8
295 ; BE-NEXT: sld 4, 6, 4
296 ; BE-NEXT: or 3, 3, 7
297 ; BE-NEXT: std 4, 8(5)
298 ; BE-NEXT: std 3, 0(5)
301 ; LE-32BIT-LABEL: shl_16bytes:
303 ; LE-32BIT-NEXT: stwu 1, -48(1)
304 ; LE-32BIT-NEXT: lwz 7, 0(3)
305 ; LE-32BIT-NEXT: li 6, 0
306 ; LE-32BIT-NEXT: lwz 8, 4(3)
307 ; LE-32BIT-NEXT: lwz 9, 8(3)
308 ; LE-32BIT-NEXT: lwz 3, 12(3)
309 ; LE-32BIT-NEXT: lwz 4, 12(4)
310 ; LE-32BIT-NEXT: stw 6, 44(1)
311 ; LE-32BIT-NEXT: stw 6, 40(1)
312 ; LE-32BIT-NEXT: clrlwi 4, 4, 28
313 ; LE-32BIT-NEXT: stw 6, 36(1)
314 ; LE-32BIT-NEXT: stw 6, 32(1)
315 ; LE-32BIT-NEXT: stw 3, 28(1)
316 ; LE-32BIT-NEXT: addi 3, 1, 16
317 ; LE-32BIT-NEXT: stw 9, 24(1)
318 ; LE-32BIT-NEXT: stw 8, 20(1)
319 ; LE-32BIT-NEXT: stw 7, 16(1)
320 ; LE-32BIT-NEXT: lwzux 3, 4, 3
321 ; LE-32BIT-NEXT: lwz 6, 4(4)
322 ; LE-32BIT-NEXT: lwz 7, 12(4)
323 ; LE-32BIT-NEXT: lwz 4, 8(4)
324 ; LE-32BIT-NEXT: stw 3, 0(5)
325 ; LE-32BIT-NEXT: stw 4, 8(5)
326 ; LE-32BIT-NEXT: stw 7, 12(5)
327 ; LE-32BIT-NEXT: stw 6, 4(5)
328 ; LE-32BIT-NEXT: addi 1, 1, 48
330 %src = load i128, ptr %src.ptr, align 1
331 %byteOff = load i128, ptr %byteOff.ptr, align 1
332 %bitOff = shl i128 %byteOff, 3
333 %res = shl i128 %src, %bitOff
334 store i128 %res, ptr %dst, align 1
337 define void @ashr_16bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
338 ; LE-64BIT-LABEL: ashr_16bytes:
340 ; LE-64BIT-NEXT: lwz 4, 0(4)
341 ; LE-64BIT-NEXT: ld 6, 8(3)
342 ; LE-64BIT-NEXT: ld 3, 0(3)
343 ; LE-64BIT-NEXT: slwi 4, 4, 3
344 ; LE-64BIT-NEXT: subfic 7, 4, 64
345 ; LE-64BIT-NEXT: srd 3, 3, 4
346 ; LE-64BIT-NEXT: sld 7, 6, 7
347 ; LE-64BIT-NEXT: or 3, 3, 7
348 ; LE-64BIT-NEXT: addi 7, 4, -64
349 ; LE-64BIT-NEXT: srad 4, 6, 4
350 ; LE-64BIT-NEXT: cmpwi 7, 1
351 ; LE-64BIT-NEXT: srad 8, 6, 7
352 ; LE-64BIT-NEXT: std 4, 8(5)
353 ; LE-64BIT-NEXT: isellt 3, 3, 8
354 ; LE-64BIT-NEXT: std 3, 0(5)
357 ; BE-LABEL: ashr_16bytes:
359 ; BE-NEXT: lwz 4, 12(4)
360 ; BE-NEXT: ld 6, 0(3)
361 ; BE-NEXT: slwi 4, 4, 3
362 ; BE-NEXT: addi 7, 4, -64
363 ; BE-NEXT: cmpwi 7, 1
364 ; BE-NEXT: blt 0, .LBB8_2
366 ; BE-NEXT: srad 3, 6, 7
369 ; BE-NEXT: ld 3, 8(3)
370 ; BE-NEXT: subfic 7, 4, 64
371 ; BE-NEXT: sld 7, 6, 7
372 ; BE-NEXT: srd 3, 3, 4
373 ; BE-NEXT: or 3, 3, 7
375 ; BE-NEXT: srad 4, 6, 4
376 ; BE-NEXT: std 3, 8(5)
377 ; BE-NEXT: std 4, 0(5)
380 ; LE-32BIT-LABEL: ashr_16bytes:
382 ; LE-32BIT-NEXT: stwu 1, -48(1)
383 ; LE-32BIT-NEXT: lwz 7, 0(3)
384 ; LE-32BIT-NEXT: addi 6, 1, 32
385 ; LE-32BIT-NEXT: lwz 8, 4(3)
386 ; LE-32BIT-NEXT: lwz 9, 8(3)
387 ; LE-32BIT-NEXT: lwz 3, 12(3)
388 ; LE-32BIT-NEXT: lwz 4, 12(4)
389 ; LE-32BIT-NEXT: stw 3, 44(1)
390 ; LE-32BIT-NEXT: srawi 3, 7, 31
391 ; LE-32BIT-NEXT: clrlwi 4, 4, 28
392 ; LE-32BIT-NEXT: stw 9, 40(1)
393 ; LE-32BIT-NEXT: stw 8, 36(1)
394 ; LE-32BIT-NEXT: stw 7, 32(1)
395 ; LE-32BIT-NEXT: stw 3, 28(1)
396 ; LE-32BIT-NEXT: stw 3, 24(1)
397 ; LE-32BIT-NEXT: stw 3, 20(1)
398 ; LE-32BIT-NEXT: stw 3, 16(1)
399 ; LE-32BIT-NEXT: sub 3, 6, 4
400 ; LE-32BIT-NEXT: lwz 4, 4(3)
401 ; LE-32BIT-NEXT: lwz 6, 0(3)
402 ; LE-32BIT-NEXT: lwz 7, 8(3)
403 ; LE-32BIT-NEXT: lwz 3, 12(3)
404 ; LE-32BIT-NEXT: stw 7, 8(5)
405 ; LE-32BIT-NEXT: stw 3, 12(5)
406 ; LE-32BIT-NEXT: stw 6, 0(5)
407 ; LE-32BIT-NEXT: stw 4, 4(5)
408 ; LE-32BIT-NEXT: addi 1, 1, 48
410 %src = load i128, ptr %src.ptr, align 1
411 %byteOff = load i128, ptr %byteOff.ptr, align 1
412 %bitOff = shl i128 %byteOff, 3
413 %res = ashr i128 %src, %bitOff
414 store i128 %res, ptr %dst, align 1
418 define void @lshr_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
419 ; LE-64BIT-LABEL: lshr_32bytes:
421 ; LE-64BIT-NEXT: li 6, 16
422 ; LE-64BIT-NEXT: lxvd2x 1, 0, 3
423 ; LE-64BIT-NEXT: xxlxor 2, 2, 2
424 ; LE-64BIT-NEXT: addi 7, 1, -64
425 ; LE-64BIT-NEXT: lxvd2x 0, 3, 6
426 ; LE-64BIT-NEXT: lwz 3, 0(4)
427 ; LE-64BIT-NEXT: li 4, 48
428 ; LE-64BIT-NEXT: stxvd2x 2, 7, 4
429 ; LE-64BIT-NEXT: li 4, 32
430 ; LE-64BIT-NEXT: clrldi 3, 3, 59
431 ; LE-64BIT-NEXT: stxvd2x 2, 7, 4
432 ; LE-64BIT-NEXT: stxvd2x 0, 7, 6
433 ; LE-64BIT-NEXT: stxvd2x 1, 0, 7
434 ; LE-64BIT-NEXT: lxvd2x 0, 7, 3
435 ; LE-64BIT-NEXT: add 3, 7, 3
436 ; LE-64BIT-NEXT: lxvd2x 1, 3, 6
437 ; LE-64BIT-NEXT: stxvd2x 1, 5, 6
438 ; LE-64BIT-NEXT: stxvd2x 0, 0, 5
441 ; BE-LABEL: lshr_32bytes:
443 ; BE-NEXT: ld 6, 0(3)
444 ; BE-NEXT: ld 7, 8(3)
445 ; BE-NEXT: ld 8, 16(3)
446 ; BE-NEXT: ld 3, 24(3)
447 ; BE-NEXT: lwz 4, 28(4)
448 ; BE-NEXT: addi 9, 1, -64
450 ; BE-NEXT: std 10, 24(9)
451 ; BE-NEXT: std 10, 16(9)
452 ; BE-NEXT: std 10, 8(9)
453 ; BE-NEXT: std 10, -64(1)
454 ; BE-NEXT: std 3, 56(9)
455 ; BE-NEXT: clrlwi 3, 4, 27
457 ; BE-NEXT: std 8, 48(9)
458 ; BE-NEXT: std 7, 40(9)
459 ; BE-NEXT: std 6, 32(9)
460 ; BE-NEXT: extsw 3, 3
461 ; BE-NEXT: addi 4, 1, -32
462 ; BE-NEXT: ldux 3, 4, 3
463 ; BE-NEXT: ld 6, 8(4)
464 ; BE-NEXT: ld 7, 24(4)
465 ; BE-NEXT: ld 4, 16(4)
466 ; BE-NEXT: std 3, 0(5)
467 ; BE-NEXT: std 4, 16(5)
468 ; BE-NEXT: std 7, 24(5)
469 ; BE-NEXT: std 6, 8(5)
472 ; LE-32BIT-LABEL: lshr_32bytes:
474 ; LE-32BIT-NEXT: stwu 1, -80(1)
475 ; LE-32BIT-NEXT: lwz 7, 0(3)
476 ; LE-32BIT-NEXT: li 6, 0
477 ; LE-32BIT-NEXT: lwz 8, 4(3)
478 ; LE-32BIT-NEXT: lwz 9, 8(3)
479 ; LE-32BIT-NEXT: lwz 10, 12(3)
480 ; LE-32BIT-NEXT: lwz 11, 16(3)
481 ; LE-32BIT-NEXT: lwz 12, 20(3)
482 ; LE-32BIT-NEXT: lwz 0, 24(3)
483 ; LE-32BIT-NEXT: lwz 3, 28(3)
484 ; LE-32BIT-NEXT: lwz 4, 28(4)
485 ; LE-32BIT-NEXT: stw 3, 76(1)
486 ; LE-32BIT-NEXT: addi 3, 1, 48
487 ; LE-32BIT-NEXT: clrlwi 4, 4, 27
488 ; LE-32BIT-NEXT: stw 6, 44(1)
489 ; LE-32BIT-NEXT: sub 3, 3, 4
490 ; LE-32BIT-NEXT: stw 6, 40(1)
491 ; LE-32BIT-NEXT: stw 6, 36(1)
492 ; LE-32BIT-NEXT: stw 6, 32(1)
493 ; LE-32BIT-NEXT: stw 6, 28(1)
494 ; LE-32BIT-NEXT: stw 6, 24(1)
495 ; LE-32BIT-NEXT: stw 6, 20(1)
496 ; LE-32BIT-NEXT: stw 6, 16(1)
497 ; LE-32BIT-NEXT: stw 0, 72(1)
498 ; LE-32BIT-NEXT: stw 12, 68(1)
499 ; LE-32BIT-NEXT: stw 11, 64(1)
500 ; LE-32BIT-NEXT: stw 10, 60(1)
501 ; LE-32BIT-NEXT: stw 9, 56(1)
502 ; LE-32BIT-NEXT: stw 8, 52(1)
503 ; LE-32BIT-NEXT: stw 7, 48(1)
504 ; LE-32BIT-NEXT: lwz 4, 4(3)
505 ; LE-32BIT-NEXT: lwz 6, 0(3)
506 ; LE-32BIT-NEXT: lwz 7, 12(3)
507 ; LE-32BIT-NEXT: lwz 8, 8(3)
508 ; LE-32BIT-NEXT: lwz 9, 20(3)
509 ; LE-32BIT-NEXT: lwz 10, 16(3)
510 ; LE-32BIT-NEXT: lwz 11, 24(3)
511 ; LE-32BIT-NEXT: lwz 3, 28(3)
512 ; LE-32BIT-NEXT: stw 11, 24(5)
513 ; LE-32BIT-NEXT: stw 3, 28(5)
514 ; LE-32BIT-NEXT: stw 10, 16(5)
515 ; LE-32BIT-NEXT: stw 9, 20(5)
516 ; LE-32BIT-NEXT: stw 8, 8(5)
517 ; LE-32BIT-NEXT: stw 7, 12(5)
518 ; LE-32BIT-NEXT: stw 6, 0(5)
519 ; LE-32BIT-NEXT: stw 4, 4(5)
520 ; LE-32BIT-NEXT: addi 1, 1, 80
522 %src = load i256, ptr %src.ptr, align 1
523 %byteOff = load i256, ptr %byteOff.ptr, align 1
524 %bitOff = shl i256 %byteOff, 3
525 %res = lshr i256 %src, %bitOff
526 store i256 %res, ptr %dst, align 1
529 define void @shl_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
530 ; LE-64BIT-LABEL: shl_32bytes:
532 ; LE-64BIT-NEXT: li 6, 16
533 ; LE-64BIT-NEXT: lxvd2x 1, 0, 3
534 ; LE-64BIT-NEXT: xxlxor 2, 2, 2
535 ; LE-64BIT-NEXT: li 7, 48
536 ; LE-64BIT-NEXT: lxvd2x 0, 3, 6
537 ; LE-64BIT-NEXT: lwz 3, 0(4)
538 ; LE-64BIT-NEXT: addi 4, 1, -64
539 ; LE-64BIT-NEXT: stxvd2x 2, 4, 6
540 ; LE-64BIT-NEXT: clrlwi 3, 3, 27
541 ; LE-64BIT-NEXT: stxvd2x 0, 4, 7
542 ; LE-64BIT-NEXT: li 7, 32
543 ; LE-64BIT-NEXT: neg 3, 3
544 ; LE-64BIT-NEXT: stxvd2x 1, 4, 7
545 ; LE-64BIT-NEXT: stxvd2x 2, 0, 4
546 ; LE-64BIT-NEXT: extsw 3, 3
547 ; LE-64BIT-NEXT: addi 4, 1, -32
548 ; LE-64BIT-NEXT: lxvd2x 0, 4, 3
549 ; LE-64BIT-NEXT: add 3, 4, 3
550 ; LE-64BIT-NEXT: lxvd2x 1, 3, 6
551 ; LE-64BIT-NEXT: stxvd2x 1, 5, 6
552 ; LE-64BIT-NEXT: stxvd2x 0, 0, 5
555 ; BE-LABEL: shl_32bytes:
557 ; BE-NEXT: ld 6, 0(3)
558 ; BE-NEXT: ld 7, 8(3)
559 ; BE-NEXT: ld 8, 16(3)
560 ; BE-NEXT: ld 3, 24(3)
561 ; BE-NEXT: lwz 4, 28(4)
562 ; BE-NEXT: addi 9, 1, -64
564 ; BE-NEXT: std 10, 56(9)
565 ; BE-NEXT: std 10, 48(9)
566 ; BE-NEXT: std 10, 40(9)
567 ; BE-NEXT: std 10, 32(9)
568 ; BE-NEXT: std 3, 24(9)
569 ; BE-NEXT: std 8, 16(9)
570 ; BE-NEXT: std 7, 8(9)
571 ; BE-NEXT: std 6, -64(1)
572 ; BE-NEXT: clrldi 3, 4, 59
573 ; BE-NEXT: ldux 4, 3, 9
574 ; BE-NEXT: ld 6, 8(3)
575 ; BE-NEXT: ld 7, 24(3)
576 ; BE-NEXT: ld 3, 16(3)
577 ; BE-NEXT: std 4, 0(5)
578 ; BE-NEXT: std 3, 16(5)
579 ; BE-NEXT: std 7, 24(5)
580 ; BE-NEXT: std 6, 8(5)
583 ; LE-32BIT-LABEL: shl_32bytes:
585 ; LE-32BIT-NEXT: stwu 1, -80(1)
586 ; LE-32BIT-NEXT: lwz 7, 0(3)
587 ; LE-32BIT-NEXT: li 6, 0
588 ; LE-32BIT-NEXT: lwz 8, 4(3)
589 ; LE-32BIT-NEXT: lwz 9, 8(3)
590 ; LE-32BIT-NEXT: lwz 10, 12(3)
591 ; LE-32BIT-NEXT: lwz 11, 16(3)
592 ; LE-32BIT-NEXT: lwz 12, 20(3)
593 ; LE-32BIT-NEXT: lwz 0, 24(3)
594 ; LE-32BIT-NEXT: lwz 3, 28(3)
595 ; LE-32BIT-NEXT: lwz 4, 28(4)
596 ; LE-32BIT-NEXT: stw 6, 76(1)
597 ; LE-32BIT-NEXT: stw 6, 72(1)
598 ; LE-32BIT-NEXT: clrlwi 4, 4, 27
599 ; LE-32BIT-NEXT: stw 6, 68(1)
600 ; LE-32BIT-NEXT: stw 6, 64(1)
601 ; LE-32BIT-NEXT: stw 6, 60(1)
602 ; LE-32BIT-NEXT: stw 6, 56(1)
603 ; LE-32BIT-NEXT: stw 6, 52(1)
604 ; LE-32BIT-NEXT: stw 6, 48(1)
605 ; LE-32BIT-NEXT: stw 3, 44(1)
606 ; LE-32BIT-NEXT: addi 3, 1, 16
607 ; LE-32BIT-NEXT: stw 0, 40(1)
608 ; LE-32BIT-NEXT: stw 12, 36(1)
609 ; LE-32BIT-NEXT: stw 11, 32(1)
610 ; LE-32BIT-NEXT: stw 10, 28(1)
611 ; LE-32BIT-NEXT: stw 9, 24(1)
612 ; LE-32BIT-NEXT: stw 8, 20(1)
613 ; LE-32BIT-NEXT: stw 7, 16(1)
614 ; LE-32BIT-NEXT: lwzux 3, 4, 3
615 ; LE-32BIT-NEXT: lwz 6, 4(4)
616 ; LE-32BIT-NEXT: lwz 7, 12(4)
617 ; LE-32BIT-NEXT: lwz 8, 8(4)
618 ; LE-32BIT-NEXT: lwz 9, 20(4)
619 ; LE-32BIT-NEXT: lwz 10, 16(4)
620 ; LE-32BIT-NEXT: lwz 11, 28(4)
621 ; LE-32BIT-NEXT: lwz 4, 24(4)
622 ; LE-32BIT-NEXT: stw 3, 0(5)
623 ; LE-32BIT-NEXT: stw 4, 24(5)
624 ; LE-32BIT-NEXT: stw 11, 28(5)
625 ; LE-32BIT-NEXT: stw 10, 16(5)
626 ; LE-32BIT-NEXT: stw 9, 20(5)
627 ; LE-32BIT-NEXT: stw 8, 8(5)
628 ; LE-32BIT-NEXT: stw 7, 12(5)
629 ; LE-32BIT-NEXT: stw 6, 4(5)
630 ; LE-32BIT-NEXT: addi 1, 1, 80
632 %src = load i256, ptr %src.ptr, align 1
633 %byteOff = load i256, ptr %byteOff.ptr, align 1
634 %bitOff = shl i256 %byteOff, 3
635 %res = shl i256 %src, %bitOff
636 store i256 %res, ptr %dst, align 1
639 define void @ashr_32bytes(ptr %src.ptr, ptr %byteOff.ptr, ptr %dst) nounwind {
640 ; LE-64BIT-LABEL: ashr_32bytes:
642 ; LE-64BIT-NEXT: lxvd2x 0, 0, 3
643 ; LE-64BIT-NEXT: ld 6, 16(3)
644 ; LE-64BIT-NEXT: ld 3, 24(3)
645 ; LE-64BIT-NEXT: addi 7, 1, -64
646 ; LE-64BIT-NEXT: lwz 4, 0(4)
647 ; LE-64BIT-NEXT: li 8, 16
648 ; LE-64BIT-NEXT: std 3, 24(7)
649 ; LE-64BIT-NEXT: sradi 3, 3, 63
650 ; LE-64BIT-NEXT: std 6, 16(7)
651 ; LE-64BIT-NEXT: std 3, 56(7)
652 ; LE-64BIT-NEXT: std 3, 48(7)
653 ; LE-64BIT-NEXT: std 3, 40(7)
654 ; LE-64BIT-NEXT: std 3, 32(7)
655 ; LE-64BIT-NEXT: clrldi 3, 4, 59
656 ; LE-64BIT-NEXT: stxvd2x 0, 0, 7
657 ; LE-64BIT-NEXT: lxvd2x 0, 7, 3
658 ; LE-64BIT-NEXT: add 3, 7, 3
659 ; LE-64BIT-NEXT: lxvd2x 1, 3, 8
660 ; LE-64BIT-NEXT: stxvd2x 1, 5, 8
661 ; LE-64BIT-NEXT: stxvd2x 0, 0, 5
664 ; BE-LABEL: ashr_32bytes:
666 ; BE-NEXT: ld 7, 0(3)
667 ; BE-NEXT: ld 8, 8(3)
668 ; BE-NEXT: ld 9, 16(3)
669 ; BE-NEXT: ld 3, 24(3)
670 ; BE-NEXT: lwz 4, 28(4)
671 ; BE-NEXT: addi 6, 1, -64
672 ; BE-NEXT: std 3, 56(6)
673 ; BE-NEXT: sradi 3, 7, 63
674 ; BE-NEXT: clrlwi 4, 4, 27
675 ; BE-NEXT: std 3, 24(6)
676 ; BE-NEXT: std 3, 16(6)
677 ; BE-NEXT: std 3, 8(6)
678 ; BE-NEXT: std 3, -64(1)
680 ; BE-NEXT: std 9, 48(6)
681 ; BE-NEXT: std 8, 40(6)
682 ; BE-NEXT: std 7, 32(6)
683 ; BE-NEXT: extsw 3, 3
684 ; BE-NEXT: addi 4, 1, -32
685 ; BE-NEXT: ldux 3, 4, 3
686 ; BE-NEXT: ld 6, 8(4)
687 ; BE-NEXT: ld 7, 24(4)
688 ; BE-NEXT: ld 4, 16(4)
689 ; BE-NEXT: std 3, 0(5)
690 ; BE-NEXT: std 4, 16(5)
691 ; BE-NEXT: std 7, 24(5)
692 ; BE-NEXT: std 6, 8(5)
695 ; LE-32BIT-LABEL: ashr_32bytes:
697 ; LE-32BIT-NEXT: stwu 1, -80(1)
698 ; LE-32BIT-NEXT: lwz 7, 0(3)
699 ; LE-32BIT-NEXT: addi 6, 1, 48
700 ; LE-32BIT-NEXT: lwz 8, 4(3)
701 ; LE-32BIT-NEXT: lwz 9, 8(3)
702 ; LE-32BIT-NEXT: lwz 10, 12(3)
703 ; LE-32BIT-NEXT: lwz 11, 16(3)
704 ; LE-32BIT-NEXT: lwz 12, 20(3)
705 ; LE-32BIT-NEXT: lwz 0, 24(3)
706 ; LE-32BIT-NEXT: lwz 3, 28(3)
707 ; LE-32BIT-NEXT: lwz 4, 28(4)
708 ; LE-32BIT-NEXT: stw 3, 76(1)
709 ; LE-32BIT-NEXT: srawi 3, 7, 31
710 ; LE-32BIT-NEXT: clrlwi 4, 4, 27
711 ; LE-32BIT-NEXT: stw 0, 72(1)
712 ; LE-32BIT-NEXT: stw 12, 68(1)
713 ; LE-32BIT-NEXT: stw 11, 64(1)
714 ; LE-32BIT-NEXT: stw 10, 60(1)
715 ; LE-32BIT-NEXT: stw 9, 56(1)
716 ; LE-32BIT-NEXT: stw 8, 52(1)
717 ; LE-32BIT-NEXT: stw 7, 48(1)
718 ; LE-32BIT-NEXT: stw 3, 44(1)
719 ; LE-32BIT-NEXT: stw 3, 40(1)
720 ; LE-32BIT-NEXT: stw 3, 36(1)
721 ; LE-32BIT-NEXT: stw 3, 32(1)
722 ; LE-32BIT-NEXT: stw 3, 28(1)
723 ; LE-32BIT-NEXT: stw 3, 24(1)
724 ; LE-32BIT-NEXT: stw 3, 20(1)
725 ; LE-32BIT-NEXT: stw 3, 16(1)
726 ; LE-32BIT-NEXT: sub 3, 6, 4
727 ; LE-32BIT-NEXT: lwz 4, 4(3)
728 ; LE-32BIT-NEXT: lwz 6, 0(3)
729 ; LE-32BIT-NEXT: lwz 7, 12(3)
730 ; LE-32BIT-NEXT: lwz 8, 8(3)
731 ; LE-32BIT-NEXT: lwz 9, 20(3)
732 ; LE-32BIT-NEXT: lwz 10, 16(3)
733 ; LE-32BIT-NEXT: lwz 11, 24(3)
734 ; LE-32BIT-NEXT: lwz 3, 28(3)
735 ; LE-32BIT-NEXT: stw 11, 24(5)
736 ; LE-32BIT-NEXT: stw 3, 28(5)
737 ; LE-32BIT-NEXT: stw 10, 16(5)
738 ; LE-32BIT-NEXT: stw 9, 20(5)
739 ; LE-32BIT-NEXT: stw 8, 8(5)
740 ; LE-32BIT-NEXT: stw 7, 12(5)
741 ; LE-32BIT-NEXT: stw 6, 0(5)
742 ; LE-32BIT-NEXT: stw 4, 4(5)
743 ; LE-32BIT-NEXT: addi 1, 1, 80
745 %src = load i256, ptr %src.ptr, align 1
746 %byteOff = load i256, ptr %byteOff.ptr, align 1
747 %bitOff = shl i256 %byteOff, 3
748 %res = ashr i256 %src, %bitOff
749 store i256 %res, ptr %dst, align 1
752 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: