1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Target Register and Register Classes Information *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9namespace llvm {
10
11extern const MCRegisterClass SPIRVMCRegisterClasses[];
12
13static const MVT::SimpleValueType VTLists[] = {
14 /* 0 */ MVT::i64, MVT::f64, MVT::i64, MVT::v2i64, MVT::v2f64, MVT::i64, MVT::Other,
15 /* 7 */ MVT::f64, MVT::Other,
16 /* 9 */ MVT::v2i64, MVT::Other,
17 /* 11 */ MVT::v2f64, MVT::Other,
18};
19static constexpr char SPIRVSubRegIndexStrings[] = {
20 /* dummy */ 0
21};
22
23
24static constexpr uint32_t SPIRVSubRegIndexNameOffsets[] = {
25 /* dummy */ 0
26};
27
28static const TargetRegisterInfo::SubRegCoveredBits SubRegIdxRangeTable[] = {
29 { .Offset: 65535, .Size: 65535 },
30};
31
32
33static const LaneBitmask SubRegIndexLaneMaskTable[] = {
34 LaneBitmask::getAll(),
35 };
36
37
38
39static const TargetRegisterInfo::RegClassInfo RegClassInfos[] = {
40 // Mode = 0 (DefaultMode)
41 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 5 }, // ANY
42 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 0 }, // ID
43 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 5 }, // TYPE
44 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 7 }, // fID
45 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 5 }, // iID
46 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 5 }, // pID
47 { .RegSize: 64, .SpillSize: 64, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 5 }, // vpID
48 { .RegSize: 128, .SpillSize: 128, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 9 }, // vID
49 { .RegSize: 128, .SpillSize: 128, .SpillAlignment: 64, /*VTLists+*/.VTListOffset: 11 }, // vfID
50};
51static const uint32_t ANYSubClassMask[] = {
52 0x000001ff,
53};
54
55static const uint32_t IDSubClassMask[] = {
56 0x000001fa,
57};
58
59static const uint32_t TYPESubClassMask[] = {
60 0x00000004,
61};
62
63static const uint32_t fIDSubClassMask[] = {
64 0x00000008,
65};
66
67static const uint32_t iIDSubClassMask[] = {
68 0x00000010,
69};
70
71static const uint32_t pIDSubClassMask[] = {
72 0x00000020,
73};
74
75static const uint32_t vpIDSubClassMask[] = {
76 0x00000040,
77};
78
79static const uint32_t vIDSubClassMask[] = {
80 0x00000080,
81};
82
83static const uint32_t vfIDSubClassMask[] = {
84 0x00000100,
85};
86
87static const uint16_t SuperRegIdxSeqs[] = {
88 /* 0 */ 0,
89};
90
91static unsigned const IDSuperclasses[] = {
92 SPIRV::ANYRegClassID,
93};
94
95static unsigned const TYPESuperclasses[] = {
96 SPIRV::ANYRegClassID,
97};
98
99static unsigned const fIDSuperclasses[] = {
100 SPIRV::ANYRegClassID,
101 SPIRV::IDRegClassID,
102};
103
104static unsigned const iIDSuperclasses[] = {
105 SPIRV::ANYRegClassID,
106 SPIRV::IDRegClassID,
107};
108
109static unsigned const pIDSuperclasses[] = {
110 SPIRV::ANYRegClassID,
111 SPIRV::IDRegClassID,
112};
113
114static unsigned const vpIDSuperclasses[] = {
115 SPIRV::ANYRegClassID,
116 SPIRV::IDRegClassID,
117};
118
119static unsigned const vIDSuperclasses[] = {
120 SPIRV::ANYRegClassID,
121 SPIRV::IDRegClassID,
122};
123
124static unsigned const vfIDSuperclasses[] = {
125 SPIRV::ANYRegClassID,
126 SPIRV::IDRegClassID,
127};
128
129namespace SPIRV {
130
131// Register class instances
132 extern const TargetRegisterClass ANYRegClass = {
133 .MC: &SPIRVMCRegisterClasses[ANYRegClassID],
134 .SubClassMask: ANYSubClassMask,
135 .SuperRegIndices: SuperRegIdxSeqs + 0,
136 .LaneMask: LaneBitmask(0x0000000000000001),
137 .AllocationPriority: 0,
138 .GlobalPriority: false,
139 .TSFlags: 0x00, /* TSFlags */
140 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
141 .CoveredBySubRegs: false, /* CoveredBySubRegs */
142 .SuperClasses: nullptr, .SuperClassesSize: 0,
143 .OrderFunc: nullptr
144 };
145
146 extern const TargetRegisterClass IDRegClass = {
147 .MC: &SPIRVMCRegisterClasses[IDRegClassID],
148 .SubClassMask: IDSubClassMask,
149 .SuperRegIndices: SuperRegIdxSeqs + 0,
150 .LaneMask: LaneBitmask(0x0000000000000001),
151 .AllocationPriority: 0,
152 .GlobalPriority: false,
153 .TSFlags: 0x00, /* TSFlags */
154 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
155 .CoveredBySubRegs: false, /* CoveredBySubRegs */
156 .SuperClasses: IDSuperclasses, .SuperClassesSize: 1,
157 .OrderFunc: nullptr
158 };
159
160 extern const TargetRegisterClass TYPERegClass = {
161 .MC: &SPIRVMCRegisterClasses[TYPERegClassID],
162 .SubClassMask: TYPESubClassMask,
163 .SuperRegIndices: SuperRegIdxSeqs + 0,
164 .LaneMask: LaneBitmask(0x0000000000000001),
165 .AllocationPriority: 0,
166 .GlobalPriority: false,
167 .TSFlags: 0x00, /* TSFlags */
168 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
169 .CoveredBySubRegs: false, /* CoveredBySubRegs */
170 .SuperClasses: TYPESuperclasses, .SuperClassesSize: 1,
171 .OrderFunc: nullptr
172 };
173
174 extern const TargetRegisterClass fIDRegClass = {
175 .MC: &SPIRVMCRegisterClasses[fIDRegClassID],
176 .SubClassMask: fIDSubClassMask,
177 .SuperRegIndices: SuperRegIdxSeqs + 0,
178 .LaneMask: LaneBitmask(0x0000000000000001),
179 .AllocationPriority: 0,
180 .GlobalPriority: false,
181 .TSFlags: 0x00, /* TSFlags */
182 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
183 .CoveredBySubRegs: false, /* CoveredBySubRegs */
184 .SuperClasses: fIDSuperclasses, .SuperClassesSize: 2,
185 .OrderFunc: nullptr
186 };
187
188 extern const TargetRegisterClass iIDRegClass = {
189 .MC: &SPIRVMCRegisterClasses[iIDRegClassID],
190 .SubClassMask: iIDSubClassMask,
191 .SuperRegIndices: SuperRegIdxSeqs + 0,
192 .LaneMask: LaneBitmask(0x0000000000000001),
193 .AllocationPriority: 0,
194 .GlobalPriority: false,
195 .TSFlags: 0x00, /* TSFlags */
196 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
197 .CoveredBySubRegs: false, /* CoveredBySubRegs */
198 .SuperClasses: iIDSuperclasses, .SuperClassesSize: 2,
199 .OrderFunc: nullptr
200 };
201
202 extern const TargetRegisterClass pIDRegClass = {
203 .MC: &SPIRVMCRegisterClasses[pIDRegClassID],
204 .SubClassMask: pIDSubClassMask,
205 .SuperRegIndices: SuperRegIdxSeqs + 0,
206 .LaneMask: LaneBitmask(0x0000000000000001),
207 .AllocationPriority: 0,
208 .GlobalPriority: false,
209 .TSFlags: 0x00, /* TSFlags */
210 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
211 .CoveredBySubRegs: false, /* CoveredBySubRegs */
212 .SuperClasses: pIDSuperclasses, .SuperClassesSize: 2,
213 .OrderFunc: nullptr
214 };
215
216 extern const TargetRegisterClass vpIDRegClass = {
217 .MC: &SPIRVMCRegisterClasses[vpIDRegClassID],
218 .SubClassMask: vpIDSubClassMask,
219 .SuperRegIndices: SuperRegIdxSeqs + 0,
220 .LaneMask: LaneBitmask(0x0000000000000001),
221 .AllocationPriority: 0,
222 .GlobalPriority: false,
223 .TSFlags: 0x00, /* TSFlags */
224 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
225 .CoveredBySubRegs: false, /* CoveredBySubRegs */
226 .SuperClasses: vpIDSuperclasses, .SuperClassesSize: 2,
227 .OrderFunc: nullptr
228 };
229
230 extern const TargetRegisterClass vIDRegClass = {
231 .MC: &SPIRVMCRegisterClasses[vIDRegClassID],
232 .SubClassMask: vIDSubClassMask,
233 .SuperRegIndices: SuperRegIdxSeqs + 0,
234 .LaneMask: LaneBitmask(0x0000000000000001),
235 .AllocationPriority: 0,
236 .GlobalPriority: false,
237 .TSFlags: 0x00, /* TSFlags */
238 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
239 .CoveredBySubRegs: false, /* CoveredBySubRegs */
240 .SuperClasses: vIDSuperclasses, .SuperClassesSize: 2,
241 .OrderFunc: nullptr
242 };
243
244 extern const TargetRegisterClass vfIDRegClass = {
245 .MC: &SPIRVMCRegisterClasses[vfIDRegClassID],
246 .SubClassMask: vfIDSubClassMask,
247 .SuperRegIndices: SuperRegIdxSeqs + 0,
248 .LaneMask: LaneBitmask(0x0000000000000001),
249 .AllocationPriority: 0,
250 .GlobalPriority: false,
251 .TSFlags: 0x00, /* TSFlags */
252 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
253 .CoveredBySubRegs: false, /* CoveredBySubRegs */
254 .SuperClasses: vfIDSuperclasses, .SuperClassesSize: 2,
255 .OrderFunc: nullptr
256 };
257
258
259} // namespace SPIRV
260namespace {
261
262 const TargetRegisterClass *const RegisterClasses[] = {
263 &SPIRV::ANYRegClass,
264 &SPIRV::IDRegClass,
265 &SPIRV::TYPERegClass,
266 &SPIRV::fIDRegClass,
267 &SPIRV::iIDRegClass,
268 &SPIRV::pIDRegClass,
269 &SPIRV::vpIDRegClass,
270 &SPIRV::vIDRegClass,
271 &SPIRV::vfIDRegClass,
272 };
273} // namespace
274
275static const uint8_t CostPerUseTable[] = {
2760, 0, 0, 0, 0, 0, 0, 0, };
277
278
279static const bool InAllocatableClassTable[] = {
280false, true, true, true, true, true, true, true, };
281
282
283static const TargetRegisterInfoDesc SPIRVRegInfoDesc = { // Extra Descriptors
284.CostPerUse: CostPerUseTable, .NumCosts: 1, .InAllocatableClass: InAllocatableClassTable};
285
286/// Get the weight in units of pressure for this register class.
287const RegClassWeight &SPIRVGenRegisterInfo::
288getRegClassWeight(const TargetRegisterClass *RC) const {
289 static const RegClassWeight RCWeightTable[] = {
290 {.RegWeight: 1, .WeightLimit: 7}, // ANY
291 {.RegWeight: 1, .WeightLimit: 6}, // ID
292 {.RegWeight: 1, .WeightLimit: 1}, // TYPE
293 {.RegWeight: 1, .WeightLimit: 1}, // fID
294 {.RegWeight: 1, .WeightLimit: 1}, // iID
295 {.RegWeight: 1, .WeightLimit: 1}, // pID
296 {.RegWeight: 1, .WeightLimit: 1}, // vpID
297 {.RegWeight: 1, .WeightLimit: 1}, // vID
298 {.RegWeight: 1, .WeightLimit: 1}, // vfID
299 };
300 return RCWeightTable[RC->getID()];
301}
302
303/// Get the weight in units of pressure for this register unit.
304unsigned SPIRVGenRegisterInfo::
305getRegUnitWeight(MCRegUnit RegUnit) const {
306 assert(static_cast<unsigned>(RegUnit) < 7 && "invalid register unit");
307 // All register units have unit weight.
308 return 1;
309}
310
311
312// Get the number of dimensions of register pressure.
313unsigned SPIRVGenRegisterInfo::getNumRegPressureSets() const {
314 return 8;
315}
316
317// Get the name of this register unit pressure set.
318const char *SPIRVGenRegisterInfo::
319getRegPressureSetName(unsigned Idx) const {
320 static const char *PressureNameTable[] = {
321 "TYPE",
322 "fID",
323 "iID",
324 "pID",
325 "vpID",
326 "vID",
327 "vfID",
328 "ID",
329 };
330 return PressureNameTable[Idx];
331}
332
333// Get the register unit pressure limit for this dimension.
334// This limit must be adjusted dynamically for reserved registers.
335unsigned SPIRVGenRegisterInfo::
336getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const {
337 static const uint8_t PressureLimitTable[] = {
338 1, // 0: TYPE
339 1, // 1: fID
340 1, // 2: iID
341 1, // 3: pID
342 1, // 4: vpID
343 1, // 5: vID
344 1, // 6: vfID
345 7, // 7: ID
346 };
347 return PressureLimitTable[Idx];
348}
349
350/// Table of pressure sets per register class or unit.
351static const int RCSetsTable[] = {
352 /* 0 */ 0, 7, -1,
353 /* 3 */ 1, 7, -1,
354 /* 6 */ 2, 7, -1,
355 /* 9 */ 3, 7, -1,
356 /* 12 */ 4, 7, -1,
357 /* 15 */ 5, 7, -1,
358 /* 18 */ 6, 7, -1,
359};
360
361/// Get the dimensions of register pressure impacted by this register class.
362/// Returns a -1 terminated array of pressure set IDs
363const int *SPIRVGenRegisterInfo::
364getRegClassPressureSets(const TargetRegisterClass *RC) const {
365 static const uint8_t RCSetStartTable[] = {
366 1,1,0,3,6,9,12,15,18,};
367 return &RCSetsTable[RCSetStartTable[RC->getID()]];
368}
369
370/// Get the dimensions of register pressure impacted by this register unit.
371/// Returns a -1 terminated array of pressure set IDs
372const int *SPIRVGenRegisterInfo::
373getRegUnitPressureSets(MCRegUnit RegUnit) const {
374 assert(static_cast<unsigned>(RegUnit) < 7 && "invalid register unit");
375 static const uint8_t RUSetStartTable[] = {
376 6,0,3,9,15,18,12,};
377 return &RCSetsTable[RUSetStartTable[static_cast<unsigned>(RegUnit)]];
378}
379
380extern const MCRegisterDesc SPIRVRegDesc[];
381extern const int16_t SPIRVRegDiffLists[];
382extern const LaneBitmask SPIRVLaneMaskLists[];
383extern const char SPIRVRegStrings[];
384extern const char SPIRVRegClassStrings[];
385extern const MCPhysReg SPIRVRegUnitRoots[][2];
386extern const uint16_t SPIRVSubRegIdxLists[];
387extern const uint16_t SPIRVRegEncodingTable[];
388
389SPIRVGenRegisterInfo::
390SPIRVGenRegisterInfo(unsigned RA, unsigned DwarfFlavour, unsigned EHFlavour,
391 unsigned PC, unsigned HwMode)
392 : TargetRegisterInfo(&SPIRVRegInfoDesc, RegisterClasses, RegisterClasses+9,
393 SPIRVSubRegIndexStrings, SPIRVSubRegIndexNameOffsets,
394 SubRegIdxRangeTable, SubRegIndexLaneMaskTable,
395
396 LaneBitmask(0xFFFFFFFFFFFFFFFF), RegClassInfos, VTLists, HwMode) {
397 InitMCRegisterInfo(D: SPIRVRegDesc, NR: 8, RA, PC,
398 C: SPIRVMCRegisterClasses, NC: 9,
399 RURoots: SPIRVRegUnitRoots,
400 NRU: 7,
401 DL: SPIRVRegDiffLists,
402 RUMS: SPIRVLaneMaskLists,
403 Strings: SPIRVRegStrings,
404 ClassStrings: SPIRVRegClassStrings,
405 SubIndices: SPIRVSubRegIdxLists,
406 NumIndices: 1,
407 RET: SPIRVRegEncodingTable,
408 RUI: nullptr);
409
410}
411
412
413
414ArrayRef<const uint32_t *> SPIRVGenRegisterInfo::getRegMasks() const {
415 return {};
416}
417
418bool SPIRVGenRegisterInfo::
419isGeneralPurposeRegister(const MachineFunction &MF, MCRegister PhysReg) const {
420 return
421 false;
422}
423
424bool SPIRVGenRegisterInfo::
425isGeneralPurposeRegisterClass(const TargetRegisterClass *RC) const {
426 return
427 false;
428}
429
430bool SPIRVGenRegisterInfo::
431isFixedRegister(const MachineFunction &MF, MCRegister PhysReg) const {
432 return
433 false;
434}
435
436bool SPIRVGenRegisterInfo::
437isArgumentRegister(const MachineFunction &MF, MCRegister PhysReg) const {
438 return
439 false;
440}
441
442bool SPIRVGenRegisterInfo::
443isConstantPhysReg(MCRegister PhysReg) const {
444 return
445 false;
446}
447
448ArrayRef<const char *> SPIRVGenRegisterInfo::getRegMaskNames() const {
449 return {};
450}
451
452const SPIRVFrameLowering *
453SPIRVGenRegisterInfo::getFrameLowering(const MachineFunction &MF) {
454 return static_cast<const SPIRVFrameLowering *>(
455 MF.getSubtarget().getFrameLowering());
456}
457
458
459} // namespace llvm
460