1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64I %s
7 ; These test that we can use both the architectural names (x*) and the ABI names
8 ; (a*, s*, t* etc) to refer to registers in inline asm constraint lists. In each
9 ; case, the named register should be used for the source register of the `addi`.
10 ; It is very likely that `a0` will be chosen as the designation register, but
11 ; this is left to the compiler to choose.
13 ; The inline assembly will, by default, contain the ABI names for the registers.
15 ; Parenthesised registers in comments are the other aliases for this register.
17 ; NOTE: This test has to pass in 0 to the inline asm, because that's the only
18 ; value `x0` (`zero`) can take.
19 define i32 @explicit_register_x0() nounwind {
20 ; RV32I-LABEL: explicit_register_x0:
23 ; RV32I-NEXT: addi a0, zero, 0
27 ; RV64I-LABEL: explicit_register_x0:
30 ; RV64I-NEXT: addi a0, zero, 0
33 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x0}"(i32 0)
37 ; NOTE: This test has to pass in 0 to the inline asm, because that's the only
38 ; value that `zero` (`x0`) can take.
39 define i32 @explicit_register_zero() nounwind {
40 ; RV32I-LABEL: explicit_register_zero:
43 ; RV32I-NEXT: addi a0, zero, 0
47 ; RV64I-LABEL: explicit_register_zero:
50 ; RV64I-NEXT: addi a0, zero, 0
53 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{zero}"(i32 0)
57 ; NOTE: This test uses `x1` (`ra`) as an input, so it should be saved.
58 define i32 @explicit_register_x1(i32 %a) nounwind {
59 ; RV32I-LABEL: explicit_register_x1:
61 ; RV32I-NEXT: addi sp, sp, -16
62 ; RV32I-NEXT: sw ra, 12(sp)
63 ; RV32I-NEXT: mv ra, a0
65 ; RV32I-NEXT: addi a0, ra, 0
67 ; RV32I-NEXT: lw ra, 12(sp)
68 ; RV32I-NEXT: addi sp, sp, 16
71 ; RV64I-LABEL: explicit_register_x1:
73 ; RV64I-NEXT: addi sp, sp, -16
74 ; RV64I-NEXT: sd ra, 8(sp)
75 ; RV64I-NEXT: mv ra, a0
77 ; RV64I-NEXT: addi a0, ra, 0
79 ; RV64I-NEXT: ld ra, 8(sp)
80 ; RV64I-NEXT: addi sp, sp, 16
82 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x1}"(i32 %a)
86 ; NOTE: This test uses `ra` (`x1`) as an input, so it should be saved.
87 define i32 @explicit_register_ra(i32 %a) nounwind {
88 ; RV32I-LABEL: explicit_register_ra:
90 ; RV32I-NEXT: addi sp, sp, -16
91 ; RV32I-NEXT: sw ra, 12(sp)
92 ; RV32I-NEXT: mv ra, a0
94 ; RV32I-NEXT: addi a0, ra, 0
96 ; RV32I-NEXT: lw ra, 12(sp)
97 ; RV32I-NEXT: addi sp, sp, 16
100 ; RV64I-LABEL: explicit_register_ra:
102 ; RV64I-NEXT: addi sp, sp, -16
103 ; RV64I-NEXT: sd ra, 8(sp)
104 ; RV64I-NEXT: mv ra, a0
106 ; RV64I-NEXT: addi a0, ra, 0
107 ; RV64I-NEXT: #NO_APP
108 ; RV64I-NEXT: ld ra, 8(sp)
109 ; RV64I-NEXT: addi sp, sp, 16
111 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{ra}"(i32 %a)
115 define i32 @explicit_register_x2(i32 %a) nounwind {
116 ; RV32I-LABEL: explicit_register_x2:
118 ; RV32I-NEXT: mv sp, a0
120 ; RV32I-NEXT: addi a0, sp, 0
121 ; RV32I-NEXT: #NO_APP
124 ; RV64I-LABEL: explicit_register_x2:
126 ; RV64I-NEXT: mv sp, a0
128 ; RV64I-NEXT: addi a0, sp, 0
129 ; RV64I-NEXT: #NO_APP
131 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x2}"(i32 %a)
135 define i32 @explicit_register_sp(i32 %a) nounwind {
136 ; RV32I-LABEL: explicit_register_sp:
138 ; RV32I-NEXT: mv sp, a0
140 ; RV32I-NEXT: addi a0, sp, 0
141 ; RV32I-NEXT: #NO_APP
144 ; RV64I-LABEL: explicit_register_sp:
146 ; RV64I-NEXT: mv sp, a0
148 ; RV64I-NEXT: addi a0, sp, 0
149 ; RV64I-NEXT: #NO_APP
151 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{sp}"(i32 %a)
155 ; NOTE: This test uses `x3` (`gp`) as an input, so it should be saved.
156 define i32 @explicit_register_x3(i32 %a) nounwind {
157 ; RV32I-LABEL: explicit_register_x3:
159 ; RV32I-NEXT: addi sp, sp, -16
160 ; RV32I-NEXT: sw gp, 12(sp)
161 ; RV32I-NEXT: mv gp, a0
163 ; RV32I-NEXT: addi a0, gp, 0
164 ; RV32I-NEXT: #NO_APP
165 ; RV32I-NEXT: lw gp, 12(sp)
166 ; RV32I-NEXT: addi sp, sp, 16
169 ; RV64I-LABEL: explicit_register_x3:
171 ; RV64I-NEXT: addi sp, sp, -16
172 ; RV64I-NEXT: sd gp, 8(sp)
173 ; RV64I-NEXT: mv gp, a0
175 ; RV64I-NEXT: addi a0, gp, 0
176 ; RV64I-NEXT: #NO_APP
177 ; RV64I-NEXT: ld gp, 8(sp)
178 ; RV64I-NEXT: addi sp, sp, 16
180 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x3}"(i32 %a)
184 ; NOTE: This test uses `gp` (`x3`) as an input, so it should be saved.
185 define i32 @explicit_register_gp(i32 %a) nounwind {
186 ; RV32I-LABEL: explicit_register_gp:
188 ; RV32I-NEXT: addi sp, sp, -16
189 ; RV32I-NEXT: sw gp, 12(sp)
190 ; RV32I-NEXT: mv gp, a0
192 ; RV32I-NEXT: addi a0, gp, 0
193 ; RV32I-NEXT: #NO_APP
194 ; RV32I-NEXT: lw gp, 12(sp)
195 ; RV32I-NEXT: addi sp, sp, 16
198 ; RV64I-LABEL: explicit_register_gp:
200 ; RV64I-NEXT: addi sp, sp, -16
201 ; RV64I-NEXT: sd gp, 8(sp)
202 ; RV64I-NEXT: mv gp, a0
204 ; RV64I-NEXT: addi a0, gp, 0
205 ; RV64I-NEXT: #NO_APP
206 ; RV64I-NEXT: ld gp, 8(sp)
207 ; RV64I-NEXT: addi sp, sp, 16
209 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{gp}"(i32 %a)
213 ; NOTE: This test uses `x4` (`tp`) as an input, so it should be saved.
214 define i32 @explicit_register_x4(i32 %a) nounwind {
215 ; RV32I-LABEL: explicit_register_x4:
217 ; RV32I-NEXT: addi sp, sp, -16
218 ; RV32I-NEXT: sw tp, 12(sp)
219 ; RV32I-NEXT: mv tp, a0
221 ; RV32I-NEXT: addi a0, tp, 0
222 ; RV32I-NEXT: #NO_APP
223 ; RV32I-NEXT: lw tp, 12(sp)
224 ; RV32I-NEXT: addi sp, sp, 16
227 ; RV64I-LABEL: explicit_register_x4:
229 ; RV64I-NEXT: addi sp, sp, -16
230 ; RV64I-NEXT: sd tp, 8(sp)
231 ; RV64I-NEXT: mv tp, a0
233 ; RV64I-NEXT: addi a0, tp, 0
234 ; RV64I-NEXT: #NO_APP
235 ; RV64I-NEXT: ld tp, 8(sp)
236 ; RV64I-NEXT: addi sp, sp, 16
238 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x4}"(i32 %a)
242 ; NOTE: This test uses `tp` (`x4`) as an input, so it should be saved.
243 define i32 @explicit_register_tp(i32 %a) nounwind {
244 ; RV32I-LABEL: explicit_register_tp:
246 ; RV32I-NEXT: addi sp, sp, -16
247 ; RV32I-NEXT: sw tp, 12(sp)
248 ; RV32I-NEXT: mv tp, a0
250 ; RV32I-NEXT: addi a0, tp, 0
251 ; RV32I-NEXT: #NO_APP
252 ; RV32I-NEXT: lw tp, 12(sp)
253 ; RV32I-NEXT: addi sp, sp, 16
256 ; RV64I-LABEL: explicit_register_tp:
258 ; RV64I-NEXT: addi sp, sp, -16
259 ; RV64I-NEXT: sd tp, 8(sp)
260 ; RV64I-NEXT: mv tp, a0
262 ; RV64I-NEXT: addi a0, tp, 0
263 ; RV64I-NEXT: #NO_APP
264 ; RV64I-NEXT: ld tp, 8(sp)
265 ; RV64I-NEXT: addi sp, sp, 16
267 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{tp}"(i32 %a)
271 define i32 @explicit_register_x5(i32 %a) nounwind {
272 ; RV32I-LABEL: explicit_register_x5:
274 ; RV32I-NEXT: mv t0, a0
276 ; RV32I-NEXT: addi a0, t0, 0
277 ; RV32I-NEXT: #NO_APP
280 ; RV64I-LABEL: explicit_register_x5:
282 ; RV64I-NEXT: mv t0, a0
284 ; RV64I-NEXT: addi a0, t0, 0
285 ; RV64I-NEXT: #NO_APP
287 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x5}"(i32 %a)
291 define i32 @explicit_register_t0(i32 %a) nounwind {
292 ; RV32I-LABEL: explicit_register_t0:
294 ; RV32I-NEXT: mv t0, a0
296 ; RV32I-NEXT: addi a0, t0, 0
297 ; RV32I-NEXT: #NO_APP
300 ; RV64I-LABEL: explicit_register_t0:
302 ; RV64I-NEXT: mv t0, a0
304 ; RV64I-NEXT: addi a0, t0, 0
305 ; RV64I-NEXT: #NO_APP
307 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t0}"(i32 %a)
311 define i32 @explicit_register_x6(i32 %a) nounwind {
312 ; RV32I-LABEL: explicit_register_x6:
314 ; RV32I-NEXT: mv t1, a0
316 ; RV32I-NEXT: addi a0, t1, 0
317 ; RV32I-NEXT: #NO_APP
320 ; RV64I-LABEL: explicit_register_x6:
322 ; RV64I-NEXT: mv t1, a0
324 ; RV64I-NEXT: addi a0, t1, 0
325 ; RV64I-NEXT: #NO_APP
327 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x6}"(i32 %a)
331 define i32 @explicit_register_t1(i32 %a) nounwind {
332 ; RV32I-LABEL: explicit_register_t1:
334 ; RV32I-NEXT: mv t1, a0
336 ; RV32I-NEXT: addi a0, t1, 0
337 ; RV32I-NEXT: #NO_APP
340 ; RV64I-LABEL: explicit_register_t1:
342 ; RV64I-NEXT: mv t1, a0
344 ; RV64I-NEXT: addi a0, t1, 0
345 ; RV64I-NEXT: #NO_APP
347 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t1}"(i32 %a)
351 define i32 @explicit_register_x7(i32 %a) nounwind {
352 ; RV32I-LABEL: explicit_register_x7:
354 ; RV32I-NEXT: mv t2, a0
356 ; RV32I-NEXT: addi a0, t2, 0
357 ; RV32I-NEXT: #NO_APP
360 ; RV64I-LABEL: explicit_register_x7:
362 ; RV64I-NEXT: mv t2, a0
364 ; RV64I-NEXT: addi a0, t2, 0
365 ; RV64I-NEXT: #NO_APP
367 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x7}"(i32 %a)
371 define i32 @explicit_register_t2(i32 %a) nounwind {
372 ; RV32I-LABEL: explicit_register_t2:
374 ; RV32I-NEXT: mv t2, a0
376 ; RV32I-NEXT: addi a0, t2, 0
377 ; RV32I-NEXT: #NO_APP
380 ; RV64I-LABEL: explicit_register_t2:
382 ; RV64I-NEXT: mv t2, a0
384 ; RV64I-NEXT: addi a0, t2, 0
385 ; RV64I-NEXT: #NO_APP
387 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t2}"(i32 %a)
391 ; NOTE: This test uses `x8` (`s0`, `fp`) as an input, so it should be saved.
392 define i32 @explicit_register_x8(i32 %a) nounwind {
393 ; RV32I-LABEL: explicit_register_x8:
395 ; RV32I-NEXT: addi sp, sp, -16
396 ; RV32I-NEXT: sw s0, 12(sp)
397 ; RV32I-NEXT: mv s0, a0
399 ; RV32I-NEXT: addi a0, s0, 0
400 ; RV32I-NEXT: #NO_APP
401 ; RV32I-NEXT: lw s0, 12(sp)
402 ; RV32I-NEXT: addi sp, sp, 16
405 ; RV64I-LABEL: explicit_register_x8:
407 ; RV64I-NEXT: addi sp, sp, -16
408 ; RV64I-NEXT: sd s0, 8(sp)
409 ; RV64I-NEXT: mv s0, a0
411 ; RV64I-NEXT: addi a0, s0, 0
412 ; RV64I-NEXT: #NO_APP
413 ; RV64I-NEXT: ld s0, 8(sp)
414 ; RV64I-NEXT: addi sp, sp, 16
416 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x8}"(i32 %a)
420 ; NOTE: This test uses `s0` (`x8`, `fp`) as an input, so it should be saved.
421 define i32 @explicit_register_s0(i32 %a) nounwind {
422 ; RV32I-LABEL: explicit_register_s0:
424 ; RV32I-NEXT: addi sp, sp, -16
425 ; RV32I-NEXT: sw s0, 12(sp)
426 ; RV32I-NEXT: mv s0, a0
428 ; RV32I-NEXT: addi a0, s0, 0
429 ; RV32I-NEXT: #NO_APP
430 ; RV32I-NEXT: lw s0, 12(sp)
431 ; RV32I-NEXT: addi sp, sp, 16
434 ; RV64I-LABEL: explicit_register_s0:
436 ; RV64I-NEXT: addi sp, sp, -16
437 ; RV64I-NEXT: sd s0, 8(sp)
438 ; RV64I-NEXT: mv s0, a0
440 ; RV64I-NEXT: addi a0, s0, 0
441 ; RV64I-NEXT: #NO_APP
442 ; RV64I-NEXT: ld s0, 8(sp)
443 ; RV64I-NEXT: addi sp, sp, 16
445 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s0}"(i32 %a)
449 ; NOTE: This test uses `fp` (`x8`, `s0`) as an input, so it should be saved.
450 define i32 @explicit_register_fp(i32 %a) nounwind {
451 ; RV32I-LABEL: explicit_register_fp:
453 ; RV32I-NEXT: addi sp, sp, -16
454 ; RV32I-NEXT: sw s0, 12(sp)
455 ; RV32I-NEXT: mv s0, a0
457 ; RV32I-NEXT: addi a0, s0, 0
458 ; RV32I-NEXT: #NO_APP
459 ; RV32I-NEXT: lw s0, 12(sp)
460 ; RV32I-NEXT: addi sp, sp, 16
463 ; RV64I-LABEL: explicit_register_fp:
465 ; RV64I-NEXT: addi sp, sp, -16
466 ; RV64I-NEXT: sd s0, 8(sp)
467 ; RV64I-NEXT: mv s0, a0
469 ; RV64I-NEXT: addi a0, s0, 0
470 ; RV64I-NEXT: #NO_APP
471 ; RV64I-NEXT: ld s0, 8(sp)
472 ; RV64I-NEXT: addi sp, sp, 16
474 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{fp}"(i32 %a)
478 ; NOTE: This test uses `x9` (`s1`) as an input, so it should be saved.
479 define i32 @explicit_register_x9(i32 %a) nounwind {
480 ; RV32I-LABEL: explicit_register_x9:
482 ; RV32I-NEXT: addi sp, sp, -16
483 ; RV32I-NEXT: sw s1, 12(sp)
484 ; RV32I-NEXT: mv s1, a0
486 ; RV32I-NEXT: addi a0, s1, 0
487 ; RV32I-NEXT: #NO_APP
488 ; RV32I-NEXT: lw s1, 12(sp)
489 ; RV32I-NEXT: addi sp, sp, 16
492 ; RV64I-LABEL: explicit_register_x9:
494 ; RV64I-NEXT: addi sp, sp, -16
495 ; RV64I-NEXT: sd s1, 8(sp)
496 ; RV64I-NEXT: mv s1, a0
498 ; RV64I-NEXT: addi a0, s1, 0
499 ; RV64I-NEXT: #NO_APP
500 ; RV64I-NEXT: ld s1, 8(sp)
501 ; RV64I-NEXT: addi sp, sp, 16
503 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x9}"(i32 %a)
507 ; NOTE: This test uses `s1` (`x9`) as an input, so it should be saved.
508 define i32 @explicit_register_s1(i32 %a) nounwind {
509 ; RV32I-LABEL: explicit_register_s1:
511 ; RV32I-NEXT: addi sp, sp, -16
512 ; RV32I-NEXT: sw s1, 12(sp)
513 ; RV32I-NEXT: mv s1, a0
515 ; RV32I-NEXT: addi a0, s1, 0
516 ; RV32I-NEXT: #NO_APP
517 ; RV32I-NEXT: lw s1, 12(sp)
518 ; RV32I-NEXT: addi sp, sp, 16
521 ; RV64I-LABEL: explicit_register_s1:
523 ; RV64I-NEXT: addi sp, sp, -16
524 ; RV64I-NEXT: sd s1, 8(sp)
525 ; RV64I-NEXT: mv s1, a0
527 ; RV64I-NEXT: addi a0, s1, 0
528 ; RV64I-NEXT: #NO_APP
529 ; RV64I-NEXT: ld s1, 8(sp)
530 ; RV64I-NEXT: addi sp, sp, 16
532 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s1}"(i32 %a)
536 define i32 @explicit_register_x10(i32 %a) nounwind {
537 ; RV32I-LABEL: explicit_register_x10:
540 ; RV32I-NEXT: addi a0, a0, 0
541 ; RV32I-NEXT: #NO_APP
544 ; RV64I-LABEL: explicit_register_x10:
547 ; RV64I-NEXT: addi a0, a0, 0
548 ; RV64I-NEXT: #NO_APP
550 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x10}"(i32 %a)
554 define i32 @explicit_register_a0(i32 %a) nounwind {
555 ; RV32I-LABEL: explicit_register_a0:
558 ; RV32I-NEXT: addi a0, a0, 0
559 ; RV32I-NEXT: #NO_APP
562 ; RV64I-LABEL: explicit_register_a0:
565 ; RV64I-NEXT: addi a0, a0, 0
566 ; RV64I-NEXT: #NO_APP
568 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a0}"(i32 %a)
572 define i32 @explicit_register_x11(i32 %a) nounwind {
573 ; RV32I-LABEL: explicit_register_x11:
575 ; RV32I-NEXT: mv a1, a0
577 ; RV32I-NEXT: addi a0, a1, 0
578 ; RV32I-NEXT: #NO_APP
581 ; RV64I-LABEL: explicit_register_x11:
583 ; RV64I-NEXT: mv a1, a0
585 ; RV64I-NEXT: addi a0, a1, 0
586 ; RV64I-NEXT: #NO_APP
588 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x11}"(i32 %a)
592 define i32 @explicit_register_a1(i32 %a) nounwind {
593 ; RV32I-LABEL: explicit_register_a1:
595 ; RV32I-NEXT: mv a1, a0
597 ; RV32I-NEXT: addi a0, a1, 0
598 ; RV32I-NEXT: #NO_APP
601 ; RV64I-LABEL: explicit_register_a1:
603 ; RV64I-NEXT: mv a1, a0
605 ; RV64I-NEXT: addi a0, a1, 0
606 ; RV64I-NEXT: #NO_APP
608 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a1}"(i32 %a)
612 define i32 @explicit_register_x12(i32 %a) nounwind {
613 ; RV32I-LABEL: explicit_register_x12:
615 ; RV32I-NEXT: mv a2, a0
617 ; RV32I-NEXT: addi a0, a2, 0
618 ; RV32I-NEXT: #NO_APP
621 ; RV64I-LABEL: explicit_register_x12:
623 ; RV64I-NEXT: mv a2, a0
625 ; RV64I-NEXT: addi a0, a2, 0
626 ; RV64I-NEXT: #NO_APP
628 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x12}"(i32 %a)
632 define i32 @explicit_register_a2(i32 %a) nounwind {
633 ; RV32I-LABEL: explicit_register_a2:
635 ; RV32I-NEXT: mv a2, a0
637 ; RV32I-NEXT: addi a0, a2, 0
638 ; RV32I-NEXT: #NO_APP
641 ; RV64I-LABEL: explicit_register_a2:
643 ; RV64I-NEXT: mv a2, a0
645 ; RV64I-NEXT: addi a0, a2, 0
646 ; RV64I-NEXT: #NO_APP
648 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a2}"(i32 %a)
652 define i32 @explicit_register_x13(i32 %a) nounwind {
653 ; RV32I-LABEL: explicit_register_x13:
655 ; RV32I-NEXT: mv a3, a0
657 ; RV32I-NEXT: addi a0, a3, 0
658 ; RV32I-NEXT: #NO_APP
661 ; RV64I-LABEL: explicit_register_x13:
663 ; RV64I-NEXT: mv a3, a0
665 ; RV64I-NEXT: addi a0, a3, 0
666 ; RV64I-NEXT: #NO_APP
668 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x13}"(i32 %a)
672 define i32 @explicit_register_a3(i32 %a) nounwind {
673 ; RV32I-LABEL: explicit_register_a3:
675 ; RV32I-NEXT: mv a3, a0
677 ; RV32I-NEXT: addi a0, a3, 0
678 ; RV32I-NEXT: #NO_APP
681 ; RV64I-LABEL: explicit_register_a3:
683 ; RV64I-NEXT: mv a3, a0
685 ; RV64I-NEXT: addi a0, a3, 0
686 ; RV64I-NEXT: #NO_APP
688 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a3}"(i32 %a)
692 define i32 @explicit_register_x14(i32 %a) nounwind {
693 ; RV32I-LABEL: explicit_register_x14:
695 ; RV32I-NEXT: mv a4, a0
697 ; RV32I-NEXT: addi a0, a4, 0
698 ; RV32I-NEXT: #NO_APP
701 ; RV64I-LABEL: explicit_register_x14:
703 ; RV64I-NEXT: mv a4, a0
705 ; RV64I-NEXT: addi a0, a4, 0
706 ; RV64I-NEXT: #NO_APP
708 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x14}"(i32 %a)
712 define i32 @explicit_register_a4(i32 %a) nounwind {
713 ; RV32I-LABEL: explicit_register_a4:
715 ; RV32I-NEXT: mv a4, a0
717 ; RV32I-NEXT: addi a0, a4, 0
718 ; RV32I-NEXT: #NO_APP
721 ; RV64I-LABEL: explicit_register_a4:
723 ; RV64I-NEXT: mv a4, a0
725 ; RV64I-NEXT: addi a0, a4, 0
726 ; RV64I-NEXT: #NO_APP
728 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a4}"(i32 %a)
732 define i32 @explicit_register_x15(i32 %a) nounwind {
733 ; RV32I-LABEL: explicit_register_x15:
735 ; RV32I-NEXT: mv a5, a0
737 ; RV32I-NEXT: addi a0, a5, 0
738 ; RV32I-NEXT: #NO_APP
741 ; RV64I-LABEL: explicit_register_x15:
743 ; RV64I-NEXT: mv a5, a0
745 ; RV64I-NEXT: addi a0, a5, 0
746 ; RV64I-NEXT: #NO_APP
748 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x15}"(i32 %a)
752 define i32 @explicit_register_a5(i32 %a) nounwind {
753 ; RV32I-LABEL: explicit_register_a5:
755 ; RV32I-NEXT: mv a5, a0
757 ; RV32I-NEXT: addi a0, a5, 0
758 ; RV32I-NEXT: #NO_APP
761 ; RV64I-LABEL: explicit_register_a5:
763 ; RV64I-NEXT: mv a5, a0
765 ; RV64I-NEXT: addi a0, a5, 0
766 ; RV64I-NEXT: #NO_APP
768 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a5}"(i32 %a)
772 define i32 @explicit_register_x16(i32 %a) nounwind {
773 ; RV32I-LABEL: explicit_register_x16:
775 ; RV32I-NEXT: mv a6, a0
777 ; RV32I-NEXT: addi a0, a6, 0
778 ; RV32I-NEXT: #NO_APP
781 ; RV64I-LABEL: explicit_register_x16:
783 ; RV64I-NEXT: mv a6, a0
785 ; RV64I-NEXT: addi a0, a6, 0
786 ; RV64I-NEXT: #NO_APP
788 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x16}"(i32 %a)
792 define i32 @explicit_register_a6(i32 %a) nounwind {
793 ; RV32I-LABEL: explicit_register_a6:
795 ; RV32I-NEXT: mv a6, a0
797 ; RV32I-NEXT: addi a0, a6, 0
798 ; RV32I-NEXT: #NO_APP
801 ; RV64I-LABEL: explicit_register_a6:
803 ; RV64I-NEXT: mv a6, a0
805 ; RV64I-NEXT: addi a0, a6, 0
806 ; RV64I-NEXT: #NO_APP
808 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a6}"(i32 %a)
812 define i32 @explicit_register_x17(i32 %a) nounwind {
813 ; RV32I-LABEL: explicit_register_x17:
815 ; RV32I-NEXT: mv a7, a0
817 ; RV32I-NEXT: addi a0, a7, 0
818 ; RV32I-NEXT: #NO_APP
821 ; RV64I-LABEL: explicit_register_x17:
823 ; RV64I-NEXT: mv a7, a0
825 ; RV64I-NEXT: addi a0, a7, 0
826 ; RV64I-NEXT: #NO_APP
828 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x17}"(i32 %a)
832 define i32 @explicit_register_a7(i32 %a) nounwind {
833 ; RV32I-LABEL: explicit_register_a7:
835 ; RV32I-NEXT: mv a7, a0
837 ; RV32I-NEXT: addi a0, a7, 0
838 ; RV32I-NEXT: #NO_APP
841 ; RV64I-LABEL: explicit_register_a7:
843 ; RV64I-NEXT: mv a7, a0
845 ; RV64I-NEXT: addi a0, a7, 0
846 ; RV64I-NEXT: #NO_APP
848 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a7}"(i32 %a)
852 ; NOTE: This test uses `x18` (`s2`) as an input, so it should be saved.
853 define i32 @explicit_register_x18(i32 %a) nounwind {
854 ; RV32I-LABEL: explicit_register_x18:
856 ; RV32I-NEXT: addi sp, sp, -16
857 ; RV32I-NEXT: sw s2, 12(sp)
858 ; RV32I-NEXT: mv s2, a0
860 ; RV32I-NEXT: addi a0, s2, 0
861 ; RV32I-NEXT: #NO_APP
862 ; RV32I-NEXT: lw s2, 12(sp)
863 ; RV32I-NEXT: addi sp, sp, 16
866 ; RV64I-LABEL: explicit_register_x18:
868 ; RV64I-NEXT: addi sp, sp, -16
869 ; RV64I-NEXT: sd s2, 8(sp)
870 ; RV64I-NEXT: mv s2, a0
872 ; RV64I-NEXT: addi a0, s2, 0
873 ; RV64I-NEXT: #NO_APP
874 ; RV64I-NEXT: ld s2, 8(sp)
875 ; RV64I-NEXT: addi sp, sp, 16
877 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x18}"(i32 %a)
881 ; NOTE: This test uses `s2` (`x18`) as an input, so it should be saved.
882 define i32 @explicit_register_s2(i32 %a) nounwind {
883 ; RV32I-LABEL: explicit_register_s2:
885 ; RV32I-NEXT: addi sp, sp, -16
886 ; RV32I-NEXT: sw s2, 12(sp)
887 ; RV32I-NEXT: mv s2, a0
889 ; RV32I-NEXT: addi a0, s2, 0
890 ; RV32I-NEXT: #NO_APP
891 ; RV32I-NEXT: lw s2, 12(sp)
892 ; RV32I-NEXT: addi sp, sp, 16
895 ; RV64I-LABEL: explicit_register_s2:
897 ; RV64I-NEXT: addi sp, sp, -16
898 ; RV64I-NEXT: sd s2, 8(sp)
899 ; RV64I-NEXT: mv s2, a0
901 ; RV64I-NEXT: addi a0, s2, 0
902 ; RV64I-NEXT: #NO_APP
903 ; RV64I-NEXT: ld s2, 8(sp)
904 ; RV64I-NEXT: addi sp, sp, 16
906 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s2}"(i32 %a)
910 ; NOTE: This test uses `x19` (`s3`) as an input, so it should be saved.
911 define i32 @explicit_register_x19(i32 %a) nounwind {
912 ; RV32I-LABEL: explicit_register_x19:
914 ; RV32I-NEXT: addi sp, sp, -16
915 ; RV32I-NEXT: sw s3, 12(sp)
916 ; RV32I-NEXT: mv s3, a0
918 ; RV32I-NEXT: addi a0, s3, 0
919 ; RV32I-NEXT: #NO_APP
920 ; RV32I-NEXT: lw s3, 12(sp)
921 ; RV32I-NEXT: addi sp, sp, 16
924 ; RV64I-LABEL: explicit_register_x19:
926 ; RV64I-NEXT: addi sp, sp, -16
927 ; RV64I-NEXT: sd s3, 8(sp)
928 ; RV64I-NEXT: mv s3, a0
930 ; RV64I-NEXT: addi a0, s3, 0
931 ; RV64I-NEXT: #NO_APP
932 ; RV64I-NEXT: ld s3, 8(sp)
933 ; RV64I-NEXT: addi sp, sp, 16
935 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x19}"(i32 %a)
939 ; NOTE: This test uses `s3` (`x19`) as an input, so it should be saved.
940 define i32 @explicit_register_s3(i32 %a) nounwind {
941 ; RV32I-LABEL: explicit_register_s3:
943 ; RV32I-NEXT: addi sp, sp, -16
944 ; RV32I-NEXT: sw s3, 12(sp)
945 ; RV32I-NEXT: mv s3, a0
947 ; RV32I-NEXT: addi a0, s3, 0
948 ; RV32I-NEXT: #NO_APP
949 ; RV32I-NEXT: lw s3, 12(sp)
950 ; RV32I-NEXT: addi sp, sp, 16
953 ; RV64I-LABEL: explicit_register_s3:
955 ; RV64I-NEXT: addi sp, sp, -16
956 ; RV64I-NEXT: sd s3, 8(sp)
957 ; RV64I-NEXT: mv s3, a0
959 ; RV64I-NEXT: addi a0, s3, 0
960 ; RV64I-NEXT: #NO_APP
961 ; RV64I-NEXT: ld s3, 8(sp)
962 ; RV64I-NEXT: addi sp, sp, 16
964 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s3}"(i32 %a)
968 ; NOTE: This test uses `x20` (`s4`) as an input, so it should be saved.
969 define i32 @explicit_register_x20(i32 %a) nounwind {
970 ; RV32I-LABEL: explicit_register_x20:
972 ; RV32I-NEXT: addi sp, sp, -16
973 ; RV32I-NEXT: sw s4, 12(sp)
974 ; RV32I-NEXT: mv s4, a0
976 ; RV32I-NEXT: addi a0, s4, 0
977 ; RV32I-NEXT: #NO_APP
978 ; RV32I-NEXT: lw s4, 12(sp)
979 ; RV32I-NEXT: addi sp, sp, 16
982 ; RV64I-LABEL: explicit_register_x20:
984 ; RV64I-NEXT: addi sp, sp, -16
985 ; RV64I-NEXT: sd s4, 8(sp)
986 ; RV64I-NEXT: mv s4, a0
988 ; RV64I-NEXT: addi a0, s4, 0
989 ; RV64I-NEXT: #NO_APP
990 ; RV64I-NEXT: ld s4, 8(sp)
991 ; RV64I-NEXT: addi sp, sp, 16
993 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x20}"(i32 %a)
997 ; NOTE: This test uses `s4` (`x20`) as an input, so it should be saved.
998 define i32 @explicit_register_s4(i32 %a) nounwind {
999 ; RV32I-LABEL: explicit_register_s4:
1001 ; RV32I-NEXT: addi sp, sp, -16
1002 ; RV32I-NEXT: sw s4, 12(sp)
1003 ; RV32I-NEXT: mv s4, a0
1005 ; RV32I-NEXT: addi a0, s4, 0
1006 ; RV32I-NEXT: #NO_APP
1007 ; RV32I-NEXT: lw s4, 12(sp)
1008 ; RV32I-NEXT: addi sp, sp, 16
1011 ; RV64I-LABEL: explicit_register_s4:
1013 ; RV64I-NEXT: addi sp, sp, -16
1014 ; RV64I-NEXT: sd s4, 8(sp)
1015 ; RV64I-NEXT: mv s4, a0
1017 ; RV64I-NEXT: addi a0, s4, 0
1018 ; RV64I-NEXT: #NO_APP
1019 ; RV64I-NEXT: ld s4, 8(sp)
1020 ; RV64I-NEXT: addi sp, sp, 16
1022 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s4}"(i32 %a)
1026 ; NOTE: This test uses `x21` (`s5`) as an input, so it should be saved.
1027 define i32 @explicit_register_x21(i32 %a) nounwind {
1028 ; RV32I-LABEL: explicit_register_x21:
1030 ; RV32I-NEXT: addi sp, sp, -16
1031 ; RV32I-NEXT: sw s5, 12(sp)
1032 ; RV32I-NEXT: mv s5, a0
1034 ; RV32I-NEXT: addi a0, s5, 0
1035 ; RV32I-NEXT: #NO_APP
1036 ; RV32I-NEXT: lw s5, 12(sp)
1037 ; RV32I-NEXT: addi sp, sp, 16
1040 ; RV64I-LABEL: explicit_register_x21:
1042 ; RV64I-NEXT: addi sp, sp, -16
1043 ; RV64I-NEXT: sd s5, 8(sp)
1044 ; RV64I-NEXT: mv s5, a0
1046 ; RV64I-NEXT: addi a0, s5, 0
1047 ; RV64I-NEXT: #NO_APP
1048 ; RV64I-NEXT: ld s5, 8(sp)
1049 ; RV64I-NEXT: addi sp, sp, 16
1051 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x21}"(i32 %a)
1055 ; NOTE: This test uses `s5` (`x21`) as an input, so it should be saved.
1056 define i32 @explicit_register_s5(i32 %a) nounwind {
1057 ; RV32I-LABEL: explicit_register_s5:
1059 ; RV32I-NEXT: addi sp, sp, -16
1060 ; RV32I-NEXT: sw s5, 12(sp)
1061 ; RV32I-NEXT: mv s5, a0
1063 ; RV32I-NEXT: addi a0, s5, 0
1064 ; RV32I-NEXT: #NO_APP
1065 ; RV32I-NEXT: lw s5, 12(sp)
1066 ; RV32I-NEXT: addi sp, sp, 16
1069 ; RV64I-LABEL: explicit_register_s5:
1071 ; RV64I-NEXT: addi sp, sp, -16
1072 ; RV64I-NEXT: sd s5, 8(sp)
1073 ; RV64I-NEXT: mv s5, a0
1075 ; RV64I-NEXT: addi a0, s5, 0
1076 ; RV64I-NEXT: #NO_APP
1077 ; RV64I-NEXT: ld s5, 8(sp)
1078 ; RV64I-NEXT: addi sp, sp, 16
1080 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s5}"(i32 %a)
1084 ; NOTE: This test uses `x22` (`s6`) as an input, so it should be saved.
1085 define i32 @explicit_register_x22(i32 %a) nounwind {
1086 ; RV32I-LABEL: explicit_register_x22:
1088 ; RV32I-NEXT: addi sp, sp, -16
1089 ; RV32I-NEXT: sw s6, 12(sp)
1090 ; RV32I-NEXT: mv s6, a0
1092 ; RV32I-NEXT: addi a0, s6, 0
1093 ; RV32I-NEXT: #NO_APP
1094 ; RV32I-NEXT: lw s6, 12(sp)
1095 ; RV32I-NEXT: addi sp, sp, 16
1098 ; RV64I-LABEL: explicit_register_x22:
1100 ; RV64I-NEXT: addi sp, sp, -16
1101 ; RV64I-NEXT: sd s6, 8(sp)
1102 ; RV64I-NEXT: mv s6, a0
1104 ; RV64I-NEXT: addi a0, s6, 0
1105 ; RV64I-NEXT: #NO_APP
1106 ; RV64I-NEXT: ld s6, 8(sp)
1107 ; RV64I-NEXT: addi sp, sp, 16
1109 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x22}"(i32 %a)
1113 ; NOTE: This test uses `s6` (`x22`) as an input, so it should be saved.
1114 define i32 @explicit_register_s6(i32 %a) nounwind {
1115 ; RV32I-LABEL: explicit_register_s6:
1117 ; RV32I-NEXT: addi sp, sp, -16
1118 ; RV32I-NEXT: sw s6, 12(sp)
1119 ; RV32I-NEXT: mv s6, a0
1121 ; RV32I-NEXT: addi a0, s6, 0
1122 ; RV32I-NEXT: #NO_APP
1123 ; RV32I-NEXT: lw s6, 12(sp)
1124 ; RV32I-NEXT: addi sp, sp, 16
1127 ; RV64I-LABEL: explicit_register_s6:
1129 ; RV64I-NEXT: addi sp, sp, -16
1130 ; RV64I-NEXT: sd s6, 8(sp)
1131 ; RV64I-NEXT: mv s6, a0
1133 ; RV64I-NEXT: addi a0, s6, 0
1134 ; RV64I-NEXT: #NO_APP
1135 ; RV64I-NEXT: ld s6, 8(sp)
1136 ; RV64I-NEXT: addi sp, sp, 16
1138 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s6}"(i32 %a)
1142 ; NOTE: This test uses `x23` (`s7`) as an input, so it should be saved.
1143 define i32 @explicit_register_x23(i32 %a) nounwind {
1144 ; RV32I-LABEL: explicit_register_x23:
1146 ; RV32I-NEXT: addi sp, sp, -16
1147 ; RV32I-NEXT: sw s7, 12(sp)
1148 ; RV32I-NEXT: mv s7, a0
1150 ; RV32I-NEXT: addi a0, s7, 0
1151 ; RV32I-NEXT: #NO_APP
1152 ; RV32I-NEXT: lw s7, 12(sp)
1153 ; RV32I-NEXT: addi sp, sp, 16
1156 ; RV64I-LABEL: explicit_register_x23:
1158 ; RV64I-NEXT: addi sp, sp, -16
1159 ; RV64I-NEXT: sd s7, 8(sp)
1160 ; RV64I-NEXT: mv s7, a0
1162 ; RV64I-NEXT: addi a0, s7, 0
1163 ; RV64I-NEXT: #NO_APP
1164 ; RV64I-NEXT: ld s7, 8(sp)
1165 ; RV64I-NEXT: addi sp, sp, 16
1167 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x23}"(i32 %a)
1171 ; NOTE: This test uses `s7` (`x23`) as an input, so it should be saved.
1172 define i32 @explicit_register_s7(i32 %a) nounwind {
1173 ; RV32I-LABEL: explicit_register_s7:
1175 ; RV32I-NEXT: addi sp, sp, -16
1176 ; RV32I-NEXT: sw s7, 12(sp)
1177 ; RV32I-NEXT: mv s7, a0
1179 ; RV32I-NEXT: addi a0, s7, 0
1180 ; RV32I-NEXT: #NO_APP
1181 ; RV32I-NEXT: lw s7, 12(sp)
1182 ; RV32I-NEXT: addi sp, sp, 16
1185 ; RV64I-LABEL: explicit_register_s7:
1187 ; RV64I-NEXT: addi sp, sp, -16
1188 ; RV64I-NEXT: sd s7, 8(sp)
1189 ; RV64I-NEXT: mv s7, a0
1191 ; RV64I-NEXT: addi a0, s7, 0
1192 ; RV64I-NEXT: #NO_APP
1193 ; RV64I-NEXT: ld s7, 8(sp)
1194 ; RV64I-NEXT: addi sp, sp, 16
1196 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s7}"(i32 %a)
1200 ; NOTE: This test uses `x24` (`s8`) as an input, so it should be saved.
1201 define i32 @explicit_register_x24(i32 %a) nounwind {
1202 ; RV32I-LABEL: explicit_register_x24:
1204 ; RV32I-NEXT: addi sp, sp, -16
1205 ; RV32I-NEXT: sw s8, 12(sp)
1206 ; RV32I-NEXT: mv s8, a0
1208 ; RV32I-NEXT: addi a0, s8, 0
1209 ; RV32I-NEXT: #NO_APP
1210 ; RV32I-NEXT: lw s8, 12(sp)
1211 ; RV32I-NEXT: addi sp, sp, 16
1214 ; RV64I-LABEL: explicit_register_x24:
1216 ; RV64I-NEXT: addi sp, sp, -16
1217 ; RV64I-NEXT: sd s8, 8(sp)
1218 ; RV64I-NEXT: mv s8, a0
1220 ; RV64I-NEXT: addi a0, s8, 0
1221 ; RV64I-NEXT: #NO_APP
1222 ; RV64I-NEXT: ld s8, 8(sp)
1223 ; RV64I-NEXT: addi sp, sp, 16
1225 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x24}"(i32 %a)
1229 ; NOTE: This test uses `s8` (`x24`) as an input, so it should be saved.
1230 define i32 @explicit_register_s8(i32 %a) nounwind {
1231 ; RV32I-LABEL: explicit_register_s8:
1233 ; RV32I-NEXT: addi sp, sp, -16
1234 ; RV32I-NEXT: sw s8, 12(sp)
1235 ; RV32I-NEXT: mv s8, a0
1237 ; RV32I-NEXT: addi a0, s8, 0
1238 ; RV32I-NEXT: #NO_APP
1239 ; RV32I-NEXT: lw s8, 12(sp)
1240 ; RV32I-NEXT: addi sp, sp, 16
1243 ; RV64I-LABEL: explicit_register_s8:
1245 ; RV64I-NEXT: addi sp, sp, -16
1246 ; RV64I-NEXT: sd s8, 8(sp)
1247 ; RV64I-NEXT: mv s8, a0
1249 ; RV64I-NEXT: addi a0, s8, 0
1250 ; RV64I-NEXT: #NO_APP
1251 ; RV64I-NEXT: ld s8, 8(sp)
1252 ; RV64I-NEXT: addi sp, sp, 16
1254 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s8}"(i32 %a)
1258 ; NOTE: This test uses `x25` (`s9`) as an input, so it should be saved.
1259 define i32 @explicit_register_x25(i32 %a) nounwind {
1260 ; RV32I-LABEL: explicit_register_x25:
1262 ; RV32I-NEXT: addi sp, sp, -16
1263 ; RV32I-NEXT: sw s9, 12(sp)
1264 ; RV32I-NEXT: mv s9, a0
1266 ; RV32I-NEXT: addi a0, s9, 0
1267 ; RV32I-NEXT: #NO_APP
1268 ; RV32I-NEXT: lw s9, 12(sp)
1269 ; RV32I-NEXT: addi sp, sp, 16
1272 ; RV64I-LABEL: explicit_register_x25:
1274 ; RV64I-NEXT: addi sp, sp, -16
1275 ; RV64I-NEXT: sd s9, 8(sp)
1276 ; RV64I-NEXT: mv s9, a0
1278 ; RV64I-NEXT: addi a0, s9, 0
1279 ; RV64I-NEXT: #NO_APP
1280 ; RV64I-NEXT: ld s9, 8(sp)
1281 ; RV64I-NEXT: addi sp, sp, 16
1283 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x25}"(i32 %a)
1287 ; NOTE: This test uses `s9` (`x25`) as an input, so it should be saved.
1288 define i32 @explicit_register_s9(i32 %a) nounwind {
1289 ; RV32I-LABEL: explicit_register_s9:
1291 ; RV32I-NEXT: addi sp, sp, -16
1292 ; RV32I-NEXT: sw s9, 12(sp)
1293 ; RV32I-NEXT: mv s9, a0
1295 ; RV32I-NEXT: addi a0, s9, 0
1296 ; RV32I-NEXT: #NO_APP
1297 ; RV32I-NEXT: lw s9, 12(sp)
1298 ; RV32I-NEXT: addi sp, sp, 16
1301 ; RV64I-LABEL: explicit_register_s9:
1303 ; RV64I-NEXT: addi sp, sp, -16
1304 ; RV64I-NEXT: sd s9, 8(sp)
1305 ; RV64I-NEXT: mv s9, a0
1307 ; RV64I-NEXT: addi a0, s9, 0
1308 ; RV64I-NEXT: #NO_APP
1309 ; RV64I-NEXT: ld s9, 8(sp)
1310 ; RV64I-NEXT: addi sp, sp, 16
1312 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s9}"(i32 %a)
1316 ; NOTE: This test uses `x26` (`s10`) as an input, so it should be saved.
1317 define i32 @explicit_register_x26(i32 %a) nounwind {
1318 ; RV32I-LABEL: explicit_register_x26:
1320 ; RV32I-NEXT: addi sp, sp, -16
1321 ; RV32I-NEXT: sw s10, 12(sp)
1322 ; RV32I-NEXT: mv s10, a0
1324 ; RV32I-NEXT: addi a0, s10, 0
1325 ; RV32I-NEXT: #NO_APP
1326 ; RV32I-NEXT: lw s10, 12(sp)
1327 ; RV32I-NEXT: addi sp, sp, 16
1330 ; RV64I-LABEL: explicit_register_x26:
1332 ; RV64I-NEXT: addi sp, sp, -16
1333 ; RV64I-NEXT: sd s10, 8(sp)
1334 ; RV64I-NEXT: mv s10, a0
1336 ; RV64I-NEXT: addi a0, s10, 0
1337 ; RV64I-NEXT: #NO_APP
1338 ; RV64I-NEXT: ld s10, 8(sp)
1339 ; RV64I-NEXT: addi sp, sp, 16
1341 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x26}"(i32 %a)
1345 ; NOTE: This test uses `s10` (`x28`) as an input, so it should be saved.
1346 define i32 @explicit_register_s10(i32 %a) nounwind {
1347 ; RV32I-LABEL: explicit_register_s10:
1349 ; RV32I-NEXT: addi sp, sp, -16
1350 ; RV32I-NEXT: sw s10, 12(sp)
1351 ; RV32I-NEXT: mv s10, a0
1353 ; RV32I-NEXT: addi a0, s10, 0
1354 ; RV32I-NEXT: #NO_APP
1355 ; RV32I-NEXT: lw s10, 12(sp)
1356 ; RV32I-NEXT: addi sp, sp, 16
1359 ; RV64I-LABEL: explicit_register_s10:
1361 ; RV64I-NEXT: addi sp, sp, -16
1362 ; RV64I-NEXT: sd s10, 8(sp)
1363 ; RV64I-NEXT: mv s10, a0
1365 ; RV64I-NEXT: addi a0, s10, 0
1366 ; RV64I-NEXT: #NO_APP
1367 ; RV64I-NEXT: ld s10, 8(sp)
1368 ; RV64I-NEXT: addi sp, sp, 16
1370 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s10}"(i32 %a)
1374 ; NOTE: This test uses `x27` (`s11`) as an input, so it should be saved.
1375 define i32 @explicit_register_x27(i32 %a) nounwind {
1376 ; RV32I-LABEL: explicit_register_x27:
1378 ; RV32I-NEXT: addi sp, sp, -16
1379 ; RV32I-NEXT: sw s11, 12(sp)
1380 ; RV32I-NEXT: mv s11, a0
1382 ; RV32I-NEXT: addi a0, s11, 0
1383 ; RV32I-NEXT: #NO_APP
1384 ; RV32I-NEXT: lw s11, 12(sp)
1385 ; RV32I-NEXT: addi sp, sp, 16
1388 ; RV64I-LABEL: explicit_register_x27:
1390 ; RV64I-NEXT: addi sp, sp, -16
1391 ; RV64I-NEXT: sd s11, 8(sp)
1392 ; RV64I-NEXT: mv s11, a0
1394 ; RV64I-NEXT: addi a0, s11, 0
1395 ; RV64I-NEXT: #NO_APP
1396 ; RV64I-NEXT: ld s11, 8(sp)
1397 ; RV64I-NEXT: addi sp, sp, 16
1399 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x27}"(i32 %a)
1403 ; NOTE: This test uses `s11` (`x27`) as an input, so it should be saved.
1404 define i32 @explicit_register_s11(i32 %a) nounwind {
1405 ; RV32I-LABEL: explicit_register_s11:
1407 ; RV32I-NEXT: addi sp, sp, -16
1408 ; RV32I-NEXT: sw s11, 12(sp)
1409 ; RV32I-NEXT: mv s11, a0
1411 ; RV32I-NEXT: addi a0, s11, 0
1412 ; RV32I-NEXT: #NO_APP
1413 ; RV32I-NEXT: lw s11, 12(sp)
1414 ; RV32I-NEXT: addi sp, sp, 16
1417 ; RV64I-LABEL: explicit_register_s11:
1419 ; RV64I-NEXT: addi sp, sp, -16
1420 ; RV64I-NEXT: sd s11, 8(sp)
1421 ; RV64I-NEXT: mv s11, a0
1423 ; RV64I-NEXT: addi a0, s11, 0
1424 ; RV64I-NEXT: #NO_APP
1425 ; RV64I-NEXT: ld s11, 8(sp)
1426 ; RV64I-NEXT: addi sp, sp, 16
1428 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s11}"(i32 %a)
1432 define i32 @explicit_register_x28(i32 %a) nounwind {
1433 ; RV32I-LABEL: explicit_register_x28:
1435 ; RV32I-NEXT: mv t3, a0
1437 ; RV32I-NEXT: addi a0, t3, 0
1438 ; RV32I-NEXT: #NO_APP
1441 ; RV64I-LABEL: explicit_register_x28:
1443 ; RV64I-NEXT: mv t3, a0
1445 ; RV64I-NEXT: addi a0, t3, 0
1446 ; RV64I-NEXT: #NO_APP
1448 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x28}"(i32 %a)
1452 define i32 @explicit_register_t3(i32 %a) nounwind {
1453 ; RV32I-LABEL: explicit_register_t3:
1455 ; RV32I-NEXT: mv t3, a0
1457 ; RV32I-NEXT: addi a0, t3, 0
1458 ; RV32I-NEXT: #NO_APP
1461 ; RV64I-LABEL: explicit_register_t3:
1463 ; RV64I-NEXT: mv t3, a0
1465 ; RV64I-NEXT: addi a0, t3, 0
1466 ; RV64I-NEXT: #NO_APP
1468 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t3}"(i32 %a)
1472 define i32 @explicit_register_x29(i32 %a) nounwind {
1473 ; RV32I-LABEL: explicit_register_x29:
1475 ; RV32I-NEXT: mv t4, a0
1477 ; RV32I-NEXT: addi a0, t4, 0
1478 ; RV32I-NEXT: #NO_APP
1481 ; RV64I-LABEL: explicit_register_x29:
1483 ; RV64I-NEXT: mv t4, a0
1485 ; RV64I-NEXT: addi a0, t4, 0
1486 ; RV64I-NEXT: #NO_APP
1488 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x29}"(i32 %a)
1492 define i32 @explicit_register_t4(i32 %a) nounwind {
1493 ; RV32I-LABEL: explicit_register_t4:
1495 ; RV32I-NEXT: mv t4, a0
1497 ; RV32I-NEXT: addi a0, t4, 0
1498 ; RV32I-NEXT: #NO_APP
1501 ; RV64I-LABEL: explicit_register_t4:
1503 ; RV64I-NEXT: mv t4, a0
1505 ; RV64I-NEXT: addi a0, t4, 0
1506 ; RV64I-NEXT: #NO_APP
1508 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t4}"(i32 %a)
1512 define i32 @explicit_register_x30(i32 %a) nounwind {
1513 ; RV32I-LABEL: explicit_register_x30:
1515 ; RV32I-NEXT: mv t5, a0
1517 ; RV32I-NEXT: addi a0, t5, 0
1518 ; RV32I-NEXT: #NO_APP
1521 ; RV64I-LABEL: explicit_register_x30:
1523 ; RV64I-NEXT: mv t5, a0
1525 ; RV64I-NEXT: addi a0, t5, 0
1526 ; RV64I-NEXT: #NO_APP
1528 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x30}"(i32 %a)
1532 define i32 @explicit_register_t5(i32 %a) nounwind {
1533 ; RV32I-LABEL: explicit_register_t5:
1535 ; RV32I-NEXT: mv t5, a0
1537 ; RV32I-NEXT: addi a0, t5, 0
1538 ; RV32I-NEXT: #NO_APP
1541 ; RV64I-LABEL: explicit_register_t5:
1543 ; RV64I-NEXT: mv t5, a0
1545 ; RV64I-NEXT: addi a0, t5, 0
1546 ; RV64I-NEXT: #NO_APP
1548 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t5}"(i32 %a)
1552 define i32 @explicit_register_x31(i32 %a) nounwind {
1553 ; RV32I-LABEL: explicit_register_x31:
1555 ; RV32I-NEXT: mv t6, a0
1557 ; RV32I-NEXT: addi a0, t6, 0
1558 ; RV32I-NEXT: #NO_APP
1561 ; RV64I-LABEL: explicit_register_x31:
1563 ; RV64I-NEXT: mv t6, a0
1565 ; RV64I-NEXT: addi a0, t6, 0
1566 ; RV64I-NEXT: #NO_APP
1568 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x31}"(i32 %a)
1572 define i32 @explicit_register_t6(i32 %a) nounwind {
1573 ; RV32I-LABEL: explicit_register_t6:
1575 ; RV32I-NEXT: mv t6, a0
1577 ; RV32I-NEXT: addi a0, t6, 0
1578 ; RV32I-NEXT: #NO_APP
1581 ; RV64I-LABEL: explicit_register_t6:
1583 ; RV64I-NEXT: mv t6, a0
1585 ; RV64I-NEXT: addi a0, t6, 0
1586 ; RV64I-NEXT: #NO_APP
1588 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t6}"(i32 %a)