1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv6m-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-T1
3 ; RUN: llc -mtriple=thumbv7m-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-T2
4 ; RUN: llc -mtriple=armv7a-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-ARM
6 define ptr @i32_0(ptr %p, i32 %v) {
9 ; CHECK-NEXT: str r1, [r0]
11 store i32 %v, ptr %p, align 4
15 define ptr @i32_3(ptr %p, i32 %v) {
16 ; CHECK-T1-LABEL: i32_3:
18 ; CHECK-T1-NEXT: movs r2, #3
19 ; CHECK-T1-NEXT: str r1, [r0, r2]
20 ; CHECK-T1-NEXT: adds r0, r0, #3
21 ; CHECK-T1-NEXT: bx lr
23 ; CHECK-T2-LABEL: i32_3:
25 ; CHECK-T2-NEXT: str r1, [r0, #3]!
26 ; CHECK-T2-NEXT: bx lr
28 ; CHECK-ARM-LABEL: i32_3:
30 ; CHECK-ARM-NEXT: str r1, [r0, #3]!
31 ; CHECK-ARM-NEXT: bx lr
32 %o = getelementptr inbounds i8, ptr %p, i32 3
33 store i32 %v, ptr %o, align 4
37 define ptr @i32_4(ptr %p, i32 %v) {
38 ; CHECK-T1-LABEL: i32_4:
40 ; CHECK-T1-NEXT: str r1, [r0, #4]
41 ; CHECK-T1-NEXT: adds r0, r0, #4
42 ; CHECK-T1-NEXT: bx lr
44 ; CHECK-T2-LABEL: i32_4:
46 ; CHECK-T2-NEXT: str r1, [r0, #4]!
47 ; CHECK-T2-NEXT: bx lr
49 ; CHECK-ARM-LABEL: i32_4:
51 ; CHECK-ARM-NEXT: str r1, [r0, #4]!
52 ; CHECK-ARM-NEXT: bx lr
53 %o = getelementptr inbounds i8, ptr %p, i32 4
54 store i32 %v, ptr %o, align 4
58 define ptr @i32_8(ptr %p, i32 %v) {
59 ; CHECK-T1-LABEL: i32_8:
61 ; CHECK-T1-NEXT: str r1, [r0, #8]
62 ; CHECK-T1-NEXT: adds r0, #8
63 ; CHECK-T1-NEXT: bx lr
65 ; CHECK-T2-LABEL: i32_8:
67 ; CHECK-T2-NEXT: str r1, [r0, #8]!
68 ; CHECK-T2-NEXT: bx lr
70 ; CHECK-ARM-LABEL: i32_8:
72 ; CHECK-ARM-NEXT: str r1, [r0, #8]!
73 ; CHECK-ARM-NEXT: bx lr
74 %o = getelementptr inbounds i8, ptr %p, i32 8
75 store i32 %v, ptr %o, align 4
79 define ptr @i32_m1(ptr %p, i32 %v) {
80 ; CHECK-T1-LABEL: i32_m1:
82 ; CHECK-T1-NEXT: subs r0, r0, #1
83 ; CHECK-T1-NEXT: str r1, [r0]
84 ; CHECK-T1-NEXT: bx lr
86 ; CHECK-T2-LABEL: i32_m1:
88 ; CHECK-T2-NEXT: str r1, [r0, #-1]!
89 ; CHECK-T2-NEXT: bx lr
91 ; CHECK-ARM-LABEL: i32_m1:
93 ; CHECK-ARM-NEXT: str r1, [r0, #-1]!
94 ; CHECK-ARM-NEXT: bx lr
95 %o = getelementptr inbounds i8, ptr %p, i32 -1
96 store i32 %v, ptr %o, align 4
100 define ptr @i32_m4(ptr %p, i32 %v) {
101 ; CHECK-T1-LABEL: i32_m4:
103 ; CHECK-T1-NEXT: subs r0, r0, #4
104 ; CHECK-T1-NEXT: str r1, [r0]
105 ; CHECK-T1-NEXT: bx lr
107 ; CHECK-T2-LABEL: i32_m4:
109 ; CHECK-T2-NEXT: str r1, [r0, #-4]!
110 ; CHECK-T2-NEXT: bx lr
112 ; CHECK-ARM-LABEL: i32_m4:
113 ; CHECK-ARM: @ %bb.0:
114 ; CHECK-ARM-NEXT: str r1, [r0, #-4]!
115 ; CHECK-ARM-NEXT: bx lr
116 %o = getelementptr inbounds i8, ptr %p, i32 -4
117 store i32 %v, ptr %o, align 4
121 define ptr @i32_252(ptr %p, i32 %v) {
122 ; CHECK-T1-LABEL: i32_252:
124 ; CHECK-T1-NEXT: movs r2, #252
125 ; CHECK-T1-NEXT: str r1, [r0, r2]
126 ; CHECK-T1-NEXT: adds r0, #252
127 ; CHECK-T1-NEXT: bx lr
129 ; CHECK-T2-LABEL: i32_252:
131 ; CHECK-T2-NEXT: str r1, [r0, #252]!
132 ; CHECK-T2-NEXT: bx lr
134 ; CHECK-ARM-LABEL: i32_252:
135 ; CHECK-ARM: @ %bb.0:
136 ; CHECK-ARM-NEXT: str r1, [r0, #252]!
137 ; CHECK-ARM-NEXT: bx lr
138 %o = getelementptr inbounds i8, ptr %p, i32 252
139 store i32 %v, ptr %o, align 4
143 define ptr @i32_255(ptr %p, i32 %v) {
144 ; CHECK-T1-LABEL: i32_255:
146 ; CHECK-T1-NEXT: movs r2, #255
147 ; CHECK-T1-NEXT: str r1, [r0, r2]
148 ; CHECK-T1-NEXT: adds r0, #255
149 ; CHECK-T1-NEXT: bx lr
151 ; CHECK-T2-LABEL: i32_255:
153 ; CHECK-T2-NEXT: str r1, [r0, #255]!
154 ; CHECK-T2-NEXT: bx lr
156 ; CHECK-ARM-LABEL: i32_255:
157 ; CHECK-ARM: @ %bb.0:
158 ; CHECK-ARM-NEXT: str r1, [r0, #255]!
159 ; CHECK-ARM-NEXT: bx lr
160 %o = getelementptr inbounds i8, ptr %p, i32 255
161 store i32 %v, ptr %o, align 4
165 define ptr @i32_256(ptr %p, i32 %v) {
166 ; CHECK-T1-LABEL: i32_256:
168 ; CHECK-T1-NEXT: movs r2, #1
169 ; CHECK-T1-NEXT: lsls r2, r2, #8
170 ; CHECK-T1-NEXT: str r1, [r0, r2]
171 ; CHECK-T1-NEXT: adds r0, r0, r2
172 ; CHECK-T1-NEXT: bx lr
174 ; CHECK-T2-LABEL: i32_256:
176 ; CHECK-T2-NEXT: str.w r1, [r0, #256]
177 ; CHECK-T2-NEXT: add.w r0, r0, #256
178 ; CHECK-T2-NEXT: bx lr
180 ; CHECK-ARM-LABEL: i32_256:
181 ; CHECK-ARM: @ %bb.0:
182 ; CHECK-ARM-NEXT: str r1, [r0, #256]!
183 ; CHECK-ARM-NEXT: bx lr
184 %o = getelementptr inbounds i8, ptr %p, i32 256
185 store i32 %v, ptr %o, align 4
189 define ptr @i32_m252(ptr %p, i32 %v) {
190 ; CHECK-T1-LABEL: i32_m252:
192 ; CHECK-T1-NEXT: subs r0, #252
193 ; CHECK-T1-NEXT: str r1, [r0]
194 ; CHECK-T1-NEXT: bx lr
196 ; CHECK-T2-LABEL: i32_m252:
198 ; CHECK-T2-NEXT: str r1, [r0, #-252]!
199 ; CHECK-T2-NEXT: bx lr
201 ; CHECK-ARM-LABEL: i32_m252:
202 ; CHECK-ARM: @ %bb.0:
203 ; CHECK-ARM-NEXT: str r1, [r0, #-252]!
204 ; CHECK-ARM-NEXT: bx lr
205 %o = getelementptr inbounds i8, ptr %p, i32 -252
206 store i32 %v, ptr %o, align 4
210 define ptr @i32_m255(ptr %p, i32 %v) {
211 ; CHECK-T1-LABEL: i32_m255:
213 ; CHECK-T1-NEXT: subs r0, #255
214 ; CHECK-T1-NEXT: str r1, [r0]
215 ; CHECK-T1-NEXT: bx lr
217 ; CHECK-T2-LABEL: i32_m255:
219 ; CHECK-T2-NEXT: str r1, [r0, #-255]!
220 ; CHECK-T2-NEXT: bx lr
222 ; CHECK-ARM-LABEL: i32_m255:
223 ; CHECK-ARM: @ %bb.0:
224 ; CHECK-ARM-NEXT: str r1, [r0, #-255]!
225 ; CHECK-ARM-NEXT: bx lr
226 %o = getelementptr inbounds i8, ptr %p, i32 -255
227 store i32 %v, ptr %o, align 4
231 define ptr @i32_m256(ptr %p, i32 %v) {
232 ; CHECK-T1-LABEL: i32_m256:
234 ; CHECK-T1-NEXT: movs r2, #255
235 ; CHECK-T1-NEXT: mvns r2, r2
236 ; CHECK-T1-NEXT: str r1, [r0, r2]
237 ; CHECK-T1-NEXT: adds r0, r0, r2
238 ; CHECK-T1-NEXT: bx lr
240 ; CHECK-T2-LABEL: i32_m256:
242 ; CHECK-T2-NEXT: mvn r2, #255
243 ; CHECK-T2-NEXT: str r1, [r0, r2]
244 ; CHECK-T2-NEXT: sub.w r0, r0, #256
245 ; CHECK-T2-NEXT: bx lr
247 ; CHECK-ARM-LABEL: i32_m256:
248 ; CHECK-ARM: @ %bb.0:
249 ; CHECK-ARM-NEXT: str r1, [r0, #-256]!
250 ; CHECK-ARM-NEXT: bx lr
251 %o = getelementptr inbounds i8, ptr %p, i32 -256
252 store i32 %v, ptr %o, align 4
256 define ptr @i32_4095(ptr %p, i32 %v) {
257 ; CHECK-T1-LABEL: i32_4095:
259 ; CHECK-T1-NEXT: ldr r2, .LCPI12_0
260 ; CHECK-T1-NEXT: str r1, [r0, r2]
261 ; CHECK-T1-NEXT: adds r0, r0, r2
262 ; CHECK-T1-NEXT: bx lr
263 ; CHECK-T1-NEXT: .p2align 2
264 ; CHECK-T1-NEXT: @ %bb.1:
265 ; CHECK-T1-NEXT: .LCPI12_0:
266 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
268 ; CHECK-T2-LABEL: i32_4095:
270 ; CHECK-T2-NEXT: str.w r1, [r0, #4095]
271 ; CHECK-T2-NEXT: addw r0, r0, #4095
272 ; CHECK-T2-NEXT: bx lr
274 ; CHECK-ARM-LABEL: i32_4095:
275 ; CHECK-ARM: @ %bb.0:
276 ; CHECK-ARM-NEXT: str r1, [r0, #4095]!
277 ; CHECK-ARM-NEXT: bx lr
278 %o = getelementptr inbounds i8, ptr %p, i32 4095
279 store i32 %v, ptr %o, align 4
283 define ptr @i32_4096(ptr %p, i32 %v) {
284 ; CHECK-T1-LABEL: i32_4096:
286 ; CHECK-T1-NEXT: movs r2, #1
287 ; CHECK-T1-NEXT: lsls r2, r2, #12
288 ; CHECK-T1-NEXT: str r1, [r0, r2]
289 ; CHECK-T1-NEXT: adds r0, r0, r2
290 ; CHECK-T1-NEXT: bx lr
292 ; CHECK-T2-LABEL: i32_4096:
294 ; CHECK-T2-NEXT: mov.w r2, #4096
295 ; CHECK-T2-NEXT: str r1, [r0, r2]
296 ; CHECK-T2-NEXT: add.w r0, r0, #4096
297 ; CHECK-T2-NEXT: bx lr
299 ; CHECK-ARM-LABEL: i32_4096:
300 ; CHECK-ARM: @ %bb.0:
301 ; CHECK-ARM-NEXT: mov r2, #4096
302 ; CHECK-ARM-NEXT: str r1, [r0, r2]!
303 ; CHECK-ARM-NEXT: bx lr
304 %o = getelementptr inbounds i8, ptr %p, i32 4096
305 store i32 %v, ptr %o, align 4
309 define ptr @i32_m4095(ptr %p, i32 %v) {
310 ; CHECK-T1-LABEL: i32_m4095:
312 ; CHECK-T1-NEXT: ldr r2, .LCPI14_0
313 ; CHECK-T1-NEXT: str r1, [r0, r2]
314 ; CHECK-T1-NEXT: adds r0, r0, r2
315 ; CHECK-T1-NEXT: bx lr
316 ; CHECK-T1-NEXT: .p2align 2
317 ; CHECK-T1-NEXT: @ %bb.1:
318 ; CHECK-T1-NEXT: .LCPI14_0:
319 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
321 ; CHECK-T2-LABEL: i32_m4095:
323 ; CHECK-T2-NEXT: movw r2, #61441
324 ; CHECK-T2-NEXT: movt r2, #65535
325 ; CHECK-T2-NEXT: str r1, [r0, r2]
326 ; CHECK-T2-NEXT: subw r0, r0, #4095
327 ; CHECK-T2-NEXT: bx lr
329 ; CHECK-ARM-LABEL: i32_m4095:
330 ; CHECK-ARM: @ %bb.0:
331 ; CHECK-ARM-NEXT: str r1, [r0, #-4095]!
332 ; CHECK-ARM-NEXT: bx lr
333 %o = getelementptr inbounds i8, ptr %p, i32 -4095
334 store i32 %v, ptr %o, align 4
338 define ptr @i32_m4096(ptr %p, i32 %v) {
339 ; CHECK-T1-LABEL: i32_m4096:
341 ; CHECK-T1-NEXT: ldr r2, .LCPI15_0
342 ; CHECK-T1-NEXT: str r1, [r0, r2]
343 ; CHECK-T1-NEXT: adds r0, r0, r2
344 ; CHECK-T1-NEXT: bx lr
345 ; CHECK-T1-NEXT: .p2align 2
346 ; CHECK-T1-NEXT: @ %bb.1:
347 ; CHECK-T1-NEXT: .LCPI15_0:
348 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
350 ; CHECK-T2-LABEL: i32_m4096:
352 ; CHECK-T2-NEXT: movw r2, #61440
353 ; CHECK-T2-NEXT: movt r2, #65535
354 ; CHECK-T2-NEXT: str r1, [r0, r2]
355 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
356 ; CHECK-T2-NEXT: bx lr
358 ; CHECK-ARM-LABEL: i32_m4096:
359 ; CHECK-ARM: @ %bb.0:
360 ; CHECK-ARM-NEXT: movw r2, #61440
361 ; CHECK-ARM-NEXT: movt r2, #65535
362 ; CHECK-ARM-NEXT: str r1, [r0, r2]!
363 ; CHECK-ARM-NEXT: bx lr
364 %o = getelementptr inbounds i8, ptr %p, i32 -4096
365 store i32 %v, ptr %o, align 4
369 define ptr @i64_0(ptr %p, i64 %v) {
370 ; CHECK-T1-LABEL: i64_0:
372 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
373 ; CHECK-T1-NEXT: subs r0, #8
374 ; CHECK-T1-NEXT: bx lr
376 ; CHECK-T2-LABEL: i64_0:
378 ; CHECK-T2-NEXT: strd r2, r3, [r0]
379 ; CHECK-T2-NEXT: bx lr
381 ; CHECK-ARM-LABEL: i64_0:
382 ; CHECK-ARM: @ %bb.0:
383 ; CHECK-ARM-NEXT: mov r1, r3
384 ; CHECK-ARM-NEXT: str r2, [r0]
385 ; CHECK-ARM-NEXT: str r1, [r0, #4]
386 ; CHECK-ARM-NEXT: bx lr
387 store i64 %v, ptr %p, align 8
391 define ptr @i64_3(ptr %p, i64 %v) {
392 ; CHECK-T1-LABEL: i64_3:
394 ; CHECK-T1-NEXT: movs r1, #3
395 ; CHECK-T1-NEXT: str r2, [r0, r1]
396 ; CHECK-T1-NEXT: adds r0, r0, #3
397 ; CHECK-T1-NEXT: str r3, [r0, #4]
398 ; CHECK-T1-NEXT: bx lr
400 ; CHECK-T2-LABEL: i64_3:
402 ; CHECK-T2-NEXT: str r2, [r0, #3]!
403 ; CHECK-T2-NEXT: str r3, [r0, #4]
404 ; CHECK-T2-NEXT: bx lr
406 ; CHECK-ARM-LABEL: i64_3:
407 ; CHECK-ARM: @ %bb.0:
408 ; CHECK-ARM-NEXT: str r2, [r0, #3]!
409 ; CHECK-ARM-NEXT: str r3, [r0, #4]
410 ; CHECK-ARM-NEXT: bx lr
411 %o = getelementptr inbounds i8, ptr %p, i32 3
412 store i64 %v, ptr %o, align 8
416 define ptr @i64_4(ptr %p, i64 %v) {
417 ; CHECK-T1-LABEL: i64_4:
419 ; CHECK-T1-NEXT: str r2, [r0, #4]
420 ; CHECK-T1-NEXT: str r3, [r0, #8]
421 ; CHECK-T1-NEXT: adds r0, r0, #4
422 ; CHECK-T1-NEXT: bx lr
424 ; CHECK-T2-LABEL: i64_4:
426 ; CHECK-T2-NEXT: str r2, [r0, #4]!
427 ; CHECK-T2-NEXT: str r3, [r0, #4]
428 ; CHECK-T2-NEXT: bx lr
430 ; CHECK-ARM-LABEL: i64_4:
431 ; CHECK-ARM: @ %bb.0:
432 ; CHECK-ARM-NEXT: str r2, [r0, #4]!
433 ; CHECK-ARM-NEXT: str r3, [r0, #4]
434 ; CHECK-ARM-NEXT: bx lr
435 %o = getelementptr inbounds i8, ptr %p, i32 4
436 store i64 %v, ptr %o, align 8
440 define ptr @i64_8(ptr %p, i64 %v) {
441 ; CHECK-T1-LABEL: i64_8:
443 ; CHECK-T1-NEXT: str r2, [r0, #8]
444 ; CHECK-T1-NEXT: str r3, [r0, #12]
445 ; CHECK-T1-NEXT: adds r0, #8
446 ; CHECK-T1-NEXT: bx lr
448 ; CHECK-T2-LABEL: i64_8:
450 ; CHECK-T2-NEXT: str r2, [r0, #8]!
451 ; CHECK-T2-NEXT: str r3, [r0, #4]
452 ; CHECK-T2-NEXT: bx lr
454 ; CHECK-ARM-LABEL: i64_8:
455 ; CHECK-ARM: @ %bb.0:
456 ; CHECK-ARM-NEXT: str r2, [r0, #8]!
457 ; CHECK-ARM-NEXT: str r3, [r0, #4]
458 ; CHECK-ARM-NEXT: bx lr
459 %o = getelementptr inbounds i8, ptr %p, i32 8
460 store i64 %v, ptr %o, align 8
464 define ptr @i64_m1(ptr %p, i64 %v) {
465 ; CHECK-T1-LABEL: i64_m1:
467 ; CHECK-T1-NEXT: subs r0, r0, #1
468 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
469 ; CHECK-T1-NEXT: subs r0, #8
470 ; CHECK-T1-NEXT: bx lr
472 ; CHECK-T2-LABEL: i64_m1:
474 ; CHECK-T2-NEXT: str r2, [r0, #-1]!
475 ; CHECK-T2-NEXT: str r3, [r0, #4]
476 ; CHECK-T2-NEXT: bx lr
478 ; CHECK-ARM-LABEL: i64_m1:
479 ; CHECK-ARM: @ %bb.0:
480 ; CHECK-ARM-NEXT: str r2, [r0, #-1]!
481 ; CHECK-ARM-NEXT: str r3, [r0, #4]
482 ; CHECK-ARM-NEXT: bx lr
483 %o = getelementptr inbounds i8, ptr %p, i32 -1
484 store i64 %v, ptr %o, align 8
488 define ptr @i64_m4(ptr %p, i64 %v) {
489 ; CHECK-T1-LABEL: i64_m4:
491 ; CHECK-T1-NEXT: str r3, [r0]
492 ; CHECK-T1-NEXT: subs r0, r0, #4
493 ; CHECK-T1-NEXT: str r2, [r0]
494 ; CHECK-T1-NEXT: bx lr
496 ; CHECK-T2-LABEL: i64_m4:
498 ; CHECK-T2-NEXT: str r3, [r0]
499 ; CHECK-T2-NEXT: str r2, [r0, #-4]!
500 ; CHECK-T2-NEXT: bx lr
502 ; CHECK-ARM-LABEL: i64_m4:
503 ; CHECK-ARM: @ %bb.0:
504 ; CHECK-ARM-NEXT: str r3, [r0]
505 ; CHECK-ARM-NEXT: str r2, [r0, #-4]!
506 ; CHECK-ARM-NEXT: bx lr
507 %o = getelementptr inbounds i8, ptr %p, i32 -4
508 store i64 %v, ptr %o, align 8
512 define ptr @i64_252(ptr %p, i64 %v) {
513 ; CHECK-T1-LABEL: i64_252:
515 ; CHECK-T1-NEXT: movs r1, #252
516 ; CHECK-T1-NEXT: str r2, [r0, r1]
517 ; CHECK-T1-NEXT: adds r0, #252
518 ; CHECK-T1-NEXT: str r3, [r0, #4]
519 ; CHECK-T1-NEXT: bx lr
521 ; CHECK-T2-LABEL: i64_252:
523 ; CHECK-T2-NEXT: str r2, [r0, #252]!
524 ; CHECK-T2-NEXT: str r3, [r0, #4]
525 ; CHECK-T2-NEXT: bx lr
527 ; CHECK-ARM-LABEL: i64_252:
528 ; CHECK-ARM: @ %bb.0:
529 ; CHECK-ARM-NEXT: str r2, [r0, #252]!
530 ; CHECK-ARM-NEXT: str r3, [r0, #4]
531 ; CHECK-ARM-NEXT: bx lr
532 %o = getelementptr inbounds i8, ptr %p, i32 252
533 store i64 %v, ptr %o, align 8
537 define ptr @i64_255(ptr %p, i64 %v) {
538 ; CHECK-T1-LABEL: i64_255:
540 ; CHECK-T1-NEXT: movs r1, #255
541 ; CHECK-T1-NEXT: str r2, [r0, r1]
542 ; CHECK-T1-NEXT: adds r0, #255
543 ; CHECK-T1-NEXT: str r3, [r0, #4]
544 ; CHECK-T1-NEXT: bx lr
546 ; CHECK-T2-LABEL: i64_255:
548 ; CHECK-T2-NEXT: str r2, [r0, #255]!
549 ; CHECK-T2-NEXT: str r3, [r0, #4]
550 ; CHECK-T2-NEXT: bx lr
552 ; CHECK-ARM-LABEL: i64_255:
553 ; CHECK-ARM: @ %bb.0:
554 ; CHECK-ARM-NEXT: str r2, [r0, #255]!
555 ; CHECK-ARM-NEXT: str r3, [r0, #4]
556 ; CHECK-ARM-NEXT: bx lr
557 %o = getelementptr inbounds i8, ptr %p, i32 255
558 store i64 %v, ptr %o, align 8
562 define ptr @i64_256(ptr %p, i64 %v) {
563 ; CHECK-T1-LABEL: i64_256:
565 ; CHECK-T1-NEXT: movs r1, #1
566 ; CHECK-T1-NEXT: lsls r1, r1, #8
567 ; CHECK-T1-NEXT: str r2, [r0, r1]
568 ; CHECK-T1-NEXT: adds r0, r0, r1
569 ; CHECK-T1-NEXT: str r3, [r0, #4]
570 ; CHECK-T1-NEXT: bx lr
572 ; CHECK-T2-LABEL: i64_256:
574 ; CHECK-T2-NEXT: strd r2, r3, [r0, #256]
575 ; CHECK-T2-NEXT: add.w r0, r0, #256
576 ; CHECK-T2-NEXT: bx lr
578 ; CHECK-ARM-LABEL: i64_256:
579 ; CHECK-ARM: @ %bb.0:
580 ; CHECK-ARM-NEXT: str r2, [r0, #256]!
581 ; CHECK-ARM-NEXT: str r3, [r0, #4]
582 ; CHECK-ARM-NEXT: bx lr
583 %o = getelementptr inbounds i8, ptr %p, i32 256
584 store i64 %v, ptr %o, align 8
588 define ptr @i64_m252(ptr %p, i64 %v) {
589 ; CHECK-T1-LABEL: i64_m252:
591 ; CHECK-T1-NEXT: subs r0, #252
592 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
593 ; CHECK-T1-NEXT: subs r0, #8
594 ; CHECK-T1-NEXT: bx lr
596 ; CHECK-T2-LABEL: i64_m252:
598 ; CHECK-T2-NEXT: str r2, [r0, #-252]!
599 ; CHECK-T2-NEXT: str r3, [r0, #4]
600 ; CHECK-T2-NEXT: bx lr
602 ; CHECK-ARM-LABEL: i64_m252:
603 ; CHECK-ARM: @ %bb.0:
604 ; CHECK-ARM-NEXT: str r2, [r0, #-252]!
605 ; CHECK-ARM-NEXT: str r3, [r0, #4]
606 ; CHECK-ARM-NEXT: bx lr
607 %o = getelementptr inbounds i8, ptr %p, i32 -252
608 store i64 %v, ptr %o, align 8
612 define ptr @i64_m255(ptr %p, i64 %v) {
613 ; CHECK-T1-LABEL: i64_m255:
615 ; CHECK-T1-NEXT: subs r0, #255
616 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
617 ; CHECK-T1-NEXT: subs r0, #8
618 ; CHECK-T1-NEXT: bx lr
620 ; CHECK-T2-LABEL: i64_m255:
622 ; CHECK-T2-NEXT: str r2, [r0, #-255]!
623 ; CHECK-T2-NEXT: str r3, [r0, #4]
624 ; CHECK-T2-NEXT: bx lr
626 ; CHECK-ARM-LABEL: i64_m255:
627 ; CHECK-ARM: @ %bb.0:
628 ; CHECK-ARM-NEXT: str r2, [r0, #-255]!
629 ; CHECK-ARM-NEXT: str r3, [r0, #4]
630 ; CHECK-ARM-NEXT: bx lr
631 %o = getelementptr inbounds i8, ptr %p, i32 -255
632 store i64 %v, ptr %o, align 8
636 define ptr @i64_m256(ptr %p, i64 %v) {
637 ; CHECK-T1-LABEL: i64_m256:
639 ; CHECK-T1-NEXT: movs r1, #255
640 ; CHECK-T1-NEXT: mvns r1, r1
641 ; CHECK-T1-NEXT: str r2, [r0, r1]
642 ; CHECK-T1-NEXT: adds r0, r0, r1
643 ; CHECK-T1-NEXT: str r3, [r0, #4]
644 ; CHECK-T1-NEXT: bx lr
646 ; CHECK-T2-LABEL: i64_m256:
648 ; CHECK-T2-NEXT: mvn r1, #255
649 ; CHECK-T2-NEXT: str r3, [r0, #-252]
650 ; CHECK-T2-NEXT: str r2, [r0, r1]
651 ; CHECK-T2-NEXT: sub.w r0, r0, #256
652 ; CHECK-T2-NEXT: bx lr
654 ; CHECK-ARM-LABEL: i64_m256:
655 ; CHECK-ARM: @ %bb.0:
656 ; CHECK-ARM-NEXT: str r2, [r0, #-256]!
657 ; CHECK-ARM-NEXT: str r3, [r0, #4]
658 ; CHECK-ARM-NEXT: bx lr
659 %o = getelementptr inbounds i8, ptr %p, i32 -256
660 store i64 %v, ptr %o, align 8
664 define ptr @i64_4095(ptr %p, i64 %v) {
665 ; CHECK-T1-LABEL: i64_4095:
667 ; CHECK-T1-NEXT: ldr r1, .LCPI28_0
668 ; CHECK-T1-NEXT: str r2, [r0, r1]
669 ; CHECK-T1-NEXT: adds r0, r0, r1
670 ; CHECK-T1-NEXT: str r3, [r0, #4]
671 ; CHECK-T1-NEXT: bx lr
672 ; CHECK-T1-NEXT: .p2align 2
673 ; CHECK-T1-NEXT: @ %bb.1:
674 ; CHECK-T1-NEXT: .LCPI28_0:
675 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
677 ; CHECK-T2-LABEL: i64_4095:
679 ; CHECK-T2-NEXT: str.w r2, [r0, #4095]
680 ; CHECK-T2-NEXT: addw r0, r0, #4095
681 ; CHECK-T2-NEXT: str r3, [r0, #4]
682 ; CHECK-T2-NEXT: bx lr
684 ; CHECK-ARM-LABEL: i64_4095:
685 ; CHECK-ARM: @ %bb.0:
686 ; CHECK-ARM-NEXT: str r2, [r0, #4095]!
687 ; CHECK-ARM-NEXT: str r3, [r0, #4]
688 ; CHECK-ARM-NEXT: bx lr
689 %o = getelementptr inbounds i8, ptr %p, i32 4095
690 store i64 %v, ptr %o, align 8
694 define ptr @i64_4096(ptr %p, i64 %v) {
695 ; CHECK-T1-LABEL: i64_4096:
697 ; CHECK-T1-NEXT: movs r1, #1
698 ; CHECK-T1-NEXT: lsls r1, r1, #12
699 ; CHECK-T1-NEXT: str r2, [r0, r1]
700 ; CHECK-T1-NEXT: adds r0, r0, r1
701 ; CHECK-T1-NEXT: str r3, [r0, #4]
702 ; CHECK-T1-NEXT: bx lr
704 ; CHECK-T2-LABEL: i64_4096:
706 ; CHECK-T2-NEXT: mov.w r1, #4096
707 ; CHECK-T2-NEXT: str r2, [r0, r1]
708 ; CHECK-T2-NEXT: add.w r0, r0, #4096
709 ; CHECK-T2-NEXT: str r3, [r0, #4]
710 ; CHECK-T2-NEXT: bx lr
712 ; CHECK-ARM-LABEL: i64_4096:
713 ; CHECK-ARM: @ %bb.0:
714 ; CHECK-ARM-NEXT: mov r1, #4096
715 ; CHECK-ARM-NEXT: str r2, [r0, r1]!
716 ; CHECK-ARM-NEXT: str r3, [r0, #4]
717 ; CHECK-ARM-NEXT: bx lr
718 %o = getelementptr inbounds i8, ptr %p, i32 4096
719 store i64 %v, ptr %o, align 8
723 define ptr @i64_m4095(ptr %p, i64 %v) {
724 ; CHECK-T1-LABEL: i64_m4095:
726 ; CHECK-T1-NEXT: ldr r1, .LCPI30_0
727 ; CHECK-T1-NEXT: str r2, [r0, r1]
728 ; CHECK-T1-NEXT: adds r0, r0, r1
729 ; CHECK-T1-NEXT: str r3, [r0, #4]
730 ; CHECK-T1-NEXT: bx lr
731 ; CHECK-T1-NEXT: .p2align 2
732 ; CHECK-T1-NEXT: @ %bb.1:
733 ; CHECK-T1-NEXT: .LCPI30_0:
734 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
736 ; CHECK-T2-LABEL: i64_m4095:
738 ; CHECK-T2-NEXT: movw r1, #61441
739 ; CHECK-T2-NEXT: movt r1, #65535
740 ; CHECK-T2-NEXT: str r2, [r0, r1]
741 ; CHECK-T2-NEXT: subw r0, r0, #4095
742 ; CHECK-T2-NEXT: str r3, [r0, #4]
743 ; CHECK-T2-NEXT: bx lr
745 ; CHECK-ARM-LABEL: i64_m4095:
746 ; CHECK-ARM: @ %bb.0:
747 ; CHECK-ARM-NEXT: str r2, [r0, #-4095]!
748 ; CHECK-ARM-NEXT: str r3, [r0, #4]
749 ; CHECK-ARM-NEXT: bx lr
750 %o = getelementptr inbounds i8, ptr %p, i32 -4095
751 store i64 %v, ptr %o, align 8
755 define ptr @i64_m4096(ptr %p, i64 %v) {
756 ; CHECK-T1-LABEL: i64_m4096:
758 ; CHECK-T1-NEXT: ldr r1, .LCPI31_0
759 ; CHECK-T1-NEXT: str r2, [r0, r1]
760 ; CHECK-T1-NEXT: adds r0, r0, r1
761 ; CHECK-T1-NEXT: str r3, [r0, #4]
762 ; CHECK-T1-NEXT: bx lr
763 ; CHECK-T1-NEXT: .p2align 2
764 ; CHECK-T1-NEXT: @ %bb.1:
765 ; CHECK-T1-NEXT: .LCPI31_0:
766 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
768 ; CHECK-T2-LABEL: i64_m4096:
770 ; CHECK-T2-NEXT: movw r1, #61440
771 ; CHECK-T2-NEXT: movt r1, #65535
772 ; CHECK-T2-NEXT: str r2, [r0, r1]
773 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
774 ; CHECK-T2-NEXT: str r3, [r0, #4]
775 ; CHECK-T2-NEXT: bx lr
777 ; CHECK-ARM-LABEL: i64_m4096:
778 ; CHECK-ARM: @ %bb.0:
779 ; CHECK-ARM-NEXT: movw r1, #61440
780 ; CHECK-ARM-NEXT: movt r1, #65535
781 ; CHECK-ARM-NEXT: str r2, [r0, r1]!
782 ; CHECK-ARM-NEXT: str r3, [r0, #4]
783 ; CHECK-ARM-NEXT: bx lr
784 %o = getelementptr inbounds i8, ptr %p, i32 -4096
785 store i64 %v, ptr %o, align 8
789 define ptr @i128_0(ptr %p, i128 %v) {
790 ; CHECK-T1-LABEL: i128_0:
792 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
793 ; CHECK-T1-NEXT: str r1, [r0, #12]
794 ; CHECK-T1-NEXT: ldr r1, [sp]
795 ; CHECK-T1-NEXT: str r1, [r0, #8]
796 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
797 ; CHECK-T1-NEXT: subs r0, #8
798 ; CHECK-T1-NEXT: bx lr
800 ; CHECK-T2-LABEL: i128_0:
802 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
803 ; CHECK-T2-NEXT: str r1, [r0, #12]
804 ; CHECK-T2-NEXT: ldr r1, [sp]
805 ; CHECK-T2-NEXT: str r1, [r0, #8]
806 ; CHECK-T2-NEXT: strd r2, r3, [r0]
807 ; CHECK-T2-NEXT: bx lr
809 ; CHECK-ARM-LABEL: i128_0:
810 ; CHECK-ARM: @ %bb.0:
811 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
812 ; CHECK-ARM-NEXT: stm r0, {r2, r3}
813 ; CHECK-ARM-NEXT: str r1, [r0, #8]
814 ; CHECK-ARM-NEXT: str r12, [r0, #12]
815 ; CHECK-ARM-NEXT: bx lr
816 store i128 %v, ptr %p, align 16
820 define ptr @i128_3(ptr %p, i128 %v) {
821 ; CHECK-T1-LABEL: i128_3:
823 ; CHECK-T1-NEXT: movs r1, #3
824 ; CHECK-T1-NEXT: str r2, [r0, r1]
825 ; CHECK-T1-NEXT: adds r0, r0, #3
826 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
827 ; CHECK-T1-NEXT: str r1, [r0, #12]
828 ; CHECK-T1-NEXT: ldr r1, [sp]
829 ; CHECK-T1-NEXT: str r1, [r0, #8]
830 ; CHECK-T1-NEXT: str r3, [r0, #4]
831 ; CHECK-T1-NEXT: bx lr
833 ; CHECK-T2-LABEL: i128_3:
835 ; CHECK-T2-NEXT: str r2, [r0, #3]!
836 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
837 ; CHECK-T2-NEXT: str r1, [r0, #12]
838 ; CHECK-T2-NEXT: ldr r1, [sp]
839 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
840 ; CHECK-T2-NEXT: bx lr
842 ; CHECK-ARM-LABEL: i128_3:
843 ; CHECK-ARM: @ %bb.0:
844 ; CHECK-ARM-NEXT: str r2, [r0, #3]!
845 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
846 ; CHECK-ARM-NEXT: str r3, [r0, #4]
847 ; CHECK-ARM-NEXT: str r1, [r0, #8]
848 ; CHECK-ARM-NEXT: str r12, [r0, #12]
849 ; CHECK-ARM-NEXT: bx lr
850 %o = getelementptr inbounds i8, ptr %p, i32 3
851 store i128 %v, ptr %o, align 16
855 define ptr @i128_4(ptr %p, i128 %v) {
856 ; CHECK-T1-LABEL: i128_4:
858 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
859 ; CHECK-T1-NEXT: str r1, [r0, #16]
860 ; CHECK-T1-NEXT: ldr r1, [sp]
861 ; CHECK-T1-NEXT: str r1, [r0, #12]
862 ; CHECK-T1-NEXT: str r3, [r0, #8]
863 ; CHECK-T1-NEXT: str r2, [r0, #4]
864 ; CHECK-T1-NEXT: adds r0, r0, #4
865 ; CHECK-T1-NEXT: bx lr
867 ; CHECK-T2-LABEL: i128_4:
869 ; CHECK-T2-NEXT: str r2, [r0, #4]!
870 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
871 ; CHECK-T2-NEXT: str r1, [r0, #12]
872 ; CHECK-T2-NEXT: ldr r1, [sp]
873 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
874 ; CHECK-T2-NEXT: bx lr
876 ; CHECK-ARM-LABEL: i128_4:
877 ; CHECK-ARM: @ %bb.0:
878 ; CHECK-ARM-NEXT: str r2, [r0, #4]!
879 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
880 ; CHECK-ARM-NEXT: str r3, [r0, #4]
881 ; CHECK-ARM-NEXT: str r1, [r0, #8]
882 ; CHECK-ARM-NEXT: str r12, [r0, #12]
883 ; CHECK-ARM-NEXT: bx lr
884 %o = getelementptr inbounds i8, ptr %p, i32 4
885 store i128 %v, ptr %o, align 16
889 define ptr @i128_8(ptr %p, i128 %v) {
890 ; CHECK-T1-LABEL: i128_8:
892 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
893 ; CHECK-T1-NEXT: str r1, [r0, #20]
894 ; CHECK-T1-NEXT: ldr r1, [sp]
895 ; CHECK-T1-NEXT: str r1, [r0, #16]
896 ; CHECK-T1-NEXT: str r3, [r0, #12]
897 ; CHECK-T1-NEXT: str r2, [r0, #8]
898 ; CHECK-T1-NEXT: adds r0, #8
899 ; CHECK-T1-NEXT: bx lr
901 ; CHECK-T2-LABEL: i128_8:
903 ; CHECK-T2-NEXT: str r2, [r0, #8]!
904 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
905 ; CHECK-T2-NEXT: str r1, [r0, #12]
906 ; CHECK-T2-NEXT: ldr r1, [sp]
907 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
908 ; CHECK-T2-NEXT: bx lr
910 ; CHECK-ARM-LABEL: i128_8:
911 ; CHECK-ARM: @ %bb.0:
912 ; CHECK-ARM-NEXT: str r2, [r0, #8]!
913 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
914 ; CHECK-ARM-NEXT: str r3, [r0, #4]
915 ; CHECK-ARM-NEXT: str r1, [r0, #8]
916 ; CHECK-ARM-NEXT: str r12, [r0, #12]
917 ; CHECK-ARM-NEXT: bx lr
918 %o = getelementptr inbounds i8, ptr %p, i32 8
919 store i128 %v, ptr %o, align 16
923 define ptr @i128_16(ptr %p, i128 %v) {
924 ; CHECK-T1-LABEL: i128_16:
926 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
927 ; CHECK-T1-NEXT: str r1, [r0, #28]
928 ; CHECK-T1-NEXT: ldr r1, [sp]
929 ; CHECK-T1-NEXT: str r1, [r0, #24]
930 ; CHECK-T1-NEXT: str r3, [r0, #20]
931 ; CHECK-T1-NEXT: str r2, [r0, #16]
932 ; CHECK-T1-NEXT: adds r0, #16
933 ; CHECK-T1-NEXT: bx lr
935 ; CHECK-T2-LABEL: i128_16:
937 ; CHECK-T2-NEXT: str r2, [r0, #16]!
938 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
939 ; CHECK-T2-NEXT: str r1, [r0, #12]
940 ; CHECK-T2-NEXT: ldr r1, [sp]
941 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
942 ; CHECK-T2-NEXT: bx lr
944 ; CHECK-ARM-LABEL: i128_16:
945 ; CHECK-ARM: @ %bb.0:
946 ; CHECK-ARM-NEXT: str r2, [r0, #16]!
947 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
948 ; CHECK-ARM-NEXT: str r3, [r0, #4]
949 ; CHECK-ARM-NEXT: str r1, [r0, #8]
950 ; CHECK-ARM-NEXT: str r12, [r0, #12]
951 ; CHECK-ARM-NEXT: bx lr
952 %o = getelementptr inbounds i8, ptr %p, i32 16
953 store i128 %v, ptr %o, align 16
957 define ptr @i128_m1(ptr %p, i128 %v) {
958 ; CHECK-T1-LABEL: i128_m1:
960 ; CHECK-T1-NEXT: subs r0, r0, #1
961 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
962 ; CHECK-T1-NEXT: str r1, [r0, #12]
963 ; CHECK-T1-NEXT: ldr r1, [sp]
964 ; CHECK-T1-NEXT: str r1, [r0, #8]
965 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
966 ; CHECK-T1-NEXT: subs r0, #8
967 ; CHECK-T1-NEXT: bx lr
969 ; CHECK-T2-LABEL: i128_m1:
971 ; CHECK-T2-NEXT: str r2, [r0, #-1]!
972 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
973 ; CHECK-T2-NEXT: str r1, [r0, #12]
974 ; CHECK-T2-NEXT: ldr r1, [sp]
975 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
976 ; CHECK-T2-NEXT: bx lr
978 ; CHECK-ARM-LABEL: i128_m1:
979 ; CHECK-ARM: @ %bb.0:
980 ; CHECK-ARM-NEXT: str r2, [r0, #-1]!
981 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
982 ; CHECK-ARM-NEXT: str r3, [r0, #4]
983 ; CHECK-ARM-NEXT: str r1, [r0, #8]
984 ; CHECK-ARM-NEXT: str r12, [r0, #12]
985 ; CHECK-ARM-NEXT: bx lr
986 %o = getelementptr inbounds i8, ptr %p, i32 -1
987 store i128 %v, ptr %o, align 16
991 define ptr @i128_m4(ptr %p, i128 %v) {
992 ; CHECK-T1-LABEL: i128_m4:
994 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
995 ; CHECK-T1-NEXT: str r1, [r0, #8]
996 ; CHECK-T1-NEXT: ldr r1, [sp]
997 ; CHECK-T1-NEXT: str r1, [r0, #4]
998 ; CHECK-T1-NEXT: str r3, [r0]
999 ; CHECK-T1-NEXT: subs r0, r0, #4
1000 ; CHECK-T1-NEXT: str r2, [r0]
1001 ; CHECK-T1-NEXT: bx lr
1003 ; CHECK-T2-LABEL: i128_m4:
1004 ; CHECK-T2: @ %bb.0:
1005 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
1006 ; CHECK-T2-NEXT: str r1, [r0, #8]
1007 ; CHECK-T2-NEXT: ldr r1, [sp]
1008 ; CHECK-T2-NEXT: strd r3, r1, [r0]
1009 ; CHECK-T2-NEXT: str r2, [r0, #-4]!
1010 ; CHECK-T2-NEXT: bx lr
1012 ; CHECK-ARM-LABEL: i128_m4:
1013 ; CHECK-ARM: @ %bb.0:
1014 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
1015 ; CHECK-ARM-NEXT: str r3, [r0]
1016 ; CHECK-ARM-NEXT: stmib r0, {r1, r12}
1017 ; CHECK-ARM-NEXT: str r2, [r0, #-4]!
1018 ; CHECK-ARM-NEXT: bx lr
1019 %o = getelementptr inbounds i8, ptr %p, i32 -4
1020 store i128 %v, ptr %o, align 16
1026 define ptr @i16_0(ptr %p, i16 %v) {
1027 ; CHECK-LABEL: i16_0:
1029 ; CHECK-NEXT: strh r1, [r0]
1031 store i16 %v, ptr %p, align 2
1035 define ptr @i16_3(ptr %p, i16 %v) {
1036 ; CHECK-T1-LABEL: i16_3:
1037 ; CHECK-T1: @ %bb.0:
1038 ; CHECK-T1-NEXT: movs r2, #3
1039 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1040 ; CHECK-T1-NEXT: adds r0, r0, #3
1041 ; CHECK-T1-NEXT: bx lr
1043 ; CHECK-T2-LABEL: i16_3:
1044 ; CHECK-T2: @ %bb.0:
1045 ; CHECK-T2-NEXT: strh r1, [r0, #3]!
1046 ; CHECK-T2-NEXT: bx lr
1048 ; CHECK-ARM-LABEL: i16_3:
1049 ; CHECK-ARM: @ %bb.0:
1050 ; CHECK-ARM-NEXT: strh r1, [r0, #3]!
1051 ; CHECK-ARM-NEXT: bx lr
1052 %o = getelementptr inbounds i8, ptr %p, i32 3
1053 store i16 %v, ptr %o, align 2
1057 define ptr @i16_4(ptr %p, i16 %v) {
1058 ; CHECK-T1-LABEL: i16_4:
1059 ; CHECK-T1: @ %bb.0:
1060 ; CHECK-T1-NEXT: strh r1, [r0, #4]
1061 ; CHECK-T1-NEXT: adds r0, r0, #4
1062 ; CHECK-T1-NEXT: bx lr
1064 ; CHECK-T2-LABEL: i16_4:
1065 ; CHECK-T2: @ %bb.0:
1066 ; CHECK-T2-NEXT: strh r1, [r0, #4]!
1067 ; CHECK-T2-NEXT: bx lr
1069 ; CHECK-ARM-LABEL: i16_4:
1070 ; CHECK-ARM: @ %bb.0:
1071 ; CHECK-ARM-NEXT: strh r1, [r0, #4]!
1072 ; CHECK-ARM-NEXT: bx lr
1073 %o = getelementptr inbounds i8, ptr %p, i32 4
1074 store i16 %v, ptr %o, align 2
1078 define ptr @i16_8(ptr %p, i16 %v) {
1079 ; CHECK-T1-LABEL: i16_8:
1080 ; CHECK-T1: @ %bb.0:
1081 ; CHECK-T1-NEXT: strh r1, [r0, #8]
1082 ; CHECK-T1-NEXT: adds r0, #8
1083 ; CHECK-T1-NEXT: bx lr
1085 ; CHECK-T2-LABEL: i16_8:
1086 ; CHECK-T2: @ %bb.0:
1087 ; CHECK-T2-NEXT: strh r1, [r0, #8]!
1088 ; CHECK-T2-NEXT: bx lr
1090 ; CHECK-ARM-LABEL: i16_8:
1091 ; CHECK-ARM: @ %bb.0:
1092 ; CHECK-ARM-NEXT: strh r1, [r0, #8]!
1093 ; CHECK-ARM-NEXT: bx lr
1094 %o = getelementptr inbounds i8, ptr %p, i32 8
1095 store i16 %v, ptr %o, align 2
1099 define ptr @i16_m1(ptr %p, i16 %v) {
1100 ; CHECK-T1-LABEL: i16_m1:
1101 ; CHECK-T1: @ %bb.0:
1102 ; CHECK-T1-NEXT: subs r0, r0, #1
1103 ; CHECK-T1-NEXT: strh r1, [r0]
1104 ; CHECK-T1-NEXT: bx lr
1106 ; CHECK-T2-LABEL: i16_m1:
1107 ; CHECK-T2: @ %bb.0:
1108 ; CHECK-T2-NEXT: strh r1, [r0, #-1]!
1109 ; CHECK-T2-NEXT: bx lr
1111 ; CHECK-ARM-LABEL: i16_m1:
1112 ; CHECK-ARM: @ %bb.0:
1113 ; CHECK-ARM-NEXT: strh r1, [r0, #-1]!
1114 ; CHECK-ARM-NEXT: bx lr
1115 %o = getelementptr inbounds i8, ptr %p, i32 -1
1116 store i16 %v, ptr %o, align 2
1120 define ptr @i16_m4(ptr %p, i16 %v) {
1121 ; CHECK-T1-LABEL: i16_m4:
1122 ; CHECK-T1: @ %bb.0:
1123 ; CHECK-T1-NEXT: subs r0, r0, #4
1124 ; CHECK-T1-NEXT: strh r1, [r0]
1125 ; CHECK-T1-NEXT: bx lr
1127 ; CHECK-T2-LABEL: i16_m4:
1128 ; CHECK-T2: @ %bb.0:
1129 ; CHECK-T2-NEXT: strh r1, [r0, #-4]!
1130 ; CHECK-T2-NEXT: bx lr
1132 ; CHECK-ARM-LABEL: i16_m4:
1133 ; CHECK-ARM: @ %bb.0:
1134 ; CHECK-ARM-NEXT: strh r1, [r0, #-4]!
1135 ; CHECK-ARM-NEXT: bx lr
1136 %o = getelementptr inbounds i8, ptr %p, i32 -4
1137 store i16 %v, ptr %o, align 2
1141 define ptr @i16_252(ptr %p, i16 %v) {
1142 ; CHECK-T1-LABEL: i16_252:
1143 ; CHECK-T1: @ %bb.0:
1144 ; CHECK-T1-NEXT: movs r2, #252
1145 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1146 ; CHECK-T1-NEXT: adds r0, #252
1147 ; CHECK-T1-NEXT: bx lr
1149 ; CHECK-T2-LABEL: i16_252:
1150 ; CHECK-T2: @ %bb.0:
1151 ; CHECK-T2-NEXT: strh r1, [r0, #252]!
1152 ; CHECK-T2-NEXT: bx lr
1154 ; CHECK-ARM-LABEL: i16_252:
1155 ; CHECK-ARM: @ %bb.0:
1156 ; CHECK-ARM-NEXT: strh r1, [r0, #252]!
1157 ; CHECK-ARM-NEXT: bx lr
1158 %o = getelementptr inbounds i8, ptr %p, i32 252
1159 store i16 %v, ptr %o, align 2
1163 define ptr @i16_255(ptr %p, i16 %v) {
1164 ; CHECK-T1-LABEL: i16_255:
1165 ; CHECK-T1: @ %bb.0:
1166 ; CHECK-T1-NEXT: movs r2, #255
1167 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1168 ; CHECK-T1-NEXT: adds r0, #255
1169 ; CHECK-T1-NEXT: bx lr
1171 ; CHECK-T2-LABEL: i16_255:
1172 ; CHECK-T2: @ %bb.0:
1173 ; CHECK-T2-NEXT: strh r1, [r0, #255]!
1174 ; CHECK-T2-NEXT: bx lr
1176 ; CHECK-ARM-LABEL: i16_255:
1177 ; CHECK-ARM: @ %bb.0:
1178 ; CHECK-ARM-NEXT: strh r1, [r0, #255]!
1179 ; CHECK-ARM-NEXT: bx lr
1180 %o = getelementptr inbounds i8, ptr %p, i32 255
1181 store i16 %v, ptr %o, align 2
1185 define ptr @i16_256(ptr %p, i16 %v) {
1186 ; CHECK-T1-LABEL: i16_256:
1187 ; CHECK-T1: @ %bb.0:
1188 ; CHECK-T1-NEXT: movs r2, #1
1189 ; CHECK-T1-NEXT: lsls r2, r2, #8
1190 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1191 ; CHECK-T1-NEXT: adds r0, r0, r2
1192 ; CHECK-T1-NEXT: bx lr
1194 ; CHECK-T2-LABEL: i16_256:
1195 ; CHECK-T2: @ %bb.0:
1196 ; CHECK-T2-NEXT: strh.w r1, [r0, #256]
1197 ; CHECK-T2-NEXT: add.w r0, r0, #256
1198 ; CHECK-T2-NEXT: bx lr
1200 ; CHECK-ARM-LABEL: i16_256:
1201 ; CHECK-ARM: @ %bb.0:
1202 ; CHECK-ARM-NEXT: mov r2, #256
1203 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1204 ; CHECK-ARM-NEXT: bx lr
1205 %o = getelementptr inbounds i8, ptr %p, i32 256
1206 store i16 %v, ptr %o, align 2
1210 define ptr @i16_m252(ptr %p, i16 %v) {
1211 ; CHECK-T1-LABEL: i16_m252:
1212 ; CHECK-T1: @ %bb.0:
1213 ; CHECK-T1-NEXT: subs r0, #252
1214 ; CHECK-T1-NEXT: strh r1, [r0]
1215 ; CHECK-T1-NEXT: bx lr
1217 ; CHECK-T2-LABEL: i16_m252:
1218 ; CHECK-T2: @ %bb.0:
1219 ; CHECK-T2-NEXT: strh r1, [r0, #-252]!
1220 ; CHECK-T2-NEXT: bx lr
1222 ; CHECK-ARM-LABEL: i16_m252:
1223 ; CHECK-ARM: @ %bb.0:
1224 ; CHECK-ARM-NEXT: strh r1, [r0, #-252]!
1225 ; CHECK-ARM-NEXT: bx lr
1226 %o = getelementptr inbounds i8, ptr %p, i32 -252
1227 store i16 %v, ptr %o, align 2
1231 define ptr @i16_m255(ptr %p, i16 %v) {
1232 ; CHECK-T1-LABEL: i16_m255:
1233 ; CHECK-T1: @ %bb.0:
1234 ; CHECK-T1-NEXT: subs r0, #255
1235 ; CHECK-T1-NEXT: strh r1, [r0]
1236 ; CHECK-T1-NEXT: bx lr
1238 ; CHECK-T2-LABEL: i16_m255:
1239 ; CHECK-T2: @ %bb.0:
1240 ; CHECK-T2-NEXT: strh r1, [r0, #-255]!
1241 ; CHECK-T2-NEXT: bx lr
1243 ; CHECK-ARM-LABEL: i16_m255:
1244 ; CHECK-ARM: @ %bb.0:
1245 ; CHECK-ARM-NEXT: strh r1, [r0, #-255]!
1246 ; CHECK-ARM-NEXT: bx lr
1247 %o = getelementptr inbounds i8, ptr %p, i32 -255
1248 store i16 %v, ptr %o, align 2
1252 define ptr @i16_m256(ptr %p, i16 %v) {
1253 ; CHECK-T1-LABEL: i16_m256:
1254 ; CHECK-T1: @ %bb.0:
1255 ; CHECK-T1-NEXT: movs r2, #255
1256 ; CHECK-T1-NEXT: mvns r2, r2
1257 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1258 ; CHECK-T1-NEXT: adds r0, r0, r2
1259 ; CHECK-T1-NEXT: bx lr
1261 ; CHECK-T2-LABEL: i16_m256:
1262 ; CHECK-T2: @ %bb.0:
1263 ; CHECK-T2-NEXT: mvn r2, #255
1264 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1265 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1266 ; CHECK-T2-NEXT: bx lr
1268 ; CHECK-ARM-LABEL: i16_m256:
1269 ; CHECK-ARM: @ %bb.0:
1270 ; CHECK-ARM-NEXT: mvn r2, #255
1271 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1272 ; CHECK-ARM-NEXT: bx lr
1273 %o = getelementptr inbounds i8, ptr %p, i32 -256
1274 store i16 %v, ptr %o, align 2
1278 define ptr @i16_4095(ptr %p, i16 %v) {
1279 ; CHECK-T1-LABEL: i16_4095:
1280 ; CHECK-T1: @ %bb.0:
1281 ; CHECK-T1-NEXT: ldr r2, .LCPI51_0
1282 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1283 ; CHECK-T1-NEXT: adds r0, r0, r2
1284 ; CHECK-T1-NEXT: bx lr
1285 ; CHECK-T1-NEXT: .p2align 2
1286 ; CHECK-T1-NEXT: @ %bb.1:
1287 ; CHECK-T1-NEXT: .LCPI51_0:
1288 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1290 ; CHECK-T2-LABEL: i16_4095:
1291 ; CHECK-T2: @ %bb.0:
1292 ; CHECK-T2-NEXT: strh.w r1, [r0, #4095]
1293 ; CHECK-T2-NEXT: addw r0, r0, #4095
1294 ; CHECK-T2-NEXT: bx lr
1296 ; CHECK-ARM-LABEL: i16_4095:
1297 ; CHECK-ARM: @ %bb.0:
1298 ; CHECK-ARM-NEXT: movw r2, #4095
1299 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1300 ; CHECK-ARM-NEXT: bx lr
1301 %o = getelementptr inbounds i8, ptr %p, i32 4095
1302 store i16 %v, ptr %o, align 2
1306 define ptr @i16_4096(ptr %p, i16 %v) {
1307 ; CHECK-T1-LABEL: i16_4096:
1308 ; CHECK-T1: @ %bb.0:
1309 ; CHECK-T1-NEXT: movs r2, #1
1310 ; CHECK-T1-NEXT: lsls r2, r2, #12
1311 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1312 ; CHECK-T1-NEXT: adds r0, r0, r2
1313 ; CHECK-T1-NEXT: bx lr
1315 ; CHECK-T2-LABEL: i16_4096:
1316 ; CHECK-T2: @ %bb.0:
1317 ; CHECK-T2-NEXT: mov.w r2, #4096
1318 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1319 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1320 ; CHECK-T2-NEXT: bx lr
1322 ; CHECK-ARM-LABEL: i16_4096:
1323 ; CHECK-ARM: @ %bb.0:
1324 ; CHECK-ARM-NEXT: mov r2, #4096
1325 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1326 ; CHECK-ARM-NEXT: bx lr
1327 %o = getelementptr inbounds i8, ptr %p, i32 4096
1328 store i16 %v, ptr %o, align 2
1332 define ptr @i16_m4095(ptr %p, i16 %v) {
1333 ; CHECK-T1-LABEL: i16_m4095:
1334 ; CHECK-T1: @ %bb.0:
1335 ; CHECK-T1-NEXT: ldr r2, .LCPI53_0
1336 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1337 ; CHECK-T1-NEXT: adds r0, r0, r2
1338 ; CHECK-T1-NEXT: bx lr
1339 ; CHECK-T1-NEXT: .p2align 2
1340 ; CHECK-T1-NEXT: @ %bb.1:
1341 ; CHECK-T1-NEXT: .LCPI53_0:
1342 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1344 ; CHECK-T2-LABEL: i16_m4095:
1345 ; CHECK-T2: @ %bb.0:
1346 ; CHECK-T2-NEXT: movw r2, #61441
1347 ; CHECK-T2-NEXT: movt r2, #65535
1348 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1349 ; CHECK-T2-NEXT: subw r0, r0, #4095
1350 ; CHECK-T2-NEXT: bx lr
1352 ; CHECK-ARM-LABEL: i16_m4095:
1353 ; CHECK-ARM: @ %bb.0:
1354 ; CHECK-ARM-NEXT: movw r2, #61441
1355 ; CHECK-ARM-NEXT: movt r2, #65535
1356 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1357 ; CHECK-ARM-NEXT: bx lr
1358 %o = getelementptr inbounds i8, ptr %p, i32 -4095
1359 store i16 %v, ptr %o, align 2
1363 define ptr @i16_m4096(ptr %p, i16 %v) {
1364 ; CHECK-T1-LABEL: i16_m4096:
1365 ; CHECK-T1: @ %bb.0:
1366 ; CHECK-T1-NEXT: ldr r2, .LCPI54_0
1367 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1368 ; CHECK-T1-NEXT: adds r0, r0, r2
1369 ; CHECK-T1-NEXT: bx lr
1370 ; CHECK-T1-NEXT: .p2align 2
1371 ; CHECK-T1-NEXT: @ %bb.1:
1372 ; CHECK-T1-NEXT: .LCPI54_0:
1373 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1375 ; CHECK-T2-LABEL: i16_m4096:
1376 ; CHECK-T2: @ %bb.0:
1377 ; CHECK-T2-NEXT: movw r2, #61440
1378 ; CHECK-T2-NEXT: movt r2, #65535
1379 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1380 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1381 ; CHECK-T2-NEXT: bx lr
1383 ; CHECK-ARM-LABEL: i16_m4096:
1384 ; CHECK-ARM: @ %bb.0:
1385 ; CHECK-ARM-NEXT: movw r2, #61440
1386 ; CHECK-ARM-NEXT: movt r2, #65535
1387 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1388 ; CHECK-ARM-NEXT: bx lr
1389 %o = getelementptr inbounds i8, ptr %p, i32 -4096
1390 store i16 %v, ptr %o, align 2
1396 define ptr @i8_0(ptr %p, i8 %v) {
1397 ; CHECK-LABEL: i8_0:
1399 ; CHECK-NEXT: strb r1, [r0]
1401 store i8 %v, ptr %p, align 1
1405 define ptr @i8_3(ptr %p, i8 %v) {
1406 ; CHECK-T1-LABEL: i8_3:
1407 ; CHECK-T1: @ %bb.0:
1408 ; CHECK-T1-NEXT: strb r1, [r0, #3]
1409 ; CHECK-T1-NEXT: adds r0, r0, #3
1410 ; CHECK-T1-NEXT: bx lr
1412 ; CHECK-T2-LABEL: i8_3:
1413 ; CHECK-T2: @ %bb.0:
1414 ; CHECK-T2-NEXT: strb r1, [r0, #3]!
1415 ; CHECK-T2-NEXT: bx lr
1417 ; CHECK-ARM-LABEL: i8_3:
1418 ; CHECK-ARM: @ %bb.0:
1419 ; CHECK-ARM-NEXT: strb r1, [r0, #3]!
1420 ; CHECK-ARM-NEXT: bx lr
1421 %o = getelementptr inbounds i8, ptr %p, i32 3
1422 store i8 %v, ptr %o, align 1
1426 define ptr @i8_4(ptr %p, i8 %v) {
1427 ; CHECK-T1-LABEL: i8_4:
1428 ; CHECK-T1: @ %bb.0:
1429 ; CHECK-T1-NEXT: strb r1, [r0, #4]
1430 ; CHECK-T1-NEXT: adds r0, r0, #4
1431 ; CHECK-T1-NEXT: bx lr
1433 ; CHECK-T2-LABEL: i8_4:
1434 ; CHECK-T2: @ %bb.0:
1435 ; CHECK-T2-NEXT: strb r1, [r0, #4]!
1436 ; CHECK-T2-NEXT: bx lr
1438 ; CHECK-ARM-LABEL: i8_4:
1439 ; CHECK-ARM: @ %bb.0:
1440 ; CHECK-ARM-NEXT: strb r1, [r0, #4]!
1441 ; CHECK-ARM-NEXT: bx lr
1442 %o = getelementptr inbounds i8, ptr %p, i32 4
1443 store i8 %v, ptr %o, align 1
1447 define ptr @i8_8(ptr %p, i8 %v) {
1448 ; CHECK-T1-LABEL: i8_8:
1449 ; CHECK-T1: @ %bb.0:
1450 ; CHECK-T1-NEXT: strb r1, [r0, #8]
1451 ; CHECK-T1-NEXT: adds r0, #8
1452 ; CHECK-T1-NEXT: bx lr
1454 ; CHECK-T2-LABEL: i8_8:
1455 ; CHECK-T2: @ %bb.0:
1456 ; CHECK-T2-NEXT: strb r1, [r0, #8]!
1457 ; CHECK-T2-NEXT: bx lr
1459 ; CHECK-ARM-LABEL: i8_8:
1460 ; CHECK-ARM: @ %bb.0:
1461 ; CHECK-ARM-NEXT: strb r1, [r0, #8]!
1462 ; CHECK-ARM-NEXT: bx lr
1463 %o = getelementptr inbounds i8, ptr %p, i32 8
1464 store i8 %v, ptr %o, align 1
1468 define ptr @i8_m1(ptr %p, i8 %v) {
1469 ; CHECK-T1-LABEL: i8_m1:
1470 ; CHECK-T1: @ %bb.0:
1471 ; CHECK-T1-NEXT: subs r0, r0, #1
1472 ; CHECK-T1-NEXT: strb r1, [r0]
1473 ; CHECK-T1-NEXT: bx lr
1475 ; CHECK-T2-LABEL: i8_m1:
1476 ; CHECK-T2: @ %bb.0:
1477 ; CHECK-T2-NEXT: strb r1, [r0, #-1]!
1478 ; CHECK-T2-NEXT: bx lr
1480 ; CHECK-ARM-LABEL: i8_m1:
1481 ; CHECK-ARM: @ %bb.0:
1482 ; CHECK-ARM-NEXT: strb r1, [r0, #-1]!
1483 ; CHECK-ARM-NEXT: bx lr
1484 %o = getelementptr inbounds i8, ptr %p, i32 -1
1485 store i8 %v, ptr %o, align 1
1489 define ptr @i8_m4(ptr %p, i8 %v) {
1490 ; CHECK-T1-LABEL: i8_m4:
1491 ; CHECK-T1: @ %bb.0:
1492 ; CHECK-T1-NEXT: subs r0, r0, #4
1493 ; CHECK-T1-NEXT: strb r1, [r0]
1494 ; CHECK-T1-NEXT: bx lr
1496 ; CHECK-T2-LABEL: i8_m4:
1497 ; CHECK-T2: @ %bb.0:
1498 ; CHECK-T2-NEXT: strb r1, [r0, #-4]!
1499 ; CHECK-T2-NEXT: bx lr
1501 ; CHECK-ARM-LABEL: i8_m4:
1502 ; CHECK-ARM: @ %bb.0:
1503 ; CHECK-ARM-NEXT: strb r1, [r0, #-4]!
1504 ; CHECK-ARM-NEXT: bx lr
1505 %o = getelementptr inbounds i8, ptr %p, i32 -4
1506 store i8 %v, ptr %o, align 1
1510 define ptr @i8_252(ptr %p, i8 %v) {
1511 ; CHECK-T1-LABEL: i8_252:
1512 ; CHECK-T1: @ %bb.0:
1513 ; CHECK-T1-NEXT: movs r2, #252
1514 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1515 ; CHECK-T1-NEXT: adds r0, #252
1516 ; CHECK-T1-NEXT: bx lr
1518 ; CHECK-T2-LABEL: i8_252:
1519 ; CHECK-T2: @ %bb.0:
1520 ; CHECK-T2-NEXT: strb r1, [r0, #252]!
1521 ; CHECK-T2-NEXT: bx lr
1523 ; CHECK-ARM-LABEL: i8_252:
1524 ; CHECK-ARM: @ %bb.0:
1525 ; CHECK-ARM-NEXT: strb r1, [r0, #252]!
1526 ; CHECK-ARM-NEXT: bx lr
1527 %o = getelementptr inbounds i8, ptr %p, i32 252
1528 store i8 %v, ptr %o, align 1
1532 define ptr @i8_255(ptr %p, i8 %v) {
1533 ; CHECK-T1-LABEL: i8_255:
1534 ; CHECK-T1: @ %bb.0:
1535 ; CHECK-T1-NEXT: movs r2, #255
1536 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1537 ; CHECK-T1-NEXT: adds r0, #255
1538 ; CHECK-T1-NEXT: bx lr
1540 ; CHECK-T2-LABEL: i8_255:
1541 ; CHECK-T2: @ %bb.0:
1542 ; CHECK-T2-NEXT: strb r1, [r0, #255]!
1543 ; CHECK-T2-NEXT: bx lr
1545 ; CHECK-ARM-LABEL: i8_255:
1546 ; CHECK-ARM: @ %bb.0:
1547 ; CHECK-ARM-NEXT: strb r1, [r0, #255]!
1548 ; CHECK-ARM-NEXT: bx lr
1549 %o = getelementptr inbounds i8, ptr %p, i32 255
1550 store i8 %v, ptr %o, align 1
1554 define ptr @i8_256(ptr %p, i8 %v) {
1555 ; CHECK-T1-LABEL: i8_256:
1556 ; CHECK-T1: @ %bb.0:
1557 ; CHECK-T1-NEXT: movs r2, #1
1558 ; CHECK-T1-NEXT: lsls r2, r2, #8
1559 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1560 ; CHECK-T1-NEXT: adds r0, r0, r2
1561 ; CHECK-T1-NEXT: bx lr
1563 ; CHECK-T2-LABEL: i8_256:
1564 ; CHECK-T2: @ %bb.0:
1565 ; CHECK-T2-NEXT: strb.w r1, [r0, #256]
1566 ; CHECK-T2-NEXT: add.w r0, r0, #256
1567 ; CHECK-T2-NEXT: bx lr
1569 ; CHECK-ARM-LABEL: i8_256:
1570 ; CHECK-ARM: @ %bb.0:
1571 ; CHECK-ARM-NEXT: strb r1, [r0, #256]!
1572 ; CHECK-ARM-NEXT: bx lr
1573 %o = getelementptr inbounds i8, ptr %p, i32 256
1574 store i8 %v, ptr %o, align 1
1578 define ptr @i8_m252(ptr %p, i8 %v) {
1579 ; CHECK-T1-LABEL: i8_m252:
1580 ; CHECK-T1: @ %bb.0:
1581 ; CHECK-T1-NEXT: subs r0, #252
1582 ; CHECK-T1-NEXT: strb r1, [r0]
1583 ; CHECK-T1-NEXT: bx lr
1585 ; CHECK-T2-LABEL: i8_m252:
1586 ; CHECK-T2: @ %bb.0:
1587 ; CHECK-T2-NEXT: strb r1, [r0, #-252]!
1588 ; CHECK-T2-NEXT: bx lr
1590 ; CHECK-ARM-LABEL: i8_m252:
1591 ; CHECK-ARM: @ %bb.0:
1592 ; CHECK-ARM-NEXT: strb r1, [r0, #-252]!
1593 ; CHECK-ARM-NEXT: bx lr
1594 %o = getelementptr inbounds i8, ptr %p, i32 -252
1595 store i8 %v, ptr %o, align 1
1599 define ptr @i8_m255(ptr %p, i8 %v) {
1600 ; CHECK-T1-LABEL: i8_m255:
1601 ; CHECK-T1: @ %bb.0:
1602 ; CHECK-T1-NEXT: subs r0, #255
1603 ; CHECK-T1-NEXT: strb r1, [r0]
1604 ; CHECK-T1-NEXT: bx lr
1606 ; CHECK-T2-LABEL: i8_m255:
1607 ; CHECK-T2: @ %bb.0:
1608 ; CHECK-T2-NEXT: strb r1, [r0, #-255]!
1609 ; CHECK-T2-NEXT: bx lr
1611 ; CHECK-ARM-LABEL: i8_m255:
1612 ; CHECK-ARM: @ %bb.0:
1613 ; CHECK-ARM-NEXT: strb r1, [r0, #-255]!
1614 ; CHECK-ARM-NEXT: bx lr
1615 %o = getelementptr inbounds i8, ptr %p, i32 -255
1616 store i8 %v, ptr %o, align 1
1620 define ptr @i8_m256(ptr %p, i8 %v) {
1621 ; CHECK-T1-LABEL: i8_m256:
1622 ; CHECK-T1: @ %bb.0:
1623 ; CHECK-T1-NEXT: movs r2, #255
1624 ; CHECK-T1-NEXT: mvns r2, r2
1625 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1626 ; CHECK-T1-NEXT: adds r0, r0, r2
1627 ; CHECK-T1-NEXT: bx lr
1629 ; CHECK-T2-LABEL: i8_m256:
1630 ; CHECK-T2: @ %bb.0:
1631 ; CHECK-T2-NEXT: mvn r2, #255
1632 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1633 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1634 ; CHECK-T2-NEXT: bx lr
1636 ; CHECK-ARM-LABEL: i8_m256:
1637 ; CHECK-ARM: @ %bb.0:
1638 ; CHECK-ARM-NEXT: strb r1, [r0, #-256]!
1639 ; CHECK-ARM-NEXT: bx lr
1640 %o = getelementptr inbounds i8, ptr %p, i32 -256
1641 store i8 %v, ptr %o, align 1
1645 define ptr @i8_4095(ptr %p, i8 %v) {
1646 ; CHECK-T1-LABEL: i8_4095:
1647 ; CHECK-T1: @ %bb.0:
1648 ; CHECK-T1-NEXT: ldr r2, .LCPI67_0
1649 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1650 ; CHECK-T1-NEXT: adds r0, r0, r2
1651 ; CHECK-T1-NEXT: bx lr
1652 ; CHECK-T1-NEXT: .p2align 2
1653 ; CHECK-T1-NEXT: @ %bb.1:
1654 ; CHECK-T1-NEXT: .LCPI67_0:
1655 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1657 ; CHECK-T2-LABEL: i8_4095:
1658 ; CHECK-T2: @ %bb.0:
1659 ; CHECK-T2-NEXT: strb.w r1, [r0, #4095]
1660 ; CHECK-T2-NEXT: addw r0, r0, #4095
1661 ; CHECK-T2-NEXT: bx lr
1663 ; CHECK-ARM-LABEL: i8_4095:
1664 ; CHECK-ARM: @ %bb.0:
1665 ; CHECK-ARM-NEXT: strb r1, [r0, #4095]!
1666 ; CHECK-ARM-NEXT: bx lr
1667 %o = getelementptr inbounds i8, ptr %p, i32 4095
1668 store i8 %v, ptr %o, align 1
1672 define ptr @i8_4096(ptr %p, i8 %v) {
1673 ; CHECK-T1-LABEL: i8_4096:
1674 ; CHECK-T1: @ %bb.0:
1675 ; CHECK-T1-NEXT: movs r2, #1
1676 ; CHECK-T1-NEXT: lsls r2, r2, #12
1677 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1678 ; CHECK-T1-NEXT: adds r0, r0, r2
1679 ; CHECK-T1-NEXT: bx lr
1681 ; CHECK-T2-LABEL: i8_4096:
1682 ; CHECK-T2: @ %bb.0:
1683 ; CHECK-T2-NEXT: mov.w r2, #4096
1684 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1685 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1686 ; CHECK-T2-NEXT: bx lr
1688 ; CHECK-ARM-LABEL: i8_4096:
1689 ; CHECK-ARM: @ %bb.0:
1690 ; CHECK-ARM-NEXT: mov r2, #4096
1691 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1692 ; CHECK-ARM-NEXT: bx lr
1693 %o = getelementptr inbounds i8, ptr %p, i32 4096
1694 store i8 %v, ptr %o, align 1
1698 define ptr @i8_m4095(ptr %p, i8 %v) {
1699 ; CHECK-T1-LABEL: i8_m4095:
1700 ; CHECK-T1: @ %bb.0:
1701 ; CHECK-T1-NEXT: ldr r2, .LCPI69_0
1702 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1703 ; CHECK-T1-NEXT: adds r0, r0, r2
1704 ; CHECK-T1-NEXT: bx lr
1705 ; CHECK-T1-NEXT: .p2align 2
1706 ; CHECK-T1-NEXT: @ %bb.1:
1707 ; CHECK-T1-NEXT: .LCPI69_0:
1708 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1710 ; CHECK-T2-LABEL: i8_m4095:
1711 ; CHECK-T2: @ %bb.0:
1712 ; CHECK-T2-NEXT: movw r2, #61441
1713 ; CHECK-T2-NEXT: movt r2, #65535
1714 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1715 ; CHECK-T2-NEXT: subw r0, r0, #4095
1716 ; CHECK-T2-NEXT: bx lr
1718 ; CHECK-ARM-LABEL: i8_m4095:
1719 ; CHECK-ARM: @ %bb.0:
1720 ; CHECK-ARM-NEXT: strb r1, [r0, #-4095]!
1721 ; CHECK-ARM-NEXT: bx lr
1722 %o = getelementptr inbounds i8, ptr %p, i32 -4095
1723 store i8 %v, ptr %o, align 1
1727 define ptr @i8_m4096(ptr %p, i8 %v) {
1728 ; CHECK-T1-LABEL: i8_m4096:
1729 ; CHECK-T1: @ %bb.0:
1730 ; CHECK-T1-NEXT: ldr r2, .LCPI70_0
1731 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1732 ; CHECK-T1-NEXT: adds r0, r0, r2
1733 ; CHECK-T1-NEXT: bx lr
1734 ; CHECK-T1-NEXT: .p2align 2
1735 ; CHECK-T1-NEXT: @ %bb.1:
1736 ; CHECK-T1-NEXT: .LCPI70_0:
1737 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1739 ; CHECK-T2-LABEL: i8_m4096:
1740 ; CHECK-T2: @ %bb.0:
1741 ; CHECK-T2-NEXT: movw r2, #61440
1742 ; CHECK-T2-NEXT: movt r2, #65535
1743 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1744 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1745 ; CHECK-T2-NEXT: bx lr
1747 ; CHECK-ARM-LABEL: i8_m4096:
1748 ; CHECK-ARM: @ %bb.0:
1749 ; CHECK-ARM-NEXT: movw r2, #61440
1750 ; CHECK-ARM-NEXT: movt r2, #65535
1751 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1752 ; CHECK-ARM-NEXT: bx lr
1753 %o = getelementptr inbounds i8, ptr %p, i32 -4096
1754 store i8 %v, ptr %o, align 1