summaryrefslogtreecommitdiff
path: root/lib/libcompiler_rt/atomic.c
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2017-12-26 20:59:46 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2017-12-26 20:59:46 +0000
commitd8478f94377c30b0c1fd017df878b0a40e2c6d45 (patch)
tree8f02c87bb22bffc9887e21546e1f485d544bc872 /lib/libcompiler_rt/atomic.c
parent0a06862e4c4f094c66df855ee85b0cdd097e0240 (diff)
Update to compiler-rt 5.0.1.
ok kettenis@
Diffstat (limited to 'lib/libcompiler_rt/atomic.c')
-rw-r--r--lib/libcompiler_rt/atomic.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libcompiler_rt/atomic.c b/lib/libcompiler_rt/atomic.c
index f1ddc3e0c52..ee35e342eda 100644
--- a/lib/libcompiler_rt/atomic.c
+++ b/lib/libcompiler_rt/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) {\