diff mbox series

[v3,06/21] arm64/sme: Manually encode ZT0 load and store instructions

Message ID 20221111215026.813348-7-broonie@kernel.org (mailing list archive)
State Accepted
Commit 2cdeecdb95134cc0abc76626a59c94073cda8a47
Headers show
Series arm64/sme: Support SME 2 and SME 2.1 | expand

Commit Message

Mark Brown Nov. 11, 2022, 9:50 p.m. UTC
In order to avoid unrealistic toolchain requirements we manually encode the
instructions for loading and storing ZT0.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 arch/arm64/include/asm/fpsimdmacros.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Zenghui Yu Dec. 17, 2022, 9:40 a.m. UTC | #1
On 2022/11/12 5:50, Mark Brown wrote:
>  /*
>   * Zero the entire ZA array
>   *	ZERO ZA

Unrelated to this patch but the zero_za macro doesn't appear to have
any in kernel user.
Mark Brown Dec. 19, 2022, 3:04 p.m. UTC | #2
On Sat, Dec 17, 2022 at 05:40:27PM +0800, Zenghui Yu wrote:
> On 2022/11/12 5:50, Mark Brown wrote:

> >  /*
> >   * Zero the entire ZA array
> >   *	ZERO ZA

> Unrelated to this patch but the zero_za macro doesn't appear to have
> any in kernel user.

Yes, it's not actually needed and could be deleted.
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/fpsimdmacros.h b/arch/arm64/include/asm/fpsimdmacros.h
index 5e0910cf4832..cd03819a3b68 100644
--- a/arch/arm64/include/asm/fpsimdmacros.h
+++ b/arch/arm64/include/asm/fpsimdmacros.h
@@ -220,6 +220,28 @@ 
 		| ((\offset) & 7)
 .endm
 
+/*
+ * LDR (ZT0)
+ *
+ *	LDR ZT0, nx
+ */
+.macro _ldr_zt nx
+	_check_general_reg \nx
+	.inst	0xe11f8000	\
+		 | (\nx << 5)
+.endm
+
+/*
+ * STR (ZT0)
+ *
+ *	STR ZT0, nx
+ */
+.macro _str_zt nx
+	_check_general_reg \nx
+	.inst	0xe13f8000		\
+		| (\nx << 5)
+.endm
+
 /*
  * Zero the entire ZA array
  *	ZERO ZA