diff mbox series

[4/4] kselftest/arm64: Fix compilation of SME instructions in the arm64 fp tests

Message ID 20241108134920.1233992-5-catalin.marinas@arm.com (mailing list archive)
State New
Headers show
Series kselftest/arm64: Fix compilation warnings/errors in the arm64 tests | expand

Commit Message

Catalin Marinas Nov. 8, 2024, 1:49 p.m. UTC
SMSTOP/SMSTART require the SME arch extension for the assembler. Add
'.arch_extension sme' to za-test.S and zt-test.S.

Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 tools/testing/selftests/arm64/fp/za-test.S | 1 +
 tools/testing/selftests/arm64/fp/zt-test.S | 1 +
 2 files changed, 2 insertions(+)

Comments

Mark Brown Nov. 8, 2024, 2:53 p.m. UTC | #1
On Fri, Nov 08, 2024 at 01:49:20PM +0000, Catalin Marinas wrote:

> SMSTOP/SMSTART require the SME arch extension for the assembler. Add
> '.arch_extension sme' to za-test.S and zt-test.S.

I've got an alternative, more idiomatic fix for this running through my
testing - SME is still relatively recent so we can't rely on people's
toolchains having it and we should use a .inst instead.  The issue was
that the toolchain I'm using locally appears to default to a full fat
version of the architecture and happily assembled the SMSTART even
though we don't have a .inst macro for it like we do with SMSTOP (which
is why that didn't error).  We only have SMSTART SM and SMSTART ZA.
Catalin Marinas Nov. 8, 2024, 2:59 p.m. UTC | #2
On Fri, Nov 08, 2024 at 02:53:29PM +0000, Mark Brown wrote:
> On Fri, Nov 08, 2024 at 01:49:20PM +0000, Catalin Marinas wrote:
> > SMSTOP/SMSTART require the SME arch extension for the assembler. Add
> > '.arch_extension sme' to za-test.S and zt-test.S.
> 
> I've got an alternative, more idiomatic fix for this running through my
> testing - SME is still relatively recent so we can't rely on people's
> toolchains having it and we should use a .inst instead.  The issue was
> that the toolchain I'm using locally appears to default to a full fat
> version of the architecture and happily assembled the SMSTART even
> though we don't have a .inst macro for it like we do with SMSTOP (which
> is why that didn't error).  We only have SMSTART SM and SMSTART ZA.

It makes sense. Please post yours and I'll drop this one.
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S
index f902e6ef9077..9ebeab6ce5c0 100644
--- a/tools/testing/selftests/arm64/fp/za-test.S
+++ b/tools/testing/selftests/arm64/fp/za-test.S
@@ -16,6 +16,7 @@ 
 #include "sme-inst.h"
 
 .arch_extension sve
+.arch_extension sme
 
 #define MAXVL     2048
 #define MAXVL_B   (MAXVL / 8)
diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S
index c96cb7c2ad4b..ad550463d31d 100644
--- a/tools/testing/selftests/arm64/fp/zt-test.S
+++ b/tools/testing/selftests/arm64/fp/zt-test.S
@@ -12,6 +12,7 @@ 
 #include "sme-inst.h"
 
 .arch_extension sve
+.arch_extension sme
 
 #define ZT_SZ	512
 #define ZT_B	(ZT_SZ / 8)