Line data Source code
1 : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2 : |* *|
3 : |* Calling Convention Implementation Fragment *|
4 : |* *|
5 : |* Automatically generated file, do not edit! *|
6 : |* *|
7 : \*===----------------------------------------------------------------------===*/
8 :
9 : static bool CC_Sparc32(unsigned ValNo, MVT ValVT,
10 : MVT LocVT, CCValAssign::LocInfo LocInfo,
11 : ISD::ArgFlagsTy ArgFlags, CCState &State);
12 : static bool CC_Sparc64(unsigned ValNo, MVT ValVT,
13 : MVT LocVT, CCValAssign::LocInfo LocInfo,
14 : ISD::ArgFlagsTy ArgFlags, CCState &State);
15 : static bool RetCC_Sparc32(unsigned ValNo, MVT ValVT,
16 : MVT LocVT, CCValAssign::LocInfo LocInfo,
17 : ISD::ArgFlagsTy ArgFlags, CCState &State);
18 : static bool RetCC_Sparc64(unsigned ValNo, MVT ValVT,
19 : MVT LocVT, CCValAssign::LocInfo LocInfo,
20 : ISD::ArgFlagsTy ArgFlags, CCState &State);
21 :
22 :
23 1402 : static bool CC_Sparc32(unsigned ValNo, MVT ValVT,
24 : MVT LocVT, CCValAssign::LocInfo LocInfo,
25 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
26 :
27 1402 : if (ArgFlags.isSRet()) {
28 56 : if (CC_Sparc_Assign_SRet(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
29 56 : return false;
30 : }
31 :
32 1346 : if (LocVT == MVT::i32 ||
33 : LocVT == MVT::f32) {
34 : static const MCPhysReg RegList1[] = {
35 : SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
36 : };
37 1278 : if (unsigned Reg = State.AllocateReg(RegList1)) {
38 2334 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
39 1167 : return false;
40 : }
41 : }
42 :
43 179 : if (LocVT == MVT::f64) {
44 68 : if (CC_Sparc_Assign_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
45 : return false;
46 : }
47 :
48 111 : if (LocVT == MVT::v2i32) {
49 0 : if (CC_Sparc_Assign_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
50 : return false;
51 : }
52 :
53 111 : unsigned Offset2 = State.AllocateStack(4, 4);
54 222 : State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
55 111 : return false;
56 :
57 : return true; // CC didn't match.
58 : }
59 :
60 :
61 994 : static bool CC_Sparc64(unsigned ValNo, MVT ValVT,
62 : MVT LocVT, CCValAssign::LocInfo LocInfo,
63 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
64 :
65 994 : if (ArgFlags.isInReg()) {
66 47 : if (LocVT == MVT::i32 ||
67 : LocVT == MVT::f32) {
68 47 : if (CC_Sparc64_Half(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
69 : return false;
70 : }
71 : }
72 :
73 947 : if (LocVT == MVT::i32) {
74 304 : LocVT = MVT::i64;
75 304 : if (ArgFlags.isSExt())
76 16 : LocInfo = CCValAssign::SExt;
77 288 : else if (ArgFlags.isZExt())
78 41 : LocInfo = CCValAssign::ZExt;
79 : else
80 247 : LocInfo = CCValAssign::AExt;
81 : }
82 :
83 947 : if (CC_Sparc64_Full(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
84 947 : return false;
85 :
86 : return true; // CC didn't match.
87 : }
88 :
89 :
90 547 : static bool RetCC_Sparc32(unsigned ValNo, MVT ValVT,
91 : MVT LocVT, CCValAssign::LocInfo LocInfo,
92 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
93 :
94 547 : if (LocVT == MVT::i32) {
95 : static const MCPhysReg RegList1[] = {
96 : SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
97 : };
98 449 : if (unsigned Reg = State.AllocateReg(RegList1)) {
99 898 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
100 449 : return false;
101 : }
102 : }
103 :
104 98 : if (LocVT == MVT::f32) {
105 : static const MCPhysReg RegList2[] = {
106 : SP::F0, SP::F1, SP::F2, SP::F3
107 : };
108 28 : if (unsigned Reg = State.AllocateReg(RegList2)) {
109 56 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
110 28 : return false;
111 : }
112 : }
113 :
114 70 : if (LocVT == MVT::f64) {
115 : static const MCPhysReg RegList3[] = {
116 : SP::D0, SP::D1
117 : };
118 62 : if (unsigned Reg = State.AllocateReg(RegList3)) {
119 124 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
120 62 : return false;
121 : }
122 : }
123 :
124 8 : if (LocVT == MVT::v2i32) {
125 8 : if (CC_Sparc_Assign_Ret_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
126 8 : return false;
127 : }
128 :
129 : return true; // CC didn't match.
130 : }
131 :
132 :
133 290 : static bool RetCC_Sparc64(unsigned ValNo, MVT ValVT,
134 : MVT LocVT, CCValAssign::LocInfo LocInfo,
135 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
136 :
137 290 : if (LocVT == MVT::f32) {
138 16 : if (CC_Sparc64_Half(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
139 : return false;
140 : }
141 :
142 274 : if (!CC_Sparc64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
143 274 : return false;
144 :
145 : return true; // CC didn't match.
146 : }
|