Index: lib/Target/Mips/MipsInstrInfo.td =================================================================== --- lib/Target/Mips/MipsInstrInfo.td +++ lib/Target/Mips/MipsInstrInfo.td @@ -394,10 +394,6 @@ let DiagnosticType = "SImm" # Bits # "_" # Offset; } -def ConstantSImm4AsmOperandClass - : ConstantSImmAsmOperandClass< - 4, []>; - class ConstantUImmAsmOperandClass Supers = [], int Offset = 0> : AsmOperandClass { let Name = "ConstantUImm" # Bits # "_" # Offset; @@ -450,45 +446,46 @@ let DiagnosticType = "UImm6_Lsl2"; } def ConstantUImm6AsmOperandClass - : ConstantUImmAsmOperandClass<6, [ConstantUImm7AsmOperandClass]>; + : ConstantUImmAsmOperandClass<6, [ConstantUImm6Lsl2AsmOperandClass]>; def ConstantSImm6AsmOperandClass - : ConstantSImmAsmOperandClass<6, [ConstantUImm7AsmOperandClass]>; -def ConstantUImm5Plus1AsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass], 1>; -def ConstantUImm5_Range2_64AsmOperandClass - : ConstantUImmRangeAsmOperandClass<2, 64, [ConstantUImm6AsmOperandClass]>; -def ConstantUImm5Plus32AsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass], 32>; -def ConstantUImm5Plus33AsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass], 33>; -def ConstantUImm5Plus32NormalizeAsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass], 32> { - let Name = "ConstantUImm5_32_Norm"; - // We must also subtract 32 when we render the operand. - let RenderMethod = "addConstantUImmOperands<5, 32, -32>"; -} + : ConstantSImmAsmOperandClass<6, [ConstantUImm6AsmOperandClass]>; def ConstantUImm5Lsl2AsmOperandClass : AsmOperandClass { let Name = "UImm5Lsl2"; let RenderMethod = "addImmOperands"; let PredicateMethod = "isScaledUImm<5, 2>"; - let SuperClasses = [ConstantUImm6AsmOperandClass]; + let SuperClasses = [ConstantSImm6AsmOperandClass]; let DiagnosticType = "UImm5_Lsl2"; } +def ConstantUImm5_Range2_64AsmOperandClass + : ConstantUImmRangeAsmOperandClass<2, 64, [ConstantUImm5Lsl2AsmOperandClass]>; +def ConstantUImm5Plus33AsmOperandClass + : ConstantUImmAsmOperandClass<5, [ConstantUImm5_Range2_64AsmOperandClass], + 33>; def ConstantUImm5ReportUImm6AsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass]> { + : ConstantUImmAsmOperandClass<5, [ConstantUImm5Plus33AsmOperandClass]> { let Name = "ConstantUImm5_0_Report_UImm6"; let DiagnosticType = "UImm5_0_Report_UImm6"; } +def ConstantUImm5Plus32AsmOperandClass + : ConstantUImmAsmOperandClass< + 5, [ConstantUImm5ReportUImm6AsmOperandClass], 32>; +def ConstantUImm5Plus32NormalizeAsmOperandClass + : ConstantUImmAsmOperandClass<5, [ConstantUImm5Plus32AsmOperandClass], 32> { + let Name = "ConstantUImm5_32_Norm"; + // We must also subtract 32 when we render the operand. + let RenderMethod = "addConstantUImmOperands<5, 32, -32>"; +} +def ConstantUImm5Plus1AsmOperandClass + : ConstantUImmAsmOperandClass< + 5, [ConstantUImm5Plus32NormalizeAsmOperandClass], 1>; def ConstantUImm5AsmOperandClass - : ConstantUImmAsmOperandClass<5, [ConstantUImm6AsmOperandClass]>; + : ConstantUImmAsmOperandClass<5, [ConstantUImm5Plus1AsmOperandClass]>; def ConstantUImm4AsmOperandClass - : ConstantUImmAsmOperandClass< - 4, [ConstantUImm5AsmOperandClass, - ConstantUImm5Plus32AsmOperandClass, - ConstantUImm5Plus32NormalizeAsmOperandClass]>; + : ConstantUImmAsmOperandClass<4, [ConstantUImm5AsmOperandClass]>; +def ConstantSImm4AsmOperandClass + : ConstantSImmAsmOperandClass<4, [ConstantUImm4AsmOperandClass]>; def ConstantUImm3AsmOperandClass - : ConstantUImmAsmOperandClass<3, [ConstantSImm4AsmOperandClass, - ConstantUImm4AsmOperandClass]>; + : ConstantUImmAsmOperandClass<3, [ConstantSImm4AsmOperandClass]>; def ConstantUImm2Plus1AsmOperandClass : ConstantUImmAsmOperandClass<2, [ConstantUImm3AsmOperandClass], 1>; def ConstantUImm2AsmOperandClass