Index: lib/Target/Mips/AsmParser/MipsAsmParser.cpp =================================================================== --- lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -3794,6 +3794,9 @@ case Match_UImm20_0: return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 20-bit unsigned immediate"); + case Match_UImm26_0: + return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), + "expected 26-bit unsigned immediate"); } llvm_unreachable("Implement any new match types added!"); Index: lib/Target/Mips/Mips16InstrInfo.td =================================================================== --- lib/Target/Mips/Mips16InstrInfo.td +++ lib/Target/Mips/Mips16InstrInfo.td @@ -115,7 +115,7 @@ // class FJAL16_ins _X, string asmstr, InstrItinClass itin>: - FJAL16<_X, (outs), (ins simm20:$imm), + FJAL16<_X, (outs), (ins uimm26:$imm), !strconcat(asmstr, "\t$imm\n\tnop"),[], itin> { let isCodeGenOnly=1; @@ -124,7 +124,7 @@ class FJALB16_ins _X, string asmstr, InstrItinClass itin>: - FJAL16<_X, (outs), (ins simm20:$imm), + FJAL16<_X, (outs), (ins uimm26:$imm), !strconcat(asmstr, "\t$imm\t# branch\n\tnop"),[], itin> { let isCodeGenOnly=1; Index: lib/Target/Mips/MipsInstrInfo.td =================================================================== --- lib/Target/Mips/MipsInstrInfo.td +++ lib/Target/Mips/MipsInstrInfo.td @@ -445,8 +445,10 @@ // uimm5 < uimm5_64, and uimm5 < vsplat_uimm5 // This is entirely arbitrary. We need an ordering and what we pick is // unimportant since only one is possible for a given mnemonic. +def ConstantUImm26AsmOperandClass + : ConstantUImmAsmOperandClass<26, []>; def ConstantUImm20AsmOperandClass - : ConstantUImmAsmOperandClass<20, []>; + : ConstantUImmAsmOperandClass<20, [ConstantUImm26AsmOperandClass]>; def UImm16RelaxedAsmOperandClass : UImmAsmOperandClass<16, [ConstantUImm20AsmOperandClass]> { let Name = "UImm16_Relaxed"; @@ -585,7 +587,6 @@ let ParserMatchClass = MipsJumpTargetAsmOperand; } -def simm20 : Operand; def simm32 : Operand; def simm16_64 : Operand { @@ -607,7 +608,7 @@ } // Unsigned Operands -foreach I = {1, 2, 3, 4, 5, 6, 7, 8, 10, 20} in +foreach I = {1, 2, 3, 4, 5, 6, 7, 8, 10, 20, 26} in def uimm # I : Operand { let PrintMethod = "printUImm<" # I # ">"; let ParserMatchClass =