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_BPF32(unsigned ValNo, MVT ValVT,
10 : MVT LocVT, CCValAssign::LocInfo LocInfo,
11 : ISD::ArgFlagsTy ArgFlags, CCState &State);
12 : static bool CC_BPF64(unsigned ValNo, MVT ValVT,
13 : MVT LocVT, CCValAssign::LocInfo LocInfo,
14 : ISD::ArgFlagsTy ArgFlags, CCState &State);
15 : static bool RetCC_BPF32(unsigned ValNo, MVT ValVT,
16 : MVT LocVT, CCValAssign::LocInfo LocInfo,
17 : ISD::ArgFlagsTy ArgFlags, CCState &State);
18 : static bool RetCC_BPF64(unsigned ValNo, MVT ValVT,
19 : MVT LocVT, CCValAssign::LocInfo LocInfo,
20 : ISD::ArgFlagsTy ArgFlags, CCState &State);
21 :
22 :
23 83 : static bool CC_BPF32(unsigned ValNo, MVT ValVT,
24 : MVT LocVT, CCValAssign::LocInfo LocInfo,
25 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
26 :
27 83 : if (LocVT == MVT::i32) {
28 : static const MCPhysReg RegList1[] = {
29 : BPF::W1, BPF::W2, BPF::W3, BPF::W4, BPF::W5
30 : };
31 : static const MCPhysReg RegList2[] = {
32 : BPF::R1, BPF::R2, BPF::R3, BPF::R4, BPF::R5
33 : };
34 56 : if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
35 56 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
36 56 : return false;
37 : }
38 : }
39 :
40 27 : if (LocVT == MVT::i64) {
41 : static const MCPhysReg RegList3[] = {
42 : BPF::R1, BPF::R2, BPF::R3, BPF::R4, BPF::R5
43 : };
44 : static const MCPhysReg RegList4[] = {
45 : BPF::W1, BPF::W2, BPF::W3, BPF::W4, BPF::W5
46 : };
47 27 : if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
48 27 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
49 27 : return false;
50 : }
51 : }
52 :
53 0 : unsigned Offset5 = State.AllocateStack(8, 8);
54 0 : State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset5, LocVT, LocInfo));
55 0 : return false;
56 :
57 : return true; // CC didn't match.
58 : }
59 :
60 :
61 384 : static bool CC_BPF64(unsigned ValNo, MVT ValVT,
62 : MVT LocVT, CCValAssign::LocInfo LocInfo,
63 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
64 :
65 384 : if (LocVT == MVT::i8 ||
66 768 : LocVT == MVT::i16 ||
67 : LocVT == MVT::i32) {
68 : LocVT = MVT::i64;
69 0 : if (ArgFlags.isSExt())
70 : LocInfo = CCValAssign::SExt;
71 0 : else if (ArgFlags.isZExt())
72 : LocInfo = CCValAssign::ZExt;
73 : else
74 : LocInfo = CCValAssign::AExt;
75 : }
76 :
77 384 : if (LocVT == MVT::i64) {
78 : static const MCPhysReg RegList1[] = {
79 : BPF::R1, BPF::R2, BPF::R3, BPF::R4, BPF::R5
80 : };
81 384 : if (unsigned Reg = State.AllocateReg(RegList1)) {
82 382 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
83 382 : return false;
84 : }
85 : }
86 :
87 2 : unsigned Offset2 = State.AllocateStack(8, 8);
88 2 : State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
89 2 : return false;
90 :
91 : return true; // CC didn't match.
92 : }
93 :
94 :
95 39 : static bool RetCC_BPF32(unsigned ValNo, MVT ValVT,
96 : MVT LocVT, CCValAssign::LocInfo LocInfo,
97 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
98 :
99 39 : if (LocVT == MVT::i32) {
100 31 : if (unsigned Reg = State.AllocateReg(BPF::W0, BPF::R0)) {
101 31 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
102 31 : return false;
103 : }
104 : }
105 :
106 8 : if (LocVT == MVT::i64) {
107 8 : if (unsigned Reg = State.AllocateReg(BPF::R0, BPF::W0)) {
108 8 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
109 8 : return false;
110 : }
111 : }
112 :
113 : return true; // CC didn't match.
114 : }
115 :
116 :
117 154 : static bool RetCC_BPF64(unsigned ValNo, MVT ValVT,
118 : MVT LocVT, CCValAssign::LocInfo LocInfo,
119 : ISD::ArgFlagsTy ArgFlags, CCState &State) {
120 :
121 154 : if (LocVT == MVT::i64) {
122 : if (unsigned Reg = State.AllocateReg(BPF::R0)) {
123 154 : State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
124 154 : return false;
125 : }
126 : }
127 :
128 : return true; // CC didn't match.
129 : }
|