From patchwork Fri Dec 6 05:58:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13896544 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 B6979E77179 for ; Fri, 6 Dec 2024 05:59:59 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=SpUzmvCyEi/cFNCKHwsBp2GTTfb4alv/+f+mBADpaSQ=; b=latIRw2zWmJeV4 P8lhCAbhRB/9sy6BgHrq1R8ql/B+FSe903NhEGS9sKZAWSVEAC0uzhqDledWQ5qFJfL6r4f8jkvk8 /a8Xq8uRgdLJu8esoeMlNywo/cbfLs70W/M0pYQxFEuZbiahRHRWQ36/F35kvPaXSHd5CJAm2FVAO Cy8Ej8jio07bDJMlTVqIhPPyxld8s6rp5v6bNs8Zd55b9yKxgSJYRrmB7ZaS4S1c3SBx84Edj+LlI ud9uzX9PU6vDwDxHCi87SgxncMLQqAmCcdvSywpRKC4tYhaSxqDw4pmg+fzNTvx64hZ8cAPcwzfXf zEIYHffHXN8uq8jKIXAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJRNZ-00000000f8w-2Uql; Fri, 06 Dec 2024 05:59:53 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJRN0-00000000ex7-191b for linux-riscv@lists.infradead.org; Fri, 06 Dec 2024 05:59:19 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6d8e773ad77so3099166d6.2 for ; Thu, 05 Dec 2024 21:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733464757; x=1734069557; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N8BiXrdu8AjyVxaZxHVQZLdp0cv6/V99Kwq2ArWLgVQ=; b=an/ucsAXSU3BcYXy6fIp93JvYP9nND2SnOpnwKDdtVE1y0PrdaQ3KdcUWOUrXAm75Y hZGLfqRFg4EFxSqA40vyjXgTJ+Vd5wTaPqw0izI2UD17n7JWfCxu4Ur+ue4ilVysFCX+ xcagm9Ccj8W7FzoGkE9PCrh1mgkhvkhIzoUfohsNUwcqVOn1Vx4mAPK7VwatlO0yPyQ8 wAMCb5Tu5vYYEuRYp/toBBPJaNwU6AHEwcxHK97Ucp2xeSCDWyy+KiZRuuiOgByt2emH BQOlIUX0DaxYXV1R5KlhpAxE4q8zqCOD4nlGFexwuEr9x18XGhAyf6FqEoFcgz86e3IU vBEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733464757; x=1734069557; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N8BiXrdu8AjyVxaZxHVQZLdp0cv6/V99Kwq2ArWLgVQ=; b=EaqVfWCA88g5Lx5S3Q4UZDbEvZdCVj3o+gSu9JTyZQCXKfMQGLHSRXKGqB2/ry+tHN MoDS3A9atlTxo23G/q4GAEpFfDjun5IBI9oV8GEeF0TqfzfjtHoZ8EnW/4NXmN3Gr9oZ sBXb5xEuPEu/ksqHKcTR+ZifWIq/scwt0kcytkVvvm27KmdNgIFpor8Wpvg/rqeRxi7U bzKc81JnVSPu2uhP7LURGCEeikVfuWkDNowKkqi+E5izvFke64myUtL1sQv2VxgsXVY/ NZgVryRLbstHCXO9umiS7spCz4bBHa2CoF7bfTumv56a/ty5UtIzm1VzK5oCWqLPi8ex 3ffw== X-Forwarded-Encrypted: i=1; AJvYcCXN63p5/cVLPgG9LebPxI9ilNy5KaDdtX+nrCkOt1erED2cJg1KOJf/5vJJmNWcFucQI6tIi+yX8XpzrA==@lists.infradead.org X-Gm-Message-State: AOJu0Yx0J5IsG8Bh5CvN42yrS5eJTYetpHIL6Yv5KG8yXvklgZJEQXLx Ggv/nGpW3svsEKuCwrIwzbMsPyaoMTNihLkgFIx9W5OsGXJDscA5 X-Gm-Gg: ASbGncstGWV8Bb+ND/HoizL4cFnlEoSUX3v6tXZAy+h9dnKoIOcjtCJnc4naEOPIFPg Of2If9iPuuz8k0XjYmiJz5HG2X+U60h4WSHKwGh+WtVZMM7PwwEuZMle/5Kab+Pc2/lCFopLMO4 kKat4E6QZUZXVzf4vQdVs7I3eT97fYNc+R1KLS4QAeM1REX/ElSPHGdGvpmIncTfkxom6GgPM+L KneMeDk7C65Bg5k1MWw0ocWGw== X-Google-Smtp-Source: AGHT+IGr4f0bbdkY7GxypZLey3m/davrnr3G1VH5MnjbXb79c+bf+NeCMvcxLFALb91XgqHliaybZQ== X-Received: by 2002:a05:6214:f26:b0:6d8:9d1d:3a7 with SMTP id 6a1803df08f44-6d8e7168da6mr20671156d6.17.1733464757010; Thu, 05 Dec 2024 21:59:17 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8dac016bfsm15381436d6.116.2024.12.05.21.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 21:59:16 -0800 (PST) From: Inochi Amaoto To: Chen Wang , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Jesse Taube , Andy Chiu , Alexandre Ghiti , Inochi Amaoto , Samuel Holland , Yong-Xuan Wang Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yixun Lan , Longbin Li , Conor Dooley Subject: [PATCH v3 1/3] dt-bindings: riscv: add bfloat16 ISA extension description Date: Fri, 6 Dec 2024 13:58:27 +0800 Message-ID: <20241206055829.1059293-2-inochiama@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206055829.1059293-1-inochiama@gmail.com> References: <20241206055829.1059293-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_215918_329201_2A60323F X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add description for the BFloat16 precision Floating-Point ISA extension, (Zfbfmin, Zvfbfmin, Zvfbfwma). which was ratified in commit 4dc23d62 ("Added Chapter title to BF16") of the riscv-isa-manual. Signed-off-by: Inochi Amaoto Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index 9c7dd7e75e0c..0a1f1a76d129 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -329,6 +329,12 @@ properties: instructions, as ratified in commit 056b6ff ("Zfa is ratified") of riscv-isa-manual. + - const: zfbfmin + description: + The standard Zfbfmin extension which provides minimal support for + 16-bit half-precision brain floating-point instructions, as ratified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-isa-manual. + - const: zfh description: The standard Zfh extension for 16-bit half-precision binary @@ -525,6 +531,18 @@ properties: in commit 6f702a2 ("Vector extensions are now ratified") of riscv-v-spec. + - const: zvfbfmin + description: + The standard Zvfbfmin extension for minimal support for vectored + 16-bit half-precision brain floating-point instructions, as ratified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-isa-manual. + + - const: zvfbfwma + description: + The standard Zvfbfwma extension for vectored half-precision brain + floating-point widening multiply-accumulate instructions, as ratified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-isa-manual. + - const: zvfh description: The standard Zvfh extension for vectored half-precision @@ -663,6 +681,33 @@ properties: then: contains: const: zca + # Zfbfmin depends on F + - if: + contains: + const: zfbfmin + then: + contains: + const: f + # Zvfbfmin depends on V or Zve32f + - if: + contains: + const: zvfbfmin + then: + oneOf: + - contains: + const: v + - contains: + const: zve32f + # Zvfbfwma depends on Zfbfmin and Zvfbfmin + - if: + contains: + const: zvfbfwma + then: + allOf: + - contains: + const: zfbfmin + - contains: + const: zvfbfmin allOf: # Zcf extension does not exist on rv64 From patchwork Fri Dec 6 05:58:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13896547 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 DDDB1E77179 for ; Fri, 6 Dec 2024 06:00:08 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=8FCs85y4nHbZZL1EB6/VWrXXZy5mhGAE/gyN+wpJPcE=; b=CiQFcQI1Xw+HNj uhVi4bZdYBYttLTfVbNbSWx8duCmRfoUyhPz8Sog0sNkYTj4y3hOlB85pMoRgEYEycCWtyCFj/pFn FIbqlGTwtEvYF/UBQhQkgpRDwZJ2ugDA/xV6Hyu3AqfJvOaowMTUP+LHQPDACPuY6EqcpBEoeKK/z Af69xluxoh82YOyYTHc16AqD8VNejaSDJf2SwvuELQ6NxRgjF1h0xfQqP1TRH1KZ2DvXvnqKJ62Bd 80mseTnC/szeoe9Dt0++ZohZydrd119LmROwH0Qzzzi0IsTVNZD3YOFaxVWxAEON+b91cxfgTtcKM hSjUIUs/sOgCH/uNvBpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJRNa-00000000f9H-0to5; Fri, 06 Dec 2024 05:59:54 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJRN3-00000000exm-3e4F for linux-riscv@lists.infradead.org; Fri, 06 Dec 2024 05:59:22 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-6d8843c44cfso19795396d6.3 for ; Thu, 05 Dec 2024 21:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733464760; x=1734069560; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3B2zlAfPxzGcJqLLkasGHOZWMqJHtz0wkkNYHD9NX98=; b=SMrWBv7/HiouOXmz1uPgA9efue3befVNpF6dPwXxF01olEIPZmTm/YXtx3UfLTQbcK vHssHpud2pkN7nNWJr24sAGMDqS5kCemfoRFdIY/gvRP6x4y+DS8wEQzcYx17JWm+W/2 ktsLUATxkuJOYlZir10FDkbdr+ahhPigv/+wPN0KiwlstrORPGzRSWfnw5LDtu0EJ8wY Z9P23JD1NDyh7MB5+kCjB3cVLbAQ+CyjBeODYsAk8WiDUvjg/Fg3pG/k5IkQ2DiKRtPS eETdqVSDR+brr7gpo9XQYV7VzCVW7gGh1AxQUfBfhbJe2T7LIQQYCzDB3Vh5Du+XtKTX FczA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733464760; x=1734069560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3B2zlAfPxzGcJqLLkasGHOZWMqJHtz0wkkNYHD9NX98=; b=AkqVoPTJlGcD7hIWcvvLzN7Itgz3z8JMw0GDFF8wSsZIZrGNXy5v2mTYReTvD/fIzq 87UgoMhryTvic6HW/Z+WzHpNYObeDI3QNTAXq92roBs2qYTb0XlnbVI+e2H5MA0dfeVe lPx8g6DzRivY+EsDRiCWlyQvXKTKDbdK8JpY4Fh/qY3fIizYtvsfC9qgKqfhvPhRRPCA dswBoE0GTjo1mbFLl1kVMWpoR2esGgqoCIndMp2Ih+rd5z+y1ecesLVoBNsPbZ2BZfGa YIct6yXuMCmz7dcQ3vY4apYvWtpNx6LuByGcI0PNhpW+QTWoEZZQhakGGI3ryTOE+17N 5JdA== X-Forwarded-Encrypted: i=1; AJvYcCVzPJc2RZqxISdCRcH8a4tngc5OIvyoYRlgZbTPz4LXelgFw+gwOCQHPaf3xFRiQbgKLEp874P8IrIbXA==@lists.infradead.org X-Gm-Message-State: AOJu0Yx55SLiw58qOUVfGkY9H0fcd08dmZzC1McwJ/00vVszE6oCGQ1R LMEOEcE/nDD4QFVgDd5SVqvJ/qherzbfe09iLf4zK8CrM6Ehu08b X-Gm-Gg: ASbGnctkkScdr7VHZikbuwvKvKpKmVdF/r8eImGwM/9RpvhdbQ+dO4kGxV+Wqc9XBGt 6Baldjr3ZQBDvu3RrrqX8CbCi5QyMDSakTIPSBiybcN+FazSZfgI/yZXc/w4ngl5R6tEcEPg9yu c013K8Yqf79p9T9cqoJPB1LS+dABk0SntNgpWjd90vHucdp4viqml33iGrU9aff4oL0gXMGPKew 2LS/SuOoM1QXDSaaNSl4ROp7A== X-Google-Smtp-Source: AGHT+IHSpUqq5Os4ifAgGNhdw5ThUTTLrj+Ai+/aRacSkXwVnOFqsvWmHLjVYLoRqjraOD4r+REhNw== X-Received: by 2002:a05:6214:1bcf:b0:6d8:9dad:e14b with SMTP id 6a1803df08f44-6d8e70ca7a8mr25029446d6.13.1733464760713; Thu, 05 Dec 2024 21:59:20 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8dac016cbsm15430616d6.117.2024.12.05.21.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 21:59:20 -0800 (PST) From: Inochi Amaoto To: Chen Wang , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Jesse Taube , Andy Chiu , Alexandre Ghiti , Inochi Amaoto , Samuel Holland , Yong-Xuan Wang Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yixun Lan , Longbin Li Subject: [PATCH v3 2/3] riscv: add ISA extension parsing for bfloat16 ISA extension Date: Fri, 6 Dec 2024 13:58:28 +0800 Message-ID: <20241206055829.1059293-3-inochiama@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206055829.1059293-1-inochiama@gmail.com> References: <20241206055829.1059293-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_215921_904277_5E22AE57 X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add parsing for Zfbmin, Zvfbfmin, Zvfbfwma ISA extension which were ratified in 4dc23d62 ("Added Chapter title to BF16") of the riscv-isa-manual. Signed-off-by: Inochi Amaoto --- arch/riscv/include/asm/hwcap.h | 3 +++ arch/riscv/kernel/cpufeature.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 869da082252a..14cc29f2a723 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -100,6 +100,9 @@ #define RISCV_ISA_EXT_ZICCRSE 91 #define RISCV_ISA_EXT_SVADE 92 #define RISCV_ISA_EXT_SVADU 93 +#define RISCV_ISA_EXT_ZFBFMIN 94 +#define RISCV_ISA_EXT_ZVFBFMIN 95 +#define RISCV_ISA_EXT_ZVFBFWMA 96 #define RISCV_ISA_EXT_XLINUXENVCFG 127 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index c0916ed318c2..5cfcab139568 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -341,6 +341,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zacas, RISCV_ISA_EXT_ZACAS), __RISCV_ISA_EXT_DATA(zawrs, RISCV_ISA_EXT_ZAWRS), __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA), + __RISCV_ISA_EXT_DATA(zfbfmin, RISCV_ISA_EXT_ZFBFMIN), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), __RISCV_ISA_EXT_DATA(zca, RISCV_ISA_EXT_ZCA), @@ -373,6 +374,8 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_SUPERSET(zve64d, RISCV_ISA_EXT_ZVE64D, riscv_zve64d_exts), __RISCV_ISA_EXT_SUPERSET(zve64f, RISCV_ISA_EXT_ZVE64F, riscv_zve64f_exts), __RISCV_ISA_EXT_SUPERSET(zve64x, RISCV_ISA_EXT_ZVE64X, riscv_zve64x_exts), + __RISCV_ISA_EXT_DATA(zvfbfmin, RISCV_ISA_EXT_ZVFBFMIN), + __RISCV_ISA_EXT_DATA(zvfbfwma, RISCV_ISA_EXT_ZVFBFWMA), __RISCV_ISA_EXT_DATA(zvfh, RISCV_ISA_EXT_ZVFH), __RISCV_ISA_EXT_DATA(zvfhmin, RISCV_ISA_EXT_ZVFHMIN), __RISCV_ISA_EXT_DATA(zvkb, RISCV_ISA_EXT_ZVKB), From patchwork Fri Dec 6 05:58:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13896545 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 70B94E77173 for ; Fri, 6 Dec 2024 05:59:59 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=nhRikgxh4iTtoSMVSxzEV9csE9QRyNYPDyGmtEETbRM=; b=RPNJSwI2uru0Vw APg8zk8Ih/mnQ41Fu/onWUFCp5d5DFgjTPXonVWmHN3f9HgW2k19TNa54VOMibhI2PY5ijNmqSgkl mvdfyzXOSH4kwOtnJIGFbvyB3jF2mpJP7s7t9ZzU3HJ+5w7vIywUCY/9b1LkNpKavEnxCLZvWvncQ 53yFtCeF3aalofAnNVeINpaubiuKK8L2Vwh3lt7aIYoADFECx9QlJiK50bTD08oHOaumWCBs5xH62 PvjVfPhNG+Je7ue6YtnUPaM5iUJcDDv6YXUaEzuDQyYSJTOwpY5IBJ9E0wpnOOLryrsvHARAP8QE+ nawR1PJGIFO9KXxPvdSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJRNa-00000000f9t-3hbW; Fri, 06 Dec 2024 05:59:54 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJRN8-00000000ezl-1wmC for linux-riscv@lists.infradead.org; Fri, 06 Dec 2024 05:59:27 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-466a079bc5eso12759381cf.3 for ; Thu, 05 Dec 2024 21:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733464765; x=1734069565; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=99+Mfl/GHyyDKmDCEIDfOnHV+iERdk7X1PZjrxCa1IU=; b=hAC6KyeFfu2YkH7gZESLRUqfy+RyPp+AAvaIGRvGl1GaNjjYPCAAS4PVqNq4tAwPC0 Sz5Anw2zB2LjaZ+j1tpqBfBN1Vbp55srLxQdGjXP7LLJs3jacWr4/MOotwTyXqn6zITV G9cYOEg+X9p7wDxLA6VrJN85sjS+xOfBwiGrKoFx08i8miIGwk2S+iAUgaATZ6bVSWNa IfYCG7ZLkaiBiJOBQsWECsx64tlDzfdQiKQB0GmeyBU/VtHvQmIVnB1BcErqkUjiXw1E L7mlKvMvoWF/PE6eVvwn3smGA2Q9xsipDSWcVNXzwbb2vUSOUlmB2noFoAJ8+v/s6oh0 l9nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733464765; x=1734069565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=99+Mfl/GHyyDKmDCEIDfOnHV+iERdk7X1PZjrxCa1IU=; b=cyMyIXSlet3UWqqYWuLaTnWvNwL6hZ43+/mkd24lVPWxgedAfVXU3K6a3dxr5f44av 7z9R4mIXL0duJiEIq1qAsk/9PHUkr7cKnFC/xXtU7+KavI1YtvW6NxJiilMbpQMtG+jj /+qpMPUvCfXPxtOXvruT6LEqsAdtrJgv1w07tOUgqX2HzI4FBULKETPL7f1/FTHcXpN3 8lodIZZGGELq4UqYrk4+orXKCvrqxEeZQJDoydTCwHwUvRNj2r4W70NU4mSJQpvF9fgJ wI11wDPO6h0d/7mRCFVbV0ckmdmG5s511Np1AwlRtX/TA2nP2W9yHDk9rj1MpsY3yqMA mzbg== X-Forwarded-Encrypted: i=1; AJvYcCWIbBBV6a19Zx7TljdJW4aaK7q5s9NzxPRuHrGYHnjzmuEdLSzyqMkA8zUZ8s576xIDBKSGhx6s29DwYQ==@lists.infradead.org X-Gm-Message-State: AOJu0YyDRlvmANlg40BM5bTXaJysyBNkLdXoR94YZeHqsr+L7cY5n95V icFiFViManZprSdAkzc3T+5kGP0dMFmiJTfAz5p9/6SGNKSrITRJ X-Gm-Gg: ASbGncs7o0m6USRwq0qsKbeuw9hoPi047GJxF66Neq1NQxBu62TJdGKDDW31Bu2Xn8R wCsIAiPn/o/ukUOUPOpCOMO+L7O0444UhkmX5GIylNJFyvmED3lxZvsx7HGeCj0GOo+xn8Mr5uu AkF5cC0BjWJQLLNAjygerZPNdq9tj8PCJKIQ8qt54LODzP9cWvISDf0yPDXmhBU8FXP9e6AAdDo s+Kzp3ZqKjjfEesWqUmRL/vxQ== X-Google-Smtp-Source: AGHT+IF0kNksBAetSJdav341ahruff6KWAb7ZkcXBJa+STsOcvKmHNoEQ+0qcg4RzK0XD/H9bZ0JMw== X-Received: by 2002:a05:622a:199b:b0:466:a61f:9ead with SMTP id d75a77b69052e-46734f7d305mr32306181cf.36.1733464765105; Thu, 05 Dec 2024 21:59:25 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46729793741sm17182941cf.61.2024.12.05.21.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 21:59:24 -0800 (PST) From: Inochi Amaoto To: Chen Wang , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Jesse Taube , Andy Chiu , Alexandre Ghiti , Inochi Amaoto , Samuel Holland , Yong-Xuan Wang Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yixun Lan , Longbin Li Subject: [PATCH v3 3/3] riscv: hwprobe: export bfloat16 ISA extension Date: Fri, 6 Dec 2024 13:58:29 +0800 Message-ID: <20241206055829.1059293-4-inochiama@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206055829.1059293-1-inochiama@gmail.com> References: <20241206055829.1059293-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_215926_501863_7D958881 X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Export Zfbmin, Zvfbfmin, Zvfbfwma ISA extension through hwprobe. Signed-off-by: Inochi Amaoto Reviewed-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 12 ++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 3 +++ arch/riscv/kernel/sys_hwprobe.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 955fbcd19ce9..a9cb40e407a4 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -242,6 +242,18 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_SUPM`: The Supm extension is supported as defined in version 1.0 of the RISC-V Pointer Masking extensions. + * :c:macro:`RISCV_HWPROBE_EXT_ZFBFMIN`: The Zfbfmin extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFBFMIN`: The Zvfbfmin extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFBFWMA`: The Zvfbfwma extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: Deprecated. Returns similar values to :c:macro:`RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF`, but the key was mistakenly classified as a bitmask rather than a value. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index 3af142b99f77..aecc1c800d54 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -73,6 +73,9 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47) #define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48) #define RISCV_HWPROBE_EXT_SUPM (1ULL << 49) +#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 50) +#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 51) +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 52) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c index cb93adfffc48..bd215f58bd1b 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -131,6 +131,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZVE64D); EXT_KEY(ZVE64F); EXT_KEY(ZVE64X); + EXT_KEY(ZVFBFMIN); + EXT_KEY(ZVFBFWMA); EXT_KEY(ZVFH); EXT_KEY(ZVFHMIN); EXT_KEY(ZVKB); @@ -147,6 +149,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZCD); EXT_KEY(ZCF); EXT_KEY(ZFA); + EXT_KEY(ZFBFMIN); EXT_KEY(ZFH); EXT_KEY(ZFHMIN); }