From cd553ed114d5feeb30b37f8165ef694ee10a210a Mon Sep 17 00:00:00 2001 From: Kerry McLaughlin Date: Thu, 23 May 2024 14:28:06 +0000 Subject: [PATCH 1/2] Document a new SME support routine to query the current value of VG. --- aapcs64/aapcs64.rst | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/aapcs64/aapcs64.rst b/aapcs64/aapcs64.rst index 66a076b..a6a1527 100644 --- a/aapcs64/aapcs64.rst +++ b/aapcs64/aapcs64.rst @@ -2077,6 +2077,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`` ^^^^^^^^^^^^^^^^^^^ @@ -2269,6 +2272,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: + +* 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 ==================== From 851fa3dff884ec5db8376de1c447f4128d8e722a Mon Sep 17 00:00:00 2001 From: Kerry McLaughlin Date: Tue, 28 May 2024 09:35:17 +0000 Subject: [PATCH 2/2] Updated the change history table in aapcs64.rst. --- aapcs64/aapcs64.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/aapcs64/aapcs64.rst b/aapcs64/aapcs64.rst index a6a1527..1c134f1 100644 --- a/aapcs64/aapcs64.rst +++ b/aapcs64/aapcs64.rst @@ -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