[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 11:51:30 PST 2025


================
@@ -1046,6 +1046,20 @@ struct RISCVOperand final : public MCParsedAsmOperand {
            isInt<26>(fixImmediateForRV32(Imm, isRV64Imm()));
   }
 
+  bool isImm32() const {
+    int64_t Imm;
+    RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None;
+    if (!isImm())
+      return false;
+    bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK);
+    bool IsValid;
+    if (!IsConstantImm)
+      IsValid = RISCVAsmParser::classifySymbolRef(getImm(), VK);
+    else
+      IsValid = isInt<32>(Imm) || isUInt<32>(Imm);
----------------
lenary wrote:

Yes this is equivalent, and a neater way to express this. I wrote it this way because i wasn't sure.


https://github.com/llvm/llvm-project/pull/124706


More information about the cfe-commits mailing list