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 AVRMCRegisterClasses[];
12
13static const MVT::SimpleValueType AVRVTLists[] = {
14 /* 0 */ MVT::i8, MVT::Other,
15 /* 2 */ MVT::i16, MVT::Other,
16};
17
18#ifdef __GNUC__
19#pragma GCC diagnostic push
20#pragma GCC diagnostic ignored "-Woverlength-strings"
21#endif
22static constexpr char AVRSubRegIndexStrings[] = {
23 /* 0 */ "sub_hi\000"
24 /* 7 */ "sub_lo\000"
25};
26#ifdef __GNUC__
27#pragma GCC diagnostic pop
28#endif
29
30
31static constexpr uint32_t AVRSubRegIndexNameOffsets[] = {
32 0,
33 7,
34};
35
36static const TargetRegisterInfo::SubRegCoveredBits AVRSubRegIdxRangeTable[] = {
37 { .Offset: 65535, .Size: 65535 },
38 { .Offset: 8, .Size: 8 }, // sub_hi
39 { .Offset: 0, .Size: 8 }, // sub_lo
40};
41
42
43static const LaneBitmask AVRSubRegIndexLaneMaskTable[] = {
44 LaneBitmask::getAll(),
45 LaneBitmask(0x0000000000000001), // sub_hi
46 LaneBitmask(0x0000000000000002), // sub_lo
47 };
48
49
50
51static const TargetRegisterInfo::RegClassInfo AVRRegClassInfos[] = {
52 // Mode = 0 (DefaultMode)
53 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // GPR8
54 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // GPR8NOZ
55 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // GPR8lo
56 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // LD8
57 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // GPR8NOZ_and_LD8
58 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // LD8lo
59 { .RegSize: 8, .SpillSize: 8, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 0 }, // CCR
60 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS
61 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ
62 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSMOVW
63 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSMOVW_and_DREGSNOZ
64 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_hi_in_LD8
65 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
66 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_lo_in_LD8
67 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
68 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_lo_in_GPR8lo
69 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_hi_in_GPR8lo
70 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DLDREGS
71 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_hi_in_LD8lo
72 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_lo_in_LD8lo
73 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSlo
74 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DLDREGS_and_DREGSNOZ
75 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
76 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSLD8lo
77 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // IWREGS
78 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ_and_IWREGS
79 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // PTRREGS
80 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ_and_PTRREGS
81 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // PTRDISPREGS
82 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGSNOZ_and_PTRDISPREGS
83 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
84 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // GPRSP
85 { .RegSize: 16, .SpillSize: 16, .SpillAlignment: 8, /*AVRVTLists+*/.VTListOffset: 2 }, // ZREG
86};
87static const uint32_t GPR8SubClassMask[] = {
88 0x0000003f, 0x00000000,
89 0x7fffff80, 0x00000001, // sub_hi
90 0x7fffff80, 0x00000001, // sub_lo
91};
92
93static const uint32_t GPR8NOZSubClassMask[] = {
94 0x00000036, 0x00000000,
95 0x6afdd500, 0x00000000, // sub_hi
96 0x6afdd500, 0x00000000, // sub_lo
97};
98
99static const uint32_t GPR8loSubClassMask[] = {
100 0x00000004, 0x00000000,
101 0x00110000, 0x00000000, // sub_hi
102 0x40118000, 0x00000000, // sub_lo
103};
104
105static const uint32_t LD8SubClassMask[] = {
106 0x00000038, 0x00000000,
107 0x7fee7800, 0x00000001, // sub_hi
108 0x3fea6000, 0x00000001, // sub_lo
109};
110
111static const uint32_t GPR8NOZ_and_LD8SubClassMask[] = {
112 0x00000030, 0x00000000,
113 0x6aec5000, 0x00000000, // sub_hi
114 0x2ae84000, 0x00000000, // sub_lo
115};
116
117static const uint32_t LD8loSubClassMask[] = {
118 0x00000020, 0x00000000,
119 0x40c40000, 0x00000000, // sub_hi
120 0x00c80000, 0x00000000, // sub_lo
121};
122
123static const uint32_t CCRSubClassMask[] = {
124 0x00000040, 0x00000000,
125};
126
127static const uint32_t DREGSSubClassMask[] = {
128 0x7fffff80, 0x00000001,
129};
130
131static const uint32_t DREGSNOZSubClassMask[] = {
132 0x6afdd500, 0x00000000,
133};
134
135static const uint32_t DREGSMOVWSubClassMask[] = {
136 0x3fb20600, 0x00000001,
137};
138
139static const uint32_t DREGSMOVW_and_DREGSNOZSubClassMask[] = {
140 0x2ab00400, 0x00000000,
141};
142
143static const uint32_t DREGS_with_sub_hi_in_LD8SubClassMask[] = {
144 0x7fee7800, 0x00000001,
145};
146
147static const uint32_t DREGSNOZ_and_DREGS_with_sub_hi_in_LD8SubClassMask[] = {
148 0x6aec5000, 0x00000000,
149};
150
151static const uint32_t DREGS_with_sub_lo_in_LD8SubClassMask[] = {
152 0x3fea6000, 0x00000001,
153};
154
155static const uint32_t DREGSNOZ_and_DREGS_with_sub_lo_in_LD8SubClassMask[] = {
156 0x2ae84000, 0x00000000,
157};
158
159static const uint32_t DREGS_with_sub_lo_in_GPR8loSubClassMask[] = {
160 0x40118000, 0x00000000,
161};
162
163static const uint32_t DREGS_with_sub_hi_in_GPR8loSubClassMask[] = {
164 0x00110000, 0x00000000,
165};
166
167static const uint32_t DLDREGSSubClassMask[] = {
168 0x3fa20000, 0x00000001,
169};
170
171static const uint32_t DREGS_with_sub_hi_in_LD8loSubClassMask[] = {
172 0x40c40000, 0x00000000,
173};
174
175static const uint32_t DREGS_with_sub_lo_in_LD8loSubClassMask[] = {
176 0x00c80000, 0x00000000,
177};
178
179static const uint32_t DREGSloSubClassMask[] = {
180 0x00100000, 0x00000000,
181};
182
183static const uint32_t DLDREGS_and_DREGSNOZSubClassMask[] = {
184 0x2aa00000, 0x00000000,
185};
186
187static const uint32_t DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8SubClassMask[] = {
188 0x00c00000, 0x00000000,
189};
190
191static const uint32_t DREGSLD8loSubClassMask[] = {
192 0x00800000, 0x00000000,
193};
194
195static const uint32_t IWREGSSubClassMask[] = {
196 0x3f000000, 0x00000001,
197};
198
199static const uint32_t DREGSNOZ_and_IWREGSSubClassMask[] = {
200 0x2a000000, 0x00000000,
201};
202
203static const uint32_t PTRREGSSubClassMask[] = {
204 0x3c000000, 0x00000001,
205};
206
207static const uint32_t DREGSNOZ_and_PTRREGSSubClassMask[] = {
208 0x28000000, 0x00000000,
209};
210
211static const uint32_t PTRDISPREGSSubClassMask[] = {
212 0x30000000, 0x00000001,
213};
214
215static const uint32_t DREGSNOZ_and_PTRDISPREGSSubClassMask[] = {
216 0x20000000, 0x00000000,
217};
218
219static const uint32_t DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loSubClassMask[] = {
220 0x40000000, 0x00000000,
221};
222
223static const uint32_t GPRSPSubClassMask[] = {
224 0x80000000, 0x00000000,
225};
226
227static const uint32_t ZREGSubClassMask[] = {
228 0x00000000, 0x00000001,
229};
230
231static const uint16_t SuperRegIdxSeqs[] = {
232 /* 0 */ 1, 2, 0,
233};
234
235static unsigned const GPR8NOZSuperclasses[] = {
236 AVR::GPR8RegClassID,
237};
238
239static unsigned const GPR8loSuperclasses[] = {
240 AVR::GPR8RegClassID,
241 AVR::GPR8NOZRegClassID,
242};
243
244static unsigned const LD8Superclasses[] = {
245 AVR::GPR8RegClassID,
246};
247
248static unsigned const GPR8NOZ_and_LD8Superclasses[] = {
249 AVR::GPR8RegClassID,
250 AVR::GPR8NOZRegClassID,
251 AVR::LD8RegClassID,
252};
253
254static unsigned const LD8loSuperclasses[] = {
255 AVR::GPR8RegClassID,
256 AVR::GPR8NOZRegClassID,
257 AVR::LD8RegClassID,
258 AVR::GPR8NOZ_and_LD8RegClassID,
259};
260
261static unsigned const DREGSNOZSuperclasses[] = {
262 AVR::DREGSRegClassID,
263};
264
265static unsigned const DREGSMOVWSuperclasses[] = {
266 AVR::DREGSRegClassID,
267};
268
269static unsigned const DREGSMOVW_and_DREGSNOZSuperclasses[] = {
270 AVR::DREGSRegClassID,
271 AVR::DREGSNOZRegClassID,
272 AVR::DREGSMOVWRegClassID,
273};
274
275static unsigned const DREGS_with_sub_hi_in_LD8Superclasses[] = {
276 AVR::DREGSRegClassID,
277};
278
279static unsigned const DREGSNOZ_and_DREGS_with_sub_hi_in_LD8Superclasses[] = {
280 AVR::DREGSRegClassID,
281 AVR::DREGSNOZRegClassID,
282 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
283};
284
285static unsigned const DREGS_with_sub_lo_in_LD8Superclasses[] = {
286 AVR::DREGSRegClassID,
287 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
288};
289
290static unsigned const DREGSNOZ_and_DREGS_with_sub_lo_in_LD8Superclasses[] = {
291 AVR::DREGSRegClassID,
292 AVR::DREGSNOZRegClassID,
293 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
294 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
295 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
296};
297
298static unsigned const DREGS_with_sub_lo_in_GPR8loSuperclasses[] = {
299 AVR::DREGSRegClassID,
300 AVR::DREGSNOZRegClassID,
301};
302
303static unsigned const DREGS_with_sub_hi_in_GPR8loSuperclasses[] = {
304 AVR::DREGSRegClassID,
305 AVR::DREGSNOZRegClassID,
306 AVR::DREGS_with_sub_lo_in_GPR8loRegClassID,
307};
308
309static unsigned const DLDREGSSuperclasses[] = {
310 AVR::DREGSRegClassID,
311 AVR::DREGSMOVWRegClassID,
312 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
313 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
314};
315
316static unsigned const DREGS_with_sub_hi_in_LD8loSuperclasses[] = {
317 AVR::DREGSRegClassID,
318 AVR::DREGSNOZRegClassID,
319 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
320 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
321};
322
323static unsigned const DREGS_with_sub_lo_in_LD8loSuperclasses[] = {
324 AVR::DREGSRegClassID,
325 AVR::DREGSNOZRegClassID,
326 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
327 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
328 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
329 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
330};
331
332static unsigned const DREGSloSuperclasses[] = {
333 AVR::DREGSRegClassID,
334 AVR::DREGSNOZRegClassID,
335 AVR::DREGSMOVWRegClassID,
336 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
337 AVR::DREGS_with_sub_lo_in_GPR8loRegClassID,
338 AVR::DREGS_with_sub_hi_in_GPR8loRegClassID,
339};
340
341static unsigned const DLDREGS_and_DREGSNOZSuperclasses[] = {
342 AVR::DREGSRegClassID,
343 AVR::DREGSNOZRegClassID,
344 AVR::DREGSMOVWRegClassID,
345 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
346 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
347 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
348 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
349 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
350 AVR::DLDREGSRegClassID,
351};
352
353static unsigned const DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8Superclasses[] = {
354 AVR::DREGSRegClassID,
355 AVR::DREGSNOZRegClassID,
356 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
357 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
358 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
359 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
360 AVR::DREGS_with_sub_hi_in_LD8loRegClassID,
361 AVR::DREGS_with_sub_lo_in_LD8loRegClassID,
362};
363
364static unsigned const DREGSLD8loSuperclasses[] = {
365 AVR::DREGSRegClassID,
366 AVR::DREGSNOZRegClassID,
367 AVR::DREGSMOVWRegClassID,
368 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
369 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
370 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
371 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
372 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
373 AVR::DLDREGSRegClassID,
374 AVR::DREGS_with_sub_hi_in_LD8loRegClassID,
375 AVR::DREGS_with_sub_lo_in_LD8loRegClassID,
376 AVR::DLDREGS_and_DREGSNOZRegClassID,
377 AVR::DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8RegClassID,
378};
379
380static unsigned const IWREGSSuperclasses[] = {
381 AVR::DREGSRegClassID,
382 AVR::DREGSMOVWRegClassID,
383 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
384 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
385 AVR::DLDREGSRegClassID,
386};
387
388static unsigned const DREGSNOZ_and_IWREGSSuperclasses[] = {
389 AVR::DREGSRegClassID,
390 AVR::DREGSNOZRegClassID,
391 AVR::DREGSMOVWRegClassID,
392 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
393 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
394 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
395 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
396 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
397 AVR::DLDREGSRegClassID,
398 AVR::DLDREGS_and_DREGSNOZRegClassID,
399 AVR::IWREGSRegClassID,
400};
401
402static unsigned const PTRREGSSuperclasses[] = {
403 AVR::DREGSRegClassID,
404 AVR::DREGSMOVWRegClassID,
405 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
406 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
407 AVR::DLDREGSRegClassID,
408 AVR::IWREGSRegClassID,
409};
410
411static unsigned const DREGSNOZ_and_PTRREGSSuperclasses[] = {
412 AVR::DREGSRegClassID,
413 AVR::DREGSNOZRegClassID,
414 AVR::DREGSMOVWRegClassID,
415 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
416 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
417 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
418 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
419 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
420 AVR::DLDREGSRegClassID,
421 AVR::DLDREGS_and_DREGSNOZRegClassID,
422 AVR::IWREGSRegClassID,
423 AVR::DREGSNOZ_and_IWREGSRegClassID,
424 AVR::PTRREGSRegClassID,
425};
426
427static unsigned const PTRDISPREGSSuperclasses[] = {
428 AVR::DREGSRegClassID,
429 AVR::DREGSMOVWRegClassID,
430 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
431 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
432 AVR::DLDREGSRegClassID,
433 AVR::IWREGSRegClassID,
434 AVR::PTRREGSRegClassID,
435};
436
437static unsigned const DREGSNOZ_and_PTRDISPREGSSuperclasses[] = {
438 AVR::DREGSRegClassID,
439 AVR::DREGSNOZRegClassID,
440 AVR::DREGSMOVWRegClassID,
441 AVR::DREGSMOVW_and_DREGSNOZRegClassID,
442 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
443 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
444 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
445 AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID,
446 AVR::DLDREGSRegClassID,
447 AVR::DLDREGS_and_DREGSNOZRegClassID,
448 AVR::IWREGSRegClassID,
449 AVR::DREGSNOZ_and_IWREGSRegClassID,
450 AVR::PTRREGSRegClassID,
451 AVR::DREGSNOZ_and_PTRREGSRegClassID,
452 AVR::PTRDISPREGSRegClassID,
453};
454
455static unsigned const DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loSuperclasses[] = {
456 AVR::DREGSRegClassID,
457 AVR::DREGSNOZRegClassID,
458 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
459 AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID,
460 AVR::DREGS_with_sub_lo_in_GPR8loRegClassID,
461 AVR::DREGS_with_sub_hi_in_LD8loRegClassID,
462};
463
464static unsigned const ZREGSuperclasses[] = {
465 AVR::DREGSRegClassID,
466 AVR::DREGSMOVWRegClassID,
467 AVR::DREGS_with_sub_hi_in_LD8RegClassID,
468 AVR::DREGS_with_sub_lo_in_LD8RegClassID,
469 AVR::DLDREGSRegClassID,
470 AVR::IWREGSRegClassID,
471 AVR::PTRREGSRegClassID,
472 AVR::PTRDISPREGSRegClassID,
473};
474
475namespace AVR {
476
477// Register class instances.
478 extern const TargetRegisterClass GPR8RegClass = {
479 .MC: &AVRMCRegisterClasses[GPR8RegClassID],
480 .SubClassMask: GPR8SubClassMask,
481 .SuperRegIndices: SuperRegIdxSeqs + 0,
482 .LaneMask: LaneBitmask(0x0000000000000001),
483 .AllocationPriority: 0,
484 .GlobalPriority: false,
485 .TSFlags: 0x00, /* TSFlags */
486 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
487 .CoveredBySubRegs: false, /* CoveredBySubRegs */
488 .SuperClasses: nullptr, .SuperClassesSize: 0,
489 .OrderFunc: nullptr
490 };
491
492 extern const TargetRegisterClass GPR8NOZRegClass = {
493 .MC: &AVRMCRegisterClasses[GPR8NOZRegClassID],
494 .SubClassMask: GPR8NOZSubClassMask,
495 .SuperRegIndices: SuperRegIdxSeqs + 0,
496 .LaneMask: LaneBitmask(0x0000000000000001),
497 .AllocationPriority: 0,
498 .GlobalPriority: false,
499 .TSFlags: 0x00, /* TSFlags */
500 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
501 .CoveredBySubRegs: false, /* CoveredBySubRegs */
502 .SuperClasses: GPR8NOZSuperclasses, .SuperClassesSize: 1,
503 .OrderFunc: nullptr
504 };
505
506 extern const TargetRegisterClass GPR8loRegClass = {
507 .MC: &AVRMCRegisterClasses[GPR8loRegClassID],
508 .SubClassMask: GPR8loSubClassMask,
509 .SuperRegIndices: SuperRegIdxSeqs + 0,
510 .LaneMask: LaneBitmask(0x0000000000000001),
511 .AllocationPriority: 0,
512 .GlobalPriority: false,
513 .TSFlags: 0x00, /* TSFlags */
514 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
515 .CoveredBySubRegs: false, /* CoveredBySubRegs */
516 .SuperClasses: GPR8loSuperclasses, .SuperClassesSize: 2,
517 .OrderFunc: nullptr
518 };
519
520 extern const TargetRegisterClass LD8RegClass = {
521 .MC: &AVRMCRegisterClasses[LD8RegClassID],
522 .SubClassMask: LD8SubClassMask,
523 .SuperRegIndices: SuperRegIdxSeqs + 0,
524 .LaneMask: LaneBitmask(0x0000000000000001),
525 .AllocationPriority: 0,
526 .GlobalPriority: false,
527 .TSFlags: 0x00, /* TSFlags */
528 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
529 .CoveredBySubRegs: false, /* CoveredBySubRegs */
530 .SuperClasses: LD8Superclasses, .SuperClassesSize: 1,
531 .OrderFunc: nullptr
532 };
533
534 extern const TargetRegisterClass GPR8NOZ_and_LD8RegClass = {
535 .MC: &AVRMCRegisterClasses[GPR8NOZ_and_LD8RegClassID],
536 .SubClassMask: GPR8NOZ_and_LD8SubClassMask,
537 .SuperRegIndices: SuperRegIdxSeqs + 0,
538 .LaneMask: LaneBitmask(0x0000000000000001),
539 .AllocationPriority: 0,
540 .GlobalPriority: false,
541 .TSFlags: 0x00, /* TSFlags */
542 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
543 .CoveredBySubRegs: false, /* CoveredBySubRegs */
544 .SuperClasses: GPR8NOZ_and_LD8Superclasses, .SuperClassesSize: 3,
545 .OrderFunc: nullptr
546 };
547
548 extern const TargetRegisterClass LD8loRegClass = {
549 .MC: &AVRMCRegisterClasses[LD8loRegClassID],
550 .SubClassMask: LD8loSubClassMask,
551 .SuperRegIndices: SuperRegIdxSeqs + 0,
552 .LaneMask: LaneBitmask(0x0000000000000001),
553 .AllocationPriority: 0,
554 .GlobalPriority: false,
555 .TSFlags: 0x00, /* TSFlags */
556 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
557 .CoveredBySubRegs: false, /* CoveredBySubRegs */
558 .SuperClasses: LD8loSuperclasses, .SuperClassesSize: 4,
559 .OrderFunc: nullptr
560 };
561
562 extern const TargetRegisterClass CCRRegClass = {
563 .MC: &AVRMCRegisterClasses[CCRRegClassID],
564 .SubClassMask: CCRSubClassMask,
565 .SuperRegIndices: SuperRegIdxSeqs + 2,
566 .LaneMask: LaneBitmask(0x0000000000000001),
567 .AllocationPriority: 0,
568 .GlobalPriority: false,
569 .TSFlags: 0x00, /* TSFlags */
570 .HasDisjunctSubRegs: false, /* HasDisjunctSubRegs */
571 .CoveredBySubRegs: false, /* CoveredBySubRegs */
572 .SuperClasses: nullptr, .SuperClassesSize: 0,
573 .OrderFunc: nullptr
574 };
575
576 extern const TargetRegisterClass DREGSRegClass = {
577 .MC: &AVRMCRegisterClasses[DREGSRegClassID],
578 .SubClassMask: DREGSSubClassMask,
579 .SuperRegIndices: SuperRegIdxSeqs + 2,
580 .LaneMask: LaneBitmask(0x0000000000000003),
581 .AllocationPriority: 0,
582 .GlobalPriority: false,
583 .TSFlags: 0x00, /* TSFlags */
584 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
585 .CoveredBySubRegs: true, /* CoveredBySubRegs */
586 .SuperClasses: nullptr, .SuperClassesSize: 0,
587 .OrderFunc: nullptr
588 };
589
590 extern const TargetRegisterClass DREGSNOZRegClass = {
591 .MC: &AVRMCRegisterClasses[DREGSNOZRegClassID],
592 .SubClassMask: DREGSNOZSubClassMask,
593 .SuperRegIndices: SuperRegIdxSeqs + 2,
594 .LaneMask: LaneBitmask(0x0000000000000003),
595 .AllocationPriority: 0,
596 .GlobalPriority: false,
597 .TSFlags: 0x00, /* TSFlags */
598 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
599 .CoveredBySubRegs: true, /* CoveredBySubRegs */
600 .SuperClasses: DREGSNOZSuperclasses, .SuperClassesSize: 1,
601 .OrderFunc: nullptr
602 };
603
604 extern const TargetRegisterClass DREGSMOVWRegClass = {
605 .MC: &AVRMCRegisterClasses[DREGSMOVWRegClassID],
606 .SubClassMask: DREGSMOVWSubClassMask,
607 .SuperRegIndices: SuperRegIdxSeqs + 2,
608 .LaneMask: LaneBitmask(0x0000000000000003),
609 .AllocationPriority: 0,
610 .GlobalPriority: false,
611 .TSFlags: 0x00, /* TSFlags */
612 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
613 .CoveredBySubRegs: true, /* CoveredBySubRegs */
614 .SuperClasses: DREGSMOVWSuperclasses, .SuperClassesSize: 1,
615 .OrderFunc: nullptr
616 };
617
618 extern const TargetRegisterClass DREGSMOVW_and_DREGSNOZRegClass = {
619 .MC: &AVRMCRegisterClasses[DREGSMOVW_and_DREGSNOZRegClassID],
620 .SubClassMask: DREGSMOVW_and_DREGSNOZSubClassMask,
621 .SuperRegIndices: SuperRegIdxSeqs + 2,
622 .LaneMask: LaneBitmask(0x0000000000000003),
623 .AllocationPriority: 0,
624 .GlobalPriority: false,
625 .TSFlags: 0x00, /* TSFlags */
626 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
627 .CoveredBySubRegs: true, /* CoveredBySubRegs */
628 .SuperClasses: DREGSMOVW_and_DREGSNOZSuperclasses, .SuperClassesSize: 3,
629 .OrderFunc: nullptr
630 };
631
632 extern const TargetRegisterClass DREGS_with_sub_hi_in_LD8RegClass = {
633 .MC: &AVRMCRegisterClasses[DREGS_with_sub_hi_in_LD8RegClassID],
634 .SubClassMask: DREGS_with_sub_hi_in_LD8SubClassMask,
635 .SuperRegIndices: SuperRegIdxSeqs + 2,
636 .LaneMask: LaneBitmask(0x0000000000000003),
637 .AllocationPriority: 0,
638 .GlobalPriority: false,
639 .TSFlags: 0x00, /* TSFlags */
640 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
641 .CoveredBySubRegs: true, /* CoveredBySubRegs */
642 .SuperClasses: DREGS_with_sub_hi_in_LD8Superclasses, .SuperClassesSize: 1,
643 .OrderFunc: nullptr
644 };
645
646 extern const TargetRegisterClass DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClass = {
647 .MC: &AVRMCRegisterClasses[DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClassID],
648 .SubClassMask: DREGSNOZ_and_DREGS_with_sub_hi_in_LD8SubClassMask,
649 .SuperRegIndices: SuperRegIdxSeqs + 2,
650 .LaneMask: LaneBitmask(0x0000000000000003),
651 .AllocationPriority: 0,
652 .GlobalPriority: false,
653 .TSFlags: 0x00, /* TSFlags */
654 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
655 .CoveredBySubRegs: true, /* CoveredBySubRegs */
656 .SuperClasses: DREGSNOZ_and_DREGS_with_sub_hi_in_LD8Superclasses, .SuperClassesSize: 3,
657 .OrderFunc: nullptr
658 };
659
660 extern const TargetRegisterClass DREGS_with_sub_lo_in_LD8RegClass = {
661 .MC: &AVRMCRegisterClasses[DREGS_with_sub_lo_in_LD8RegClassID],
662 .SubClassMask: DREGS_with_sub_lo_in_LD8SubClassMask,
663 .SuperRegIndices: SuperRegIdxSeqs + 2,
664 .LaneMask: LaneBitmask(0x0000000000000003),
665 .AllocationPriority: 0,
666 .GlobalPriority: false,
667 .TSFlags: 0x00, /* TSFlags */
668 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
669 .CoveredBySubRegs: true, /* CoveredBySubRegs */
670 .SuperClasses: DREGS_with_sub_lo_in_LD8Superclasses, .SuperClassesSize: 2,
671 .OrderFunc: nullptr
672 };
673
674 extern const TargetRegisterClass DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClass = {
675 .MC: &AVRMCRegisterClasses[DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClassID],
676 .SubClassMask: DREGSNOZ_and_DREGS_with_sub_lo_in_LD8SubClassMask,
677 .SuperRegIndices: SuperRegIdxSeqs + 2,
678 .LaneMask: LaneBitmask(0x0000000000000003),
679 .AllocationPriority: 0,
680 .GlobalPriority: false,
681 .TSFlags: 0x00, /* TSFlags */
682 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
683 .CoveredBySubRegs: true, /* CoveredBySubRegs */
684 .SuperClasses: DREGSNOZ_and_DREGS_with_sub_lo_in_LD8Superclasses, .SuperClassesSize: 5,
685 .OrderFunc: nullptr
686 };
687
688 extern const TargetRegisterClass DREGS_with_sub_lo_in_GPR8loRegClass = {
689 .MC: &AVRMCRegisterClasses[DREGS_with_sub_lo_in_GPR8loRegClassID],
690 .SubClassMask: DREGS_with_sub_lo_in_GPR8loSubClassMask,
691 .SuperRegIndices: SuperRegIdxSeqs + 2,
692 .LaneMask: LaneBitmask(0x0000000000000003),
693 .AllocationPriority: 0,
694 .GlobalPriority: false,
695 .TSFlags: 0x00, /* TSFlags */
696 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
697 .CoveredBySubRegs: true, /* CoveredBySubRegs */
698 .SuperClasses: DREGS_with_sub_lo_in_GPR8loSuperclasses, .SuperClassesSize: 2,
699 .OrderFunc: nullptr
700 };
701
702 extern const TargetRegisterClass DREGS_with_sub_hi_in_GPR8loRegClass = {
703 .MC: &AVRMCRegisterClasses[DREGS_with_sub_hi_in_GPR8loRegClassID],
704 .SubClassMask: DREGS_with_sub_hi_in_GPR8loSubClassMask,
705 .SuperRegIndices: SuperRegIdxSeqs + 2,
706 .LaneMask: LaneBitmask(0x0000000000000003),
707 .AllocationPriority: 0,
708 .GlobalPriority: false,
709 .TSFlags: 0x00, /* TSFlags */
710 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
711 .CoveredBySubRegs: true, /* CoveredBySubRegs */
712 .SuperClasses: DREGS_with_sub_hi_in_GPR8loSuperclasses, .SuperClassesSize: 3,
713 .OrderFunc: nullptr
714 };
715
716 extern const TargetRegisterClass DLDREGSRegClass = {
717 .MC: &AVRMCRegisterClasses[DLDREGSRegClassID],
718 .SubClassMask: DLDREGSSubClassMask,
719 .SuperRegIndices: SuperRegIdxSeqs + 2,
720 .LaneMask: LaneBitmask(0x0000000000000003),
721 .AllocationPriority: 0,
722 .GlobalPriority: false,
723 .TSFlags: 0x00, /* TSFlags */
724 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
725 .CoveredBySubRegs: true, /* CoveredBySubRegs */
726 .SuperClasses: DLDREGSSuperclasses, .SuperClassesSize: 4,
727 .OrderFunc: nullptr
728 };
729
730 extern const TargetRegisterClass DREGS_with_sub_hi_in_LD8loRegClass = {
731 .MC: &AVRMCRegisterClasses[DREGS_with_sub_hi_in_LD8loRegClassID],
732 .SubClassMask: DREGS_with_sub_hi_in_LD8loSubClassMask,
733 .SuperRegIndices: SuperRegIdxSeqs + 2,
734 .LaneMask: LaneBitmask(0x0000000000000003),
735 .AllocationPriority: 0,
736 .GlobalPriority: false,
737 .TSFlags: 0x00, /* TSFlags */
738 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
739 .CoveredBySubRegs: true, /* CoveredBySubRegs */
740 .SuperClasses: DREGS_with_sub_hi_in_LD8loSuperclasses, .SuperClassesSize: 4,
741 .OrderFunc: nullptr
742 };
743
744 extern const TargetRegisterClass DREGS_with_sub_lo_in_LD8loRegClass = {
745 .MC: &AVRMCRegisterClasses[DREGS_with_sub_lo_in_LD8loRegClassID],
746 .SubClassMask: DREGS_with_sub_lo_in_LD8loSubClassMask,
747 .SuperRegIndices: SuperRegIdxSeqs + 2,
748 .LaneMask: LaneBitmask(0x0000000000000003),
749 .AllocationPriority: 0,
750 .GlobalPriority: false,
751 .TSFlags: 0x00, /* TSFlags */
752 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
753 .CoveredBySubRegs: true, /* CoveredBySubRegs */
754 .SuperClasses: DREGS_with_sub_lo_in_LD8loSuperclasses, .SuperClassesSize: 6,
755 .OrderFunc: nullptr
756 };
757
758 extern const TargetRegisterClass DREGSloRegClass = {
759 .MC: &AVRMCRegisterClasses[DREGSloRegClassID],
760 .SubClassMask: DREGSloSubClassMask,
761 .SuperRegIndices: SuperRegIdxSeqs + 2,
762 .LaneMask: LaneBitmask(0x0000000000000003),
763 .AllocationPriority: 0,
764 .GlobalPriority: false,
765 .TSFlags: 0x00, /* TSFlags */
766 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
767 .CoveredBySubRegs: true, /* CoveredBySubRegs */
768 .SuperClasses: DREGSloSuperclasses, .SuperClassesSize: 6,
769 .OrderFunc: nullptr
770 };
771
772 extern const TargetRegisterClass DLDREGS_and_DREGSNOZRegClass = {
773 .MC: &AVRMCRegisterClasses[DLDREGS_and_DREGSNOZRegClassID],
774 .SubClassMask: DLDREGS_and_DREGSNOZSubClassMask,
775 .SuperRegIndices: SuperRegIdxSeqs + 2,
776 .LaneMask: LaneBitmask(0x0000000000000003),
777 .AllocationPriority: 0,
778 .GlobalPriority: false,
779 .TSFlags: 0x00, /* TSFlags */
780 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
781 .CoveredBySubRegs: true, /* CoveredBySubRegs */
782 .SuperClasses: DLDREGS_and_DREGSNOZSuperclasses, .SuperClassesSize: 9,
783 .OrderFunc: nullptr
784 };
785
786 extern const TargetRegisterClass DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8RegClass = {
787 .MC: &AVRMCRegisterClasses[DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8RegClassID],
788 .SubClassMask: DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8SubClassMask,
789 .SuperRegIndices: SuperRegIdxSeqs + 2,
790 .LaneMask: LaneBitmask(0x0000000000000003),
791 .AllocationPriority: 0,
792 .GlobalPriority: false,
793 .TSFlags: 0x00, /* TSFlags */
794 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
795 .CoveredBySubRegs: true, /* CoveredBySubRegs */
796 .SuperClasses: DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8Superclasses, .SuperClassesSize: 8,
797 .OrderFunc: nullptr
798 };
799
800 extern const TargetRegisterClass DREGSLD8loRegClass = {
801 .MC: &AVRMCRegisterClasses[DREGSLD8loRegClassID],
802 .SubClassMask: DREGSLD8loSubClassMask,
803 .SuperRegIndices: SuperRegIdxSeqs + 2,
804 .LaneMask: LaneBitmask(0x0000000000000003),
805 .AllocationPriority: 0,
806 .GlobalPriority: false,
807 .TSFlags: 0x00, /* TSFlags */
808 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
809 .CoveredBySubRegs: true, /* CoveredBySubRegs */
810 .SuperClasses: DREGSLD8loSuperclasses, .SuperClassesSize: 13,
811 .OrderFunc: nullptr
812 };
813
814 extern const TargetRegisterClass IWREGSRegClass = {
815 .MC: &AVRMCRegisterClasses[IWREGSRegClassID],
816 .SubClassMask: IWREGSSubClassMask,
817 .SuperRegIndices: SuperRegIdxSeqs + 2,
818 .LaneMask: LaneBitmask(0x0000000000000003),
819 .AllocationPriority: 0,
820 .GlobalPriority: false,
821 .TSFlags: 0x00, /* TSFlags */
822 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
823 .CoveredBySubRegs: true, /* CoveredBySubRegs */
824 .SuperClasses: IWREGSSuperclasses, .SuperClassesSize: 5,
825 .OrderFunc: nullptr
826 };
827
828 extern const TargetRegisterClass DREGSNOZ_and_IWREGSRegClass = {
829 .MC: &AVRMCRegisterClasses[DREGSNOZ_and_IWREGSRegClassID],
830 .SubClassMask: DREGSNOZ_and_IWREGSSubClassMask,
831 .SuperRegIndices: SuperRegIdxSeqs + 2,
832 .LaneMask: LaneBitmask(0x0000000000000003),
833 .AllocationPriority: 0,
834 .GlobalPriority: false,
835 .TSFlags: 0x00, /* TSFlags */
836 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
837 .CoveredBySubRegs: true, /* CoveredBySubRegs */
838 .SuperClasses: DREGSNOZ_and_IWREGSSuperclasses, .SuperClassesSize: 11,
839 .OrderFunc: nullptr
840 };
841
842 extern const TargetRegisterClass PTRREGSRegClass = {
843 .MC: &AVRMCRegisterClasses[PTRREGSRegClassID],
844 .SubClassMask: PTRREGSSubClassMask,
845 .SuperRegIndices: SuperRegIdxSeqs + 2,
846 .LaneMask: LaneBitmask(0x0000000000000003),
847 .AllocationPriority: 0,
848 .GlobalPriority: false,
849 .TSFlags: 0x00, /* TSFlags */
850 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
851 .CoveredBySubRegs: true, /* CoveredBySubRegs */
852 .SuperClasses: PTRREGSSuperclasses, .SuperClassesSize: 6,
853 .OrderFunc: nullptr
854 };
855
856 extern const TargetRegisterClass DREGSNOZ_and_PTRREGSRegClass = {
857 .MC: &AVRMCRegisterClasses[DREGSNOZ_and_PTRREGSRegClassID],
858 .SubClassMask: DREGSNOZ_and_PTRREGSSubClassMask,
859 .SuperRegIndices: SuperRegIdxSeqs + 2,
860 .LaneMask: LaneBitmask(0x0000000000000003),
861 .AllocationPriority: 0,
862 .GlobalPriority: false,
863 .TSFlags: 0x00, /* TSFlags */
864 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
865 .CoveredBySubRegs: true, /* CoveredBySubRegs */
866 .SuperClasses: DREGSNOZ_and_PTRREGSSuperclasses, .SuperClassesSize: 13,
867 .OrderFunc: nullptr
868 };
869
870 extern const TargetRegisterClass PTRDISPREGSRegClass = {
871 .MC: &AVRMCRegisterClasses[PTRDISPREGSRegClassID],
872 .SubClassMask: PTRDISPREGSSubClassMask,
873 .SuperRegIndices: SuperRegIdxSeqs + 2,
874 .LaneMask: LaneBitmask(0x0000000000000003),
875 .AllocationPriority: 0,
876 .GlobalPriority: false,
877 .TSFlags: 0x00, /* TSFlags */
878 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
879 .CoveredBySubRegs: true, /* CoveredBySubRegs */
880 .SuperClasses: PTRDISPREGSSuperclasses, .SuperClassesSize: 7,
881 .OrderFunc: nullptr
882 };
883
884 extern const TargetRegisterClass DREGSNOZ_and_PTRDISPREGSRegClass = {
885 .MC: &AVRMCRegisterClasses[DREGSNOZ_and_PTRDISPREGSRegClassID],
886 .SubClassMask: DREGSNOZ_and_PTRDISPREGSSubClassMask,
887 .SuperRegIndices: SuperRegIdxSeqs + 2,
888 .LaneMask: LaneBitmask(0x0000000000000003),
889 .AllocationPriority: 0,
890 .GlobalPriority: false,
891 .TSFlags: 0x00, /* TSFlags */
892 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
893 .CoveredBySubRegs: true, /* CoveredBySubRegs */
894 .SuperClasses: DREGSNOZ_and_PTRDISPREGSSuperclasses, .SuperClassesSize: 15,
895 .OrderFunc: nullptr
896 };
897
898 extern const TargetRegisterClass DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loRegClass = {
899 .MC: &AVRMCRegisterClasses[DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loRegClassID],
900 .SubClassMask: DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loSubClassMask,
901 .SuperRegIndices: SuperRegIdxSeqs + 2,
902 .LaneMask: LaneBitmask(0x0000000000000003),
903 .AllocationPriority: 0,
904 .GlobalPriority: false,
905 .TSFlags: 0x00, /* TSFlags */
906 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
907 .CoveredBySubRegs: true, /* CoveredBySubRegs */
908 .SuperClasses: DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loSuperclasses, .SuperClassesSize: 6,
909 .OrderFunc: nullptr
910 };
911
912 extern const TargetRegisterClass GPRSPRegClass = {
913 .MC: &AVRMCRegisterClasses[GPRSPRegClassID],
914 .SubClassMask: GPRSPSubClassMask,
915 .SuperRegIndices: SuperRegIdxSeqs + 2,
916 .LaneMask: LaneBitmask(0x0000000000000003),
917 .AllocationPriority: 0,
918 .GlobalPriority: false,
919 .TSFlags: 0x00, /* TSFlags */
920 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
921 .CoveredBySubRegs: true, /* CoveredBySubRegs */
922 .SuperClasses: nullptr, .SuperClassesSize: 0,
923 .OrderFunc: nullptr
924 };
925
926 extern const TargetRegisterClass ZREGRegClass = {
927 .MC: &AVRMCRegisterClasses[ZREGRegClassID],
928 .SubClassMask: ZREGSubClassMask,
929 .SuperRegIndices: SuperRegIdxSeqs + 2,
930 .LaneMask: LaneBitmask(0x0000000000000003),
931 .AllocationPriority: 0,
932 .GlobalPriority: false,
933 .TSFlags: 0x00, /* TSFlags */
934 .HasDisjunctSubRegs: true, /* HasDisjunctSubRegs */
935 .CoveredBySubRegs: true, /* CoveredBySubRegs */
936 .SuperClasses: ZREGSuperclasses, .SuperClassesSize: 8,
937 .OrderFunc: nullptr
938 };
939
940
941} // namespace AVR
942static const TargetRegisterClass *const AVRRegisterClasses[] = {
943 &AVR::GPR8RegClass,
944 &AVR::GPR8NOZRegClass,
945 &AVR::GPR8loRegClass,
946 &AVR::LD8RegClass,
947 &AVR::GPR8NOZ_and_LD8RegClass,
948 &AVR::LD8loRegClass,
949 &AVR::CCRRegClass,
950 &AVR::DREGSRegClass,
951 &AVR::DREGSNOZRegClass,
952 &AVR::DREGSMOVWRegClass,
953 &AVR::DREGSMOVW_and_DREGSNOZRegClass,
954 &AVR::DREGS_with_sub_hi_in_LD8RegClass,
955 &AVR::DREGSNOZ_and_DREGS_with_sub_hi_in_LD8RegClass,
956 &AVR::DREGS_with_sub_lo_in_LD8RegClass,
957 &AVR::DREGSNOZ_and_DREGS_with_sub_lo_in_LD8RegClass,
958 &AVR::DREGS_with_sub_lo_in_GPR8loRegClass,
959 &AVR::DREGS_with_sub_hi_in_GPR8loRegClass,
960 &AVR::DLDREGSRegClass,
961 &AVR::DREGS_with_sub_hi_in_LD8loRegClass,
962 &AVR::DREGS_with_sub_lo_in_LD8loRegClass,
963 &AVR::DREGSloRegClass,
964 &AVR::DLDREGS_and_DREGSNOZRegClass,
965 &AVR::DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8RegClass,
966 &AVR::DREGSLD8loRegClass,
967 &AVR::IWREGSRegClass,
968 &AVR::DREGSNOZ_and_IWREGSRegClass,
969 &AVR::PTRREGSRegClass,
970 &AVR::DREGSNOZ_and_PTRREGSRegClass,
971 &AVR::PTRDISPREGSRegClass,
972 &AVR::DREGSNOZ_and_PTRDISPREGSRegClass,
973 &AVR::DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8loRegClass,
974 &AVR::GPRSPRegClass,
975 &AVR::ZREGRegClass,
976 };
977
978static const uint8_t AVRCostPerUseTable[] = {
9790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
980
981
982static const bool AVRInAllocatableClassTable[] = {
983false, true, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, };
984
985
986static const TargetRegisterInfoDesc AVRRegInfoDesc = { // Extra Descriptors
987.CostPerUse: AVRCostPerUseTable, .NumCosts: 1, .InAllocatableClass: AVRInAllocatableClassTable};
988
989unsigned AVRGenRegisterInfo::composeSubRegIndicesImpl(unsigned IdxA, unsigned IdxB) const {
990 static const uint8_t Rows[1][2] = {
991 { 0, 0, },
992 };
993
994 --IdxA; assert(IdxA < 2); (void) IdxA;
995 --IdxB; assert(IdxB < 2);
996 return Rows[0][IdxB];
997}
998
999unsigned AVRGenRegisterInfo::reverseComposeSubRegIndicesImpl(unsigned IdxA, unsigned IdxB) const {
1000 static const uint8_t Table[2][2] = {
1001 { 0, 0, },
1002 { 0, 0, },
1003 };
1004
1005 --IdxA; assert(IdxA < 2);
1006 --IdxB; assert(IdxB < 2);
1007 return Table[IdxA][IdxB];
1008 }
1009
1010 struct MaskRolOp {
1011 LaneBitmask Mask;
1012 uint8_t RotateLeft;
1013 };
1014 static const MaskRolOp LaneMaskComposeSequences[] = {
1015 { .Mask: LaneBitmask(0xFFFFFFFFFFFFFFFF), .RotateLeft: 0 }, { .Mask: LaneBitmask::getNone(), .RotateLeft: 0 }, // Sequence 0
1016 { .Mask: LaneBitmask(0xFFFFFFFFFFFFFFFF), .RotateLeft: 1 }, { .Mask: LaneBitmask::getNone(), .RotateLeft: 0 } // Sequence 2
1017 };
1018 static const uint8_t CompositeSequences[] = {
1019 0, // to sub_hi
1020 2 // to sub_lo
1021 };
1022
1023LaneBitmask AVRGenRegisterInfo::composeSubRegIndexLaneMaskImpl(unsigned IdxA, LaneBitmask LaneMask) const {
1024 --IdxA; assert(IdxA < 2 && "Subregister index out of bounds");
1025 LaneBitmask Result;
1026 for (const MaskRolOp *Ops =
1027 &LaneMaskComposeSequences[CompositeSequences[IdxA]];
1028 Ops->Mask.any(); ++Ops) {
1029 LaneBitmask::Type M = LaneMask.getAsInteger() & Ops->Mask.getAsInteger();
1030 if (unsigned S = Ops->RotateLeft)
1031 Result |= LaneBitmask((M << S) | (M >> (LaneBitmask::BitWidth - S)));
1032 else
1033 Result |= LaneBitmask(M);
1034 }
1035 return Result;
1036}
1037
1038LaneBitmask AVRGenRegisterInfo::reverseComposeSubRegIndexLaneMaskImpl(unsigned IdxA, LaneBitmask LaneMask) const {
1039 LaneMask &= getSubRegIndexLaneMask(SubIdx: IdxA);
1040 --IdxA; assert(IdxA < 2 && "Subregister index out of bounds");
1041 LaneBitmask Result;
1042 for (const MaskRolOp *Ops =
1043 &LaneMaskComposeSequences[CompositeSequences[IdxA]];
1044 Ops->Mask.any(); ++Ops) {
1045 LaneBitmask::Type M = LaneMask.getAsInteger();
1046 if (unsigned S = Ops->RotateLeft)
1047 Result |= LaneBitmask((M >> S) | (M << (LaneBitmask::BitWidth - S)));
1048 else
1049 Result |= LaneBitmask(M);
1050 }
1051 return Result;
1052}
1053
1054const TargetRegisterClass *AVRGenRegisterInfo::getSubClassWithSubReg(const TargetRegisterClass *RC, unsigned Idx) const {
1055 static constexpr uint8_t Table[33][2] = {
1056 { // GPR8
1057 0, // sub_hi
1058 0, // sub_lo
1059 },
1060 { // GPR8NOZ
1061 0, // sub_hi
1062 0, // sub_lo
1063 },
1064 { // GPR8lo
1065 0, // sub_hi
1066 0, // sub_lo
1067 },
1068 { // LD8
1069 0, // sub_hi
1070 0, // sub_lo
1071 },
1072 { // GPR8NOZ_and_LD8
1073 0, // sub_hi
1074 0, // sub_lo
1075 },
1076 { // LD8lo
1077 0, // sub_hi
1078 0, // sub_lo
1079 },
1080 { // CCR
1081 0, // sub_hi
1082 0, // sub_lo
1083 },
1084 { // DREGS
1085 8, // sub_hi -> DREGS
1086 8, // sub_lo -> DREGS
1087 },
1088 { // DREGSNOZ
1089 9, // sub_hi -> DREGSNOZ
1090 9, // sub_lo -> DREGSNOZ
1091 },
1092 { // DREGSMOVW
1093 10, // sub_hi -> DREGSMOVW
1094 10, // sub_lo -> DREGSMOVW
1095 },
1096 { // DREGSMOVW_and_DREGSNOZ
1097 11, // sub_hi -> DREGSMOVW_and_DREGSNOZ
1098 11, // sub_lo -> DREGSMOVW_and_DREGSNOZ
1099 },
1100 { // DREGS_with_sub_hi_in_LD8
1101 12, // sub_hi -> DREGS_with_sub_hi_in_LD8
1102 12, // sub_lo -> DREGS_with_sub_hi_in_LD8
1103 },
1104 { // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
1105 13, // sub_hi -> DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
1106 13, // sub_lo -> DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
1107 },
1108 { // DREGS_with_sub_lo_in_LD8
1109 14, // sub_hi -> DREGS_with_sub_lo_in_LD8
1110 14, // sub_lo -> DREGS_with_sub_lo_in_LD8
1111 },
1112 { // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
1113 15, // sub_hi -> DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
1114 15, // sub_lo -> DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
1115 },
1116 { // DREGS_with_sub_lo_in_GPR8lo
1117 16, // sub_hi -> DREGS_with_sub_lo_in_GPR8lo
1118 16, // sub_lo -> DREGS_with_sub_lo_in_GPR8lo
1119 },
1120 { // DREGS_with_sub_hi_in_GPR8lo
1121 17, // sub_hi -> DREGS_with_sub_hi_in_GPR8lo
1122 17, // sub_lo -> DREGS_with_sub_hi_in_GPR8lo
1123 },
1124 { // DLDREGS
1125 18, // sub_hi -> DLDREGS
1126 18, // sub_lo -> DLDREGS
1127 },
1128 { // DREGS_with_sub_hi_in_LD8lo
1129 19, // sub_hi -> DREGS_with_sub_hi_in_LD8lo
1130 19, // sub_lo -> DREGS_with_sub_hi_in_LD8lo
1131 },
1132 { // DREGS_with_sub_lo_in_LD8lo
1133 20, // sub_hi -> DREGS_with_sub_lo_in_LD8lo
1134 20, // sub_lo -> DREGS_with_sub_lo_in_LD8lo
1135 },
1136 { // DREGSlo
1137 21, // sub_hi -> DREGSlo
1138 21, // sub_lo -> DREGSlo
1139 },
1140 { // DLDREGS_and_DREGSNOZ
1141 22, // sub_hi -> DLDREGS_and_DREGSNOZ
1142 22, // sub_lo -> DLDREGS_and_DREGSNOZ
1143 },
1144 { // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
1145 23, // sub_hi -> DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
1146 23, // sub_lo -> DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
1147 },
1148 { // DREGSLD8lo
1149 24, // sub_hi -> DREGSLD8lo
1150 24, // sub_lo -> DREGSLD8lo
1151 },
1152 { // IWREGS
1153 25, // sub_hi -> IWREGS
1154 25, // sub_lo -> IWREGS
1155 },
1156 { // DREGSNOZ_and_IWREGS
1157 26, // sub_hi -> DREGSNOZ_and_IWREGS
1158 26, // sub_lo -> DREGSNOZ_and_IWREGS
1159 },
1160 { // PTRREGS
1161 27, // sub_hi -> PTRREGS
1162 27, // sub_lo -> PTRREGS
1163 },
1164 { // DREGSNOZ_and_PTRREGS
1165 28, // sub_hi -> DREGSNOZ_and_PTRREGS
1166 28, // sub_lo -> DREGSNOZ_and_PTRREGS
1167 },
1168 { // PTRDISPREGS
1169 29, // sub_hi -> PTRDISPREGS
1170 29, // sub_lo -> PTRDISPREGS
1171 },
1172 { // DREGSNOZ_and_PTRDISPREGS
1173 30, // sub_hi -> DREGSNOZ_and_PTRDISPREGS
1174 30, // sub_lo -> DREGSNOZ_and_PTRDISPREGS
1175 },
1176 { // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1177 31, // sub_hi -> DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1178 31, // sub_lo -> DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1179 },
1180 { // GPRSP
1181 32, // sub_hi -> GPRSP
1182 32, // sub_lo -> GPRSP
1183 },
1184 { // ZREG
1185 33, // sub_hi -> ZREG
1186 33, // sub_lo -> ZREG
1187 },
1188
1189 };
1190 assert(RC && "Missing regclass");
1191 if (!Idx) return RC;
1192 --Idx;
1193 assert(Idx < 2 && "Bad subreg");
1194 unsigned TV = Table[RC->getID()][Idx];
1195 return TV ? getRegClass(i: TV - 1) : nullptr;
1196}const TargetRegisterClass *AVRGenRegisterInfo::getSubRegisterClass(const TargetRegisterClass *RC, unsigned Idx) const {
1197 static constexpr uint8_t Table[33][2] = {
1198 { // GPR8
1199 0, // GPR8:sub_hi
1200 0, // GPR8:sub_lo
1201 },
1202 { // GPR8NOZ
1203 0, // GPR8NOZ:sub_hi
1204 0, // GPR8NOZ:sub_lo
1205 },
1206 { // GPR8lo
1207 0, // GPR8lo:sub_hi
1208 0, // GPR8lo:sub_lo
1209 },
1210 { // LD8
1211 0, // LD8:sub_hi
1212 0, // LD8:sub_lo
1213 },
1214 { // GPR8NOZ_and_LD8
1215 0, // GPR8NOZ_and_LD8:sub_hi
1216 0, // GPR8NOZ_and_LD8:sub_lo
1217 },
1218 { // LD8lo
1219 0, // LD8lo:sub_hi
1220 0, // LD8lo:sub_lo
1221 },
1222 { // CCR
1223 0, // CCR:sub_hi
1224 0, // CCR:sub_lo
1225 },
1226 { // DREGS
1227 1, // DREGS:sub_hi -> GPR8
1228 1, // DREGS:sub_lo -> GPR8
1229 },
1230 { // DREGSNOZ
1231 2, // DREGSNOZ:sub_hi -> GPR8NOZ
1232 2, // DREGSNOZ:sub_lo -> GPR8NOZ
1233 },
1234 { // DREGSMOVW
1235 1, // DREGSMOVW:sub_hi -> GPR8
1236 1, // DREGSMOVW:sub_lo -> GPR8
1237 },
1238 { // DREGSMOVW_and_DREGSNOZ
1239 2, // DREGSMOVW_and_DREGSNOZ:sub_hi -> GPR8NOZ
1240 2, // DREGSMOVW_and_DREGSNOZ:sub_lo -> GPR8NOZ
1241 },
1242 { // DREGS_with_sub_hi_in_LD8
1243 4, // DREGS_with_sub_hi_in_LD8:sub_hi -> LD8
1244 1, // DREGS_with_sub_hi_in_LD8:sub_lo -> GPR8
1245 },
1246 { // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
1247 5, // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8:sub_hi -> GPR8NOZ_and_LD8
1248 2, // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8:sub_lo -> GPR8NOZ
1249 },
1250 { // DREGS_with_sub_lo_in_LD8
1251 4, // DREGS_with_sub_lo_in_LD8:sub_hi -> LD8
1252 4, // DREGS_with_sub_lo_in_LD8:sub_lo -> LD8
1253 },
1254 { // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
1255 5, // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8:sub_hi -> GPR8NOZ_and_LD8
1256 5, // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8:sub_lo -> GPR8NOZ_and_LD8
1257 },
1258 { // DREGS_with_sub_lo_in_GPR8lo
1259 2, // DREGS_with_sub_lo_in_GPR8lo:sub_hi -> GPR8NOZ
1260 3, // DREGS_with_sub_lo_in_GPR8lo:sub_lo -> GPR8lo
1261 },
1262 { // DREGS_with_sub_hi_in_GPR8lo
1263 3, // DREGS_with_sub_hi_in_GPR8lo:sub_hi -> GPR8lo
1264 3, // DREGS_with_sub_hi_in_GPR8lo:sub_lo -> GPR8lo
1265 },
1266 { // DLDREGS
1267 4, // DLDREGS:sub_hi -> LD8
1268 4, // DLDREGS:sub_lo -> LD8
1269 },
1270 { // DREGS_with_sub_hi_in_LD8lo
1271 6, // DREGS_with_sub_hi_in_LD8lo:sub_hi -> LD8lo
1272 2, // DREGS_with_sub_hi_in_LD8lo:sub_lo -> GPR8NOZ
1273 },
1274 { // DREGS_with_sub_lo_in_LD8lo
1275 5, // DREGS_with_sub_lo_in_LD8lo:sub_hi -> GPR8NOZ_and_LD8
1276 6, // DREGS_with_sub_lo_in_LD8lo:sub_lo -> LD8lo
1277 },
1278 { // DREGSlo
1279 3, // DREGSlo:sub_hi -> GPR8lo
1280 3, // DREGSlo:sub_lo -> GPR8lo
1281 },
1282 { // DLDREGS_and_DREGSNOZ
1283 5, // DLDREGS_and_DREGSNOZ:sub_hi -> GPR8NOZ_and_LD8
1284 5, // DLDREGS_and_DREGSNOZ:sub_lo -> GPR8NOZ_and_LD8
1285 },
1286 { // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
1287 6, // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8:sub_hi -> LD8lo
1288 6, // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8:sub_lo -> LD8lo
1289 },
1290 { // DREGSLD8lo
1291 6, // DREGSLD8lo:sub_hi -> LD8lo
1292 6, // DREGSLD8lo:sub_lo -> LD8lo
1293 },
1294 { // IWREGS
1295 4, // IWREGS:sub_hi -> LD8
1296 4, // IWREGS:sub_lo -> LD8
1297 },
1298 { // DREGSNOZ_and_IWREGS
1299 5, // DREGSNOZ_and_IWREGS:sub_hi -> GPR8NOZ_and_LD8
1300 5, // DREGSNOZ_and_IWREGS:sub_lo -> GPR8NOZ_and_LD8
1301 },
1302 { // PTRREGS
1303 4, // PTRREGS:sub_hi -> LD8
1304 4, // PTRREGS:sub_lo -> LD8
1305 },
1306 { // DREGSNOZ_and_PTRREGS
1307 5, // DREGSNOZ_and_PTRREGS:sub_hi -> GPR8NOZ_and_LD8
1308 5, // DREGSNOZ_and_PTRREGS:sub_lo -> GPR8NOZ_and_LD8
1309 },
1310 { // PTRDISPREGS
1311 4, // PTRDISPREGS:sub_hi -> LD8
1312 4, // PTRDISPREGS:sub_lo -> LD8
1313 },
1314 { // DREGSNOZ_and_PTRDISPREGS
1315 5, // DREGSNOZ_and_PTRDISPREGS:sub_hi -> GPR8NOZ_and_LD8
1316 5, // DREGSNOZ_and_PTRDISPREGS:sub_lo -> GPR8NOZ_and_LD8
1317 },
1318 { // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1319 6, // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo:sub_hi -> LD8lo
1320 3, // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo:sub_lo -> GPR8lo
1321 },
1322 { // GPRSP
1323 0, // GPRSP:sub_hi
1324 0, // GPRSP:sub_lo
1325 },
1326 { // ZREG
1327 4, // ZREG:sub_hi -> LD8
1328 4, // ZREG:sub_lo -> LD8
1329 },
1330
1331 };
1332 assert(RC && "Missing regclass");
1333 if (!Idx) return RC;
1334 --Idx;
1335 assert(Idx < 2 && "Bad subreg");
1336 unsigned TV = Table[RC->getID()][Idx];
1337 return TV ? getRegClass(i: TV - 1) : nullptr;
1338}/// Get the weight in units of pressure for this register class.
1339const RegClassWeight &AVRGenRegisterInfo::
1340getRegClassWeight(const TargetRegisterClass *RC) const {
1341 static const RegClassWeight RCWeightTable[] = {
1342 {.RegWeight: 1, .WeightLimit: 32}, // GPR8
1343 {.RegWeight: 1, .WeightLimit: 30}, // GPR8NOZ
1344 {.RegWeight: 1, .WeightLimit: 16}, // GPR8lo
1345 {.RegWeight: 1, .WeightLimit: 16}, // LD8
1346 {.RegWeight: 1, .WeightLimit: 14}, // GPR8NOZ_and_LD8
1347 {.RegWeight: 1, .WeightLimit: 8}, // LD8lo
1348 {.RegWeight: 1, .WeightLimit: 1}, // CCR
1349 {.RegWeight: 2, .WeightLimit: 32}, // DREGS
1350 {.RegWeight: 2, .WeightLimit: 30}, // DREGSNOZ
1351 {.RegWeight: 2, .WeightLimit: 32}, // DREGSMOVW
1352 {.RegWeight: 2, .WeightLimit: 30}, // DREGSMOVW_and_DREGSNOZ
1353 {.RegWeight: 2, .WeightLimit: 17}, // DREGS_with_sub_hi_in_LD8
1354 {.RegWeight: 2, .WeightLimit: 15}, // DREGSNOZ_and_DREGS_with_sub_hi_in_LD8
1355 {.RegWeight: 2, .WeightLimit: 16}, // DREGS_with_sub_lo_in_LD8
1356 {.RegWeight: 2, .WeightLimit: 14}, // DREGSNOZ_and_DREGS_with_sub_lo_in_LD8
1357 {.RegWeight: 2, .WeightLimit: 17}, // DREGS_with_sub_lo_in_GPR8lo
1358 {.RegWeight: 2, .WeightLimit: 16}, // DREGS_with_sub_hi_in_GPR8lo
1359 {.RegWeight: 2, .WeightLimit: 16}, // DLDREGS
1360 {.RegWeight: 2, .WeightLimit: 9}, // DREGS_with_sub_hi_in_LD8lo
1361 {.RegWeight: 2, .WeightLimit: 9}, // DREGS_with_sub_lo_in_LD8lo
1362 {.RegWeight: 2, .WeightLimit: 16}, // DREGSlo
1363 {.RegWeight: 2, .WeightLimit: 14}, // DLDREGS_and_DREGSNOZ
1364 {.RegWeight: 2, .WeightLimit: 8}, // DREGS_with_sub_hi_in_LD8lo_and_DREGS_with_sub_lo_in_LD8
1365 {.RegWeight: 2, .WeightLimit: 8}, // DREGSLD8lo
1366 {.RegWeight: 2, .WeightLimit: 8}, // IWREGS
1367 {.RegWeight: 2, .WeightLimit: 6}, // DREGSNOZ_and_IWREGS
1368 {.RegWeight: 2, .WeightLimit: 6}, // PTRREGS
1369 {.RegWeight: 2, .WeightLimit: 4}, // DREGSNOZ_and_PTRREGS
1370 {.RegWeight: 2, .WeightLimit: 4}, // PTRDISPREGS
1371 {.RegWeight: 2, .WeightLimit: 2}, // DREGSNOZ_and_PTRDISPREGS
1372 {.RegWeight: 2, .WeightLimit: 2}, // DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1373 {.RegWeight: 2, .WeightLimit: 2}, // GPRSP
1374 {.RegWeight: 2, .WeightLimit: 2}, // ZREG
1375 };
1376 return RCWeightTable[RC->getID()];
1377}
1378
1379/// Get the weight in units of pressure for this register unit.
1380unsigned AVRGenRegisterInfo::
1381getRegUnitWeight(MCRegUnit RegUnit) const {
1382 assert(static_cast<unsigned>(RegUnit) < 35 && "invalid register unit");
1383 // All register units have unit weight.
1384 return 1;
1385}
1386
1387
1388// Get the number of dimensions of register pressure.
1389unsigned AVRGenRegisterInfo::getNumRegPressureSets() const {
1390 return 9;
1391}
1392
1393// Get the name of this register unit pressure set.
1394const char *AVRGenRegisterInfo::
1395getRegPressureSetName(unsigned Idx) const {
1396 static const char *PressureNameTable[] = {
1397 "CCR",
1398 "DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo",
1399 "GPRSP",
1400 "IWREGS",
1401 "LD8lo",
1402 "LD8",
1403 "GPR8lo",
1404 "GPR8lo_with_LD8lo",
1405 "GPR8",
1406 };
1407 return PressureNameTable[Idx];
1408}
1409
1410// Get the register unit pressure limit for this dimension.
1411// This limit must be adjusted dynamically for reserved registers.
1412unsigned AVRGenRegisterInfo::
1413getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const {
1414 static const uint8_t PressureLimitTable[] = {
1415 1, // 0: CCR
1416 2, // 1: DREGS_with_sub_hi_in_LD8_and_DREGS_with_sub_lo_in_GPR8lo
1417 2, // 2: GPRSP
1418 8, // 3: IWREGS
1419 10, // 4: LD8lo
1420 17, // 5: LD8
1421 17, // 6: GPR8lo
1422 25, // 7: GPR8lo_with_LD8lo
1423 32, // 8: GPR8
1424 };
1425 return PressureLimitTable[Idx];
1426}
1427
1428/// Table of pressure sets per register class or unit.
1429static const int RCSetsTable[] = {
1430 /* 0 */ 0, -1,
1431 /* 2 */ 2, -1,
1432 /* 4 */ 3, 5, 8, -1,
1433 /* 8 */ 3, 4, 5, 7, 8, -1,
1434 /* 14 */ 1, 4, 5, 6, 7, 8, -1,
1435};
1436
1437/// Get the dimensions of register pressure impacted by this register class.
1438/// Returns a -1 terminated array of pressure set IDs
1439const int *AVRGenRegisterInfo::
1440getRegClassPressureSets(const TargetRegisterClass *RC) const {
1441 static const uint8_t RCSetStartTable[] = {
1442 6,6,17,5,5,9,0,6,6,6,6,5,5,5,5,17,17,5,9,9,17,5,9,9,4,4,4,4,4,4,14,2,4,};
1443 return &RCSetsTable[RCSetStartTable[RC->getID()]];
1444}
1445
1446/// Get the dimensions of register pressure impacted by this register unit.
1447/// Returns a -1 terminated array of pressure set IDs
1448const int *AVRGenRegisterInfo::
1449getRegUnitPressureSets(MCRegUnit RegUnit) const {
1450 assert(static_cast<unsigned>(RegUnit) < 35 && "invalid register unit");
1451 static const uint8_t RUSetStartTable[] = {
1452 2,2,0,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,14,14,9,9,9,9,9,9,9,8,4,4,4,4,4,4,4,};
1453 return &RCSetsTable[RUSetStartTable[static_cast<unsigned>(RegUnit)]];
1454}
1455
1456extern const MCRegisterDesc AVRRegDesc[];
1457extern const int16_t AVRRegDiffLists[];
1458extern const LaneBitmask AVRLaneMaskLists[];
1459extern const char AVRRegStrings[];
1460extern const char AVRRegClassStrings[];
1461extern const MCPhysReg AVRRegUnitRoots[][2];
1462extern const uint16_t AVRSubRegIdxLists[];
1463extern const uint16_t AVRRegEncodingTable[];
1464// AVR Dwarf<->LLVM register mappings.
1465extern const MCRegisterInfo::DwarfLLVMRegPair AVRDwarfFlavour0Dwarf2L[];
1466extern const unsigned AVRDwarfFlavour0Dwarf2LSize;
1467
1468extern const MCRegisterInfo::DwarfLLVMRegPair AVREHFlavour0Dwarf2L[];
1469extern const unsigned AVREHFlavour0Dwarf2LSize;
1470
1471extern const MCRegisterInfo::DwarfLLVMRegPair AVRDwarfFlavour0L2Dwarf[];
1472extern const unsigned AVRDwarfFlavour0L2DwarfSize;
1473
1474extern const MCRegisterInfo::DwarfLLVMRegPair AVREHFlavour0L2Dwarf[];
1475extern const unsigned AVREHFlavour0L2DwarfSize;
1476
1477
1478AVRGenRegisterInfo::
1479AVRGenRegisterInfo(unsigned RA, unsigned DwarfFlavour, unsigned EHFlavour,
1480 unsigned PC, unsigned HwMode)
1481 : TargetRegisterInfo(&AVRRegInfoDesc, AVRRegisterClasses,
1482 AVRSubRegIndexStrings, AVRSubRegIndexNameOffsets,
1483 AVRSubRegIdxRangeTable, AVRSubRegIndexLaneMaskTable,
1484
1485 LaneBitmask(0xFFFFFFFFFFFFFFFF), AVRRegClassInfos, AVRVTLists, HwMode) {
1486 InitMCRegisterInfo(D: AVRRegDesc, NR: 62, RA, PC,
1487 C: AVRMCRegisterClasses, NC: 33, RURoots: AVRRegUnitRoots, NRU: 35, DL: AVRRegDiffLists,
1488 RUMS: AVRLaneMaskLists, Strings: AVRRegStrings, ClassStrings: AVRRegClassStrings, SubIndices: AVRSubRegIdxLists, NumIndices: 3,
1489 RET: AVRRegEncodingTable, RUI: nullptr);
1490
1491 switch (DwarfFlavour) {
1492 default:
1493 llvm_unreachable("Unknown DWARF flavour");
1494 case 0:
1495 mapDwarfRegsToLLVMRegs(Map: AVRDwarfFlavour0Dwarf2L, Size: AVRDwarfFlavour0Dwarf2LSize, isEH: false);
1496 break;
1497 }
1498 switch (EHFlavour) {
1499 default:
1500 llvm_unreachable("Unknown DWARF flavour");
1501 case 0:
1502 mapDwarfRegsToLLVMRegs(Map: AVREHFlavour0Dwarf2L, Size: AVREHFlavour0Dwarf2LSize, isEH: true);
1503 break;
1504 }
1505 switch (DwarfFlavour) {
1506 default:
1507 llvm_unreachable("Unknown DWARF flavour");
1508 case 0:
1509 mapLLVMRegsToDwarfRegs(Map: AVRDwarfFlavour0L2Dwarf, Size: AVRDwarfFlavour0L2DwarfSize, isEH: false);
1510 break;
1511 }
1512 switch (EHFlavour) {
1513 default:
1514 llvm_unreachable("Unknown DWARF flavour");
1515 case 0:
1516 mapLLVMRegsToDwarfRegs(Map: AVREHFlavour0L2Dwarf, Size: AVREHFlavour0L2DwarfSize, isEH: true);
1517 break;
1518 }
1519}
1520
1521static const MCPhysReg CSR_Interrupts_SaveList[] = { AVR::R31, AVR::R30, AVR::R29, AVR::R28, AVR::R27, AVR::R26, AVR::R25, AVR::R24, AVR::R23, AVR::R22, AVR::R21, AVR::R20, AVR::R19, AVR::R18, AVR::R17, AVR::R16, AVR::R15, AVR::R14, AVR::R13, AVR::R12, AVR::R11, AVR::R10, AVR::R9, AVR::R8, AVR::R7, AVR::R6, AVR::R5, AVR::R4, AVR::R3, AVR::R2, 0 };
1522static const uint32_t CSR_Interrupts_RegMask[] = { 0xffffff80, 0x3fffffdf, };
1523static const MCPhysReg CSR_InterruptsTiny_SaveList[] = { AVR::R31, AVR::R30, AVR::R29, AVR::R28, AVR::R27, AVR::R26, AVR::R25, AVR::R24, AVR::R23, AVR::R22, AVR::R21, AVR::R20, AVR::R19, AVR::R18, 0 };
1524static const uint32_t CSR_InterruptsTiny_RegMask[] = { 0xff800000, 0x3ff8001f, };
1525static const MCPhysReg CSR_Normal_SaveList[] = { AVR::R29, AVR::R28, AVR::R17, AVR::R16, AVR::R15, AVR::R14, AVR::R13, AVR::R12, AVR::R11, AVR::R10, AVR::R9, AVR::R8, AVR::R7, AVR::R6, AVR::R5, AVR::R4, AVR::R3, AVR::R2, 0 };
1526static const uint32_t CSR_Normal_RegMask[] = { 0x007fff80, 0x1003ffc6, };
1527static const MCPhysReg CSR_NormalTiny_SaveList[] = { AVR::R29, AVR::R28, AVR::R19, AVR::R18, 0 };
1528static const uint32_t CSR_NormalTiny_RegMask[] = { 0x01800000, 0x10080006, };
1529
1530
1531ArrayRef<const uint32_t *> AVRGenRegisterInfo::getRegMasks() const {
1532 static const uint32_t *const Masks[] = {
1533 CSR_Interrupts_RegMask,
1534 CSR_InterruptsTiny_RegMask,
1535 CSR_Normal_RegMask,
1536 CSR_NormalTiny_RegMask,
1537 };
1538 return ArrayRef(Masks);
1539}
1540
1541bool AVRGenRegisterInfo::
1542isGeneralPurposeRegister(const MachineFunction &MF, MCRegister PhysReg) const {
1543 return
1544 false;
1545}
1546
1547bool AVRGenRegisterInfo::
1548isGeneralPurposeRegisterClass(const TargetRegisterClass *RC) const {
1549 return
1550 false;
1551}
1552
1553bool AVRGenRegisterInfo::
1554isFixedRegister(const MachineFunction &MF, MCRegister PhysReg) const {
1555 return
1556 false;
1557}
1558
1559bool AVRGenRegisterInfo::
1560isArgumentRegister(const MachineFunction &MF, MCRegister PhysReg) const {
1561 return
1562 false;
1563}
1564
1565bool AVRGenRegisterInfo::
1566isConstantPhysReg(MCRegister PhysReg) const {
1567 return
1568 false;
1569}
1570
1571ArrayRef<const char *> AVRGenRegisterInfo::getRegMaskNames() const {
1572 static const char *Names[] = {
1573 "CSR_Interrupts",
1574 "CSR_InterruptsTiny",
1575 "CSR_Normal",
1576 "CSR_NormalTiny",
1577 };
1578 return ArrayRef(Names);
1579}
1580
1581const AVRFrameLowering *
1582AVRGenRegisterInfo::getFrameLowering(const MachineFunction &MF) {
1583 return static_cast<const AVRFrameLowering *>(
1584 MF.getSubtarget().getFrameLowering());
1585}
1586
1587
1588} // namespace llvm
1589