Closed kito-cheng closed 4 months ago
ChangeLog:
(copying my comment from #68 since it applies to both)
Stylistically, since this is a well-defined RISC-V specific ABI attribute independent of any GNU extensions, I wonder if it should be [[riscv:vector_cc]]
instead of [[gnu:riscv_vector_cc]]
. Probably not since other architectures still seem to be using attributes in the compiler-specific namespace?
I believe that this needs to be included in C++ function pointer mangling to support natural uses (although this doesn't work on aarch64). Do the rules for that need to be specified here?
LGTM otherwise.
Update:
Added C++11 and C23 style syntax.
Let me ask our folks to implement that in LLVM and GCC.
GCC and clang/LLVM implementation has merged into trunk[1][2]
[1] https://github.com/gcc-mirror/gcc/commit/4547628c78618616595f4b5e1bef2b582c77793d [2] https://github.com/llvm/llvm-project/pull/77560
Standard vector calling convention variant has landed in psABI now, and the implementation also merged into GCC trunk, LLVM part are also under reviewing, and this attribute has mentioned during the discussion, but seems like we don't document that yet.
Standard vector calling convention variant will only enabled when function has vector argument or returing value by default, however user may also want to invoke function without that during a vectorized loop at some situation, but it will cause a huge performance penalty due to vector register store/restore.
So user can declare function with this riscv_vector_cc attribute like below, that could enforce function will use standard vector calling convention variant.