From ed2d3ee924058d4f28e3a5cdbfe5022e927bd223 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 11 Apr 2025 01:13:44 +0000 Subject: [PATCH] RISC-V: Add placeholder for the "B" extension The "B" extension is once abandoned (instead, it is ratified as a collection of "Zb*" extensions). However, it is later redefined and ratified as a superset of "Zba", "Zbb" and "Zbs" extensions (but not "Zbc" carry-less multiplication for limited benefits and implementation cost). Although non-functional (because feature detection is not yet implemented), it provides the foundation to implement this extension (along with straightforward documentation showing subsets of "B"). --- library/stdarch/crates/std_detect/src/detect/arch/riscv.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/stdarch/crates/std_detect/src/detect/arch/riscv.rs b/library/stdarch/crates/std_detect/src/detect/arch/riscv.rs index 271700aefa6b..4b1cbdcda5af 100644 --- a/library/stdarch/crates/std_detect/src/detect/arch/riscv.rs +++ b/library/stdarch/crates/std_detect/src/detect/arch/riscv.rs @@ -32,10 +32,9 @@ features! { /// * A: `"a"` /// * Zaamo: `"zaamo"` /// * Zalrsc: `"zalrsc"` - /// * Bit-Manipulation Extensions: + /// * B: `"b"` /// * Zba: `"zba"` /// * Zbb: `"zbb"` - /// * Zbc: `"zbc"` /// * Zbs: `"zbs"` /// * C: `"c"` /// * D: `"d"` @@ -54,6 +53,7 @@ features! { /// * Zdinx: `"zdinx"` /// * Zhinx: `"zhinx"` /// * Zhinxmin: `"zhinxmin"` + /// * Zbc: `"zbc"` /// * Zbkb: `"zbkb"` /// * Zbkc: `"zbkc"` /// * Zbkx: `"zbkx"` @@ -159,6 +159,9 @@ features! { @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] c: "c"; /// "C" Extension for Compressed Instructions + @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] b: "b"; + without cfg check: true; + /// "B" Extension for Bit Manipulation @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zba: "zba"; /// "Zba" Extension for Address Generation @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zbb: "zbb";