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 WebAssembly {
15
16enum {
17 FeatureAcquireReleaseAtomics = 0,
18 FeatureAtomics = 1,
19 FeatureBulkMemory = 2,
20 FeatureBulkMemoryOpt = 3,
21 FeatureCallIndirectOverlong = 4,
22 FeatureExceptionHandling = 5,
23 FeatureExtendedConst = 6,
24 FeatureFP16 = 7,
25 FeatureGC = 8,
26 FeatureMultiMemory = 9,
27 FeatureMultivalue = 10,
28 FeatureMutableGlobals = 11,
29 FeatureNontrappingFPToInt = 12,
30 FeatureReferenceTypes = 13,
31 FeatureRelaxedSIMD = 14,
32 FeatureSIMD128 = 15,
33 FeatureSignExt = 16,
34 FeatureTailCall = 17,
35 FeatureWideArithmetic = 18,
36 NumSubtargetFeatures = 19
37};
38
39} // namespace WebAssembly
40
41} // namespace llvm
42
43#endif // GET_SUBTARGETINFO_ENUM
44
45#ifdef GET_SUBTARGETINFO_MACRO
46
47GET_SUBTARGETINFO_MACRO(HasAcquireReleaseAtomics, false, hasAcquireReleaseAtomics)
48GET_SUBTARGETINFO_MACRO(HasAtomics, false, hasAtomics)
49GET_SUBTARGETINFO_MACRO(HasBulkMemory, false, hasBulkMemory)
50GET_SUBTARGETINFO_MACRO(HasBulkMemoryOpt, false, hasBulkMemoryOpt)
51GET_SUBTARGETINFO_MACRO(HasCallIndirectOverlong, false, hasCallIndirectOverlong)
52GET_SUBTARGETINFO_MACRO(HasExceptionHandling, false, hasExceptionHandling)
53GET_SUBTARGETINFO_MACRO(HasExtendedConst, false, hasExtendedConst)
54GET_SUBTARGETINFO_MACRO(HasFP16, false, hasFP16)
55GET_SUBTARGETINFO_MACRO(HasGC, false, hasGC)
56GET_SUBTARGETINFO_MACRO(HasMultiMemory, false, hasMultiMemory)
57GET_SUBTARGETINFO_MACRO(HasMultivalue, false, hasMultivalue)
58GET_SUBTARGETINFO_MACRO(HasMutableGlobals, false, hasMutableGlobals)
59GET_SUBTARGETINFO_MACRO(HasNontrappingFPToInt, false, hasNontrappingFPToInt)
60GET_SUBTARGETINFO_MACRO(HasReferenceTypes, false, hasReferenceTypes)
61GET_SUBTARGETINFO_MACRO(HasSignExt, false, hasSignExt)
62GET_SUBTARGETINFO_MACRO(HasTailCall, false, hasTailCall)
63GET_SUBTARGETINFO_MACRO(HasWideArithmetic, false, hasWideArithmetic)
64
65#undef GET_SUBTARGETINFO_MACRO
66#endif // GET_SUBTARGETINFO_MACRO
67
68#ifdef GET_SUBTARGETINFO_MC_DESC
69#undef GET_SUBTARGETINFO_MC_DESC
70
71namespace llvm {
72
73// Sorted (by key) array of values for CPU features.
74extern const llvm::SubtargetFeatureKVStorage< 19, 875> WebAssemblyFeatureKVStorage = {
75 {
76 { sizeof(SubtargetFeatureKV) * 19 + 1, sizeof(SubtargetFeatureKV) * 19 + 25, WebAssembly::FeatureAcquireReleaseAtomics, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
77 { sizeof(SubtargetFeatureKV) * 18 + 65, sizeof(SubtargetFeatureKV) * 18 + 73, WebAssembly::FeatureAtomics, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
78 { sizeof(SubtargetFeatureKV) * 17 + 88, sizeof(SubtargetFeatureKV) * 17 + 100, WebAssembly::FeatureBulkMemory, { { { 0x8ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
79 { sizeof(SubtargetFeatureKV) * 16 + 130, sizeof(SubtargetFeatureKV) * 16 + 146, WebAssembly::FeatureBulkMemoryOpt, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
80 { sizeof(SubtargetFeatureKV) * 15 + 189, sizeof(SubtargetFeatureKV) * 15 + 212, WebAssembly::FeatureCallIndirectOverlong, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
81 { sizeof(SubtargetFeatureKV) * 14 + 266, sizeof(SubtargetFeatureKV) * 14 + 285, WebAssembly::FeatureExceptionHandling, { { { 0x2400ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
82 { sizeof(SubtargetFeatureKV) * 13 + 316, sizeof(SubtargetFeatureKV) * 13 + 331, WebAssembly::FeatureExtendedConst, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
83 { sizeof(SubtargetFeatureKV) * 12 + 365, sizeof(SubtargetFeatureKV) * 12 + 370, WebAssembly::FeatureFP16, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
84 { sizeof(SubtargetFeatureKV) * 11 + 395, sizeof(SubtargetFeatureKV) * 11 + 398, WebAssembly::FeatureGC, { { { 0x2000ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
85 { sizeof(SubtargetFeatureKV) * 10 + 413, sizeof(SubtargetFeatureKV) * 10 + 425, WebAssembly::FeatureMultiMemory, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
86 { sizeof(SubtargetFeatureKV) * 9 + 450, sizeof(SubtargetFeatureKV) * 9 + 461, WebAssembly::FeatureMultivalue, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
87 { sizeof(SubtargetFeatureKV) * 8 + 515, sizeof(SubtargetFeatureKV) * 8 + 531, WebAssembly::FeatureMutableGlobals, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
88 { sizeof(SubtargetFeatureKV) * 7 + 554, sizeof(SubtargetFeatureKV) * 7 + 574, WebAssembly::FeatureNontrappingFPToInt, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
89 { sizeof(SubtargetFeatureKV) * 6 + 628, sizeof(SubtargetFeatureKV) * 6 + 644, WebAssembly::FeatureReferenceTypes, { { { 0x10ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
90 { sizeof(SubtargetFeatureKV) * 5 + 667, sizeof(SubtargetFeatureKV) * 5 + 680, WebAssembly::FeatureRelaxedSIMD, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
91 { sizeof(SubtargetFeatureKV) * 4 + 713, sizeof(SubtargetFeatureKV) * 4 + 722, WebAssembly::FeatureSignExt, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
92 { sizeof(SubtargetFeatureKV) * 3 + 754, sizeof(SubtargetFeatureKV) * 3 + 762, WebAssembly::FeatureSIMD128, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
93 { sizeof(SubtargetFeatureKV) * 2 + 782, sizeof(SubtargetFeatureKV) * 2 + 792, WebAssembly::FeatureTailCall, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
94 { sizeof(SubtargetFeatureKV) * 1 + 822, sizeof(SubtargetFeatureKV) * 1 + 838, WebAssembly::FeatureWideArithmetic, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } },
95 },
96 "\000acquire-release-atomics\000Enable acquire-release-atomics proposal\000"
97 "atomics\000Enable Atomics\000bulk-memory\000Enable bulk memory operatio"
98 "ns\000bulk-memory-opt\000Enable bulk memory optimization operations\000"
99 "call-indirect-overlong\000Enable overlong encoding for call_indirect im"
100 "mediates\000exception-handling\000Enable Wasm exception handling\000ext"
101 "ended-const\000Enable extended const expressions\000fp16\000Enable FP16"
102 " instructions\000gc\000Enable wasm gc\000multimemory\000Enable multiple"
103 " memories\000multivalue\000Enable multivalue blocks, instructions, and "
104 "functions\000mutable-globals\000Enable mutable globals\000nontrapping-f"
105 "ptoint\000Enable non-trapping float-to-int conversion operators\000refe"
106 "rence-types\000Enable reference types\000relaxed-simd\000Enable relaxed"
107 "-simd instructions\000sign-ext\000Enable sign extension operators\000si"
108 "md128\000Enable 128-bit SIMD\000tail-call\000Enable tail call instructi"
109 "ons\000wide-arithmetic\000Enable wide-arithmetic instructions\000"};
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#define DBGVAL_OR_NULLPTR(x) x
117#else
118#define DBGFIELD(x)
119#define DBGVAL_OR_NULLPTR(x) nullptr
120#endif
121
122// ===============================================================
123// Data tables for the new per-operand machine model.
124
125static_assert(0 <= UINT8_MAX, "NumWriteProcResEntries does not fit in uint8_t");
126static_assert(0 <= UINT8_MAX, "NumWriteLatencyEntries does not fit in uint8_t");
127
128// {ProcResourceIdx, ReleaseAtCycle, AcquireAtCycle}
129extern const llvm::MCWriteProcResEntry WebAssemblyWriteProcResTable[] = {
130 { 0, 0, 0 }, // Invalid
131}; // WebAssemblyWriteProcResTable
132
133// {Cycles, WriteResourceID}
134extern const llvm::MCWriteLatencyEntry WebAssemblyWriteLatencyTable[] = {
135 { 0, 0}, // Invalid
136}; // WebAssemblyWriteLatencyTable
137
138// {UseIdx, WriteResourceID, Cycles}
139extern const llvm::MCReadAdvanceEntry WebAssemblyReadAdvanceTable[] = {
140 {0, 0, 0}, // Invalid
141}; // WebAssemblyReadAdvanceTable
142
143#ifdef __GNUC__
144#pragma GCC diagnostic push
145#pragma GCC diagnostic ignored "-Woverlength-strings"
146#endif
147static constexpr char WebAssemblySchedClassNamesStorage[] =
148 "\0"
149 "InvalidSchedClass\0"
150 ;
151#ifdef __GNUC__
152#pragma GCC diagnostic pop
153#endif
154
155static constexpr llvm::StringTable
156WebAssemblySchedClassNames = WebAssemblySchedClassNamesStorage;
157
158extern const llvm::MCSchedModel WebAssemblySchedModels[] = {
159{ // NoSchedModel
160 MCSchedModel::DefaultIssueWidth,
161 MCSchedModel::DefaultMicroOpBufferSize,
162 MCSchedModel::DefaultLoopMicroOpBufferSize,
163 MCSchedModel::DefaultLoadLatency,
164 MCSchedModel::DefaultHighLatency,
165 MCSchedModel::DefaultMispredictPenalty,
166 false, // PostRAScheduler
167 false, // CompleteModel
168 false, // EnableIntervals
169 0, // Processor ID
170 nullptr, nullptr, 0, 0, // No instruction-level machine model.
171 DBGVAL_OR_NULLPTR(&WebAssemblySchedClassNames), // SchedClassNames
172 nullptr, // No Itinerary
173 nullptr // No extra processor descriptor
174 },
175};
176
177#undef DBGFIELD
178
179#undef DBGVAL_OR_NULLPTR
180
181static constexpr size_t WebAssemblyCPUAliasArraySize = sizeof(std::array<SubtargetSubTypeAliasKV, 0>);
182// Sorted (by key) array of values for CPU subtype.
183extern const llvm::SubtargetSubTypeKVStorage< 4, 0, 34> WebAssemblySubTypeKVStorage = {
184 {
185 { sizeof(SubtargetSubTypeKV) * 4 + WebAssemblyCPUAliasArraySize + 1, { { { 0x3fffeULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
186 { sizeof(SubtargetSubTypeKV) * 3 + WebAssemblyCPUAliasArraySize + 15, { { { 0x13c1cULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
187 { sizeof(SubtargetSubTypeKV) * 2 + WebAssemblyCPUAliasArraySize + 23, { { { 0x11c58ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
188 { sizeof(SubtargetSubTypeKV) * 1 + WebAssemblyCPUAliasArraySize + 29, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, 0 },
189 },
190 { {
191 } },
192 "\000bleeding-edge\000generic\000lime1\000mvp\000"};
193
194namespace WebAssembly_MC {
195
196unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
197 const MCInst *MI, const MCInstrInfo *MCII, const MCSubtargetInfo &STI, unsigned CPUID) {
198 // Don't know how to resolve this scheduling class.
199 return 0;
200}
201ArrayRef<unsigned> getVariantSchedClassTargets(unsigned SchedClass,
202 unsigned CPUID) {
203 return {};
204}
205
206} // namespace WebAssembly_MC
207struct WebAssemblyGenMCSubtargetInfo : public MCSubtargetInfo {
208 WebAssemblyGenMCSubtargetInfo(const Triple &TT,
209 StringRef CPU, StringRef TuneCPU, StringRef FS,
210 StringTable PN,
211 ArrayRef<SubtargetFeatureKV> PF,
212 ArrayRef<SubtargetSubTypeKV> PD,
213 ArrayRef<SubtargetSubTypeAliasKV> PA,
214 const MCSchedModel *PSM,
215 const MCWriteProcResEntry *WPR,
216 const MCWriteLatencyEntry *WL,
217 const MCReadAdvanceEntry *RA, const InstrStage *IS,
218 const unsigned *OC, const unsigned *FP) :
219 MCSubtargetInfo(TT, CPU, TuneCPU, FS, PN, PF, PD, PA, PSM,
220 WPR, WL, RA, IS, OC, FP) { }
221
222 explicit WebAssemblyGenMCSubtargetInfo(const MCSubtargetInfo &STI)
223 : MCSubtargetInfo(STI) {}
224
225 std::unique_ptr<MCSubtargetInfo> clone() const final {
226 return std::make_unique<WebAssemblyGenMCSubtargetInfo>(*this);
227 }
228
229 unsigned resolveVariantSchedClass(unsigned SchedClass,
230 const MCInst *MI, const MCInstrInfo *MCII,
231 unsigned CPUID) const final {
232 return WebAssembly_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, *this, CPUID);
233 }
234 unsigned getHwModeSet() const final;
235 unsigned getHwMode(enum HwModeType type = HwMode_Default) const final;
236};
237unsigned WebAssemblyGenMCSubtargetInfo::getHwModeSet() const {
238 [[maybe_unused]] const FeatureBitset &FB = getFeatureBits();
239 // Collect HwModes and store them as a bit set.
240 unsigned Modes = 0;
241 if (false) Modes |= (1 << 0);
242 return Modes;
243}
244unsigned WebAssemblyGenMCSubtargetInfo::getHwMode(enum HwModeType type) const {
245 unsigned Modes = getHwModeSet();
246
247 if (!Modes)
248 return Modes;
249
250 switch (type) {
251 case HwMode_Default:
252 return llvm::countr_zero(Modes) + 1;
253 case HwMode_ValueType:
254 // No HwMode for ValueType.
255 return 0;
256 case HwMode_RegInfo:
257 Modes &= 1;
258 if (!Modes)
259 return Modes;
260 if (!llvm::has_single_bit<unsigned>(Modes))
261 llvm_unreachable("Two or more HwModes for RegInfo were found!");
262 return llvm::countr_zero(Modes) + 1;
263 case HwMode_EncodingInfo:
264 // No HwMode for EncodingInfo.
265 return 0;
266 }
267 llvm_unreachable("unexpected HwModeType");
268 return 0; // should not get here
269}
270namespace WebAssembly_MC {
271
272std::unique_ptr<MCSubtargetInfo> cloneSubtargetInfo(const MCSubtargetInfo &STI) {
273 return std::make_unique<WebAssemblyGenMCSubtargetInfo>(STI);
274}
275
276} // namespace WebAssembly_MC
277
278static inline MCSubtargetInfo *createWebAssemblyMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS) {
279 return new WebAssemblyGenMCSubtargetInfo(TT, CPU, TuneCPU, FS, StringTable(WebAssemblySubTypeKVStorage.Strings), WebAssemblyFeatureKVStorage.Features, WebAssemblySubTypeKVStorage.SubTypes, ArrayRef(WebAssemblySubTypeKVStorage.Aliases).take_front(0), WebAssemblySchedModels,
280 WebAssemblyWriteProcResTable, WebAssemblyWriteLatencyTable, WebAssemblyReadAdvanceTable,
281 nullptr, nullptr, nullptr);
282}
283
284
285} // namespace llvm
286
287#endif // GET_SUBTARGETINFO_MC_DESC
288
289#ifdef GET_SUBTARGETINFO_TARGET_DESC
290#undef GET_SUBTARGETINFO_TARGET_DESC
291
292#include "llvm/ADT/BitmaskEnum.h"
293#include "llvm/Support/Debug.h"
294#include "llvm/Support/raw_ostream.h"
295
296// ParseSubtargetFeatures - Parses features string setting specified
297// subtarget options.
298void llvm::WebAssemblySubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS) {
299 LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
300 LLVM_DEBUG(dbgs() << "\nCPU:" << CPU);
301 LLVM_DEBUG(dbgs() << "\nTuneCPU:" << TuneCPU << "\n\n");
302 InitMCProcessorInfo(CPU, TuneCPU, FS);
303 const FeatureBitset &Bits = getFeatureBits();
304 if (Bits[WebAssembly::FeatureAcquireReleaseAtomics]) HasAcquireReleaseAtomics = true;
305 if (Bits[WebAssembly::FeatureAtomics]) HasAtomics = true;
306 if (Bits[WebAssembly::FeatureBulkMemory]) HasBulkMemory = true;
307 if (Bits[WebAssembly::FeatureBulkMemoryOpt]) HasBulkMemoryOpt = true;
308 if (Bits[WebAssembly::FeatureCallIndirectOverlong]) HasCallIndirectOverlong = true;
309 if (Bits[WebAssembly::FeatureExceptionHandling]) HasExceptionHandling = true;
310 if (Bits[WebAssembly::FeatureExtendedConst]) HasExtendedConst = true;
311 if (Bits[WebAssembly::FeatureFP16]) HasFP16 = true;
312 if (Bits[WebAssembly::FeatureGC]) HasGC = true;
313 if (Bits[WebAssembly::FeatureMultiMemory]) HasMultiMemory = true;
314 if (Bits[WebAssembly::FeatureMultivalue]) HasMultivalue = true;
315 if (Bits[WebAssembly::FeatureMutableGlobals]) HasMutableGlobals = true;
316 if (Bits[WebAssembly::FeatureNontrappingFPToInt]) HasNontrappingFPToInt = true;
317 if (Bits[WebAssembly::FeatureReferenceTypes]) HasReferenceTypes = true;
318 if (Bits[WebAssembly::FeatureRelaxedSIMD] && SIMDLevel < RelaxedSIMD) SIMDLevel = RelaxedSIMD;
319 if (Bits[WebAssembly::FeatureSIMD128] && SIMDLevel < SIMD128) SIMDLevel = SIMD128;
320 if (Bits[WebAssembly::FeatureSignExt]) HasSignExt = true;
321 if (Bits[WebAssembly::FeatureTailCall]) HasTailCall = true;
322 if (Bits[WebAssembly::FeatureWideArithmetic]) HasWideArithmetic = true;
323}
324
325#endif // GET_SUBTARGETINFO_TARGET_DESC
326
327#ifdef GET_SUBTARGETINFO_HEADER
328#undef GET_SUBTARGETINFO_HEADER
329
330namespace llvm {
331
332class DFAPacketizer;
333namespace WebAssembly_MC {
334
335unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, const MCSubtargetInfo &STI, unsigned CPUID);
336std::unique_ptr<MCSubtargetInfo> cloneSubtargetInfo(const MCSubtargetInfo &STI);
337ArrayRef<unsigned> getVariantSchedClassTargets(unsigned SchedClass, unsigned CPUID);
338
339} // namespace WebAssembly_MC
340struct WebAssemblyGenSubtargetInfo : public TargetSubtargetInfo {
341 explicit WebAssemblyGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS);
342public:
343 std::unique_ptr<MCSubtargetInfo> clone() const final;
344 unsigned resolveSchedClass(unsigned SchedClass, const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const final;
345 unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const final;
346 DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
347 enum class WebAssemblyHwModeBits : unsigned {
348 DefaultMode = 0,
349 WASM64 = (1 << 0),
350
351 LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/WASM64),
352 };
353 unsigned getHwModeSet() const final;
354 unsigned getHwMode(enum HwModeType type = HwMode_Default) const final;
355 const FeatureBitset &getInlineIgnoreFeatures() const override;
356 const FeatureBitset &getInlineInverseFeatures() const override;
357 const FeatureBitset &getInlineMustMatchFeatures() const override;
358};
359
360} // namespace llvm
361
362#endif // GET_SUBTARGETINFO_HEADER
363
364#ifdef GET_SUBTARGETINFO_CTOR
365#undef GET_SUBTARGETINFO_CTOR
366
367#include "llvm/CodeGen/TargetSchedule.h"
368
369namespace llvm {
370
371extern const llvm::StringRef WebAssemblyNames[];
372extern const llvm::SubtargetFeatureKVStorage<19, 875> WebAssemblyFeatureKVStorage;
373extern const llvm::SubtargetSubTypeKVStorage<4, 0, 34> WebAssemblySubTypeKVStorage;
374extern const llvm::MCSchedModel WebAssemblySchedModels[];
375extern const llvm::MCWriteProcResEntry WebAssemblyWriteProcResTable[];
376extern const llvm::MCWriteLatencyEntry WebAssemblyWriteLatencyTable[];
377extern const llvm::MCReadAdvanceEntry WebAssemblyReadAdvanceTable[];
378WebAssemblyGenSubtargetInfo::WebAssemblyGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS)
379 : TargetSubtargetInfo(TT, CPU, TuneCPU, FS, StringTable(WebAssemblySubTypeKVStorage.Strings), ArrayRef(WebAssemblyFeatureKVStorage.Features), ArrayRef(WebAssemblySubTypeKVStorage.SubTypes), ArrayRef(WebAssemblySubTypeKVStorage.Aliases).take_front(0), WebAssemblySchedModels,
380 WebAssemblyWriteProcResTable, WebAssemblyWriteLatencyTable, WebAssemblyReadAdvanceTable,
381 nullptr, nullptr, nullptr) {}
382
383unsigned WebAssemblyGenSubtargetInfo
384::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
385 report_fatal_error("Expected a variant SchedClass");
386} // WebAssemblyGenSubtargetInfo::resolveSchedClass
387
388unsigned WebAssemblyGenSubtargetInfo
389::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const {
390 return WebAssembly_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, *this, CPUID);
391} // WebAssemblyGenSubtargetInfo::resolveVariantSchedClass
392
393std::unique_ptr<MCSubtargetInfo> WebAssemblyGenSubtargetInfo::clone() const {
394 return WebAssembly_MC::cloneSubtargetInfo(*this);
395} // WebAssemblyGenSubtargetInfo::clone
396
397unsigned WebAssemblyGenSubtargetInfo::getHwModeSet() const {
398 [[maybe_unused]] const auto *Subtarget =
399 static_cast<const WebAssemblySubtarget *>(this);
400 // Collect HwModes and store them as a bit set.
401 unsigned Modes = 0;
402 if ((Subtarget->hasAddr64())) Modes |= (1 << 0);
403 return Modes;
404}
405unsigned WebAssemblyGenSubtargetInfo::getHwMode(enum HwModeType type) const {
406 unsigned Modes = getHwModeSet();
407
408 if (!Modes)
409 return Modes;
410
411 switch (type) {
412 case HwMode_Default:
413 return llvm::countr_zero(Modes) + 1;
414 case HwMode_ValueType:
415 // No HwMode for ValueType.
416 return 0;
417 case HwMode_RegInfo:
418 Modes &= 1;
419 if (!Modes)
420 return Modes;
421 if (!llvm::has_single_bit<unsigned>(Modes))
422 llvm_unreachable("Two or more HwModes for RegInfo were found!");
423 return llvm::countr_zero(Modes) + 1;
424 case HwMode_EncodingInfo:
425 // No HwMode for EncodingInfo.
426 return 0;
427 }
428 llvm_unreachable("unexpected HwModeType");
429 return 0; // should not get here
430}
431const FeatureBitset &WebAssemblyGenSubtargetInfo::getInlineIgnoreFeatures() const {
432 static constexpr FeatureBitset Features = {
433 };
434 return Features;
435}
436
437const FeatureBitset &WebAssemblyGenSubtargetInfo::getInlineInverseFeatures() const {
438 static constexpr FeatureBitset Features = {
439 };
440 return Features;
441}
442
443const FeatureBitset &WebAssemblyGenSubtargetInfo::getInlineMustMatchFeatures() const {
444 static constexpr FeatureBitset Features = {
445 };
446 return Features;
447}
448
449
450} // namespace llvm
451
452#endif // GET_SUBTARGETINFO_CTOR
453
454#ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
455#undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
456
457
458#endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
459
460#ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
461#undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
462
463
464#endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
465
466