Coverage Report

Created: 2018-11-16 02:38

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/Hexagon/HexagonGenCallingConv.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_Hexagon(unsigned ValNo, MVT ValVT,
10
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
11
                       ISD::ArgFlagsTy ArgFlags, CCState &State);
12
static bool CC_HexagonStack(unsigned ValNo, MVT ValVT,
13
                            MVT LocVT, CCValAssign::LocInfo LocInfo,
14
                            ISD::ArgFlagsTy ArgFlags, CCState &State);
15
static bool CC_Hexagon_HVX(unsigned ValNo, MVT ValVT,
16
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
17
                           ISD::ArgFlagsTy ArgFlags, CCState &State);
18
static bool RetCC_Hexagon(unsigned ValNo, MVT ValVT,
19
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
20
                          ISD::ArgFlagsTy ArgFlags, CCState &State);
21
static bool RetCC_Hexagon_HVX(unsigned ValNo, MVT ValVT,
22
                              MVT LocVT, CCValAssign::LocInfo LocInfo,
23
                              ISD::ArgFlagsTy ArgFlags, CCState &State);
24
25
26
static bool CC_Hexagon(unsigned ValNo, MVT ValVT,
27
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
28
7.19k
                       ISD::ArgFlagsTy ArgFlags, CCState &State) {
29
7.19k
30
7.19k
  if (LocVT == MVT::i1 ||
31
7.19k
      
LocVT == MVT::i87.18k
||
32
7.19k
      
LocVT == MVT::i167.18k
) {
33
13
    LocVT = MVT::i32;
34
13
    if (ArgFlags.isSExt())
35
0
        LocInfo = CCValAssign::SExt;
36
13
    else if (ArgFlags.isZExt())
37
1
        LocInfo = CCValAssign::ZExt;
38
12
    else
39
12
        LocInfo = CCValAssign::AExt;
40
13
  }
41
7.19k
42
7.19k
  if (LocVT == MVT::f32) {
43
161
    LocVT = MVT::i32;
44
161
    LocInfo = CCValAssign::BCvt;
45
161
  }
46
7.19k
47
7.19k
  if (LocVT == MVT::f64) {
48
461
    LocVT = MVT::i64;
49
461
    LocInfo = CCValAssign::BCvt;
50
461
  }
51
7.19k
52
7.19k
  if (ArgFlags.isByVal()) {
53
19
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
54
19
    return false;
55
19
  }
56
7.17k
57
7.17k
  if (State.isVarArg() && 
ValNo >= static_cast<HexagonCCState&>(State).getNumNamedVarArgParams()153
) {
58
76
    if (!CC_HexagonStack(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
59
76
      return false;
60
7.10k
  }
61
7.10k
62
7.10k
  if (LocVT == MVT::i32) {
63
5.20k
    if (ArgFlags.isSplit()) {
64
0
      if (CC_SkipOdd(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
65
0
            return false;
66
7.10k
    }
67
5.20k
  }
68
7.10k
69
7.10k
  if (LocVT == MVT::i32 ||
70
7.10k
      
LocVT == MVT::v2i161.90k
||
71
7.10k
      
LocVT == MVT::v4i81.87k
) {
72
5.28k
    static const MCPhysReg RegList1[] = {
73
5.28k
      Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4, Hexagon::R5
74
5.28k
    };
75
5.28k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
76
5.24k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
77
5.24k
      return false;
78
5.24k
    }
79
1.86k
  }
80
1.86k
81
1.86k
  if (LocVT == MVT::i64 ||
82
1.86k
      
LocVT == MVT::v2i32107
||
83
1.86k
      
LocVT == MVT::v4i1691
||
84
1.86k
      
LocVT == MVT::v8i865
) {
85
1.81k
    if (CC_SkipOdd(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
86
0
        return false;
87
1.86k
  }
88
1.86k
89
1.86k
  if (LocVT == MVT::i64 ||
90
1.86k
      
LocVT == MVT::v2i32107
||
91
1.86k
      
LocVT == MVT::v4i1691
||
92
1.86k
      
LocVT == MVT::v8i865
) {
93
1.81k
    static const MCPhysReg RegList2[] = {
94
1.81k
      Hexagon::D0, Hexagon::D1, Hexagon::D2
95
1.81k
    };
96
1.81k
    if (unsigned Reg = State.AllocateReg(RegList2)) {
97
1.81k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
98
1.81k
      return false;
99
1.81k
    }
100
51
  }
101
51
102
51
  if (!CC_HexagonStack(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
103
51
    return false;
104
0
105
0
  return true;  // CC didn't match.
106
0
}
107
108
109
static bool CC_HexagonStack(unsigned ValNo, MVT ValVT,
110
                            MVT LocVT, CCValAssign::LocInfo LocInfo,
111
127
                            ISD::ArgFlagsTy ArgFlags, CCState &State) {
112
127
113
127
  if (LocVT == MVT::i32 ||
114
127
      
LocVT == MVT::v2i1617
||
115
127
      
LocVT == MVT::v4i817
) {
116
110
    unsigned Offset1 = State.AllocateStack(4, 4);
117
110
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
118
110
    return false;
119
110
  }
120
17
121
17
  if (LocVT == MVT::i64 ||
122
17
      
LocVT == MVT::v2i320
||
123
17
      
LocVT == MVT::v4i160
||
124
17
      
LocVT == MVT::v8i80
) {
125
17
    unsigned Offset2 = State.AllocateStack(8, 8);
126
17
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
127
17
    return false;
128
17
  }
129
0
130
0
  return true;  // CC didn't match.
131
0
}
132
133
134
static bool CC_Hexagon_HVX(unsigned ValNo, MVT ValVT,
135
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
136
3.70k
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
137
3.70k
138
3.70k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
139
2.10k
    if (LocVT == MVT::v16i32 ||
140
2.10k
        
LocVT == MVT::v32i161.46k
||
141
2.10k
        
LocVT == MVT::v64i81.37k
) {
142
1.01k
      static const MCPhysReg RegList1[] = {
143
1.01k
        Hexagon::V0, Hexagon::V1, Hexagon::V2, Hexagon::V3, Hexagon::V4, Hexagon::V5, Hexagon::V6, Hexagon::V7, Hexagon::V8, Hexagon::V9, Hexagon::V10, Hexagon::V11, Hexagon::V12, Hexagon::V13, Hexagon::V14, Hexagon::V15
144
1.01k
      };
145
1.01k
      if (unsigned Reg = State.AllocateReg(RegList1)) {
146
1.01k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
147
1.01k
        return false;
148
1.01k
      }
149
2.68k
    }
150
2.10k
  }
151
2.68k
152
2.68k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
153
1.08k
    if (LocVT == MVT::v32i32 ||
154
1.08k
        
LocVT == MVT::v64i161.01k
||
155
1.08k
        
LocVT == MVT::v128i81.01k
) {
156
472
      static const MCPhysReg RegList2[] = {
157
472
        Hexagon::W0, Hexagon::W1, Hexagon::W2, Hexagon::W3, Hexagon::W4, Hexagon::W5, Hexagon::W6, Hexagon::W7
158
472
      };
159
472
      if (unsigned Reg = State.AllocateReg(RegList2)) {
160
472
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
161
472
        return false;
162
472
      }
163
2.21k
    }
164
1.08k
  }
165
2.21k
166
2.21k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
167
617
    if (LocVT == MVT::v16i32 ||
168
617
        LocVT == MVT::v32i16 ||
169
617
        LocVT == MVT::v64i8) {
170
0
      unsigned Offset3 = State.AllocateStack(64, 64);
171
0
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
172
0
      return false;
173
0
    }
174
2.21k
  }
175
2.21k
176
2.21k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
177
617
    if (LocVT == MVT::v32i32 ||
178
617
        LocVT == MVT::v64i16 ||
179
617
        LocVT == MVT::v128i8) {
180
0
      unsigned Offset4 = State.AllocateStack(128, 64);
181
0
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset4, LocVT, LocInfo));
182
0
      return false;
183
0
    }
184
2.21k
  }
185
2.21k
186
2.21k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
187
1.60k
    if (LocVT == MVT::v32i32 ||
188
1.60k
        
LocVT == MVT::v64i161.41k
||
189
1.60k
        
LocVT == MVT::v128i81.33k
) {
190
743
      static const MCPhysReg RegList5[] = {
191
743
        Hexagon::V0, Hexagon::V1, Hexagon::V2, Hexagon::V3, Hexagon::V4, Hexagon::V5, Hexagon::V6, Hexagon::V7, Hexagon::V8, Hexagon::V9, Hexagon::V10, Hexagon::V11, Hexagon::V12, Hexagon::V13, Hexagon::V14, Hexagon::V15
192
743
      };
193
743
      if (unsigned Reg = State.AllocateReg(RegList5)) {
194
739
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
195
739
        return false;
196
739
      }
197
1.47k
    }
198
1.60k
  }
199
1.47k
200
1.47k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
201
861
    if (LocVT == MVT::v64i32 ||
202
861
        
LocVT == MVT::v128i16845
||
203
861
        
LocVT == MVT::v256i8844
) {
204
684
      static const MCPhysReg RegList6[] = {
205
684
        Hexagon::W0, Hexagon::W1, Hexagon::W2, Hexagon::W3, Hexagon::W4, Hexagon::W5, Hexagon::W6, Hexagon::W7
206
684
      };
207
684
      if (unsigned Reg = State.AllocateReg(RegList6)) {
208
684
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
209
684
        return false;
210
684
      }
211
794
    }
212
861
  }
