From 5db19cc01017ed67ec443dd7b0e7b54d991a67da Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 30 Mar 2021 19:00:28 -0700 Subject: [PATCH] [RISCV] simm12_plus1 should not inherit from Operand. NFC We only use this in Pat patterns, so it just needs to be an ImmLeaf. If we did need it as an instruction operand, the ParserMatchClass, EncoderMethod, and DecoderMethod were probably wrong. --- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td index 4e754bd..68d5e75 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; -- 2.7.4