1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
2 | |* *| |
3 | |* Calling Convention Implementation Fragment *| |
4 | |* *| |
5 | |* Automatically generated file, do not edit! *| |
6 | |* *| |
7 | \*===----------------------------------------------------------------------===*/ |
8 | |
9 | #ifndef GET_CC_REGISTER_LISTS |
10 | |
11 | static bool CC_MSP430_AssignStack(unsigned ValNo, MVT ValVT, |
12 | MVT LocVT, CCValAssign::LocInfo LocInfo, |
13 | ISD::ArgFlagsTy ArgFlags, CCState &State); |
14 | static bool RetCC_MSP430(unsigned ValNo, MVT ValVT, |
15 | MVT LocVT, CCValAssign::LocInfo LocInfo, |
16 | ISD::ArgFlagsTy ArgFlags, CCState &State); |
17 | |
18 | |
19 | static bool CC_MSP430_AssignStack(unsigned ValNo, MVT ValVT, |
20 | MVT LocVT, CCValAssign::LocInfo LocInfo, |
21 | ISD::ArgFlagsTy ArgFlags, CCState &State) { |
22 | |
23 | if (ArgFlags.isByVal()) { |
24 | State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, MinSize: 2, MinAlign: Align(2), ArgFlags); |
25 | return false; |
26 | } |
27 | |
28 | if (LocVT == MVT::i8) { |
29 | LocVT = MVT::i16; |
30 | if (ArgFlags.isSExt()) |
31 | LocInfo = CCValAssign::SExt; |
32 | else if (ArgFlags.isZExt()) |
33 | LocInfo = CCValAssign::ZExt; |
34 | else |
35 | LocInfo = CCValAssign::AExt; |
36 | } |
37 | |
38 | if (LocVT == MVT::i16) { |
39 | int64_t Offset1 = State.AllocateStack(Size: 2, Alignment: Align(2)); |
40 | State.addLoc(V: CCValAssign::getMem(ValNo, ValVT, Offset: Offset1, LocVT, HTP: LocInfo)); |
41 | return false; |
42 | } |
43 | |
44 | return true; // CC didn't match. |
45 | } |
46 | |
47 | |
48 | static bool RetCC_MSP430(unsigned ValNo, MVT ValVT, |
49 | MVT LocVT, CCValAssign::LocInfo LocInfo, |
50 | ISD::ArgFlagsTy ArgFlags, CCState &State) { |
51 | |
52 | if (LocVT == MVT::i8) { |
53 | static const MCPhysReg RegList1[] = { |
54 | MSP430::R12B, MSP430::R13B, MSP430::R14B, MSP430::R15B |
55 | }; |
56 | if (unsigned Reg = State.AllocateReg(Regs: RegList1)) { |
57 | State.addLoc(V: CCValAssign::getReg(ValNo, ValVT, RegNo: Reg, LocVT, HTP: LocInfo)); |
58 | return false; |
59 | } |
60 | } |
61 | |
62 | if (LocVT == MVT::i16) { |
63 | static const MCPhysReg RegList2[] = { |
64 | MSP430::R12, MSP430::R13, MSP430::R14, MSP430::R15 |
65 | }; |
66 | if (unsigned Reg = State.AllocateReg(Regs: RegList2)) { |
67 | State.addLoc(V: CCValAssign::getReg(ValNo, ValVT, RegNo: Reg, LocVT, HTP: LocInfo)); |
68 | return false; |
69 | } |
70 | } |
71 | |
72 | return true; // CC didn't match. |
73 | } |
74 | |
75 | #else |
76 | |
77 | const MCRegister CC_MSP430_AssignStack_ArgRegs[] = { 0 }; |
78 | const MCRegister RetCC_MSP430_ArgRegs[] = { MSP430::R12, MSP430::R12B, MSP430::R13, MSP430::R13B, MSP430::R14, MSP430::R14B, MSP430::R15, MSP430::R15B }; |
79 | |
80 | #endif // CC_REGISTER_LIST |
81 | |