Skip to content

Commit d69b776

Browse files
committed
riscv: use name riscv32 for 32-bit RISC-V architecture
rename internal riscv32 module to riscv_shared
1 parent ebe0141 commit d69b776

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

crates/core_arch/src/core_arch_docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ others at:
185185
* [`x86_64`]
186186
* [`arm`]
187187
* [`aarch64`]
188-
* [`riscv`]
188+
* [`riscv32`]
189189
* [`riscv64`]
190190
* [`mips`]
191191
* [`mips64`]
@@ -198,7 +198,7 @@ others at:
198198
[`x86_64`]: x86_64/index.html
199199
[`arm`]: arm/index.html
200200
[`aarch64`]: aarch64/index.html
201-
[`riscv`]: riscv/index.html
201+
[`riscv32`]: riscv32/index.html
202202
[`riscv64`]: riscv64/index.html
203203
[`mips`]: mips/index.html
204204
[`mips64`]: mips64/index.html

crates/core_arch/src/mod.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ pub mod arch {
5656
pub use crate::core_arch::aarch64::*;
5757
}
5858

59-
/// Platform-specific intrinsics for the `riscv` platform.
59+
/// Platform-specific intrinsics for the `riscv32` platform.
6060
///
6161
/// See the [module documentation](../index.html) for more details.
62-
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64", doc))]
63-
#[doc(cfg(any(target_arch = "riscv32", target_arch = "riscv64")))]
62+
#[cfg(any(target_arch = "riscv32", doc))]
63+
#[doc(cfg(any(target_arch = "riscv32")))]
6464
#[unstable(feature = "stdsimd", issue = "27731")]
65-
pub mod riscv {
66-
pub use crate::core_arch::riscv::*;
65+
pub mod riscv32 {
66+
pub use crate::core_arch::riscv_shared::*;
6767
}
6868

6969
/// Platform-specific intrinsics for the `riscv64` platform.
@@ -73,8 +73,11 @@ pub mod arch {
7373
#[doc(cfg(any(target_arch = "riscv64")))]
7474
#[unstable(feature = "stdsimd", issue = "27731")]
7575
pub mod riscv64 {
76-
pub use crate::core_arch::riscv::*;
7776
pub use crate::core_arch::riscv64::*;
77+
// RISC-V RV64 supports all RV32 instructions as well in current specifications (2022-01-05).
78+
// Module `riscv_shared` includes instructions available under all RISC-V platforms,
79+
// i.e. RISC-V RV32 instructions.
80+
pub use crate::core_arch::riscv_shared::*;
7881
}
7982

8083
/// Platform-specific intrinsics for the `wasm32` platform.
@@ -275,7 +278,7 @@ mod arm;
275278

276279
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64", doc))]
277280
#[doc(cfg(any(target_arch = "riscv32", target_arch = "riscv64")))]
278-
mod riscv;
281+
mod riscv_shared;
279282

280283
#[cfg(any(target_arch = "riscv64", doc))]
281284
#[doc(cfg(any(target_arch = "riscv64")))]

crates/core_arch/src/riscv/mod.rs renamed to crates/core_arch/src/riscv_shared/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! RISC-V intrinsics
1+
//! Shared RISC-V intrinsics
22
33
use crate::arch::asm;
44

0 commit comments

Comments
 (0)