Dylan McKay | bf1d2ed | 2016-12-11 07:09:45 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=avr | FileCheck %s |
| 2 | |
| 3 | ; CHECK-LABEL: ret_void_args_i64_i64_i32 |
| 4 | define void @ret_void_args_i64_i64_i32(i64 %a, i64 %b, i32 %c) { |
| 5 | ; We're goign to clobber PTRREG Y |
| 6 | ; CHECK: push r28 |
| 7 | ; CHECK-NEXT: push r29 |
| 8 | |
| 9 | ; Load the stack pointer into Y. |
| 10 | ; CHECK-NEXT: in r28, 61 |
| 11 | ; CHECK-NEXT: in r29, 62 |
| 12 | |
| 13 | ; Load the top two bytes from the 32-bit int. |
Dylan McKay | 28355ef | 2017-05-02 01:57:48 +0000 | [diff] [blame] | 14 | ; CHECK-NEXT: ldd r24, Y+5 |
| 15 | ; CHECK-NEXT: ldd r25, Y+6 |
Dylan McKay | bf1d2ed | 2016-12-11 07:09:45 +0000 | [diff] [blame] | 16 | ; Store the top two bytes of the 32-bit int to memory. |
| 17 | ; CHECK-NEXT: sts 7, r25 |
| 18 | ; CHECK-NEXT: sts 6, r24 |
| 19 | |
| 20 | ; Load the bottom two bytes from the 32-bit int. |
Dylan McKay | 28355ef | 2017-05-02 01:57:48 +0000 | [diff] [blame] | 21 | ; CHECK-NEXT: ldd r24, Y+3 |
| 22 | ; CHECK-NEXT: ldd r25, Y+4 |
Dylan McKay | bf1d2ed | 2016-12-11 07:09:45 +0000 | [diff] [blame] | 23 | ; Store the bottom two bytes of the 32-bit int to memory. |
| 24 | ; CHECK-NEXT: sts 5, r25 |
| 25 | ; CHECK-NEXT: sts 4, r24 |
| 26 | |
| 27 | ; Restore PTRREG Y |
| 28 | ; CHECK-NEXT: pop r29 |
| 29 | ; CHECK-NEXT: pop r28 |
| 30 | store volatile i32 %c, i32* inttoptr (i64 4 to i32*) |
| 31 | ret void |
| 32 | } |