kselftest/arm64: add jscvt feature to hwcap test
authorZeng Heng <zengheng4@huawei.com>
Tue, 15 Aug 2023 04:09:15 +0000 (12:09 +0800)
committerWill Deacon <will@kernel.org>
Wed, 16 Aug 2023 14:24:01 +0000 (15:24 +0100)
Add the jscvt feature check in the set of hwcap tests.

Due to the requirement of jscvt feature, a compiler configuration
of v8.3 or above is needed to support assembly. Therefore, hand
encode is used here instead.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815040915.3966955-5-zengheng4@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
tools/testing/selftests/arm64/abi/hwcap.c

index b3492a944503c55a1c02028ea4a67d63936a5cd9..fe844b825a1e59c268c5bd69b6fbf5d98cf66bc1 100644 (file)
@@ -68,6 +68,12 @@ static void ilrcpc_sigill(void)
        asm volatile(".inst 0x994083e0" : : : );
 }
 
+static void jscvt_sigill(void)
+{
+       /* FJCVTZS W0, D0 */
+       asm volatile(".inst 0x1e7e0000" : : : );
+}
+
 static void lrcpc_sigill(void)
 {
        /* LDAPR W0, [SP, #0] */
@@ -313,6 +319,13 @@ static const struct hwcap_data {
                .cpuinfo = "fp",
                .sigill_fn = fp_sigill,
        },
+       {
+               .name = "JSCVT",
+               .at_hwcap = AT_HWCAP,
+               .hwcap_bit = HWCAP_JSCVT,
+               .cpuinfo = "jscvt",
+               .sigill_fn = jscvt_sigill,
+       },
        {
                .name = "LRCPC",
                .at_hwcap = AT_HWCAP,