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 i8* @i32_0(i8* %p, i32 %v) {
9 ; CHECK-NEXT: str r1, [r0]
11 %o = getelementptr inbounds i8, i8* %p, i32 0
12 %q = bitcast i8* %o to i32*
13 store i32 %v, i32* %q, align 4
17 define i8* @i32_3(i8* %p, i32 %v) {
18 ; CHECK-T1-LABEL: i32_3:
20 ; CHECK-T1-NEXT: movs r2, #3
21 ; CHECK-T1-NEXT: str r1, [r0, r2]
22 ; CHECK-T1-NEXT: adds r0, r0, #3
23 ; CHECK-T1-NEXT: bx lr
25 ; CHECK-T2-LABEL: i32_3:
27 ; CHECK-T2-NEXT: str r1, [r0, #3]!
28 ; CHECK-T2-NEXT: bx lr
30 ; CHECK-ARM-LABEL: i32_3:
32 ; CHECK-ARM-NEXT: str r1, [r0, #3]!
33 ; CHECK-ARM-NEXT: bx lr
34 %o = getelementptr inbounds i8, i8* %p, i32 3
35 %q = bitcast i8* %o to i32*
36 store i32 %v, i32* %q, align 4
40 define i8* @i32_4(i8* %p, i32 %v) {
41 ; CHECK-T1-LABEL: i32_4:
43 ; CHECK-T1-NEXT: str r1, [r0, #4]
44 ; CHECK-T1-NEXT: adds r0, r0, #4
45 ; CHECK-T1-NEXT: bx lr
47 ; CHECK-T2-LABEL: i32_4:
49 ; CHECK-T2-NEXT: str r1, [r0, #4]!
50 ; CHECK-T2-NEXT: bx lr
52 ; CHECK-ARM-LABEL: i32_4:
54 ; CHECK-ARM-NEXT: str r1, [r0, #4]!
55 ; CHECK-ARM-NEXT: bx lr
56 %o = getelementptr inbounds i8, i8* %p, i32 4
57 %q = bitcast i8* %o to i32*
58 store i32 %v, i32* %q, align 4
62 define i8* @i32_8(i8* %p, i32 %v) {
63 ; CHECK-T1-LABEL: i32_8:
65 ; CHECK-T1-NEXT: str r1, [r0, #8]
66 ; CHECK-T1-NEXT: adds r0, #8
67 ; CHECK-T1-NEXT: bx lr
69 ; CHECK-T2-LABEL: i32_8:
71 ; CHECK-T2-NEXT: str r1, [r0, #8]!
72 ; CHECK-T2-NEXT: bx lr
74 ; CHECK-ARM-LABEL: i32_8:
76 ; CHECK-ARM-NEXT: str r1, [r0, #8]!
77 ; CHECK-ARM-NEXT: bx lr
78 %o = getelementptr inbounds i8, i8* %p, i32 8
79 %q = bitcast i8* %o to i32*
80 store i32 %v, i32* %q, align 4
84 define i8* @i32_m1(i8* %p, i32 %v) {
85 ; CHECK-T1-LABEL: i32_m1:
87 ; CHECK-T1-NEXT: subs r0, r0, #1
88 ; CHECK-T1-NEXT: str r1, [r0]
89 ; CHECK-T1-NEXT: bx lr
91 ; CHECK-T2-LABEL: i32_m1:
93 ; CHECK-T2-NEXT: str r1, [r0, #-1]!
94 ; CHECK-T2-NEXT: bx lr
96 ; CHECK-ARM-LABEL: i32_m1:
98 ; CHECK-ARM-NEXT: str r1, [r0, #-1]!
99 ; CHECK-ARM-NEXT: bx lr
100 %o = getelementptr inbounds i8, i8* %p, i32 -1
101 %q = bitcast i8* %o to i32*
102 store i32 %v, i32* %q, align 4
106 define i8* @i32_m4(i8* %p, i32 %v) {
107 ; CHECK-T1-LABEL: i32_m4:
109 ; CHECK-T1-NEXT: subs r0, r0, #4
110 ; CHECK-T1-NEXT: str r1, [r0]
111 ; CHECK-T1-NEXT: bx lr
113 ; CHECK-T2-LABEL: i32_m4:
115 ; CHECK-T2-NEXT: str r1, [r0, #-4]!
116 ; CHECK-T2-NEXT: bx lr
118 ; CHECK-ARM-LABEL: i32_m4:
119 ; CHECK-ARM: @ %bb.0:
120 ; CHECK-ARM-NEXT: str r1, [r0, #-4]!
121 ; CHECK-ARM-NEXT: bx lr
122 %o = getelementptr inbounds i8, i8* %p, i32 -4
123 %q = bitcast i8* %o to i32*
124 store i32 %v, i32* %q, align 4
128 define i8* @i32_252(i8* %p, i32 %v) {
129 ; CHECK-T1-LABEL: i32_252:
131 ; CHECK-T1-NEXT: movs r2, #252
132 ; CHECK-T1-NEXT: str r1, [r0, r2]
133 ; CHECK-T1-NEXT: adds r0, #252
134 ; CHECK-T1-NEXT: bx lr
136 ; CHECK-T2-LABEL: i32_252:
138 ; CHECK-T2-NEXT: str r1, [r0, #252]!
139 ; CHECK-T2-NEXT: bx lr
141 ; CHECK-ARM-LABEL: i32_252:
142 ; CHECK-ARM: @ %bb.0:
143 ; CHECK-ARM-NEXT: str r1, [r0, #252]!
144 ; CHECK-ARM-NEXT: bx lr
145 %o = getelementptr inbounds i8, i8* %p, i32 252
146 %q = bitcast i8* %o to i32*
147 store i32 %v, i32* %q, align 4
151 define i8* @i32_255(i8* %p, i32 %v) {
152 ; CHECK-T1-LABEL: i32_255:
154 ; CHECK-T1-NEXT: movs r2, #255
155 ; CHECK-T1-NEXT: str r1, [r0, r2]
156 ; CHECK-T1-NEXT: adds r0, #255
157 ; CHECK-T1-NEXT: bx lr
159 ; CHECK-T2-LABEL: i32_255:
161 ; CHECK-T2-NEXT: str r1, [r0, #255]!
162 ; CHECK-T2-NEXT: bx lr
164 ; CHECK-ARM-LABEL: i32_255:
165 ; CHECK-ARM: @ %bb.0:
166 ; CHECK-ARM-NEXT: str r1, [r0, #255]!
167 ; CHECK-ARM-NEXT: bx lr
168 %o = getelementptr inbounds i8, i8* %p, i32 255
169 %q = bitcast i8* %o to i32*
170 store i32 %v, i32* %q, align 4
174 define i8* @i32_256(i8* %p, i32 %v) {
175 ; CHECK-T1-LABEL: i32_256:
177 ; CHECK-T1-NEXT: movs r2, #1
178 ; CHECK-T1-NEXT: lsls r2, r2, #8
179 ; CHECK-T1-NEXT: str r1, [r0, r2]
180 ; CHECK-T1-NEXT: adds r0, r0, r2
181 ; CHECK-T1-NEXT: bx lr
183 ; CHECK-T2-LABEL: i32_256:
185 ; CHECK-T2-NEXT: str.w r1, [r0, #256]
186 ; CHECK-T2-NEXT: add.w r0, r0, #256
187 ; CHECK-T2-NEXT: bx lr
189 ; CHECK-ARM-LABEL: i32_256:
190 ; CHECK-ARM: @ %bb.0:
191 ; CHECK-ARM-NEXT: str r1, [r0, #256]!
192 ; CHECK-ARM-NEXT: bx lr
193 %o = getelementptr inbounds i8, i8* %p, i32 256
194 %q = bitcast i8* %o to i32*
195 store i32 %v, i32* %q, align 4
199 define i8* @i32_m252(i8* %p, i32 %v) {
200 ; CHECK-T1-LABEL: i32_m252:
202 ; CHECK-T1-NEXT: subs r0, #252
203 ; CHECK-T1-NEXT: str r1, [r0]
204 ; CHECK-T1-NEXT: bx lr
206 ; CHECK-T2-LABEL: i32_m252:
208 ; CHECK-T2-NEXT: str r1, [r0, #-252]!
209 ; CHECK-T2-NEXT: bx lr
211 ; CHECK-ARM-LABEL: i32_m252:
212 ; CHECK-ARM: @ %bb.0:
213 ; CHECK-ARM-NEXT: str r1, [r0, #-252]!
214 ; CHECK-ARM-NEXT: bx lr
215 %o = getelementptr inbounds i8, i8* %p, i32 -252
216 %q = bitcast i8* %o to i32*
217 store i32 %v, i32* %q, align 4
221 define i8* @i32_m255(i8* %p, i32 %v) {
222 ; CHECK-T1-LABEL: i32_m255:
224 ; CHECK-T1-NEXT: subs r0, #255
225 ; CHECK-T1-NEXT: str r1, [r0]
226 ; CHECK-T1-NEXT: bx lr
228 ; CHECK-T2-LABEL: i32_m255:
230 ; CHECK-T2-NEXT: str r1, [r0, #-255]!
231 ; CHECK-T2-NEXT: bx lr
233 ; CHECK-ARM-LABEL: i32_m255:
234 ; CHECK-ARM: @ %bb.0:
235 ; CHECK-ARM-NEXT: str r1, [r0, #-255]!
236 ; CHECK-ARM-NEXT: bx lr
237 %o = getelementptr inbounds i8, i8* %p, i32 -255
238 %q = bitcast i8* %o to i32*
239 store i32 %v, i32* %q, align 4
243 define i8* @i32_m256(i8* %p, i32 %v) {
244 ; CHECK-T1-LABEL: i32_m256:
246 ; CHECK-T1-NEXT: movs r2, #255
247 ; CHECK-T1-NEXT: mvns r2, r2
248 ; CHECK-T1-NEXT: str r1, [r0, r2]
249 ; CHECK-T1-NEXT: adds r0, r0, r2
250 ; CHECK-T1-NEXT: bx lr
252 ; CHECK-T2-LABEL: i32_m256:
254 ; CHECK-T2-NEXT: mvn r2, #255
255 ; CHECK-T2-NEXT: str r1, [r0, r2]
256 ; CHECK-T2-NEXT: sub.w r0, r0, #256
257 ; CHECK-T2-NEXT: bx lr
259 ; CHECK-ARM-LABEL: i32_m256:
260 ; CHECK-ARM: @ %bb.0:
261 ; CHECK-ARM-NEXT: str r1, [r0, #-256]!
262 ; CHECK-ARM-NEXT: bx lr
263 %o = getelementptr inbounds i8, i8* %p, i32 -256
264 %q = bitcast i8* %o to i32*
265 store i32 %v, i32* %q, align 4
269 define i8* @i32_4095(i8* %p, i32 %v) {
270 ; CHECK-T1-LABEL: i32_4095:
272 ; CHECK-T1-NEXT: ldr r2, .LCPI12_0
273 ; CHECK-T1-NEXT: str r1, [r0, r2]
274 ; CHECK-T1-NEXT: adds r0, r0, r2
275 ; CHECK-T1-NEXT: bx lr
276 ; CHECK-T1-NEXT: .p2align 2
277 ; CHECK-T1-NEXT: @ %bb.1:
278 ; CHECK-T1-NEXT: .LCPI12_0:
279 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
281 ; CHECK-T2-LABEL: i32_4095:
283 ; CHECK-T2-NEXT: str.w r1, [r0, #4095]
284 ; CHECK-T2-NEXT: addw r0, r0, #4095
285 ; CHECK-T2-NEXT: bx lr
287 ; CHECK-ARM-LABEL: i32_4095:
288 ; CHECK-ARM: @ %bb.0:
289 ; CHECK-ARM-NEXT: str r1, [r0, #4095]!
290 ; CHECK-ARM-NEXT: bx lr
291 %o = getelementptr inbounds i8, i8* %p, i32 4095
292 %q = bitcast i8* %o to i32*
293 store i32 %v, i32* %q, align 4
297 define i8* @i32_4096(i8* %p, i32 %v) {
298 ; CHECK-T1-LABEL: i32_4096:
300 ; CHECK-T1-NEXT: movs r2, #1
301 ; CHECK-T1-NEXT: lsls r2, r2, #12
302 ; CHECK-T1-NEXT: str r1, [r0, r2]
303 ; CHECK-T1-NEXT: adds r0, r0, r2
304 ; CHECK-T1-NEXT: bx lr
306 ; CHECK-T2-LABEL: i32_4096:
308 ; CHECK-T2-NEXT: mov.w r2, #4096
309 ; CHECK-T2-NEXT: str r1, [r0, r2]
310 ; CHECK-T2-NEXT: add.w r0, r0, #4096
311 ; CHECK-T2-NEXT: bx lr
313 ; CHECK-ARM-LABEL: i32_4096:
314 ; CHECK-ARM: @ %bb.0:
315 ; CHECK-ARM-NEXT: mov r2, #4096
316 ; CHECK-ARM-NEXT: str r1, [r0, r2]!
317 ; CHECK-ARM-NEXT: bx lr
318 %o = getelementptr inbounds i8, i8* %p, i32 4096
319 %q = bitcast i8* %o to i32*
320 store i32 %v, i32* %q, align 4
324 define i8* @i32_m4095(i8* %p, i32 %v) {
325 ; CHECK-T1-LABEL: i32_m4095:
327 ; CHECK-T1-NEXT: ldr r2, .LCPI14_0
328 ; CHECK-T1-NEXT: str r1, [r0, r2]
329 ; CHECK-T1-NEXT: adds r0, r0, r2
330 ; CHECK-T1-NEXT: bx lr
331 ; CHECK-T1-NEXT: .p2align 2
332 ; CHECK-T1-NEXT: @ %bb.1:
333 ; CHECK-T1-NEXT: .LCPI14_0:
334 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
336 ; CHECK-T2-LABEL: i32_m4095:
338 ; CHECK-T2-NEXT: movw r2, #61441
339 ; CHECK-T2-NEXT: movt r2, #65535
340 ; CHECK-T2-NEXT: str r1, [r0, r2]
341 ; CHECK-T2-NEXT: subw r0, r0, #4095
342 ; CHECK-T2-NEXT: bx lr
344 ; CHECK-ARM-LABEL: i32_m4095:
345 ; CHECK-ARM: @ %bb.0:
346 ; CHECK-ARM-NEXT: str r1, [r0, #-4095]!
347 ; CHECK-ARM-NEXT: bx lr
348 %o = getelementptr inbounds i8, i8* %p, i32 -4095
349 %q = bitcast i8* %o to i32*
350 store i32 %v, i32* %q, align 4
354 define i8* @i32_m4096(i8* %p, i32 %v) {
355 ; CHECK-T1-LABEL: i32_m4096:
357 ; CHECK-T1-NEXT: ldr r2, .LCPI15_0
358 ; CHECK-T1-NEXT: str r1, [r0, r2]
359 ; CHECK-T1-NEXT: adds r0, r0, r2
360 ; CHECK-T1-NEXT: bx lr
361 ; CHECK-T1-NEXT: .p2align 2
362 ; CHECK-T1-NEXT: @ %bb.1:
363 ; CHECK-T1-NEXT: .LCPI15_0:
364 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
366 ; CHECK-T2-LABEL: i32_m4096:
368 ; CHECK-T2-NEXT: movw r2, #61440
369 ; CHECK-T2-NEXT: movt r2, #65535
370 ; CHECK-T2-NEXT: str r1, [r0, r2]
371 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
372 ; CHECK-T2-NEXT: bx lr
374 ; CHECK-ARM-LABEL: i32_m4096:
375 ; CHECK-ARM: @ %bb.0:
376 ; CHECK-ARM-NEXT: movw r2, #61440
377 ; CHECK-ARM-NEXT: movt r2, #65535
378 ; CHECK-ARM-NEXT: str r1, [r0, r2]!
379 ; CHECK-ARM-NEXT: bx lr
380 %o = getelementptr inbounds i8, i8* %p, i32 -4096
381 %q = bitcast i8* %o to i32*
382 store i32 %v, i32* %q, align 4
386 define i8* @i64_0(i8* %p, i64 %v) {
387 ; CHECK-T1-LABEL: i64_0:
389 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
390 ; CHECK-T1-NEXT: subs r0, #8
391 ; CHECK-T1-NEXT: bx lr
393 ; CHECK-T2-LABEL: i64_0:
395 ; CHECK-T2-NEXT: strd r2, r3, [r0]
396 ; CHECK-T2-NEXT: bx lr
398 ; CHECK-ARM-LABEL: i64_0:
399 ; CHECK-ARM: @ %bb.0:
400 ; CHECK-ARM-NEXT: mov r1, r3
401 ; CHECK-ARM-NEXT: str r2, [r0]
402 ; CHECK-ARM-NEXT: str r1, [r0, #4]
403 ; CHECK-ARM-NEXT: bx lr
404 %o = getelementptr inbounds i8, i8* %p, i32 0
405 %q = bitcast i8* %o to i64*
406 store i64 %v, i64* %q, align 8
410 define i8* @i64_3(i8* %p, i64 %v) {
411 ; CHECK-T1-LABEL: i64_3:
413 ; CHECK-T1-NEXT: movs r1, #3
414 ; CHECK-T1-NEXT: str r2, [r0, r1]
415 ; CHECK-T1-NEXT: adds r0, r0, #3
416 ; CHECK-T1-NEXT: str r3, [r0, #4]
417 ; CHECK-T1-NEXT: bx lr
419 ; CHECK-T2-LABEL: i64_3:
421 ; CHECK-T2-NEXT: str r2, [r0, #3]!
422 ; CHECK-T2-NEXT: str r3, [r0, #4]
423 ; CHECK-T2-NEXT: bx lr
425 ; CHECK-ARM-LABEL: i64_3:
426 ; CHECK-ARM: @ %bb.0:
427 ; CHECK-ARM-NEXT: str r2, [r0, #3]!
428 ; CHECK-ARM-NEXT: str r3, [r0, #4]
429 ; CHECK-ARM-NEXT: bx lr
430 %o = getelementptr inbounds i8, i8* %p, i32 3
431 %q = bitcast i8* %o to i64*
432 store i64 %v, i64* %q, align 8
436 define i8* @i64_4(i8* %p, i64 %v) {
437 ; CHECK-T1-LABEL: i64_4:
439 ; CHECK-T1-NEXT: str r2, [r0, #4]
440 ; CHECK-T1-NEXT: str r3, [r0, #8]
441 ; CHECK-T1-NEXT: adds r0, r0, #4
442 ; CHECK-T1-NEXT: bx lr
444 ; CHECK-T2-LABEL: i64_4:
446 ; CHECK-T2-NEXT: str r2, [r0, #4]!
447 ; CHECK-T2-NEXT: str r3, [r0, #4]
448 ; CHECK-T2-NEXT: bx lr
450 ; CHECK-ARM-LABEL: i64_4:
451 ; CHECK-ARM: @ %bb.0:
452 ; CHECK-ARM-NEXT: str r2, [r0, #4]!
453 ; CHECK-ARM-NEXT: str r3, [r0, #4]
454 ; CHECK-ARM-NEXT: bx lr
455 %o = getelementptr inbounds i8, i8* %p, i32 4
456 %q = bitcast i8* %o to i64*
457 store i64 %v, i64* %q, align 8
461 define i8* @i64_8(i8* %p, i64 %v) {
462 ; CHECK-T1-LABEL: i64_8:
464 ; CHECK-T1-NEXT: str r2, [r0, #8]
465 ; CHECK-T1-NEXT: str r3, [r0, #12]
466 ; CHECK-T1-NEXT: adds r0, #8
467 ; CHECK-T1-NEXT: bx lr
469 ; CHECK-T2-LABEL: i64_8:
471 ; CHECK-T2-NEXT: str r2, [r0, #8]!
472 ; CHECK-T2-NEXT: str r3, [r0, #4]
473 ; CHECK-T2-NEXT: bx lr
475 ; CHECK-ARM-LABEL: i64_8:
476 ; CHECK-ARM: @ %bb.0:
477 ; CHECK-ARM-NEXT: str r2, [r0, #8]!
478 ; CHECK-ARM-NEXT: str r3, [r0, #4]
479 ; CHECK-ARM-NEXT: bx lr
480 %o = getelementptr inbounds i8, i8* %p, i32 8
481 %q = bitcast i8* %o to i64*
482 store i64 %v, i64* %q, align 8
486 define i8* @i64_m1(i8* %p, i64 %v) {
487 ; CHECK-T1-LABEL: i64_m1:
489 ; CHECK-T1-NEXT: subs r0, r0, #1
490 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
491 ; CHECK-T1-NEXT: subs r0, #8
492 ; CHECK-T1-NEXT: bx lr
494 ; CHECK-T2-LABEL: i64_m1:
496 ; CHECK-T2-NEXT: str r2, [r0, #-1]!
497 ; CHECK-T2-NEXT: str r3, [r0, #4]
498 ; CHECK-T2-NEXT: bx lr
500 ; CHECK-ARM-LABEL: i64_m1:
501 ; CHECK-ARM: @ %bb.0:
502 ; CHECK-ARM-NEXT: str r2, [r0, #-1]!
503 ; CHECK-ARM-NEXT: str r3, [r0, #4]
504 ; CHECK-ARM-NEXT: bx lr
505 %o = getelementptr inbounds i8, i8* %p, i32 -1
506 %q = bitcast i8* %o to i64*
507 store i64 %v, i64* %q, align 8
511 define i8* @i64_m4(i8* %p, i64 %v) {
512 ; CHECK-T1-LABEL: i64_m4:
514 ; CHECK-T1-NEXT: str r3, [r0]
515 ; CHECK-T1-NEXT: subs r0, r0, #4
516 ; CHECK-T1-NEXT: str r2, [r0]
517 ; CHECK-T1-NEXT: bx lr
519 ; CHECK-T2-LABEL: i64_m4:
521 ; CHECK-T2-NEXT: str r3, [r0]
522 ; CHECK-T2-NEXT: str r2, [r0, #-4]!
523 ; CHECK-T2-NEXT: bx lr
525 ; CHECK-ARM-LABEL: i64_m4:
526 ; CHECK-ARM: @ %bb.0:
527 ; CHECK-ARM-NEXT: str r3, [r0]
528 ; CHECK-ARM-NEXT: str r2, [r0, #-4]!
529 ; CHECK-ARM-NEXT: bx lr
530 %o = getelementptr inbounds i8, i8* %p, i32 -4
531 %q = bitcast i8* %o to i64*
532 store i64 %v, i64* %q, align 8
536 define i8* @i64_252(i8* %p, i64 %v) {
537 ; CHECK-T1-LABEL: i64_252:
539 ; CHECK-T1-NEXT: movs r1, #252
540 ; CHECK-T1-NEXT: str r2, [r0, r1]
541 ; CHECK-T1-NEXT: adds r0, #252
542 ; CHECK-T1-NEXT: str r3, [r0, #4]
543 ; CHECK-T1-NEXT: bx lr
545 ; CHECK-T2-LABEL: i64_252:
547 ; CHECK-T2-NEXT: str r2, [r0, #252]!
548 ; CHECK-T2-NEXT: str r3, [r0, #4]
549 ; CHECK-T2-NEXT: bx lr
551 ; CHECK-ARM-LABEL: i64_252:
552 ; CHECK-ARM: @ %bb.0:
553 ; CHECK-ARM-NEXT: str r2, [r0, #252]!
554 ; CHECK-ARM-NEXT: str r3, [r0, #4]
555 ; CHECK-ARM-NEXT: bx lr
556 %o = getelementptr inbounds i8, i8* %p, i32 252
557 %q = bitcast i8* %o to i64*
558 store i64 %v, i64* %q, align 8
562 define i8* @i64_255(i8* %p, i64 %v) {
563 ; CHECK-T1-LABEL: i64_255:
565 ; CHECK-T1-NEXT: movs r1, #255
566 ; CHECK-T1-NEXT: str r2, [r0, r1]
567 ; CHECK-T1-NEXT: adds r0, #255
568 ; CHECK-T1-NEXT: str r3, [r0, #4]
569 ; CHECK-T1-NEXT: bx lr
571 ; CHECK-T2-LABEL: i64_255:
573 ; CHECK-T2-NEXT: str r2, [r0, #255]!
574 ; CHECK-T2-NEXT: str r3, [r0, #4]
575 ; CHECK-T2-NEXT: bx lr
577 ; CHECK-ARM-LABEL: i64_255:
578 ; CHECK-ARM: @ %bb.0:
579 ; CHECK-ARM-NEXT: str r2, [r0, #255]!
580 ; CHECK-ARM-NEXT: str r3, [r0, #4]
581 ; CHECK-ARM-NEXT: bx lr
582 %o = getelementptr inbounds i8, i8* %p, i32 255
583 %q = bitcast i8* %o to i64*
584 store i64 %v, i64* %q, align 8
588 define i8* @i64_256(i8* %p, i64 %v) {
589 ; CHECK-T1-LABEL: i64_256:
591 ; CHECK-T1-NEXT: movs r1, #1
592 ; CHECK-T1-NEXT: lsls r1, r1, #8
593 ; CHECK-T1-NEXT: str r2, [r0, r1]
594 ; CHECK-T1-NEXT: adds r0, r0, r1
595 ; CHECK-T1-NEXT: str r3, [r0, #4]
596 ; CHECK-T1-NEXT: bx lr
598 ; CHECK-T2-LABEL: i64_256:
600 ; CHECK-T2-NEXT: strd r2, r3, [r0, #256]
601 ; CHECK-T2-NEXT: add.w r0, r0, #256
602 ; CHECK-T2-NEXT: bx lr
604 ; CHECK-ARM-LABEL: i64_256:
605 ; CHECK-ARM: @ %bb.0:
606 ; CHECK-ARM-NEXT: str r2, [r0, #256]!
607 ; CHECK-ARM-NEXT: str r3, [r0, #4]
608 ; CHECK-ARM-NEXT: bx lr
609 %o = getelementptr inbounds i8, i8* %p, i32 256
610 %q = bitcast i8* %o to i64*
611 store i64 %v, i64* %q, align 8
615 define i8* @i64_m252(i8* %p, i64 %v) {
616 ; CHECK-T1-LABEL: i64_m252:
618 ; CHECK-T1-NEXT: subs r0, #252
619 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
620 ; CHECK-T1-NEXT: subs r0, #8
621 ; CHECK-T1-NEXT: bx lr
623 ; CHECK-T2-LABEL: i64_m252:
625 ; CHECK-T2-NEXT: str r2, [r0, #-252]!
626 ; CHECK-T2-NEXT: str r3, [r0, #4]
627 ; CHECK-T2-NEXT: bx lr
629 ; CHECK-ARM-LABEL: i64_m252:
630 ; CHECK-ARM: @ %bb.0:
631 ; CHECK-ARM-NEXT: str r2, [r0, #-252]!
632 ; CHECK-ARM-NEXT: str r3, [r0, #4]
633 ; CHECK-ARM-NEXT: bx lr
634 %o = getelementptr inbounds i8, i8* %p, i32 -252
635 %q = bitcast i8* %o to i64*
636 store i64 %v, i64* %q, align 8
640 define i8* @i64_m255(i8* %p, i64 %v) {
641 ; CHECK-T1-LABEL: i64_m255:
643 ; CHECK-T1-NEXT: subs r0, #255
644 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
645 ; CHECK-T1-NEXT: subs r0, #8
646 ; CHECK-T1-NEXT: bx lr
648 ; CHECK-T2-LABEL: i64_m255:
650 ; CHECK-T2-NEXT: str r2, [r0, #-255]!
651 ; CHECK-T2-NEXT: str r3, [r0, #4]
652 ; CHECK-T2-NEXT: bx lr
654 ; CHECK-ARM-LABEL: i64_m255:
655 ; CHECK-ARM: @ %bb.0:
656 ; CHECK-ARM-NEXT: str r2, [r0, #-255]!
657 ; CHECK-ARM-NEXT: str r3, [r0, #4]
658 ; CHECK-ARM-NEXT: bx lr
659 %o = getelementptr inbounds i8, i8* %p, i32 -255
660 %q = bitcast i8* %o to i64*
661 store i64 %v, i64* %q, align 8
665 define i8* @i64_m256(i8* %p, i64 %v) {
666 ; CHECK-T1-LABEL: i64_m256:
668 ; CHECK-T1-NEXT: movs r1, #255
669 ; CHECK-T1-NEXT: mvns r1, r1
670 ; CHECK-T1-NEXT: str r2, [r0, r1]
671 ; CHECK-T1-NEXT: adds r0, r0, r1
672 ; CHECK-T1-NEXT: str r3, [r0, #4]
673 ; CHECK-T1-NEXT: bx lr
675 ; CHECK-T2-LABEL: i64_m256:
677 ; CHECK-T2-NEXT: mvn r1, #255
678 ; CHECK-T2-NEXT: str r3, [r0, #-252]
679 ; CHECK-T2-NEXT: str r2, [r0, r1]
680 ; CHECK-T2-NEXT: sub.w r0, r0, #256
681 ; CHECK-T2-NEXT: bx lr
683 ; CHECK-ARM-LABEL: i64_m256:
684 ; CHECK-ARM: @ %bb.0:
685 ; CHECK-ARM-NEXT: str r2, [r0, #-256]!
686 ; CHECK-ARM-NEXT: str r3, [r0, #4]
687 ; CHECK-ARM-NEXT: bx lr
688 %o = getelementptr inbounds i8, i8* %p, i32 -256
689 %q = bitcast i8* %o to i64*
690 store i64 %v, i64* %q, align 8
694 define i8* @i64_4095(i8* %p, i64 %v) {
695 ; CHECK-T1-LABEL: i64_4095:
697 ; CHECK-T1-NEXT: ldr r1, .LCPI28_0
698 ; CHECK-T1-NEXT: str r2, [r0, r1]
699 ; CHECK-T1-NEXT: adds r0, r0, r1
700 ; CHECK-T1-NEXT: str r3, [r0, #4]
701 ; CHECK-T1-NEXT: bx lr
702 ; CHECK-T1-NEXT: .p2align 2
703 ; CHECK-T1-NEXT: @ %bb.1:
704 ; CHECK-T1-NEXT: .LCPI28_0:
705 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
707 ; CHECK-T2-LABEL: i64_4095:
709 ; CHECK-T2-NEXT: str.w r2, [r0, #4095]
710 ; CHECK-T2-NEXT: addw r0, r0, #4095
711 ; CHECK-T2-NEXT: str r3, [r0, #4]
712 ; CHECK-T2-NEXT: bx lr
714 ; CHECK-ARM-LABEL: i64_4095:
715 ; CHECK-ARM: @ %bb.0:
716 ; CHECK-ARM-NEXT: str r2, [r0, #4095]!
717 ; CHECK-ARM-NEXT: str r3, [r0, #4]
718 ; CHECK-ARM-NEXT: bx lr
719 %o = getelementptr inbounds i8, i8* %p, i32 4095
720 %q = bitcast i8* %o to i64*
721 store i64 %v, i64* %q, align 8
725 define i8* @i64_4096(i8* %p, i64 %v) {
726 ; CHECK-T1-LABEL: i64_4096:
728 ; CHECK-T1-NEXT: movs r1, #1
729 ; CHECK-T1-NEXT: lsls r1, r1, #12
730 ; CHECK-T1-NEXT: str r2, [r0, r1]
731 ; CHECK-T1-NEXT: adds r0, r0, r1
732 ; CHECK-T1-NEXT: str r3, [r0, #4]
733 ; CHECK-T1-NEXT: bx lr
735 ; CHECK-T2-LABEL: i64_4096:
737 ; CHECK-T2-NEXT: mov.w r1, #4096
738 ; CHECK-T2-NEXT: str r2, [r0, r1]
739 ; CHECK-T2-NEXT: add.w r0, r0, #4096
740 ; CHECK-T2-NEXT: str r3, [r0, #4]
741 ; CHECK-T2-NEXT: bx lr
743 ; CHECK-ARM-LABEL: i64_4096:
744 ; CHECK-ARM: @ %bb.0:
745 ; CHECK-ARM-NEXT: mov r1, #4096
746 ; CHECK-ARM-NEXT: str r2, [r0, r1]!
747 ; CHECK-ARM-NEXT: str r3, [r0, #4]
748 ; CHECK-ARM-NEXT: bx lr
749 %o = getelementptr inbounds i8, i8* %p, i32 4096
750 %q = bitcast i8* %o to i64*
751 store i64 %v, i64* %q, align 8
755 define i8* @i64_m4095(i8* %p, i64 %v) {
756 ; CHECK-T1-LABEL: i64_m4095:
758 ; CHECK-T1-NEXT: ldr r1, .LCPI30_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: .LCPI30_0:
766 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
768 ; CHECK-T2-LABEL: i64_m4095:
770 ; CHECK-T2-NEXT: movw r1, #61441
771 ; CHECK-T2-NEXT: movt r1, #65535
772 ; CHECK-T2-NEXT: str r2, [r0, r1]
773 ; CHECK-T2-NEXT: subw r0, r0, #4095
774 ; CHECK-T2-NEXT: str r3, [r0, #4]
775 ; CHECK-T2-NEXT: bx lr
777 ; CHECK-ARM-LABEL: i64_m4095:
778 ; CHECK-ARM: @ %bb.0:
779 ; CHECK-ARM-NEXT: str r2, [r0, #-4095]!
780 ; CHECK-ARM-NEXT: str r3, [r0, #4]
781 ; CHECK-ARM-NEXT: bx lr
782 %o = getelementptr inbounds i8, i8* %p, i32 -4095
783 %q = bitcast i8* %o to i64*
784 store i64 %v, i64* %q, align 8
788 define i8* @i64_m4096(i8* %p, i64 %v) {
789 ; CHECK-T1-LABEL: i64_m4096:
791 ; CHECK-T1-NEXT: ldr r1, .LCPI31_0
792 ; CHECK-T1-NEXT: str r2, [r0, r1]
793 ; CHECK-T1-NEXT: adds r0, r0, r1
794 ; CHECK-T1-NEXT: str r3, [r0, #4]
795 ; CHECK-T1-NEXT: bx lr
796 ; CHECK-T1-NEXT: .p2align 2
797 ; CHECK-T1-NEXT: @ %bb.1:
798 ; CHECK-T1-NEXT: .LCPI31_0:
799 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
801 ; CHECK-T2-LABEL: i64_m4096:
803 ; CHECK-T2-NEXT: movw r1, #61440
804 ; CHECK-T2-NEXT: movt r1, #65535
805 ; CHECK-T2-NEXT: str r2, [r0, r1]
806 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
807 ; CHECK-T2-NEXT: str r3, [r0, #4]
808 ; CHECK-T2-NEXT: bx lr
810 ; CHECK-ARM-LABEL: i64_m4096:
811 ; CHECK-ARM: @ %bb.0:
812 ; CHECK-ARM-NEXT: movw r1, #61440
813 ; CHECK-ARM-NEXT: movt r1, #65535
814 ; CHECK-ARM-NEXT: str r2, [r0, r1]!
815 ; CHECK-ARM-NEXT: str r3, [r0, #4]
816 ; CHECK-ARM-NEXT: bx lr
817 %o = getelementptr inbounds i8, i8* %p, i32 -4096
818 %q = bitcast i8* %o to i64*
819 store i64 %v, i64* %q, align 8
823 define i8* @i128_0(i8* %p, i128 %v) {
824 ; CHECK-T1-LABEL: i128_0:
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: stm r0!, {r2, r3}
831 ; CHECK-T1-NEXT: subs r0, #8
832 ; CHECK-T1-NEXT: bx lr
834 ; CHECK-T2-LABEL: i128_0:
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: str r1, [r0, #8]
840 ; CHECK-T2-NEXT: strd r2, r3, [r0]
841 ; CHECK-T2-NEXT: bx lr
843 ; CHECK-ARM-LABEL: i128_0:
844 ; CHECK-ARM: @ %bb.0:
845 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
846 ; CHECK-ARM-NEXT: stm r0, {r2, r3}
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, i8* %p, i32 0
851 %q = bitcast i8* %o to i128*
852 store i128 %v, i128* %q, align 16
856 define i8* @i128_3(i8* %p, i128 %v) {
857 ; CHECK-T1-LABEL: i128_3:
859 ; CHECK-T1-NEXT: movs r1, #3
860 ; CHECK-T1-NEXT: str r2, [r0, r1]
861 ; CHECK-T1-NEXT: adds r0, r0, #3
862 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
863 ; CHECK-T1-NEXT: str r1, [r0, #12]
864 ; CHECK-T1-NEXT: ldr r1, [sp]
865 ; CHECK-T1-NEXT: str r1, [r0, #8]
866 ; CHECK-T1-NEXT: str r3, [r0, #4]
867 ; CHECK-T1-NEXT: bx lr
869 ; CHECK-T2-LABEL: i128_3:
871 ; CHECK-T2-NEXT: str r2, [r0, #3]!
872 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
873 ; CHECK-T2-NEXT: str r1, [r0, #12]
874 ; CHECK-T2-NEXT: ldr r1, [sp]
875 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
876 ; CHECK-T2-NEXT: bx lr
878 ; CHECK-ARM-LABEL: i128_3:
879 ; CHECK-ARM: @ %bb.0:
880 ; CHECK-ARM-NEXT: str r2, [r0, #3]!
881 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
882 ; CHECK-ARM-NEXT: str r3, [r0, #4]
883 ; CHECK-ARM-NEXT: str r1, [r0, #8]
884 ; CHECK-ARM-NEXT: str r12, [r0, #12]
885 ; CHECK-ARM-NEXT: bx lr
886 %o = getelementptr inbounds i8, i8* %p, i32 3
887 %q = bitcast i8* %o to i128*
888 store i128 %v, i128* %q, align 16
892 define i8* @i128_4(i8* %p, i128 %v) {
893 ; CHECK-T1-LABEL: i128_4:
895 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
896 ; CHECK-T1-NEXT: str r1, [r0, #16]
897 ; CHECK-T1-NEXT: ldr r1, [sp]
898 ; CHECK-T1-NEXT: str r1, [r0, #12]
899 ; CHECK-T1-NEXT: str r3, [r0, #8]
900 ; CHECK-T1-NEXT: str r2, [r0, #4]
901 ; CHECK-T1-NEXT: adds r0, r0, #4
902 ; CHECK-T1-NEXT: bx lr
904 ; CHECK-T2-LABEL: i128_4:
906 ; CHECK-T2-NEXT: str r2, [r0, #4]!
907 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
908 ; CHECK-T2-NEXT: str r1, [r0, #12]
909 ; CHECK-T2-NEXT: ldr r1, [sp]
910 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
911 ; CHECK-T2-NEXT: bx lr
913 ; CHECK-ARM-LABEL: i128_4:
914 ; CHECK-ARM: @ %bb.0:
915 ; CHECK-ARM-NEXT: str r2, [r0, #4]!
916 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
917 ; CHECK-ARM-NEXT: str r3, [r0, #4]
918 ; CHECK-ARM-NEXT: str r1, [r0, #8]
919 ; CHECK-ARM-NEXT: str r12, [r0, #12]
920 ; CHECK-ARM-NEXT: bx lr
921 %o = getelementptr inbounds i8, i8* %p, i32 4
922 %q = bitcast i8* %o to i128*
923 store i128 %v, i128* %q, align 16
927 define i8* @i128_8(i8* %p, i128 %v) {
928 ; CHECK-T1-LABEL: i128_8:
930 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
931 ; CHECK-T1-NEXT: str r1, [r0, #20]
932 ; CHECK-T1-NEXT: ldr r1, [sp]
933 ; CHECK-T1-NEXT: str r1, [r0, #16]
934 ; CHECK-T1-NEXT: str r3, [r0, #12]
935 ; CHECK-T1-NEXT: str r2, [r0, #8]
936 ; CHECK-T1-NEXT: adds r0, #8
937 ; CHECK-T1-NEXT: bx lr
939 ; CHECK-T2-LABEL: i128_8:
941 ; CHECK-T2-NEXT: str r2, [r0, #8]!
942 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
943 ; CHECK-T2-NEXT: str r1, [r0, #12]
944 ; CHECK-T2-NEXT: ldr r1, [sp]
945 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
946 ; CHECK-T2-NEXT: bx lr
948 ; CHECK-ARM-LABEL: i128_8:
949 ; CHECK-ARM: @ %bb.0:
950 ; CHECK-ARM-NEXT: str r2, [r0, #8]!
951 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
952 ; CHECK-ARM-NEXT: str r3, [r0, #4]
953 ; CHECK-ARM-NEXT: str r1, [r0, #8]
954 ; CHECK-ARM-NEXT: str r12, [r0, #12]
955 ; CHECK-ARM-NEXT: bx lr
956 %o = getelementptr inbounds i8, i8* %p, i32 8
957 %q = bitcast i8* %o to i128*
958 store i128 %v, i128* %q, align 16
962 define i8* @i128_16(i8* %p, i128 %v) {
963 ; CHECK-T1-LABEL: i128_16:
965 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
966 ; CHECK-T1-NEXT: str r1, [r0, #28]
967 ; CHECK-T1-NEXT: ldr r1, [sp]
968 ; CHECK-T1-NEXT: str r1, [r0, #24]
969 ; CHECK-T1-NEXT: str r3, [r0, #20]
970 ; CHECK-T1-NEXT: str r2, [r0, #16]
971 ; CHECK-T1-NEXT: adds r0, #16
972 ; CHECK-T1-NEXT: bx lr
974 ; CHECK-T2-LABEL: i128_16:
976 ; CHECK-T2-NEXT: str r2, [r0, #16]!
977 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
978 ; CHECK-T2-NEXT: str r1, [r0, #12]
979 ; CHECK-T2-NEXT: ldr r1, [sp]
980 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
981 ; CHECK-T2-NEXT: bx lr
983 ; CHECK-ARM-LABEL: i128_16:
984 ; CHECK-ARM: @ %bb.0:
985 ; CHECK-ARM-NEXT: str r2, [r0, #16]!
986 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
987 ; CHECK-ARM-NEXT: str r3, [r0, #4]
988 ; CHECK-ARM-NEXT: str r1, [r0, #8]
989 ; CHECK-ARM-NEXT: str r12, [r0, #12]
990 ; CHECK-ARM-NEXT: bx lr
991 %o = getelementptr inbounds i8, i8* %p, i32 16
992 %q = bitcast i8* %o to i128*
993 store i128 %v, i128* %q, align 16
997 define i8* @i128_m1(i8* %p, i128 %v) {
998 ; CHECK-T1-LABEL: i128_m1:
1000 ; CHECK-T1-NEXT: subs r0, r0, #1
1001 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
1002 ; CHECK-T1-NEXT: str r1, [r0, #12]
1003 ; CHECK-T1-NEXT: ldr r1, [sp]
1004 ; CHECK-T1-NEXT: str r1, [r0, #8]
1005 ; CHECK-T1-NEXT: stm r0!, {r2, r3}
1006 ; CHECK-T1-NEXT: subs r0, #8
1007 ; CHECK-T1-NEXT: bx lr
1009 ; CHECK-T2-LABEL: i128_m1:
1010 ; CHECK-T2: @ %bb.0:
1011 ; CHECK-T2-NEXT: str r2, [r0, #-1]!
1012 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
1013 ; CHECK-T2-NEXT: str r1, [r0, #12]
1014 ; CHECK-T2-NEXT: ldr r1, [sp]
1015 ; CHECK-T2-NEXT: strd r3, r1, [r0, #4]
1016 ; CHECK-T2-NEXT: bx lr
1018 ; CHECK-ARM-LABEL: i128_m1:
1019 ; CHECK-ARM: @ %bb.0:
1020 ; CHECK-ARM-NEXT: str r2, [r0, #-1]!
1021 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
1022 ; CHECK-ARM-NEXT: str r3, [r0, #4]
1023 ; CHECK-ARM-NEXT: str r1, [r0, #8]
1024 ; CHECK-ARM-NEXT: str r12, [r0, #12]
1025 ; CHECK-ARM-NEXT: bx lr
1026 %o = getelementptr inbounds i8, i8* %p, i32 -1
1027 %q = bitcast i8* %o to i128*
1028 store i128 %v, i128* %q, align 16
1032 define i8* @i128_m4(i8* %p, i128 %v) {
1033 ; CHECK-T1-LABEL: i128_m4:
1034 ; CHECK-T1: @ %bb.0:
1035 ; CHECK-T1-NEXT: ldr r1, [sp, #4]
1036 ; CHECK-T1-NEXT: str r1, [r0, #8]
1037 ; CHECK-T1-NEXT: ldr r1, [sp]
1038 ; CHECK-T1-NEXT: str r1, [r0, #4]
1039 ; CHECK-T1-NEXT: str r3, [r0]
1040 ; CHECK-T1-NEXT: subs r0, r0, #4
1041 ; CHECK-T1-NEXT: str r2, [r0]
1042 ; CHECK-T1-NEXT: bx lr
1044 ; CHECK-T2-LABEL: i128_m4:
1045 ; CHECK-T2: @ %bb.0:
1046 ; CHECK-T2-NEXT: ldr r1, [sp, #4]
1047 ; CHECK-T2-NEXT: str r1, [r0, #8]
1048 ; CHECK-T2-NEXT: ldr r1, [sp]
1049 ; CHECK-T2-NEXT: strd r3, r1, [r0]
1050 ; CHECK-T2-NEXT: str r2, [r0, #-4]!
1051 ; CHECK-T2-NEXT: bx lr
1053 ; CHECK-ARM-LABEL: i128_m4:
1054 ; CHECK-ARM: @ %bb.0:
1055 ; CHECK-ARM-NEXT: ldm sp, {r1, r12}
1056 ; CHECK-ARM-NEXT: str r3, [r0]
1057 ; CHECK-ARM-NEXT: stmib r0, {r1, r12}
1058 ; CHECK-ARM-NEXT: str r2, [r0, #-4]!
1059 ; CHECK-ARM-NEXT: bx lr
1060 %o = getelementptr inbounds i8, i8* %p, i32 -4
1061 %q = bitcast i8* %o to i128*
1062 store i128 %v, i128* %q, align 16
1066 define i8* @i16_0(i8* %p, i16 %v) {
1067 ; CHECK-LABEL: i16_0:
1069 ; CHECK-NEXT: strh r1, [r0]
1071 %o = getelementptr inbounds i8, i8* %p, i32 0
1072 %q = bitcast i8* %o to i16*
1073 store i16 %v, i16* %q, align 2
1077 define i8* @i16_3(i8* %p, i16 %v) {
1078 ; CHECK-T1-LABEL: i16_3:
1079 ; CHECK-T1: @ %bb.0:
1080 ; CHECK-T1-NEXT: movs r2, #3
1081 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1082 ; CHECK-T1-NEXT: adds r0, r0, #3
1083 ; CHECK-T1-NEXT: bx lr
1085 ; CHECK-T2-LABEL: i16_3:
1086 ; CHECK-T2: @ %bb.0:
1087 ; CHECK-T2-NEXT: strh r1, [r0, #3]!
1088 ; CHECK-T2-NEXT: bx lr
1090 ; CHECK-ARM-LABEL: i16_3:
1091 ; CHECK-ARM: @ %bb.0:
1092 ; CHECK-ARM-NEXT: strh r1, [r0, #3]!
1093 ; CHECK-ARM-NEXT: bx lr
1094 %o = getelementptr inbounds i8, i8* %p, i32 3
1095 %q = bitcast i8* %o to i16*
1096 store i16 %v, i16* %q, align 2
1100 define i8* @i16_4(i8* %p, i16 %v) {
1101 ; CHECK-T1-LABEL: i16_4:
1102 ; CHECK-T1: @ %bb.0:
1103 ; CHECK-T1-NEXT: strh r1, [r0, #4]
1104 ; CHECK-T1-NEXT: adds r0, r0, #4
1105 ; CHECK-T1-NEXT: bx lr
1107 ; CHECK-T2-LABEL: i16_4:
1108 ; CHECK-T2: @ %bb.0:
1109 ; CHECK-T2-NEXT: strh r1, [r0, #4]!
1110 ; CHECK-T2-NEXT: bx lr
1112 ; CHECK-ARM-LABEL: i16_4:
1113 ; CHECK-ARM: @ %bb.0:
1114 ; CHECK-ARM-NEXT: strh r1, [r0, #4]!
1115 ; CHECK-ARM-NEXT: bx lr
1116 %o = getelementptr inbounds i8, i8* %p, i32 4
1117 %q = bitcast i8* %o to i16*
1118 store i16 %v, i16* %q, align 2
1122 define i8* @i16_8(i8* %p, i16 %v) {
1123 ; CHECK-T1-LABEL: i16_8:
1124 ; CHECK-T1: @ %bb.0:
1125 ; CHECK-T1-NEXT: strh r1, [r0, #8]
1126 ; CHECK-T1-NEXT: adds r0, #8
1127 ; CHECK-T1-NEXT: bx lr
1129 ; CHECK-T2-LABEL: i16_8:
1130 ; CHECK-T2: @ %bb.0:
1131 ; CHECK-T2-NEXT: strh r1, [r0, #8]!
1132 ; CHECK-T2-NEXT: bx lr
1134 ; CHECK-ARM-LABEL: i16_8:
1135 ; CHECK-ARM: @ %bb.0:
1136 ; CHECK-ARM-NEXT: strh r1, [r0, #8]!
1137 ; CHECK-ARM-NEXT: bx lr
1138 %o = getelementptr inbounds i8, i8* %p, i32 8
1139 %q = bitcast i8* %o to i16*
1140 store i16 %v, i16* %q, align 2
1144 define i8* @i16_m1(i8* %p, i16 %v) {
1145 ; CHECK-T1-LABEL: i16_m1:
1146 ; CHECK-T1: @ %bb.0:
1147 ; CHECK-T1-NEXT: subs r0, r0, #1
1148 ; CHECK-T1-NEXT: strh r1, [r0]
1149 ; CHECK-T1-NEXT: bx lr
1151 ; CHECK-T2-LABEL: i16_m1:
1152 ; CHECK-T2: @ %bb.0:
1153 ; CHECK-T2-NEXT: strh r1, [r0, #-1]!
1154 ; CHECK-T2-NEXT: bx lr
1156 ; CHECK-ARM-LABEL: i16_m1:
1157 ; CHECK-ARM: @ %bb.0:
1158 ; CHECK-ARM-NEXT: strh r1, [r0, #-1]!
1159 ; CHECK-ARM-NEXT: bx lr
1160 %o = getelementptr inbounds i8, i8* %p, i32 -1
1161 %q = bitcast i8* %o to i16*
1162 store i16 %v, i16* %q, align 2
1166 define i8* @i16_m4(i8* %p, i16 %v) {
1167 ; CHECK-T1-LABEL: i16_m4:
1168 ; CHECK-T1: @ %bb.0:
1169 ; CHECK-T1-NEXT: subs r0, r0, #4
1170 ; CHECK-T1-NEXT: strh r1, [r0]
1171 ; CHECK-T1-NEXT: bx lr
1173 ; CHECK-T2-LABEL: i16_m4:
1174 ; CHECK-T2: @ %bb.0:
1175 ; CHECK-T2-NEXT: strh r1, [r0, #-4]!
1176 ; CHECK-T2-NEXT: bx lr
1178 ; CHECK-ARM-LABEL: i16_m4:
1179 ; CHECK-ARM: @ %bb.0:
1180 ; CHECK-ARM-NEXT: strh r1, [r0, #-4]!
1181 ; CHECK-ARM-NEXT: bx lr
1182 %o = getelementptr inbounds i8, i8* %p, i32 -4
1183 %q = bitcast i8* %o to i16*
1184 store i16 %v, i16* %q, align 2
1188 define i8* @i16_252(i8* %p, i16 %v) {
1189 ; CHECK-T1-LABEL: i16_252:
1190 ; CHECK-T1: @ %bb.0:
1191 ; CHECK-T1-NEXT: movs r2, #252
1192 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1193 ; CHECK-T1-NEXT: adds r0, #252
1194 ; CHECK-T1-NEXT: bx lr
1196 ; CHECK-T2-LABEL: i16_252:
1197 ; CHECK-T2: @ %bb.0:
1198 ; CHECK-T2-NEXT: strh r1, [r0, #252]!
1199 ; CHECK-T2-NEXT: bx lr
1201 ; CHECK-ARM-LABEL: i16_252:
1202 ; CHECK-ARM: @ %bb.0:
1203 ; CHECK-ARM-NEXT: strh r1, [r0, #252]!
1204 ; CHECK-ARM-NEXT: bx lr
1205 %o = getelementptr inbounds i8, i8* %p, i32 252
1206 %q = bitcast i8* %o to i16*
1207 store i16 %v, i16* %q, align 2
1211 define i8* @i16_255(i8* %p, i16 %v) {
1212 ; CHECK-T1-LABEL: i16_255:
1213 ; CHECK-T1: @ %bb.0:
1214 ; CHECK-T1-NEXT: movs r2, #255
1215 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1216 ; CHECK-T1-NEXT: adds r0, #255
1217 ; CHECK-T1-NEXT: bx lr
1219 ; CHECK-T2-LABEL: i16_255:
1220 ; CHECK-T2: @ %bb.0:
1221 ; CHECK-T2-NEXT: strh r1, [r0, #255]!
1222 ; CHECK-T2-NEXT: bx lr
1224 ; CHECK-ARM-LABEL: i16_255:
1225 ; CHECK-ARM: @ %bb.0:
1226 ; CHECK-ARM-NEXT: strh r1, [r0, #255]!
1227 ; CHECK-ARM-NEXT: bx lr
1228 %o = getelementptr inbounds i8, i8* %p, i32 255
1229 %q = bitcast i8* %o to i16*
1230 store i16 %v, i16* %q, align 2
1234 define i8* @i16_256(i8* %p, i16 %v) {
1235 ; CHECK-T1-LABEL: i16_256:
1236 ; CHECK-T1: @ %bb.0:
1237 ; CHECK-T1-NEXT: movs r2, #1
1238 ; CHECK-T1-NEXT: lsls r2, r2, #8
1239 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1240 ; CHECK-T1-NEXT: adds r0, r0, r2
1241 ; CHECK-T1-NEXT: bx lr
1243 ; CHECK-T2-LABEL: i16_256:
1244 ; CHECK-T2: @ %bb.0:
1245 ; CHECK-T2-NEXT: strh.w r1, [r0, #256]
1246 ; CHECK-T2-NEXT: add.w r0, r0, #256
1247 ; CHECK-T2-NEXT: bx lr
1249 ; CHECK-ARM-LABEL: i16_256:
1250 ; CHECK-ARM: @ %bb.0:
1251 ; CHECK-ARM-NEXT: mov r2, #256
1252 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1253 ; CHECK-ARM-NEXT: bx lr
1254 %o = getelementptr inbounds i8, i8* %p, i32 256
1255 %q = bitcast i8* %o to i16*
1256 store i16 %v, i16* %q, align 2
1260 define i8* @i16_m252(i8* %p, i16 %v) {
1261 ; CHECK-T1-LABEL: i16_m252:
1262 ; CHECK-T1: @ %bb.0:
1263 ; CHECK-T1-NEXT: subs r0, #252
1264 ; CHECK-T1-NEXT: strh r1, [r0]
1265 ; CHECK-T1-NEXT: bx lr
1267 ; CHECK-T2-LABEL: i16_m252:
1268 ; CHECK-T2: @ %bb.0:
1269 ; CHECK-T2-NEXT: strh r1, [r0, #-252]!
1270 ; CHECK-T2-NEXT: bx lr
1272 ; CHECK-ARM-LABEL: i16_m252:
1273 ; CHECK-ARM: @ %bb.0:
1274 ; CHECK-ARM-NEXT: strh r1, [r0, #-252]!
1275 ; CHECK-ARM-NEXT: bx lr
1276 %o = getelementptr inbounds i8, i8* %p, i32 -252
1277 %q = bitcast i8* %o to i16*
1278 store i16 %v, i16* %q, align 2
1282 define i8* @i16_m255(i8* %p, i16 %v) {
1283 ; CHECK-T1-LABEL: i16_m255:
1284 ; CHECK-T1: @ %bb.0:
1285 ; CHECK-T1-NEXT: subs r0, #255
1286 ; CHECK-T1-NEXT: strh r1, [r0]
1287 ; CHECK-T1-NEXT: bx lr
1289 ; CHECK-T2-LABEL: i16_m255:
1290 ; CHECK-T2: @ %bb.0:
1291 ; CHECK-T2-NEXT: strh r1, [r0, #-255]!
1292 ; CHECK-T2-NEXT: bx lr
1294 ; CHECK-ARM-LABEL: i16_m255:
1295 ; CHECK-ARM: @ %bb.0:
1296 ; CHECK-ARM-NEXT: strh r1, [r0, #-255]!
1297 ; CHECK-ARM-NEXT: bx lr
1298 %o = getelementptr inbounds i8, i8* %p, i32 -255
1299 %q = bitcast i8* %o to i16*
1300 store i16 %v, i16* %q, align 2
1304 define i8* @i16_m256(i8* %p, i16 %v) {
1305 ; CHECK-T1-LABEL: i16_m256:
1306 ; CHECK-T1: @ %bb.0:
1307 ; CHECK-T1-NEXT: movs r2, #255
1308 ; CHECK-T1-NEXT: mvns r2, r2
1309 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1310 ; CHECK-T1-NEXT: adds r0, r0, r2
1311 ; CHECK-T1-NEXT: bx lr
1313 ; CHECK-T2-LABEL: i16_m256:
1314 ; CHECK-T2: @ %bb.0:
1315 ; CHECK-T2-NEXT: mvn r2, #255
1316 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1317 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1318 ; CHECK-T2-NEXT: bx lr
1320 ; CHECK-ARM-LABEL: i16_m256:
1321 ; CHECK-ARM: @ %bb.0:
1322 ; CHECK-ARM-NEXT: mvn r2, #255
1323 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1324 ; CHECK-ARM-NEXT: bx lr
1325 %o = getelementptr inbounds i8, i8* %p, i32 -256
1326 %q = bitcast i8* %o to i16*
1327 store i16 %v, i16* %q, align 2
1331 define i8* @i16_4095(i8* %p, i16 %v) {
1332 ; CHECK-T1-LABEL: i16_4095:
1333 ; CHECK-T1: @ %bb.0:
1334 ; CHECK-T1-NEXT: ldr r2, .LCPI51_0
1335 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1336 ; CHECK-T1-NEXT: adds r0, r0, r2
1337 ; CHECK-T1-NEXT: bx lr
1338 ; CHECK-T1-NEXT: .p2align 2
1339 ; CHECK-T1-NEXT: @ %bb.1:
1340 ; CHECK-T1-NEXT: .LCPI51_0:
1341 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1343 ; CHECK-T2-LABEL: i16_4095:
1344 ; CHECK-T2: @ %bb.0:
1345 ; CHECK-T2-NEXT: strh.w r1, [r0, #4095]
1346 ; CHECK-T2-NEXT: addw r0, r0, #4095
1347 ; CHECK-T2-NEXT: bx lr
1349 ; CHECK-ARM-LABEL: i16_4095:
1350 ; CHECK-ARM: @ %bb.0:
1351 ; CHECK-ARM-NEXT: movw r2, #4095
1352 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1353 ; CHECK-ARM-NEXT: bx lr
1354 %o = getelementptr inbounds i8, i8* %p, i32 4095
1355 %q = bitcast i8* %o to i16*
1356 store i16 %v, i16* %q, align 2
1360 define i8* @i16_4096(i8* %p, i16 %v) {
1361 ; CHECK-T1-LABEL: i16_4096:
1362 ; CHECK-T1: @ %bb.0:
1363 ; CHECK-T1-NEXT: movs r2, #1
1364 ; CHECK-T1-NEXT: lsls r2, r2, #12
1365 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1366 ; CHECK-T1-NEXT: adds r0, r0, r2
1367 ; CHECK-T1-NEXT: bx lr
1369 ; CHECK-T2-LABEL: i16_4096:
1370 ; CHECK-T2: @ %bb.0:
1371 ; CHECK-T2-NEXT: mov.w r2, #4096
1372 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1373 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1374 ; CHECK-T2-NEXT: bx lr
1376 ; CHECK-ARM-LABEL: i16_4096:
1377 ; CHECK-ARM: @ %bb.0:
1378 ; CHECK-ARM-NEXT: mov r2, #4096
1379 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1380 ; CHECK-ARM-NEXT: bx lr
1381 %o = getelementptr inbounds i8, i8* %p, i32 4096
1382 %q = bitcast i8* %o to i16*
1383 store i16 %v, i16* %q, align 2
1387 define i8* @i16_m4095(i8* %p, i16 %v) {
1388 ; CHECK-T1-LABEL: i16_m4095:
1389 ; CHECK-T1: @ %bb.0:
1390 ; CHECK-T1-NEXT: ldr r2, .LCPI53_0
1391 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1392 ; CHECK-T1-NEXT: adds r0, r0, r2
1393 ; CHECK-T1-NEXT: bx lr
1394 ; CHECK-T1-NEXT: .p2align 2
1395 ; CHECK-T1-NEXT: @ %bb.1:
1396 ; CHECK-T1-NEXT: .LCPI53_0:
1397 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1399 ; CHECK-T2-LABEL: i16_m4095:
1400 ; CHECK-T2: @ %bb.0:
1401 ; CHECK-T2-NEXT: movw r2, #61441
1402 ; CHECK-T2-NEXT: movt r2, #65535
1403 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1404 ; CHECK-T2-NEXT: subw r0, r0, #4095
1405 ; CHECK-T2-NEXT: bx lr
1407 ; CHECK-ARM-LABEL: i16_m4095:
1408 ; CHECK-ARM: @ %bb.0:
1409 ; CHECK-ARM-NEXT: movw r2, #61441
1410 ; CHECK-ARM-NEXT: movt r2, #65535
1411 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1412 ; CHECK-ARM-NEXT: bx lr
1413 %o = getelementptr inbounds i8, i8* %p, i32 -4095
1414 %q = bitcast i8* %o to i16*
1415 store i16 %v, i16* %q, align 2
1419 define i8* @i16_m4096(i8* %p, i16 %v) {
1420 ; CHECK-T1-LABEL: i16_m4096:
1421 ; CHECK-T1: @ %bb.0:
1422 ; CHECK-T1-NEXT: ldr r2, .LCPI54_0
1423 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1424 ; CHECK-T1-NEXT: adds r0, r0, r2
1425 ; CHECK-T1-NEXT: bx lr
1426 ; CHECK-T1-NEXT: .p2align 2
1427 ; CHECK-T1-NEXT: @ %bb.1:
1428 ; CHECK-T1-NEXT: .LCPI54_0:
1429 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1431 ; CHECK-T2-LABEL: i16_m4096:
1432 ; CHECK-T2: @ %bb.0:
1433 ; CHECK-T2-NEXT: movw r2, #61440
1434 ; CHECK-T2-NEXT: movt r2, #65535
1435 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1436 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1437 ; CHECK-T2-NEXT: bx lr
1439 ; CHECK-ARM-LABEL: i16_m4096:
1440 ; CHECK-ARM: @ %bb.0:
1441 ; CHECK-ARM-NEXT: movw r2, #61440
1442 ; CHECK-ARM-NEXT: movt r2, #65535
1443 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1444 ; CHECK-ARM-NEXT: bx lr
1445 %o = getelementptr inbounds i8, i8* %p, i32 -4096
1446 %q = bitcast i8* %o to i16*
1447 store i16 %v, i16* %q, align 2
1451 define i8* @i8_0(i8* %p, i8 %v) {
1452 ; CHECK-LABEL: i8_0:
1454 ; CHECK-NEXT: strb r1, [r0]
1456 %o = getelementptr inbounds i8, i8* %p, i32 0
1457 %q = bitcast i8* %o to i8*
1458 store i8 %v, i8* %q, align 1
1462 define i8* @i8_3(i8* %p, i8 %v) {
1463 ; CHECK-T1-LABEL: i8_3:
1464 ; CHECK-T1: @ %bb.0:
1465 ; CHECK-T1-NEXT: strb r1, [r0, #3]
1466 ; CHECK-T1-NEXT: adds r0, r0, #3
1467 ; CHECK-T1-NEXT: bx lr
1469 ; CHECK-T2-LABEL: i8_3:
1470 ; CHECK-T2: @ %bb.0:
1471 ; CHECK-T2-NEXT: strb r1, [r0, #3]!
1472 ; CHECK-T2-NEXT: bx lr
1474 ; CHECK-ARM-LABEL: i8_3:
1475 ; CHECK-ARM: @ %bb.0:
1476 ; CHECK-ARM-NEXT: strb r1, [r0, #3]!
1477 ; CHECK-ARM-NEXT: bx lr
1478 %o = getelementptr inbounds i8, i8* %p, i32 3
1479 %q = bitcast i8* %o to i8*
1480 store i8 %v, i8* %q, align 1
1484 define i8* @i8_4(i8* %p, i8 %v) {
1485 ; CHECK-T1-LABEL: i8_4:
1486 ; CHECK-T1: @ %bb.0:
1487 ; CHECK-T1-NEXT: strb r1, [r0, #4]
1488 ; CHECK-T1-NEXT: adds r0, r0, #4
1489 ; CHECK-T1-NEXT: bx lr
1491 ; CHECK-T2-LABEL: i8_4:
1492 ; CHECK-T2: @ %bb.0:
1493 ; CHECK-T2-NEXT: strb r1, [r0, #4]!
1494 ; CHECK-T2-NEXT: bx lr
1496 ; CHECK-ARM-LABEL: i8_4:
1497 ; CHECK-ARM: @ %bb.0:
1498 ; CHECK-ARM-NEXT: strb r1, [r0, #4]!
1499 ; CHECK-ARM-NEXT: bx lr
1500 %o = getelementptr inbounds i8, i8* %p, i32 4
1501 %q = bitcast i8* %o to i8*
1502 store i8 %v, i8* %q, align 1
1506 define i8* @i8_8(i8* %p, i8 %v) {
1507 ; CHECK-T1-LABEL: i8_8:
1508 ; CHECK-T1: @ %bb.0:
1509 ; CHECK-T1-NEXT: strb r1, [r0, #8]
1510 ; CHECK-T1-NEXT: adds r0, #8
1511 ; CHECK-T1-NEXT: bx lr
1513 ; CHECK-T2-LABEL: i8_8:
1514 ; CHECK-T2: @ %bb.0:
1515 ; CHECK-T2-NEXT: strb r1, [r0, #8]!
1516 ; CHECK-T2-NEXT: bx lr
1518 ; CHECK-ARM-LABEL: i8_8:
1519 ; CHECK-ARM: @ %bb.0:
1520 ; CHECK-ARM-NEXT: strb r1, [r0, #8]!
1521 ; CHECK-ARM-NEXT: bx lr
1522 %o = getelementptr inbounds i8, i8* %p, i32 8
1523 %q = bitcast i8* %o to i8*
1524 store i8 %v, i8* %q, align 1
1528 define i8* @i8_m1(i8* %p, i8 %v) {
1529 ; CHECK-T1-LABEL: i8_m1:
1530 ; CHECK-T1: @ %bb.0:
1531 ; CHECK-T1-NEXT: subs r0, r0, #1
1532 ; CHECK-T1-NEXT: strb r1, [r0]
1533 ; CHECK-T1-NEXT: bx lr
1535 ; CHECK-T2-LABEL: i8_m1:
1536 ; CHECK-T2: @ %bb.0:
1537 ; CHECK-T2-NEXT: strb r1, [r0, #-1]!
1538 ; CHECK-T2-NEXT: bx lr
1540 ; CHECK-ARM-LABEL: i8_m1:
1541 ; CHECK-ARM: @ %bb.0:
1542 ; CHECK-ARM-NEXT: strb r1, [r0, #-1]!
1543 ; CHECK-ARM-NEXT: bx lr
1544 %o = getelementptr inbounds i8, i8* %p, i32 -1
1545 %q = bitcast i8* %o to i8*
1546 store i8 %v, i8* %q, align 1
1550 define i8* @i8_m4(i8* %p, i8 %v) {
1551 ; CHECK-T1-LABEL: i8_m4:
1552 ; CHECK-T1: @ %bb.0:
1553 ; CHECK-T1-NEXT: subs r0, r0, #4
1554 ; CHECK-T1-NEXT: strb r1, [r0]
1555 ; CHECK-T1-NEXT: bx lr
1557 ; CHECK-T2-LABEL: i8_m4:
1558 ; CHECK-T2: @ %bb.0:
1559 ; CHECK-T2-NEXT: strb r1, [r0, #-4]!
1560 ; CHECK-T2-NEXT: bx lr
1562 ; CHECK-ARM-LABEL: i8_m4:
1563 ; CHECK-ARM: @ %bb.0:
1564 ; CHECK-ARM-NEXT: strb r1, [r0, #-4]!
1565 ; CHECK-ARM-NEXT: bx lr
1566 %o = getelementptr inbounds i8, i8* %p, i32 -4
1567 %q = bitcast i8* %o to i8*
1568 store i8 %v, i8* %q, align 1
1572 define i8* @i8_252(i8* %p, i8 %v) {
1573 ; CHECK-T1-LABEL: i8_252:
1574 ; CHECK-T1: @ %bb.0:
1575 ; CHECK-T1-NEXT: movs r2, #252
1576 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1577 ; CHECK-T1-NEXT: adds r0, #252
1578 ; CHECK-T1-NEXT: bx lr
1580 ; CHECK-T2-LABEL: i8_252:
1581 ; CHECK-T2: @ %bb.0:
1582 ; CHECK-T2-NEXT: strb r1, [r0, #252]!
1583 ; CHECK-T2-NEXT: bx lr
1585 ; CHECK-ARM-LABEL: i8_252:
1586 ; CHECK-ARM: @ %bb.0:
1587 ; CHECK-ARM-NEXT: strb r1, [r0, #252]!
1588 ; CHECK-ARM-NEXT: bx lr
1589 %o = getelementptr inbounds i8, i8* %p, i32 252
1590 %q = bitcast i8* %o to i8*
1591 store i8 %v, i8* %q, align 1
1595 define i8* @i8_255(i8* %p, i8 %v) {
1596 ; CHECK-T1-LABEL: i8_255:
1597 ; CHECK-T1: @ %bb.0:
1598 ; CHECK-T1-NEXT: movs r2, #255
1599 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1600 ; CHECK-T1-NEXT: adds r0, #255
1601 ; CHECK-T1-NEXT: bx lr
1603 ; CHECK-T2-LABEL: i8_255:
1604 ; CHECK-T2: @ %bb.0:
1605 ; CHECK-T2-NEXT: strb r1, [r0, #255]!
1606 ; CHECK-T2-NEXT: bx lr
1608 ; CHECK-ARM-LABEL: i8_255:
1609 ; CHECK-ARM: @ %bb.0:
1610 ; CHECK-ARM-NEXT: strb r1, [r0, #255]!
1611 ; CHECK-ARM-NEXT: bx lr
1612 %o = getelementptr inbounds i8, i8* %p, i32 255
1613 %q = bitcast i8* %o to i8*
1614 store i8 %v, i8* %q, align 1
1618 define i8* @i8_256(i8* %p, i8 %v) {
1619 ; CHECK-T1-LABEL: i8_256:
1620 ; CHECK-T1: @ %bb.0:
1621 ; CHECK-T1-NEXT: movs r2, #1
1622 ; CHECK-T1-NEXT: lsls r2, r2, #8
1623 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1624 ; CHECK-T1-NEXT: adds r0, r0, r2
1625 ; CHECK-T1-NEXT: bx lr
1627 ; CHECK-T2-LABEL: i8_256:
1628 ; CHECK-T2: @ %bb.0:
1629 ; CHECK-T2-NEXT: strb.w r1, [r0, #256]
1630 ; CHECK-T2-NEXT: add.w r0, r0, #256
1631 ; CHECK-T2-NEXT: bx lr
1633 ; CHECK-ARM-LABEL: i8_256:
1634 ; CHECK-ARM: @ %bb.0:
1635 ; CHECK-ARM-NEXT: strb r1, [r0, #256]!
1636 ; CHECK-ARM-NEXT: bx lr
1637 %o = getelementptr inbounds i8, i8* %p, i32 256
1638 %q = bitcast i8* %o to i8*
1639 store i8 %v, i8* %q, align 1
1643 define i8* @i8_m252(i8* %p, i8 %v) {
1644 ; CHECK-T1-LABEL: i8_m252:
1645 ; CHECK-T1: @ %bb.0:
1646 ; CHECK-T1-NEXT: subs r0, #252
1647 ; CHECK-T1-NEXT: strb r1, [r0]
1648 ; CHECK-T1-NEXT: bx lr
1650 ; CHECK-T2-LABEL: i8_m252:
1651 ; CHECK-T2: @ %bb.0:
1652 ; CHECK-T2-NEXT: strb r1, [r0, #-252]!
1653 ; CHECK-T2-NEXT: bx lr
1655 ; CHECK-ARM-LABEL: i8_m252:
1656 ; CHECK-ARM: @ %bb.0:
1657 ; CHECK-ARM-NEXT: strb r1, [r0, #-252]!
1658 ; CHECK-ARM-NEXT: bx lr
1659 %o = getelementptr inbounds i8, i8* %p, i32 -252
1660 %q = bitcast i8* %o to i8*
1661 store i8 %v, i8* %q, align 1
1665 define i8* @i8_m255(i8* %p, i8 %v) {
1666 ; CHECK-T1-LABEL: i8_m255:
1667 ; CHECK-T1: @ %bb.0:
1668 ; CHECK-T1-NEXT: subs r0, #255
1669 ; CHECK-T1-NEXT: strb r1, [r0]
1670 ; CHECK-T1-NEXT: bx lr
1672 ; CHECK-T2-LABEL: i8_m255:
1673 ; CHECK-T2: @ %bb.0:
1674 ; CHECK-T2-NEXT: strb r1, [r0, #-255]!
1675 ; CHECK-T2-NEXT: bx lr
1677 ; CHECK-ARM-LABEL: i8_m255:
1678 ; CHECK-ARM: @ %bb.0:
1679 ; CHECK-ARM-NEXT: strb r1, [r0, #-255]!
1680 ; CHECK-ARM-NEXT: bx lr
1681 %o = getelementptr inbounds i8, i8* %p, i32 -255
1682 %q = bitcast i8* %o to i8*
1683 store i8 %v, i8* %q, align 1
1687 define i8* @i8_m256(i8* %p, i8 %v) {
1688 ; CHECK-T1-LABEL: i8_m256:
1689 ; CHECK-T1: @ %bb.0:
1690 ; CHECK-T1-NEXT: movs r2, #255
1691 ; CHECK-T1-NEXT: mvns r2, r2
1692 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1693 ; CHECK-T1-NEXT: adds r0, r0, r2
1694 ; CHECK-T1-NEXT: bx lr
1696 ; CHECK-T2-LABEL: i8_m256:
1697 ; CHECK-T2: @ %bb.0:
1698 ; CHECK-T2-NEXT: mvn r2, #255
1699 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1700 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1701 ; CHECK-T2-NEXT: bx lr
1703 ; CHECK-ARM-LABEL: i8_m256:
1704 ; CHECK-ARM: @ %bb.0:
1705 ; CHECK-ARM-NEXT: strb r1, [r0, #-256]!
1706 ; CHECK-ARM-NEXT: bx lr
1707 %o = getelementptr inbounds i8, i8* %p, i32 -256
1708 %q = bitcast i8* %o to i8*
1709 store i8 %v, i8* %q, align 1
1713 define i8* @i8_4095(i8* %p, i8 %v) {
1714 ; CHECK-T1-LABEL: i8_4095:
1715 ; CHECK-T1: @ %bb.0:
1716 ; CHECK-T1-NEXT: ldr r2, .LCPI67_0
1717 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1718 ; CHECK-T1-NEXT: adds r0, r0, r2
1719 ; CHECK-T1-NEXT: bx lr
1720 ; CHECK-T1-NEXT: .p2align 2
1721 ; CHECK-T1-NEXT: @ %bb.1:
1722 ; CHECK-T1-NEXT: .LCPI67_0:
1723 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1725 ; CHECK-T2-LABEL: i8_4095:
1726 ; CHECK-T2: @ %bb.0:
1727 ; CHECK-T2-NEXT: strb.w r1, [r0, #4095]
1728 ; CHECK-T2-NEXT: addw r0, r0, #4095
1729 ; CHECK-T2-NEXT: bx lr
1731 ; CHECK-ARM-LABEL: i8_4095:
1732 ; CHECK-ARM: @ %bb.0:
1733 ; CHECK-ARM-NEXT: strb r1, [r0, #4095]!
1734 ; CHECK-ARM-NEXT: bx lr
1735 %o = getelementptr inbounds i8, i8* %p, i32 4095
1736 %q = bitcast i8* %o to i8*
1737 store i8 %v, i8* %q, align 1
1741 define i8* @i8_4096(i8* %p, i8 %v) {
1742 ; CHECK-T1-LABEL: i8_4096:
1743 ; CHECK-T1: @ %bb.0:
1744 ; CHECK-T1-NEXT: movs r2, #1
1745 ; CHECK-T1-NEXT: lsls r2, r2, #12
1746 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1747 ; CHECK-T1-NEXT: adds r0, r0, r2
1748 ; CHECK-T1-NEXT: bx lr
1750 ; CHECK-T2-LABEL: i8_4096:
1751 ; CHECK-T2: @ %bb.0:
1752 ; CHECK-T2-NEXT: mov.w r2, #4096
1753 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1754 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1755 ; CHECK-T2-NEXT: bx lr
1757 ; CHECK-ARM-LABEL: i8_4096:
1758 ; CHECK-ARM: @ %bb.0:
1759 ; CHECK-ARM-NEXT: mov r2, #4096
1760 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1761 ; CHECK-ARM-NEXT: bx lr
1762 %o = getelementptr inbounds i8, i8* %p, i32 4096
1763 %q = bitcast i8* %o to i8*
1764 store i8 %v, i8* %q, align 1
1768 define i8* @i8_m4095(i8* %p, i8 %v) {
1769 ; CHECK-T1-LABEL: i8_m4095:
1770 ; CHECK-T1: @ %bb.0:
1771 ; CHECK-T1-NEXT: ldr r2, .LCPI69_0
1772 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1773 ; CHECK-T1-NEXT: adds r0, r0, r2
1774 ; CHECK-T1-NEXT: bx lr
1775 ; CHECK-T1-NEXT: .p2align 2
1776 ; CHECK-T1-NEXT: @ %bb.1:
1777 ; CHECK-T1-NEXT: .LCPI69_0:
1778 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1780 ; CHECK-T2-LABEL: i8_m4095:
1781 ; CHECK-T2: @ %bb.0:
1782 ; CHECK-T2-NEXT: movw r2, #61441
1783 ; CHECK-T2-NEXT: movt r2, #65535
1784 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1785 ; CHECK-T2-NEXT: subw r0, r0, #4095
1786 ; CHECK-T2-NEXT: bx lr
1788 ; CHECK-ARM-LABEL: i8_m4095:
1789 ; CHECK-ARM: @ %bb.0:
1790 ; CHECK-ARM-NEXT: strb r1, [r0, #-4095]!
1791 ; CHECK-ARM-NEXT: bx lr
1792 %o = getelementptr inbounds i8, i8* %p, i32 -4095
1793 %q = bitcast i8* %o to i8*
1794 store i8 %v, i8* %q, align 1
1798 define i8* @i8_m4096(i8* %p, i8 %v) {
1799 ; CHECK-T1-LABEL: i8_m4096:
1800 ; CHECK-T1: @ %bb.0:
1801 ; CHECK-T1-NEXT: ldr r2, .LCPI70_0
1802 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1803 ; CHECK-T1-NEXT: adds r0, r0, r2
1804 ; CHECK-T1-NEXT: bx lr
1805 ; CHECK-T1-NEXT: .p2align 2
1806 ; CHECK-T1-NEXT: @ %bb.1:
1807 ; CHECK-T1-NEXT: .LCPI70_0:
1808 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1810 ; CHECK-T2-LABEL: i8_m4096:
1811 ; CHECK-T2: @ %bb.0:
1812 ; CHECK-T2-NEXT: movw r2, #61440
1813 ; CHECK-T2-NEXT: movt r2, #65535
1814 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1815 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1816 ; CHECK-T2-NEXT: bx lr
1818 ; CHECK-ARM-LABEL: i8_m4096:
1819 ; CHECK-ARM: @ %bb.0:
1820 ; CHECK-ARM-NEXT: movw r2, #61440
1821 ; CHECK-ARM-NEXT: movt r2, #65535
1822 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1823 ; CHECK-ARM-NEXT: bx lr
1824 %o = getelementptr inbounds i8, i8* %p, i32 -4096
1825 %q = bitcast i8* %o to i8*
1826 store i8 %v, i8* %q, align 1