[llvm] [RISCV] Add compress patterns for Xqcibi branch instructions (PR #143095)
Sudharsan Veeravalli via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 8 19:16:50 PDT 2025
================
@@ -341,21 +341,33 @@ def simm12 : RISCVSImmLeafOp<12> {
def simm12_no6 : ImmLeaf<XLenVT, [{
return isInt<12>(Imm) && !isInt<6>(Imm) && isInt<12>(-Imm);}]>;
-// A 13-bit signed immediate where the least significant bit is zero.
-def bare_simm13_lsb0 : Operand<OtherVT> {
- let ParserMatchClass = BareSImmNLsb0AsmOperand<13>;
- let PrintMethod = "printBranchOperand";
- let EncoderMethod = "getImmOpValueAsrN<1>";
- let DecoderMethod = "decodeSImmOperandAndLslN<13, 1>";
+class BareSImm13Lsb0MaybeSym : Operand<OtherVT> {
let MCOperandPredicate = [{
int64_t Imm;
if (MCOp.evaluateAsConstantImm(Imm))
return isShiftedInt<12, 1>(Imm);
return MCOp.isBareSymbolRef();
}];
+}
+
+// A 13-bit signed immediate where the least significant bit is zero. The ImmLeaf
+// is needed so that the CompressInstEmitter can correctly add checks for the
+// compress patterns that involve instructions that use this operand. Similar to
+// bare_simm9_lsb0 in RISCVInstrINfoC.td.
----------------
svs-quic wrote:
Done
https://github.com/llvm/llvm-project/pull/143095
More information about the llvm-commits
mailing list