[compiler-rt] r285265 - Atomics library: provide operations for __int128 when it is available.

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 18:46:25 PDT 2016


Author: rsmith
Date: Wed Oct 26 20:46:24 2016
New Revision: 285265

URL: http://llvm.org/viewvc/llvm-project?rev=285265&view=rev
Log:
Atomics library: provide operations for __int128 when it is available.

Modified:
    compiler-rt/trunk/lib/builtins/atomic.c

Modified: compiler-rt/trunk/lib/builtins/atomic.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/atomic.c?rev=285265&r1=285264&r2=285265&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/atomic.c (original)
+++ compiler-rt/trunk/lib/builtins/atomic.c Wed Oct 26 20:46:24 2016
@@ -229,13 +229,20 @@ void __atomic_exchange_c(int size, void
 // Where the size is known at compile time, the compiler may emit calls to
 // specialised versions of the above functions.
 ////////////////////////////////////////////////////////////////////////////////
+#ifdef __SIZEOF_INT128__
 #define OPTIMISED_CASES\
   OPTIMISED_CASE(1, IS_LOCK_FREE_1, uint8_t)\
   OPTIMISED_CASE(2, IS_LOCK_FREE_2, uint16_t)\
   OPTIMISED_CASE(4, IS_LOCK_FREE_4, uint32_t)\
   OPTIMISED_CASE(8, IS_LOCK_FREE_8, uint64_t)\
-  /* FIXME: __uint128_t isn't available on 32 bit platforms.
-  OPTIMISED_CASE(16, IS_LOCK_FREE_16, __uint128_t)*/\
+  OPTIMISED_CASE(16, IS_LOCK_FREE_16, __uint128_t)
+#else
+#define OPTIMISED_CASES\
+  OPTIMISED_CASE(1, IS_LOCK_FREE_1, uint8_t)\
+  OPTIMISED_CASE(2, IS_LOCK_FREE_2, uint16_t)\
+  OPTIMISED_CASE(4, IS_LOCK_FREE_4, uint32_t)\
+  OPTIMISED_CASE(8, IS_LOCK_FREE_8, uint64_t)
+#endif
 
 #define OPTIMISED_CASE(n, lockfree, type)\
 type __atomic_load_##n(type *src, int model) {\




More information about the llvm-commits mailing list