xref: /freebsd/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric//==- SystemZRegisterInfo.td - SystemZ register definitions -*- tablegen -*-==//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
100b57cec5SDimitry Andric// Class definitions.
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andricclass SystemZReg<string n> : Register<n> {
140b57cec5SDimitry Andric  let Namespace = "SystemZ";
150b57cec5SDimitry Andric}
160b57cec5SDimitry Andric
170b57cec5SDimitry Andricclass SystemZRegWithSubregs<string n, list<Register> subregs>
180b57cec5SDimitry Andric  : RegisterWithSubRegs<n, subregs> {
190b57cec5SDimitry Andric  let Namespace = "SystemZ";
200b57cec5SDimitry Andric}
210b57cec5SDimitry Andric
220b57cec5SDimitry Andriclet Namespace = "SystemZ" in {
2306c3fb27SDimitry Andricdef subreg_l32   : SubRegIndex<32, 0>;  // Also acts as subreg_hl32.
2406c3fb27SDimitry Andricdef subreg_h32   : SubRegIndex<32, 32>; // Also acts as subreg_hh32.
250b57cec5SDimitry Andricdef subreg_l64   : SubRegIndex<64, 0>;
260b57cec5SDimitry Andricdef subreg_h64   : SubRegIndex<64, 64>;
2706c3fb27SDimitry Andricdef subreg_lh32  : ComposedSubRegIndex<subreg_l64, subreg_h32>;
2806c3fb27SDimitry Andricdef subreg_ll32  : ComposedSubRegIndex<subreg_l64, subreg_l32>;
290b57cec5SDimitry Andric}
300b57cec5SDimitry Andric
310b57cec5SDimitry Andric// Define a register class that contains values of types TYPES and an
320b57cec5SDimitry Andric// associated operand called NAME.  SIZE is the size and alignment
330b57cec5SDimitry Andric// of the registers and REGLIST is the list of individual registers.
34fe6060f1SDimitry Andric// If the user provides an alternate order list of regs, it will be used for
35fe6060f1SDimitry Andric// XPLINK. Otherwise, by default, XPLINK will use the regList ordering as well
360b57cec5SDimitry Andricmulticlass SystemZRegClass<string name, list<ValueType> types, int size,
37fe6060f1SDimitry Andric                           dag regList, list<dag> altRegList = [regList], bit allocatable = 1> {
380b57cec5SDimitry Andric  def AsmOperand : AsmOperandClass {
390b57cec5SDimitry Andric    let Name = name;
405ffd83dbSDimitry Andric    let ParserMethod = "parse"#name;
410b57cec5SDimitry Andric    let RenderMethod = "addRegOperands";
420b57cec5SDimitry Andric  }
430b57cec5SDimitry Andric  let isAllocatable = allocatable in
440b57cec5SDimitry Andric    def Bit : RegisterClass<"SystemZ", types, size, regList> {
450b57cec5SDimitry Andric      let Size = size;
46fe6060f1SDimitry Andric      let AltOrders = altRegList;
47fe6060f1SDimitry Andric      let AltOrderSelect = [{
48fe6060f1SDimitry Andric        const SystemZSubtarget &S = MF.getSubtarget<SystemZSubtarget>();
49fe6060f1SDimitry Andric        return S.isTargetXPLINK64();
50fe6060f1SDimitry Andric      }];
510b57cec5SDimitry Andric    }
525ffd83dbSDimitry Andric  def "" : RegisterOperand<!cast<RegisterClass>(name#"Bit")> {
535ffd83dbSDimitry Andric    let ParserMatchClass = !cast<AsmOperandClass>(name#"AsmOperand");
540b57cec5SDimitry Andric  }
550b57cec5SDimitry Andric}
560b57cec5SDimitry Andric
570b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
580b57cec5SDimitry Andric// General-purpose registers
590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
600b57cec5SDimitry Andric
610b57cec5SDimitry Andric// Lower 32 bits of one of the 16 64-bit general-purpose registers
620b57cec5SDimitry Andricclass GPR32<bits<16> num, string n> : SystemZReg<n> {
630b57cec5SDimitry Andric  let HWEncoding = num;
640b57cec5SDimitry Andric}
650b57cec5SDimitry Andric
660b57cec5SDimitry Andric// One of the 16 64-bit general-purpose registers.
670b57cec5SDimitry Andricclass GPR64<bits<16> num, string n, GPR32 low, GPR32 high>
680b57cec5SDimitry Andric : SystemZRegWithSubregs<n, [low, high]> {
690b57cec5SDimitry Andric  let HWEncoding = num;
700b57cec5SDimitry Andric  let SubRegIndices = [subreg_l32, subreg_h32];
710b57cec5SDimitry Andric  let CoveredBySubRegs = 1;
720b57cec5SDimitry Andric}
730b57cec5SDimitry Andric
740b57cec5SDimitry Andric// 8 even-odd pairs of GPR64s.
750b57cec5SDimitry Andricclass GPR128<bits<16> num, string n, GPR64 low, GPR64 high>
7606c3fb27SDimitry Andric : SystemZRegWithSubregs<n, [high, low]> {
770b57cec5SDimitry Andric  let HWEncoding = num;
7806c3fb27SDimitry Andric  let SubRegIndices = [subreg_h64, subreg_l64];
790b57cec5SDimitry Andric  let CoveredBySubRegs = 1;
800b57cec5SDimitry Andric}
810b57cec5SDimitry Andric
820b57cec5SDimitry Andric// General-purpose registers
830b57cec5SDimitry Andricforeach I = 0-15 in {
840b57cec5SDimitry Andric  def R#I#L : GPR32<I, "r"#I>;
850b57cec5SDimitry Andric  def R#I#H : GPR32<I, "r"#I>;
860b57cec5SDimitry Andric  def R#I#D : GPR64<I, "r"#I, !cast<GPR32>("R"#I#"L"), !cast<GPR32>("R"#I#"H")>,
870b57cec5SDimitry Andric                    DwarfRegNum<[I]>;
880b57cec5SDimitry Andric}
890b57cec5SDimitry Andric
900b57cec5SDimitry Andricforeach I = [0, 2, 4, 6, 8, 10, 12, 14] in {
910b57cec5SDimitry Andric  def R#I#Q : GPR128<I, "r"#I, !cast<GPR64>("R"#!add(I, 1)#"D"),
920b57cec5SDimitry Andric                     !cast<GPR64>("R"#I#"D")>;
930b57cec5SDimitry Andric}
940b57cec5SDimitry Andric
95fe6060f1SDimitry Andric/// zLinux: Allocate the callee-saved R6-R13 backwards. That way they can be
96fe6060f1SDimitry Andric/// saved together with R14 and R15 in one prolog instruction.
97fe6060f1SDimitry Andric/// XPLINK64: Allocate all registers in natural order
980b57cec5SDimitry Andricdefm GR32  : SystemZRegClass<"GR32",  [i32], 32,
990b57cec5SDimitry Andric                             (add (sequence "R%uL",  0, 5),
100fe6060f1SDimitry Andric                                  (sequence "R%uL", 15, 6)),
101fe6060f1SDimitry Andric                             [(add (sequence "R%uL", 0, 15))]>;
1020b57cec5SDimitry Andricdefm GRH32 : SystemZRegClass<"GRH32", [i32], 32,
1030b57cec5SDimitry Andric                             (add (sequence "R%uH",  0, 5),
104fe6060f1SDimitry Andric                                  (sequence "R%uH", 15, 6)),
105fe6060f1SDimitry Andric                             [(add (sequence "R%uH", 0, 15))]>;
1060b57cec5SDimitry Andricdefm GR64  : SystemZRegClass<"GR64",  [i64], 64,
1070b57cec5SDimitry Andric                             (add (sequence "R%uD",  0, 5),
108fe6060f1SDimitry Andric                                  (sequence "R%uD", 15, 6)),
109fe6060f1SDimitry Andric                             [(add (sequence "R%uD",  0, 15))]>;
1100b57cec5SDimitry Andric
1110b57cec5SDimitry Andric// Combine the low and high GR32s into a single class.  This can only be
1120b57cec5SDimitry Andric// used for virtual registers if the high-word facility is available.
113fe6060f1SDimitry Andric/// XPLINK64: Allocate all registers in natural order
1140b57cec5SDimitry Andricdefm GRX32 : SystemZRegClass<"GRX32", [i32], 32,
1150b57cec5SDimitry Andric                             (add (sequence "R%uL",  0, 5),
1160b57cec5SDimitry Andric                                  (sequence "R%uH",  0, 5),
1170b57cec5SDimitry Andric                                  R15L, R15H, R14L, R14H, R13L, R13H,
1180b57cec5SDimitry Andric                                  R12L, R12H, R11L, R11H, R10L, R10H,
119fe6060f1SDimitry Andric                                  R9L, R9H, R8L, R8H, R7L, R7H, R6L, R6H),
120fe6060f1SDimitry Andric                             [(add
121fe6060f1SDimitry Andric                               R0L, R1L, R2L, R3L, R0H, R1H, R2H, R3H,
122fe6060f1SDimitry Andric                               R4L, R4H, R5L, R5H, R6L, R6H, R7L, R7H,
123fe6060f1SDimitry Andric                               R8L, R8H, R9L, R9H, R10L,R10H,R11L,R11H,
124fe6060f1SDimitry Andric                               R12L,R12H,R13L,R13H,R14L,R14H,R15L,R15H)
125fe6060f1SDimitry Andric                             ]>;
1260b57cec5SDimitry Andric
127*5f757f3fSDimitry Andric// On machines without SIMD support, i128 is not a legal type, so model the
1280b57cec5SDimitry Andric// register pairs as untyped instead.
129fe6060f1SDimitry Andric// XPLINK64: Allocate all registers in natural order
1300b57cec5SDimitry Andricdefm GR128 : SystemZRegClass<"GR128", [untyped], 128,
131fe6060f1SDimitry Andric                             (add R0Q, R2Q, R4Q, R12Q, R10Q, R8Q, R6Q, R14Q),
132fe6060f1SDimitry Andric                             [(add R0Q, R2Q, R4Q, R6Q, R8Q, R10Q, R12Q, R14Q)]>;
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andric// Base and index registers.  Everything except R0, which in an address
1350b57cec5SDimitry Andric// context evaluates as 0.
136fe6060f1SDimitry Andric// XPLINK64: Allocate all registers in natural order
137fe6060f1SDimitry Andricdefm ADDR32 : SystemZRegClass<"ADDR32", [i32], 32, (sub GR32Bit, R0L),
138fe6060f1SDimitry Andric                              [(add (sequence "R%uL",  1, 15))]>;
139fe6060f1SDimitry Andricdefm ADDR64 : SystemZRegClass<"ADDR64", [i64], 64, (sub GR64Bit, R0D),
140fe6060f1SDimitry Andric                              [(add (sequence "R%uD",  1, 15))]>;
1410b57cec5SDimitry Andric
1420b57cec5SDimitry Andric// Not used directly, but needs to exist for ADDR32 and ADDR64 subregs
1430b57cec5SDimitry Andric// of a GR128.
144fe6060f1SDimitry Andric// XPLINK64: Allocate all registers in natural order
145fe6060f1SDimitry Andricdefm ADDR128 : SystemZRegClass<"ADDR128", [untyped], 128, (sub GR128Bit, R0Q),
146fe6060f1SDimitry Andric                               [(add R2Q, R4Q, R6Q, R8Q, R10Q, R12Q, R14Q)]>;
1470b57cec5SDimitry Andric
1480b57cec5SDimitry Andric// Any type register. Used for .insn directives when we don't know what the
1490b57cec5SDimitry Andric// register types could be.
1500b57cec5SDimitry Andricdefm AnyReg : SystemZRegClass<"AnyReg",
1510b57cec5SDimitry Andric                              [i64, f64, v8i8, v4i16, v2i32, v2f32], 64,
1520b57cec5SDimitry Andric                              (add (sequence "R%uD", 0, 15),
1530b57cec5SDimitry Andric                                   (sequence "F%uD", 0, 15),
154fe6060f1SDimitry Andric                                   (sequence "V%u", 0, 15)),
155fe6060f1SDimitry Andric                              [], 0/*allocatable*/>;
1560b57cec5SDimitry Andric
1570b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
1580b57cec5SDimitry Andric// Floating-point registers
1590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
1600b57cec5SDimitry Andric
1610b57cec5SDimitry Andric// Maps FPR register numbers to their DWARF encoding.
1620b57cec5SDimitry Andricclass DwarfMapping<int id> { int Id = id; }
1630b57cec5SDimitry Andric
1640b57cec5SDimitry Andricdef F0Dwarf  : DwarfMapping<16>;
1650b57cec5SDimitry Andricdef F2Dwarf  : DwarfMapping<17>;
1660b57cec5SDimitry Andricdef F4Dwarf  : DwarfMapping<18>;
1670b57cec5SDimitry Andricdef F6Dwarf  : DwarfMapping<19>;
1680b57cec5SDimitry Andric
1690b57cec5SDimitry Andricdef F1Dwarf  : DwarfMapping<20>;
1700b57cec5SDimitry Andricdef F3Dwarf  : DwarfMapping<21>;
1710b57cec5SDimitry Andricdef F5Dwarf  : DwarfMapping<22>;
1720b57cec5SDimitry Andricdef F7Dwarf  : DwarfMapping<23>;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef F8Dwarf  : DwarfMapping<24>;
1750b57cec5SDimitry Andricdef F10Dwarf : DwarfMapping<25>;
1760b57cec5SDimitry Andricdef F12Dwarf : DwarfMapping<26>;
1770b57cec5SDimitry Andricdef F14Dwarf : DwarfMapping<27>;
1780b57cec5SDimitry Andric
1790b57cec5SDimitry Andricdef F9Dwarf  : DwarfMapping<28>;
1800b57cec5SDimitry Andricdef F11Dwarf : DwarfMapping<29>;
1810b57cec5SDimitry Andricdef F13Dwarf : DwarfMapping<30>;
1820b57cec5SDimitry Andricdef F15Dwarf : DwarfMapping<31>;
1830b57cec5SDimitry Andric
1840b57cec5SDimitry Andricdef F16Dwarf : DwarfMapping<68>;
1850b57cec5SDimitry Andricdef F18Dwarf : DwarfMapping<69>;
1860b57cec5SDimitry Andricdef F20Dwarf : DwarfMapping<70>;
1870b57cec5SDimitry Andricdef F22Dwarf : DwarfMapping<71>;
1880b57cec5SDimitry Andric
1890b57cec5SDimitry Andricdef F17Dwarf : DwarfMapping<72>;
1900b57cec5SDimitry Andricdef F19Dwarf : DwarfMapping<73>;
1910b57cec5SDimitry Andricdef F21Dwarf : DwarfMapping<74>;
1920b57cec5SDimitry Andricdef F23Dwarf : DwarfMapping<75>;
1930b57cec5SDimitry Andric
1940b57cec5SDimitry Andricdef F24Dwarf : DwarfMapping<76>;
1950b57cec5SDimitry Andricdef F26Dwarf : DwarfMapping<77>;
1960b57cec5SDimitry Andricdef F28Dwarf : DwarfMapping<78>;
1970b57cec5SDimitry Andricdef F30Dwarf : DwarfMapping<79>;
1980b57cec5SDimitry Andric
1990b57cec5SDimitry Andricdef F25Dwarf : DwarfMapping<80>;
2000b57cec5SDimitry Andricdef F27Dwarf : DwarfMapping<81>;
2010b57cec5SDimitry Andricdef F29Dwarf : DwarfMapping<82>;
2020b57cec5SDimitry Andricdef F31Dwarf : DwarfMapping<83>;
2030b57cec5SDimitry Andric
2040b57cec5SDimitry Andric// Upper 32 bits of one of the floating-point registers
2050b57cec5SDimitry Andricclass FPR32<bits<16> num, string n> : SystemZReg<n> {
2060b57cec5SDimitry Andric  let HWEncoding = num;
2070b57cec5SDimitry Andric}
2080b57cec5SDimitry Andric
2090b57cec5SDimitry Andric// One of the floating-point registers.
2100b57cec5SDimitry Andricclass FPR64<bits<16> num, string n, FPR32 high>
2110b57cec5SDimitry Andric : SystemZRegWithSubregs<n, [high]> {
2120b57cec5SDimitry Andric  let HWEncoding = num;
2130b57cec5SDimitry Andric  let SubRegIndices = [subreg_h32];
2140b57cec5SDimitry Andric}
2150b57cec5SDimitry Andric
2160b57cec5SDimitry Andric// 8 pairs of FPR64s, with a one-register gap inbetween.
2170b57cec5SDimitry Andricclass FPR128<bits<16> num, string n, FPR64 low, FPR64 high>
21806c3fb27SDimitry Andric : SystemZRegWithSubregs<n, [high, low]> {
2190b57cec5SDimitry Andric  let HWEncoding = num;
22006c3fb27SDimitry Andric  let SubRegIndices = [subreg_h64, subreg_l64];
2210b57cec5SDimitry Andric  let CoveredBySubRegs = 1;
2220b57cec5SDimitry Andric}
2230b57cec5SDimitry Andric
2240b57cec5SDimitry Andric// Floating-point registers.  Registers 16-31 require the vector facility.
2250b57cec5SDimitry Andricforeach I = 0-15 in {
2260b57cec5SDimitry Andric  def F#I#S : FPR32<I, "f"#I>;
2270b57cec5SDimitry Andric  def F#I#D : FPR64<I, "f"#I, !cast<FPR32>("F"#I#"S")>,
2280b57cec5SDimitry Andric              DwarfRegNum<[!cast<DwarfMapping>("F"#I#"Dwarf").Id]>;
2290b57cec5SDimitry Andric}
2300b57cec5SDimitry Andricforeach I = 16-31 in {
2310b57cec5SDimitry Andric  def F#I#S : FPR32<I, "v"#I>;
2320b57cec5SDimitry Andric  def F#I#D : FPR64<I, "v"#I, !cast<FPR32>("F"#I#"S")>,
2330b57cec5SDimitry Andric              DwarfRegNum<[!cast<DwarfMapping>("F"#I#"Dwarf").Id]>;
2340b57cec5SDimitry Andric}
2350b57cec5SDimitry Andric
2360b57cec5SDimitry Andricforeach I = [0, 1, 4, 5, 8, 9, 12, 13] in {
2370b57cec5SDimitry Andric  def F#I#Q  : FPR128<I, "f"#I, !cast<FPR64>("F"#!add(I, 2)#"D"),
2380b57cec5SDimitry Andric                     !cast<FPR64>("F"#I#"D")>;
2390b57cec5SDimitry Andric}
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andric// There's no store-multiple instruction for FPRs, so we're not fussy
2420b57cec5SDimitry Andric// about the order in which call-saved registers are allocated.
2430b57cec5SDimitry Andricdefm FP32  : SystemZRegClass<"FP32", [f32], 32, (sequence "F%uS", 0, 15)>;
2440b57cec5SDimitry Andricdefm FP64  : SystemZRegClass<"FP64", [f64], 64, (sequence "F%uD", 0, 15)>;
2450b57cec5SDimitry Andricdefm FP128 : SystemZRegClass<"FP128", [f128], 128,
2460b57cec5SDimitry Andric                             (add F0Q, F1Q, F4Q, F5Q, F8Q, F9Q, F12Q, F13Q)>;
2470b57cec5SDimitry Andric
2480b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
2490b57cec5SDimitry Andric// Vector registers
2500b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
2510b57cec5SDimitry Andric
2520b57cec5SDimitry Andric// A full 128-bit vector register, with an FPR64 as its high part.
2530b57cec5SDimitry Andricclass VR128<bits<16> num, string n, FPR64 high>
2540b57cec5SDimitry Andric  : SystemZRegWithSubregs<n, [high]> {
2550b57cec5SDimitry Andric  let HWEncoding = num;
2560b57cec5SDimitry Andric  let SubRegIndices = [subreg_h64];
2570b57cec5SDimitry Andric}
2580b57cec5SDimitry Andric
2590b57cec5SDimitry Andric// Full vector registers.
2600b57cec5SDimitry Andricforeach I = 0-31 in {
2610b57cec5SDimitry Andric  def V#I : VR128<I, "v"#I, !cast<FPR64>("F"#I#"D")>,
2620b57cec5SDimitry Andric            DwarfRegNum<[!cast<DwarfMapping>("F"#I#"Dwarf").Id]>;
2630b57cec5SDimitry Andric}
2640b57cec5SDimitry Andric
2650b57cec5SDimitry Andric// Class used to store 32-bit values in the first element of a vector
2660b57cec5SDimitry Andric// register.  f32 scalars are used for the WLEDB and WLDEB instructions.
2670b57cec5SDimitry Andricdefm VR32 : SystemZRegClass<"VR32", [f32, v4i8, v2i16], 32,
2680b57cec5SDimitry Andric                            (add (sequence "F%uS", 0, 7),
2690b57cec5SDimitry Andric                                 (sequence "F%uS", 16, 31),
2700b57cec5SDimitry Andric                                 (sequence "F%uS", 8, 15))>;
2710b57cec5SDimitry Andric
2720b57cec5SDimitry Andric// Class used to store 64-bit values in the upper half of a vector register.
2730b57cec5SDimitry Andric// The vector facility also includes scalar f64 instructions that operate
2740b57cec5SDimitry Andric// on the full vector register set.
2750b57cec5SDimitry Andricdefm VR64 : SystemZRegClass<"VR64", [f64, v8i8, v4i16, v2i32, v2f32], 64,
2760b57cec5SDimitry Andric                            (add (sequence "F%uD", 0, 7),
2770b57cec5SDimitry Andric                                 (sequence "F%uD", 16, 31),
2780b57cec5SDimitry Andric                                 (sequence "F%uD", 8, 15))>;
2790b57cec5SDimitry Andric
2800b57cec5SDimitry Andric// The subset of vector registers that can be used for floating-point
2810b57cec5SDimitry Andric// operations too.
2820b57cec5SDimitry Andricdefm VF128 : SystemZRegClass<"VF128",
2830b57cec5SDimitry Andric                             [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], 128,
2840b57cec5SDimitry Andric                             (sequence "V%u", 0, 15)>;
2850b57cec5SDimitry Andric
2860b57cec5SDimitry Andric// All vector registers.
2870b57cec5SDimitry Andricdefm VR128 : SystemZRegClass<"VR128",
288*5f757f3fSDimitry Andric                             [v16i8, v8i16, v4i32, v2i64, i128,
289*5f757f3fSDimitry Andric                              v4f32, v2f64, f128],
2900b57cec5SDimitry Andric                             128, (add (sequence "V%u", 0, 7),
2910b57cec5SDimitry Andric                                       (sequence "V%u", 16, 31),
2920b57cec5SDimitry Andric                                       (sequence "V%u", 8, 15))>;
2930b57cec5SDimitry Andric
2940b57cec5SDimitry Andric// Attaches a ValueType to a register operand, to make the instruction
2950b57cec5SDimitry Andric// definitions easier.
2960b57cec5SDimitry Andricclass TypedReg<ValueType vtin, RegisterOperand opin> {
2970b57cec5SDimitry Andric  ValueType vt = vtin;
2980b57cec5SDimitry Andric  RegisterOperand op = opin;
2990b57cec5SDimitry Andric}
3000b57cec5SDimitry Andric
3010b57cec5SDimitry Andricdef v32f    : TypedReg<i32,     VR32>;
3020b57cec5SDimitry Andricdef v32sb   : TypedReg<f32,     VR32>;
3030b57cec5SDimitry Andricdef v64g    : TypedReg<i64,     VR64>;
3040b57cec5SDimitry Andricdef v64db   : TypedReg<f64,     VR64>;
3050b57cec5SDimitry Andricdef v128b   : TypedReg<v16i8,   VR128>;
3060b57cec5SDimitry Andricdef v128h   : TypedReg<v8i16,   VR128>;
3070b57cec5SDimitry Andricdef v128f   : TypedReg<v4i32,   VR128>;
3080b57cec5SDimitry Andricdef v128g   : TypedReg<v2i64,   VR128>;
309*5f757f3fSDimitry Andricdef v128q   : TypedReg<i128,    VR128>;
3100b57cec5SDimitry Andricdef v128sb  : TypedReg<v4f32,   VR128>;
3110b57cec5SDimitry Andricdef v128db  : TypedReg<v2f64,   VR128>;
3120b57cec5SDimitry Andricdef v128xb  : TypedReg<f128,    VR128>;
3130b57cec5SDimitry Andricdef v128any : TypedReg<untyped, VR128>;
3140b57cec5SDimitry Andric
3150b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3160b57cec5SDimitry Andric// Other registers
3170b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andric// The 2-bit condition code field of the PSW.  Every register named in an
3200b57cec5SDimitry Andric// inline asm needs a class associated with it.
3210b57cec5SDimitry Andricdef CC : SystemZReg<"cc">;
3220b57cec5SDimitry Andriclet isAllocatable = 0, CopyCost = -1 in
3230b57cec5SDimitry Andric  def CCR : RegisterClass<"SystemZ", [i32], 32, (add CC)>;
3240b57cec5SDimitry Andric
3250b57cec5SDimitry Andric// The floating-point control register.
3260b57cec5SDimitry Andric// Note: We only model the current rounding modes and the IEEE masks.
3270b57cec5SDimitry Andric// IEEE flags and DXC are not modeled here.
3280b57cec5SDimitry Andricdef FPC : SystemZReg<"fpc">;
3290b57cec5SDimitry Andriclet isAllocatable = 0 in
3300b57cec5SDimitry Andric  def FPCRegs : RegisterClass<"SystemZ", [i32], 32, (add FPC)>;
3310b57cec5SDimitry Andric
3320b57cec5SDimitry Andric// Access registers.
3330b57cec5SDimitry Andricclass ACR32<bits<16> num, string n> : SystemZReg<n> {
3340b57cec5SDimitry Andric  let HWEncoding = num;
3350b57cec5SDimitry Andric}
3360b57cec5SDimitry Andricforeach I = 0-15 in {
3370b57cec5SDimitry Andric  def A#I : ACR32<I, "a"#I>, DwarfRegNum<[!add(I, 48)]>;
3380b57cec5SDimitry Andric}
3390b57cec5SDimitry Andricdefm AR32 : SystemZRegClass<"AR32", [i32], 32,
340fe6060f1SDimitry Andric                            (add (sequence "A%u", 0, 15)), [], 0>;
3410b57cec5SDimitry Andric
3420b57cec5SDimitry Andric// Control registers.
3430b57cec5SDimitry Andricclass CREG64<bits<16> num, string n> : SystemZReg<n> {
3440b57cec5SDimitry Andric  let HWEncoding = num;
3450b57cec5SDimitry Andric}
3460b57cec5SDimitry Andricforeach I = 0-15 in {
3470b57cec5SDimitry Andric  def C#I : CREG64<I, "c"#I>, DwarfRegNum<[!add(I, 32)]>;
3480b57cec5SDimitry Andric}
3490b57cec5SDimitry Andricdefm CR64 : SystemZRegClass<"CR64", [i64], 64,
350fe6060f1SDimitry Andric                            (add (sequence "C%u", 0, 15)), [], 0>;
351