Skip to content

Commit 80a58cd

Browse files
committed
[RISCV] Add compress patterns for qc.extu and qc.mveqi
Change-Id: If45e95ffb225e058652f6528e46b5cb7b924832f
1 parent 4873b72 commit 80a58cd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ def uimm5_plus1 : RISCVOp, ImmLeaf<XLenVT,
4242
let OperandType = "OPERAND_UIMM5_PLUS1";
4343
let MCOperandPredicate = [{
4444
int64_t Imm;
45-
if (MCOp.evaluateAsConstantImm(Imm))
46-
return (isUInt<5>(Imm) && (Imm != 0)) || (Imm == 32);
47-
return MCOp.isBareSymbolRef();
45+
if (!MCOp.evaluateAsConstantImm(Imm))
46+
return false;
47+
return (isUInt<5>(Imm) && (Imm != 0)) || (Imm == 32);
4848
}];
49-
5049
}
5150

5251
def uimm5ge6_plus1 : RISCVOp<XLenVT>, ImmLeaf<XLenVT,
@@ -57,9 +56,9 @@ def uimm5ge6_plus1 : RISCVOp<XLenVT>, ImmLeaf<XLenVT,
5756
let OperandType = "OPERAND_UIMM5_GE6_PLUS1";
5857
let MCOperandPredicate = [{
5958
int64_t Imm;
60-
if (MCOp.evaluateAsConstantImm(Imm))
61-
return (Imm >= 6) && (isUInt<5>(Imm) || (Imm == 32));
62-
return MCOp.isBareSymbolRef();
59+
if (!MCOp.evaluateAsConstantImm(Imm))
60+
return false;
61+
return (Imm >= 6) && (isUInt<5>(Imm) || (Imm == 32));
6362
}];
6463
}
6564

0 commit comments

Comments
 (0)