aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2022-09-12 18:53:18 +0300
committerJames Almer <jamrial@gmail.com>2022-09-13 16:50:43 -0300
commitff14e3739393147b4596245ea511ec43a4ce6448 (patch)
treee063dea56357c48cff0cdca2aff86dd9e4e0077f /configure
parentd808070547a867a8f3f7b97fdff3574576213c07 (diff)
downloadffmpeg-ff14e3739393147b4596245ea511ec43a4ce6448.tar.gz
configure/riscv: detect fast CLZ
RISC-V defines the CLZ instruction as part of the ratified Zbb subset of the (not yet ratified) bit mapulation extension (B). We can detect it from the __riscv_zbb predefined constant. At least GCC 12 already supports this correctly. Note that the macro will be non-zero if supported, zero if enabled in the compiler flags (e.g. -march=rv64gzbb) but not known to the compiler, and undefined otherwise.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure b/configure
index 9e51abd0d3..b7dc1d8656 100755
--- a/configure
+++ b/configure
@@ -5334,6 +5334,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