From patchwork Sun Nov 3 07:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13860329 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 3ABC2E67806 for ; Sun, 3 Nov 2024 07:52:37 +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=O95UFC16Tez0YTX3qpeGjj/OmUauBypQ+GmrWqkFe/I=; b=SeiDL6r/e4U6pa +EgDd+Y1CQFgdoFkQUnxOR7C2XYqq94LYwrcFz/IUzpVktXmyJmT8qviXoxhokyjOGHSdtUiJRYbP p4IAYQnEyOR6uRI8C1wY+BslxVweJ3+zsIst34l67YGw5fao48sodxJHJk1s/c6BuAKCqFF/wphKB ikV/N0gYYqxsqnWvtsFE4ijJVz8bp1VocHvpjdAZXhoUoXPVX5yqGJoFWPWP4ctL6gcG/D3Mss5wU h+7Pz/kLVlsdSCEQER/9hoz6ZiTEnGiuvjCCoZ3optXr801RNPIK8fbU2xweSCZNNQPpbtdbfaKuR bVaLuBijlKD0qMKoHffw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t7VPS-0000000B7mB-2z8d; Sun, 03 Nov 2024 07:52:30 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t7VNe-0000000B7QK-0NV7 for linux-riscv@lists.infradead.org; Sun, 03 Nov 2024 07:50:39 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-720be27db27so2481895b3a.2 for ; Sun, 03 Nov 2024 00:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730620237; x=1731225037; 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=HHcOCAQRVF6wDwCpz/Ofc5RAAihYPSYxf02RxaoduNk=; b=hPmIvM9K/3VyI2b0g3B0rXnz9E9tygNI/zg+giYRi2OfFC/1VjbKXz5dRhvGI5wU3B RHI9aLTWif8LubHDCqZhBtw3DmLazuX5D3m731SpqqelUrTmh91ybXO75q5LgU7NUrHk ZwsGuN9UzsnW/ht+3EJjfRcnA8vMvk7Vkt7hbmi0rYmEofamzMHm+HoRrf3+zTqxeD4d J+XSasYo2urP5mXU7TZqskzXByrb0tDScrQ6LKZWK0aoWDyhu7CpmyZK31ksoUcdVTZe rNvDRDXK9AHVMG3jjtjU7euKVzryX+/VAkQklZ2fMJigrJIWTImGJxinsHdJgsUP0LHQ KysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730620237; x=1731225037; 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=HHcOCAQRVF6wDwCpz/Ofc5RAAihYPSYxf02RxaoduNk=; b=Y2lz+IUBiQmhP+UyqyLRG2hibrpGWyvbwSr9TspD6FqpoMIsVE+JaugPuXkOKIfYtX qPXNCask/2jXbyaPpAu8HOS9hQlv8sfDspZ0Sgmd9/sFlP+Oz8O3jhiXBMQRHFUpkjCB 3+9vo54StDfOvGumDdh9zch9s0qnhqoznFNdHoopSZMRVFpdArwUmk7sZgyhjhyeikYB t3ErTKR18Rp5ibtFNawizctMPvlx/MY0tLVxytNirKhvl3qTK4+iODeseRQNqC6eP26X N8X7hGxZbe4NJDevEiNAwknW6RopAlB2ryTMrIGPWye1koe8AeEp6pQgni18tUP+RtPC yuwQ== X-Forwarded-Encrypted: i=1; AJvYcCXG4tCqZf2HAbSg3tAy3utunltZgNx3A3L6+WHraDkJgzZMrMDIphS4erKU6yeaDbEnA2es2TwUqk9VvQ==@lists.infradead.org X-Gm-Message-State: AOJu0Yyroy0xy4ra2Cjm+ySsudRnON4292n1NAlP6JwpRB0spP92JejA RNgL2ngRYSjn48oKgyW5VU3grvmaEhw/KIyYG0ISkL1y5BYGRgB1 X-Google-Smtp-Source: AGHT+IG7/wFicHX9OEUYDqktOUiK/uVF+gBMW79yuPguvpjtQ5yao4SckDLDe3KLDsePTQwcfpW9kg== X-Received: by 2002:a05:6a20:734c:b0:1db:d756:6136 with SMTP id adf61e73a8af0-1dbd7566139mr99827637.3.1730620236993; Sun, 03 Nov 2024 00:50:36 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc20f64asm5409704b3a.96.2024.11.03.00.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 00:50:36 -0700 (PDT) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Andy Chiu , Inochi Amaoto , Xiao Wang , Samuel Holland 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 v2 1/3] dt-bindings: riscv: add bfloat16 ISA extension description Date: Sun, 3 Nov 2024 15:49:55 +0800 Message-ID: <20241103074959.1135240-2-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241103074959.1135240-1-inochiama@gmail.com> References: <20241103074959.1135240-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241103_005038_159298_7858EB15 X-CRM114-Status: UNSURE ( 8.98 ) 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 2cf2026cff57..99d8b70fa321 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -277,6 +277,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 @@ -467,6 +473,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 @@ -605,6 +623,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 Sun Nov 3 07:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13860330 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 53790E67807 for ; Sun, 3 Nov 2024 07:52:37 +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=yV4MNyYg9uTD+YypQEcPUCP/6zkzQxoFf7rhSlJ31/k=; b=YVWvrtIUeIvAlm kx49HUYysH8eqZRFTyKrZbPScAPUAWiJedmuJKIFI5ATTTVZVjpuDiF7XlO4qSL2zmdm+ScdidfbH xWQnEBcZHucNaowiTEZpte1f8zx7wthrv1rjoiYf/6sQD9tKJtCETa18oTXJYx8TPZ9vvC5N7fmjn o85jkckiRw2d3WuBKiAI1bQHvnr+wdTlK0Vluka7cf2qQB1jeKNWBZcpOo6xJnj2eQxvOQw3ROu73 Mm5FohBgw6iZ8M6mMwfeviDExdhDImUK6rcO64IJiwp32wyLKeZf12YtwrcMcghH/eFoTITSAuxS0 +qaDODCpqvsFk8F9agwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t7VPT-0000000B7mM-1Op8; Sun, 03 Nov 2024 07:52:31 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t7VNf-0000000B7Qi-3XnD for linux-riscv@lists.infradead.org; Sun, 03 Nov 2024 07:50:41 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-720d14c8dbfso1907566b3a.0 for ; Sun, 03 Nov 2024 00:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730620239; x=1731225039; 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=1uizG+AQKjMiNSyY0/c5FnD4O0HivvPLaMjzCzg5Rho=; b=B5oIJC5874tyx8sLb6fYwBkljfDVSGmxa8CHnBXgebmLk7wUlxl7HszlFgFo+CrvMK m6deHrXE+9vHTJTJu4A+4vo9Fyihw5yWwMHoYIGkL287FKjkWg0XtfWqNvMgjBiRqCVs bhzIDJqtOT82mzpP1E6eR1u9H4iErPgfC8sDg/jvykOEdlWoHo2KifCe1dFCSJuz3D/p TFmzeF+KvTLBD6MvND+WIx4qgYlmxW1+3Xy3M2ZTvP5LyVUhypcx3zyWD2frgWGIyXz1 qUkK7mDu1eZF1U077a+cUHp+5ZdpN3hya1PeJR1WUHEUh49TTbjdfe5jONDPlXPEKDh+ z9eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730620239; x=1731225039; 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=1uizG+AQKjMiNSyY0/c5FnD4O0HivvPLaMjzCzg5Rho=; b=ZbziMkSWedO92+gfqn1nvOD/xWLR9GJDMdsq2Cw6PiWMfwKKTZG1z5zAZvitF6yTnx 5IRoz85hFiHOuGCjlL7w6EgU1GxtYm9bn7c5CuxV9JoFq8u5oHD0R/QxGlXM5E+YJ00I I5i4bNBYqrNKtl13RuECgDzf7bvM9eaVu811idqhNJ3UDh+cf1cIU2WsJeW4x/sWCe/P NeVW/iiN3JrQCWp/njdw2ib2K467Q4pP0dVWZRrMqPt911oxwFfAM5bdoW1ImHr7FuY9 aIm3zGOl1KqAHt37AmHi1FhKWcRo2EAe7MjEzy8zAn1TK0aKE7dgwWUgEI/8aFguH+2e hfOg== X-Forwarded-Encrypted: i=1; AJvYcCVSlKZtEi7+JL9zFoWj0EKvD9DBPhrkALsjouh3LC4gk2MTlZ9HZhxfF17MZNmsiYR2cYrsMtkuMIT1gA==@lists.infradead.org X-Gm-Message-State: AOJu0YzhQL9ZN7B0yebnuO7apyCFH5GwpmGKTHqV/Gwm+LXi701ObysK xKsY6RPqAvkyon04whBEGGBd0B4/N8fyMy8nriRBtMHoShDGQk2B X-Google-Smtp-Source: AGHT+IGBI9drJicN8m+V2yXjzCG8M+gsBBzp5RBPh4a3AqoLk36+eLE2uPD9/29r0ZVb+zZWxlwzMw== X-Received: by 2002:a05:6a21:7101:b0:1d9:1c1e:239e with SMTP id adf61e73a8af0-1db91de3c85mr15691002637.28.1730620238824; Sun, 03 Nov 2024 00:50:38 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1b8936sm5276775b3a.5.2024.11.03.00.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 00:50:38 -0700 (PDT) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Andy Chiu , Inochi Amaoto , Xiao Wang , Samuel Holland 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 v2 2/3] riscv: add ISA extension parsing for bfloat16 ISA extension Date: Sun, 3 Nov 2024 15:49:56 +0800 Message-ID: <20241103074959.1135240-3-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241103074959.1135240-1-inochiama@gmail.com> References: <20241103074959.1135240-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241103_005039_906290_B81E8773 X-CRM114-Status: UNSURE ( 9.59 ) 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 46d9de54179e..97657fb63af6 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -93,6 +93,9 @@ #define RISCV_ISA_EXT_ZCMOP 84 #define RISCV_ISA_EXT_ZAWRS 85 #define RISCV_ISA_EXT_SVVPTC 86 +#define RISCV_ISA_EXT_ZFBFMIN 87 +#define RISCV_ISA_EXT_ZVFBFMIN 88 +#define RISCV_ISA_EXT_ZVFBFWMA 89 #define RISCV_ISA_EXT_XLINUXENVCFG 127 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3a8eeaa9310c..1b286f5bc591 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -325,6 +325,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), @@ -357,6 +358,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 Sun Nov 3 07:49:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13860332 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 9F7EFD10C0D for ; Sun, 3 Nov 2024 07:52:45 +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=tYJQQqxofDBagVMCFXykNim0rz9sMPAYeWqoCHoWjUY=; b=XQ3cYabNdBC8zt 80GcCIa3IZ/8Ut33TAtvhIr4cmUXQAdZhQv5YcVDz3LFwbNt8mOYaITQkNO4t2I8GLABjXRgux/s1 nFmKiqJ+VC4wLJ1QFD+gOEXGi1H8WzVdODtQYUa5w7ffkAlqTmD0fGTZCLk1eU1M3cffmOcitT5YM PEpMr/fECCXAmGujgdmJKhhtNHU7OZ+Oa6auXW79BFmHkETyPGIP7Roqa/1J80WhOftSgOb363V6D f2CH53OITQNm3DBua/JI/1RyrT7hRIC9aZldw3VE2I5tqj7vMzalIAPduOuhwTYCXWI4z11xitRNu mLmYCSIFDsaUAf0uj0vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t7VPT-0000000B7mT-42Je; Sun, 03 Nov 2024 07:52:31 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t7VNi-0000000B7RD-1twd for linux-riscv@lists.infradead.org; Sun, 03 Nov 2024 07:50:43 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20c77459558so27462155ad.0 for ; Sun, 03 Nov 2024 00:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730620241; x=1731225041; 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=VKC325jeeb+bVADWaZpPiV68gFL/gz/ByL8ImcIeld8=; b=YGKVu5cr2fm0JNky5Z0lMKotqib7I7Z35KA4ZSFVtljkl0nnoA+B+qz4oMD60itVKM bfCuk5RvnjvJomn4bEAtNuuURE5GJ/x/LBbwWIgpRFhgmtDm2MM0W2oj7YtNT4eXl18W OoyCBKLzLar/m9fKb04hMrIgUJeudp08OdKi3arGbF5GDXiWxQ8kypcSd5rOGm4MREQO KS4a90X8DA8SChDEjUob9MNqVHY7AdyW2y6b1oD0o8OqnDBaLuTqXvXJ99yAs11Uz3HO uEXThcGXcbIMe/MD5PodVPhP6j08gSm95Q/4kWJA/VSyrMpUg3EBGfeyJZGXv2Zc+Ky1 mNjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730620241; x=1731225041; 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=VKC325jeeb+bVADWaZpPiV68gFL/gz/ByL8ImcIeld8=; b=t2On0UQTyOHE09zAmY15I73EwAJH/FT7xFgWHO9rIW84f64kGN0cdYoULEGDr98O9a 96XLeVBxfmWJLrNXlehLYZ1ghZeDuvsWkPq8yiBPGMqpdrmpe9LXlvXlSM1unEPaK3Hw rbfFo372JPhV5GTQik+ayCmvPrwvNQziSj2ryVTo+svgBDWswTcY4LQ6sc0hBeOM8q33 GhJmkdDhKUiTduHbD/LcYDhkbSZQJjNoGU30ardHoJrGym8a2eUopCJeMFjeuRztKX4q 7o7Z+8howpdbS9dQxtEwXYFCDVvhGEEHCNgD2d7g71P/1JhxJhlMrf+WB7IP7vkCyAbz +HDg== X-Forwarded-Encrypted: i=1; AJvYcCVlRr1qMWKe6Kiv9JWgQ743WbxcgqzxTjvKEaIBnC6zBhHMdlELV+mmuGOsgg8VxFKfNDOnaV+/EoGwkw==@lists.infradead.org X-Gm-Message-State: AOJu0Yzzh13bEOVDxN1RbqUxDNm6mMZ44SURYEEQa/dPCnqt/uX0sdmf 6bPqKrorC0izpOJ0XckHKbmO0BUB4uAaqNhLm71NtNMnN88M6PzL5+6MgA== X-Google-Smtp-Source: AGHT+IEKYPq7oqoeSULfZN24QbWKB75bFPKLNJo6fZCRP1KNJw6SX/2/tkgq6QHogIYQMwPXETbmyQ== X-Received: by 2002:a17:902:dace:b0:20c:5cdd:a91 with SMTP id d9443c01a7336-210f76d6870mr236020995ad.41.1730620241063; Sun, 03 Nov 2024 00:50:41 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211056eda2csm43041595ad.49.2024.11.03.00.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 00:50:40 -0700 (PDT) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Charlie Jenkins , Andrew Jones , Andy Chiu , Inochi Amaoto , Xiao Wang , Samuel Holland 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 v2 3/3] riscv: hwprobe: export bfloat16 ISA extension Date: Sun, 3 Nov 2024 15:49:57 +0800 Message-ID: <20241103074959.1135240-4-inochiama@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241103074959.1135240-1-inochiama@gmail.com> References: <20241103074959.1135240-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241103_005042_514454_3344457B X-CRM114-Status: GOOD ( 10.75 ) 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 85b709257918..8c30dd06f3c0 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -239,6 +239,18 @@ The following keys are defined: ratified in commit 98918c844281 ("Merge pull request #1217 from riscv/zawrs") of riscv-isa-manual. + * :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 1e153cda57db..95d00a065b4e 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -72,6 +72,9 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCF (1ULL << 46) #define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47) #define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48) +#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 49) +#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 50) +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 51) #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 cea0ca2bf2a2..de1966bd1776 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); }