[compiler-rt] r199998 - Implement __ARM_ARCH if the compiler lacks it. Add feature tests for bx and clz.
Joerg Sonnenberger
joerg at bec.de
Fri Jan 24 05:39:51 PST 2014
Author: joerg
Date: Fri Jan 24 07:39:51 2014
New Revision: 199998
URL: http://llvm.org/viewvc/llvm-project?rev=199998&view=rev
Log:
Implement __ARM_ARCH if the compiler lacks it. Add feature tests for bx and clz.
Modified:
compiler-rt/trunk/lib/assembly.h
Modified: compiler-rt/trunk/lib/assembly.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/assembly.h?rev=199998&r1=199997&r2=199998&view=diff
==============================================================================
--- compiler-rt/trunk/lib/assembly.h (original)
+++ compiler-rt/trunk/lib/assembly.h Fri Jan 24 07:39:51 2014
@@ -38,6 +38,44 @@
# endif
#endif
+#if defined(__arm__)
+# ifndef __ARM_ARCH
+# if defined (__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) || \
+ defined (__ARM_ARCH_7R__) || defined (__ARM_ARCH_7M__) || \
+ defined (__ARM_ARCH_7EM__)
+# define __ARM_ARCH 7
+# endif
+# endif
+
+# ifndef __ARM_ARCH
+# if defined (__ARM_ARCH_6__) || \
+ defined (__ARM_ARCH_6J__) || defined (__ARM_ARCH_6K__) || \
+ defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__) || \
+ defined (__ARM_ARCH_6ZM__)
+# define __ARM_ARCH 6
+# endif
+# endif
+
+# ifndef __ARM_ARCH
+# if defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5T__) || \
+ defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
+# define __ARM_ARCH 5
+# endif
+# endif
+
+# ifndef __ARM_ARCH
+# define __ARM_ARCH 4
+# endif
+
+# if defined(__ARM_ARCH_4T__) || __ARM_ARCH >= 5
+# define ARM_HAS_BX
+# endif
+# if !defined(__ARM_FEATURE_CLZ) && \
+ (__ARM_ARCH >= 6 || (__ARM_ARCH == 5 && !defined(__ARM_ARCH_5__)))
+# define __ARM_FEATURE_CLZ
+# endif
+#endif
+
#define GLUE2(a, b) a ## b
#define GLUE(a, b) GLUE2(a, b)
#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
More information about the llvm-commits
mailing list