1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Subtarget Enumeration Source Fragment *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9#ifdef GET_SUBTARGETINFO_ENUM
10#undef GET_SUBTARGETINFO_ENUM
11
12namespace llvm {
13
14namespace MSP430 {
15
16enum {
17 FeatureHWMult16 = 0,
18 FeatureHWMult32 = 1,
19 FeatureHWMultF5 = 2,
20 FeatureX = 3,
21 NumSubtargetFeatures = 4
22};
23
24} // namespace MSP430
25
26} // namespace llvm
27
28#endif // GET_SUBTARGETINFO_ENUM
29
30#ifdef GET_SUBTARGETINFO_MACRO
31
32GET_SUBTARGETINFO_MACRO(ExtendedInsts, false, extendedInsts)
33
34#undef GET_SUBTARGETINFO_MACRO
35#endif // GET_SUBTARGETINFO_MACRO
36
37#ifdef GET_SUBTARGETINFO_MC_DESC
38#undef GET_SUBTARGETINFO_MC_DESC
39
40namespace llvm {
41
42// Sorted (by key) array of values for CPU features.
43extern const llvm::SubtargetFeatureKVStorage< 4, 165> MSP430FeatureKVStorage = {
44 {
45 { sizeof(SubtargetFeatureKV) * 4 + 1, sizeof(SubtargetFeatureKV) * 4 + 5, MSP430::FeatureX, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
46 { sizeof(SubtargetFeatureKV) * 3 + 32, sizeof(SubtargetFeatureKV) * 3 + 41, MSP430::FeatureHWMult16, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
47 { sizeof(SubtargetFeatureKV) * 2 + 75, sizeof(SubtargetFeatureKV) * 2 + 84, MSP430::FeatureHWMult32, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
48 { sizeof(SubtargetFeatureKV) * 1 + 118, sizeof(SubtargetFeatureKV) * 1 + 127, MSP430::FeatureHWMultF5, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
49 },
50 "\000ext\000Enable MSP430-X extensions\000hwmult16\000Enable 16-bit hard"
51 "ware multiplier\000hwmult32\000Enable 32-bit hardware multiplier\000hwm"
52 "ultf5\000Enable F5 series hardware multiplier\000"};
53
54#ifdef DBGFIELD
55#error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
56#endif
57#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
58#define DBGFIELD(x) x,
59#define DBGVAL_OR_NULLPTR(x) x
60#else
61#define DBGFIELD(x)
62#define DBGVAL_OR_NULLPTR(x) nullptr
63#endif
64
65// ===============================================================
66// Data tables for the new per-operand machine model.
67
68static_assert(0 <= UINT8_MAX, "NumWriteProcResEntries does not fit in uint8_t");
69static_assert(0 <= UINT8_MAX, "NumWriteLatencyEntries does not fit in uint8_t");
70
71// {ProcResourceIdx, ReleaseAtCycle, AcquireAtCycle}
72extern const llvm::MCWriteProcResEntry MSP430WriteProcResTable[] = {
73 { 0, 0, 0 }, // Invalid
74}; // MSP430WriteProcResTable
75
76// {Cycles, WriteResourceID}
77extern const llvm::MCWriteLatencyEntry MSP430WriteLatencyTable[] = {
78 { 0, 0}, // Invalid
79}; // MSP430WriteLatencyTable
80
81// {UseIdx, WriteResourceID, Cycles}
82extern const llvm::MCReadAdvanceEntry MSP430ReadAdvanceTable[] = {
83 {0, 0, 0}, // Invalid
84}; // MSP430ReadAdvanceTable
85
86#ifdef __GNUC__
87#pragma GCC diagnostic push
88#pragma GCC diagnostic ignored "-Woverlength-strings"
89#endif
90static constexpr char MSP430SchedClassNamesStorage[] =
91 "\0"
92 "InvalidSchedClass\0"
93 ;
94#ifdef __GNUC__
95#pragma GCC diagnostic pop
96#endif
97
98static constexpr llvm::StringTable
99MSP430SchedClassNames = MSP430SchedClassNamesStorage;
100
101extern const llvm::MCSchedModel MSP430SchedModels[] = {
102{ // NoSchedModel
103 MCSchedModel::DefaultIssueWidth,
104 MCSchedModel::DefaultMicroOpBufferSize,
105 MCSchedModel::DefaultLoopMicroOpBufferSize,
106 MCSchedModel::DefaultLoadLatency,
107 MCSchedModel::DefaultHighLatency,
108 MCSchedModel::DefaultMispredictPenalty,
109 false, // PostRAScheduler
110 false, // CompleteModel
111 false, // EnableIntervals
112 0, // Processor ID
113 nullptr, nullptr, 0, 0, // No instruction-level machine model.
114 DBGVAL_OR_NULLPTR(&MSP430SchedClassNames), // SchedClassNames
115 nullptr, // No Itinerary
116 nullptr // No extra processor descriptor
117 },
118};
119
120#undef DBGFIELD
121
122#undef DBGVAL_OR_NULLPTR
123
124static constexpr size_t MSP430CPUAliasArraySize = sizeof(std::array<SubtargetSubTypeAliasKV, 0>);
125// Sorted (by key) array of values for CPU subtype.
126extern const llvm::SubtargetSubTypeKVStorage< 3, 0, 25> MSP430SubTypeKVStorage = {
127 {
128 { sizeof(SubtargetSubTypeKV) * 3 + MSP430CPUAliasArraySize + 1, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
129 { sizeof(SubtargetSubTypeKV) * 2 + MSP430CPUAliasArraySize + 9, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
130 { sizeof(SubtargetSubTypeKV) * 1 + MSP430CPUAliasArraySize + 16, { { { 0x8ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
131 },
132 { {
133 } },
134 "\000generic\000msp430\000msp430x\000"};
135
136namespace MSP430_MC {
137
138unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
139 const MCInst *MI, const MCInstrInfo *MCII, const MCSubtargetInfo &STI, unsigned CPUID) {
140 // Don't know how to resolve this scheduling class.
141 return 0;
142}
143ArrayRef<unsigned> getVariantSchedClassTargets(unsigned SchedClass,
144 unsigned CPUID) {
145 return {};
146}
147
148} // namespace MSP430_MC
149struct MSP430GenMCSubtargetInfo : public MCSubtargetInfo {
150 MSP430GenMCSubtargetInfo(const Triple &TT,
151 StringRef CPU, StringRef TuneCPU, StringRef FS,
152 StringTable PN,
153 ArrayRef<SubtargetFeatureKV> PF,
154 ArrayRef<SubtargetSubTypeKV> PD,
155 ArrayRef<SubtargetSubTypeAliasKV> PA,
156 const MCSchedModel *PSM,
157 const MCWriteProcResEntry *WPR,
158 const MCWriteLatencyEntry *WL,
159 const MCReadAdvanceEntry *RA, const InstrStage *IS,
160 const unsigned *OC, const unsigned *FP) :
161 MCSubtargetInfo(TT, CPU, TuneCPU, FS, PN, PF, PD, PA, PSM,
162 WPR, WL, RA, IS, OC, FP) { }
163
164 explicit MSP430GenMCSubtargetInfo(const MCSubtargetInfo &STI)
165 : MCSubtargetInfo(STI) {}
166
167 std::unique_ptr<MCSubtargetInfo> clone() const final {
168 return std::make_unique<MSP430GenMCSubtargetInfo>(*this);
169 }
170
171 unsigned resolveVariantSchedClass(unsigned SchedClass,
172 const MCInst *MI, const MCInstrInfo *MCII,
173 unsigned CPUID) const final {
174 return MSP430_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, *this, CPUID);
175 }
176};
177namespace MSP430_MC {
178
179std::unique_ptr<MCSubtargetInfo> cloneSubtargetInfo(const MCSubtargetInfo &STI) {
180 return std::make_unique<MSP430GenMCSubtargetInfo>(STI);
181}
182
183} // namespace MSP430_MC
184
185static inline MCSubtargetInfo *createMSP430MCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS) {
186 return new MSP430GenMCSubtargetInfo(TT, CPU, TuneCPU, FS, StringTable(MSP430SubTypeKVStorage.Strings), MSP430FeatureKVStorage.Features, MSP430SubTypeKVStorage.SubTypes, ArrayRef(MSP430SubTypeKVStorage.Aliases).take_front(0), MSP430SchedModels,
187 MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable,
188 nullptr, nullptr, nullptr);
189}
190
191
192} // namespace llvm
193
194#endif // GET_SUBTARGETINFO_MC_DESC
195
196#ifdef GET_SUBTARGETINFO_TARGET_DESC
197#undef GET_SUBTARGETINFO_TARGET_DESC
198
199#include "llvm/ADT/BitmaskEnum.h"
200#include "llvm/Support/Debug.h"
201#include "llvm/Support/raw_ostream.h"
202
203// ParseSubtargetFeatures - Parses features string setting specified
204// subtarget options.
205void llvm::MSP430Subtarget::ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS) {
206 LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
207 LLVM_DEBUG(dbgs() << "\nCPU:" << CPU);
208 LLVM_DEBUG(dbgs() << "\nTuneCPU:" << TuneCPU << "\n\n");
209 InitMCProcessorInfo(CPU, TuneCPU, FS);
210 const FeatureBitset &Bits = getFeatureBits();
211 if (Bits[MSP430::FeatureHWMult16] && HWMultMode < MSP430::HWMult::HW16) HWMultMode = MSP430::HWMult::HW16;
212 if (Bits[MSP430::FeatureHWMult32] && HWMultMode < MSP430::HWMult::HW32) HWMultMode = MSP430::HWMult::HW32;
213 if (Bits[MSP430::FeatureHWMultF5] && HWMultMode < MSP430::HWMult::F5) HWMultMode = MSP430::HWMult::F5;
214 if (Bits[MSP430::FeatureX]) ExtendedInsts = true;
215}
216
217#endif // GET_SUBTARGETINFO_TARGET_DESC
218
219#ifdef GET_SUBTARGETINFO_HEADER
220#undef GET_SUBTARGETINFO_HEADER
221
222namespace llvm {
223
224class DFAPacketizer;
225namespace MSP430_MC {
226
227unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, const MCSubtargetInfo &STI, unsigned CPUID);
228std::unique_ptr<MCSubtargetInfo> cloneSubtargetInfo(const MCSubtargetInfo &STI);
229ArrayRef<unsigned> getVariantSchedClassTargets(unsigned SchedClass, unsigned CPUID);
230
231} // namespace MSP430_MC
232struct MSP430GenSubtargetInfo : public TargetSubtargetInfo {
233 explicit MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS);
234public:
235 std::unique_ptr<MCSubtargetInfo> clone() const final;
236 unsigned resolveSchedClass(unsigned SchedClass, const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const final;
237 unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const final;
238 DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
239 const FeatureBitset &getInlineIgnoreFeatures() const override;
240 const FeatureBitset &getInlineInverseFeatures() const override;
241 const FeatureBitset &getInlineMustMatchFeatures() const override;
242};
243
244} // namespace llvm
245
246#endif // GET_SUBTARGETINFO_HEADER
247
248#ifdef GET_SUBTARGETINFO_CTOR
249#undef GET_SUBTARGETINFO_CTOR
250
251#include "llvm/CodeGen/TargetSchedule.h"
252
253namespace llvm {
254
255extern const llvm::StringRef MSP430Names[];
256extern const llvm::SubtargetFeatureKVStorage<4, 165> MSP430FeatureKVStorage;
257extern const llvm::SubtargetSubTypeKVStorage<3, 0, 25> MSP430SubTypeKVStorage;
258extern const llvm::MCSchedModel MSP430SchedModels[];
259extern const llvm::MCWriteProcResEntry MSP430WriteProcResTable[];
260extern const llvm::MCWriteLatencyEntry MSP430WriteLatencyTable[];
261extern const llvm::MCReadAdvanceEntry MSP430ReadAdvanceTable[];
262MSP430GenSubtargetInfo::MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS)
263 : TargetSubtargetInfo(TT, CPU, TuneCPU, FS, StringTable(MSP430SubTypeKVStorage.Strings), ArrayRef(MSP430FeatureKVStorage.Features), ArrayRef(MSP430SubTypeKVStorage.SubTypes), ArrayRef(MSP430SubTypeKVStorage.Aliases).take_front(0), MSP430SchedModels,
264 MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable,
265 nullptr, nullptr, nullptr) {}
266
267unsigned MSP430GenSubtargetInfo
268::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
269 report_fatal_error("Expected a variant SchedClass");
270} // MSP430GenSubtargetInfo::resolveSchedClass
271
272unsigned MSP430GenSubtargetInfo
273::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const {
274 return MSP430_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, *this, CPUID);
275} // MSP430GenSubtargetInfo::resolveVariantSchedClass
276
277std::unique_ptr<MCSubtargetInfo> MSP430GenSubtargetInfo::clone() const {
278 return MSP430_MC::cloneSubtargetInfo(*this);
279} // MSP430GenSubtargetInfo::clone
280
281const FeatureBitset &MSP430GenSubtargetInfo::getInlineIgnoreFeatures() const {
282 static constexpr FeatureBitset Features = {
283 };
284 return Features;
285}
286
287const FeatureBitset &MSP430GenSubtargetInfo::getInlineInverseFeatures() const {
288 static constexpr FeatureBitset Features = {
289 };
290 return Features;
291}
292
293const FeatureBitset &MSP430GenSubtargetInfo::getInlineMustMatchFeatures() const {
294 static constexpr FeatureBitset Features = {
295 };
296 return Features;
297}
298
299
300} // namespace llvm
301
302#endif // GET_SUBTARGETINFO_CTOR
303
304#ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
305#undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
306
307
308#endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
309
310#ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
311#undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
312
313
314#endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
315
316