Move ARMv6 detection to configure.ac
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 17 Aug 2013 10:41:46 +0000 (13:41 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 20 Aug 2013 09:33:32 +0000 (12:33 +0300)
* cipher/blowfish-armv6.S: Replace __ARM_ARCH >= 6 checks with
HAVE_ARM_ARCH_V6.
* cipher/blowfish.c: Ditto.
* cipher/camellia-armv6.S: Ditto.
* cipher/camellia.h: Ditto.
* cipher/cast5-armv6.S: Ditto.
* cipher/cast5.c: Ditto.
* cipher/rijndael-armv6.S: Ditto.
* cipher/rijndael.c: Ditto.
* configure.ac: Add HAVE_ARM_ARCH_V6 check.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/blowfish-armv6.S
cipher/blowfish.c
cipher/camellia-armv6.S
cipher/camellia.h
cipher/cast5-armv6.S
cipher/cast5.c
cipher/rijndael-armv6.S
cipher/rijndael.c
configure.ac

index b11d27f..eea879f 100644 (file)
 
 #include <config.h>
 
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 
 .text
index fe4e280..2806433 100644 (file)
 
 /* USE_ARMV6_ASM indicates whether to use ARMv6 assembly code. */
 #undef USE_ARMV6_ASM
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 # if (BLOWFISH_ROUNDS == 16) && defined(HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS)
 #  define USE_ARMV6_ASM 1
 # endif
index 769db02..3544754 100644 (file)
 
 #include <config.h>
 
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 
 .text
index 48f9160..72f2d1f 100644 (file)
 #include <config.h>
 /* USE_ARMV6_ASM indicates whether to use ARMv6 assembly code. */
 # undef USE_ARMV6_ASM
-# if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+# if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 #  ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 #   define USE_ARMV6_ASM 1
 #  endif
index e4b2339..038fc4f 100644 (file)
 
 #include <config.h>
 
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 
 .text
index 9e7b50f..4377c28 100644 (file)
 
 /* USE_ARMV6_ASM indicates whether to use ARMv6 assembly code. */
 #undef USE_ARMV6_ASM
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 # ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 #  define USE_ARMV6_ASM 1
 # endif
index e778a94..bbbfb0e 100644 (file)
 
 #include <config.h>
 
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 
 .text
index 8855e0c..314f106 100644 (file)
 
 /* USE_ARMV6_ASM indicates whether to use ARMv6 assembly code. */
 #undef USE_ARMV6_ASM
-#if defined(__arm__) && defined(__ARMEL__) && \
-        ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
-       || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
-       || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
-       || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
-       || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
-       || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
-       || defined(__ARM_ARCH_7EM__))
+#if defined(HAVE_ARM_ARCH_V6) && defined(__ARMEL__)
 # ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
 #  define USE_ARMV6_ASM 1
 # endif
index c33f36b..f20d0a1 100644 (file)
@@ -965,6 +965,29 @@ fi
 
 
 #
+# Check whether compiler is configured for ARMv6 or newer architecture
+#
+AC_CACHE_CHECK([whether compiler is configured for ARMv6 or newer architecture],
+       [gcry_cv_cc_arm_arch_is_v6],
+       [AC_EGREP_CPP(yes,
+          [#if defined(__arm__) && \
+             ((defined(__ARM_ARCH) && __ARM_ARCH >= 6) \
+             || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+             || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
+             || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
+             || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+             || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+             || defined(__ARM_ARCH_7EM__))
+            yes
+           #endif
+          ], gcry_cv_cc_arm_arch_is_v6=yes, gcry_cv_cc_arm_arch_is_v6=no)])
+if test "$gcry_cv_cc_arm_arch_is_v6" = "yes" ; then
+   AC_DEFINE(HAVE_ARM_ARCH_V6,1,
+     [Defined if ARM architecture is v6 or newer])
+fi
+
+
+#
 # Check whether GCC assembler supports features needed for our ARM
 # implementations
 #