From 025076f763405d3d2a9e05716b9b055ee8b52155 Mon Sep 17 00:00:00 2001 From: Aaron Kutch Date: Thu, 6 Jul 2023 01:51:47 -0500 Subject: [PATCH] Use the target_feature "zbb" instead of "b" for RISC-V --- library/compiler-builtins/src/int/specialized_div_rem/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/src/int/specialized_div_rem/mod.rs b/library/compiler-builtins/src/int/specialized_div_rem/mod.rs index 77034eb5476e..1ff1d19dc8c2 100644 --- a/library/compiler-builtins/src/int/specialized_div_rem/mod.rs +++ b/library/compiler-builtins/src/int/specialized_div_rem/mod.rs @@ -95,8 +95,9 @@ const USE_LZ: bool = { // LZD or LZCNT on SPARC only exists for the VIS 3 extension and later. cfg!(target_feature = "vis3") } else if cfg!(any(target_arch = "riscv32", target_arch = "riscv64")) { - // The `B` extension on RISC-V determines if a CLZ assembly instruction exists - cfg!(target_feature = "b") + // The 'Zbb' Basic Bit-Manipulation extension on RISC-V + // determines if a CLZ assembly instruction exists + cfg!(target_feature = "zbb") } else { // All other common targets Rust supports should have CLZ instructions true