[llvm] [AArch64][SME] Emit Zero instruction for NewZA functions (PR #66361)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 07:55:11 PDT 2023


================
@@ -112,6 +112,12 @@ bool SMEABI::updateNewZAFunctions(Module *M, Function *F,
       Intrinsic::getDeclaration(M, Intrinsic::aarch64_sme_za_enable);
   Builder.CreateCall(EnableZAIntr->getFunctionType(), EnableZAIntr);
 
+  // ZA state must be zeroed upon entry to a function with NewZA
+  Function *ZeroIntr =
+      Intrinsic::getDeclaration(M, Intrinsic::aarch64_sme_zero);
+  Builder.CreateCall(ZeroIntr->getFunctionType(), ZeroIntr,
+                     Builder.getInt32(0b11111111));
----------------
sdesmalen-arm wrote:

nit: could you write `0xff` instead? I find that more readable than what I assume I'm counting is eight 1's :)

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


More information about the llvm-commits mailing list