File: i128-abi.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (97 lines) | stat: -rw-r--r-- 2,907 bytes parent folder | download | duplicates (3)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp --version 2
; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s

define i128 @in_reg(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i128 %a4) {
; CHECK-LABEL: in_reg:
; CHECK:       # %bb.0:
; CHECK-NEXT:    movq %r9, %rdx
; CHECK-NEXT:    movq %r8, %rax
; CHECK-NEXT:    retq
  ret i128 %a4
}

define i128 @on_stack(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i128 %a5) {
; CHECK-LABEL: on_stack:
; CHECK:       # %bb.0:
; CHECK-NEXT:    movq 8(%rsp), %rax
; CHECK-NEXT:    movq 16(%rsp), %rdx
; CHECK-NEXT:    retq
  ret i128 %a5
}

define i128 @on_stack2(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i128 %a5, i128 %a6) {
; CHECK-LABEL: on_stack2:
; CHECK:       # %bb.0:
; CHECK-NEXT:    movq 24(%rsp), %rax
; CHECK-NEXT:    movq 32(%rsp), %rdx
; CHECK-NEXT:    retq
  ret i128 %a6
}

define i64 @trailing_arg_on_stack(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i128 %a5, i64 %a6) {
; CHECK-LABEL: trailing_arg_on_stack:
; CHECK:       # %bb.0:
; CHECK-NEXT:    movq %r9, %rax
; CHECK-NEXT:    retq
  ret i64 %a6
}

define void @call_in_reg(i128 %x) nounwind {
; CHECK-LABEL: call_in_reg:
; CHECK:       # %bb.0:
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    movq %rsi, %r9
; CHECK-NEXT:    movq %rdi, %r8
; CHECK-NEXT:    movl $1, %esi
; CHECK-NEXT:    movl $2, %edx
; CHECK-NEXT:    movl $3, %ecx
; CHECK-NEXT:    xorl %edi, %edi
; CHECK-NEXT:    callq in_reg@PLT
; CHECK-NEXT:    popq %rax
; CHECK-NEXT:    retq
  call i128 @in_reg(i64 0, i64 1, i64 2, i64 3, i128 %x)
  ret void
}

define void @call_on_stack(i128 %x) nounwind {
; CHECK-LABEL: call_on_stack:
; CHECK:       # %bb.0:
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    movq %rsi, %rax
; CHECK-NEXT:    movq %rdi, %r9
; CHECK-NEXT:    movl $1, %esi
; CHECK-NEXT:    movl $2, %edx
; CHECK-NEXT:    movl $3, %ecx
; CHECK-NEXT:    movl $4, %r8d
; CHECK-NEXT:    xorl %edi, %edi
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    pushq %r9
; CHECK-NEXT:    callq on_stack@PLT
; CHECK-NEXT:    addq $16, %rsp
; CHECK-NEXT:    popq %rax
; CHECK-NEXT:    retq
  call i128 @on_stack(i64 0, i64 1, i64 2, i64 3, i64 4, i128 %x)
  ret void
}

define void @call_trailing_arg_on_stack(i128 %x, i64 %y) nounwind {
; CHECK-LABEL: call_trailing_arg_on_stack:
; CHECK:       # %bb.0:
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    movq %rdx, %r9
; CHECK-NEXT:    movq %rsi, %rax
; CHECK-NEXT:    movq %rdi, %r10
; CHECK-NEXT:    movl $1, %esi
; CHECK-NEXT:    movl $2, %edx
; CHECK-NEXT:    movl $3, %ecx
; CHECK-NEXT:    movl $4, %r8d
; CHECK-NEXT:    xorl %edi, %edi
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    pushq %r10
; CHECK-NEXT:    callq trailing_arg_on_stack@PLT
; CHECK-NEXT:    addq $16, %rsp
; CHECK-NEXT:    popq %rax
; CHECK-NEXT:    retq
  call i128 @trailing_arg_on_stack(i64 0, i64 1, i64 2, i64 3, i64 4, i128 %x, i64 %y)
  ret void
}