[PATCH] D158492: [RISCV] Add CSR RegisterClass and save/restore fcsr in interrupt

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 02:51:44 PDT 2023


wangpc marked an inline comment as done.
wangpc added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:379
   }
-
+  NonLibcallCSI.insert(IsRestore ? NonLibcallCSI.begin() : NonLibcallCSI.end(),
+                       CSRs.begin(), CSRs.end());
----------------
Jim wrote:
> If we put FCSR at first in CSR_XLEN_F32_Interrupt/CSR_XLEN_F64_Interrupt, is it still need to depend on save or restore to determinate the order of CSR inserted.
Yes. We should save FCSR after saving `t0` and restore it before restoring `t0` since we are using `t0` as a temporary register.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158492/new/

https://reviews.llvm.org/D158492



More information about the llvm-commits mailing list