File: stack.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (32 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: llc < %s -march=avr | FileCheck %s

; CHECK-LABEL: ret_void_args_i64_i64_i32
define void @ret_void_args_i64_i64_i32(i64 %a, i64 %b, i32 %c) {
  ; We're goign to clobber PTRREG Y
  ; CHECK:      push    r28
  ; CHECK-NEXT: push    r29

  ; Load the stack pointer into Y.
  ; CHECK-NEXT: in      r28, 61
  ; CHECK-NEXT: in      r29, 62

  ; Load the top two bytes from the 32-bit int.
  ; CHECK-NEXT: ldd     r24, Y+7
  ; CHECK-NEXT: ldd     r25, Y+8
  ; Store the top two bytes of the 32-bit int to memory.
  ; CHECK-NEXT: sts     7, r25
  ; CHECK-NEXT: sts     6, r24

  ; Load the bottom two bytes from the 32-bit int.
  ; CHECK-NEXT: ldd     r24, Y+5
  ; CHECK-NEXT: ldd     r25, Y+6
  ; Store the bottom two bytes of the 32-bit int to memory.
  ; CHECK-NEXT: sts     5, r25
  ; CHECK-NEXT: sts     4, r24

  ; Restore PTRREG Y
  ; CHECK-NEXT: pop     r29
  ; CHECK-NEXT: pop     r28
  store volatile i32 %c, i32* inttoptr (i64 4 to i32*)
  ret void
}