class AFPR64<bits<16> Enc, string n, list<Register> subregs>
: MipsRegWithSubRegs<Enc, n, subregs> {
let SubRegIndices = [sub_lo, sub_hi];
+ let CoveredBySubRegs = 1;
}
// Mips 128-bit (aliased) MSA Registers
/// Mips MSA registers
/// MSA and FPU cannot both be present unless the FPU has 64-bit registers
- def W0 : AFPR128<0, "w0", [D0_64]>, DwarfRegNum<[32]>;
- def W1 : AFPR128<1, "w1", [D1_64]>, DwarfRegNum<[33]>;
- def W2 : AFPR128<2, "w2", [D2_64]>, DwarfRegNum<[34]>;
- def W3 : AFPR128<3, "w3", [D3_64]>, DwarfRegNum<[35]>;
- def W4 : AFPR128<4, "w4", [D4_64]>, DwarfRegNum<[36]>;
- def W5 : AFPR128<5, "w5", [D5_64]>, DwarfRegNum<[37]>;
- def W6 : AFPR128<6, "w6", [D6_64]>, DwarfRegNum<[38]>;
- def W7 : AFPR128<7, "w7", [D7_64]>, DwarfRegNum<[39]>;
- def W8 : AFPR128<8, "w8", [D8_64]>, DwarfRegNum<[40]>;
- def W9 : AFPR128<9, "w9", [D9_64]>, DwarfRegNum<[41]>;
- def W10 : AFPR128<10, "w10", [D10_64]>, DwarfRegNum<[42]>;
- def W11 : AFPR128<11, "w11", [D11_64]>, DwarfRegNum<[43]>;
- def W12 : AFPR128<12, "w12", [D12_64]>, DwarfRegNum<[44]>;
- def W13 : AFPR128<13, "w13", [D13_64]>, DwarfRegNum<[45]>;
- def W14 : AFPR128<14, "w14", [D14_64]>, DwarfRegNum<[46]>;
- def W15 : AFPR128<15, "w15", [D15_64]>, DwarfRegNum<[47]>;
- def W16 : AFPR128<16, "w16", [D16_64]>, DwarfRegNum<[48]>;
- def W17 : AFPR128<17, "w17", [D17_64]>, DwarfRegNum<[49]>;
- def W18 : AFPR128<18, "w18", [D18_64]>, DwarfRegNum<[50]>;
- def W19 : AFPR128<19, "w19", [D19_64]>, DwarfRegNum<[51]>;
- def W20 : AFPR128<20, "w20", [D20_64]>, DwarfRegNum<[52]>;
- def W21 : AFPR128<21, "w21", [D21_64]>, DwarfRegNum<[53]>;
- def W22 : AFPR128<22, "w22", [D22_64]>, DwarfRegNum<[54]>;
- def W23 : AFPR128<23, "w23", [D23_64]>, DwarfRegNum<[55]>;
- def W24 : AFPR128<24, "w24", [D24_64]>, DwarfRegNum<[56]>;
- def W25 : AFPR128<25, "w25", [D25_64]>, DwarfRegNum<[57]>;
- def W26 : AFPR128<26, "w26", [D26_64]>, DwarfRegNum<[58]>;
- def W27 : AFPR128<27, "w27", [D27_64]>, DwarfRegNum<[59]>;
- def W28 : AFPR128<28, "w28", [D28_64]>, DwarfRegNum<[60]>;
- def W29 : AFPR128<29, "w29", [D29_64]>, DwarfRegNum<[61]>;
- def W30 : AFPR128<30, "w30", [D30_64]>, DwarfRegNum<[62]>;
- def W31 : AFPR128<31, "w31", [D31_64]>, DwarfRegNum<[63]>;
+ foreach I = 0-31 in
+ def W#I : AFPR128<I, "w"#I, [!cast<AFPR64>("D"#I#"_64")]>,
+ DwarfRegNum<[!add(I, 32)]>;
// Hi/Lo registers
- def HI0 : Register<"ac0">, DwarfRegNum<[64]>;
- def HI1 : Register<"ac1">, DwarfRegNum<[176]>;
- def HI2 : Register<"ac2">, DwarfRegNum<[178]>;
- def HI3 : Register<"ac3">, DwarfRegNum<[180]>;
- def LO0 : Register<"ac0">, DwarfRegNum<[65]>;
- def LO1 : Register<"ac1">, DwarfRegNum<[177]>;
- def LO2 : Register<"ac2">, DwarfRegNum<[179]>;
- def LO3 : Register<"ac3">, DwarfRegNum<[181]>;
+ def HI0 : MipsReg<0, "ac0">, DwarfRegNum<[64]>;
+ def HI1 : MipsReg<1, "ac1">, DwarfRegNum<[176]>;
+ def HI2 : MipsReg<2, "ac2">, DwarfRegNum<[178]>;
+ def HI3 : MipsReg<3, "ac3">, DwarfRegNum<[180]>;
+ def LO0 : MipsReg<0, "ac0">, DwarfRegNum<[65]>;
+ def LO1 : MipsReg<1, "ac1">, DwarfRegNum<[177]>;
+ def LO2 : MipsReg<2, "ac2">, DwarfRegNum<[179]>;
+ def LO3 : MipsReg<3, "ac3">, DwarfRegNum<[181]>;
let SubRegIndices = [sub_32] in {
def HI0_64 : RegisterWithSubRegs<"hi", [HI0]>;
foreach I = 0-7 in
def FCC#I : MipsReg<#I, "fcc"#I>;
+ // COP2 registers.
+ foreach I = 0-31 in
+ def COP2#I : MipsReg<#I, ""#I>;
+
// PC register
def PC : Register<"pc">;
def DSPOutFlag : RegisterWithSubRegs<"", [DSPOutFlag16_19, DSPOutFlag20,
DSPOutFlag21, DSPOutFlag22,
DSPOutFlag23]>;
+
+ // MSA-ASE control registers.
+ def MSAIR : MipsReg<0, "0">;
+ def MSACSR : MipsReg<1, "1">;
+ def MSAAccess : MipsReg<2, "2">;
+ def MSASave : MipsReg<3, "3">;
+ def MSAModify : MipsReg<4, "4">;
+ def MSARequest : MipsReg<5, "5">;
+ def MSAMap : MipsReg<6, "6">;
+ def MSAUnmap : MipsReg<7, "7">;
}
//===----------------------------------------------------------------------===//
// * FGR32 - 32 32-bit registers (single float only mode)
def FGR32 : RegisterClass<"Mips", [f32], 32, (sequence "F%u", 0, 31)>;
-def FGRH32 : RegisterClass<"Mips", [f32], 32, (sequence "F_HI%u", 0, 31)>;
+def FGRH32 : RegisterClass<"Mips", [f32], 32, (sequence "F_HI%u", 0, 31)>,
+ Unallocatable;
def AFGR64 : RegisterClass<"Mips", [f64], 64, (add
// Return Values and Arguments
def FCC : RegisterClass<"Mips", [i32], 32, (sequence "FCC%u", 0, 7)>,
Unallocatable;
-def MSA128: RegisterClass<"Mips",
- [v16i8, v8i16, v4i32, v2i64, v8f16, v4f32, v2f64],
- 128, (sequence "W%u", 0, 31)>;
+def MSA128B: RegisterClass<"Mips", [v16i8], 128,
+ (sequence "W%u", 0, 31)>;
+def MSA128H: RegisterClass<"Mips", [v8i16, v8f16], 128,
+ (sequence "W%u", 0, 31)>;
+def MSA128W: RegisterClass<"Mips", [v4i32, v4f32], 128,
+ (sequence "W%u", 0, 31)>;
+def MSA128D: RegisterClass<"Mips", [v2i64, v2f64], 128,
+ (sequence "W%u", 0, 31)>;
+
+def MSACtrl: RegisterClass<"Mips", [i32], 32, (add
+ MSAIR, MSACSR, MSAAccess, MSASave, MSAModify, MSARequest, MSAMap, MSAUnmap)>;
// Hi/Lo Registers
def LO32 : RegisterClass<"Mips", [i32], 32, (add LO0)>;
def DSPCC : RegisterClass<"Mips", [v4i8, v2i16], 32, (add DSPCCond)>;
+// Coprocessor 2 registers.
+def COP2 : RegisterClass<"Mips", [i32], 32, (sequence "COP2%u", 0, 31)>,
+ Unallocatable;
+
// Register Operands.
class MipsAsmRegOperand : AsmOperandClass {
let ParserMethod = "parseFCCRegs";
}
+def MSA128BAsmOperand : MipsAsmRegOperand {
+ let Name = "MSA128BAsm";
+ let ParserMethod = "parseMSA128BRegs";
+}
+
+def MSA128HAsmOperand : MipsAsmRegOperand {
+ let Name = "MSA128HAsm";
+ let ParserMethod = "parseMSA128HRegs";
+}
+
+def MSA128WAsmOperand : MipsAsmRegOperand {
+ let Name = "MSA128WAsm";
+ let ParserMethod = "parseMSA128WRegs";
+}
+
+def MSA128DAsmOperand : MipsAsmRegOperand {
+ let Name = "MSA128DAsm";
+ let ParserMethod = "parseMSA128DRegs";
+}
+
+def MSA128CRAsmOperand : MipsAsmRegOperand {
+ let Name = "MSA128CRAsm";
+ let ParserMethod = "parseMSA128CtrlRegs";
+}
+
def GPR32Opnd : RegisterOperand<GPR32> {
let ParserMatchClass = GPR32AsmOperand;
}
let ParserMethod = "parseHWRegs";
}
+def COP2AsmOperand : MipsAsmRegOperand {
+ let Name = "COP2Asm";
+ let ParserMethod = "parseCOP2";
+}
+
def HWRegsOpnd : RegisterOperand<HWRegs> {
let ParserMatchClass = HWRegsAsmOperand;
}
def ACC64DSPOpnd : RegisterOperand<ACC64DSP> {
let ParserMatchClass = ACC64DSPAsmOperand;
}
+
+def COP2Opnd : RegisterOperand<COP2> {
+ let ParserMatchClass = COP2AsmOperand;
+}
+
+def MSA128BOpnd : RegisterOperand<MSA128B> {
+ let ParserMatchClass = MSA128BAsmOperand;
+}
+
+def MSA128HOpnd : RegisterOperand<MSA128H> {
+ let ParserMatchClass = MSA128HAsmOperand;
+}
+
+def MSA128WOpnd : RegisterOperand<MSA128W> {
+ let ParserMatchClass = MSA128WAsmOperand;
+}
+
+def MSA128DOpnd : RegisterOperand<MSA128D> {
+ let ParserMatchClass = MSA128DAsmOperand;
+}
+
+def MSA128CROpnd : RegisterOperand<MSACtrl> {
+ let ParserMatchClass = MSA128CRAsmOperand;
+}
+