[PATCH 3/6] bithelp: fix __riscv_zbb check for _gcry_ctz_no_zero

Jussi Kivilinna <[email protected]> Thu, 7 Aug 2025 16:28:52 +0300
Newsgroups gmane.comp.encryption.gpg.libgcrypt.devel
Message-ID <[email protected]>
* cipher/bithelp.h (_gcry_ctz_no_zero): Fix __riscv_zbb version check.
--

Signed-off-by: Jussi Kivilinna <[email protected]>
---
 cipher/bithelp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/bithelp.h b/cipher/bithelp.h
index a4faf345..50731650 100644
--- a/cipher/bithelp.h
+++ b/cipher/bithelp.h
@@ -84,7 +84,7 @@ _gcry_ctz_no_zero (unsigned int x)
 {
 #if defined(__riscv) && \
     (defined(__riscv_f) && __riscv_f >= 2002000) && \
-    (!defined(__riscv_zbb) || __riscv_zbb < 2002000) && \
+    (!defined(__riscv_zbb) || __riscv_zbb < 1000000) && \
     defined(HAVE_GCC_ATTRIBUTE_MAY_ALIAS)
   /* Use float cast approach when building for RISC-V without Zbb extension.
    * Without Zbb, GCC gives us slower generic version for __builtin_ctz().
-- 
2.48.1