[libunwind] [RISCV] Allow libunwind to build for rv32e (PR #98855)
Sam Elliott via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 1 11:32:58 PDT 2024
================
@@ -1169,7 +1169,11 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv)
ILOAD x\i, (RISCV_ISIZE * \i)(a0)
.endr
// skip a0 for now
+#if defined(__riscv_abi_rve)
----------------
lenary wrote:
> The non-e case seems to be saving/restoring all registers (just like every other architecture)? I'm not sure where you're seeing that it doesn't save all of them?
Sorry, my fault, I didn't realise there were two loops in this function and thus two different lists of registers.
>
> The reason the lists aren't symmetric is because register a0 is x10, so restoring it is deferred until the end. I'm not sure why it doesn't just use one list, but this pattern is also used for MIPS and LoongArch.
Yeah, I'm happy with this.
Broadly, going back to your/craig's original question: I feel this should be keyed on architecture, not ABI. This function is restoring all registers, including temporaries, not just caller-saves, so on the e-abi it should be restoring all temporaries as well. (This is different to my change to the save/restore routines, which only touch callee-saves).
https://github.com/llvm/llvm-project/pull/98855
More information about the cfe-commits
mailing list