@@ -62,7 +62,7 @@ def UImm5Plus1AsmOperand : AsmOperandClass {
6262}
6363
6464def uimm5_plus1 : RISCVOp, ImmLeaf<XLenVT,
65- [{return (isUInt<5>( Imm) && (Imm != 0)) || ( Imm == 32) ;}]> {
65+ [{return Imm >= 1 && Imm <= 32;}]> {
6666 let ParserMatchClass = UImm5Plus1AsmOperand;
6767 let EncoderMethod = "getImmOpValueMinus1";
6868 let DecoderMethod = "decodeUImmPlus1Operand<5>";
@@ -71,12 +71,12 @@ def uimm5_plus1 : RISCVOp, ImmLeaf<XLenVT,
7171 int64_t Imm;
7272 if (!MCOp.evaluateAsConstantImm(Imm))
7373 return false;
74- return (isUInt<5>( Imm) && (Imm != 0)) || ( Imm == 32) ;
74+ return Imm >= 1 && Imm <= 32;
7575 }];
7676}
7777
7878def uimm5ge6_plus1 : RISCVOp<XLenVT>, ImmLeaf<XLenVT,
79- [{return ( Imm >= 6) && (isUInt<5>( Imm) || (Imm == 32)) ;}]> {
79+ [{return Imm >= 6 && Imm <= 32;}]> {
8080 let ParserMatchClass = UImmAsmOperand<5, "GE6Plus1">;
8181 let EncoderMethod = "getImmOpValueMinus1";
8282 let DecoderMethod = "decodeUImmPlus1OperandGE<5,6>";
@@ -85,7 +85,7 @@ def uimm5ge6_plus1 : RISCVOp<XLenVT>, ImmLeaf<XLenVT,
8585 int64_t Imm;
8686 if (!MCOp.evaluateAsConstantImm(Imm))
8787 return false;
88- return ( Imm >= 6) && (isUInt<5>( Imm) || (Imm == 32)) ;
88+ return Imm >= 6 && Imm <= 32;
8989 }];
9090}
9191
0 commit comments