Skip to content
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

Document a new SME support routine to query the current value of VG. #263

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions aapcs64/aapcs64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ changes to the content of the document for that release.
+------------+--------------------+------------------------------------------------------------------+
| | | - Change the status of the SME support from Alpha to Beta. |
| | | - Add soft-float PCS variant. |
| | | - Add the __arm_get_current_vg SME support routine. |
+------------+--------------------+------------------------------------------------------------------+

References
Expand Down Expand Up @@ -2077,6 +2078,9 @@ support routines:
``__arm_tpidr2_restore``
Provides a simple way of restoring lazily-saved ZA data.

``__arm_get_current_vg``
Provides a safe way to detect the current value of VG.

``__arm_sme_state``
^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -2269,6 +2273,38 @@ a lazy save, with the subroutine having the following properties:
* The only memory modified by the subroutine (if any) is stack memory
below the incoming SP.

``__arm_get_current_vg``
^^^^^^^^^^^^^^^^^^^^^^^^

**(Beta)**

Platforms that support SME must provide a subroutine to query the current
value of VG, with the subroutine having the following properties:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to:

and the subroutine must have the following properties:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed by #278


* The subroutine is called ``__arm_get_current_vg``.

* The subroutine has a `private-ZA`_ `streaming-compatible interface`_ with the
following properties:

* X1-X15, X19-X29 and SP are call-preserved.
* Z0-Z31 are call-preserved.
* P0-P15 are call-preserved.
* the subroutine `preserves ZA`_.

* The subroutine does not take any arguments.

* The subroutine returns an unsigned double word in X0.

* The subroutine behaves as follows:

* If the current thread has access to FEAT_SME and PSTATE.SM is 1, the
subroutine returns the value of the streaming VG in X0.

* Otherwise, if the current thread has access to FEAT_SVE, the subroutine
returns the value of VG in X0.

* Otherwise, the subroutine returns the value 0 in X0.

Pseudo-code examples
====================

Expand Down
Loading