Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E652C38A2D for ; Wed, 26 Oct 2022 05:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EiAb9sE4g+WOsEseiGaFdH4SZh/FY1kUHpjz6Comlmw=; b=LHbaaqBsBXROc3 Wu1ow0cXkvYPHP4XOOYmf/x63clfJKIglRhUD85hoBZjqz0gZgEFp9QE42jn4alTbNIZ2FP+guUyB U8cZHGmWnerY5qQgs0MQw4/dYR2AOBVJAVshf+qQrHn71yjVujcIdTPwyyZVjd9qkLMWJxA8Qz+Uc VWPH8PPxc7iENTiscEa1SmbqubwGhYBmIEqV5VwSzF+GfFRsOvDeVpyyXx0tbwZrY0OkFc/8gFUcu dnQ4HkYqcfDtsh3V8BpSESZecFKJRwKd3LWax0bSkLLy3XPMIjUYL3MSdQrSL36l7UH3g7DVG9Si0 KjRzpi826v6IL8Z8YKaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onZJy-00832B-MU; Wed, 26 Oct 2022 05:51:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onZJV-0082ts-8y for linux-arm-kernel@lists.infradead.org; Wed, 26 Oct 2022 05:50:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3675423A; Tue, 25 Oct 2022 22:50:55 -0700 (PDT) Received: from a077416.blr.arm.com (unknown [10.162.42.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1B4DA3F7B4; Tue, 25 Oct 2022 22:50:46 -0700 (PDT) From: Amit Daniel Kachhap To: Russell King Cc: patches@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Amit Daniel Kachhap Subject: [PATCH 4/8] ARM: vfp: Add hwcap for FEAT_FHM Date: Wed, 26 Oct 2022 11:19:57 +0530 Message-Id: <20221026055001.12986-5-amit.kachhap@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221026055001.12986-1-amit.kachhap@arm.com> References: <20221026055001.12986-1-amit.kachhap@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221025_225053_382142_54B0EBCE X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Floating-point half-precision multiplication (FHM) is a feature present in AArch32 state for Armv8 and is represented by ISAR6.FHM identification register. This feature denotes the presence of VFMAL and VMFSL 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 --- 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 64f3608e6f1b..3d168d4f2a51 100644 --- a/arch/arm/include/uapi/asm/hwcap.h +++ b/arch/arm/include/uapi/asm/hwcap.h @@ -31,6 +31,7 @@ #define HWCAP_FPHP (1 << 22) #define HWCAP_ASIMDHP (1 << 23) #define HWCAP_ASIMDDP (1 << 24) +#define HWCAP_ASIMDFHM (1 << 25) /* * 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 c55ff1110152..5e8bf2d5e516 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1252,6 +1252,7 @@ static const char *hwcap_str[] = { "fphp", "asimdhp", "asimddp", + "asimdfhm", NULL }; diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 70f1e0f4eece..404c4f901132 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -845,6 +845,12 @@ static int __init vfp_init(void) isar6 = read_cpuid_ext(CPUID_EXT_ISAR6); if (cpuid_feature_extract_field(isar6, 4) == 0x1) elf_hwcap |= HWCAP_ASIMDDP; + /* + * Check for the presence of Advanced SIMD Floating point + * half-precision multiplication instructions. + */ + if (cpuid_feature_extract_field(isar6, 8) == 0x1) + elf_hwcap |= HWCAP_ASIMDFHM; /* 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