[llvm] [AArch64][SME2] Preserve ZT0 state around function calls (PR #76968)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 06:21:12 PST 2024


================
@@ -82,6 +93,13 @@ class SMEAttrs {
   bool hasZAState() const {
     return hasNewZABody() || hasSharedZAInterface();
   }
+
+  // Interfaces to query ZT0 state
+  bool hasNewZTBody() const { return Bitmask & ZT_New; }
+  bool hasSharedZTInterface() const { return Bitmask & ZT_Shared; }
----------------
sdesmalen-arm wrote:

Please change this to `bool sharesZT0()`. This otherwise conflicts with the ABI concept of a "Shared ZA" interface, and the ABI does not describe a  "Shared ZT0" interface.

`aarch64_sme_zt0_in`, `aarch64_sme_zt0_out`, `aarch64_sme_zt0_inout`, `aarch64_sme_zt0_preserved` would all return `true` or `sharesZT0()`, as they are all part of the "Shared ZA" interface from an ABI point of view, as the function enters with PSTATE.ZA = 1 and returns with PSTATE.ZA = 1.

https://github.com/llvm/llvm-project/pull/76968


More information about the llvm-commits mailing list