Skip to content

Commit afa57f9

Browse files
committed
RISC-V: Lower requirements of clmul and clmulh
They don't need full "Zbc" extension but only its subset: the "Zbkc" extension. Since the compiler implies `zbkc` from `zbc`, it's safe to use `target_feature = "zbkc"`.
1 parent bfc1839 commit afa57f9

File tree

1 file changed

+2
-2
lines changed
  • crates/core_arch/src/riscv_shared

1 file changed

+2
-2
lines changed

crates/core_arch/src/riscv_shared/zb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub fn orc_b(rs: usize) -> usize {
6868
///
6969
/// Section: 2.11
7070
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
71-
#[target_feature(enable = "zbc")]
71+
#[target_feature(enable = "zbkc")]
7272
#[cfg_attr(test, assert_instr(clmul))]
7373
#[inline]
7474
pub fn clmul(rs1: usize, rs2: usize) -> usize {
@@ -93,7 +93,7 @@ pub fn clmul(rs1: usize, rs2: usize) -> usize {
9393
///
9494
/// Section: 2.12
9595
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
96-
#[target_feature(enable = "zbc")]
96+
#[target_feature(enable = "zbkc")]
9797
#[cfg_attr(test, assert_instr(clmulh))]
9898
#[inline]
9999
pub fn clmulh(rs1: usize, rs2: usize) -> usize {

0 commit comments

Comments
 (0)