summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-01-15 10:04:43 +0100
committerWerner Koch <wk@gnupg.org>2015-01-15 10:37:53 +0100
commit9d2a22c94ae99f9301321082c4fb8d73f4085fda (patch)
treebd06e3f0b580cf0676e4eca798620414f61e1240 /configure.ac
parent27a91a93d101ef080f71e5d7e50c3cbf3dbb2e39 (diff)
downloadlibgcrypt-9d2a22c94ae99f9301321082c4fb8d73f4085fda.tar.gz
Add functions to count trailing zero bits in a word.
* cipher/bithelp.h (_gcry_ctz, _gcry_ctz64): New. * configure.ac (HAVE_BUILTIN_CTZ): Add new test. -- Note that these functions return the number of bits in the word when passing 0. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4cfebe7b..4bbd686c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,6 +827,21 @@ fi
#
+# Check for __builtin_ctz intrinsic.
+#
+AC_CACHE_CHECK(for __builtin_ctz,
+ [gcry_cv_have_builtin_ctz],
+ [gcry_cv_have_builtin_ctz=no
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+ [unsigned int x = 0; int y = __builtin_ctz(x); return y;])],
+ [gcry_cv_have_builtin_ctz=yes])])
+if test "$gcry_cv_have_builtin_ctz" = "yes" ; then
+ AC_DEFINE(HAVE_BUILTIN_CTZ, 1,
+ [Defined if compiler has '__builtin_ctz' intrinsic])
+fi
+
+
+#
# Check for VLA support (variable length arrays).
#
AC_CACHE_CHECK(whether the variable length arrays are supported,