Debian Codegraph @

arch/TriCore/TriCoreCallingConv.td

raw
1 //=- TriCoreCallingConv.td - Calling Conventions for TriCore -*- tablegen -*-=//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // This describes the calling conventions for TriCore architecture.
10 //===----------------------------------------------------------------------===//
11
12 //===----------------------------------------------------------------------===//
13 // CCDelegate implemented form TriCore LLVM Thesis
14 //===----------------------------------------------------------------------===//
15 //def CC_TriCore_StackModel : CallingConv<[
16 //CCAssignToStack<4, 4>
17 //]>;
18
19 //===----------------------------------------------------------------------===//
20 // TriCore Return Value Calling Convention
21 //===----------------------------------------------------------------------===//
22 def RetCC_TriCore : CallingConv<[
23 // Promote i8/i16 arguments to i32.
24 CCIfType<[i8, i16], CCPromoteToType<i32>>,
25
26 // i32 are returned in registers D2
27 CCIfType<[i32], CCAssignToReg<[D2]>>,
28
29 // Integer values get stored in stack slots that are 4 bytes in
30 // size and 4-byte aligned.
31 CCIfType<[i32], CCAssignToStack<4, 4>>
32 ]>;
33
34 //===----------------------------------------------------------------------===//
35 // TriCore Argument Calling Conventions
36 //===----------------------------------------------------------------------===//
37 def CC_TriCore : CallingConv<[
38 // Promote i8/i16 arguments to i32.
39 CCIfType<[i8, i16], CCPromoteToType<i32>>,
40
41
42 // The first 4 integer arguments are passed in integer registers.
43 // CCIfType<[i32], CCAssignToReg<[D4, D5, D6, D7]>>,
44
45 //CCIfType<[i32], CCAssignToReg<[A4, A5, A6, A7]>>,
46
47 // Pointer arguments are handled inside TriCoreIselLowering, because
48 // LLVM lowers i32** type into i32, hence there is no way to distingusish
49 // beetwen a pointer type and an integer type.
50
51
52
53
54 //CCDelegateTo<CC_TriCore_StackModel>
55
56 // Integer values get stored in stack slots that are 4 bytes in
57 // size and 4-byte aligned.
58 CCIfType<[i32], CCAssignToStack<4, 4>>
59 ]>;
60
61 //def CC_Save : CalleeSavedRegs<(add R4, R5, R6, R7, R8, R9)>;