diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td index 4e754bd6a2380..68d5e7507633c 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.td @@ -157,20 +157,6 @@ def simm12 : Operand, ImmLeaf(Imm);}]> { let OperandNamespace = "RISCVOp"; } -// A 12-bit signed immediate plus one where the imm range will be -2047~2048. -def simm12_plus1 : Operand, ImmLeaf(Imm) && Imm != -2048) || Imm == 2048;}]> { - let ParserMatchClass = SImmAsmOperand<12>; - let EncoderMethod = "getImmOpValue"; - let DecoderMethod = "decodeSImmOperand<12>"; - let MCOperandPredicate = [{ - int64_t Imm; - if (MCOp.evaluateAsConstantImm(Imm)) - return (isInt<12>(Imm) && Imm != -2048) || Imm == 2048; - return MCOp.isBareSymbolRef(); - }]; -} - // A 13-bit signed immediate where the least significant bit is zero. def simm13_lsb0 : Operand { let ParserMatchClass = SImmAsmOperand<13, "Lsb0">; @@ -296,6 +282,10 @@ def ixlenimm_li : Operand { // Standalone (codegen-only) immleaf patterns. +// A 12-bit signed immediate plus one where the imm range will be -2047~2048. +def simm12_plus1 : ImmLeaf(Imm) && Imm != -2048) || Imm == 2048;}]>; + // A 6-bit constant greater than 32. def uimm6gt32 : ImmLeaf(Imm) && Imm > 32;