diff mbox series

[FFmpeg-devel] riscv: detect fast CLZ from Zbb extension

Message ID 20220903123559.78526-1-remi@remlab.net
State New
Headers show
Series [FFmpeg-devel] riscv: detect fast CLZ from Zbb extension | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Rémi Denis-Courmont Sept. 3, 2022, 12:35 p.m. UTC
From: Rémi Denis-Courmont <remi@remlab.net>

RISC-V defines the CLZ instruction as part of the Zbb subset of the
bit mapulation extension (B). We can detect it from the __riscv_zbb
predefined constant. It will be non-zero if supported, zero if enabled
in the compiler flags but not supported by the compiler, and undefined
otherwise.
---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/configure b/configure
index 932ea5b553..b54ff5fc44 100755
--- a/configure
+++ b/configure
@@ -5331,6 +5331,12 @@  elif enabled ppc; then
         ;;
     esac
 
+elif enabled riscv; then
+
+    if test_cpp_condition stddef.h "__riscv_zbb"; then
+        enable fast_clz
+    fi
+
 elif enabled sparc; then
 
     case $cpu in