1 //===-- PPCRegisterInfo.td - The PowerPC Register File -----*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 let Namespace = "PPC" in {
13 def sub_lt : SubRegIndex<1>;
14 def sub_gt : SubRegIndex<1, 1>;
15 def sub_eq : SubRegIndex<1, 2>;
16 def sub_un : SubRegIndex<1, 3>;
17 def sub_32 : SubRegIndex<32>;
18 def sub_32_hi_phony : SubRegIndex<32,32>;
19 def sub_64 : SubRegIndex<64>;
20 def sub_64_hi_phony : SubRegIndex<64,64>;
21 def sub_vsx0 : SubRegIndex<128>;
22 def sub_vsx1 : SubRegIndex<128, 128>;
23 def sub_gp8_x0 : SubRegIndex<64>;
24 def sub_gp8_x1 : SubRegIndex<64, 64>;
25 def sub_fp0 : SubRegIndex<64>;
26 def sub_fp1 : SubRegIndex<64, 64>;
30 class PPCReg<string n> : Register<n> {
31 let Namespace = "PPC";
34 // We identify all our registers with a 5-bit ID, for consistency's sake.
36 // GPR - One of the 32 32-bit general-purpose registers
37 class GPR<bits<5> num, string n> : PPCReg<n> {
38 let HWEncoding{4-0} = num;
41 // GP8 - One of the 32 64-bit general-purpose registers
42 class GP8<GPR SubReg, string n> : PPCReg<n> {
43 let HWEncoding = SubReg.HWEncoding;
44 let SubRegs = [SubReg];
45 let SubRegIndices = [sub_32];
48 class SPE<string n, bits<5> Enc, list<Register> subregs = []> : PPCReg<n> {
49 let HWEncoding{4-0} = Enc;
50 let SubRegs = subregs;
51 let SubRegIndices = [sub_32, sub_32_hi_phony];
52 let CoveredBySubRegs = 1;
54 // SPR - One of the 32-bit special-purpose registers
55 class SPR<bits<10> num, string n> : PPCReg<n> {
56 let HWEncoding{9-0} = num;
59 // FPR - One of the 32 64-bit floating-point registers
60 class FPR<bits<5> num, string n> : PPCReg<n> {
61 let HWEncoding{4-0} = num;
64 // FPPair - A pair of 64-bit floating-point registers.
65 class FPPair<string n, bits<5> EvenIndex> : PPCReg<n> {
66 assert !eq(EvenIndex{0}, 0), "Index should be even.";
67 let HWEncoding{4-0} = EvenIndex;
68 let SubRegs = [!cast<FPR>("F"#EvenIndex), !cast<FPR>("F"#!add(EvenIndex, 1))];
69 let DwarfNumbers = [-1, -1];
70 let SubRegIndices = [sub_fp0, sub_fp1];
73 // VF - One of the 32 64-bit floating-point subregisters of the vector
74 // registers (used by VSX).
75 class VF<bits<5> num, string n> : PPCReg<n> {
76 let HWEncoding{4-0} = num;
77 let HWEncoding{5} = 1;
80 // VR - One of the 32 128-bit vector registers
81 class VR<VF SubReg, VF SubRegH, string n> : PPCReg<n> {
82 let HWEncoding{4-0} = SubReg.HWEncoding{4-0};
83 let HWEncoding{5} = 0;
84 let SubRegs = [SubReg, SubRegH];
85 let SubRegIndices = [sub_64, sub_64_hi_phony];
88 // VSRL - One of the 32 128-bit VSX registers that overlap with the scalar
89 // floating-point registers.
90 class VSRL<FPR SubReg, FPR SubRegH, string n> : PPCReg<n> {
91 let HWEncoding = SubReg.HWEncoding;
92 let SubRegs = [SubReg, SubRegH];
93 let SubRegIndices = [sub_64, sub_64_hi_phony];
96 // VSXReg - One of the VSX registers in the range vs32-vs63 with numbering
97 // and encoding to match.
98 class VSXReg<bits<6> num, string n> : PPCReg<n> {
99 let HWEncoding{5-0} = num;
102 // CR - One of the 8 4-bit condition registers
103 class CR<bits<3> num, string n, list<Register> subregs> : PPCReg<n> {
104 let HWEncoding{2-0} = num;
105 let SubRegs = subregs;
108 // CRBIT - One of the 32 1-bit condition register fields
109 class CRBIT<bits<5> num, string n> : PPCReg<n> {
110 let HWEncoding{4-0} = num;
113 // VSR Pairs - One of the 32 paired even-odd consecutive VSRs.
114 class VSRPair<bits<5> num, string n, list<Register> subregs> : PPCReg<n> {
115 let HWEncoding{4-0} = num;
116 let SubRegs = subregs;
119 // GP8Pair - Consecutive even-odd paired GP8.
120 class GP8Pair<string n, bits<5> EvenIndex> : PPCReg<n> {
121 assert !eq(EvenIndex{0}, 0), "Index should be even.";
122 let HWEncoding{4-0} = EvenIndex;
123 let SubRegs = [!cast<GP8>("X"#EvenIndex), !cast<GP8>("X"#!add(EvenIndex, 1))];
124 let DwarfNumbers = [-1, -1];
125 let SubRegIndices = [sub_gp8_x0, sub_gp8_x1];
128 // General-purpose registers
129 foreach Index = 0-31 in {
130 def R#Index : GPR<Index, "r"#Index>, DwarfRegNum<[-2, Index]>;
133 let isArtificial = 1 in {
134 foreach Index = 0-31 in {
135 def H#Index : GPR<-1,"">;
139 // 64-bit General-purpose registers
140 foreach Index = 0-31 in {
141 def X#Index : GP8<!cast<GPR>("R"#Index), "r"#Index>,
142 DwarfRegNum<[Index, -2]>;
146 foreach Index = 0-31 in {
147 def S#Index : SPE<"r"#Index, Index, [!cast<GPR>("R"#Index), !cast<GPR>("H"#Index)]>,
148 DwarfRegNum<[!add(Index, 1200), !add(Index, 1200)]>;
153 // Floating-point registers
154 foreach Index = 0-31 in {
155 def F#Index : FPR<Index, "f"#Index>,
156 DwarfRegNum<[!add(Index, 32), !add(Index, 32)]>;
159 // The FH and VFH registers have been marked as Artifical because there are no
160 // instructions on PowerPC that use those register classes. They only exist
161 // in order to ensure that the super registers (V and VSL) are covered by their
162 // subregisters and have correct subregister lane masks.
163 let isArtificial = 1 in {
164 foreach Index = 0-31 in {
165 def FH#Index : FPR<-1, "">;
166 def VFH#Index : VF<-1, "">;
170 let isAllocatable = 0, CopyCost = -1 in {
171 def VFHRC : RegisterClass<"PPC", [f64], 64, (sequence "VFH%u", 0, 31)>;
172 def FHRC : RegisterClass<"PPC", [f64], 64, (sequence "FH%u", 0, 31)>;
175 // Floating-point pair registers
176 foreach Index = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 } in {
177 def Fpair#Index : FPPair<"fp"#Index, Index>;
180 // 64-bit Floating-point subregisters of Altivec registers
181 // Note: the register names are v0-v31 or vs32-vs63 depending on the use.
182 // Custom C++ code is used to produce the correct name and encoding.
183 foreach Index = 0-31 in {
184 def VF#Index : VF<Index, "v" #Index>,
185 DwarfRegNum<[!add(Index, 77), !add(Index, 77)]>;
188 let CoveredBySubRegs = 1 in {
190 foreach Index = 0-31 in {
191 def V#Index : VR<!cast<VF>("VF"#Index), !cast<VF>("VFH"#Index), "v"#Index>,
192 DwarfRegNum<[!add(Index, 77), !add(Index, 77)]>;
196 foreach Index = 0-31 in {
197 def VSL#Index : VSRL<!cast<FPR>("F"#Index), !cast<FPR>("FH"#Index), "vs"#Index>,
198 DwarfRegAlias<!cast<FPR>("F"#Index)>;
202 // Dummy VSX registers, this defines string: "vs32"-"vs63", and is only used for
204 foreach Index = 32-63 in {
205 def VSX#Index : VSXReg<Index, "vs"#Index>;
208 let SubRegIndices = [sub_vsx0, sub_vsx1] in {
209 // VSR pairs 0 - 15 (corresponding to VSRs 0 - 30 paired with 1 - 31).
210 foreach Index = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 } in {
211 def VSRp#!srl(Index, 1) : VSRPair<!srl(Index, 1), "vsp"#Index,
212 [!cast<VSRL>("VSL"#Index), !cast<VSRL>("VSL"#!add(Index, 1))]>,
213 DwarfRegNum<[-1, -1]>;
216 // VSR pairs 16 - 31 (corresponding to VSRs 32 - 62 paired with 33 - 63).
217 foreach Index = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 } in {
218 def VSRp#!add(!srl(Index, 1), 16) :
219 VSRPair<!add(!srl(Index, 1), 16), "vsp"#!add(Index, 32),
220 [!cast<VR>("V"#Index), !cast<VR>("V"#!add(Index, 1))]>,
221 DwarfRegAlias<!cast<VR>("V"#Index)>;
225 // 16 paired even-odd consecutive GP8s.
226 foreach Index = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 } in {
227 def G8p#!srl(Index, 1) : GP8Pair<"r"#Index, Index>;
230 // The representation of r0 when treated as the constant 0.
231 let isConstant = true in {
232 def ZERO : GPR<0, "0">, DwarfRegAlias<R0>;
233 def ZERO8 : GP8<ZERO, "0">, DwarfRegAlias<X0>;
234 } // isConstant = true
236 // Representations of the frame pointer used by ISD::FRAMEADDR.
237 def FP : GPR<0 /* arbitrary */, "**FRAME POINTER**">;
238 def FP8 : GP8<FP, "**FRAME POINTER**">;
240 // Representations of the base pointer used by setjmp.
241 def BP : GPR<0 /* arbitrary */, "**BASE POINTER**">;
242 def BP8 : GP8<BP, "**BASE POINTER**">;
244 // Condition register bits
245 def CR0LT : CRBIT< 0, "0">;
246 def CR0GT : CRBIT< 1, "1">;
247 def CR0EQ : CRBIT< 2, "2">;
248 def CR0UN : CRBIT< 3, "3">;
249 def CR1LT : CRBIT< 4, "4">;
250 def CR1GT : CRBIT< 5, "5">;
251 def CR1EQ : CRBIT< 6, "6">;
252 def CR1UN : CRBIT< 7, "7">;
253 def CR2LT : CRBIT< 8, "8">;
254 def CR2GT : CRBIT< 9, "9">;
255 def CR2EQ : CRBIT<10, "10">;
256 def CR2UN : CRBIT<11, "11">;
257 def CR3LT : CRBIT<12, "12">;
258 def CR3GT : CRBIT<13, "13">;
259 def CR3EQ : CRBIT<14, "14">;
260 def CR3UN : CRBIT<15, "15">;
261 def CR4LT : CRBIT<16, "16">;
262 def CR4GT : CRBIT<17, "17">;
263 def CR4EQ : CRBIT<18, "18">;
264 def CR4UN : CRBIT<19, "19">;
265 def CR5LT : CRBIT<20, "20">;
266 def CR5GT : CRBIT<21, "21">;
267 def CR5EQ : CRBIT<22, "22">;
268 def CR5UN : CRBIT<23, "23">;
269 def CR6LT : CRBIT<24, "24">;
270 def CR6GT : CRBIT<25, "25">;
271 def CR6EQ : CRBIT<26, "26">;
272 def CR6UN : CRBIT<27, "27">;
273 def CR7LT : CRBIT<28, "28">;
274 def CR7GT : CRBIT<29, "29">;
275 def CR7EQ : CRBIT<30, "30">;
276 def CR7UN : CRBIT<31, "31">;
278 // Condition registers
279 let SubRegIndices = [sub_lt, sub_gt, sub_eq, sub_un] in {
280 def CR0 : CR<0, "cr0", [CR0LT, CR0GT, CR0EQ, CR0UN]>, DwarfRegNum<[68, 68]>;
281 def CR1 : CR<1, "cr1", [CR1LT, CR1GT, CR1EQ, CR1UN]>, DwarfRegNum<[69, 69]>;
282 def CR2 : CR<2, "cr2", [CR2LT, CR2GT, CR2EQ, CR2UN]>, DwarfRegNum<[70, 70]>;
283 def CR3 : CR<3, "cr3", [CR3LT, CR3GT, CR3EQ, CR3UN]>, DwarfRegNum<[71, 71]>;
284 def CR4 : CR<4, "cr4", [CR4LT, CR4GT, CR4EQ, CR4UN]>, DwarfRegNum<[72, 72]>;
285 def CR5 : CR<5, "cr5", [CR5LT, CR5GT, CR5EQ, CR5UN]>, DwarfRegNum<[73, 73]>;
286 def CR6 : CR<6, "cr6", [CR6LT, CR6GT, CR6EQ, CR6UN]>, DwarfRegNum<[74, 74]>;
287 def CR7 : CR<7, "cr7", [CR7LT, CR7GT, CR7EQ, CR7UN]>, DwarfRegNum<[75, 75]>;
291 def LR : SPR<8, "lr">, DwarfRegNum<[-2, 65]>;
292 def LR8 : SPR<8, "lr">, DwarfRegNum<[65, -2]> {
297 def CTR : SPR<9, "ctr">, DwarfRegNum<[-2, 66]>;
298 def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66, -2]> {
303 def VRSAVE: SPR<256, "vrsave">, DwarfRegNum<[109]>;
305 // SPE extra registers
306 def SPEFSCR: SPR<512, "spefscr">, DwarfRegNum<[612, 112]>;
308 def XER: SPR<1, "xer">, DwarfRegNum<[76]>;
310 // Carry bit. In the architecture this is really bit 0 of the XER register
311 // (which really is SPR register 1); this is the only bit interesting to a
313 def CARRY: SPR<1, "xer">, DwarfRegNum<[76]> {
317 // FP rounding mode: bits 30 and 31 of the FP status and control register
318 // This is not allocated as a normal register; it appears only in
319 // Uses and Defs. The ABI says it needs to be preserved by a function,
320 // but this is not achieved by saving and restoring it as with
321 // most registers, it has to be done in code; to make this work all the
322 // return and call instructions are described as Uses of RM, so instructions
323 // that do nothing but change RM will not get deleted.
324 def RM: PPCReg<"**ROUNDING MODE**">;
326 let isAllocatable = 0 in
327 def GPRC32 : RegisterClass<"PPC", [i32,f32], 32, (add (sequence "H%u", 2, 12),
328 (sequence "H%u", 30, 13),
332 // Allocate volatiles first
333 // then nonvolatiles in reverse order since stmw/lmw save from rN to r31
334 def GPRC : RegisterClass<"PPC", [i32,f32], 32, (add (sequence "R%u", 2, 12),
335 (sequence "R%u", 30, 13),
336 R31, R0, R1, FP, BP)> {
337 // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
338 // put it at the end of the list.
339 // On AIX, CSRs are allocated starting from R31 according to:
340 // https://www.ibm.com/docs/en/ssw_aix_72/assembler/assembler_pdf.pdf.
341 // This also helps setting the correct `NumOfGPRsSaved' in traceback table.
342 let AltOrders = [(add (sub GPRC, R2), R2),
343 (add (sequence "R%u", 2, 12),
344 (sequence "R%u", 31, 13), R0, R1, FP, BP)];
345 let AltOrderSelect = [{
346 return MF.getSubtarget<PPCSubtarget>().getGPRAllocationOrderIdx();
350 def G8RC : RegisterClass<"PPC", [i64], 64, (add (sequence "X%u", 2, 12),
351 (sequence "X%u", 30, 14),
352 X31, X13, X0, X1, FP8, BP8)> {
353 // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
354 // put it at the end of the list.
355 let AltOrders = [(add (sub G8RC, X2), X2),
356 (add (sequence "X%u", 2, 12),
357 (sequence "X%u", 31, 13), X0, X1, FP8, BP8)];
358 let AltOrderSelect = [{
359 return MF.getSubtarget<PPCSubtarget>().getGPRAllocationOrderIdx();
363 // For some instructions r0 is special (representing the value 0 instead of
364 // the value in the r0 register), and we use these register subclasses to
365 // prevent r0 from being allocated for use by those instructions.
366 def GPRC_NOR0 : RegisterClass<"PPC", [i32,f32], 32, (add (sub GPRC, R0), ZERO)> {
367 // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
368 // put it at the end of the list.
369 let AltOrders = [(add (sub GPRC_NOR0, R2), R2),
370 (add (sequence "R%u", 2, 12),
371 (sequence "R%u", 31, 13), R1, FP, BP, ZERO)];
372 let AltOrderSelect = [{
373 return MF.getSubtarget<PPCSubtarget>().getGPRAllocationOrderIdx();
377 def G8RC_NOX0 : RegisterClass<"PPC", [i64], 64, (add (sub G8RC, X0), ZERO8)> {
378 // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
379 // put it at the end of the list.
380 let AltOrders = [(add (sub G8RC_NOX0, X2), X2),
381 (add (sequence "X%u", 2, 12),
382 (sequence "X%u", 31, 13), X1, FP8, BP8, ZERO8)];
383 let AltOrderSelect = [{
384 return MF.getSubtarget<PPCSubtarget>().getGPRAllocationOrderIdx();
388 def SPERC : RegisterClass<"PPC", [f64], 64, (add (sequence "S%u", 2, 12),
389 (sequence "S%u", 30, 13),
392 // Allocate volatiles first, then non-volatiles in reverse order. With the SVR4
393 // ABI the size of the Floating-point register save area is determined by the
394 // allocated non-volatile register with the lowest register number, as FP
395 // register N is spilled to offset 8 * (32 - N) below the back chain word of the
396 // previous stack frame. By allocating non-volatiles in reverse order we make
397 // sure that the Floating-point register save area is always as small as
398 // possible because there aren't any unused spill slots.
399 def F8RC : RegisterClass<"PPC", [f64], 64, (add (sequence "F%u", 0, 13),
400 (sequence "F%u", 31, 14))>;
401 def F4RC : RegisterClass<"PPC", [f32], 32, (add F8RC)>;
403 // Floating point pair registers.
404 // Note that the type used for this register class is ppcf128. This is not
405 // completely correct. However, since we are not pattern matching any
406 // instructions for these registers and we are not register allocating or
407 // scheduling any of these instructions it should be safe to do this.
408 // The reason we didn't use the correct type (Decimal Floating Point) is that
409 // at the time of this implementation the correct type was not available.
411 RegisterClass<"PPC", [ppcf128], 128,
412 (add Fpair0, Fpair2, Fpair4, Fpair6, Fpair8, Fpair10, Fpair12,
413 Fpair14, Fpair16, Fpair18, Fpair20, Fpair22, Fpair24,
414 Fpair26, Fpair28, Fpair30)> {
418 def VRRC : RegisterClass<"PPC",
419 [v16i8,v8i16,v4i32,v2i64,v1i128,v4f32,v2f64, f128],
421 (add V2, V3, V4, V5, V0, V1, V6, V7, V8, V9, V10, V11,
422 V12, V13, V14, V15, V16, V17, V18, V19, V31, V30,
423 V29, V28, V27, V26, V25, V24, V23, V22, V21, V20)>;
425 // VSX register classes (the allocation order mirrors that of the corresponding
426 // subregister classes).
427 def VSLRC : RegisterClass<"PPC", [v4i32,v4f32,v2f64,v2i64], 128,
428 (add (sequence "VSL%u", 0, 13),
429 (sequence "VSL%u", 31, 14))>;
430 def VSRC : RegisterClass<"PPC", [v4i32,v4f32,v2f64,v2i64], 128,
433 // Register classes for the 64-bit "scalar" VSX subregisters.
434 def VFRC : RegisterClass<"PPC", [f64], 64,
435 (add VF2, VF3, VF4, VF5, VF0, VF1, VF6, VF7,
436 VF8, VF9, VF10, VF11, VF12, VF13, VF14,
437 VF15, VF16, VF17, VF18, VF19, VF31, VF30,
438 VF29, VF28, VF27, VF26, VF25, VF24, VF23,
440 def VSFRC : RegisterClass<"PPC", [f64], 64, (add F8RC, VFRC)>;
442 // Allow spilling GPR's into caller-saved VSR's.
443 def SPILLTOVSRRC : RegisterClass<"PPC", [i64, f64], 64, (add G8RC, (sub VSFRC,
444 (sequence "VF%u", 31, 20),
445 (sequence "F%u", 31, 14)))>;
447 // Register class for single precision scalars in VSX registers
448 def VSSRC : RegisterClass<"PPC", [f32], 32, (add VSFRC)>;
450 def CRBITRC : RegisterClass<"PPC", [i1], 32,
451 (add CR2LT, CR2GT, CR2EQ, CR2UN,
452 CR3LT, CR3GT, CR3EQ, CR3UN,
453 CR4LT, CR4GT, CR4EQ, CR4UN,
454 CR5LT, CR5GT, CR5EQ, CR5UN,
455 CR6LT, CR6GT, CR6EQ, CR6UN,
456 CR7LT, CR7GT, CR7EQ, CR7UN,
457 CR1LT, CR1GT, CR1EQ, CR1UN,
458 CR0LT, CR0GT, CR0EQ, CR0UN)> {
460 let AltOrders = [(sub CRBITRC, CR2LT, CR2GT, CR2EQ, CR2UN, CR3LT, CR3GT,
461 CR3EQ, CR3UN, CR4LT, CR4GT, CR4EQ, CR4UN)];
462 let AltOrderSelect = [{
463 return MF.getSubtarget<PPCSubtarget>().isELFv2ABI() &&
464 MF.getInfo<PPCFunctionInfo>()->isNonVolatileCRDisabled();
468 def CRRC : RegisterClass<"PPC", [i32], 32,
469 (add CR0, CR1, CR5, CR6,
470 CR7, CR2, CR3, CR4)> {
471 let AltOrders = [(sub CRRC, CR2, CR3, CR4)];
472 let AltOrderSelect = [{
473 return MF.getSubtarget<PPCSubtarget>().isELFv2ABI() &&
474 MF.getInfo<PPCFunctionInfo>()->isNonVolatileCRDisabled();
477 // The CTR registers are not allocatable because they're used by the
478 // decrement-and-branch instructions, and thus need to stay live across
479 // multiple basic blocks.
480 def CTRRC : RegisterClass<"PPC", [i32], 32, (add CTR)> {
481 let isAllocatable = 0;
483 def CTRRC8 : RegisterClass<"PPC", [i64], 64, (add CTR8)> {
484 let isAllocatable = 0;
487 def LRRC : RegisterClass<"PPC", [i32], 32, (add LR)> {
488 let isAllocatable = 0;
490 def LR8RC : RegisterClass<"PPC", [i64], 64, (add LR8)> {
491 let isAllocatable = 0;
494 def VRSAVERC : RegisterClass<"PPC", [i32], 32, (add VRSAVE)>;
495 def CARRYRC : RegisterClass<"PPC", [i32], 32, (add CARRY, XER)> {
499 // Make AllocationOrder as similar as G8RC's to avoid potential spilling.
500 // Similarly, we have an AltOrder for 64-bit ELF ABI which r2 is allocated
503 RegisterClass<"PPC", [i128], 128,
504 (add (sequence "G8p%u", 1, 5),
505 (sequence "G8p%u", 14, 7),
506 G8p15, G8p6, G8p0)> {
507 let AltOrders = [(add (sub G8pRC, G8p1), G8p1)];
508 let AltOrderSelect = [{
509 return MF.getSubtarget<PPCSubtarget>().is64BitELFABI();
514 include "PPCRegisterInfoMMA.td"
515 include "PPCRegisterInfoDMR.td"
517 //===----------------------------------------------------------------------===//
518 // PowerPC Operand Definitions.
520 // In the default PowerPC assembler syntax, registers are specified simply
521 // by number, so they cannot be distinguished from immediate values (without
522 // looking at the opcode). This means that the default operand matching logic
523 // for the asm parser does not work, and we need to specify custom matchers.
524 // Since those can only be specified with RegisterOperand classes and not
525 // directly on the RegisterClass, all instructions patterns used by the asm
526 // parser need to use a RegisterOperand (instead of a RegisterClass) for
527 // all their register operands.
528 // For this purpose, we define one RegisterOperand for each RegisterClass,
529 // using the same name as the class, just in lower case.
531 def PPCRegGPRCAsmOperand : AsmOperandClass {
532 let Name = "RegGPRC"; let PredicateMethod = "isRegNumber";
534 def gprc : RegisterOperand<GPRC> {
535 let ParserMatchClass = PPCRegGPRCAsmOperand;
537 def PPCRegG8RCAsmOperand : AsmOperandClass {
538 let Name = "RegG8RC"; let PredicateMethod = "isRegNumber";
540 def g8rc : RegisterOperand<G8RC> {
541 let ParserMatchClass = PPCRegG8RCAsmOperand;
543 def PPCRegG8pRCAsmOperand : AsmOperandClass {
544 let Name = "RegG8pRC"; let PredicateMethod = "isEvenRegNumber";
546 def g8prc : RegisterOperand<G8pRC> {
547 let ParserMatchClass = PPCRegG8pRCAsmOperand;
549 def PPCRegGPRCNoR0AsmOperand : AsmOperandClass {
550 let Name = "RegGPRCNoR0"; let PredicateMethod = "isRegNumber";
552 def gprc_nor0 : RegisterOperand<GPRC_NOR0> {
553 let ParserMatchClass = PPCRegGPRCNoR0AsmOperand;
555 def PPCRegG8RCNoX0AsmOperand : AsmOperandClass {
556 let Name = "RegG8RCNoX0"; let PredicateMethod = "isRegNumber";
558 def g8rc_nox0 : RegisterOperand<G8RC_NOX0> {
559 let ParserMatchClass = PPCRegG8RCNoX0AsmOperand;
561 def PPCRegF8RCAsmOperand : AsmOperandClass {
562 let Name = "RegF8RC"; let PredicateMethod = "isRegNumber";
564 def f8rc : RegisterOperand<F8RC> {
565 let ParserMatchClass = PPCRegF8RCAsmOperand;
567 def PPCRegF4RCAsmOperand : AsmOperandClass {
568 let Name = "RegF4RC"; let PredicateMethod = "isRegNumber";
570 def f4rc : RegisterOperand<F4RC> {
571 let ParserMatchClass = PPCRegF4RCAsmOperand;
573 def PPCRegFpRCAsmOperand : AsmOperandClass {
574 let Name = "RegFpRC"; let PredicateMethod = "isEvenRegNumber";
576 def fpairrc : RegisterOperand<FpRC> {
577 let ParserMatchClass = PPCRegFpRCAsmOperand;
579 def PPCRegVRRCAsmOperand : AsmOperandClass {
580 let Name = "RegVRRC"; let PredicateMethod = "isRegNumber";
582 def vrrc : RegisterOperand<VRRC> {
583 let ParserMatchClass = PPCRegVRRCAsmOperand;
585 def PPCRegVFRCAsmOperand : AsmOperandClass {
586 let Name = "RegVFRC"; let PredicateMethod = "isRegNumber";
588 def vfrc : RegisterOperand<VFRC> {
589 let ParserMatchClass = PPCRegVFRCAsmOperand;
591 def PPCRegCRBITRCAsmOperand : AsmOperandClass {
592 let Name = "RegCRBITRC"; let PredicateMethod = "isCRBitNumber";
594 def crbitrc : RegisterOperand<CRBITRC> {
595 let ParserMatchClass = PPCRegCRBITRCAsmOperand;
597 def PPCRegCRRCAsmOperand : AsmOperandClass {
598 let Name = "RegCRRC"; let PredicateMethod = "isCCRegNumber";
600 def crrc : RegisterOperand<CRRC> {
601 let ParserMatchClass = PPCRegCRRCAsmOperand;
603 def PPCRegSPERCAsmOperand : AsmOperandClass {
604 let Name = "RegSPERC"; let PredicateMethod = "isRegNumber";
606 def sperc : RegisterOperand<SPERC> {
607 let ParserMatchClass = PPCRegSPERCAsmOperand;
609 def PPCRegSPE4RCAsmOperand : AsmOperandClass {
610 let Name = "RegSPE4RC"; let PredicateMethod = "isRegNumber";
612 def spe4rc : RegisterOperand<GPRC> {
613 let ParserMatchClass = PPCRegSPE4RCAsmOperand;
616 def PPCU1ImmAsmOperand : AsmOperandClass {
617 let Name = "U1Imm"; let PredicateMethod = "isU1Imm";
618 let RenderMethod = "addImmOperands";
620 def u1imm : Operand<i32> {
621 let PrintMethod = "printU1ImmOperand";
622 let ParserMatchClass = PPCU1ImmAsmOperand;
623 let DecoderMethod = "decodeUImmOperand<1>";
624 let OperandType = "OPERAND_IMMEDIATE";
627 def PPCU2ImmAsmOperand : AsmOperandClass {
628 let Name = "U2Imm"; let PredicateMethod = "isU2Imm";
629 let RenderMethod = "addImmOperands";
631 def u2imm : Operand<i32> {
632 let PrintMethod = "printU2ImmOperand";
633 let ParserMatchClass = PPCU2ImmAsmOperand;
634 let DecoderMethod = "decodeUImmOperand<2>";
635 let OperandType = "OPERAND_IMMEDIATE";
638 def PPCATBitsAsHintAsmOperand : AsmOperandClass {
639 let Name = "ATBitsAsHint"; let PredicateMethod = "isATBitsAsHint";
640 let RenderMethod = "addImmOperands"; // Irrelevant, predicate always fails.
642 def atimm : Operand<i32> {
643 let PrintMethod = "printATBitsAsHint";
644 let ParserMatchClass = PPCATBitsAsHintAsmOperand;
645 let OperandType = "OPERAND_IMMEDIATE";
648 def PPCU3ImmAsmOperand : AsmOperandClass {
649 let Name = "U3Imm"; let PredicateMethod = "isU3Imm";
650 let RenderMethod = "addImmOperands";
652 def u3imm : Operand<i32> {
653 let PrintMethod = "printU3ImmOperand";
654 let ParserMatchClass = PPCU3ImmAsmOperand;
655 let DecoderMethod = "decodeUImmOperand<3>";
656 let OperandType = "OPERAND_IMMEDIATE";
659 def PPCU4ImmAsmOperand : AsmOperandClass {
660 let Name = "U4Imm"; let PredicateMethod = "isU4Imm";
661 let RenderMethod = "addImmOperands";
663 def u4imm : Operand<i32> {
664 let PrintMethod = "printU4ImmOperand";
665 let ParserMatchClass = PPCU4ImmAsmOperand;
666 let DecoderMethod = "decodeUImmOperand<4>";
667 let OperandType = "OPERAND_IMMEDIATE";
669 def PPCS5ImmAsmOperand : AsmOperandClass {
670 let Name = "S5Imm"; let PredicateMethod = "isS5Imm";
671 let RenderMethod = "addImmOperands";
673 def s5imm : Operand<i32> {
674 let PrintMethod = "printS5ImmOperand";
675 let ParserMatchClass = PPCS5ImmAsmOperand;
676 let DecoderMethod = "decodeSImmOperand<5>";
677 let OperandType = "OPERAND_IMMEDIATE";
679 def PPCU5ImmAsmOperand : AsmOperandClass {
680 let Name = "U5Imm"; let PredicateMethod = "isU5Imm";
681 let RenderMethod = "addImmOperands";
683 def u5imm : Operand<i32> {
684 let PrintMethod = "printU5ImmOperand";
685 let ParserMatchClass = PPCU5ImmAsmOperand;
686 let DecoderMethod = "decodeUImmOperand<5>";
687 let OperandType = "OPERAND_IMMEDIATE";
689 def PPCU6ImmAsmOperand : AsmOperandClass {
690 let Name = "U6Imm"; let PredicateMethod = "isU6Imm";
691 let RenderMethod = "addImmOperands";
693 def u6imm : Operand<i32> {
694 let PrintMethod = "printU6ImmOperand";
695 let ParserMatchClass = PPCU6ImmAsmOperand;
696 let DecoderMethod = "decodeUImmOperand<6>";
697 let OperandType = "OPERAND_IMMEDIATE";
699 def PPCU7ImmAsmOperand : AsmOperandClass {
700 let Name = "U7Imm"; let PredicateMethod = "isU7Imm";
701 let RenderMethod = "addImmOperands";
703 def u7imm : Operand<i32> {
704 let PrintMethod = "printU7ImmOperand";
705 let ParserMatchClass = PPCU7ImmAsmOperand;
706 let DecoderMethod = "decodeUImmOperand<7>";
707 let OperandType = "OPERAND_IMMEDIATE";
709 def PPCU8ImmAsmOperand : AsmOperandClass {
710 let Name = "U8Imm"; let PredicateMethod = "isU8Imm";
711 let RenderMethod = "addImmOperands";
713 def u8imm : Operand<i32> {
714 let PrintMethod = "printU8ImmOperand";
715 let ParserMatchClass = PPCU8ImmAsmOperand;
716 let DecoderMethod = "decodeUImmOperand<8>";
717 let OperandType = "OPERAND_IMMEDIATE";
719 def PPCU10ImmAsmOperand : AsmOperandClass {
720 let Name = "U10Imm"; let PredicateMethod = "isU10Imm";
721 let RenderMethod = "addImmOperands";
723 def u10imm : Operand<i32> {
724 let PrintMethod = "printU10ImmOperand";
725 let ParserMatchClass = PPCU10ImmAsmOperand;
726 let DecoderMethod = "decodeUImmOperand<10>";
727 let OperandType = "OPERAND_IMMEDIATE";
729 def PPCU12ImmAsmOperand : AsmOperandClass {
730 let Name = "U12Imm"; let PredicateMethod = "isU12Imm";
731 let RenderMethod = "addImmOperands";
733 def u12imm : Operand<i32> {
734 let PrintMethod = "printU12ImmOperand";
735 let ParserMatchClass = PPCU12ImmAsmOperand;
736 let DecoderMethod = "decodeUImmOperand<12>";
737 let OperandType = "OPERAND_IMMEDIATE";
739 def PPCS16ImmAsmOperand : AsmOperandClass {
740 let Name = "S16Imm"; let PredicateMethod = "isS16Imm";
741 let RenderMethod = "addS16ImmOperands";
743 def s16imm : Operand<i32> {
744 let PrintMethod = "printS16ImmOperand";
745 let EncoderMethod = "getImm16Encoding";
746 let ParserMatchClass = PPCS16ImmAsmOperand;
747 let DecoderMethod = "decodeSImmOperand<16>";
748 let OperandType = "OPERAND_IMMEDIATE";
750 def PPCU16ImmAsmOperand : AsmOperandClass {
751 let Name = "U16Imm"; let PredicateMethod = "isU16Imm";
752 let RenderMethod = "addU16ImmOperands";
754 def u16imm : Operand<i32> {
755 let PrintMethod = "printU16ImmOperand";
756 let EncoderMethod = "getImm16Encoding";
757 let ParserMatchClass = PPCU16ImmAsmOperand;
758 let DecoderMethod = "decodeUImmOperand<16>";
759 let OperandType = "OPERAND_IMMEDIATE";
761 def PPCS17ImmAsmOperand : AsmOperandClass {
762 let Name = "S17Imm"; let PredicateMethod = "isS17Imm";
763 let RenderMethod = "addS16ImmOperands";
765 def s17imm : Operand<i32> {
766 // This operand type is used for addis/lis to allow the assembler parser
767 // to accept immediates in the range -65536..65535 for compatibility with
768 // the GNU assembler. The operand is treated as 16-bit otherwise.
769 let PrintMethod = "printS16ImmOperand";
770 let EncoderMethod = "getImm16Encoding";
771 let ParserMatchClass = PPCS17ImmAsmOperand;
772 let DecoderMethod = "decodeSImmOperand<16>";
773 let OperandType = "OPERAND_IMMEDIATE";
775 def PPCS34ImmAsmOperand : AsmOperandClass {
777 let PredicateMethod = "isS34Imm";
778 let RenderMethod = "addImmOperands";
780 def s34imm : Operand<i64> {
781 let PrintMethod = "printS34ImmOperand";
782 let EncoderMethod = "getImm34EncodingNoPCRel";
783 let ParserMatchClass = PPCS34ImmAsmOperand;
784 let DecoderMethod = "decodeSImmOperand<34>";
785 let OperandType = "OPERAND_IMMEDIATE";
787 def s34imm_pcrel : Operand<i64> {
788 let PrintMethod = "printS34ImmOperand";
789 let EncoderMethod = "getImm34EncodingPCRel";
790 let ParserMatchClass = PPCS34ImmAsmOperand;
791 let DecoderMethod = "decodeSImmOperand<34>";
792 let OperandType = "OPERAND_IMMEDIATE";
794 def PPCImmZeroAsmOperand : AsmOperandClass {
795 let Name = "ImmZero";
796 let PredicateMethod = "isImmZero";
797 let RenderMethod = "addImmOperands";
799 def immZero : Operand<i32> {
800 let PrintMethod = "printImmZeroOperand";
801 let ParserMatchClass = PPCImmZeroAsmOperand;
802 let DecoderMethod = "decodeImmZeroOperand";
803 let OperandType = "OPERAND_IMMEDIATE";
806 def fpimm0 : PatLeaf<(fpimm), [{ return N->isExactlyValue(+0.0); }]>;
807 def fpimm0neg : PatLeaf<(fpimm), [{return N->isExactlyValue(-0.0);}]>;
809 def PPCDirectBrAsmOperand : AsmOperandClass {
810 let Name = "DirectBr"; let PredicateMethod = "isDirectBr";
811 let RenderMethod = "addBranchTargetOperands";
813 def directbrtarget : Operand<OtherVT> {
814 let PrintMethod = "printBranchOperand";
815 let EncoderMethod = "getDirectBrEncoding";
816 let DecoderMethod = "decodeDirectBrTarget";
817 let ParserMatchClass = PPCDirectBrAsmOperand;
818 let OperandType = "OPERAND_PCREL";
820 def absdirectbrtarget : Operand<OtherVT> {
821 let PrintMethod = "printAbsBranchOperand";
822 let EncoderMethod = "getAbsDirectBrEncoding";
823 let DecoderMethod = "decodeDirectBrTarget";
824 let ParserMatchClass = PPCDirectBrAsmOperand;
826 def PPCCondBrAsmOperand : AsmOperandClass {
827 let Name = "CondBr"; let PredicateMethod = "isCondBr";
828 let RenderMethod = "addBranchTargetOperands";
830 def condbrtarget : Operand<OtherVT> {
831 let PrintMethod = "printBranchOperand";
832 let EncoderMethod = "getCondBrEncoding";
833 let DecoderMethod = "decodeCondBrTarget";
834 let ParserMatchClass = PPCCondBrAsmOperand;
835 let OperandType = "OPERAND_PCREL";
837 def abscondbrtarget : Operand<OtherVT> {
838 let PrintMethod = "printAbsBranchOperand";
839 let EncoderMethod = "getAbsCondBrEncoding";
840 let DecoderMethod = "decodeCondBrTarget";
841 let ParserMatchClass = PPCCondBrAsmOperand;
843 def calltarget : Operand<iPTR> {
844 let PrintMethod = "printBranchOperand";
845 let EncoderMethod = "getDirectBrEncoding";
846 let DecoderMethod = "decodeDirectBrTarget";
847 let ParserMatchClass = PPCDirectBrAsmOperand;
848 let OperandType = "OPERAND_PCREL";
850 def abscalltarget : Operand<iPTR> {
851 let PrintMethod = "printAbsBranchOperand";
852 let EncoderMethod = "getAbsDirectBrEncoding";
853 let DecoderMethod = "decodeDirectBrTarget";
854 let ParserMatchClass = PPCDirectBrAsmOperand;
856 def PPCCRBitMaskOperand : AsmOperandClass {
857 let Name = "CRBitMask"; let PredicateMethod = "isCRBitMask";
859 def crbitm: Operand<i8> {
860 let PrintMethod = "printcrbitm";
861 let EncoderMethod = "get_crbitm_encoding";
862 let DecoderMethod = "decodeCRBitMOperand";
863 let ParserMatchClass = PPCCRBitMaskOperand;
866 // A version of ptr_rc which excludes R0 (or X0 in 64-bit mode).
867 def PPCRegGxRCNoR0Operand : AsmOperandClass {
868 let Name = "RegGxRCNoR0"; let PredicateMethod = "isRegNumber";
870 def ptr_rc_nor0 : Operand<iPTR>, PointerLikeRegClass<1> {
871 let ParserMatchClass = PPCRegGxRCNoR0Operand;
874 // New addressing modes with 34 bit immediates.
875 def PPCDispRI34Operand : AsmOperandClass {
876 let Name = "DispRI34"; let PredicateMethod = "isS34Imm";
877 let RenderMethod = "addImmOperands";
879 def dispRI34 : Operand<iPTR> {
880 let ParserMatchClass = PPCDispRI34Operand;
881 let EncoderMethod = "getDispRI34Encoding";
882 let DecoderMethod = "decodeSImmOperand<34>";
884 def dispRI34_pcrel : Operand<iPTR> {
885 let ParserMatchClass = PPCDispRI34Operand;
886 let EncoderMethod = "getDispRI34PCRelEncoding";
887 let DecoderMethod = "decodeSImmOperand<34>";
889 def memri34 : Operand<iPTR> { // memri, imm is a 34-bit value.
890 let PrintMethod = "printMemRegImm34";
891 let MIOperandInfo = (ops dispRI34:$imm, ptr_rc_nor0:$reg);
893 // memri, imm is a 34-bit value for pc-relative instructions where
894 // base register is set to zero.
895 def memri34_pcrel : Operand<iPTR> { // memri, imm is a 34-bit value.
896 let PrintMethod = "printMemRegImm34PCRel";
897 let MIOperandInfo = (ops dispRI34_pcrel:$imm, immZero:$reg);
900 // A version of ptr_rc usable with the asm parser.
901 def PPCRegGxRCOperand : AsmOperandClass {
902 let Name = "RegGxRC"; let PredicateMethod = "isRegNumber";
904 def ptr_rc_idx : Operand<iPTR>, PointerLikeRegClass<0> {
905 let ParserMatchClass = PPCRegGxRCOperand;
908 def PPCDispRIOperand : AsmOperandClass {
909 let Name = "DispRI"; let PredicateMethod = "isS16Imm";
910 let RenderMethod = "addS16ImmOperands";
912 def dispRI : Operand<iPTR> {
913 let ParserMatchClass = PPCDispRIOperand;
914 let EncoderMethod = "getDispRIEncoding";
916 def PPCDispRIXOperand : AsmOperandClass {
917 let Name = "DispRIX"; let PredicateMethod = "isS16ImmX4";
918 let RenderMethod = "addS16ImmOperands";
920 def dispRIX : Operand<iPTR> {
921 let ParserMatchClass = PPCDispRIXOperand;
922 let EncoderMethod = "getDispRIXEncoding";
923 let DecoderMethod = "decodeDispRIXOperand";
925 def PPCDispRIHashOperand : AsmOperandClass {
926 let Name = "DispRIHash"; let PredicateMethod = "isHashImmX8";
927 let RenderMethod = "addImmOperands";
929 def dispRIHash : Operand<iPTR> {
930 let ParserMatchClass = PPCDispRIHashOperand;
931 let EncoderMethod = "getDispRIHashEncoding";
932 let DecoderMethod = "decodeDispRIHashOperand";
934 def PPCDispRIX16Operand : AsmOperandClass {
935 let Name = "DispRIX16"; let PredicateMethod = "isS16ImmX16";
936 let RenderMethod = "addS16ImmOperands";
938 def dispRIX16 : Operand<iPTR> {
939 let ParserMatchClass = PPCDispRIX16Operand;
940 let EncoderMethod = "getDispRIX16Encoding";
941 let DecoderMethod = "decodeDispRIX16Operand";
944 def PPCDispSPE8Operand : AsmOperandClass {
945 let Name = "DispSPE8"; let PredicateMethod = "isU8ImmX8";
946 let RenderMethod = "addImmOperands";
948 def dispSPE8 : Operand<iPTR> {
949 let ParserMatchClass = PPCDispSPE8Operand;
950 let DecoderMethod = "decodeDispSPE8Operand";
951 let EncoderMethod = "getDispSPE8Encoding";
953 def PPCDispSPE4Operand : AsmOperandClass {
954 let Name = "DispSPE4"; let PredicateMethod = "isU7ImmX4";
955 let RenderMethod = "addImmOperands";
957 def dispSPE4 : Operand<iPTR> {
958 let ParserMatchClass = PPCDispSPE4Operand;
959 let DecoderMethod = "decodeDispSPE4Operand";
960 let EncoderMethod = "getDispSPE4Encoding";
962 def PPCDispSPE2Operand : AsmOperandClass {
963 let Name = "DispSPE2"; let PredicateMethod = "isU6ImmX2";
964 let RenderMethod = "addImmOperands";
966 def dispSPE2 : Operand<iPTR> {
967 let ParserMatchClass = PPCDispSPE2Operand;
968 let DecoderMethod = "decodeDispSPE2Operand";
969 let EncoderMethod = "getDispSPE2Encoding";
972 def memri : Operand<iPTR> {
973 let PrintMethod = "printMemRegImm";
974 let MIOperandInfo = (ops dispRI:$imm, ptr_rc_nor0:$reg);
975 let OperandType = "OPERAND_MEMORY";
977 def memrr : Operand<iPTR> {
978 let PrintMethod = "printMemRegReg";
979 let MIOperandInfo = (ops ptr_rc_nor0:$ptrreg, ptr_rc_idx:$offreg);
980 let OperandType = "OPERAND_MEMORY";
982 def memrix : Operand<iPTR> { // memri where the imm is 4-aligned.
983 let PrintMethod = "printMemRegImm";
984 let MIOperandInfo = (ops dispRIX:$imm, ptr_rc_nor0:$reg);
985 let OperandType = "OPERAND_MEMORY";
987 def memrihash : Operand<iPTR> {
988 // memrihash 8-aligned for ROP Protection Instructions.
989 let PrintMethod = "printMemRegImmHash";
990 let MIOperandInfo = (ops dispRIHash:$imm, ptr_rc_nor0:$reg);
991 let OperandType = "OPERAND_MEMORY";
993 def memrix16 : Operand<iPTR> { // memri, imm is 16-aligned, 12-bit, Inst{16:27}
994 let PrintMethod = "printMemRegImm";
995 let MIOperandInfo = (ops dispRIX16:$imm, ptr_rc_nor0:$reg);
996 let OperandType = "OPERAND_MEMORY";
998 def spe8dis : Operand<iPTR> { // SPE displacement where the imm is 8-aligned.
999 let PrintMethod = "printMemRegImm";
1000 let MIOperandInfo = (ops dispSPE8:$imm, ptr_rc_nor0:$reg);
1001 let OperandType = "OPERAND_MEMORY";
1003 def spe4dis : Operand<iPTR> { // SPE displacement where the imm is 4-aligned.
1004 let PrintMethod = "printMemRegImm";
1005 let MIOperandInfo = (ops dispSPE4:$imm, ptr_rc_nor0:$reg);
1006 let OperandType = "OPERAND_MEMORY";
1008 def spe2dis : Operand<iPTR> { // SPE displacement where the imm is 2-aligned.
1009 let PrintMethod = "printMemRegImm";
1010 let MIOperandInfo = (ops dispSPE2:$imm, ptr_rc_nor0:$reg);
1011 let OperandType = "OPERAND_MEMORY";
1014 // A single-register address. This is used with the SjLj
1015 // pseudo-instructions which translates to LD/LWZ. These instructions requires
1016 // G8RC_NOX0 registers.
1017 def memr : Operand<iPTR> {
1018 let MIOperandInfo = (ops ptr_rc_nor0:$ptrreg);
1019 let OperandType = "OPERAND_MEMORY";
1021 def PPCTLSRegOperand : AsmOperandClass {
1022 let Name = "TLSReg"; let PredicateMethod = "isTLSReg";
1023 let RenderMethod = "addTLSRegOperands";
1025 def tlsreg32 : Operand<i32> {
1026 let EncoderMethod = "getTLSRegEncoding";
1027 let ParserMatchClass = PPCTLSRegOperand;
1029 def tlsgd32 : Operand<i32> {}
1030 def tlscall32 : Operand<i32> {
1031 let PrintMethod = "printTLSCall";
1032 let MIOperandInfo = (ops calltarget:$func, tlsgd32:$sym);
1033 let EncoderMethod = "getTLSCallEncoding";
1036 // PowerPC Predicate operand.
1037 def pred : Operand<OtherVT> {
1038 let PrintMethod = "printPredicateOperand";
1039 let MIOperandInfo = (ops i32imm:$bibo, crrc:$reg);
1042 def PPCRegVSRCAsmOperand : AsmOperandClass {
1043 let Name = "RegVSRC"; let PredicateMethod = "isVSRegNumber";
1045 def vsrc : RegisterOperand<VSRC> {
1046 let ParserMatchClass = PPCRegVSRCAsmOperand;
1049 def PPCRegVSFRCAsmOperand : AsmOperandClass {
1050 let Name = "RegVSFRC"; let PredicateMethod = "isVSRegNumber";
1052 def vsfrc : RegisterOperand<VSFRC> {
1053 let ParserMatchClass = PPCRegVSFRCAsmOperand;
1056 def PPCRegVSSRCAsmOperand : AsmOperandClass {
1057 let Name = "RegVSSRC"; let PredicateMethod = "isVSRegNumber";
1059 def vssrc : RegisterOperand<VSSRC> {
1060 let ParserMatchClass = PPCRegVSSRCAsmOperand;
1063 def PPCRegSPILLTOVSRRCAsmOperand : AsmOperandClass {
1064 let Name = "RegSPILLTOVSRRC"; let PredicateMethod = "isVSRegNumber";
1067 def spilltovsrrc : RegisterOperand<SPILLTOVSRRC> {
1068 let ParserMatchClass = PPCRegSPILLTOVSRRCAsmOperand;
1071 def PPCRegVSRpRCAsmOperand : AsmOperandClass {
1072 let Name = "RegVSRpRC"; let PredicateMethod = "isVSRpEvenRegNumber";
1075 def vsrprc : RegisterOperand<VSRpRC> {
1076 let ParserMatchClass = PPCRegVSRpRCAsmOperand;
1079 def PPCRegVSRpEvenRCAsmOperand : AsmOperandClass {
1080 let Name = "RegVSRpEvenRC"; let PredicateMethod = "isVSRpEvenRegNumber";
1083 def vsrpevenrc : RegisterOperand<VSRpRC> {
1084 let ParserMatchClass = PPCRegVSRpEvenRCAsmOperand;
1085 let EncoderMethod = "getVSRpEvenEncoding";
1086 let DecoderMethod = "decodeVSRpEvenOperands";
1089 def PPCRegACCRCAsmOperand : AsmOperandClass {
1090 let Name = "RegACCRC"; let PredicateMethod = "isACCRegNumber";
1093 def acc : RegisterOperand<ACCRC> {
1094 let ParserMatchClass = PPCRegACCRCAsmOperand;
1097 def uacc : RegisterOperand<UACCRC> {
1098 let ParserMatchClass = PPCRegACCRCAsmOperand;
1101 // DMR Register Operands
1102 def PPCRegDMRROWRCAsmOperand : AsmOperandClass {
1103 let Name = "RegDMRROWRC";
1104 let PredicateMethod = "isDMRROWRegNumber";
1107 def dmrrow : RegisterOperand<DMRROWRC> {
1108 let ParserMatchClass = PPCRegDMRROWRCAsmOperand;
1111 def PPCRegDMRROWpRCAsmOperand : AsmOperandClass {
1112 let Name = "RegDMRROWpRC";
1113 let PredicateMethod = "isDMRROWpRegNumber";
1116 def dmrrowp : RegisterOperand<DMRROWpRC> {
1117 let ParserMatchClass = PPCRegDMRROWpRCAsmOperand;
1120 def wacc : RegisterOperand<WACCRC> {
1121 let ParserMatchClass = PPCRegACCRCAsmOperand;
1124 def wacc_hi : RegisterOperand<WACC_HIRC> {
1125 let ParserMatchClass = PPCRegACCRCAsmOperand;
1128 def PPCRegDMRRCAsmOperand : AsmOperandClass {
1129 let Name = "RegDMRRC";
1130 let PredicateMethod = "isDMRRegNumber";
1133 def dmr : RegisterOperand<DMRRC> {
1134 let ParserMatchClass = PPCRegDMRRCAsmOperand;
1137 def PPCRegDMRpRCAsmOperand : AsmOperandClass {
1138 let Name = "RegDMRpRC";
1139 let PredicateMethod = "isDMRpRegNumber";
1142 def dmrp : RegisterOperand<DMRpRC> {
1143 let ParserMatchClass = PPCRegDMRpRCAsmOperand;