213
794
214
794
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
215
177
    if (LocVT == MVT::v32i32 ||
216
177
        
LocVT == MVT::v64i16173
||
217
177
        
LocVT == MVT::v128i8173
) {
218
4
      unsigned Offset7 = State.AllocateStack(128, 128);
219
4
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
220
4
      return false;
221
4
    }
222
790
  }
223
790
224
790
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
225
173
    if (LocVT == MVT::v64i32 ||
226
173
        LocVT == MVT::v128i16 ||
227
173
        LocVT == MVT::v256i8) {
228
0
      unsigned Offset8 = State.AllocateStack(256, 128);
229
0
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset8, LocVT, LocInfo));
230
0
      return false;
231
0
    }
232
790
  }
233
790
234
790
  if (!CC_Hexagon(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
235
790
    return false;
236
0
237
0
  return true;  // CC didn't match.
238
0
}
239
240
241
static bool RetCC_Hexagon(unsigned ValNo, MVT ValVT,
242
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
243
5.80k
                          ISD::ArgFlagsTy ArgFlags, CCState &State) {
244
5.80k
245
5.80k
  if (LocVT == MVT::i1 ||
246
5.80k
      
LocVT == MVT::i85.77k
||
247
5.80k
      
LocVT == MVT::i165.77k
) {
248
26
    LocVT = MVT::i32;
249
26
    if (ArgFlags.isSExt())
250
0
        LocInfo = CCValAssign::SExt;
251
26
    else if (ArgFlags.isZExt())
252
0
        LocInfo = CCValAssign::ZExt;
253
26
    else
254
26
        LocInfo = CCValAssign::AExt;
255
26
  }
256
5.80k
257
5.80k
  if (LocVT == MVT::f32) {
258
142
    LocVT = MVT::i32;
259
142
    LocInfo = CCValAssign::BCvt;
260
142
  }
261
5.80k
262
5.80k
  if (LocVT == MVT::f64) {
263
480
    LocVT = MVT::i64;
264
480
    LocInfo = CCValAssign::BCvt;
265
480
  }
266
5.80k
267
5.80k
  if (ArgFlags.isSplit()) {
268
0
    static const MCPhysReg RegList1[] = {
269
0
      Hexagon::R0, Hexagon::R1
270
0
    };
271
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
272
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
273
0
      return false;
274
0
    }
275
5.80k
  }
276
5.80k
277
5.80k
  if (LocVT == MVT::i32 ||
278
5.80k
      
LocVT == MVT::v2i162.26k
||
279
5.80k
      
LocVT == MVT::v4i82.23k
) {
280
3.62k
    static const MCPhysReg RegList2[] = {
281
3.62k
      Hexagon::R0, Hexagon::R1
282
3.62k
    };
283
3.62k
    if (unsigned Reg = State.AllocateReg(RegList2)) {
284
3.62k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
285
3.62k
      return false;
286
3.62k
    }
287
2.17k
  }
288
2.17k
289
2.17k
  if (LocVT == MVT::i64 ||
290
2.17k
      
LocVT == MVT::v2i3268
||
291
2.17k
      
LocVT == MVT::v4i1654
||
292
2.17k
      
LocVT == MVT::v8i822
) {
293
2.17k
    if (unsigned Reg = State.AllocateReg(Hexagon::D0)) {
294
2.17k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
295
2.17k
      return false;
296
2.17k
    }
297
0
  }
298
0
299
0
  return true;  // CC didn't match.
300
0
}
301
302
303
static bool RetCC_Hexagon_HVX(unsigned ValNo, MVT ValVT,
304
                              MVT LocVT, CCValAssign::LocInfo LocInfo,
305
3.00k
                              ISD::ArgFlagsTy ArgFlags, CCState &State) {
306
3.00k
307
3.00k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
308
1.46k
    if (LocVT == MVT::v16i32 ||
309
1.46k
        
LocVT == MVT::v32i161.14k
||
310
1.46k
        
LocVT == MVT::v64i81.06k
) {
311
690
      if (unsigned Reg = State.AllocateReg(Hexagon::V0)) {
312
690
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
313
690
        return false;
314
690
      }
315
2.31k
    }
316
1.46k
  }
