Coverage Report

Created: 2018-12-14 11:24

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/SystemZ/SystemZGenCallingConv.inc
Line
Count
Source (jump to first uncovered line)
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_SystemZ(unsigned ValNo, MVT ValVT,
10
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
11
                       ISD::ArgFlagsTy ArgFlags, CCState &State);
12
static bool RetCC_SystemZ(unsigned ValNo, MVT ValVT,
13
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
14
                          ISD::ArgFlagsTy ArgFlags, CCState &State);
15
16
17
static bool CC_SystemZ(unsigned ValNo, MVT ValVT,
18
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
19
15.1k
                       ISD::ArgFlagsTy ArgFlags, CCState &State) {
20
15.1k
21
15.1k
  if (LocVT == MVT::i32) {
22
2.48k
    if (ArgFlags.isSExt() || 
ArgFlags.isZExt()2.43k
) {
23
117
      LocVT = MVT::i64;
24
117
      if (ArgFlags.isSExt())
25
58
            LocInfo = CCValAssign::SExt;
26
59
      else if (ArgFlags.isZExt())
27
59
            LocInfo = CCValAssign::ZExt;
28
0
      else
29
0
            LocInfo = CCValAssign::AExt;
30
117
    }
31
2.48k
  }
32
15.1k
33
15.1k
  if (ArgFlags.isSwiftSelf()) {
34
10
    if (LocVT == MVT::i64) {
35
10
      if (unsigned Reg = State.AllocateReg(SystemZ::R10D)) {
36
10
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
37
10
        return false;
38
10
      }
39
15.1k
    }
40
10
  }
41
15.1k
42
15.1k
  if (ArgFlags.isSwiftError()) {
43
18
    if (LocVT == MVT::i64) {
44
18
      if (unsigned Reg = State.AllocateReg(SystemZ::R9D)) {
45
18
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
46
18
        return false;
47
18
      }
48
15.1k
    }
49
18
  }
50
15.1k
51
15.1k
  if (LocVT == MVT::f128) {
52
100
    LocVT = MVT::i64;
53
100
    LocInfo = CCValAssign::Indirect;
54
100
  }
55
15.1k
56
15.1k
  if (LocVT == MVT::i64) {
57
7.45k
    if (CC_SystemZ_I128Indirect(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
58
76
        return false;
59
15.0k
  }
60
15.0k
61
15.0k
  if (LocVT == MVT::i32) {
62
2.37k
    static const MCPhysReg RegList1[] = {
63
2.37k
      SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L, SystemZ::R6L
64
2.37k
    };
65
2.37k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
66
2.34k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
67
2.34k
      return false;
68
2.34k
    }
69
12.7k
  }
70
12.7k
71
12.7k
  if (LocVT == MVT::i64) {
72
7.37k
    static const MCPhysReg RegList2[] = {
73
7.37k
      SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D, SystemZ::R6D
74
7.37k
    };
75
7.37k
    if (unsigned Reg = State.AllocateReg(RegList2)) {
76
7.18k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
77
7.18k
      return false;
78
7.18k
    }
79
5.54k
  }
80
5.54k
81
5.54k
  if (LocVT == MVT::f32) {
82
674
    static const MCPhysReg RegList3[] = {
83
674
      SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
84
674
    };
85
674
    if (unsigned Reg = State.AllocateReg(RegList3)) {
86
653
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
87
653
      return false;
88
653
    }
89
4.88k
  }
90
4.88k
91
4.88k
  if (LocVT == MVT::f64) {
92
1.28k
    static const MCPhysReg RegList4[] = {
93
1.28k
      SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
94
1.28k
    };
95
1.28k
    if (unsigned Reg = State.AllocateReg(RegList4)) {
96
1.26k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
97
1.26k
      return false;
98
1.26k
    }
99
3.62k
  }
100
3.62k
101
3.62k
  if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
102
3.37k
    if (LocVT == MVT::v16i8 ||
103
3.37k
        
LocVT == MVT::v8i162.63k
||
104
3.37k
        
LocVT == MVT::v4i322.00k
||
105
3.37k
        
LocVT == MVT::v2i641.27k
||
106
3.37k
        
LocVT == MVT::v4f32796
||
107
3.37k
        
LocVT == MVT::v2f64355
) {
108
3.37k
      if (static_cast<SystemZCCState *>(&State)->IsFixed(ValNo)) {
109
3.36k
        static const MCPhysReg RegList5[] = {
110
3.36k
          SystemZ::V24, SystemZ::V26, SystemZ::V28, SystemZ::V30, SystemZ::V25, SystemZ::V27, SystemZ::V29, SystemZ::V31
111
3.36k
        };
112
3.36k
        if (unsigned Reg = State.AllocateReg(RegList5)) {
113
3.27k
          State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
114
3.27k
          return false;
115
3.27k
        }
116
350
      }
117
3.37k
    }
118
3.37k
  }
119
350
120
350
  if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
121
104
    if (LocVT == MVT::v16i8 ||
122
104
        
LocVT == MVT::v8i1678
||
123
104
        
LocVT == MVT::v4i3262
||
124
104
        
LocVT == MVT::v2i6428
||
125
104
        
LocVT == MVT::v4f3224
||
126
104
        
LocVT == MVT::v2f6416
) {
127
100
      if (static_cast<SystemZCCState *>(&State)->IsShortVector(ValNo)) {
128
14
        LocVT = MVT::i64;
129
14
        LocInfo = CCValAssign::BCvt;
130
14
      }
131
100
    }
132
104
  }
