[PATCH] D65448: [AArch64] Implement initial SVE calling convention support

Richard Sandiford via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 11:45:19 PDT 2019


rsandifo-arm added a comment.

In D65448#1606567 <https://reviews.llvm.org/D65448#1606567>, @ostannard wrote:

> Out of interest, why does the ABI allow functions which don't have SVE args/returns to clobber the P registers? For Z registers, we've got to be compatible with old code which only needed to save the bottom half of v8-v15, but there should be no existing code which uses P registers, so we could enforce a mixture of callee- and caller-saved P registers for all code. Existing code is already compliant with this, because it doesn't touch the P regs.


One reason is that syscalls do not need to preserve any state that they wouldn't without SVE, so all the predicate registers are clobbered by syscalls: https://www.kernel.org/doc/Documentation/arm64/sve.txt .  This seemed better than forcing the kernel to preserve the registers when the registers are only intended for short-term working data.  There's also the setjmp/longjmp problem: you could longjmp from a normal function to a normal function in a way that effectively unwinds through an SVE function.  This won't restore the predicate registers properly unless extra state is added to jmp_buf, which is something we wanted to avoid (and would be difficult to do in a backward-compatible, length-agnostic way).


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65448





More information about the llvm-commits mailing list