From 958fbe8696853a5b6bff0dd1c979c6319fa5d2ec Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 11 Apr 2025 01:01:30 +0000 Subject: [PATCH 1/4] RISC-V: doc: Capitalize some words for consistency RISC-V extension names are capitalized for consistency. --- crates/std_detect/src/detect/arch/riscv.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/std_detect/src/detect/arch/riscv.rs b/crates/std_detect/src/detect/arch/riscv.rs index 2368131fea..e0673165ab 100644 --- a/crates/std_detect/src/detect/arch/riscv.rs +++ b/crates/std_detect/src/detect/arch/riscv.rs @@ -163,14 +163,14 @@ features! { @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbc: "zbc"; /// "Zbc" Extension for Carry-less Multiplication @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbs: "zbs"; - /// "Zbs" Extension for Single-Bit instructions + /// "Zbs" Extension for Single-Bit Instructions @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbkb: "zbkb"; - /// "Zbkb" Extension for Bit-manipulation for Cryptography + /// "Zbkb" Extension for Bit-Manipulation for Cryptography @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbkc: "zbkc"; - /// "Zbkc" Extension for Carry-less multiplication for Cryptography + /// "Zbkc" Extension for Carry-less Multiplication for Cryptography @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbkx: "zbkx"; - /// "Zbkx" Extension for Crossbar permutations + /// "Zbkx" Extension for Crossbar Permutations @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zknd: "zknd"; /// "Zknd" Cryptography Extension for NIST Suite: AES Decryption @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zkne: "zkne"; @@ -188,7 +188,7 @@ features! { @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zks: "zks"; /// "Zks" Cryptography Extension for ShangMi Algorithm Suite @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zk: "zk"; - /// "Zk" Cryptography Extension for Standard scalar cryptography + /// "Zk" Cryptography Extension for Standard Scalar Cryptography @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zkt: "zkt"; /// "Zkt" Cryptography Extension for Data Independent Execution Latency From 41c4f68ee6f03b12c3677532e43f30449b997b36 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 11 Apr 2025 01:01:30 +0000 Subject: [PATCH 2/4] RISC-V: doc: Updated status and clarification Some extensions are ratified at least on the ISA specification version 20240411. This commit moves such extensions. This commit also changes that: 1. Lower indentation of "Zk*" and "Zbk*" extensions to avoid extension groups from being misleading inside this section. 2. Raise indentation of "Zfhmin" and "Zhinxmin" extensions to show that they are a strict subset of "Zfh" and "Zhinx" (respectively). 3. Clarify that "s" is not an extension but a feature notifying the existence of the supervisor-level ISA. 4. Clarify that "h" is not just an existence of the hypervisor-level ISA but is also an extension name ("H"). --- crates/std_detect/src/detect/arch/riscv.rs | 45 ++++++++++------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/crates/std_detect/src/detect/arch/riscv.rs b/crates/std_detect/src/detect/arch/riscv.rs index e0673165ab..ed7ea86815 100644 --- a/crates/std_detect/src/detect/arch/riscv.rs +++ b/crates/std_detect/src/detect/arch/riscv.rs @@ -44,34 +44,31 @@ features! { /// * Zifencei: `"zifencei"` /// * Zihintpause: `"zihintpause"` /// * Zihpm: `"zihpm"` - /// * Zk: `"zk"` - /// * Zbkb: `"zbkb"` - /// * Zbkc: `"zbkc"` - /// * Zbkx: `"zbkx"` - /// * Zkn: `"zkn"` - /// * Zknd: `"zknd"` - /// * Zkne: `"zkne"` - /// * Zknh: `"zknh"` - /// * Zkr: `"zkr"` - /// * Zks: `"zks"` - /// * Zksed: `"zksed"` - /// * Zksh: `"zksh"` - /// * Zkt: `"zkt"` - /// - /// There's also bases and extensions marked as standard instruction set, - /// but they are in frozen or draft state. These instruction sets are also - /// reserved by this macro and can be detected in the future platforms. - /// - /// Frozen RISC-V instruction sets: - /// /// * Zfh: `"zfh"` - /// * Zfhmin: `"zfhmin"` + /// * Zfhmin: `"zfhmin"` /// * Zfinx: `"zfinx"` /// * Zdinx: `"zdinx"` /// * Zhinx: `"zhinx"` - /// * Zhinxmin: `"zhinxmin"` + /// * Zhinxmin: `"zhinxmin"` + /// * Zbkb: `"zbkb"` + /// * Zbkc: `"zbkc"` + /// * Zbkx: `"zbkx"` + /// * Zk: `"zk"` + /// * Zkn: `"zkn"` + /// * Zknd: `"zknd"` + /// * Zkne: `"zkne"` + /// * Zknh: `"zknh"` + /// * Zkr: `"zkr"` + /// * Zks: `"zks"` + /// * Zksed: `"zksed"` + /// * Zksh: `"zksh"` + /// * Zkt: `"zkt"` /// * Ztso: `"ztso"` /// + /// There's also bases and extensions marked as standard instruction set, + /// but they are in frozen or draft state. These instruction sets are also + /// reserved by this macro and can be detected in the future platforms. + /// /// Draft RISC-V instruction sets: /// /// * RV128I: `"rv128i"` @@ -81,11 +78,11 @@ features! { /// /// Defined by Privileged Specification: /// - /// * Supervisor: `"s"` + /// * *Supervisor-Level ISA* (not "S" extension): `"s"` + /// * H (hypervisor): `"h"` /// * Svnapot: `"svnapot"` /// * Svpbmt: `"svpbmt"` /// * Svinval: `"svinval"` - /// * Hypervisor: `"h"` /// /// [ISA manual]: https://github.com/riscv/riscv-isa-manual/ #[stable(feature = "riscv_ratified", since = "1.78.0")] From d621c9d73e4cd07a3a733f29e0767afdf616ac0c Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 11 Apr 2025 01:01:30 +0000 Subject: [PATCH 3/4] RISC-V: doc: tidying: Move link to the ISA Manual Not only moving the link to the end of the section, this commit changes the link so that we can reach to the *ratified* ISA manuals (note that, while the original URL (GitHub) is a good place to browse the latest draft, it's not easy to know which is the ratified version; even "Releases" page is not helpful since it's regularly updated). --- crates/std_detect/src/detect/arch/riscv.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/std_detect/src/detect/arch/riscv.rs b/crates/std_detect/src/detect/arch/riscv.rs index ed7ea86815..ec4a26b5f4 100644 --- a/crates/std_detect/src/detect/arch/riscv.rs +++ b/crates/std_detect/src/detect/arch/riscv.rs @@ -20,6 +20,8 @@ features! { /// ISA prefix X. These sets are highly platform specific and should be /// detected with their own platform support crates. /// + /// [ISA manual]: https://riscv.org/specifications/ratified/ + /// /// # Unprivileged Specification /// /// The supported ratified RISC-V instruction sets are as follows: @@ -83,8 +85,6 @@ features! { /// * Svnapot: `"svnapot"` /// * Svpbmt: `"svpbmt"` /// * Svinval: `"svinval"` - /// - /// [ISA manual]: https://github.com/riscv/riscv-isa-manual/ #[stable(feature = "riscv_ratified", since = "1.78.0")] @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] rv32i: "rv32i"; From eab39c6b4af461c2386a6d570ddbec0adc0c52db Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 11 Apr 2025 01:01:30 +0000 Subject: [PATCH 4/4] RISC-V: tidying: Fix separation of I-related extensions The author intended to split: 1. Former "I" extensions 2. Other "I"-related extensions but incorrectly separated between "Zihpm" (a supplement of "Zicntr" which is a former "I" extension) and "Zifencei" (a former "I" extension) while the author intended making a separation between "Zifencei" and "Zihintpause" (not a part of "I"). This commit fixes the separation. --- crates/std_detect/src/detect/arch/riscv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/std_detect/src/detect/arch/riscv.rs b/crates/std_detect/src/detect/arch/riscv.rs index ec4a26b5f4..29d8da8e12 100644 --- a/crates/std_detect/src/detect/arch/riscv.rs +++ b/crates/std_detect/src/detect/arch/riscv.rs @@ -109,10 +109,10 @@ features! { @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zihpm: "zihpm"; without cfg check: true; /// "Zihpm" Extension for Hardware Performance Counters - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zifencei: "zifencei"; without cfg check: true; /// "Zifencei" Extension for Instruction-Fetch Fence + @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zihintpause: "zihintpause"; without cfg check: true; /// "Zihintpause" Extension for Pause Hint