-
Notifications
You must be signed in to change notification settings - Fork 192
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
Include SME attributes in the name mangling of types #290
base: main
Are you sure you want to change the base?
Changes from all commits
0d1959b
44e8a55
55f3e6d
d71f379
0495b41
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 |
---|---|---|
|
@@ -256,6 +256,7 @@ changes to the content of the document for that release. | |
| | September 2024 | - Add soft-float PCS variant. | | ||
| | | - Add the __arm_get_current_vg SME support routine. | | ||
| | | - Clarify use of `it` when preserving z and p registers. | | ||
| | | - Update C++ mangling to include SME attributes in type names | | ||
+------------+--------------------+------------------------------------------------------------------+ | ||
|
||
References | ||
|
@@ -3111,6 +3112,65 @@ instead. | |
The SVE tuple types are mangled using their ``arm_sve.h`` names | ||
(``svBASExN_t``). | ||
|
||
Function types which have SME streaming, ZA interface or ZT0 interface attributes must include these attributes in the name mangling of the type. | ||
|
||
SME attributes are mangled in the same way as a template: | ||
|
||
template<typename, unsigned, unsigned, unsigned> __SME_ATTRS; | ||
|
||
with the arguments: | ||
|
||
__SME_ATTRS<normal_function_type, streaming_mode, za_state, zt0_state>; | ||
|
||
where: | ||
|
||
* normal_function_type is the function type without any SME attributes. | ||
|
||
* streaming_mode is an integer representing the streaming-mode of the function: | ||
|
||
+------------------------+--------------------------+ | ||
| Interface Type | Value | | ||
+========================+==========================+ | ||
| Normal (default) | 0 | | ||
+------------------------+--------------------------+ | ||
| Streaming Mode | 1 | | ||
+------------------------+--------------------------+ | ||
| Streaming-Compatible | 2 | | ||
+------------------------+--------------------------+ | ||
|
||
* za_state is an integer representing the ZA state of the function: | ||
|
||
+------------------------+--------------------------+ | ||
| Interface Type | Value | | ||
+========================+==========================+ | ||
| No ZA State (default) | 0 | | ||
+------------------------+--------------------------+ | ||
| Shared ZA | 1 | | ||
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. The reason for mangling the ZA information is to deal with the fact that the sharing attributes create distinct function types for overloading purposes. I think this means that we need to represent all five possibilities:
Similarly for Since that classification is only described in the ACLE, we should probably describe the mangling there too. Sorry for only realising that now. 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. Thanks @rsandifo-arm, I've updated this to represent each of the shared ZA/ZT0 attributes separately and moved these changes to the ACLE (ARM-software/acle#358). |
||
+------------------------+--------------------------+ | ||
|
||
* zt0_state is an integer representing the ZT0 state of the function: | ||
|
||
+------------------------+--------------------------+ | ||
| Interface Type | Value | | ||
+========================+==========================+ | ||
| No ZT0 State (default) | 0 | | ||
+------------------------+--------------------------+ | ||
| Shared ZT0 | 1 | | ||
+------------------------+--------------------------+ | ||
|
||
For example: | ||
|
||
.. code-block:: c++ | ||
|
||
// Mangled as fP11__SME_ATTRSIFu10__SVInt8_tELj1ELj0ELj0EE | ||
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. I think there's a missing
Also, we should probably include the leading |
||
void f(svint8_t (*fn)() __arm_streaming) { fn(); } | ||
|
||
// Mangled as fP11__SME_ATTRSIFu10__SVInt8_tELj2ELj1ELj0EE | ||
void f(svint8_t (*fn)() __arm_streaming_compatible __arm_inout("za")) { fn(); } | ||
|
||
// Mangled as fP11__SME_ATTRSIFu10__SVInt8_tELj0ELj0ELj1EE | ||
void f(svint8_t (*fn)() __arm_in("zt0")) { fn(); } | ||
|
||
.. raw:: pdf | ||
|
||
PageBreak | ||
|
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.
Like @efriedma-quic says, the intention was to include this mangling if and only if the mangling would normally include the return type of the function. We should probably say that explicitly.