Coverage Report

Created: 2018-12-11 17:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/Sparc/SparcGenSubtargetInfo.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Subtarget Enumeration Source Fragment                                      *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
10
#ifdef GET_SUBTARGETINFO_ENUM
11
#undef GET_SUBTARGETINFO_ENUM
12
13
namespace llvm {
14
namespace Sparc {
15
enum {
16
  DetectRoundChange = 0,
17
  FeatureHardQuad = 1,
18
  FeatureLeon = 2,
19
  FeatureNoFMULS = 3,
20
  FeatureNoFSMULD = 4,
21
  FeaturePWRPSR = 5,
22
  FeatureSoftFloat = 6,
23
  FeatureSoftMulDiv = 7,
24
  FeatureV8Deprecated = 8,
25
  FeatureV9 = 9,
26
  FeatureVIS = 10,
27
  FeatureVIS2 = 11,
28
  FeatureVIS3 = 12,
29
  FixAllFDIVSQRT = 13,
30
  InsertNOPLoad = 14,
31
  LeonCASA = 15,
32
  LeonCycleCounter = 16,
33
  UMACSMACSupport = 17,
34
  UsePopc = 18,
35
};
36
} // end namespace Sparc
37
} // end namespace llvm
38
39
#endif // GET_SUBTARGETINFO_ENUM
40
41
42
#ifdef GET_SUBTARGETINFO_MC_DESC
43
#undef GET_SUBTARGETINFO_MC_DESC
44
45
namespace llvm {
46
// Sorted (by key) array of values for CPU features.
47
extern const llvm::SubtargetFeatureKV SparcFeatureKV[] = {
48
  { "deprecated-v8", "Enable deprecated V8 instructions in V9 mode", { Sparc::FeatureV8Deprecated }, { } },
49
  { "detectroundchange", "LEON3 erratum detection: Detects any rounding mode change request: use only the round-to-nearest rounding mode", { Sparc::DetectRoundChange }, { } },
50
  { "fixallfdivsqrt", "LEON erratum fix: Fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store", { Sparc::FixAllFDIVSQRT }, { } },
51
  { "hard-quad-float", "Enable quad-word floating point instructions", { Sparc::FeatureHardQuad }, { } },
52
  { "hasleoncasa", "Enable CASA instruction for LEON3 and LEON4 processors", { Sparc::LeonCASA }, { } },
53
  { "hasumacsmac", "Enable UMAC and SMAC for LEON3 and LEON4 processors", { Sparc::UMACSMACSupport }, { } },
54
  { "insertnopload", "LEON3 erratum fix: Insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction", { Sparc::InsertNOPLoad }, { } },
55
  { "leon", "Enable LEON extensions", { Sparc::FeatureLeon }, { } },
56
  { "leoncyclecounter", "Use the Leon cycle counter register", { Sparc::LeonCycleCounter }, { } },
57
  { "leonpwrpsr", "Enable the PWRPSR instruction", { Sparc::FeaturePWRPSR }, { } },
58
  { "no-fmuls", "Disable the fmuls instruction.", { Sparc::FeatureNoFMULS }, { } },
59
  { "no-fsmuld", "Disable the fsmuld instruction.", { Sparc::FeatureNoFSMULD }, { } },
60
  { "popc", "Use the popc (population count) instruction", { Sparc::UsePopc }, { } },
61
  { "soft-float", "Use software emulation for floating point", { Sparc::FeatureSoftFloat }, { } },
62
  { "soft-mul-div", "Use software emulation for integer multiply and divide", { Sparc::FeatureSoftMulDiv }, { } },
63
  { "v9", "Enable SPARC-V9 instructions", { Sparc::FeatureV9 }, { } },
64
  { "vis", "Enable UltraSPARC Visual Instruction Set extensions", { Sparc::FeatureVIS }, { } },
65
  { "vis2", "Enable Visual Instruction Set extensions II", { Sparc::FeatureVIS2 }, { } },
66
  { "vis3", "Enable Visual Instruction Set extensions III", { Sparc::FeatureVIS3 }, { } },
67
};
68
69
// Sorted (by key) array of values for CPU subtype.
70
extern const llvm::SubtargetFeatureKV SparcSubTypeKV[] = {
71
  { "at697e", "Select the at697e processor", { Sparc::FeatureLeon, Sparc::InsertNOPLoad }, { } },
72
  { "at697f", "Select the at697f processor", { Sparc::FeatureLeon, Sparc::InsertNOPLoad }, { } },
73
  { "f934", "Select the f934 processor", { }, { } },
74
  { "generic", "Select the generic processor", { }, { } },
75
  { "gr712rc", "Select the gr712rc processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
76
  { "gr740", "Select the gr740 processor", { Sparc::FeatureLeon, Sparc::UMACSMACSupport, Sparc::LeonCASA, Sparc::LeonCycleCounter, Sparc::FeaturePWRPSR }, { } },
77
  { "hypersparc", "Select the hypersparc processor", { }, { } },
78
  { "leon2", "Select the leon2 processor", { Sparc::FeatureLeon }, { } },
79
  { "leon3", "Select the leon3 processor", { Sparc::FeatureLeon, Sparc::UMACSMACSupport }, { } },
80
  { "leon4", "Select the leon4 processor", { Sparc::FeatureLeon, Sparc::UMACSMACSupport, Sparc::LeonCASA }, { } },
81
  { "ma2080", "Select the ma2080 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
82
  { "ma2085", "Select the ma2085 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
83
  { "ma2100", "Select the ma2100 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
84
  { "ma2150", "Select the ma2150 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
85
  { "ma2155", "Select the ma2155 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
86
  { "ma2450", "Select the ma2450 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
87
  { "ma2455", "Select the ma2455 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
88
  { "ma2480", "Select the ma2480 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
89
  { "ma2485", "Select the ma2485 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
90
  { "ma2x5x", "Select the ma2x5x processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
91
  { "ma2x8x", "Select the ma2x8x processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
92
  { "myriad2", "Select the myriad2 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
93
  { "myriad2.1", "Select the myriad2.1 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
94
  { "myriad2.2", "Select the myriad2.2 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
95
  { "myriad2.3", "Select the myriad2.3 processor", { Sparc::FeatureLeon, Sparc::LeonCASA }, { } },
96
  { "niagara", "Select the niagara processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::FeatureVIS, Sparc::FeatureVIS2 }, { } },
97
  { "niagara2", "Select the niagara2 processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::UsePopc, Sparc::FeatureVIS, Sparc::FeatureVIS2 }, { } },
98
  { "niagara3", "Select the niagara3 processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::UsePopc, Sparc::FeatureVIS, Sparc::FeatureVIS2 }, { } },
99
  { "niagara4", "Select the niagara4 processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::UsePopc, Sparc::FeatureVIS, Sparc::FeatureVIS2, Sparc::FeatureVIS3 }, { } },
100
  { "sparclet", "Select the sparclet processor", { }, { } },
101
  { "sparclite", "Select the sparclite processor", { }, { } },
102
  { "sparclite86x", "Select the sparclite86x processor", { }, { } },
103
  { "supersparc", "Select the supersparc processor", { }, { } },
104
  { "tsc701", "Select the tsc701 processor", { }, { } },
105
  { "ultrasparc", "Select the ultrasparc processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::FeatureVIS }, { } },
106
  { "ultrasparc3", "Select the ultrasparc3 processor", { Sparc::FeatureV9, Sparc::FeatureV8Deprecated, Sparc::FeatureVIS, Sparc::FeatureVIS2 }, { } },
107
  { "ut699", "Select the ut699 processor", { Sparc::FeatureLeon, Sparc::InsertNOPLoad, Sparc::FeatureNoFSMULD, Sparc::FeatureNoFMULS, Sparc::FixAllFDIVSQRT }, { } },
108
  { "v7", "Select the v7 processor", { Sparc::FeatureSoftMulDiv, Sparc::FeatureNoFSMULD }, { } },
109
  { "v8", "Select the v8 processor", { }, { } },
110
  { "v9", "Select the v9 processor", { Sparc::FeatureV9 }, { } },
111
};
112
113
#ifdef DBGFIELD
114
#error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
115
#endif
116
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
117
#define DBGFIELD(x) x,
118
#else
119
#define DBGFIELD(x)
120
#endif
121
122
// Functional units for "LEON2Itineraries"
123
namespace LEON2ItinerariesFU {
124
  const unsigned LEONIU = 1 << 0;
125
  const unsigned LEONFPU = 1 << 1;
126
} // end namespace LEON2ItinerariesFU
127
128
// Functional units for "LEON3Itineraries"
129
namespace LEON3ItinerariesFU {
130
  const unsigned LEONIU = 1 << 0;
131
  const unsigned LEONFPU = 1 << 1;
132
} // end namespace LEON3ItinerariesFU
133
134
// Functional units for "LEON4Itineraries"
135
namespace LEON4ItinerariesFU {
136
  const unsigned LEONIU = 1 << 0;
137
  const unsigned LEONFPU = 1 << 1;
138
} // end namespace LEON4ItinerariesFU
139
140
extern const llvm::InstrStage SparcStages[] = {
141
  { 0, 0, 0, llvm::InstrStage::Required }, // No itinerary
142
  { 1, LEON2ItinerariesFU::LEONIU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 1
143
  { 1, LEON2ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 2
144
  { 1, LEON2ItinerariesFU::LEONIU | LEON2ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 3
145
  { 1, LEON3ItinerariesFU::LEONIU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 4
146
  { 1, LEON3ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 5
147
  { 1, LEON3ItinerariesFU::LEONIU | LEON3ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 6
148
  { 1, LEON4ItinerariesFU::LEONIU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 7
149
  { 1, LEON4ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 8
150
  { 1, LEON4ItinerariesFU::LEONIU | LEON4ItinerariesFU::LEONFPU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 9
151
  { 0, 0, 0, llvm::InstrStage::Required } // End stages
152
};
153
extern const unsigned SparcOperandCycles[] = {
154
  0, // No itinerary
155
  1,   1, // 1-2
156
  7,   1, // 3-4
157
  2,   1, // 5-6
158
  2,   1, // 7-8
159
  7,   1, // 9-10
160
  36,   1, // 11-12
161
  20,   1, // 13-14
162
  21,   1, // 15-16
163
  16,   1, // 17-18
164
  2,   1, // 19-20
165
  65,   1, // 21-22
166
  37,   1, // 23-24
167
  2,   1, // 25-26
168
  2,   1, // 27-28
169
  1,   1, // 29-30
170
  35,   1, // 31-32
171
  5,   1, // 33-34
172
  2,   1, // 35-36
173
  3,   1, // 37-38
174
  5,   1, // 39-40
175
  1,   1, // 41-42
176
  7,   1, // 43-44
177
  3,   1, // 45-46
178
  2,   1, // 47-48
179
  4,   1, // 49-50
180
  17,   1, // 51-52
181
  16,   1, // 53-54
182
  4,   1, // 55-56
183
  4,   1, // 57-58
184
  2,   1, // 59-60
185
  25,   1, // 61-62
186
  24,   1, // 63-64
187
  4,   1, // 65-66
188
  2,   1, // 67-68
189
  1,   1, // 69-70
190
  35,   1, // 71-72
191
  2,   1, // 73-74
192
  1,   1, // 75-76
193
  4,   1, // 77-78
194
  5,   1, // 79-80
195
  4,   1, // 81-82
196
  1,   1, // 83-84
197
  7,   1, // 85-86
198
  3,   1, // 87-88
199
  2,   1, // 89-90
200
  4,   1, // 91-92
201
  17,   1, // 93-94
202
  16,   1, // 95-96
203
  4,   1, // 97-98
204
  4,   1, // 99-100
205
  2,   1, // 101-102
206
  25,   1, // 103-104
207
  24,   1, // 105-106
208
  4,   1, // 107-108
209
  1,   1, // 109-110
210
  1,   1, // 111-112
211
  35,   1, // 113-114
212
  2,   1, // 115-116
213
  1,   1, // 117-118
214
  1,   1, // 119-120
215
  1,   1, // 121-122
216
  4,   1, // 123-124
217
  0 // End operand cycles
218
};
219
extern const unsigned SparcForwardingPaths[] = {
220
 0, // No itinerary
221
 0,  0, // 1-2
222
 0,  0, // 3-4
223
 0,  0, // 5-6
224
 0,  0, // 7-8
225
 0,  0, // 9-10
226
 0,  0, // 11-12
227
 0,  0, // 13-14
228
 0,  0, // 15-16
229
 0,  0, // 17-18
230
 0,  0, // 19-20
231
 0,  0, // 21-22
232
 0,  0, // 23-24
233
 0,  0, // 25-26
234
 0,  0, // 27-28
235
 0,  0, // 29-30
236
 0,  0, // 31-32
237
 0,  0, // 33-34
238
 0,  0, // 35-36
239
 0,  0, // 37-38
240
 0,  0, // 39-40
241
 0,  0, // 41-42
242
 0,  0, // 43-44
243
 0,  0, // 45-46
244
 0,  0, // 47-48
245
 0,  0, // 49-50
246
 0,  0, // 51-52
247
 0,  0, // 53-54
248
 0,  0, // 55-56
249
 0,  0, // 57-58
250
 0,  0, // 59-60
251
 0,  0, // 61-62
252
 0,  0, // 63-64
253
 0,  0, // 65-66
254
 0,  0, // 67-68
255
 0,  0, // 69-70
256
 0,  0, // 71-72
257
 0,  0, // 73-74
258
 0,  0, // 75-76
259
 0,  0, // 77-78
260
 0,  0, // 79-80
261
 0,  0, // 81-82
262
 0,  0, // 83-84
263
 0,  0, // 85-86
264
 0,  0, // 87-88
265
 0,  0, // 89-90
266
 0,  0, // 91-92
267
 0,  0, // 93-94
268
 0,  0, // 95-96
269
 0,  0, // 97-98
270
 0,  0, // 99-100
271
 0,  0, // 101-102
272
 0,  0, // 103-104
273
 0,  0, // 105-106
274
 0,  0, // 107-108
275
 0,  0, // 109-110
276
 0,  0, // 111-112
277
 0,  0, // 113-114
278
 0,  0, // 115-116
279
 0,  0, // 117-118
280
 0,  0, // 119-120
281
 0,  0, // 121-122
282
 0,  0, // 123-124
283
 0 // End bypass tables
284
};
285
286
static const llvm::InstrItinerary LEON2Itineraries[] = {
287
  { 0, 0, 0, 0, 0 }, // 0 NoInstrModel
288
  { 1, 1, 2, 1, 3 }, // 1 IIC_iu_instr
289
  { 1, 2, 3, 3, 5 }, // 2 IIC_fpu_normal_instr
290
  { 1, 3, 4, 5, 7 }, // 3 IIC_jmp_or_call
291
  { 1, 2, 3, 7, 9 }, // 4 IIC_fpu_abs
292
  { 1, 2, 3, 9, 11 }, // 5 IIC_fpu_fast_instr
293
  { 1, 2, 3, 11, 13 }, // 6 IIC_fpu_divd
294
  { 1, 2, 3, 13, 15 }, // 7 IIC_fpu_divs
295
  { 1, 2, 3, 15, 17 }, // 8 IIC_fpu_muld
296
  { 1, 2, 3, 17, 19 }, // 9 IIC_fpu_muls
297
  { 1, 2, 3, 19, 21 }, // 10 IIC_fpu_negs
298
  { 1, 2, 3, 21, 23 }, // 11 IIC_fpu_sqrtd
299
  { 1, 2, 3, 23, 25 }, // 12 IIC_fpu_sqrts
300
  { 1, 2, 3, 25, 27 }, // 13 IIC_fpu_stod
301
  { 1, 3, 4, 27, 29 }, // 14 IIC_ldd
302
  { 1, 3, 4, 29, 31 }, // 15 IIC_iu_or_fpu_instr
303
  { 1, 1, 2, 31, 33 }, // 16 IIC_iu_div
304
  { 0, 0, 0, 0, 0 }, // 17 IIC_smac_umac
305
  { 1, 1, 2, 33, 35 }, // 18 IIC_iu_smul
306
  { 1, 3, 4, 35, 37 }, // 19 IIC_st
307
  { 1, 3, 4, 37, 39 }, // 20 IIC_std
308
  { 1, 1, 2, 39, 41 }, // 21 IIC_iu_umul
309
  { 0, uint16_t(~0U), uint16_t(~0U), uint16_t(~0U), uint16_t(~0U) }// end marker
310
};
311
312
static const llvm::InstrItinerary LEON3Itineraries[] = {
313
  { 0, 0, 0, 0, 0 }, // 0 NoInstrModel
314
  { 1, 4, 5, 41, 43 }, // 1 IIC_iu_instr
315
  { 1, 5, 6, 43, 45 }, // 2 IIC_fpu_normal_instr
316
  { 1, 6, 7, 45, 47 }, // 3 IIC_jmp_or_call
317
  { 1, 5, 6, 47, 49 }, // 4 IIC_fpu_abs
318
  { 1, 5, 6, 49, 51 }, // 5 IIC_fpu_fast_instr
319
  { 1, 5, 6, 51, 53 }, // 6 IIC_fpu_divd
320
  { 1, 5, 6, 53, 55 }, // 7 IIC_fpu_divs
321
  { 1, 5, 6, 55, 57 }, // 8 IIC_fpu_muld
322
  { 1, 5, 6, 57, 59 }, // 9 IIC_fpu_muls
323
  { 1, 5, 6, 59, 61 }, // 10 IIC_fpu_negs
324
  { 1, 5, 6, 61, 63 }, // 11 IIC_fpu_sqrtd
325
  { 1, 5, 6, 63, 65 }, // 12 IIC_fpu_sqrts
326
  { 1, 5, 6, 65, 67 }, // 13 IIC_fpu_stod
327
  { 1, 6, 7, 67, 69 }, // 14 IIC_ldd
328
  { 1, 6, 7, 69, 71 }, // 15 IIC_iu_or_fpu_instr
329
  { 1, 4, 5, 71, 73 }, // 16 IIC_iu_div
330
  { 1, 4, 5, 73, 75 }, // 17 IIC_smac_umac
331
  { 1, 4, 5, 75, 77 }, // 18 IIC_iu_smul
332
  { 1, 6, 7, 77, 79 }, // 19 IIC_st
333
  { 1, 6, 7, 79, 81 }, // 20 IIC_std
334
  { 1, 4, 5, 81, 83 }, // 21 IIC_iu_umul
335
  { 0, uint16_t(~0U), uint16_t(~0U), uint16_t(~0U), uint16_t(~0U) }// end marker
336
};
337
338
static const llvm::InstrItinerary LEON4Itineraries[] = {
339
  { 0, 0, 0, 0, 0 }, // 0 NoInstrModel
340
  { 1, 7, 8, 83, 85 }, // 1 IIC_iu_instr
341
  { 1, 8, 9, 85, 87 }, // 2 IIC_fpu_normal_instr
342
  { 1, 9, 10, 87, 89 }, // 3 IIC_jmp_or_call
343
  { 1, 8, 9, 89, 91 }, // 4 IIC_fpu_abs
344
  { 1, 8, 9, 91, 93 }, // 5 IIC_fpu_fast_instr
345
  { 1, 8, 9, 93, 95 }, // 6 IIC_fpu_divd
346
  { 1, 8, 9, 95, 97 }, // 7 IIC_fpu_divs
347
  { 1, 8, 9, 97, 99 }, // 8 IIC_fpu_muld
348
  { 1, 8, 9, 99, 101 }, // 9 IIC_fpu_muls
349
  { 1, 8, 9, 101, 103 }, // 10 IIC_fpu_negs
350
  { 1, 8, 9, 103, 105 }, // 11 IIC_fpu_sqrtd
351
  { 1, 8, 9, 105, 107 }, // 12 IIC_fpu_sqrts
352
  { 1, 8, 9, 107, 109 }, // 13 IIC_fpu_stod
353
  { 1, 9, 10, 109, 111 }, // 14 IIC_ldd
354
  { 1, 9, 10, 111, 113 }, // 15 IIC_iu_or_fpu_instr
355
  { 1, 7, 8, 113, 115 }, // 16 IIC_iu_div
356
  { 1, 7, 8, 115, 117 }, // 17 IIC_smac_umac
357
  { 1, 7, 8, 117, 119 }, // 18 IIC_iu_smul
358
  { 1, 9, 10, 119, 121 }, // 19 IIC_st
359
  { 1, 9, 10, 121, 123 }, // 20 IIC_std
360
  { 1, 7, 8, 123, 125 }, // 21 IIC_iu_umul
361
  { 0, uint16_t(~0U), uint16_t(~0U), uint16_t(~0U), uint16_t(~0U) }// end marker
362
};
363
364
// ===============================================================
365
// Data tables for the new per-operand machine model.
366
367
// {ProcResourceIdx, Cycles}
368
extern const llvm::MCWriteProcResEntry SparcWriteProcResTable[] = {
369
  { 0,  0}, // Invalid
370
}; // SparcWriteProcResTable
371
372
// {Cycles, WriteResourceID}
373
extern const llvm::MCWriteLatencyEntry SparcWriteLatencyTable[] = {
374
  { 0,  0}, // Invalid
375
}; // SparcWriteLatencyTable
376
377
// {UseIdx, WriteResourceID, Cycles}
378
extern const llvm::MCReadAdvanceEntry SparcReadAdvanceTable[] = {
379
  {0,  0,  0}, // Invalid
380
}; // SparcReadAdvanceTable
381
382
static const llvm::MCSchedModel NoSchedModel = {
383
  MCSchedModel::DefaultIssueWidth,
384
  MCSchedModel::DefaultMicroOpBufferSize,
385
  MCSchedModel::DefaultLoopMicroOpBufferSize,
386
  MCSchedModel::DefaultLoadLatency,
387
  MCSchedModel::DefaultHighLatency,
388
  MCSchedModel::DefaultMispredictPenalty,
389
  false, // PostRAScheduler
390
  false, // CompleteModel
391
  0, // Processor ID
392
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
393
  nullptr, // No Itinerary
394
  nullptr // No extra processor descriptor
395
};
396
397
static const llvm::MCSchedModel LEON2ItinerariesModel = {
398
  MCSchedModel::DefaultIssueWidth,
399
  MCSchedModel::DefaultMicroOpBufferSize,
400
  MCSchedModel::DefaultLoopMicroOpBufferSize,
401
  MCSchedModel::DefaultLoadLatency,
402
  MCSchedModel::DefaultHighLatency,
403
  MCSchedModel::DefaultMispredictPenalty,
404
  false, // PostRAScheduler
405
  false, // CompleteModel
406
  1, // Processor ID
407
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
408
  LEON2Itineraries,
409
  nullptr // No extra processor descriptor
410
};
411
412
static const llvm::MCSchedModel LEON3ItinerariesModel = {
413
  MCSchedModel::DefaultIssueWidth,
414
  MCSchedModel::DefaultMicroOpBufferSize,
415
  MCSchedModel::DefaultLoopMicroOpBufferSize,
416
  MCSchedModel::DefaultLoadLatency,
417
  MCSchedModel::DefaultHighLatency,
418
  MCSchedModel::DefaultMispredictPenalty,
419
  false, // PostRAScheduler
420
  false, // CompleteModel
421
  2, // Processor ID
422
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
423
  LEON3Itineraries,
424
  nullptr // No extra processor descriptor
425
};
426
427
static const llvm::MCSchedModel LEON4ItinerariesModel = {
428
  MCSchedModel::DefaultIssueWidth,
429
  MCSchedModel::DefaultMicroOpBufferSize,
430
  MCSchedModel::DefaultLoopMicroOpBufferSize,
431
  MCSchedModel::DefaultLoadLatency,
432
  MCSchedModel::DefaultHighLatency,
433
  MCSchedModel::DefaultMispredictPenalty,
434
  false, // PostRAScheduler
435
  false, // CompleteModel
436
  3, // Processor ID
437
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
438
  LEON4Itineraries,
439
  nullptr // No extra processor descriptor
440
};
441
442
// Sorted (by key) array of sched model for CPU subtype.
443
extern const llvm::SubtargetInfoKV SparcProcSchedKV[] = {
444
  { "at697e", (const void *)&LEON2ItinerariesModel },
445
  { "at697f", (const void *)&LEON2ItinerariesModel },
446
  { "f934", (const void *)&NoSchedModel },
447
  { "generic", (const void *)&NoSchedModel },
448
  { "gr712rc", (const void *)&LEON3ItinerariesModel },
449
  { "gr740", (const void *)&LEON4ItinerariesModel },
450
  { "hypersparc", (const void *)&NoSchedModel },
451
  { "leon2", (const void *)&LEON2ItinerariesModel },
452
  { "leon3", (const void *)&LEON3ItinerariesModel },
453
  { "leon4", (const void *)&LEON4ItinerariesModel },
454
  { "ma2080", (const void *)&NoSchedModel },
455
  { "ma2085", (const void *)&NoSchedModel },
456
  { "ma2100", (const void *)&NoSchedModel },
457
  { "ma2150", (const void *)&NoSchedModel },
458
  { "ma2155", (const void *)&NoSchedModel },
459
  { "ma2450", (const void *)&NoSchedModel },
460
  { "ma2455", (const void *)&NoSchedModel },
461
  { "ma2480", (const void *)&NoSchedModel },
462
  { "ma2485", (const void *)&NoSchedModel },
463
  { "ma2x5x", (const void *)&NoSchedModel },
464
  { "ma2x8x", (const void *)&NoSchedModel },
465
  { "myriad2", (const void *)&NoSchedModel },
466
  { "myriad2.1", (const void *)&NoSchedModel },
467
  { "myriad2.2", (const void *)&NoSchedModel },
468
  { "myriad2.3", (const void *)&NoSchedModel },
469
  { "niagara", (const void *)&NoSchedModel },
470
  { "niagara2", (const void *)&NoSchedModel },
471
  { "niagara3", (const void *)&NoSchedModel },
472
  { "niagara4", (const void *)&NoSchedModel },
473
  { "sparclet", (const void *)&NoSchedModel },
474
  { "sparclite", (const void *)&NoSchedModel },
475
  { "sparclite86x", (const void *)&NoSchedModel },
476
  { "supersparc", (const void *)&NoSchedModel },
477
  { "tsc701", (const void *)&NoSchedModel },
478
  { "ultrasparc", (const void *)&NoSchedModel },
479
  { "ultrasparc3", (const void *)&NoSchedModel },
480
  { "ut699", (const void *)&LEON3ItinerariesModel },
481
  { "v7", (const void *)&NoSchedModel },
482
  { "v8", (const void *)&NoSchedModel },
483
  { "v9", (const void *)&NoSchedModel },
484
};
485
486
#undef DBGFIELD
487
namespace Sparc_MC {
488
unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
489
0
    const MCInst *MI, unsigned CPUID) {
490
0
  // Don't know how to resolve this scheduling class.
491
0
  return 0;
492
0
}
493
} // end of namespace Sparc_MC
494
495
struct SparcGenMCSubtargetInfo : public MCSubtargetInfo {
496
  SparcGenMCSubtargetInfo(const Triple &TT, 
497
    StringRef CPU, StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
498
    ArrayRef<SubtargetFeatureKV> PD,
499
    const SubtargetInfoKV *ProcSched,
500
    const MCWriteProcResEntry *WPR,
501
    const MCWriteLatencyEntry *WL,
502
    const MCReadAdvanceEntry *RA, const InstrStage *IS,
503
    const unsigned *OC, const unsigned *FP) :
504
      MCSubtargetInfo(TT, CPU, FS, PF, PD, ProcSched,
505
293
                      WPR, WL, RA, IS, OC, FP) { }
506
507
  unsigned resolveVariantSchedClass(unsigned SchedClass,
508
0
      const MCInst *MI, unsigned CPUID) const override {
509
0
    return Sparc_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID); 
510
0
  }
511
};
512
513
293
static inline MCSubtargetInfo *createSparcMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
514
293
  return new SparcGenMCSubtargetInfo(TT, CPU, FS, SparcFeatureKV, SparcSubTypeKV, 
515
293
                      SparcProcSchedKV, SparcWriteProcResTable, SparcWriteLatencyTable, SparcReadAdvanceTable, 
516
293
                      SparcStages, SparcOperandCycles, SparcForwardingPaths);
517
293
}
518
519
} // end namespace llvm
520
521
#endif // GET_SUBTARGETINFO_MC_DESC
522
523
524
#ifdef GET_SUBTARGETINFO_TARGET_DESC
525
#undef GET_SUBTARGETINFO_TARGET_DESC
526
527
#include "llvm/Support/Debug.h"
528
#include "llvm/Support/raw_ostream.h"
529
530
// ParseSubtargetFeatures - Parses features string setting specified
531
// subtarget options.
532
419
void llvm::SparcSubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
533
419
  LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
534
419
  LLVM_DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
535
419
  InitMCProcessorInfo(CPU, FS);
536
419
  const FeatureBitset& Bits = getFeatureBits();
537
419
  if (Bits[Sparc::DetectRoundChange]) 
DetectRoundChange = true2
;
538
419
  if (Bits[Sparc::FeatureHardQuad]) 
HasHardQuad = true4
;
539
419
  if (Bits[Sparc::FeatureLeon]) 
IsLeon = true62
;
540
419
  if (Bits[Sparc::FeatureNoFMULS]) 
HasNoFMULS = true8
;
541
419
  if (Bits[Sparc::FeatureNoFSMULD]) 
HasNoFSMULD = true10
;
542
419
  if (Bits[Sparc::FeaturePWRPSR]) 
HasPWRPSR = true4
;
543
419
  if (Bits[Sparc::FeatureSoftFloat]) 
UseSoftFloat = true7
;
544
419
  if (Bits[Sparc::FeatureSoftMulDiv]) 
UseSoftMulDiv = true2
;
545
419
  if (Bits[Sparc::FeatureV8Deprecated]) 
V8DeprecatedInsts = true12
;
546
419
  if (Bits[Sparc::FeatureV9]) 
IsV9 = true151
;
547
419
  if (Bits[Sparc::FeatureVIS]) 
IsVIS = true12
;
548
419
  if (Bits[Sparc::FeatureVIS2]) 
IsVIS2 = true10
;
549
419
  if (Bits[Sparc::FeatureVIS3]) 
IsVIS3 = true2
;
550
419
  if (Bits[Sparc::FixAllFDIVSQRT]) 
FixAllFDIVSQRT = true6
;
551
419
  if (Bits[Sparc::InsertNOPLoad]) 
InsertNOPLoad = true6
;
552
419
  if (Bits[Sparc::LeonCASA]) 
HasLeonCasa = true44
;
553
419
  if (Bits[Sparc::LeonCycleCounter]) 
HasLeonCycleCounter = true4
;
554
419
  if (Bits[Sparc::UMACSMACSupport]) 
HasUmacSmac = true22
;
555
419
  if (Bits[Sparc::UsePopc]) 
UsePopc = true14
;
556
419
}
557
#endif // GET_SUBTARGETINFO_TARGET_DESC
558
559
560
#ifdef GET_SUBTARGETINFO_HEADER
561
#undef GET_SUBTARGETINFO_HEADER
562
563
namespace llvm {
564
class DFAPacketizer;
565
namespace Sparc_MC {
566
unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, unsigned CPUID);
567
}
568
569
struct SparcGenSubtargetInfo : public TargetSubtargetInfo {
570
  explicit SparcGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
571
public:
572
  unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
573
  unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const override;
574
  DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
575
};
576
} // end namespace llvm
577
578
#endif // GET_SUBTARGETINFO_HEADER
579
580
581
#ifdef GET_SUBTARGETINFO_CTOR
582
#undef GET_SUBTARGETINFO_CTOR
583
584
#include "llvm/CodeGen/TargetSchedule.h"
585
586
namespace llvm {
587
extern const llvm::SubtargetFeatureKV SparcFeatureKV[];
588
extern const llvm::SubtargetFeatureKV SparcSubTypeKV[];
589
extern const llvm::SubtargetInfoKV SparcProcSchedKV[];
590
extern const llvm::MCWriteProcResEntry SparcWriteProcResTable[];
591
extern const llvm::MCWriteLatencyEntry SparcWriteLatencyTable[];
592
extern const llvm::MCReadAdvanceEntry SparcReadAdvanceTable[];
593
extern const llvm::InstrStage SparcStages[];
594
extern const unsigned SparcOperandCycles[];
595
extern const unsigned SparcForwardingPaths[];
596
SparcGenSubtargetInfo::SparcGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
597
  : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(SparcFeatureKV, 19), makeArrayRef(SparcSubTypeKV, 40), 
598
                        SparcProcSchedKV, SparcWriteProcResTable, SparcWriteLatencyTable, SparcReadAdvanceTable, 
599
419
                        SparcStages, SparcOperandCycles, SparcForwardingPaths) {}
600
601
unsigned SparcGenSubtargetInfo
602
0
::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
603
0
  report_fatal_error("Expected a variant SchedClass");
604
0
} // SparcGenSubtargetInfo::resolveSchedClass
605
606
unsigned SparcGenSubtargetInfo
607
0
::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const {
608
0
  return Sparc_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID);
609
0
} // SparcGenSubtargetInfo::resolveVariantSchedClass
610
611
} // end namespace llvm
612
613
#endif // GET_SUBTARGETINFO_CTOR
614
615
616
#ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
617
#undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
618
619
#endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
620
621
622
#ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
623
#undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
624
625
#endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
626