/src/build/lib/Target/WebAssembly/WebAssemblyGenSubtargetInfo.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 WebAssembly { |
15 | | enum { |
16 | | FeatureAtomics = 0, |
17 | | FeatureBulkMemory = 1, |
18 | | FeatureExceptionHandling = 2, |
19 | | FeatureExtendedConst = 3, |
20 | | FeatureMultiMemory = 4, |
21 | | FeatureMultivalue = 5, |
22 | | FeatureMutableGlobals = 6, |
23 | | FeatureNontrappingFPToInt = 7, |
24 | | FeatureReferenceTypes = 8, |
25 | | FeatureRelaxedSIMD = 9, |
26 | | FeatureSIMD128 = 10, |
27 | | FeatureSignExt = 11, |
28 | | FeatureTailCall = 12, |
29 | | NumSubtargetFeatures = 13 |
30 | | }; |
31 | | } // end namespace WebAssembly |
32 | | } // end namespace llvm |
33 | | |
34 | | #endif // GET_SUBTARGETINFO_ENUM |
35 | | |
36 | | |
37 | | #ifdef GET_SUBTARGETINFO_MACRO |
38 | | GET_SUBTARGETINFO_MACRO(HasAtomics, false, hasAtomics) |
39 | | GET_SUBTARGETINFO_MACRO(HasBulkMemory, false, hasBulkMemory) |
40 | | GET_SUBTARGETINFO_MACRO(HasExceptionHandling, false, hasExceptionHandling) |
41 | | GET_SUBTARGETINFO_MACRO(HasExtendedConst, false, hasExtendedConst) |
42 | | GET_SUBTARGETINFO_MACRO(HasMultiMemory, false, hasMultiMemory) |
43 | | GET_SUBTARGETINFO_MACRO(HasMultivalue, false, hasMultivalue) |
44 | | GET_SUBTARGETINFO_MACRO(HasMutableGlobals, false, hasMutableGlobals) |
45 | | GET_SUBTARGETINFO_MACRO(HasNontrappingFPToInt, false, hasNontrappingFPToInt) |
46 | | GET_SUBTARGETINFO_MACRO(HasReferenceTypes, false, hasReferenceTypes) |
47 | | GET_SUBTARGETINFO_MACRO(HasSignExt, false, hasSignExt) |
48 | | GET_SUBTARGETINFO_MACRO(HasTailCall, false, hasTailCall) |
49 | | #undef GET_SUBTARGETINFO_MACRO |
50 | | #endif // GET_SUBTARGETINFO_MACRO |
51 | | |
52 | | |
53 | | #ifdef GET_SUBTARGETINFO_MC_DESC |
54 | | #undef GET_SUBTARGETINFO_MC_DESC |
55 | | |
56 | | namespace llvm { |
57 | | // Sorted (by key) array of values for CPU features. |
58 | | extern const llvm::SubtargetFeatureKV WebAssemblyFeatureKV[] = { |
59 | | { "atomics", "Enable Atomics", WebAssembly::FeatureAtomics, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
60 | | { "bulk-memory", "Enable bulk memory operations", WebAssembly::FeatureBulkMemory, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
61 | | { "exception-handling", "Enable Wasm exception handling", WebAssembly::FeatureExceptionHandling, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
62 | | { "extended-const", "Enable extended const expressions", WebAssembly::FeatureExtendedConst, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
63 | | { "multimemory", "Enable multiple memories", WebAssembly::FeatureMultiMemory, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
64 | | { "multivalue", "Enable multivalue blocks, instructions, and functions", WebAssembly::FeatureMultivalue, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
65 | | { "mutable-globals", "Enable mutable globals", WebAssembly::FeatureMutableGlobals, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
66 | | { "nontrapping-fptoint", "Enable non-trapping float-to-int conversion operators", WebAssembly::FeatureNontrappingFPToInt, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
67 | | { "reference-types", "Enable reference types", WebAssembly::FeatureReferenceTypes, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
68 | | { "relaxed-simd", "Enable relaxed-simd instructions", WebAssembly::FeatureRelaxedSIMD, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
69 | | { "sign-ext", "Enable sign extension operators", WebAssembly::FeatureSignExt, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
70 | | { "simd128", "Enable 128-bit SIMD", WebAssembly::FeatureSIMD128, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
71 | | { "tail-call", "Enable tail call instructions", WebAssembly::FeatureTailCall, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } } }, |
72 | | }; |
73 | | |
74 | | #ifdef DBGFIELD |
75 | | #error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro" |
76 | | #endif |
77 | | #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) |
78 | | #define DBGFIELD(x) x, |
79 | | #else |
80 | | #define DBGFIELD(x) |
81 | | #endif |
82 | | |
83 | | // =============================================================== |
84 | | // Data tables for the new per-operand machine model. |
85 | | |
86 | | // {ProcResourceIdx, ReleaseAtCycle, AcquireAtCycle} |
87 | | extern const llvm::MCWriteProcResEntry WebAssemblyWriteProcResTable[] = { |
88 | | { 0, 0, 0 }, // Invalid |
89 | | }; // WebAssemblyWriteProcResTable |
90 | | |
91 | | // {Cycles, WriteResourceID} |
92 | | extern const llvm::MCWriteLatencyEntry WebAssemblyWriteLatencyTable[] = { |
93 | | { 0, 0}, // Invalid |
94 | | }; // WebAssemblyWriteLatencyTable |
95 | | |
96 | | // {UseIdx, WriteResourceID, Cycles} |
97 | | extern const llvm::MCReadAdvanceEntry WebAssemblyReadAdvanceTable[] = { |
98 | | {0, 0, 0}, // Invalid |
99 | | }; // WebAssemblyReadAdvanceTable |
100 | | |
101 | | #undef DBGFIELD |
102 | | |
103 | | static const llvm::MCSchedModel NoSchedModel = { |
104 | | MCSchedModel::DefaultIssueWidth, |
105 | | MCSchedModel::DefaultMicroOpBufferSize, |
106 | | MCSchedModel::DefaultLoopMicroOpBufferSize, |
107 | | MCSchedModel::DefaultLoadLatency, |
108 | | MCSchedModel::DefaultHighLatency, |
109 | | MCSchedModel::DefaultMispredictPenalty, |
110 | | false, // PostRAScheduler |
111 | | false, // CompleteModel |
112 | | false, // EnableIntervals |
113 | | 0, // Processor ID |
114 | | nullptr, nullptr, 0, 0, // No instruction-level machine model. |
115 | | nullptr, // No Itinerary |
116 | | nullptr // No extra processor descriptor |
117 | | }; |
118 | | |
119 | | // Sorted (by key) array of values for CPU subtype. |
120 | | extern const llvm::SubtargetSubTypeKV WebAssemblySubTypeKV[] = { |
121 | | { "bleeding-edge", { { { 0x1cc3ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel }, |
122 | | { "generic", { { { 0x840ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel }, |
123 | | { "mvp", { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, { { { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel }, |
124 | | }; |
125 | | |
126 | | namespace WebAssembly_MC { |
127 | | unsigned resolveVariantSchedClassImpl(unsigned SchedClass, |
128 | 0 | const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) { |
129 | | // Don't know how to resolve this scheduling class. |
130 | 0 | return 0; |
131 | 0 | } |
132 | | } // end namespace WebAssembly_MC |
133 | | |
134 | | struct WebAssemblyGenMCSubtargetInfo : public MCSubtargetInfo { |
135 | | WebAssemblyGenMCSubtargetInfo(const Triple &TT, |
136 | | StringRef CPU, StringRef TuneCPU, StringRef FS, |
137 | | ArrayRef<SubtargetFeatureKV> PF, |
138 | | ArrayRef<SubtargetSubTypeKV> PD, |
139 | | const MCWriteProcResEntry *WPR, |
140 | | const MCWriteLatencyEntry *WL, |
141 | | const MCReadAdvanceEntry *RA, const InstrStage *IS, |
142 | | const unsigned *OC, const unsigned *FP) : |
143 | | MCSubtargetInfo(TT, CPU, TuneCPU, FS, PF, PD, |
144 | 2 | WPR, WL, RA, IS, OC, FP) { } |
145 | | |
146 | | unsigned resolveVariantSchedClass(unsigned SchedClass, |
147 | | const MCInst *MI, const MCInstrInfo *MCII, |
148 | 0 | unsigned CPUID) const override { |
149 | 0 | return WebAssembly_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, CPUID); |
150 | 0 | } |
151 | | }; |
152 | | |
153 | 2 | static inline MCSubtargetInfo *createWebAssemblyMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS) { |
154 | 2 | return new WebAssemblyGenMCSubtargetInfo(TT, CPU, TuneCPU, FS, WebAssemblyFeatureKV, WebAssemblySubTypeKV, |
155 | 2 | WebAssemblyWriteProcResTable, WebAssemblyWriteLatencyTable, WebAssemblyReadAdvanceTable, |
156 | 2 | nullptr, nullptr, nullptr); |
157 | 2 | } |
158 | | |
159 | | } // end namespace llvm |
160 | | |
161 | | #endif // GET_SUBTARGETINFO_MC_DESC |
162 | | |
163 | | |
164 | | #ifdef GET_SUBTARGETINFO_TARGET_DESC |
165 | | #undef GET_SUBTARGETINFO_TARGET_DESC |
166 | | |
167 | | #include "llvm/Support/Debug.h" |
168 | | #include "llvm/Support/raw_ostream.h" |
169 | | |
170 | | // ParseSubtargetFeatures - Parses features string setting specified |
171 | | // subtarget options. |
172 | 2 | void llvm::WebAssemblySubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS) { |
173 | 2 | LLVM_DEBUG(dbgs() << "\nFeatures:" << FS); |
174 | 2 | LLVM_DEBUG(dbgs() << "\nCPU:" << CPU); |
175 | 2 | LLVM_DEBUG(dbgs() << "\nTuneCPU:" << TuneCPU << "\n\n"); |
176 | 2 | InitMCProcessorInfo(CPU, TuneCPU, FS); |
177 | 2 | const FeatureBitset &Bits = getFeatureBits(); |
178 | 2 | if (Bits[WebAssembly::FeatureAtomics]) HasAtomics = true; |
179 | 2 | if (Bits[WebAssembly::FeatureBulkMemory]) HasBulkMemory = true; |
180 | 2 | if (Bits[WebAssembly::FeatureExceptionHandling]) HasExceptionHandling = true; |
181 | 2 | if (Bits[WebAssembly::FeatureExtendedConst]) HasExtendedConst = true; |
182 | 2 | if (Bits[WebAssembly::FeatureMultiMemory]) HasMultiMemory = true; |
183 | 2 | if (Bits[WebAssembly::FeatureMultivalue]) HasMultivalue = true; |
184 | 2 | if (Bits[WebAssembly::FeatureMutableGlobals]) HasMutableGlobals = true; |
185 | 2 | if (Bits[WebAssembly::FeatureNontrappingFPToInt]) HasNontrappingFPToInt = true; |
186 | 2 | if (Bits[WebAssembly::FeatureReferenceTypes]) HasReferenceTypes = true; |
187 | 2 | if (Bits[WebAssembly::FeatureRelaxedSIMD] && SIMDLevel < RelaxedSIMD) SIMDLevel = RelaxedSIMD; |
188 | 2 | if (Bits[WebAssembly::FeatureSIMD128] && SIMDLevel < SIMD128) SIMDLevel = SIMD128; |
189 | 2 | if (Bits[WebAssembly::FeatureSignExt]) HasSignExt = true; |
190 | 2 | if (Bits[WebAssembly::FeatureTailCall]) HasTailCall = true; |
191 | 2 | } |
192 | | #endif // GET_SUBTARGETINFO_TARGET_DESC |
193 | | |
194 | | |
195 | | #ifdef GET_SUBTARGETINFO_HEADER |
196 | | #undef GET_SUBTARGETINFO_HEADER |
197 | | |
198 | | namespace llvm { |
199 | | class DFAPacketizer; |
200 | | namespace WebAssembly_MC { |
201 | | unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID); |
202 | | } // end namespace WebAssembly_MC |
203 | | |
204 | | struct WebAssemblyGenSubtargetInfo : public TargetSubtargetInfo { |
205 | | explicit WebAssemblyGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS); |
206 | | public: |
207 | | unsigned resolveSchedClass(unsigned SchedClass, const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override; |
208 | | unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const override; |
209 | | DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const; |
210 | | }; |
211 | | } // end namespace llvm |
212 | | |
213 | | #endif // GET_SUBTARGETINFO_HEADER |
214 | | |
215 | | |
216 | | #ifdef GET_SUBTARGETINFO_CTOR |
217 | | #undef GET_SUBTARGETINFO_CTOR |
218 | | |
219 | | #include "llvm/CodeGen/TargetSchedule.h" |
220 | | |
221 | | namespace llvm { |
222 | | extern const llvm::SubtargetFeatureKV WebAssemblyFeatureKV[]; |
223 | | extern const llvm::SubtargetSubTypeKV WebAssemblySubTypeKV[]; |
224 | | extern const llvm::MCWriteProcResEntry WebAssemblyWriteProcResTable[]; |
225 | | extern const llvm::MCWriteLatencyEntry WebAssemblyWriteLatencyTable[]; |
226 | | extern const llvm::MCReadAdvanceEntry WebAssemblyReadAdvanceTable[]; |
227 | | WebAssemblyGenSubtargetInfo::WebAssemblyGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS) |
228 | | : TargetSubtargetInfo(TT, CPU, TuneCPU, FS, ArrayRef(WebAssemblyFeatureKV, 13), ArrayRef(WebAssemblySubTypeKV, 3), |
229 | | WebAssemblyWriteProcResTable, WebAssemblyWriteLatencyTable, WebAssemblyReadAdvanceTable, |
230 | 2 | nullptr, nullptr, nullptr) {} |
231 | | |
232 | | unsigned WebAssemblyGenSubtargetInfo |
233 | 0 | ::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const { |
234 | 0 | report_fatal_error("Expected a variant SchedClass"); |
235 | 0 | } // WebAssemblyGenSubtargetInfo::resolveSchedClass |
236 | | |
237 | | unsigned WebAssemblyGenSubtargetInfo |
238 | 0 | ::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const { |
239 | 0 | return WebAssembly_MC::resolveVariantSchedClassImpl(SchedClass, MI, MCII, CPUID); |
240 | 0 | } // WebAssemblyGenSubtargetInfo::resolveVariantSchedClass |
241 | | |
242 | | } // end namespace llvm |
243 | | |
244 | | #endif // GET_SUBTARGETINFO_CTOR |
245 | | |
246 | | |
247 | | #ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS |
248 | | #undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS |
249 | | |
250 | | #endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS |
251 | | |
252 | | |
253 | | #ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS |
254 | | #undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS |
255 | | |
256 | | #endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS |
257 | | |