Skip to content

Commit 51f2b1e

Browse files
coastalwhiteAmanieu
authored andcommitted
Fix: #1464 for rv64 zb
1 parent 839c9ec commit 51f2b1e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

crates/core_arch/src/riscv_shared/zb.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ extern "unadjusted" {
4747
///
4848
/// This function is safe to use if the `zbb` target feature is present.
4949
#[target_feature(enable = "zbb")]
50-
// See #1464
51-
// #[cfg_attr(test, assert_instr(orc.b))]
50+
#[cfg_attr(test, assert_instr(orc.b))]
5251
#[inline]
5352
pub unsafe fn orc_b(rs: usize) -> usize {
5453
#[cfg(target_arch = "riscv32")]
@@ -76,8 +75,7 @@ pub unsafe fn orc_b(rs: usize) -> usize {
7675
///
7776
/// This function is safe to use if the `zbc` target feature is present.
7877
#[target_feature(enable = "zbc")]
79-
// See #1464
80-
// #[cfg_attr(test, assert_instr(clmul))]
78+
#[cfg_attr(test, assert_instr(clmul))]
8179
#[inline]
8280
pub unsafe fn clmul(rs1: usize, rs2: usize) -> usize {
8381
#[cfg(target_arch = "riscv32")]
@@ -105,8 +103,7 @@ pub unsafe fn clmul(rs1: usize, rs2: usize) -> usize {
105103
///
106104
/// This function is safe to use if the `zbc` target feature is present.
107105
#[target_feature(enable = "zbc")]
108-
// See #1464
109-
// #[cfg_attr(test, assert_instr(clmulh))]
106+
#[cfg_attr(test, assert_instr(clmulh))]
110107
#[inline]
111108
pub unsafe fn clmulh(rs1: usize, rs2: usize) -> usize {
112109
#[cfg(target_arch = "riscv32")]
@@ -134,8 +131,7 @@ pub unsafe fn clmulh(rs1: usize, rs2: usize) -> usize {
134131
///
135132
/// This function is safe to use if the `zbc` target feature is present.
136133
#[target_feature(enable = "zbc")]
137-
// See #1464
138-
// #[cfg_attr(test, assert_instr(clmulr))]
134+
#[cfg_attr(test, assert_instr(clmulr))]
139135
#[inline]
140136
pub unsafe fn clmulr(rs1: usize, rs2: usize) -> usize {
141137
#[cfg(target_arch = "riscv32")]

crates/stdarch-test/src/disassembly.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
8282
// Target features need to be enabled for LLVM objdump on Macos ARM64
8383
vec!["--mattr=+v8.6a,+crypto,+tme"]
8484
} else if cfg!(target_arch = "riscv64") {
85-
vec!["--mattr=+zk,+zks"]
85+
vec!["--mattr=+zk,+zks,+zbc,+zbb"]
8686
} else {
8787
vec![]
8888
};

0 commit comments

Comments
 (0)