[clang] [llvm] [RISCV] Add Codegen support for ACLIC (PR #238325)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 12:52:54 PST 2026


================
@@ -67,6 +67,15 @@ static const MCPhysReg FixedCSRFIMap[] = {
 // `QC.C.MILEAVERET`.
 static constexpr uint64_t QCIInterruptPushAmount = 96;
 
+// Smip/Ssip push six registers. ACLIC specifies a 24-byte frame for RV32E,
+// a 32-byte frame for RV32I, and a 48-byte frame for RV64I/E.
+static uint64_t getACLICInterruptPushAmount(const MachineFunction &MF) {
+  const auto &STI = MF.getSubtarget<RISCVSubtarget>();
+  if (STI.is64Bit())
+    return 48;
+  return STI.getTargetABI() == RISCVABI::ABI::ILP32E ? 24 : 32;
----------------
topperc wrote:

I don't think this can be based on the ABI. The hardware doesn't know the ABI. It only knows ISA string.

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


More information about the cfe-commits mailing list