317
2.31k
318
2.31k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX64BOps()) {
319
772
    if (LocVT == MVT::v32i32 ||
320
772
        
LocVT == MVT::v64i16688
||
321
772
        
LocVT == MVT::v128i8678
) {
322
596
      if (unsigned Reg = State.AllocateReg(Hexagon::W0)) {
323
596
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
324
596
        return false;
325
596
      }
326
1.71k
    }
327
772
  }
328
1.71k
329
1.71k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
330
1.53k
    if (LocVT == MVT::v32i32 ||
331
1.53k
        
LocVT == MVT::v64i161.44k
||
332
1.53k
        
LocVT == MVT::v128i81.37k
) {
333
654
      if (unsigned Reg = State.AllocateReg(Hexagon::V0)) {
334
654
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
335
654
        return false;
336
654
      }
337
1.06k
    }
338
1.53k
  }
339
1.06k
340
1.06k
  if (State.getMachineFunction().getSubtarget<HexagonSubtarget>().useHVX128BOps()) {
341
884
    if (LocVT == MVT::v64i32 ||
342
884
        
LocVT == MVT::v128i16874
||
343
884
        
LocVT == MVT::v256i8864
) {
344
844
      if (unsigned Reg = State.AllocateReg(Hexagon::W0)) {
345
844
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
346
844
        return false;
347
844
      }
348
216
    }
349
884
  }
350
216
351
216
  if (!RetCC_Hexagon(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
352
216
    return false;
353
0
354
0
  return true;  // CC didn't match.
355
0
}