diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-27 01:46:24 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-27 01:46:24 +0000 |
commit | f8520559ce1be64c9f4f0abae7e5e1494341892d (patch) | |
tree | 21ecf640b46502eef371f7e6044679b014dfd8d7 /compiler-rt/lib/builtins/atomic.c | |
parent | 10e905c2e9e470f5f56cc717885c923db348dba4 (diff) | |
download | bcm5719-llvm-f8520559ce1be64c9f4f0abae7e5e1494341892d.tar.gz bcm5719-llvm-f8520559ce1be64c9f4f0abae7e5e1494341892d.zip |
Atomics library: provide operations for __int128 when it is available.
llvm-svn: 285265
Diffstat (limited to 'compiler-rt/lib/builtins/atomic.c')
-rw-r--r-- | compiler-rt/lib/builtins/atomic.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler-rt/lib/builtins/atomic.c b/compiler-rt/lib/builtins/atomic.c index f1ddc3e0c52..ee35e342eda 100644 --- a/compiler-rt/lib/builtins/atomic.c +++ b/compiler-rt/lib/builtins/atomic.c @@ -229,13 +229,20 @@ void __atomic_exchange_c(int size, void *ptr, void *val, void *old, int model) { // 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) {\ |