[llvm] [RISCV][CFI] Emit cfi_offset for every callee-saved vector registers (PR #100455)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 13:41:58 PDT 2024
================
@@ -53,6 +53,35 @@ static const std::pair<MCPhysReg, int8_t> FixedCSRFIMap[] = {
{/*s9*/ RISCV::X25, -11}, {/*s10*/ RISCV::X26, -12},
{/*s11*/ RISCV::X27, -13}};
+// This function returns {Base VReg, corresponding LMUL} of callee-saved VReg.
+// For example:
+// V2M2 -> {RISCV::V2, 2}
+// V8 -> {RISCV::V8, 1}
+static std::pair<MCPhysReg, int8_t> getCSBaseVRegLMULPair(MCPhysReg VR) {
+ assert(((VR >= RISCV::V1 && VR <= RISCV::V7) ||
+ (VR >= RISCV::V24 && VR <= RISCV::V31) ||
+ (VR >= RISCV::V2M2 && VR <= RISCV::V6M2) ||
+ (VR >= RISCV::V24M2 && VR <= RISCV::V30M2)) &&
+ "Invalid VR");
+
+ static constexpr std::pair<MCPhysReg, int8_t> VRegLMULLUT[] = {
+ {/*V2M2*/ RISCV::V2, 2}, {/*V4M2*/ RISCV::V4, 2},
----------------
topperc wrote:
This needs static_asserts to make sure the registers are really in this order.
https://github.com/llvm/llvm-project/pull/100455
More information about the llvm-commits
mailing list