]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add ARM implementation of CTZL for Visual C++.
authorMika Lindqvist <postmaster@raasu.org>
Sun, 30 Oct 2016 12:36:09 +0000 (14:36 +0200)
committerMika Lindqvist <postmaster@raasu.org>
Fri, 24 Mar 2017 21:55:58 +0000 (23:55 +0200)
arch/arm/ctzl.h [new file with mode: 0644]
match.c

diff --git a/arch/arm/ctzl.h b/arch/arm/ctzl.h
new file mode 100644 (file)
index 0000000..f27cb95
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef ARM_CTZL_H
+#define ARM_CTZL_H
+
+#include <armintr.h>
+
+#if defined(_MSC_VER) && !defined(__clang__)
+static __forceinline unsigned long __builtin_ctzl(unsigned long value)
+{
+       return _arm_clz(_arm_rbit(value));
+}
+#endif
+
+#endif
diff --git a/match.c b/match.c
index b731246c0031af5684f2839b2454f311422616d0..18874dfec22a1f9d4abc5a54c77b88568d27bf7a 100644 (file)
--- a/match.c
+++ b/match.c
@@ -31,6 +31,8 @@
 #if defined(_MSC_VER) && !defined(__clang__)
 # if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
 #  include "arch/x86/ctzl.h"
+# elif defined(_M_ARM)
+#  include "arch/arm/ctzl.h"
 # endif
 #endif