]> granicus.if.org Git - libatomic_ops/commitdiff
Do not use LDREXD/STREXD for Clang3.2/arm (and earlier)
authorIvan Maidanski <ivmai@mail.ru>
Sat, 17 Aug 2013 11:05:36 +0000 (15:05 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 17 Aug 2013 11:06:45 +0000 (15:06 +0400)
* src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_LDREXD): Do not define
for pre-Clang3.3 (since it does not allocate register pairs for
LDREXD/STREXD instructions properly); add comment.

src/atomic_ops/sysdeps/gcc/arm.h

index 874ed0759dd959c0a9d1de5e73e895ad2a434e23..c19f6dabedbed012d86b11561b239c9913a2a0f8 100644 (file)
       /* DMB is present in ARMv6M and ARMv7+.   */
 #     define AO_ARM_HAVE_DMB
 #   endif
-#   if !defined(__thumb__) \
-       || (defined(__thumb2__) && !defined(__ARM_ARCH_7__) \
-           && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__))
+#   if (!defined(__thumb__) \
+        || (defined(__thumb2__) && !defined(__ARM_ARCH_7__) \
+            && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__))) \
+       && (!defined(__clang__) || (__clang_major__ > 3) \
+            || (__clang_major__ == 3 && __clang_minor__ >= 3))
       /* LDREXD/STREXD present in ARMv6K/M+ (see gas/config/tc-arm.c).  */
       /* In the Thumb mode, this works only starting from ARMv7 (except */
-      /* for the base and 'M' models).                                  */
+      /* for the base and 'M' models).  Clang3.2 (and earlier) does not */
+      /* allocate register pairs for LDREXD/STREXD properly (besides,   */
+      /* Clang3.1 does not support "%H<r>" operand specification).      */
 #     define AO_ARM_HAVE_LDREXD
 #   endif /* !thumb || ARMv7A || ARMv7R+ */
 # endif /* ARMv7+ */