1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-apple-ios -aarch64-enable-sink-fold=true -aarch64-redzone | FileCheck %s --check-prefixes=CHECK,CHECK64
3 ; RUN: llc < %s -mtriple=arm64-apple-ios -aarch64-enable-sink-fold=true -aarch64-redzone -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=CHECK,GISEL
4 ; RUN: llc < %s -mtriple=arm64_32-apple-ios -aarch64-enable-sink-fold=true -aarch64-redzone | FileCheck %s --check-prefixes=CHECK,CHECK32
6 define ptr @store64(ptr %ptr, i64 %index, i64 %spacing) {
7 ; CHECK-LABEL: store64:
9 ; CHECK-NEXT: str x2, [x0], #8
11 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 1
12 store i64 %spacing, ptr %ptr, align 4
16 define ptr @store64idxpos256(ptr %ptr, i64 %index, i64 %spacing) {
17 ; CHECK-LABEL: store64idxpos256:
19 ; CHECK-NEXT: mov x8, x0
20 ; CHECK-NEXT: add x0, x0, #256
21 ; CHECK-NEXT: str x2, [x8]
23 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 32
24 store i64 %spacing, ptr %ptr, align 4
28 define ptr @store64idxneg256(ptr %ptr, i64 %index, i64 %spacing) {
29 ; CHECK-LABEL: store64idxneg256:
31 ; CHECK-NEXT: str x2, [x0], #-256
33 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 -32
34 store i64 %spacing, ptr %ptr, align 4
38 define ptr @store32(ptr %ptr, i32 %index, i32 %spacing) {
39 ; CHECK-LABEL: store32:
41 ; CHECK-NEXT: str w2, [x0], #4
43 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 1
44 store i32 %spacing, ptr %ptr, align 4
48 define ptr @store32idxpos256(ptr %ptr, i32 %index, i32 %spacing) {
49 ; CHECK-LABEL: store32idxpos256:
51 ; CHECK-NEXT: mov x8, x0
52 ; CHECK-NEXT: add x0, x0, #256
53 ; CHECK-NEXT: str w2, [x8]
55 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 64
56 store i32 %spacing, ptr %ptr, align 4
60 define ptr @store32idxneg256(ptr %ptr, i32 %index, i32 %spacing) {
61 ; CHECK-LABEL: store32idxneg256:
63 ; CHECK-NEXT: str w2, [x0], #-256
65 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 -64
66 store i32 %spacing, ptr %ptr, align 4
70 define ptr @store16(ptr %ptr, i16 %index, i16 %spacing) {
71 ; CHECK-LABEL: store16:
73 ; CHECK-NEXT: strh w2, [x0], #2
75 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 1
76 store i16 %spacing, ptr %ptr, align 4
80 define ptr @store16idxpos256(ptr %ptr, i16 %index, i16 %spacing) {
81 ; CHECK-LABEL: store16idxpos256:
83 ; CHECK-NEXT: mov x8, x0
84 ; CHECK-NEXT: add x0, x0, #256
85 ; CHECK-NEXT: strh w2, [x8]
87 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 128
88 store i16 %spacing, ptr %ptr, align 4
92 define ptr @store16idxneg256(ptr %ptr, i16 %index, i16 %spacing) {
93 ; CHECK-LABEL: store16idxneg256:
95 ; CHECK-NEXT: strh w2, [x0], #-256
97 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 -128
98 store i16 %spacing, ptr %ptr, align 4
102 define ptr @store8(ptr %ptr, i8 %index, i8 %spacing) {
103 ; CHECK-LABEL: store8:
105 ; CHECK-NEXT: strb w2, [x0], #1
107 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 1
108 store i8 %spacing, ptr %ptr, align 4
112 define ptr @store8idxpos256(ptr %ptr, i8 %index, i8 %spacing) {
113 ; CHECK-LABEL: store8idxpos256:
115 ; CHECK-NEXT: mov x8, x0
116 ; CHECK-NEXT: add x0, x0, #256
117 ; CHECK-NEXT: strb w2, [x8]
119 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 256
120 store i8 %spacing, ptr %ptr, align 4
124 define ptr @store8idxneg256(ptr %ptr, i8 %index, i8 %spacing) {
125 ; CHECK-LABEL: store8idxneg256:
127 ; CHECK-NEXT: strb w2, [x0], #-256
129 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 -256
130 store i8 %spacing, ptr %ptr, align 4
134 define ptr @truncst64to32(ptr %ptr, i32 %index, i64 %spacing) {
135 ; CHECK-LABEL: truncst64to32:
137 ; CHECK-NEXT: str w2, [x0], #4
139 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 1
140 %trunc = trunc i64 %spacing to i32
141 store i32 %trunc, ptr %ptr, align 4
145 define ptr @truncst64to16(ptr %ptr, i16 %index, i64 %spacing) {
146 ; CHECK-LABEL: truncst64to16:
148 ; CHECK-NEXT: strh w2, [x0], #2
150 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 1
151 %trunc = trunc i64 %spacing to i16
152 store i16 %trunc, ptr %ptr, align 4
156 define ptr @truncst64to8(ptr %ptr, i8 %index, i64 %spacing) {
157 ; CHECK-LABEL: truncst64to8:
159 ; CHECK-NEXT: strb w2, [x0], #1
161 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 1
162 %trunc = trunc i64 %spacing to i8
163 store i8 %trunc, ptr %ptr, align 4
168 define ptr @storef16(ptr %ptr, half %index, half %spacing) nounwind {
169 ; CHECK-LABEL: storef16:
171 ; CHECK-NEXT: str h1, [x0], #2
173 %incdec.ptr = getelementptr inbounds half, ptr %ptr, i64 1
174 store half %spacing, ptr %ptr, align 2
178 define ptr @storef32(ptr %ptr, float %index, float %spacing) {
179 ; CHECK-LABEL: storef32:
181 ; CHECK-NEXT: str s1, [x0], #4
183 %incdec.ptr = getelementptr inbounds float, ptr %ptr, i64 1
184 store float %spacing, ptr %ptr, align 4
188 define ptr @storef64(ptr %ptr, double %index, double %spacing) {
189 ; CHECK-LABEL: storef64:
191 ; CHECK-NEXT: str d1, [x0], #8
193 %incdec.ptr = getelementptr inbounds double, ptr %ptr, i64 1
194 store double %spacing, ptr %ptr, align 4
199 define ptr @pref64(ptr %ptr, double %spacing) {
200 ; CHECK-LABEL: pref64:
202 ; CHECK-NEXT: str d0, [x0, #32]!
204 %incdec.ptr = getelementptr inbounds double, ptr %ptr, i64 4
205 store double %spacing, ptr %incdec.ptr, align 4
209 define ptr @pref32(ptr %ptr, float %spacing) {
210 ; CHECK-LABEL: pref32:
212 ; CHECK-NEXT: str s0, [x0, #12]!
214 %incdec.ptr = getelementptr inbounds float, ptr %ptr, i64 3
215 store float %spacing, ptr %incdec.ptr, align 4
219 define ptr @pref16(ptr %ptr, half %spacing) nounwind {
220 ; CHECK-LABEL: pref16:
222 ; CHECK-NEXT: str h0, [x0, #6]!
224 %incdec.ptr = getelementptr inbounds half, ptr %ptr, i64 3
225 store half %spacing, ptr %incdec.ptr, align 2
229 define ptr @pre64(ptr %ptr, i64 %spacing) {
230 ; CHECK-LABEL: pre64:
232 ; CHECK-NEXT: str x1, [x0, #16]!
234 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 2
235 store i64 %spacing, ptr %incdec.ptr, align 4
239 define ptr @pre64idxpos256(ptr %ptr, i64 %spacing) {
240 ; CHECK-LABEL: pre64idxpos256:
242 ; CHECK-NEXT: mov x8, x0
243 ; CHECK-NEXT: add x0, x0, #256
244 ; CHECK-NEXT: str x1, [x8, #256]
246 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 32
247 store i64 %spacing, ptr %incdec.ptr, align 4
251 define ptr @pre64idxneg256(ptr %ptr, i64 %spacing) {
252 ; CHECK-LABEL: pre64idxneg256:
254 ; CHECK-NEXT: str x1, [x0, #-256]!
256 %incdec.ptr = getelementptr inbounds i64, ptr %ptr, i64 -32
257 store i64 %spacing, ptr %incdec.ptr, align 4
261 define ptr @pre32(ptr %ptr, i32 %spacing) {
262 ; CHECK-LABEL: pre32:
264 ; CHECK-NEXT: str w1, [x0, #8]!
266 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 2
267 store i32 %spacing, ptr %incdec.ptr, align 4
271 define ptr @pre32idxpos256(ptr %ptr, i32 %spacing) {
272 ; CHECK-LABEL: pre32idxpos256:
274 ; CHECK-NEXT: mov x8, x0
275 ; CHECK-NEXT: add x0, x0, #256
276 ; CHECK-NEXT: str w1, [x8, #256]
278 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 64
279 store i32 %spacing, ptr %incdec.ptr, align 4
283 define ptr @pre32idxneg256(ptr %ptr, i32 %spacing) {
284 ; CHECK-LABEL: pre32idxneg256:
286 ; CHECK-NEXT: str w1, [x0, #-256]!
288 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 -64
289 store i32 %spacing, ptr %incdec.ptr, align 4
293 define ptr @pre16(ptr %ptr, i16 %spacing) {
294 ; CHECK-LABEL: pre16:
296 ; CHECK-NEXT: strh w1, [x0, #4]!
298 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 2
299 store i16 %spacing, ptr %incdec.ptr, align 4
303 define ptr @pre16idxpos256(ptr %ptr, i16 %spacing) {
304 ; CHECK-LABEL: pre16idxpos256:
306 ; CHECK-NEXT: mov x8, x0
307 ; CHECK-NEXT: add x0, x0, #256
308 ; CHECK-NEXT: strh w1, [x8, #256]
310 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 128
311 store i16 %spacing, ptr %incdec.ptr, align 4
315 define ptr @pre16idxneg256(ptr %ptr, i16 %spacing) {
316 ; CHECK-LABEL: pre16idxneg256:
318 ; CHECK-NEXT: strh w1, [x0, #-256]!
320 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 -128
321 store i16 %spacing, ptr %incdec.ptr, align 4
325 define ptr @pre8(ptr %ptr, i8 %spacing) {
328 ; CHECK-NEXT: strb w1, [x0, #2]!
330 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 2
331 store i8 %spacing, ptr %incdec.ptr, align 4
335 define ptr @pre8idxpos256(ptr %ptr, i8 %spacing) {
336 ; CHECK-LABEL: pre8idxpos256:
338 ; CHECK-NEXT: mov x8, x0
339 ; CHECK-NEXT: add x0, x0, #256
340 ; CHECK-NEXT: strb w1, [x8, #256]
342 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 256
343 store i8 %spacing, ptr %incdec.ptr, align 4
347 define ptr @pre8idxneg256(ptr %ptr, i8 %spacing) {
348 ; CHECK-LABEL: pre8idxneg256:
350 ; CHECK-NEXT: strb w1, [x0, #-256]!
352 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 -256
353 store i8 %spacing, ptr %incdec.ptr, align 4
357 define ptr @pretrunc64to32(ptr %ptr, i64 %spacing) {
358 ; CHECK-LABEL: pretrunc64to32:
360 ; CHECK-NEXT: str w1, [x0, #8]!
362 %incdec.ptr = getelementptr inbounds i32, ptr %ptr, i64 2
363 %trunc = trunc i64 %spacing to i32
364 store i32 %trunc, ptr %incdec.ptr, align 4
368 define ptr @pretrunc64to16(ptr %ptr, i64 %spacing) {
369 ; CHECK-LABEL: pretrunc64to16:
371 ; CHECK-NEXT: strh w1, [x0, #4]!
373 %incdec.ptr = getelementptr inbounds i16, ptr %ptr, i64 2
374 %trunc = trunc i64 %spacing to i16
375 store i16 %trunc, ptr %incdec.ptr, align 4
379 define ptr @pretrunc64to8(ptr %ptr, i64 %spacing) {
380 ; CHECK-LABEL: pretrunc64to8:
382 ; CHECK-NEXT: strb w1, [x0, #2]!
384 %incdec.ptr = getelementptr inbounds i8, ptr %ptr, i64 2
385 %trunc = trunc i64 %spacing to i8
386 store i8 %trunc, ptr %incdec.ptr, align 4
393 define ptr @preidxf64(ptr %src, ptr %out) {
394 ; CHECK-LABEL: preidxf64:
396 ; CHECK-NEXT: ldr d0, [x0, #8]!
397 ; CHECK-NEXT: str d0, [x1]
399 %ptr = getelementptr inbounds double, ptr %src, i64 1
400 %tmp = load double, ptr %ptr, align 4
401 store double %tmp, ptr %out, align 4
405 define ptr @preidxf32(ptr %src, ptr %out) {
406 ; CHECK-LABEL: preidxf32:
408 ; CHECK-NEXT: ldr s0, [x0, #4]!
409 ; CHECK-NEXT: str s0, [x1]
411 %ptr = getelementptr inbounds float, ptr %src, i64 1
412 %tmp = load float, ptr %ptr, align 4
413 store float %tmp, ptr %out, align 4
417 define ptr @preidxf16(ptr %src, ptr %out) {
418 ; CHECK-LABEL: preidxf16:
420 ; CHECK-NEXT: ldr h0, [x0, #2]!
421 ; CHECK-NEXT: str h0, [x1]
423 %ptr = getelementptr inbounds half, ptr %src, i64 1
424 %tmp = load half, ptr %ptr, align 2
425 store half %tmp, ptr %out, align 2
429 define ptr @preidx64(ptr %src, ptr %out) {
430 ; CHECK-LABEL: preidx64:
432 ; CHECK-NEXT: ldr x8, [x0, #8]!
433 ; CHECK-NEXT: str x8, [x1]
435 %ptr = getelementptr inbounds i64, ptr %src, i64 1
436 %tmp = load i64, ptr %ptr, align 4
437 store i64 %tmp, ptr %out, align 4
441 define ptr @preidx32(ptr %src, ptr %out) {
442 ; CHECK-LABEL: preidx32:
444 ; CHECK-NEXT: ldr w8, [x0, #4]!
445 ; CHECK-NEXT: str w8, [x1]
447 %ptr = getelementptr inbounds i32, ptr %src, i64 1
448 %tmp = load i32, ptr %ptr, align 4
449 store i32 %tmp, ptr %out, align 4
453 define ptr @preidx16zext32(ptr %src, ptr %out) {
454 ; CHECK-LABEL: preidx16zext32:
456 ; CHECK-NEXT: ldrh w8, [x0, #2]!
457 ; CHECK-NEXT: str w8, [x1]
459 %ptr = getelementptr inbounds i16, ptr %src, i64 1
460 %tmp = load i16, ptr %ptr, align 4
461 %ext = zext i16 %tmp to i32
462 store i32 %ext, ptr %out, align 4
466 define ptr @preidx16zext64(ptr %src, ptr %out) {
467 ; CHECK-LABEL: preidx16zext64:
469 ; CHECK-NEXT: ldrh w8, [x0, #2]!
470 ; CHECK-NEXT: str x8, [x1]
472 %ptr = getelementptr inbounds i16, ptr %src, i64 1
473 %tmp = load i16, ptr %ptr, align 4
474 %ext = zext i16 %tmp to i64
475 store i64 %ext, ptr %out, align 4
479 define ptr @preidx8zext32(ptr %src, ptr %out) {
480 ; CHECK-LABEL: preidx8zext32:
482 ; CHECK-NEXT: ldrb w8, [x0, #1]!
483 ; CHECK-NEXT: str w8, [x1]
485 %ptr = getelementptr inbounds i8, ptr %src, i64 1
486 %tmp = load i8, ptr %ptr, align 4
487 %ext = zext i8 %tmp to i32
488 store i32 %ext, ptr %out, align 4
492 define ptr @preidx8zext64(ptr %src, ptr %out) {
493 ; CHECK-LABEL: preidx8zext64:
495 ; CHECK-NEXT: ldrb w8, [x0, #1]!
496 ; CHECK-NEXT: str x8, [x1]
498 %ptr = getelementptr inbounds i8, ptr %src, i64 1
499 %tmp = load i8, ptr %ptr, align 4
500 %ext = zext i8 %tmp to i64
501 store i64 %ext, ptr %out, align 4
505 define ptr @preidx32sext64(ptr %src, ptr %out) {
506 ; CHECK-LABEL: preidx32sext64:
508 ; CHECK-NEXT: ldrsw x8, [x0, #4]!
509 ; CHECK-NEXT: str x8, [x1]
511 %ptr = getelementptr inbounds i32, ptr %src, i64 1
512 %tmp = load i32, ptr %ptr, align 4
513 %ext = sext i32 %tmp to i64
514 store i64 %ext, ptr %out, align 8
518 define ptr @preidx16sext32(ptr %src, ptr %out) {
519 ; CHECK-LABEL: preidx16sext32:
521 ; CHECK-NEXT: ldrsh w8, [x0, #2]!
522 ; CHECK-NEXT: str w8, [x1]
524 %ptr = getelementptr inbounds i16, ptr %src, i64 1
525 %tmp = load i16, ptr %ptr, align 4
526 %ext = sext i16 %tmp to i32
527 store i32 %ext, ptr %out, align 4
531 define ptr @preidx16sext64(ptr %src, ptr %out) {
532 ; CHECK-LABEL: preidx16sext64:
534 ; CHECK-NEXT: ldrsh x8, [x0, #2]!
535 ; CHECK-NEXT: str x8, [x1]
537 %ptr = getelementptr inbounds i16, ptr %src, i64 1
538 %tmp = load i16, ptr %ptr, align 4
539 %ext = sext i16 %tmp to i64
540 store i64 %ext, ptr %out, align 4
544 define ptr @preidx8sext32(ptr %src, ptr %out) {
545 ; CHECK-LABEL: preidx8sext32:
547 ; CHECK-NEXT: ldrsb w8, [x0, #1]!
548 ; CHECK-NEXT: str w8, [x1]
550 %ptr = getelementptr inbounds i8, ptr %src, i64 1
551 %tmp = load i8, ptr %ptr, align 4
552 %ext = sext i8 %tmp to i32
553 store i32 %ext, ptr %out, align 4
557 define ptr @preidx8sext64(ptr %src, ptr %out) {
558 ; CHECK-LABEL: preidx8sext64:
560 ; CHECK-NEXT: ldrsb x8, [x0, #1]!
561 ; CHECK-NEXT: str x8, [x1]
563 %ptr = getelementptr inbounds i8, ptr %src, i64 1
564 %tmp = load i8, ptr %ptr, align 4
565 %ext = sext i8 %tmp to i64
566 store i64 %ext, ptr %out, align 4
570 ; This test checks if illegal post-index is generated
572 define ptr @postidx_clobber(ptr %addr) nounwind noinline ssp {
573 ; CHECK64-LABEL: postidx_clobber:
575 ; CHECK64-NEXT: mov x8, x0
576 ; CHECK64-NEXT: str x0, [x8], #8
577 ; CHECK64-NEXT: mov x0, x8
580 ; GISEL-LABEL: postidx_clobber:
582 ; GISEL-NEXT: mov x8, x0
583 ; GISEL-NEXT: str x0, [x8], #8
584 ; GISEL-NEXT: mov x0, x8
587 ; CHECK32-LABEL: postidx_clobber:
589 ; CHECK32-NEXT: mov x8, x0
590 ; CHECK32-NEXT: add w0, w8, #8
591 ; CHECK32-NEXT: str w8, [x8]
594 store ptr %addr, ptr %addr
595 %newaddr = getelementptr i64, ptr %addr, i32 1
599 define ptr @preidx32_sb(ptr %src, ptr %out) {
600 ; CHECK-LABEL: preidx32_sb:
602 ; CHECK-NEXT: ldrsb w8, [x0, #1]!
603 ; CHECK-NEXT: str w8, [x1]
605 %ptr = getelementptr inbounds i8, ptr %src, i64 1
606 %tmp = load i8, ptr %ptr, align 1
607 %sext = sext i8 %tmp to i32
608 store i32 %sext, ptr %out, align 4
612 define ptr @preidx32_sh(ptr %src, ptr %out) {
613 ; CHECK-LABEL: preidx32_sh:
615 ; CHECK-NEXT: ldrsh w8, [x0, #2]!
616 ; CHECK-NEXT: str w8, [x1]
618 %ptr = getelementptr inbounds i16, ptr %src, i64 1
619 %tmp = load i16, ptr %ptr, align 2
620 %sext = sext i16 %tmp to i32
621 store i32 %sext, ptr %out, align 4
625 define ptr @preidx64_sb(ptr %src, ptr %out) {
626 ; CHECK-LABEL: preidx64_sb:
628 ; CHECK-NEXT: ldrsb x8, [x0, #1]!
629 ; CHECK-NEXT: str x8, [x1]
631 %ptr = getelementptr inbounds i8, ptr %src, i64 1
632 %tmp = load i8, ptr %ptr, align 1
633 %sext = sext i8 %tmp to i64
634 store i64 %sext, ptr %out, align 8
638 define ptr @preidx64_sh(ptr %src, ptr %out) {
639 ; CHECK-LABEL: preidx64_sh:
641 ; CHECK-NEXT: ldrsh x8, [x0, #2]!
642 ; CHECK-NEXT: str x8, [x1]
644 %ptr = getelementptr inbounds i16, ptr %src, i64 1
645 %tmp = load i16, ptr %ptr, align 2
646 %sext = sext i16 %tmp to i64
647 store i64 %sext, ptr %out, align 8
651 define ptr @preidx64_sw(ptr %src, ptr %out) {
652 ; CHECK-LABEL: preidx64_sw:
654 ; CHECK-NEXT: ldrsw x8, [x0, #4]!
655 ; CHECK-NEXT: str x8, [x1]
657 %ptr = getelementptr inbounds i32, ptr %src, i64 1
658 %tmp = load i32, ptr %ptr, align 2
659 %sext = sext i32 %tmp to i64
660 store i64 %sext, ptr %out, align 8
664 define ptr @postidx32_sb(ptr %src, ptr %out) {
665 ; CHECK-LABEL: postidx32_sb:
667 ; CHECK-NEXT: ldrsb w8, [x0], #1
668 ; CHECK-NEXT: str w8, [x1]
670 %tmp = load i8, ptr %src, align 1
671 %ptr = getelementptr inbounds i8, ptr %src, i64 1
672 %sext = sext i8 %tmp to i32
673 store i32 %sext, ptr %out, align 4
677 define ptr @postidx32_sh(ptr %src, ptr %out) {
678 ; CHECK-LABEL: postidx32_sh:
680 ; CHECK-NEXT: ldrsh w8, [x0], #2
681 ; CHECK-NEXT: str w8, [x1]
683 %tmp = load i16, ptr %src, align 2
684 %ptr = getelementptr inbounds i16, ptr %src, i64 1
685 %sext = sext i16 %tmp to i32
686 store i32 %sext, ptr %out, align 4
690 define ptr @postidx64_sb(ptr %src, ptr %out) {
691 ; CHECK-LABEL: postidx64_sb:
693 ; CHECK-NEXT: ldrsb x8, [x0], #1
694 ; CHECK-NEXT: str x8, [x1]
696 %tmp = load i8, ptr %src, align 1
697 %ptr = getelementptr inbounds i8, ptr %src, i64 1
698 %sext = sext i8 %tmp to i64
699 store i64 %sext, ptr %out, align 8
703 define ptr @postidx64_sh(ptr %src, ptr %out) {
704 ; CHECK-LABEL: postidx64_sh:
706 ; CHECK-NEXT: ldrsh x8, [x0], #2
707 ; CHECK-NEXT: str x8, [x1]
709 %tmp = load i16, ptr %src, align 2
710 %ptr = getelementptr inbounds i16, ptr %src, i64 1
711 %sext = sext i16 %tmp to i64
712 store i64 %sext, ptr %out, align 8
716 define ptr @postidx64_sw(ptr %src, ptr %out) {
717 ; CHECK-LABEL: postidx64_sw:
719 ; CHECK-NEXT: ldrsw x8, [x0], #4
720 ; CHECK-NEXT: str x8, [x1]
722 %tmp = load i32, ptr %src, align 4
723 %ptr = getelementptr inbounds i32, ptr %src, i64 1
724 %sext = sext i32 %tmp to i64
725 store i64 %sext, ptr %out, align 8