1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=csky -verify-machineinstrs -csky-no-aliases -no-integrated-as -mattr=+e2 < %s \
3 ; RUN: | FileCheck -check-prefix=CSKY %s
5 ; These test that we can use both the architectural names (r*) and the ABI names
6 ; (a*, l* etc) to refer to registers in inline asm constraint lists. In each
7 ; case, the named register should be used for the source register of the `addi`.
9 ; The inline assembly will, by default, contain the ABI names for the registers.
11 ; Parenthesised registers in comments are the other aliases for this register.
13 ; NOTE: This test uses `r0` (`a0`) as an input, so it should be saved.
14 define i32 @explicit_register_r0(i32 %a) nounwind {
15 ; CSKY-LABEL: explicit_register_r0:
18 ; CSKY-NEXT: addi a0, a0, 1
21 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r0}"(i32 %a)
25 ; NOTE: This test uses `r0` (`a0`) as an input, so it should be saved.
26 define i32 @explicit_register_a0(i32 %a) nounwind {
27 ; CSKY-LABEL: explicit_register_a0:
30 ; CSKY-NEXT: addi a0, a0, 1
33 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{a0}"(i32 %a)
37 ; NOTE: This test uses `r1` (`a1`) as an input, so it should be saved.
38 define i32 @explicit_register_r1(i32 %a) nounwind {
39 ; CSKY-LABEL: explicit_register_r1:
41 ; CSKY-NEXT: mov16 a1, a0
43 ; CSKY-NEXT: addi a0, a1, 1
46 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r1}"(i32 %a)
50 define i32 @explicit_register_a1(i32 %a) nounwind {
51 ; CSKY-LABEL: explicit_register_a1:
53 ; CSKY-NEXT: mov16 a1, a0
55 ; CSKY-NEXT: addi a0, a1, 1
58 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{a1}"(i32 %a)
62 ; NOTE: This test uses `r2` (`a2`) as an input, so it should be saved.
63 define i32 @explicit_register_r2(i32 %a) nounwind {
64 ; CSKY-LABEL: explicit_register_r2:
66 ; CSKY-NEXT: mov16 a2, a0
68 ; CSKY-NEXT: addi a0, a2, 1
71 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r2}"(i32 %a)
75 define i32 @explicit_register_a2(i32 %a) nounwind {
76 ; CSKY-LABEL: explicit_register_a2:
78 ; CSKY-NEXT: mov16 a2, a0
80 ; CSKY-NEXT: addi a0, a2, 1
83 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{a2}"(i32 %a)
87 ; NOTE: This test uses `r3` (`a3`) as an input, so it should be saved.
88 define i32 @explicit_register_r3(i32 %a) nounwind {
89 ; CSKY-LABEL: explicit_register_r3:
91 ; CSKY-NEXT: mov16 a3, a0
93 ; CSKY-NEXT: addi a0, a3, 1
96 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r3}"(i32 %a)
100 define i32 @explicit_register_a3(i32 %a) nounwind {
101 ; CSKY-LABEL: explicit_register_a3:
103 ; CSKY-NEXT: mov16 a3, a0
105 ; CSKY-NEXT: addi a0, a3, 1
108 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{a3}"(i32 %a)
112 ; NOTE: This test uses `r4` (`l0`) as an input, so it should be saved.
113 define i32 @explicit_register_r4(i32 %a) nounwind {
114 ; CSKY-LABEL: explicit_register_r4:
116 ; CSKY-NEXT: subi16 sp, sp, 4
117 ; CSKY-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
118 ; CSKY-NEXT: mov16 l0, a0
120 ; CSKY-NEXT: addi a0, l0, 1
122 ; CSKY-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
123 ; CSKY-NEXT: addi16 sp, sp, 4
125 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r4}"(i32 %a)
129 define i32 @explicit_register_l0(i32 %a) nounwind {
130 ; CSKY-LABEL: explicit_register_l0:
132 ; CSKY-NEXT: subi16 sp, sp, 4
133 ; CSKY-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
134 ; CSKY-NEXT: mov16 l0, a0
136 ; CSKY-NEXT: addi a0, l0, 1
138 ; CSKY-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
139 ; CSKY-NEXT: addi16 sp, sp, 4
141 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l0}"(i32 %a)
145 ; NOTE: This test uses `r5` (`l1`) as an input, so it should be saved.
146 define i32 @explicit_register_r5(i32 %a) nounwind {
147 ; CSKY-LABEL: explicit_register_r5:
149 ; CSKY-NEXT: subi16 sp, sp, 4
150 ; CSKY-NEXT: st16.w l1, (sp, 0) # 4-byte Folded Spill
151 ; CSKY-NEXT: mov16 l1, a0
153 ; CSKY-NEXT: addi a0, l1, 1
155 ; CSKY-NEXT: ld16.w l1, (sp, 0) # 4-byte Folded Reload
156 ; CSKY-NEXT: addi16 sp, sp, 4
158 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r5}"(i32 %a)
162 define i32 @explicit_register_l1(i32 %a) nounwind {
163 ; CSKY-LABEL: explicit_register_l1:
165 ; CSKY-NEXT: subi16 sp, sp, 4
166 ; CSKY-NEXT: st16.w l1, (sp, 0) # 4-byte Folded Spill
167 ; CSKY-NEXT: mov16 l1, a0
169 ; CSKY-NEXT: addi a0, l1, 1
171 ; CSKY-NEXT: ld16.w l1, (sp, 0) # 4-byte Folded Reload
172 ; CSKY-NEXT: addi16 sp, sp, 4
174 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l1}"(i32 %a)
178 ; NOTE: This test uses `r6` (`l2`) as an input, so it should be saved.
179 define i32 @explicit_register_r6(i32 %a) nounwind {
180 ; CSKY-LABEL: explicit_register_r6:
182 ; CSKY-NEXT: subi16 sp, sp, 4
183 ; CSKY-NEXT: st16.w l2, (sp, 0) # 4-byte Folded Spill
184 ; CSKY-NEXT: mov16 l2, a0
186 ; CSKY-NEXT: addi a0, l2, 1
188 ; CSKY-NEXT: ld16.w l2, (sp, 0) # 4-byte Folded Reload
189 ; CSKY-NEXT: addi16 sp, sp, 4
191 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r6}"(i32 %a)
195 define i32 @explicit_register_l2(i32 %a) nounwind {
196 ; CSKY-LABEL: explicit_register_l2:
198 ; CSKY-NEXT: subi16 sp, sp, 4
199 ; CSKY-NEXT: st16.w l2, (sp, 0) # 4-byte Folded Spill
200 ; CSKY-NEXT: mov16 l2, a0
202 ; CSKY-NEXT: addi a0, l2, 1
204 ; CSKY-NEXT: ld16.w l2, (sp, 0) # 4-byte Folded Reload
205 ; CSKY-NEXT: addi16 sp, sp, 4
207 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l2}"(i32 %a)
211 ; NOTE: This test uses `r7` (`l3`) as an input, so it should be saved.
212 define i32 @explicit_register_r7(i32 %a) nounwind {
213 ; CSKY-LABEL: explicit_register_r7:
215 ; CSKY-NEXT: subi16 sp, sp, 4
216 ; CSKY-NEXT: st16.w l3, (sp, 0) # 4-byte Folded Spill
217 ; CSKY-NEXT: mov16 l3, a0
219 ; CSKY-NEXT: addi a0, l3, 1
221 ; CSKY-NEXT: ld16.w l3, (sp, 0) # 4-byte Folded Reload
222 ; CSKY-NEXT: addi16 sp, sp, 4
224 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r7}"(i32 %a)
228 define i32 @explicit_register_l3(i32 %a) nounwind {
229 ; CSKY-LABEL: explicit_register_l3:
231 ; CSKY-NEXT: subi16 sp, sp, 4
232 ; CSKY-NEXT: st16.w l3, (sp, 0) # 4-byte Folded Spill
233 ; CSKY-NEXT: mov16 l3, a0
235 ; CSKY-NEXT: addi a0, l3, 1
237 ; CSKY-NEXT: ld16.w l3, (sp, 0) # 4-byte Folded Reload
238 ; CSKY-NEXT: addi16 sp, sp, 4
240 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l3}"(i32 %a)
244 ; NOTE: This test uses `r8` (`l4`) as an input, so it should be saved.
245 define i32 @explicit_register_r8(i32 %a) nounwind {
246 ; CSKY-LABEL: explicit_register_r8:
248 ; CSKY-NEXT: subi16 sp, sp, 4
249 ; CSKY-NEXT: st32.w l4, (sp, 0) # 4-byte Folded Spill
250 ; CSKY-NEXT: mov16 l4, a0
252 ; CSKY-NEXT: addi a0, l4, 1
254 ; CSKY-NEXT: ld32.w l4, (sp, 0) # 4-byte Folded Reload
255 ; CSKY-NEXT: addi16 sp, sp, 4
257 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r8}"(i32 %a)
261 define i32 @explicit_register_l4(i32 %a) nounwind {
262 ; CSKY-LABEL: explicit_register_l4:
264 ; CSKY-NEXT: subi16 sp, sp, 4
265 ; CSKY-NEXT: st32.w l4, (sp, 0) # 4-byte Folded Spill
266 ; CSKY-NEXT: mov16 l4, a0
268 ; CSKY-NEXT: addi a0, l4, 1
270 ; CSKY-NEXT: ld32.w l4, (sp, 0) # 4-byte Folded Reload
271 ; CSKY-NEXT: addi16 sp, sp, 4
273 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l4}"(i32 %a)
277 ; NOTE: This test uses `r9` (`l5`) as an input, so it should be saved.
278 define i32 @explicit_register_r9(i32 %a) nounwind {
279 ; CSKY-LABEL: explicit_register_r9:
281 ; CSKY-NEXT: subi16 sp, sp, 4
282 ; CSKY-NEXT: st32.w l5, (sp, 0) # 4-byte Folded Spill
283 ; CSKY-NEXT: mov16 l5, a0
285 ; CSKY-NEXT: addi a0, l5, 1
287 ; CSKY-NEXT: ld32.w l5, (sp, 0) # 4-byte Folded Reload
288 ; CSKY-NEXT: addi16 sp, sp, 4
290 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r9}"(i32 %a)
294 define i32 @explicit_register_l5(i32 %a) nounwind {
295 ; CSKY-LABEL: explicit_register_l5:
297 ; CSKY-NEXT: subi16 sp, sp, 4
298 ; CSKY-NEXT: st32.w l5, (sp, 0) # 4-byte Folded Spill
299 ; CSKY-NEXT: mov16 l5, a0
301 ; CSKY-NEXT: addi a0, l5, 1
303 ; CSKY-NEXT: ld32.w l5, (sp, 0) # 4-byte Folded Reload
304 ; CSKY-NEXT: addi16 sp, sp, 4
306 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l5}"(i32 %a)
310 ; NOTE: This test uses `r10` (`l6`) as an input, so it should be saved.
311 define i32 @explicit_register_r10(i32 %a) nounwind {
312 ; CSKY-LABEL: explicit_register_r10:
314 ; CSKY-NEXT: subi16 sp, sp, 4
315 ; CSKY-NEXT: st32.w l6, (sp, 0) # 4-byte Folded Spill
316 ; CSKY-NEXT: mov16 l6, a0
318 ; CSKY-NEXT: addi a0, l6, 1
320 ; CSKY-NEXT: ld32.w l6, (sp, 0) # 4-byte Folded Reload
321 ; CSKY-NEXT: addi16 sp, sp, 4
323 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r10}"(i32 %a)
327 define i32 @explicit_register_l6(i32 %a) nounwind {
328 ; CSKY-LABEL: explicit_register_l6:
330 ; CSKY-NEXT: subi16 sp, sp, 4
331 ; CSKY-NEXT: st32.w l6, (sp, 0) # 4-byte Folded Spill
332 ; CSKY-NEXT: mov16 l6, a0
334 ; CSKY-NEXT: addi a0, l6, 1
336 ; CSKY-NEXT: ld32.w l6, (sp, 0) # 4-byte Folded Reload
337 ; CSKY-NEXT: addi16 sp, sp, 4
339 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l6}"(i32 %a)
343 ; NOTE: This test uses `r11` (`l7`) as an input, so it should be saved.
344 define i32 @explicit_register_r11(i32 %a) nounwind {
345 ; CSKY-LABEL: explicit_register_r11:
347 ; CSKY-NEXT: subi16 sp, sp, 4
348 ; CSKY-NEXT: st32.w l7, (sp, 0) # 4-byte Folded Spill
349 ; CSKY-NEXT: mov16 l7, a0
351 ; CSKY-NEXT: addi a0, l7, 1
353 ; CSKY-NEXT: ld32.w l7, (sp, 0) # 4-byte Folded Reload
354 ; CSKY-NEXT: addi16 sp, sp, 4
356 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r11}"(i32 %a)
360 define i32 @explicit_register_l7(i32 %a) nounwind {
361 ; CSKY-LABEL: explicit_register_l7:
363 ; CSKY-NEXT: subi16 sp, sp, 4
364 ; CSKY-NEXT: st32.w l7, (sp, 0) # 4-byte Folded Spill
365 ; CSKY-NEXT: mov16 l7, a0
367 ; CSKY-NEXT: addi a0, l7, 1
369 ; CSKY-NEXT: ld32.w l7, (sp, 0) # 4-byte Folded Reload
370 ; CSKY-NEXT: addi16 sp, sp, 4
372 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l7}"(i32 %a)
376 ; NOTE: This test uses `r12` (`t0`) as an input, so it should be saved.
377 define i32 @explicit_register_r12(i32 %a) nounwind {
378 ; CSKY-LABEL: explicit_register_r12:
380 ; CSKY-NEXT: mov16 t0, a0
382 ; CSKY-NEXT: addi a0, t0, 1
385 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r12}"(i32 %a)
389 define i32 @explicit_register_t0(i32 %a) nounwind {
390 ; CSKY-LABEL: explicit_register_t0:
392 ; CSKY-NEXT: mov16 t0, a0
394 ; CSKY-NEXT: addi a0, t0, 1
397 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t0}"(i32 %a)
401 ; NOTE: This test uses `r13` (`t1`) as an input, so it should be saved.
402 define i32 @explicit_register_r13(i32 %a) nounwind {
403 ; CSKY-LABEL: explicit_register_r13:
405 ; CSKY-NEXT: mov16 t1, a0
407 ; CSKY-NEXT: addi a0, t1, 1
410 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r13}"(i32 %a)
414 define i32 @explicit_register_t1(i32 %a) nounwind {
415 ; CSKY-LABEL: explicit_register_t1:
417 ; CSKY-NEXT: mov16 t1, a0
419 ; CSKY-NEXT: addi a0, t1, 1
422 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t1}"(i32 %a)
426 ; NOTE: This test uses `r14` (`sp`) as an input, so it should be saved.
427 define i32 @explicit_register_r14(i32 %a) nounwind {
428 ; CSKY-LABEL: explicit_register_r14:
430 ; CSKY-NEXT: mov16 sp, a0
432 ; CSKY-NEXT: addi a0, sp, 1
435 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r14}"(i32 %a)
439 define i32 @explicit_register_sp(i32 %a) nounwind {
440 ; CSKY-LABEL: explicit_register_sp:
442 ; CSKY-NEXT: mov16 sp, a0
444 ; CSKY-NEXT: addi a0, sp, 1
447 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{sp}"(i32 %a)
451 ; NOTE: This test uses `r15` (`lr`) as an input, so it should be saved.
452 define i32 @explicit_register_r15(i32 %a) nounwind {
453 ; CSKY-LABEL: explicit_register_r15:
455 ; CSKY-NEXT: subi16 sp, sp, 4
456 ; CSKY-NEXT: st32.w lr, (sp, 0) # 4-byte Folded Spill
457 ; CSKY-NEXT: mov16 lr, a0
459 ; CSKY-NEXT: addi a0, lr, 1
461 ; CSKY-NEXT: ld32.w lr, (sp, 0) # 4-byte Folded Reload
462 ; CSKY-NEXT: addi16 sp, sp, 4
464 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r15}"(i32 %a)
468 define i32 @explicit_register_lr(i32 %a) nounwind {
469 ; CSKY-LABEL: explicit_register_lr:
471 ; CSKY-NEXT: subi16 sp, sp, 4
472 ; CSKY-NEXT: st32.w lr, (sp, 0) # 4-byte Folded Spill
473 ; CSKY-NEXT: mov16 lr, a0
475 ; CSKY-NEXT: addi a0, lr, 1
477 ; CSKY-NEXT: ld32.w lr, (sp, 0) # 4-byte Folded Reload
478 ; CSKY-NEXT: addi16 sp, sp, 4
480 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{lr}"(i32 %a)
484 ; NOTE: This test uses `r16` (`l8`) as an input, so it should be saved.
485 define i32 @explicit_register_r16(i32 %a) nounwind {
486 ; CSKY-LABEL: explicit_register_r16:
488 ; CSKY-NEXT: subi16 sp, sp, 4
489 ; CSKY-NEXT: st32.w l8, (sp, 0) # 4-byte Folded Spill
490 ; CSKY-NEXT: mov32 l8, a0
492 ; CSKY-NEXT: addi a0, l8, 1
494 ; CSKY-NEXT: ld32.w l8, (sp, 0) # 4-byte Folded Reload
495 ; CSKY-NEXT: addi16 sp, sp, 4
497 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r16}"(i32 %a)
501 define i32 @explicit_register_l8(i32 %a) nounwind {
502 ; CSKY-LABEL: explicit_register_l8:
504 ; CSKY-NEXT: subi16 sp, sp, 4
505 ; CSKY-NEXT: st32.w l8, (sp, 0) # 4-byte Folded Spill
506 ; CSKY-NEXT: mov32 l8, a0
508 ; CSKY-NEXT: addi a0, l8, 1
510 ; CSKY-NEXT: ld32.w l8, (sp, 0) # 4-byte Folded Reload
511 ; CSKY-NEXT: addi16 sp, sp, 4
513 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l8}"(i32 %a)
517 ; NOTE: This test uses `r17` (`l9`) as an input, so it should be saved.
518 define i32 @explicit_register_r17(i32 %a) nounwind {
519 ; CSKY-LABEL: explicit_register_r17:
521 ; CSKY-NEXT: subi16 sp, sp, 4
522 ; CSKY-NEXT: st32.w l9, (sp, 0) # 4-byte Folded Spill
523 ; CSKY-NEXT: mov32 l9, a0
525 ; CSKY-NEXT: addi a0, l9, 1
527 ; CSKY-NEXT: ld32.w l9, (sp, 0) # 4-byte Folded Reload
528 ; CSKY-NEXT: addi16 sp, sp, 4
530 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r17}"(i32 %a)
534 define i32 @explicit_register_l9(i32 %a) nounwind {
535 ; CSKY-LABEL: explicit_register_l9:
537 ; CSKY-NEXT: subi16 sp, sp, 4
538 ; CSKY-NEXT: st32.w l9, (sp, 0) # 4-byte Folded Spill
539 ; CSKY-NEXT: mov32 l9, a0
541 ; CSKY-NEXT: addi a0, l9, 1
543 ; CSKY-NEXT: ld32.w l9, (sp, 0) # 4-byte Folded Reload
544 ; CSKY-NEXT: addi16 sp, sp, 4
546 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{l9}"(i32 %a)
550 ; NOTE: This test uses `r18` (`t2`) as an input, so it should be saved.
551 define i32 @explicit_register_r18(i32 %a) nounwind {
552 ; CSKY-LABEL: explicit_register_r18:
554 ; CSKY-NEXT: mov32 t2, a0
556 ; CSKY-NEXT: addi a0, t2, 1
559 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r18}"(i32 %a)
563 define i32 @explicit_register_t2(i32 %a) nounwind {
564 ; CSKY-LABEL: explicit_register_t2:
566 ; CSKY-NEXT: mov32 t2, a0
568 ; CSKY-NEXT: addi a0, t2, 1
571 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t2}"(i32 %a)
575 ; NOTE: This test uses `r19` (`t3`) as an input, so it should be saved.
576 define i32 @explicit_register_r19(i32 %a) nounwind {
577 ; CSKY-LABEL: explicit_register_r19:
579 ; CSKY-NEXT: mov32 t3, a0
581 ; CSKY-NEXT: addi a0, t3, 1
584 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r19}"(i32 %a)
588 define i32 @explicit_register_t3(i32 %a) nounwind {
589 ; CSKY-LABEL: explicit_register_t3:
591 ; CSKY-NEXT: mov32 t3, a0
593 ; CSKY-NEXT: addi a0, t3, 1
596 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t3}"(i32 %a)
600 ; NOTE: This test uses `r20` (`t4`) as an input, so it should be saved.
601 define i32 @explicit_register_r20(i32 %a) nounwind {
602 ; CSKY-LABEL: explicit_register_r20:
604 ; CSKY-NEXT: mov32 t4, a0
606 ; CSKY-NEXT: addi a0, t4, 1
609 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r20}"(i32 %a)
613 define i32 @explicit_register_t4(i32 %a) nounwind {
614 ; CSKY-LABEL: explicit_register_t4:
616 ; CSKY-NEXT: mov32 t4, a0
618 ; CSKY-NEXT: addi a0, t4, 1
621 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t4}"(i32 %a)
625 ; NOTE: This test uses `r21` (`t5`) as an input, so it should be saved.
626 define i32 @explicit_register_r21(i32 %a) nounwind {
627 ; CSKY-LABEL: explicit_register_r21:
629 ; CSKY-NEXT: mov32 t5, a0
631 ; CSKY-NEXT: addi a0, t5, 1
634 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r21}"(i32 %a)
638 define i32 @explicit_register_t5(i32 %a) nounwind {
639 ; CSKY-LABEL: explicit_register_t5:
641 ; CSKY-NEXT: mov32 t5, a0
643 ; CSKY-NEXT: addi a0, t5, 1
646 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t5}"(i32 %a)
650 ; NOTE: This test uses `r22` (`t6`) as an input, so it should be saved.
651 define i32 @explicit_register_r22(i32 %a) nounwind {
652 ; CSKY-LABEL: explicit_register_r22:
654 ; CSKY-NEXT: mov32 t6, a0
656 ; CSKY-NEXT: addi a0, t6, 1
659 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r22}"(i32 %a)
663 define i32 @explicit_register_t6(i32 %a) nounwind {
664 ; CSKY-LABEL: explicit_register_t6:
666 ; CSKY-NEXT: mov32 t6, a0
668 ; CSKY-NEXT: addi a0, t6, 1
671 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t6}"(i32 %a)
675 ; NOTE: This test uses `r23` (`t7`) as an input, so it should be saved.
676 define i32 @explicit_register_r23(i32 %a) nounwind {
677 ; CSKY-LABEL: explicit_register_r23:
679 ; CSKY-NEXT: mov32 t7, a0
681 ; CSKY-NEXT: addi a0, t7, 1
684 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r23}"(i32 %a)
688 define i32 @explicit_register_t7(i32 %a) nounwind {
689 ; CSKY-LABEL: explicit_register_t7:
691 ; CSKY-NEXT: mov32 t7, a0
693 ; CSKY-NEXT: addi a0, t7, 1
696 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t7}"(i32 %a)
700 ; NOTE: This test uses `r24` (`t8`) as an input, so it should be saved.
701 define i32 @explicit_register_r24(i32 %a) nounwind {
702 ; CSKY-LABEL: explicit_register_r24:
704 ; CSKY-NEXT: mov32 t8, a0
706 ; CSKY-NEXT: addi a0, t8, 1
709 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r24}"(i32 %a)
713 define i32 @explicit_register_t8(i32 %a) nounwind {
714 ; CSKY-LABEL: explicit_register_t8:
716 ; CSKY-NEXT: mov32 t8, a0
718 ; CSKY-NEXT: addi a0, t8, 1
721 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t8}"(i32 %a)
725 ; NOTE: This test uses `r25` (`t9`) as an input, so it should be saved.
726 define i32 @explicit_register_r25(i32 %a) nounwind {
727 ; CSKY-LABEL: explicit_register_r25:
729 ; CSKY-NEXT: mov32 t9, a0
731 ; CSKY-NEXT: addi a0, t9, 1
734 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r25}"(i32 %a)
738 define i32 @explicit_register_t9(i32 %a) nounwind {
739 ; CSKY-LABEL: explicit_register_t9:
741 ; CSKY-NEXT: mov32 t9, a0
743 ; CSKY-NEXT: addi a0, t9, 1
746 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{t9}"(i32 %a)
750 ; NOTE: This test uses `r26` (`r26`) as an input, so it should be saved.
751 define i32 @explicit_register_r26(i32 %a) nounwind {
752 ; CSKY-LABEL: explicit_register_r26:
754 ; CSKY-NEXT: mov32 r26, a0
756 ; CSKY-NEXT: addi a0, r26, 1
759 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r26}"(i32 %a)
764 ; NOTE: This test uses `r27` (`r27`) as an input, so it should be saved.
765 define i32 @explicit_register_r27(i32 %a) nounwind {
766 ; CSKY-LABEL: explicit_register_r27:
768 ; CSKY-NEXT: mov32 r27, a0
770 ; CSKY-NEXT: addi a0, r27, 1
773 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r27}"(i32 %a)
777 ; NOTE: This test uses `r28` (`rgb`) as an input, so it should be saved.
778 define i32 @explicit_register_r28(i32 %a) nounwind {
779 ; CSKY-LABEL: explicit_register_r28:
781 ; CSKY-NEXT: subi16 sp, sp, 4
782 ; CSKY-NEXT: st32.w rgb, (sp, 0) # 4-byte Folded Spill
783 ; CSKY-NEXT: mov32 rgb, a0
785 ; CSKY-NEXT: addi a0, rgb, 1
787 ; CSKY-NEXT: ld32.w rgb, (sp, 0) # 4-byte Folded Reload
788 ; CSKY-NEXT: addi16 sp, sp, 4
790 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r28}"(i32 %a)
794 define i32 @explicit_register_rgb(i32 %a) nounwind {
795 ; CSKY-LABEL: explicit_register_rgb:
797 ; CSKY-NEXT: subi16 sp, sp, 4
798 ; CSKY-NEXT: st32.w rgb, (sp, 0) # 4-byte Folded Spill
799 ; CSKY-NEXT: mov32 rgb, a0
801 ; CSKY-NEXT: addi a0, rgb, 1
803 ; CSKY-NEXT: ld32.w rgb, (sp, 0) # 4-byte Folded Reload
804 ; CSKY-NEXT: addi16 sp, sp, 4
806 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{rgb}"(i32 %a)
810 ; NOTE: This test uses `r29` (`rtb`) as an input, so it should be saved.
811 define i32 @explicit_register_r29(i32 %a) nounwind {
812 ; CSKY-LABEL: explicit_register_r29:
814 ; CSKY-NEXT: mov32 rtb, a0
816 ; CSKY-NEXT: addi a0, rtb, 1
819 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r29}"(i32 %a)
823 define i32 @explicit_register_rtb(i32 %a) nounwind {
824 ; CSKY-LABEL: explicit_register_rtb:
826 ; CSKY-NEXT: mov32 rtb, a0
828 ; CSKY-NEXT: addi a0, rtb, 1
831 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{rtb}"(i32 %a)
835 ; NOTE: This test uses `r30` (`svbr`) as an input, so it should be saved.
836 define i32 @explicit_register_r30(i32 %a) nounwind {
837 ; CSKY-LABEL: explicit_register_r30:
839 ; CSKY-NEXT: mov32 svbr, a0
841 ; CSKY-NEXT: addi a0, svbr, 1
844 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r30}"(i32 %a)
848 define i32 @explicit_register_svbr(i32 %a) nounwind {
849 ; CSKY-LABEL: explicit_register_svbr:
851 ; CSKY-NEXT: mov32 svbr, a0
853 ; CSKY-NEXT: addi a0, svbr, 1
856 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{svbr}"(i32 %a)
860 ; NOTE: This test uses `r31` (`tls`) as an input, so it should be saved.
861 define i32 @explicit_register_r31(i32 %a) nounwind {
862 ; CSKY-LABEL: explicit_register_r31:
864 ; CSKY-NEXT: mov32 tls, a0
866 ; CSKY-NEXT: addi a0, tls, 1
869 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{r31}"(i32 %a)
873 define i32 @explicit_register_tls(i32 %a) nounwind {
874 ; CSKY-LABEL: explicit_register_tls:
876 ; CSKY-NEXT: mov32 tls, a0
878 ; CSKY-NEXT: addi a0, tls, 1
881 %1 = tail call i32 asm "addi $0, $1, 1", "=r,{tls}"(i32 %a)