Coverage Report

Created: 2018-09-25 00:18

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