riscv-non-isa / riscv-elf-psabi-doc

A RISC-V ELF psABI Document
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
691 stars 163 forks source link

Name mangling for standard vector calling convention #422

Open kito-cheng opened 8 months ago

kito-cheng commented 8 months ago

Add extra name mangling rule for standard vector calling convention on C++ ABI, fortunately the Itanium C++ ABI already defined mangling rule for ABI tag, so we just need to define the ABI tag name.

Example for the mangling rule:

__attribute__((riscv_vector_cc)) void foo();
// _Z3fooB15riscv_vector_ccv with this mangling rule
// _Z3foov without this mangling rule
sorear commented 7 months ago

I filed itanium-cxx-abi/cxx-abi#178 to maybe get an expert opinion. Hope that isn't overstepping.

kito-cheng commented 7 months ago

I filed https://github.com/itanium-cxx-abi/cxx-abi/issues/178 to maybe get an expert opinion. Hope that isn't overstepping.

Thanks for doing this, I think you are better person to create that since you have more context than me on this, will support you on that PR if needed :)

sorear commented 7 months ago

swiftcall in clang appears to already have the behavior we need.

kito-cheng commented 7 months ago

Change to draft since this PR is not intend to merge so far, but we may keep this PR for keep tracking and/or discuss this issue.

kito-cheng commented 7 months ago

Oh, I should reply after read the PR, I didn't notice there is some discussion within the PR, anyway let me find some time to update and update this PR later.

(@sorear you can create another PR if you are interested since I may deal with other stuffs around the psABI repo first)

kito-cheng commented 7 months ago

Not really spec related, but kinda bookmark for myself:

clang implementation for Swift name mangling: CXXNameMangler::mangleExtParameterInfo@ItaniumMangle.cpp