riscv-non-isa / riscv-c-api-doc

Documentation of the RISC-V C API
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
68 stars 38 forks source link

Function attribute for standard fixed-length vector calling convention variant #68

Open kito-cheng opened 7 months ago

kito-cheng commented 7 months ago

…n variant

Fixed-length vector are passed via general purposed register or memory within current ABI design, we proposed a standard fixed-length vector calling convention variant for passing the fixed-length vector via vector register.

This is the syntax part in the proposal, further detail for that calling convention variant see https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/418

sorear commented 7 months ago

Stylistically, since this is a well-defined RISC-V specific ABI attribute independent of any GNU extensions, I wonder if it should be [[riscv:vls_cc]] instead of [[gnu:riscv_vls_cs]]. 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.

kito-cheng commented 7 months ago

@sorear thanks for remind that, I almost forgot [[]] style function attribute, for C++ function pointer mangling , I guess we still have few time to fix that before GCC 14 and LLVM 18 release.

kito-cheng commented 7 months ago

Update: