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
1068 define i8* @i16_0(i8* %p, i16 %v) {
1069 ; CHECK-LABEL: i16_0:
1071 ; CHECK-NEXT: strh r1, [r0]
1073 %o = getelementptr inbounds i8, i8* %p, i32 0
1074 %q = bitcast i8* %o to i16*
1075 store i16 %v, i16* %q, align 2
1079 define i8* @i16_3(i8* %p, i16 %v) {
1080 ; CHECK-T1-LABEL: i16_3:
1081 ; CHECK-T1: @ %bb.0:
1082 ; CHECK-T1-NEXT: movs r2, #3
1083 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1084 ; CHECK-T1-NEXT: adds r0, r0, #3
1085 ; CHECK-T1-NEXT: bx lr
1087 ; CHECK-T2-LABEL: i16_3:
1088 ; CHECK-T2: @ %bb.0:
1089 ; CHECK-T2-NEXT: strh r1, [r0, #3]!
1090 ; CHECK-T2-NEXT: bx lr
1092 ; CHECK-ARM-LABEL: i16_3:
1093 ; CHECK-ARM: @ %bb.0:
1094 ; CHECK-ARM-NEXT: strh r1, [r0, #3]!
1095 ; CHECK-ARM-NEXT: bx lr
1096 %o = getelementptr inbounds i8, i8* %p, i32 3
1097 %q = bitcast i8* %o to i16*
1098 store i16 %v, i16* %q, align 2
1102 define i8* @i16_4(i8* %p, i16 %v) {
1103 ; CHECK-T1-LABEL: i16_4:
1104 ; CHECK-T1: @ %bb.0:
1105 ; CHECK-T1-NEXT: strh r1, [r0, #4]
1106 ; CHECK-T1-NEXT: adds r0, r0, #4
1107 ; CHECK-T1-NEXT: bx lr
1109 ; CHECK-T2-LABEL: i16_4:
1110 ; CHECK-T2: @ %bb.0:
1111 ; CHECK-T2-NEXT: strh r1, [r0, #4]!
1112 ; CHECK-T2-NEXT: bx lr
1114 ; CHECK-ARM-LABEL: i16_4:
1115 ; CHECK-ARM: @ %bb.0:
1116 ; CHECK-ARM-NEXT: strh r1, [r0, #4]!
1117 ; CHECK-ARM-NEXT: bx lr
1118 %o = getelementptr inbounds i8, i8* %p, i32 4
1119 %q = bitcast i8* %o to i16*
1120 store i16 %v, i16* %q, align 2
1124 define i8* @i16_8(i8* %p, i16 %v) {
1125 ; CHECK-T1-LABEL: i16_8:
1126 ; CHECK-T1: @ %bb.0:
1127 ; CHECK-T1-NEXT: strh r1, [r0, #8]
1128 ; CHECK-T1-NEXT: adds r0, #8
1129 ; CHECK-T1-NEXT: bx lr
1131 ; CHECK-T2-LABEL: i16_8:
1132 ; CHECK-T2: @ %bb.0:
1133 ; CHECK-T2-NEXT: strh r1, [r0, #8]!
1134 ; CHECK-T2-NEXT: bx lr
1136 ; CHECK-ARM-LABEL: i16_8:
1137 ; CHECK-ARM: @ %bb.0:
1138 ; CHECK-ARM-NEXT: strh r1, [r0, #8]!
1139 ; CHECK-ARM-NEXT: bx lr
1140 %o = getelementptr inbounds i8, i8* %p, i32 8
1141 %q = bitcast i8* %o to i16*
1142 store i16 %v, i16* %q, align 2
1146 define i8* @i16_m1(i8* %p, i16 %v) {
1147 ; CHECK-T1-LABEL: i16_m1:
1148 ; CHECK-T1: @ %bb.0:
1149 ; CHECK-T1-NEXT: subs r0, r0, #1
1150 ; CHECK-T1-NEXT: strh r1, [r0]
1151 ; CHECK-T1-NEXT: bx lr
1153 ; CHECK-T2-LABEL: i16_m1:
1154 ; CHECK-T2: @ %bb.0:
1155 ; CHECK-T2-NEXT: strh r1, [r0, #-1]!
1156 ; CHECK-T2-NEXT: bx lr
1158 ; CHECK-ARM-LABEL: i16_m1:
1159 ; CHECK-ARM: @ %bb.0:
1160 ; CHECK-ARM-NEXT: strh r1, [r0, #-1]!
1161 ; CHECK-ARM-NEXT: bx lr
1162 %o = getelementptr inbounds i8, i8* %p, i32 -1
1163 %q = bitcast i8* %o to i16*
1164 store i16 %v, i16* %q, align 2
1168 define i8* @i16_m4(i8* %p, i16 %v) {
1169 ; CHECK-T1-LABEL: i16_m4:
1170 ; CHECK-T1: @ %bb.0:
1171 ; CHECK-T1-NEXT: subs r0, r0, #4
1172 ; CHECK-T1-NEXT: strh r1, [r0]
1173 ; CHECK-T1-NEXT: bx lr
1175 ; CHECK-T2-LABEL: i16_m4:
1176 ; CHECK-T2: @ %bb.0:
1177 ; CHECK-T2-NEXT: strh r1, [r0, #-4]!
1178 ; CHECK-T2-NEXT: bx lr
1180 ; CHECK-ARM-LABEL: i16_m4:
1181 ; CHECK-ARM: @ %bb.0:
1182 ; CHECK-ARM-NEXT: strh r1, [r0, #-4]!
1183 ; CHECK-ARM-NEXT: bx lr
1184 %o = getelementptr inbounds i8, i8* %p, i32 -4
1185 %q = bitcast i8* %o to i16*
1186 store i16 %v, i16* %q, align 2
1190 define i8* @i16_252(i8* %p, i16 %v) {
1191 ; CHECK-T1-LABEL: i16_252:
1192 ; CHECK-T1: @ %bb.0:
1193 ; CHECK-T1-NEXT: movs r2, #252
1194 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1195 ; CHECK-T1-NEXT: adds r0, #252
1196 ; CHECK-T1-NEXT: bx lr
1198 ; CHECK-T2-LABEL: i16_252:
1199 ; CHECK-T2: @ %bb.0:
1200 ; CHECK-T2-NEXT: strh r1, [r0, #252]!
1201 ; CHECK-T2-NEXT: bx lr
1203 ; CHECK-ARM-LABEL: i16_252:
1204 ; CHECK-ARM: @ %bb.0:
1205 ; CHECK-ARM-NEXT: strh r1, [r0, #252]!
1206 ; CHECK-ARM-NEXT: bx lr
1207 %o = getelementptr inbounds i8, i8* %p, i32 252
1208 %q = bitcast i8* %o to i16*
1209 store i16 %v, i16* %q, align 2
1213 define i8* @i16_255(i8* %p, i16 %v) {
1214 ; CHECK-T1-LABEL: i16_255:
1215 ; CHECK-T1: @ %bb.0:
1216 ; CHECK-T1-NEXT: movs r2, #255
1217 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1218 ; CHECK-T1-NEXT: adds r0, #255
1219 ; CHECK-T1-NEXT: bx lr
1221 ; CHECK-T2-LABEL: i16_255:
1222 ; CHECK-T2: @ %bb.0:
1223 ; CHECK-T2-NEXT: strh r1, [r0, #255]!
1224 ; CHECK-T2-NEXT: bx lr
1226 ; CHECK-ARM-LABEL: i16_255:
1227 ; CHECK-ARM: @ %bb.0:
1228 ; CHECK-ARM-NEXT: strh r1, [r0, #255]!
1229 ; CHECK-ARM-NEXT: bx lr
1230 %o = getelementptr inbounds i8, i8* %p, i32 255
1231 %q = bitcast i8* %o to i16*
1232 store i16 %v, i16* %q, align 2
1236 define i8* @i16_256(i8* %p, i16 %v) {
1237 ; CHECK-T1-LABEL: i16_256:
1238 ; CHECK-T1: @ %bb.0:
1239 ; CHECK-T1-NEXT: movs r2, #1
1240 ; CHECK-T1-NEXT: lsls r2, r2, #8
1241 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1242 ; CHECK-T1-NEXT: adds r0, r0, r2
1243 ; CHECK-T1-NEXT: bx lr
1245 ; CHECK-T2-LABEL: i16_256:
1246 ; CHECK-T2: @ %bb.0:
1247 ; CHECK-T2-NEXT: strh.w r1, [r0, #256]
1248 ; CHECK-T2-NEXT: add.w r0, r0, #256
1249 ; CHECK-T2-NEXT: bx lr
1251 ; CHECK-ARM-LABEL: i16_256:
1252 ; CHECK-ARM: @ %bb.0:
1253 ; CHECK-ARM-NEXT: mov r2, #256
1254 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1255 ; CHECK-ARM-NEXT: bx lr
1256 %o = getelementptr inbounds i8, i8* %p, i32 256
1257 %q = bitcast i8* %o to i16*
1258 store i16 %v, i16* %q, align 2
1262 define i8* @i16_m252(i8* %p, i16 %v) {
1263 ; CHECK-T1-LABEL: i16_m252:
1264 ; CHECK-T1: @ %bb.0:
1265 ; CHECK-T1-NEXT: subs r0, #252
1266 ; CHECK-T1-NEXT: strh r1, [r0]
1267 ; CHECK-T1-NEXT: bx lr
1269 ; CHECK-T2-LABEL: i16_m252:
1270 ; CHECK-T2: @ %bb.0:
1271 ; CHECK-T2-NEXT: strh r1, [r0, #-252]!
1272 ; CHECK-T2-NEXT: bx lr
1274 ; CHECK-ARM-LABEL: i16_m252:
1275 ; CHECK-ARM: @ %bb.0:
1276 ; CHECK-ARM-NEXT: strh r1, [r0, #-252]!
1277 ; CHECK-ARM-NEXT: bx lr
1278 %o = getelementptr inbounds i8, i8* %p, i32 -252
1279 %q = bitcast i8* %o to i16*
1280 store i16 %v, i16* %q, align 2
1284 define i8* @i16_m255(i8* %p, i16 %v) {
1285 ; CHECK-T1-LABEL: i16_m255:
1286 ; CHECK-T1: @ %bb.0:
1287 ; CHECK-T1-NEXT: subs r0, #255
1288 ; CHECK-T1-NEXT: strh r1, [r0]
1289 ; CHECK-T1-NEXT: bx lr
1291 ; CHECK-T2-LABEL: i16_m255:
1292 ; CHECK-T2: @ %bb.0:
1293 ; CHECK-T2-NEXT: strh r1, [r0, #-255]!
1294 ; CHECK-T2-NEXT: bx lr
1296 ; CHECK-ARM-LABEL: i16_m255:
1297 ; CHECK-ARM: @ %bb.0:
1298 ; CHECK-ARM-NEXT: strh r1, [r0, #-255]!
1299 ; CHECK-ARM-NEXT: bx lr
1300 %o = getelementptr inbounds i8, i8* %p, i32 -255
1301 %q = bitcast i8* %o to i16*
1302 store i16 %v, i16* %q, align 2
1306 define i8* @i16_m256(i8* %p, i16 %v) {
1307 ; CHECK-T1-LABEL: i16_m256:
1308 ; CHECK-T1: @ %bb.0:
1309 ; CHECK-T1-NEXT: movs r2, #255
1310 ; CHECK-T1-NEXT: mvns r2, r2
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_m256:
1316 ; CHECK-T2: @ %bb.0:
1317 ; CHECK-T2-NEXT: mvn r2, #255
1318 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1319 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1320 ; CHECK-T2-NEXT: bx lr
1322 ; CHECK-ARM-LABEL: i16_m256:
1323 ; CHECK-ARM: @ %bb.0:
1324 ; CHECK-ARM-NEXT: mvn r2, #255
1325 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1326 ; CHECK-ARM-NEXT: bx lr
1327 %o = getelementptr inbounds i8, i8* %p, i32 -256
1328 %q = bitcast i8* %o to i16*
1329 store i16 %v, i16* %q, align 2
1333 define i8* @i16_4095(i8* %p, i16 %v) {
1334 ; CHECK-T1-LABEL: i16_4095:
1335 ; CHECK-T1: @ %bb.0:
1336 ; CHECK-T1-NEXT: ldr r2, .LCPI51_0
1337 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1338 ; CHECK-T1-NEXT: adds r0, r0, r2
1339 ; CHECK-T1-NEXT: bx lr
1340 ; CHECK-T1-NEXT: .p2align 2
1341 ; CHECK-T1-NEXT: @ %bb.1:
1342 ; CHECK-T1-NEXT: .LCPI51_0:
1343 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1345 ; CHECK-T2-LABEL: i16_4095:
1346 ; CHECK-T2: @ %bb.0:
1347 ; CHECK-T2-NEXT: strh.w r1, [r0, #4095]
1348 ; CHECK-T2-NEXT: addw r0, r0, #4095
1349 ; CHECK-T2-NEXT: bx lr
1351 ; CHECK-ARM-LABEL: i16_4095:
1352 ; CHECK-ARM: @ %bb.0:
1353 ; CHECK-ARM-NEXT: movw r2, #4095
1354 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1355 ; CHECK-ARM-NEXT: bx lr
1356 %o = getelementptr inbounds i8, i8* %p, i32 4095
1357 %q = bitcast i8* %o to i16*
1358 store i16 %v, i16* %q, align 2
1362 define i8* @i16_4096(i8* %p, i16 %v) {
1363 ; CHECK-T1-LABEL: i16_4096:
1364 ; CHECK-T1: @ %bb.0:
1365 ; CHECK-T1-NEXT: movs r2, #1
1366 ; CHECK-T1-NEXT: lsls r2, r2, #12
1367 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1368 ; CHECK-T1-NEXT: adds r0, r0, r2
1369 ; CHECK-T1-NEXT: bx lr
1371 ; CHECK-T2-LABEL: i16_4096:
1372 ; CHECK-T2: @ %bb.0:
1373 ; CHECK-T2-NEXT: mov.w r2, #4096
1374 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1375 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1376 ; CHECK-T2-NEXT: bx lr
1378 ; CHECK-ARM-LABEL: i16_4096:
1379 ; CHECK-ARM: @ %bb.0:
1380 ; CHECK-ARM-NEXT: mov r2, #4096
1381 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1382 ; CHECK-ARM-NEXT: bx lr
1383 %o = getelementptr inbounds i8, i8* %p, i32 4096
1384 %q = bitcast i8* %o to i16*
1385 store i16 %v, i16* %q, align 2
1389 define i8* @i16_m4095(i8* %p, i16 %v) {
1390 ; CHECK-T1-LABEL: i16_m4095:
1391 ; CHECK-T1: @ %bb.0:
1392 ; CHECK-T1-NEXT: ldr r2, .LCPI53_0
1393 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1394 ; CHECK-T1-NEXT: adds r0, r0, r2
1395 ; CHECK-T1-NEXT: bx lr
1396 ; CHECK-T1-NEXT: .p2align 2
1397 ; CHECK-T1-NEXT: @ %bb.1:
1398 ; CHECK-T1-NEXT: .LCPI53_0:
1399 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1401 ; CHECK-T2-LABEL: i16_m4095:
1402 ; CHECK-T2: @ %bb.0:
1403 ; CHECK-T2-NEXT: movw r2, #61441
1404 ; CHECK-T2-NEXT: movt r2, #65535
1405 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1406 ; CHECK-T2-NEXT: subw r0, r0, #4095
1407 ; CHECK-T2-NEXT: bx lr
1409 ; CHECK-ARM-LABEL: i16_m4095:
1410 ; CHECK-ARM: @ %bb.0:
1411 ; CHECK-ARM-NEXT: movw r2, #61441
1412 ; CHECK-ARM-NEXT: movt r2, #65535
1413 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1414 ; CHECK-ARM-NEXT: bx lr
1415 %o = getelementptr inbounds i8, i8* %p, i32 -4095
1416 %q = bitcast i8* %o to i16*
1417 store i16 %v, i16* %q, align 2
1421 define i8* @i16_m4096(i8* %p, i16 %v) {
1422 ; CHECK-T1-LABEL: i16_m4096:
1423 ; CHECK-T1: @ %bb.0:
1424 ; CHECK-T1-NEXT: ldr r2, .LCPI54_0
1425 ; CHECK-T1-NEXT: strh r1, [r0, r2]
1426 ; CHECK-T1-NEXT: adds r0, r0, r2
1427 ; CHECK-T1-NEXT: bx lr
1428 ; CHECK-T1-NEXT: .p2align 2
1429 ; CHECK-T1-NEXT: @ %bb.1:
1430 ; CHECK-T1-NEXT: .LCPI54_0:
1431 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1433 ; CHECK-T2-LABEL: i16_m4096:
1434 ; CHECK-T2: @ %bb.0:
1435 ; CHECK-T2-NEXT: movw r2, #61440
1436 ; CHECK-T2-NEXT: movt r2, #65535
1437 ; CHECK-T2-NEXT: strh r1, [r0, r2]
1438 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1439 ; CHECK-T2-NEXT: bx lr
1441 ; CHECK-ARM-LABEL: i16_m4096:
1442 ; CHECK-ARM: @ %bb.0:
1443 ; CHECK-ARM-NEXT: movw r2, #61440
1444 ; CHECK-ARM-NEXT: movt r2, #65535
1445 ; CHECK-ARM-NEXT: strh r1, [r0, r2]!
1446 ; CHECK-ARM-NEXT: bx lr
1447 %o = getelementptr inbounds i8, i8* %p, i32 -4096
1448 %q = bitcast i8* %o to i16*
1449 store i16 %v, i16* %q, align 2
1455 define i8* @i8_0(i8* %p, i8 %v) {
1456 ; CHECK-LABEL: i8_0:
1458 ; CHECK-NEXT: strb r1, [r0]
1460 %o = getelementptr inbounds i8, i8* %p, i32 0
1461 %q = bitcast i8* %o to i8*
1462 store i8 %v, i8* %q, align 1
1466 define i8* @i8_3(i8* %p, i8 %v) {
1467 ; CHECK-T1-LABEL: i8_3:
1468 ; CHECK-T1: @ %bb.0:
1469 ; CHECK-T1-NEXT: strb r1, [r0, #3]
1470 ; CHECK-T1-NEXT: adds r0, r0, #3
1471 ; CHECK-T1-NEXT: bx lr
1473 ; CHECK-T2-LABEL: i8_3:
1474 ; CHECK-T2: @ %bb.0:
1475 ; CHECK-T2-NEXT: strb r1, [r0, #3]!
1476 ; CHECK-T2-NEXT: bx lr
1478 ; CHECK-ARM-LABEL: i8_3:
1479 ; CHECK-ARM: @ %bb.0:
1480 ; CHECK-ARM-NEXT: strb r1, [r0, #3]!
1481 ; CHECK-ARM-NEXT: bx lr
1482 %o = getelementptr inbounds i8, i8* %p, i32 3
1483 %q = bitcast i8* %o to i8*
1484 store i8 %v, i8* %q, align 1
1488 define i8* @i8_4(i8* %p, i8 %v) {
1489 ; CHECK-T1-LABEL: i8_4:
1490 ; CHECK-T1: @ %bb.0:
1491 ; CHECK-T1-NEXT: strb r1, [r0, #4]
1492 ; CHECK-T1-NEXT: adds r0, r0, #4
1493 ; CHECK-T1-NEXT: bx lr
1495 ; CHECK-T2-LABEL: i8_4:
1496 ; CHECK-T2: @ %bb.0:
1497 ; CHECK-T2-NEXT: strb r1, [r0, #4]!
1498 ; CHECK-T2-NEXT: bx lr
1500 ; CHECK-ARM-LABEL: i8_4:
1501 ; CHECK-ARM: @ %bb.0:
1502 ; CHECK-ARM-NEXT: strb r1, [r0, #4]!
1503 ; CHECK-ARM-NEXT: bx lr
1504 %o = getelementptr inbounds i8, i8* %p, i32 4
1505 %q = bitcast i8* %o to i8*
1506 store i8 %v, i8* %q, align 1
1510 define i8* @i8_8(i8* %p, i8 %v) {
1511 ; CHECK-T1-LABEL: i8_8:
1512 ; CHECK-T1: @ %bb.0:
1513 ; CHECK-T1-NEXT: strb r1, [r0, #8]
1514 ; CHECK-T1-NEXT: adds r0, #8
1515 ; CHECK-T1-NEXT: bx lr
1517 ; CHECK-T2-LABEL: i8_8:
1518 ; CHECK-T2: @ %bb.0:
1519 ; CHECK-T2-NEXT: strb r1, [r0, #8]!
1520 ; CHECK-T2-NEXT: bx lr
1522 ; CHECK-ARM-LABEL: i8_8:
1523 ; CHECK-ARM: @ %bb.0:
1524 ; CHECK-ARM-NEXT: strb r1, [r0, #8]!
1525 ; CHECK-ARM-NEXT: bx lr
1526 %o = getelementptr inbounds i8, i8* %p, i32 8
1527 %q = bitcast i8* %o to i8*
1528 store i8 %v, i8* %q, align 1
1532 define i8* @i8_m1(i8* %p, i8 %v) {
1533 ; CHECK-T1-LABEL: i8_m1:
1534 ; CHECK-T1: @ %bb.0:
1535 ; CHECK-T1-NEXT: subs r0, r0, #1
1536 ; CHECK-T1-NEXT: strb r1, [r0]
1537 ; CHECK-T1-NEXT: bx lr
1539 ; CHECK-T2-LABEL: i8_m1:
1540 ; CHECK-T2: @ %bb.0:
1541 ; CHECK-T2-NEXT: strb r1, [r0, #-1]!
1542 ; CHECK-T2-NEXT: bx lr
1544 ; CHECK-ARM-LABEL: i8_m1:
1545 ; CHECK-ARM: @ %bb.0:
1546 ; CHECK-ARM-NEXT: strb r1, [r0, #-1]!
1547 ; CHECK-ARM-NEXT: bx lr
1548 %o = getelementptr inbounds i8, i8* %p, i32 -1
1549 %q = bitcast i8* %o to i8*
1550 store i8 %v, i8* %q, align 1
1554 define i8* @i8_m4(i8* %p, i8 %v) {
1555 ; CHECK-T1-LABEL: i8_m4:
1556 ; CHECK-T1: @ %bb.0:
1557 ; CHECK-T1-NEXT: subs r0, r0, #4
1558 ; CHECK-T1-NEXT: strb r1, [r0]
1559 ; CHECK-T1-NEXT: bx lr
1561 ; CHECK-T2-LABEL: i8_m4:
1562 ; CHECK-T2: @ %bb.0:
1563 ; CHECK-T2-NEXT: strb r1, [r0, #-4]!
1564 ; CHECK-T2-NEXT: bx lr
1566 ; CHECK-ARM-LABEL: i8_m4:
1567 ; CHECK-ARM: @ %bb.0:
1568 ; CHECK-ARM-NEXT: strb r1, [r0, #-4]!
1569 ; CHECK-ARM-NEXT: bx lr
1570 %o = getelementptr inbounds i8, i8* %p, i32 -4
1571 %q = bitcast i8* %o to i8*
1572 store i8 %v, i8* %q, align 1
1576 define i8* @i8_252(i8* %p, i8 %v) {
1577 ; CHECK-T1-LABEL: i8_252:
1578 ; CHECK-T1: @ %bb.0:
1579 ; CHECK-T1-NEXT: movs r2, #252
1580 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1581 ; CHECK-T1-NEXT: adds r0, #252
1582 ; CHECK-T1-NEXT: bx lr
1584 ; CHECK-T2-LABEL: i8_252:
1585 ; CHECK-T2: @ %bb.0:
1586 ; CHECK-T2-NEXT: strb r1, [r0, #252]!
1587 ; CHECK-T2-NEXT: bx lr
1589 ; CHECK-ARM-LABEL: i8_252:
1590 ; CHECK-ARM: @ %bb.0:
1591 ; CHECK-ARM-NEXT: strb r1, [r0, #252]!
1592 ; CHECK-ARM-NEXT: bx lr
1593 %o = getelementptr inbounds i8, i8* %p, i32 252
1594 %q = bitcast i8* %o to i8*
1595 store i8 %v, i8* %q, align 1
1599 define i8* @i8_255(i8* %p, i8 %v) {
1600 ; CHECK-T1-LABEL: i8_255:
1601 ; CHECK-T1: @ %bb.0:
1602 ; CHECK-T1-NEXT: movs r2, #255
1603 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1604 ; CHECK-T1-NEXT: adds r0, #255
1605 ; CHECK-T1-NEXT: bx lr
1607 ; CHECK-T2-LABEL: i8_255:
1608 ; CHECK-T2: @ %bb.0:
1609 ; CHECK-T2-NEXT: strb r1, [r0, #255]!
1610 ; CHECK-T2-NEXT: bx lr
1612 ; CHECK-ARM-LABEL: i8_255:
1613 ; CHECK-ARM: @ %bb.0:
1614 ; CHECK-ARM-NEXT: strb r1, [r0, #255]!
1615 ; CHECK-ARM-NEXT: bx lr
1616 %o = getelementptr inbounds i8, i8* %p, i32 255
1617 %q = bitcast i8* %o to i8*
1618 store i8 %v, i8* %q, align 1
1622 define i8* @i8_256(i8* %p, i8 %v) {
1623 ; CHECK-T1-LABEL: i8_256:
1624 ; CHECK-T1: @ %bb.0:
1625 ; CHECK-T1-NEXT: movs r2, #1
1626 ; CHECK-T1-NEXT: lsls r2, r2, #8
1627 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1628 ; CHECK-T1-NEXT: adds r0, r0, r2
1629 ; CHECK-T1-NEXT: bx lr
1631 ; CHECK-T2-LABEL: i8_256:
1632 ; CHECK-T2: @ %bb.0:
1633 ; CHECK-T2-NEXT: strb.w r1, [r0, #256]
1634 ; CHECK-T2-NEXT: add.w r0, r0, #256
1635 ; CHECK-T2-NEXT: bx lr
1637 ; CHECK-ARM-LABEL: i8_256:
1638 ; CHECK-ARM: @ %bb.0:
1639 ; CHECK-ARM-NEXT: strb r1, [r0, #256]!
1640 ; CHECK-ARM-NEXT: bx lr
1641 %o = getelementptr inbounds i8, i8* %p, i32 256
1642 %q = bitcast i8* %o to i8*
1643 store i8 %v, i8* %q, align 1
1647 define i8* @i8_m252(i8* %p, i8 %v) {
1648 ; CHECK-T1-LABEL: i8_m252:
1649 ; CHECK-T1: @ %bb.0:
1650 ; CHECK-T1-NEXT: subs r0, #252
1651 ; CHECK-T1-NEXT: strb r1, [r0]
1652 ; CHECK-T1-NEXT: bx lr
1654 ; CHECK-T2-LABEL: i8_m252:
1655 ; CHECK-T2: @ %bb.0:
1656 ; CHECK-T2-NEXT: strb r1, [r0, #-252]!
1657 ; CHECK-T2-NEXT: bx lr
1659 ; CHECK-ARM-LABEL: i8_m252:
1660 ; CHECK-ARM: @ %bb.0:
1661 ; CHECK-ARM-NEXT: strb r1, [r0, #-252]!
1662 ; CHECK-ARM-NEXT: bx lr
1663 %o = getelementptr inbounds i8, i8* %p, i32 -252
1664 %q = bitcast i8* %o to i8*
1665 store i8 %v, i8* %q, align 1
1669 define i8* @i8_m255(i8* %p, i8 %v) {
1670 ; CHECK-T1-LABEL: i8_m255:
1671 ; CHECK-T1: @ %bb.0:
1672 ; CHECK-T1-NEXT: subs r0, #255
1673 ; CHECK-T1-NEXT: strb r1, [r0]
1674 ; CHECK-T1-NEXT: bx lr
1676 ; CHECK-T2-LABEL: i8_m255:
1677 ; CHECK-T2: @ %bb.0:
1678 ; CHECK-T2-NEXT: strb r1, [r0, #-255]!
1679 ; CHECK-T2-NEXT: bx lr
1681 ; CHECK-ARM-LABEL: i8_m255:
1682 ; CHECK-ARM: @ %bb.0:
1683 ; CHECK-ARM-NEXT: strb r1, [r0, #-255]!
1684 ; CHECK-ARM-NEXT: bx lr
1685 %o = getelementptr inbounds i8, i8* %p, i32 -255
1686 %q = bitcast i8* %o to i8*
1687 store i8 %v, i8* %q, align 1
1691 define i8* @i8_m256(i8* %p, i8 %v) {
1692 ; CHECK-T1-LABEL: i8_m256:
1693 ; CHECK-T1: @ %bb.0:
1694 ; CHECK-T1-NEXT: movs r2, #255
1695 ; CHECK-T1-NEXT: mvns r2, r2
1696 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1697 ; CHECK-T1-NEXT: adds r0, r0, r2
1698 ; CHECK-T1-NEXT: bx lr
1700 ; CHECK-T2-LABEL: i8_m256:
1701 ; CHECK-T2: @ %bb.0:
1702 ; CHECK-T2-NEXT: mvn r2, #255
1703 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1704 ; CHECK-T2-NEXT: sub.w r0, r0, #256
1705 ; CHECK-T2-NEXT: bx lr
1707 ; CHECK-ARM-LABEL: i8_m256:
1708 ; CHECK-ARM: @ %bb.0:
1709 ; CHECK-ARM-NEXT: strb r1, [r0, #-256]!
1710 ; CHECK-ARM-NEXT: bx lr
1711 %o = getelementptr inbounds i8, i8* %p, i32 -256
1712 %q = bitcast i8* %o to i8*
1713 store i8 %v, i8* %q, align 1
1717 define i8* @i8_4095(i8* %p, i8 %v) {
1718 ; CHECK-T1-LABEL: i8_4095:
1719 ; CHECK-T1: @ %bb.0:
1720 ; CHECK-T1-NEXT: ldr r2, .LCPI67_0
1721 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1722 ; CHECK-T1-NEXT: adds r0, r0, r2
1723 ; CHECK-T1-NEXT: bx lr
1724 ; CHECK-T1-NEXT: .p2align 2
1725 ; CHECK-T1-NEXT: @ %bb.1:
1726 ; CHECK-T1-NEXT: .LCPI67_0:
1727 ; CHECK-T1-NEXT: .long 4095 @ 0xfff
1729 ; CHECK-T2-LABEL: i8_4095:
1730 ; CHECK-T2: @ %bb.0:
1731 ; CHECK-T2-NEXT: strb.w r1, [r0, #4095]
1732 ; CHECK-T2-NEXT: addw r0, r0, #4095
1733 ; CHECK-T2-NEXT: bx lr
1735 ; CHECK-ARM-LABEL: i8_4095:
1736 ; CHECK-ARM: @ %bb.0:
1737 ; CHECK-ARM-NEXT: strb r1, [r0, #4095]!
1738 ; CHECK-ARM-NEXT: bx lr
1739 %o = getelementptr inbounds i8, i8* %p, i32 4095
1740 %q = bitcast i8* %o to i8*
1741 store i8 %v, i8* %q, align 1
1745 define i8* @i8_4096(i8* %p, i8 %v) {
1746 ; CHECK-T1-LABEL: i8_4096:
1747 ; CHECK-T1: @ %bb.0:
1748 ; CHECK-T1-NEXT: movs r2, #1
1749 ; CHECK-T1-NEXT: lsls r2, r2, #12
1750 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1751 ; CHECK-T1-NEXT: adds r0, r0, r2
1752 ; CHECK-T1-NEXT: bx lr
1754 ; CHECK-T2-LABEL: i8_4096:
1755 ; CHECK-T2: @ %bb.0:
1756 ; CHECK-T2-NEXT: mov.w r2, #4096
1757 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1758 ; CHECK-T2-NEXT: add.w r0, r0, #4096
1759 ; CHECK-T2-NEXT: bx lr
1761 ; CHECK-ARM-LABEL: i8_4096:
1762 ; CHECK-ARM: @ %bb.0:
1763 ; CHECK-ARM-NEXT: mov r2, #4096
1764 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1765 ; CHECK-ARM-NEXT: bx lr
1766 %o = getelementptr inbounds i8, i8* %p, i32 4096
1767 %q = bitcast i8* %o to i8*
1768 store i8 %v, i8* %q, align 1
1772 define i8* @i8_m4095(i8* %p, i8 %v) {
1773 ; CHECK-T1-LABEL: i8_m4095:
1774 ; CHECK-T1: @ %bb.0:
1775 ; CHECK-T1-NEXT: ldr r2, .LCPI69_0
1776 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1777 ; CHECK-T1-NEXT: adds r0, r0, r2
1778 ; CHECK-T1-NEXT: bx lr
1779 ; CHECK-T1-NEXT: .p2align 2
1780 ; CHECK-T1-NEXT: @ %bb.1:
1781 ; CHECK-T1-NEXT: .LCPI69_0:
1782 ; CHECK-T1-NEXT: .long 4294963201 @ 0xfffff001
1784 ; CHECK-T2-LABEL: i8_m4095:
1785 ; CHECK-T2: @ %bb.0:
1786 ; CHECK-T2-NEXT: movw r2, #61441
1787 ; CHECK-T2-NEXT: movt r2, #65535
1788 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1789 ; CHECK-T2-NEXT: subw r0, r0, #4095
1790 ; CHECK-T2-NEXT: bx lr
1792 ; CHECK-ARM-LABEL: i8_m4095:
1793 ; CHECK-ARM: @ %bb.0:
1794 ; CHECK-ARM-NEXT: strb r1, [r0, #-4095]!
1795 ; CHECK-ARM-NEXT: bx lr
1796 %o = getelementptr inbounds i8, i8* %p, i32 -4095
1797 %q = bitcast i8* %o to i8*
1798 store i8 %v, i8* %q, align 1
1802 define i8* @i8_m4096(i8* %p, i8 %v) {
1803 ; CHECK-T1-LABEL: i8_m4096:
1804 ; CHECK-T1: @ %bb.0:
1805 ; CHECK-T1-NEXT: ldr r2, .LCPI70_0
1806 ; CHECK-T1-NEXT: strb r1, [r0, r2]
1807 ; CHECK-T1-NEXT: adds r0, r0, r2
1808 ; CHECK-T1-NEXT: bx lr
1809 ; CHECK-T1-NEXT: .p2align 2
1810 ; CHECK-T1-NEXT: @ %bb.1:
1811 ; CHECK-T1-NEXT: .LCPI70_0:
1812 ; CHECK-T1-NEXT: .long 4294963200 @ 0xfffff000
1814 ; CHECK-T2-LABEL: i8_m4096:
1815 ; CHECK-T2: @ %bb.0:
1816 ; CHECK-T2-NEXT: movw r2, #61440
1817 ; CHECK-T2-NEXT: movt r2, #65535
1818 ; CHECK-T2-NEXT: strb r1, [r0, r2]
1819 ; CHECK-T2-NEXT: sub.w r0, r0, #4096
1820 ; CHECK-T2-NEXT: bx lr
1822 ; CHECK-ARM-LABEL: i8_m4096:
1823 ; CHECK-ARM: @ %bb.0:
1824 ; CHECK-ARM-NEXT: movw r2, #61440
1825 ; CHECK-ARM-NEXT: movt r2, #65535
1826 ; CHECK-ARM-NEXT: strb r1, [r0, r2]!
1827 ; CHECK-ARM-NEXT: bx lr
1828 %o = getelementptr inbounds i8, i8* %p, i32 -4096
1829 %q = bitcast i8* %o to i8*
1830 store i8 %v, i8* %q, align 1