diff options
author | Tim Northover <Tim.Northover@arm.com> | 2013-02-18 12:11:32 +0000 |
---|---|---|
committer | Tim Northover <Tim.Northover@arm.com> | 2013-02-18 12:11:32 +0000 |
commit | 6a93c86fc73d84a40d3460be04444669c8439e20 (patch) | |
tree | f11736e7e08b84d0045d907187302fb08d9a31d3 | |
parent | 66d19bdeef25611c9188b3f27b7d578df4b9a447 (diff) |
AArch64: add atomic support parameters to TargetInfo
This allows Clang to detect and deal wih __atomic_* operations properly on
AArch64. Previously we produced an error when encountering them at high
optimisation levels.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175438 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Basic/Targets.cpp | 4 | ||||
-rw-r--r-- | test/Sema/atomic-ops.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 6f8dfe9b65..eaf2e7d05e 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -3167,6 +3167,10 @@ public: WCharType = UnsignedInt; LongDoubleFormat = &llvm::APFloat::IEEEquad; + // AArch64 backend supports 64-bit operations at the moment. In principle + // 128-bit is possible if register-pairs are used. + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; + TheCXXABI.set(TargetCXXABI::GenericAArch64); } virtual void getTargetDefines(const LangOptions &Opts, diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c index 2a935918ac..a33ff2b19c 100644 --- a/test/Sema/atomic-ops.c +++ b/test/Sema/atomic-ops.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -verify -fsyntax-only -triple=i686-linux-gnu -std=c11 +// RUN: %clang_cc1 %s -verify -fsyntax-only -triple=aarch64-linux-gnu -std=c11 // Basic parsing/Sema tests for __c11_atomic_* @@ -17,7 +18,11 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, ""); _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, ""); _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, ""); _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, ""); +#ifdef __i386__ _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, ""); +#else +_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, ""); +#endif _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, ""); _Static_assert(__c11_atomic_is_lock_free(1), ""); |