Skip to content

Commit 38a608b

Browse files
committed
[AVR] Cherry-pick (D68524) Rewrite the function calling convention.
This fixes avr-rust/rust-legacy-fork#92. At the time of cherry-picking, this patch has not yet been upstreamed.
1 parent 4350776 commit 38a608b

File tree

9 files changed

+428
-213
lines changed

9 files changed

+428
-213
lines changed

llvm/lib/Target/AVR/AVRCallingConv.td

+1-17
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88
// This describes the calling conventions for AVR architecture.
9+
// Normal functions use a special calling convention, solved in code.
910
//===----------------------------------------------------------------------===//
1011

1112
//===----------------------------------------------------------------------===//
1213
// AVR Return Value Calling Convention
1314
//===----------------------------------------------------------------------===//
1415

15-
def RetCC_AVR : CallingConv
16-
<[
17-
// i8 is returned in R24.
18-
CCIfType<[i8], CCAssignToReg<[R24]>>,
19-
20-
// i16 are returned in R25:R24, R23:R22, R21:R20 and R19:R18.
21-
CCIfType<[i16], CCAssignToReg<[R25R24, R23R22, R21R20, R19R18]>>
22-
]>;
23-
2416
// Special return value calling convention for runtime functions.
2517
def RetCC_AVR_BUILTIN : CallingConv
2618
<[
@@ -41,14 +33,6 @@ def ArgCC_AVR_Vararg : CallingConv
4133
CCAssignToStack<2, 1>
4234
]>;
4335

44-
// Special argument calling convention for
45-
// division runtime functions.
46-
def ArgCC_AVR_BUILTIN_DIV : CallingConv
47-
<[
48-
CCIfType<[i8], CCAssignToReg<[R24,R22]>>,
49-
CCIfType<[i16], CCAssignToReg<[R25R24, R23R22]>>
50-
]>;
51-
5236
//===----------------------------------------------------------------------===//
5337
// Callee-saved register lists.
5438
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)