diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 17 |
2 files changed, 7 insertions, 13 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index d04e8d4e4fa..14e63ad0c2b 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -3653,6 +3653,9 @@ bool MipsAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, case Match_UImm8_0: return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 8-bit unsigned immediate"); + case Match_UImm10_0: + return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), + "expected 10-bit unsigned immediate"); } llvm_unreachable("Implement any new match types added!"); diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index e3844d67daa..c07edef8673 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -394,8 +394,10 @@ class ConstantUImmAsmOperandClass<int Bits, list<AsmOperandClass> Supers = [], let DiagnosticType = "UImm" # Bits # "_" # Offset; } +def ConstantUImm10AsmOperandClass + : ConstantUImmAsmOperandClass<10, []>; def ConstantUImm8AsmOperandClass - : ConstantUImmAsmOperandClass<8, []>; + : ConstantUImmAsmOperandClass<8, [ConstantUImm10AsmOperandClass]>; def ConstantUImm6AsmOperandClass : ConstantUImmAsmOperandClass<6, [ConstantUImm8AsmOperandClass]>; def ConstantUImm5Plus32AsmOperandClass @@ -492,17 +494,6 @@ def simm32 : Operand<i32>; def uimm20 : Operand<i32> { } -def MipsUImm10AsmOperand : AsmOperandClass { - let Name = "UImm10"; - let RenderMethod = "addImmOperands"; - let ParserMethod = "parseImm"; - let PredicateMethod = "isUImm<10>"; -} - -def uimm10 : Operand<i32> { - let ParserMatchClass = MipsUImm10AsmOperand; -} - def simm16_64 : Operand<i64> { let DecoderMethod = "DecodeSimm16"; } @@ -514,7 +505,7 @@ def uimmz : Operand<i32> { } // Unsigned Operands -foreach I = {1, 2, 3, 4, 5, 6, 8} in +foreach I = {1, 2, 3, 4, 5, 6, 8, 10} in def uimm # I : Operand<i32> { let PrintMethod = "printUnsignedImm"; let ParserMatchClass = |