-
Notifications
You must be signed in to change notification settings - Fork 179
Name mangling for standard vector calling convention #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,6 +149,34 @@ See the "Type encodings" section in _Itanium {Cpp} ABI_ | |
| for more detail on how to mangle types. Note that `__bf16` is mangled in the | ||
| same way as `std::bfloat16_t`. | ||
|
|
||
| === Name Mangling for Standard Calling Convention Variant | ||
|
|
||
| Function use standard calling convention variant have to append extra ABI tag to | ||
| the function name mangling, the rule are same as the "ABI tags" section in | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ABI tags (B) are used for the GNU abi_tag extension, which uses a string that is entirely under the control of a library author. It is probably wrong to use for architecture-specific features, and it does not fix my original example since it cannot be used on unnamed entities. I was originally thinking of using a vendor-defined pointer qualifier as defined in 5.1.5.1 Qualified types, but the closest existing thing to what I'm asking for is the definition of Dx in 5.1.5.3 Function types. We may need upstream guidance.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, I thought it work? https://gcc.godbolt.org/z/95shE9a13
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (let me read the Itanium C++ ABI more carefully again)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, yeah, I got your main point: it should mangling function (pointer) type, not function name, I thought abi_tag works for function type but it only decorate/mangling function name. |
||
| _Itanium {Cpp} ABI_. | ||
|
|
||
| .ABI Tag name for calling convention variants | ||
| [cols="5,2"] | ||
| [width=80%] | ||
| |=== | ||
| | Name | ABI tag name | ||
|
|
||
| | Standard vector calling convention variant | riscv_vector_cc | ||
| |=== | ||
|
|
||
|
|
||
| For example: | ||
| [,c] | ||
| ---- | ||
| __attribute__((riscv_vector_cc)) void foo(); | ||
| ---- | ||
|
|
||
| is mangled as | ||
| [,c] | ||
| ---- | ||
| _Z3fooB15riscv_vector_ccv | ||
| ---- | ||
|
|
||
| === Name Mangling for Vector Data Types, Vector Mask Types and Vector Tuple Types. | ||
|
|
||
| The vector data types and vector mask types, as defined in the section | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to specially mangle the names of functions that use the vector calling convention. While arguably useful for function multi-versioning and the
[[gnu::target_version]]attribute in particular, this is orthogonal to C++ overload resolution.We do need to mangle function pointer types that use the vector calling convention, whether or not the function taking the parameter itself uses the vector calling convention, to allow overloading a function that takes arguments with different ABIs.