Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/core_arch/src/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ pub mod arch {
/// See the [module documentation](../index.html) for more details.
#[cfg(any(target_arch = "riscv32", doc))]
#[doc(cfg(any(target_arch = "riscv32")))]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub mod riscv32 {
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub use crate::core_arch::riscv_shared::*;
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub use crate::core_arch::riscv32::*;
}

Expand All @@ -94,12 +96,14 @@ pub mod arch {
/// See the [module documentation](../index.html) for more details.
#[cfg(any(target_arch = "riscv64", doc))]
#[doc(cfg(any(target_arch = "riscv64")))]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub mod riscv64 {
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub use crate::core_arch::riscv64::*;
// RISC-V RV64 supports all RV32 instructions as well in current specifications (2022-01-05).
// Module `riscv_shared` includes instructions available under all RISC-V platforms,
// i.e. RISC-V RV32 instructions.
#[stable(feature = "stdarch_riscv", since = "CURRENT_RUSTC_VERSION")]
pub use crate::core_arch::riscv_shared::*;
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core_arch/src/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
mod zb;
mod zk;

#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
pub use zb::*;

#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub use zk::*;
15 changes: 7 additions & 8 deletions crates/core_arch/src/riscv32/zb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ unsafe extern "llvm-intrinsic" {
/// Version: v1.0.1
///
/// Section: 3.47
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkx")]
#[cfg_attr(test, assert_instr(xperm8))]
#[inline]
Expand All @@ -53,7 +53,7 @@ pub fn xperm8_32(rs1: u32, rs2: u32) -> u32 {
/// Version: v1.0.1
///
/// Section: 3.48
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkx")]
#[cfg_attr(test, assert_instr(xperm4))]
#[inline]
Expand All @@ -70,7 +70,7 @@ pub fn xperm4_32(rs1: u32, rs2: u32) -> u32 {
/// Version: v1.0.0
///
/// Section: 2.12
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkc")]
#[cfg_attr(test, assert_instr(clmulh))]
#[inline]
Expand All @@ -87,7 +87,7 @@ pub fn clmulh_32(rs1: u32, rs2: u32) -> u32 {
/// Version: v1.0.0
///
/// Section: 2.13
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbc")]
#[cfg_attr(test, assert_instr(clmulr))]
#[inline]
Expand All @@ -109,10 +109,9 @@ pub fn clmulr_32(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.49
#[target_feature(enable = "zbkb")]
// See #1464
// #[cfg_attr(test, assert_instr(zip))]
#[cfg_attr(test, assert_instr(zip))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
pub fn zip_32(rs: u32) -> u32 {
unsafe { _zip_32(rs) }
}
Expand All @@ -131,7 +130,7 @@ pub fn zip_32(rs: u32) -> u32 {
#[target_feature(enable = "zbkb")]
#[cfg_attr(test, assert_instr(unzip))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
pub fn unzip_32(rs: u32) -> u32 {
unsafe { _unzip_32(rs) }
}
47 changes: 19 additions & 28 deletions crates/core_arch/src/riscv32/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ unsafe extern "llvm-intrinsic" {
/// used.
#[target_feature(enable = "zkne")]
#[rustc_legacy_const_generics(2)]
// See #1464
// #[cfg_attr(test, assert_instr(aes32esi, BS = 0))]
#[cfg_attr(test, assert_instr(aes32esi, BS = 0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes32esi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
static_assert!(BS < 4);

Expand All @@ -81,10 +80,9 @@ pub fn aes32esi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
/// used.
#[target_feature(enable = "zkne")]
#[rustc_legacy_const_generics(2)]
// See #1464
// #[cfg_attr(test, assert_instr(aes32esmi, BS = 0))]
#[cfg_attr(test, assert_instr(aes32esmi, BS = 0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes32esmi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
static_assert!(BS < 4);

Expand All @@ -109,10 +107,9 @@ pub fn aes32esmi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
/// used.
#[target_feature(enable = "zknd")]
#[rustc_legacy_const_generics(2)]
// See #1464
// #[cfg_attr(test, assert_instr(aes32dsi, BS = 0))]
#[cfg_attr(test, assert_instr(aes32dsi, BS = 0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes32dsi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
static_assert!(BS < 4);

Expand All @@ -138,10 +135,9 @@ pub fn aes32dsi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
/// used.
#[target_feature(enable = "zknd")]
#[rustc_legacy_const_generics(2)]
// See #1464
// #[cfg_attr(test, assert_instr(aes32dsmi, BS = 0))]
#[cfg_attr(test, assert_instr(aes32dsmi, BS = 0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes32dsmi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
static_assert!(BS < 4);

Expand All @@ -163,10 +159,9 @@ pub fn aes32dsmi<const BS: u8>(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.31
#[target_feature(enable = "zknh")]
// See #1464
// #[cfg_attr(test, assert_instr(sha512sig0h))]
#[cfg_attr(test, assert_instr(sha512sig0h))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig0h(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sig0h(rs1, rs2) }
}
Expand All @@ -186,10 +181,9 @@ pub fn sha512sig0h(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.32
#[target_feature(enable = "zknh")]
// See #1464
// #[cfg_attr(test, assert_instr(sha512sig0l))]
#[cfg_attr(test, assert_instr(sha512sig0l))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig0l(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sig0l(rs1, rs2) }
}
Expand All @@ -209,10 +203,9 @@ pub fn sha512sig0l(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.33
#[target_feature(enable = "zknh")]
// See #1464
// #[cfg_attr(test, assert_instr(sha512sig1h))]
#[cfg_attr(test, assert_instr(sha512sig1h))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig1h(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sig1h(rs1, rs2) }
}
Expand All @@ -234,7 +227,7 @@ pub fn sha512sig1h(rs1: u32, rs2: u32) -> u32 {
#[target_feature(enable = "zknh")]
#[cfg_attr(test, assert_instr(sha512sig1l))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig1l(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sig1l(rs1, rs2) }
}
Expand All @@ -253,10 +246,9 @@ pub fn sha512sig1l(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.35
#[target_feature(enable = "zknh")]
// See #1464
// #[cfg_attr(test, assert_instr(sha512sum0r))]
#[cfg_attr(test, assert_instr(sha512sum0r))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sum0r(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sum0r(rs1, rs2) }
}
Expand All @@ -275,10 +267,9 @@ pub fn sha512sum0r(rs1: u32, rs2: u32) -> u32 {
///
/// Section: 3.36
#[target_feature(enable = "zknh")]
// See #1464
// #[cfg_attr(test, assert_instr(sha512sum1r))]
#[cfg_attr(test, assert_instr(sha512sum1r))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sum1r(rs1: u32, rs2: u32) -> u32 {
unsafe { _sha512sum1r(rs1, rs2) }
}
4 changes: 2 additions & 2 deletions crates/core_arch/src/riscv64/mod.rs
Comment thread
TechnoPorg marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use crate::arch::asm;
mod zb;
mod zk;

#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
pub use zb::*;

#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub use zk::*;

/// Loads virtual machine memory by unsigned word integer
Expand Down
12 changes: 6 additions & 6 deletions crates/core_arch/src/riscv64/zb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ unsafe extern "llvm-intrinsic" {
/// Version: v1.0.1
///
/// Section: 3.47
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkx")]
#[cfg_attr(test, assert_instr(xperm8))]
#[inline]
Expand All @@ -53,7 +53,7 @@ pub fn xperm8_64(rs1: u64, rs2: u64) -> u64 {
/// Version: v1.0.1
///
/// Section: 3.48
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkx")]
#[cfg_attr(test, assert_instr(xperm4))]
#[inline]
Expand All @@ -72,7 +72,7 @@ pub fn xperm4_64(rs1: u64, rs2: u64) -> u64 {
/// Version: v1.0.0
///
/// Section: 2.24
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbb")]
#[cfg_attr(test, assert_instr(orc.b))]
#[inline]
Expand All @@ -89,7 +89,7 @@ pub fn orc_b_64(rs: u64) -> u64 {
/// Version: v1.0.0
///
/// Section: 2.11
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkc")]
#[cfg_attr(test, assert_instr(clmul))]
#[inline]
Expand All @@ -106,7 +106,7 @@ pub fn clmul_64(rs1: u64, rs2: u64) -> u64 {
/// Version: v1.0.0
///
/// Section: 2.12
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbkc")]
#[cfg_attr(test, assert_instr(clmulh))]
#[inline]
Expand All @@ -123,7 +123,7 @@ pub fn clmulh_64(rs1: u64, rs2: u64) -> u64 {
/// Version: v1.0.0
///
/// Section: 2.13
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zb", since = "CURRENT_RUSTC_VERSION")]
#[target_feature(enable = "zbc")]
#[cfg_attr(test, assert_instr(clmulr))]
#[inline]
Expand Down
22 changes: 11 additions & 11 deletions crates/core_arch/src/riscv64/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ unsafe extern "llvm-intrinsic" {
#[target_feature(enable = "zkne")]
#[cfg_attr(test, assert_instr(aes64es))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64es(rs1: u64, rs2: u64) -> u64 {
unsafe { _aes64es(rs1, rs2) }
}
Expand All @@ -67,7 +67,7 @@ pub fn aes64es(rs1: u64, rs2: u64) -> u64 {
#[target_feature(enable = "zkne")]
#[cfg_attr(test, assert_instr(aes64esm))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64esm(rs1: u64, rs2: u64) -> u64 {
unsafe { _aes64esm(rs1, rs2) }
}
Expand All @@ -87,7 +87,7 @@ pub fn aes64esm(rs1: u64, rs2: u64) -> u64 {
#[target_feature(enable = "zknd")]
#[cfg_attr(test, assert_instr(aes64ds))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64ds(rs1: u64, rs2: u64) -> u64 {
unsafe { _aes64ds(rs1, rs2) }
}
Expand All @@ -107,7 +107,7 @@ pub fn aes64ds(rs1: u64, rs2: u64) -> u64 {
#[target_feature(enable = "zknd")]
#[cfg_attr(test, assert_instr(aes64dsm))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64dsm(rs1: u64, rs2: u64) -> u64 {
unsafe { _aes64dsm(rs1, rs2) }
}
Expand All @@ -132,7 +132,7 @@ pub fn aes64dsm(rs1: u64, rs2: u64) -> u64 {
#[target_feature(enable = "zkne_or_zknd")]
#[rustc_legacy_const_generics(1)]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64ks1i<const RNUM: u8>(rs1: u64) -> u64 {
static_assert!(RNUM <= 10);
unsafe {
Expand Down Expand Up @@ -164,7 +164,7 @@ pub fn aes64ks1i<const RNUM: u8>(rs1: u64) -> u64 {
/// Section: 3.11
#[target_feature(enable = "zkne_or_zknd")]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64ks2(rs1: u64, rs2: u64) -> u64 {
unsafe {
let rd: u64;
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn aes64ks2(rs1: u64, rs2: u64) -> u64 {
#[target_feature(enable = "zknd")]
#[cfg_attr(test, assert_instr(aes64im))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn aes64im(rs1: u64) -> u64 {
unsafe { _aes64im(rs1) }
}
Expand All @@ -218,7 +218,7 @@ pub fn aes64im(rs1: u64) -> u64 {
#[target_feature(enable = "zknh")]
#[cfg_attr(test, assert_instr(sha512sig0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig0(rs1: u64) -> u64 {
unsafe { _sha512sig0(rs1) }
}
Expand All @@ -238,7 +238,7 @@ pub fn sha512sig0(rs1: u64) -> u64 {
#[target_feature(enable = "zknh")]
#[cfg_attr(test, assert_instr(sha512sig1))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sig1(rs1: u64) -> u64 {
unsafe { _sha512sig1(rs1) }
}
Expand All @@ -258,7 +258,7 @@ pub fn sha512sig1(rs1: u64) -> u64 {
#[target_feature(enable = "zknh")]
#[cfg_attr(test, assert_instr(sha512sum0))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sum0(rs1: u64) -> u64 {
unsafe { _sha512sum0(rs1) }
}
Expand All @@ -278,7 +278,7 @@ pub fn sha512sum0(rs1: u64) -> u64 {
#[target_feature(enable = "zknh")]
#[cfg_attr(test, assert_instr(sha512sum1))]
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
#[stable(feature = "stdarch_riscv_zk", since = "CURRENT_RUSTC_VERSION")]
pub fn sha512sum1(rs1: u64) -> u64 {
unsafe { _sha512sum1(rs1) }
}
Loading
Loading