All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: Russell King <linux@armlinux.org.uk>
Cc: patches@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
	Amit Daniel Kachhap <amit.kachhap@arm.com>
Subject: [PATCH 5/8] ARM: vfp: Add hwcap for FEAT_AA32BF16
Date: Wed, 26 Oct 2022 11:19:58 +0530	[thread overview]
Message-ID: <20221026055001.12986-6-amit.kachhap@arm.com> (raw)
In-Reply-To: <20221026055001.12986-1-amit.kachhap@arm.com>

Advanced SIMD BFloat16 (FEAT_AA32BF16) is a feature present in AArch32
state for Armv8 and is represented by ISAR6.BF16 identification register.

This feature denotes the presence of VCVT, VCVTB, VCVTT, VDOT, VFMAB,
VFMAT and VMMLA instructions and hence adding a hwcap will enable the
userspace to check it before trying to use those instructions.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
---
 arch/arm/include/uapi/asm/hwcap.h | 1 +
 arch/arm/kernel/setup.c           | 1 +
 arch/arm/vfp/vfpmodule.c          | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
index 3d168d4f2a51..14e260e2d6d0 100644
--- a/arch/arm/include/uapi/asm/hwcap.h
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -32,6 +32,7 @@
 #define HWCAP_ASIMDHP	(1 << 23)
 #define HWCAP_ASIMDDP	(1 << 24)
 #define HWCAP_ASIMDFHM	(1 << 25)
+#define HWCAP_ASIMDBF16	(1 << 26)
 
 /*
  * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 5e8bf2d5e516..231d885ad4b5 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1253,6 +1253,7 @@ static const char *hwcap_str[] = {
 	"asimdhp",
 	"asimddp",
 	"asimdfhm",
+	"asimdbf16",
 	NULL
 };
 
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 404c4f901132..ff574cb8a0b9 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -851,6 +851,12 @@ static int __init vfp_init(void)
 		 */
 		if (cpuid_feature_extract_field(isar6, 8) == 0x1)
 			elf_hwcap |= HWCAP_ASIMDFHM;
+		/*
+		 * Check for the presence of Advanced SIMD Bfloat16
+		 * floating point instructions.
+		 */
+		if (cpuid_feature_extract_field(isar6, 20) == 0x1)
+			elf_hwcap |= HWCAP_ASIMDBF16;
 
 	/* Extract the architecture version on pre-cpuid scheme */
 	} else {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-10-26  5:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  5:49 [PATCH 0/8] ARM: Expose Armv8 AArch32 features via hwcap Amit Daniel Kachhap
2022-10-26  5:49 ` [PATCH 1/8] ARM: Define Armv8 registers in AArch32 state Amit Daniel Kachhap
2022-10-26  5:49 ` [PATCH 2/8] ARM: vfp: Add hwcap FPHP and ASIMDHP for FEAT_FP16 Amit Daniel Kachhap
2022-10-26  5:49 ` [PATCH 3/8] ARM: vfp: Add hwcap for FEAT_DotProd Amit Daniel Kachhap
2022-10-26  5:49 ` [PATCH 4/8] ARM: vfp: Add hwcap for FEAT_FHM Amit Daniel Kachhap
2022-10-26  5:49 ` Amit Daniel Kachhap [this message]
2022-10-26  5:49 ` [PATCH 6/8] ARM: vfp: Add hwcap for FEAT_AA32I8MM Amit Daniel Kachhap
2022-10-26  5:50 ` [PATCH 7/8] ARM: Add hwcap for Speculation Barrier(SB) Amit Daniel Kachhap
2022-11-16 14:06   ` Linus Walleij
2022-11-17 10:19     ` Amit Daniel Kachhap
2022-11-17 11:14     ` Robin Murphy
2022-10-26  5:50 ` [PATCH 8/8] ARM: Add hwcap for Speculative Store Bypassing Safe Amit Daniel Kachhap
2022-11-16 13:51 ` [PATCH 0/8] ARM: Expose Armv8 AArch32 features via hwcap Linus Walleij
2022-11-17  6:19   ` Amit Kachhap
2022-11-21 19:04 ` Russell King (Oracle)
2022-11-22 12:24   ` Amit Daniel Kachhap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221026055001.12986-6-amit.kachhap@arm.com \
    --to=amit.kachhap@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=patches@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.