133
350
134
350
  if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
135
104
    if (LocVT == MVT::v16i8 ||
136
104
        
LocVT == MVT::v8i1692
||
137
104
        
LocVT == MVT::v4i3276
||
138
104
        
LocVT == MVT::v2i6442
||
139
104
        
LocVT == MVT::v4f3238
||
140
104
        
LocVT == MVT::v2f6430
) {
141
86
      unsigned Offset6 = State.AllocateStack(16, 8);
142
86
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
143
86
      return false;
144
86
    }
145
264
  }
146
264
147
264
  if (LocVT == MVT::i32 ||
148
264
      
LocVT == MVT::i64238
||
149
264
      
LocVT == MVT::f3239
||
150
264
      
LocVT == MVT::f6418
) {
151
264
    unsigned Offset7 = State.AllocateStack(8, 8);
152
264
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
153
264
    return false;
154
264
  }
155
0
156
0
  return true;  // CC didn't match.
157
0
}
158
159
160
static bool RetCC_SystemZ(unsigned ValNo, MVT ValVT,
161
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
162
11.8k
                          ISD::ArgFlagsTy ArgFlags, CCState &State) {
163
11.8k
164
11.8k
  if (LocVT == MVT::i32) {
165
3.68k
    if (ArgFlags.isSExt() || 
ArgFlags.isZExt()3.60k
) {
166
818
      LocVT = MVT::i64;
167
818
      if (ArgFlags.isSExt())
168
74
            LocInfo = CCValAssign::SExt;
169
744
      else if (ArgFlags.isZExt())
170
744
            LocInfo = CCValAssign::ZExt;
171
0
      else
172
0
            LocInfo = CCValAssign::AExt;
173
818
    }
174
3.68k
  }
175
11.8k
176
11.8k
  if (ArgFlags.isSwiftError()) {
177
20
    if (LocVT == MVT::i64) {
178
20
      if (unsigned Reg = State.AllocateReg(SystemZ::R9D)) {
179
20
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
180
20
        return false;
181
20
      }
182
11.8k
    }
183
20
  }
184
11.8k
185
11.8k
  if (LocVT == MVT::i32) {
186
2.86k
    static const MCPhysReg RegList1[] = {
187
2.86k
      SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L
188
2.86k
    };
189
2.86k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
190
2.85k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
191
2.85k
      return false;
192
2.85k
    }
193
8.99k
  }
194
8.99k
195
8.99k
  if (LocVT == MVT::i64) {
196
3.42k
    static const MCPhysReg RegList2[] = {
197
3.42k
      SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D
198
3.42k
    };
199
3.42k
    if (unsigned Reg = State.AllocateReg(RegList2)) {
200
3.42k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
201
3.42k
      return false;
202
3.42k
    }
203
5.57k
  }
204
5.57k
205
5.57k
  if (LocVT == MVT::f32) {
206
662
    static const MCPhysReg RegList3[] = {
207
662
      SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
208
662
    };
209
662
    if (unsigned Reg = State.AllocateReg(RegList3)) {
210
662
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
211
662
      return false;
212
662
    }
213
4.91k
  }
214
4.91k
215
4.91k
  if (LocVT == MVT::f64) {
216
1.47k
    static const MCPhysReg RegList4[] = {
217
1.47k
      SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
218
1.47k
    };
219
1.47k
    if (unsigned Reg = State.AllocateReg(RegList4)) {
220
1.47k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
221
1.47k
      return false;
222
1.47k
    }
223
3.43k
  }
224
3.43k
225
3.43k
  if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
226
3.39k
    if (LocVT == MVT::v16i8 ||
227
3.39k
        
LocVT == MVT::v8i162.61k
||
228
3.39k
        
LocVT == MVT::v4i321.96k
||
229
3.39k
        
LocVT == MVT::v2i641.23k
||
230
3.39k
        
LocVT == MVT::v4f32662
||
231
3.39k
        
LocVT == MVT::v2f64334
) {
232
3.38k
      static const MCPhysReg RegList5[] = {
233
3.38k
        SystemZ::V24, SystemZ::V26, SystemZ::V28, SystemZ::V30, SystemZ::V25, SystemZ::V27, SystemZ::V29, SystemZ::V31
234
3.38k
      };
235
3.38k
      if (unsigned Reg = State.AllocateReg(RegList5)) {
236
3.38k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
237
3.38k
        return false;
238
3.38k
      }
239
52
    }
240
3.39k
  }
241
52
242
52
  return true;  // CC didn't match.
243
52
}